@pisell/private-materials 6.11.663 → 6.11.664
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +2 -2
- package/build/lowcode/view.js +2 -2
- package/es/plus/pisellSaleSummaryDetail/index.js +1 -1
- package/es/plus/pisellSalesManagement/hooks/useBookingPerspective.js +2 -1
- package/es/plus/pisellSalesManagement/hooks/useOrderPerspective.js +3 -1
- package/es/plus/saleDetail/components/SummaryFinancialSections/index.js +1 -1
- package/es/plus/saleDetail/tmpl/B/components/Pay/index.js +1 -1
- package/es/plus/{saleDetail → salesSdk}/utils/paymentStatus.js +1 -1
- package/lib/plus/pisellSaleSummaryDetail/index.js +1 -1
- package/lib/plus/pisellSalesManagement/hooks/useBookingPerspective.js +2 -1
- package/lib/plus/pisellSalesManagement/hooks/useOrderPerspective.js +3 -1
- package/lib/plus/saleDetail/components/SummaryFinancialSections/index.js +1 -1
- package/lib/plus/saleDetail/tmpl/B/components/Pay/index.js +1 -1
- package/lib/plus/{saleDetail → salesSdk}/utils/paymentStatus.js +1 -1
- package/package.json +3 -3
package/build/lowcode/view.js
CHANGED
|
@@ -107,8 +107,8 @@ ${String((null==e?void 0:e.message)??e)}`})}};return(0,ev.jsxs)("section",{class
|
|
|
107
107
|
操作を確認すると、元に戻せません。
|
|
108
108
|
`),`選択した注文には${e>0?`${e}件の未完了注文、`:""}${t>0?`${t}件の完了注文、`:""}${l>0?`${l}件のキャンセル注文が含まれています。`:""}${s}`},"page.order.cancel.title":(e,t)=>`注文を${e}ステータスに変更してもよろしいですか?`,"page.order.void":"注文を無効化","page.order.completeds":"注文を完了","page.order.cancelleds":"注文をキャンセル"},pt:{"pisell2.orderList.title":"Lista de Pedidos","pisell2.orderList.column.orderNumber":"N\xfamero do Pedido","pisell2.orderList.column.customerInfo":"Informa\xe7\xf5es do Cliente","pisell2.orderList.column.contactInfo":"Informa\xe7\xf5es de Contato","pisell2.orderList.column.tags":"Tags","pisell2.orderList.column.deliveryMethod":"M\xe9todo de Entrega","pisell2.orderList.column.paymentInfo":"Informa\xe7\xf5es de Pagamento","pisell2.orderList.column.orderChannel":"Canal do Pedido","pisell2.orderList.column.productQuantity":"Quantidade de Produtos","pisell2.orderList.column.device":"Dispositivo","pisell2.orderList.column.business":"Neg\xf3cio","pisell2.orderList.column.orderStatus":"Status do Pedido","pisell2.orderList.column.processStatus":"Status do Processamento","pisell2.orderList.column.createInfo":"Informa\xe7\xf5es de Cria\xe7\xe3o","pisell2.orderList.column.moreInfo":"Mais Informa\xe7\xf5es","pisell2.orderList.deliveryType.nil":"Sem Entrega Necess\xe1ria","pisell2.orderList.deliveryType.shipping":"Envio","pisell2.orderList.deliveryType.local_delivery":"Entrega Local","pisell2.orderList.deliveryType.pickup":"Retirada","pisell2.orderList.deliveryType.shop_service":"Servi\xe7o na Loja","pisell2.orderList.shopServiceType.dine-in":"Refei\xe7\xe3o no Local","pisell2.orderList.shopServiceType.takeaway":"Para Viagem","pisell2.orderList.platform.online_store":"Loja Online","pisell2.orderList.platform.wholesalebusiness":"Neg\xf3cio Atacadista","pisell2.orderList.platform.table-order":"Pedido na Mesa","pisell2.orderList.platform.mobile_order":"Pedido M\xf3vel","pisell2.orderList.platform.kiosk":"Quiosque","pisell2.orderList.platform.pos":"POS","pisell2.orderList.orderStatus.open":"Aberto","pisell2.orderList.orderStatus.completed":"Conclu\xeddo","pisell2.orderList.orderStatus.cancelled":"Cancelado","pisell2.orderList.shippingStatus.falseulfilled":"Atendido","pisell2.orderList.shippingStatus.unfulfilled":"N\xe3o Atendido","pisell2.orderList.shippingStatus.fulfilling":"Atendendo","pisell2.orderList.shippingStatus.partial_fulfilled":"Parcialmente Atendido","pisell2.orderList.paymentStatus.authorized":"Autorizado","pisell2.orderList.paymentStatus.paid":"Pago","pisell2.orderList.paymentStatus.partially_paid":"Parcialmente Pago","pisell2.orderList.paymentStatus.partially_refunded":"Parcialmente Reembolsado","pisell2.orderList.paymentStatus.payment_pending":"Pagamento Pendente","pisell2.orderList.paymentStatus.refunded":"Reembolsado","pisell2.orderList.paymentStatus.unpaid":"N\xe3o Pago","pisell2.orderList.paymentStatus.voided":"Anulado","pisell2.orderList.paymentStatus.payment_processing":"Processando Pagamento","pisell2.orderList.common.note":"Nota","pisell2.orderList.common.itemsCount":" itens","pisell2.orderList.common.totalAmount":"Total","pisell2.orderList.common.paidAmount":"Pago","pisell2.orderList.common.dueAmount":"Devido","pisell2.orderList.common.refundedAmount":"Reembolsado","pisell2.orderList.common.unpaidAmount":"N\xe3o Pago","pisell2.orderList.common.reset":"Redefinir","pisell2.orderList.common.guest":"Convidado","pisell2.orderList.quickFilter.keyword.placeholder":"Pesquisar pedidos","pisell2.orderList.quickFilter.orderDate.label":"Data do Pedido","pisell2.orderList.quickFilter.orderDate.placeholder":"Por favor, selecione a data do pedido","pisell2.orderList.filter.orderStatus.label":"Status do Pedido","pisell2.orderList.filter.orderStatus.placeholder":"Por favor, selecione o status do pedido","pisell2.orderList.filter.paymentStatus.label":"Status do Pagamento","pisell2.orderList.filter.paymentStatus.placeholder":"Por favor, selecione o status do pagamento","pisell2.orderList.filter.shippingStatus.label":"Status do Envio","pisell2.orderList.filter.shippingStatus.placeholder":"Por favor, selecione o status do envio","pisell2.orderList.filter.customer.label":"Cliente","pisell2.orderList.filter.customer.placeholder":"Por favor, selecione o cliente","pisell2.orderList.filter.salesChannel.label":"Canal de Vendas","pisell2.orderList.filter.salesChannel.placeholder":"Por favor, selecione o canal de vendas","pisell2.orderList.filter.paymentMethod.label":"M\xe9todo de Pagamento","pisell2.orderList.filter.paymentMethod.placeholder":"Por favor, selecione o m\xe9todo de pagamento","pisell2.orderList.filter.totalAmount.label":"Faixa de Valor do Pedido","pisell2.orderList.filter.totalAmount.placeholder":"Por favor, insira","pisell2.orderList.filter.tags.label":"Tags","pisell2.orderList.filter.tags.placeholder":"Por favor, selecione as tags","pisell2.orderList.filter.shippingType.label":"Tipo de Envio","pisell2.orderList.filter.shippingType.placeholder":"Por favor, selecione o tipo de envio","pisell2.orderList.filter.deliveryZone.label":"Zona de Entrega","pisell2.orderList.filter.deliveryZone.placeholder":"Por favor, selecione a zona de entrega","pisell2.orderList.filter.pickupLocation.label":"Local de Retirada","pisell2.orderList.filter.pickupLocation.placeholder":"Por favor, selecione o local de retirada","pisell2.orderList.filter.trackingNumber.label":"N\xfamero de Rastreamento","pisell2.orderList.filter.trackingNumber.placeholder":"Por favor, insira o n\xfamero de rastreamento","pisell2.orderList.filter.logistics.label":"Empresa de Log\xedstica","pisell2.orderList.filter.logistics.placeholder":"Por favor, selecione a empresa de log\xedstica","pisell2.orderList.filter.zipCode.label":"CEP","pisell2.orderList.filter.zipCode.placeholder":"Por favor, insira o CEP","pisell2.orderList.sort.orderNumber":"N\xfamero do Pedido","pisell2.orderList.sort.createdAt":"Hora de Cria\xe7\xe3o","pisell2.orderList.sort.updatedAt":"Hora de Atualiza\xe7\xe3o","pisell2.orderList.sort.customerName":"Nome do Cliente","pisell2.orderList.sort.paymentStatus":"Status do Pagamento","pisell2.orderList.sort.shippingStatus":"Status do Envio","pisell2.orderList.sort.totalAmount":"Valor do Pedido","pisell2.orderList.sort.deliveryStartAt":"Hora do Agendamento","pisell2.orderList.filterButton.todayOrders":"Pedidos de Hoje","pisell2.orderList.filterButton.todayPending":"Pagamentos Pendentes de Hoje","pisell2.orderList.filterButton.todayRefunds":"Reembolsos de Hoje","pisell2.orderList.filterButton.last7Days":"\xdaltimos 7 Dias","page.order.table.shipping_status.mark.fulfilled":"Marcar como Atendido","page.order.table.sale.confirmdeliver.content":"Os pedidos selecionados ser\xe3o marcados como 'Atendidos'","page.order.fa.check":"Enviar a notifica\xe7\xe3o de atendimento ao seu cliente agora.","pisell2.orderList.batchAction.ship.title":e=>`Processar (${e} pedidos)`,"pisell2.orderList.batchAction.ship.content":'Os pedidos selecionados ser\xe3o marcados como "Atendidos"',"pisell2.orderList.batchAction.addTags.title":e=>`Adicionar tags a ${e} pedidos`,"pisell2.orderList.batchAction.removeTags.title":e=>`Remover tags de ${e} pedidos`,"pisell2.orderList.batchAction.button.cancel":"Cancelar","pisell2.orderList.batchAction.button.back":"Voltar","pisell2.orderList.batchAction.button.ok":"OK","pisell2.orderList.batchAction.button.onlyCancel":"Apenas Cancelar","pisell2.orderList.batchAction.button.cancelAndVoid":"Cancelar e Anular","pisell2.orderList.batchAction.void.title":"Tem certeza de que deseja anular os pedidos selecionados?","page.order.table.list.button.send.invoice":"Enviar fatura","page.order.table.list.button.send.invoice.tip":"Tem certeza de que deseja enviar a fatura?","page.order.table.list.button.send.invoice.success":"Fatura enviada com sucesso","page.order.table.list.printpack":"Imprimir Etiquetas de Embalagem","page.order.table.list.printpink":"Imprimir Lista de Coleta","page.order.text.addtags.button":"Adicionar tags","page.order.table.list.deletetag":"Remover tags","page.order.open":"Abrir este pedido","page.order.lists.cancel.content":(e,t,l,a,i,n)=>{let s=`Tem certeza de que deseja alterar em lote os pedidos para o status ${a}? Modificar o status do pedido n\xe3o altera o status do pagamento${!i?" e do atendimento":""}.`;return"void"===n&&(s=`Tem certeza de que deseja alterar o status do pedido para cancelado e anular o pedido?
|
|
109
109
|
Ap\xf3s confirmar a opera\xe7\xe3o, n\xe3o poder\xe1 ser desfeita.
|
|
110
|
-
`),`Os pedidos que voc\xea selecionou cont\xeam ${e>0?`${e} ${e>1?"pedidos":"pedido"} aberto${e>1?"s":""}, `:""}${t>0?`${t} ${t>1?"pedidos":"pedido"} conclu\xeddo${t>1?"s":""}, `:""}${l>0?`e ${l} ${l>1?"pedidos":"pedido"} cancelado${l>1?"s":""}.`:""}${s}`},"page.order.cancel.title":(e,t)=>`Tem certeza de alterar o ${t>1?"pedidos":"pedido"} para o status ${e}?`,"page.order.void":"Anular pedidos","page.order.completeds":"Completar pedidos","page.order.cancelleds":"Cancelar pedidos"}};function eVZ(e){return"monitor"===e?{filter:{values:{order_payment_status:eVO,booking_time_start_between:[em()().startOf("day"),em()().endOf("day")]}}}:{filter:{values:{payment_status:eVO,orderDate:[em()(),em()()]}},sort:"created_at:desc"}}let eVX="pisell_sales_grid_search_params_",eV0=ey().forwardRef((e,t)=>(0,ev.jsx)(ex.Select,{...e,ref:t,showSearch:!1}));eV0.Option=ex.Select.Option;let eV2={selectComponentClass:eV0,showSizeChanger:!0,pageSizeOptions:["10","20","50","100"]},eV1=e=>{var t,l,a,i,n,s,r,o,d,c,u,p,m;let{perspectives:g,currentPerspective:h,className:v,style:f,extParams:y,__id:x,data:b,loading:_,total:k,pagination:w,onPageChange:j,searchParams:S,onSearch:M,onReset:N,selectedKeys:C,selectedRows:T,onSelectionChange:P,rowKey:A,onRefresh:D,refreshAsync:I,columnRenderers:E,enableScanner:z}=e,L=ik(),O=(null==L||null==(t=L.appHelper)?void 0:t.utils)||{};eN.init(eVJ,(null==L||null==(a=L.engine)||null==(l=a.props)?void 0:l.locale)||"en"),z_.Em.setRequest(null==O?void 0:O.request);let R=void 0!==b,[$,F]=(0,ef.useState)([]),[B,H]=(0,ef.useState)([]),[q,V]=(0,ef.useState)({pageNumber:1,pageSize:20}),[Y,U]=(0,ef.useState)(()=>{let e=eVZ(h);if(x){let t=function(e){try{let t=sessionStorage.getItem(`${eVX}${e}`);if(t){let e=JSON.parse(t,(e,t)=>t&&"object"==typeof t&&t.__isDayjs?em()(t.value):t);if(e&&"object"==typeof e){let{filter:t,...l}=e;return l}return e}}catch(e){console.warn("Failed to get stored search params:",e)}return null}(x);if(t)return{...e,...t}}return e}),[W,G]=(0,ef.useState)(null),Q=(0,ef.useCallback)((e,t)=>{F(e),H(t)},[]),K=(0,ef.useCallback)((e,t)=>{e<1||t<1||V({pageNumber:e,pageSize:t})},[]),J=(0,ef.useCallback)(e=>{U(e||{}),V(e=>({...e,pageNumber:1}))},[]),Z=(0,ef.useCallback)(()=>{U(eVZ(h)),V(e=>({...e,pageNumber:1}))},[h]);(0,ef.useEffect)(()=>{x&&function(e,t){try{var l;let a;{let{filter:e,...l}=t;a=l}sessionStorage.setItem(`${eVX}${e}`,(l=a,JSON.stringify(l,(e,t)=>em().isDayjs(t)?{__isDayjs:!0,value:t.toISOString()}:t)))}catch(e){console.warn("Failed to save search params:",e)}}(x,Y)},[x,Y]),(0,ef.useEffect)(()=>{document.body.id="body"},[]);let X=rP(eVV,{manual:!0}),ee=rP(eVH,{manual:!0}),et=(0,ef.useMemo)(()=>{let{keyword:e,filter:t,sort:l}=Y;return{keyword:e,sort:l,...(null==t?void 0:t.values)||{},skip:q.pageNumber,num:q.pageSize}},[Y,q.pageNumber,q.pageSize]),el=eVx({onRefresh:(0,ef.useCallback)(e=>{D?D(e):"monitor"===h?X.run({...et,...(null==y?void 0:y.list)||{}}):ee.run({...et,...(null==y?void 0:y.list)||{}})},[h,et,X,ee,D]),onClearSelection:(0,ef.useCallback)(()=>{F([]),H([]),null==P||P([],[])},[P])}),ea="phone"===eVb(void 0),ei=(0,ef.useMemo)(()=>R&&w?w:q,[R,w,q]),en=(0,ef.useMemo)(()=>R&&void 0!==S?S:Y,[R,S,Y]),es=(0,ef.useMemo)(()=>{var e,t;return R?b??[]:"monitor"===h?(null==(e=X.data)?void 0:e.list)||[]:(null==(t=ee.data)?void 0:t.list)||[]},[R,b,h,null==(i=X.data)?void 0:i.list,null==(n=ee.data)?void 0:n.list]),er=eV_({enabled:ea,isInternalListData:!0,rowKey:A??"id",data:es,pagination:ei,searchParams:en}),eo=ea?er:es,ed=R?_??!1:"monitor"===h?X.loading:ee.loading,ec=R?k:"monitor"===h?null==(s=X.data)?void 0:s.count:null==(r=ee.data)?void 0:r.count,eu=(0,ef.useMemo)(()=>({actions:el}),[el]);(0,ef.useEffect)(()=>{R||("monitor"===h?X.run({...et,...(null==y?void 0:y.list)||{}}):ee.run({...et,...(null==y?void 0:y.list)||{}}))},[R,h,et,null==y?void 0:y.list,X,ee]);let ep=(0,ef.useMemo)(()=>R&&D?{refresh:D,refreshAsync:I??(()=>Promise.resolve()),currentPerspective:h}:{refresh:"monitor"===h?()=>X.run({...et,...(null==y?void 0:y.list)||{}}):()=>ee.run({...et,...(null==y?void 0:y.list)||{}}),refreshAsync:"monitor"===h?()=>X.runAsync({...et,...(null==y?void 0:y.list)||{}}):()=>ee.runAsync({...et,...(null==y?void 0:y.list)||{}}),currentPerspective:h},[R,D,I,h,X,ee,et,y]),eg=(0,ef.useMemo)(()=>{let e,t=(e=g.find(e=>e.key===h))||(g.length>0?g[0]:void 0);if(t)return"function"==typeof t.getChildComponentProps?{...t,childComponentProps:t.getChildComponentProps(ep)}:t},[g,h,ep]),eh=(0,ef.useMemo)(()=>{var e,t,l,a,i;let n=function(e,t){if(!(null==t?void 0:t.length)||!Array.isArray(e.columns))return e;let l=new Map(t.map(e=>[e.type,e.render]));return{...e,columns:e.columns.map(e=>{let t=null==e?void 0:e.type;if(null!=t&&l.has(t)){let a=l.get(t);return{...e,render:(e,t,l)=>a(e,t,l)}}return e})}}((null==eg||null==(e=eg.childComponentProps)?void 0:e.grid)??{},E),s=null!=n.scroll&&"object"==typeof n.scroll?{...n.scroll}:{},r=R&&void 0!==C?C:$,o=R&&void 0!==T?T:B,d=R&&P?P:Q,c=ea?function(e){let t=e&&"object"==typeof e?{...e}:{},{x:l,...a}=t;return{...a,autoCalc:t.autoCalc??!0}}(s):void 0,u=ea?{size:"small",tableLayout:"fixed",infiniteScroll:!1!==n.infiniteScroll,scroll:c,rowSelection:(t=n.rowSelection)&&"object"==typeof t?{...t,fixed:!1}:t,className:(l="string"==typeof n.className?n.className:void 0,t_()(l,"pisell-sales-grid-mobile-table-grid")),columns:Array.isArray(a=n.columns)?a.map(e=>(function(e){var t,l;let a,i=String(e.key??e.dataIndex??"");if(!i)return e;let n=(t=e.width,null!=eVW[i]?eVW[i]:null!=eVG[i]?eVG[i]:"number"==typeof t&&t>0?Math.max(64,Math.round(.72*t)):void 0);if(null==n)return e;let s=[`pisell-sales-grid-mobile-table-col--${i.replace(/_/g,"-")}`];eVQ.has(i)&&s.push("pisell-sales-grid-mobile-table-col--stack"),eVK.has(i)&&s.push("pisell-sales-grid-mobile-table-col--tag");let r=!eVQ.has(i)&&!eVK.has(i);return l={...e,width:n,ellipsis:r},a=t_()("string"==typeof l.className?l.className:void 0,...s),{...l,className:a,onCell:()=>({className:a})}})(e)):a}:{};return{...i={...n,...u,selectedKeys:r,selectedRows:o,onSelectionChange:d},infiniteScroll:!1!==i.infiniteScroll}},[eg,R,C,T,P,$,B,Q,E,ea]),ey=(0,ef.useMemo)(()=>{var e;let t=null==eg||null==(e=eg.childComponentProps)?void 0:e.toolBar,l=e=>{if(!1===e)return!1;let t="object"==typeof e&&null!==e?e:{},l="function"==typeof t.onScan?t.onScan:void 0,a="function"==typeof t.onScannerData?t.onScannerData:void 0,i="function"==typeof t.inputRender?t.inputRender:void 0,n="boolean"==typeof z?z:t.enableScanner;return{searchDebounce:300,...t,enableScanner:n,onScan:e=>{G({keyword:e,hasRequested:!1}),null==l||l(e)},onScannerData:e=>{let t="string"==typeof(null==e?void 0:e.data)?e.data:"";t&&G({keyword:t,hasRequested:!1}),null==a||a(e)},inputRender:i??(e=>(0,ev.jsx)(qN,{ctx:e,showSearchButton:!1!==t.showConfirmButton}))}};if(!t)return{search:l(void 0)};if(!ea)return{...t,search:l(t.search)};let a="string"==typeof t.className?t.className:void 0,i=t_()(a,"pisell-record-board-toolbar--narrow-stack","pisell-sales-grid-mobile-toolbar");if(!1===t.filter)return{...t,search:l(t.search),toolbarDensity:"compact-narrow",className:i};let n="object"==typeof t.filter&&null!==t.filter?t.filter:{};return{...t,search:l(t.search),toolbarDensity:"compact-narrow",filter:{...n,phoneLayout:!0},className:i}},[eg,ea,z]);(0,ef.useEffect)(()=>{if(!W)return;if(ed){W.hasRequested||G({...W,hasRequested:!0});return}if(!W.hasRequested)return;if((null==en?void 0:en.keyword)!==W.keyword)return void G(null);let e=Array.isArray(eo)?eo:[],t="number"==typeof ec?ec:e.length;if(1!==e.length||1!==t)return void G(null);let l=eh.onRow;if("function"!=typeof l)return void G(null);let a=l(e[0],0);"function"==typeof(null==a?void 0:a.onClick)&&a.onClick({}),G(null)},[W,ed,null==en?void 0:en.keyword,eo,ec,eh]);let ex=(0,ef.useMemo)(()=>{var e;return{...eV2,...null==eg||null==(e=eg.childComponentProps)?void 0:e.pagination}},[null==eg||null==(o=eg.childComponentProps)?void 0:o.pagination]),eb=(0,ef.useMemo)(()=>"monitor"===h?eVL(x)??x:x,[x,h]);return(0,ev.jsx)("div",{className:t_()("pisell-sales-grid",ea&&"pisell-sales-grid--phone",v),style:{height:"100%",minHeight:0,display:"flex",flexDirection:"column",...f},children:(0,ev.jsx)(lL.PisellRecordBoard,{__id:x,columnVisibilityStorageKey:eb,layoutType:"grid",layoutVariant:ea?"phone":"default",rowKey:A??"id",data:eo,loading:ed,total:ec??0,pagination:ei,onPageChange:R&&j?j:K,searchParams:en,onSearch:R&&M?M:J,onReset:R&&N?N:Z,fillHeight:(null==(d=eh.scroll)?void 0:d.autoCalc)??!0,grid:eh,toolBar:ey,paginationConfig:ex,search:null==eg||null==(c=eg.childComponentProps)?void 0:c.search,batchActionBar:{...eu,...null==eg||null==(u=eg.childComponentProps)?void 0:u.batchActionBar},floorMap:null==eg||null==(p=eg.childComponentProps)?void 0:p.floorMap,defaultBodyView:null==eg||null==(m=eg.childComponentProps)?void 0:m.defaultBodyView,children:(0,ev.jsx)(lL.PisellRecordBoard.ShellFrame,{children:(0,ev.jsx)(lL.PisellRecordBoard.GridLayout,{})})},h)})};eV1.displayName="PisellSalesGrid";let eV4=eV1,eV3=(0,ef.forwardRef)(function(e,t){let{autoBootstrap:l,orderId:a}=e,i=euc();return(0,ef.useImperativeHandle)(t,()=>({refresh:async function(){let{forceRemote:e=!0,preloadedSalesDetail:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(null==i?void 0:i.bookingTicket)&&!1!==l&&a&&await i.refreshSalesDetail({forceRemote:e,preloadedSalesDetail:t})}}),[i,l,a]),null}),eV8=(0,ef.forwardRef)(function(e,t){let l,{osProps:a,...i}=e,{osKey:n,orderId:s,autoBootstrap:r,preloadedSalesDetail:o,businessCode:d,bookingConfigParams:c,autoInitBookingContext:u,otherParams:p,rulesHooks:m,restoreOrderAfterPaidCheckout:g,destroyOnUnmount:h,syncDetailOnOrderChange:v}={osKey:(l=e.osProps??{}).osKey??e.osKey,orderId:l.orderId??e.orderId,autoBootstrap:l.autoBootstrap??e.autoBootstrap,preloadedSalesDetail:l.preloadedSalesDetail??e.preloadedSalesDetail,businessCode:l.businessCode??e.businessCode,bookingConfigParams:l.bookingConfigParams??e.bookingConfigParams,autoInitBookingContext:l.autoInitBookingContext??e.autoInitBookingContext,otherParams:l.otherParams??e.otherParams,rulesHooks:l.rulesHooks??e.rulesHooks,restoreOrderAfterPaidCheckout:l.restoreOrderAfterPaidCheckout??e.restoreOrderAfterPaidCheckout??!1,destroyOnUnmount:l.destroyOnUnmount??e.destroyOnUnmount,syncDetailOnOrderChange:l.syncDetailOnOrderChange??e.syncDetailOnOrderChange};return(0,ev.jsx)(ehq,{osKey:n,orderId:s,autoBootstrap:r,preloadedSalesDetail:o,businessCode:d,bookingConfigParams:c,autoInitBookingContext:u,otherParams:p,rulesHooks:m,restoreOrderAfterPaidCheckout:g,destroyOnUnmount:h,syncDetailOnOrderChange:v,children:(0,ev.jsx)(ehU,{children:(0,ev.jsxs)(ebN,{children:[(0,ev.jsx)(eV3,{ref:t,autoBootstrap:r,orderId:s}),(0,ev.jsx)(eNd,{...i})]})})})});eV8.displayName="SaleDetail";let eV6=eV8,eV5="\xa0\xb7\xa0";function eV7(e){let t=e.trim().split(":").map(e=>e.trim());if(t.length>=2){let e=String(t[0]).padStart(2,"0"),l=String(t[1]).padStart(2,"0"),a=null!=t[2]?String(t[2]).padStart(2,"0"):"00";return`${e}:${l}:${a}`}return"00:00:00"}function eV9(e,t,l,a){return{start:em()(`${e}T${eV7(t)}`).valueOf(),end:em()(`${l}T${eV7(a)}`).valueOf()}}function eYe(e){return eV9(e.start_date,e.start_time,e.end_date,e.end_time)}function eYt(e){return Number.isFinite(e)?em()(e).startOf("minute").valueOf():e}function eYl(e){let t=String(e??"").trim();if(!t)return"";let[,l,a]=t.split("-").map(Number);return l&&a?`${l}/${a}`:t}function eYa(e){let t=String(e.start_date??"").trim(),l=String(e.end_date??"").trim();return!!t&&!!l&&t!==l}function eYi(e,t){let l=String(e.end_time??"").trim();if(!l)return t;let a=eYa(e)?`${eYl(e.end_date)} `:"";return`${a}${l} ${t}`.trim()}function eYn(e){let t=String(e.start_time??"").trim(),l=String(e.end_time??"").trim();return t&&l?eYa(e)?`${eYl(e.start_date)} ${t} - ${eYl(e.end_date)} ${l}`:`${t} - ${l}`:t||l||""}function eYs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),l=e.progressPercent;return null!=l&&Number.isFinite(l)?Math.min(100,Math.max(0,Math.round(l))):function(e,t,l,a){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Date.now(),{start:n,end:s}=eV9(e,t,l,a);return!Number.isFinite(n)||!Number.isFinite(s)||s<=n||i<=n?0:i>=s?100:Math.round((i-n)/(s-n)*100)}(e.start_date,e.start_time,e.end_date,e.end_time,t)}function eYr(e){if(e<=0)return"0m";let t=Math.floor(e/60),l=e%60;return t>0?l>0?`${t}h ${l}m`:`${t}h`:`${l}m`}function eYo(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),null!=e.lateTime&&Number.isFinite(e.lateTime)&&e.lateTime>0)?"late":"not_arrived"}function eYd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),{start:l,end:a}=eV9(e.start_date,e.start_time,e.end_date,e.end_time);return!!Number.isFinite(l)&&!!Number.isFinite(a)&&!(a<=l)&&t>=l&&t<a}function eYc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),{start:l}=eV9(e.start_date,e.start_time,e.end_date,e.end_time);return!!Number.isFinite(l)&&t<l}function eYu(e){return[...e].sort((e,t)=>{let{start:l}=eV9(e.start_date,e.start_time,e.end_date,e.end_time),{start:a}=eV9(t.start_date,t.start_time,t.end_date,t.end_time);return l-a})}function eYp(e){let t=e.bookings.filter(e=>!0===e.isNext);return 0===t.length?null:eYu(t)[0]??null}function eYm(e,t){var l;let a=null==e||null==(l=e.name)?void 0:l.trim();if(a)return a;if(t&&(null==e?void 0:e.phone)){let t=eYx(e.phone);if(t)return t}return""}function eYg(e,t){let l=e.contactTiers;if(null==l?void 0:l.length){var a=l.map(e=>eYm({name:e.name,...e.phone?{phone:e.phone}:{}},t).trim()).filter(Boolean);let e=[];for(let t of a)t&&(0===e.length||e[e.length-1]!==t)&&e.push(t);return e}let i=eYm(e.holder,t).trim();return i?[i]:[]}function eYh(e,t){return eYg(e,t).join(eV5)}function eYv(e){return e.bookings.find(e=>!0!==e.isNext)??e.bookings[0]}function eYf(e){return e.length<=1||e.some(e=>"occupied"===e.hostBookingStatus)||!e.every(e=>null==e.hostBookingStatus||"reserved"===e.hostBookingStatus)?e:eYu(e)}function eYy(e){if("locked"===e.status)return"locked";if("empty"===e.status)return"empty";let t=e.bookings.filter(e=>!0!==e.isNext),l=t.filter(e=>"occupied"===e.hostBookingStatus).length;if(t.length>1){if("reserved"===e.status&&0===l)return"multi_reserved";let a=t.filter(e=>null!=e.hostBookingStatus);if(a.length>0){if(l>=2)return"multi_occupied";if(1===l&&"occupied"===e.status){let t=e.sub_status;return"payed"===t||"payment_required"===t||"timeout"===t?t:"payed"}if(a.every(e=>"reserved"===e.hostBookingStatus)){let t=e.sub_status;return"not_arrived"===t||"late"===t?t:"not_arrived"}}if("occupied"===e.status){let t=e.sub_status;return"payed"===t||"payment_required"===t||"timeout"===t?t:"payed"}if("reserved"===e.status){let t=e.sub_status;return"not_arrived"===t||"late"===t?t:"not_arrived"}}if("occupied"===e.status){let t=e.sub_status;return"payed"===t||"payment_required"===t||"timeout"===t?t:"payed"}if("reserved"===e.status){let t=e.sub_status;return"not_arrived"===t||"late"===t?t:"not_arrived"}return"empty"}function eYx(e){return e.length>=4?`***${e.slice(-4)}`:null}function eYb(e,t){var l,a;let i=e.main_field;if("string"==typeof i&&i.trim()){let e=null==(a=i.split(" ## ")[0])?void 0:a.trim();if(e)return e}let n=null==(l=e.code)?void 0:l.trim();if(n)return n;let s=null==t?void 0:t.trim();return s||""}function eY_(e){return null!=e.recordId&&""!==String(e.recordId).trim()?String(e.recordId).trim():e.booking_id}function eYk(e){return null==e||""===String(e).trim()?"unpaid":"paid"===String(e).trim().toLowerCase()?"paid":"unpaid"}let eYw="pisell-reservation.room-time-end";function eYj(e){return"paid"===e?"rc-compact__badge--paid":"rc-compact__badge--unpaid"}function eYS(e){return"paid"===e?"pisell-reservation.room-paid":"pisell-reservation.room-payment-needed"}function eYM(e){let t=String(e??"").trim();if(!t)return"";let l=t.split(":");if(l.length>=2){let e=parseInt(l[0],10),t=l[1].replace(/\D/g,"").slice(0,2),a=t.length>=2?t.padStart(2,"0"):`${t}0`.slice(0,2);if(Number.isFinite(e))return`${e}:${a}`}return t}function eYN(e,t){let l=t.bookingCount;if("number"!=typeof l||!Number.isFinite(l)||l<=0)return e;let a="number"==typeof t.completeBookingCount&&Number.isFinite(t.completeBookingCount)&&t.completeBookingCount>=0?t.completeBookingCount:0;return`${e} (${a}/${l})`}function eYC(e){let t=Number(e.percent),l=Math.min(100,Math.max(0,Number.isFinite(t)?t:0));return(0,ev.jsx)("div",{className:"rc-tooltip-time-bar","aria-hidden":!0,children:(0,ev.jsx)("div",{className:"rc-tooltip-time-bar__track",children:(0,ev.jsx)("div",{className:t_()("rc-tooltip-time-bar__fill",e.isTimeout&&"rc-tooltip-time-bar__fill--warn"),style:{width:`${l}%`}})})})}function eYT(e){let{data:t,booking:l,cardType:a,shellShape:i="rect",hideInnerLinearProgress:n=!1,headerMainFieldOverride:s,scrollSurfaceHandlers:r}=e,o=eYN((null==s?void 0:s.trim())||String(t.main_field??"").trim(),t),d="payed"===a||"payment_required"===a||"timeout"===a,c=d&&eYM(l.end_time)||eYM(l.start_time),u=eYs(l),p=eYk(l.order_payment_status),m=eYj(p),g=eN.getText("paid"===p?"pisell-reservation.room-paid":"pisell-reservation.room-payment-needed"),h=eN.getText(d?"pisell-reservation.room-time-end":"pisell-reservation.room-time-start"),v=`${c||"—"} ${h}`;return(0,ev.jsx)("div",{className:"rc-tooltip-time-root","data-pisell-floor-room-scroll-surface":"",...r,children:(0,ev.jsxs)("div",{className:"rc-tooltip-time-stack",children:[d&&"unpaid"===p?(0,ev.jsx)("span",{className:t_()("rc-tooltip-time-pay-badge","rc-compact__badge",m),"aria-hidden":!0,children:g}):null,d&&!n&&"circle"!==i?(0,ev.jsx)("div",{className:"rc-tooltip-time-progress",children:(0,ev.jsx)(eYC,{percent:u,isTimeout:"timeout"===a})}):null,(0,ev.jsx)("div",{className:"rc-tooltip-time-title-anchor rc-tooltip-time-title-anchor--overflow",children:(0,ev.jsx)(ex.Tooltip,{title:v,placement:"bottom",open:!0,color:"#000000",autoAdjustOverflow:!1,getPopupContainer:e=>e.closest(".pisell-res-floor-room-card__viewport-compensate")??e.closest(".pisell-res-floor-room-card")??document.body,overlayClassName:t_()("rc-tooltip-time-ant-overlay",!d&&"rc-tooltip-time-ant-overlay--reserved"),arrow:!0,children:(0,ev.jsx)("span",{className:"rc-tooltip-time-title rc-tooltip-time-title--overflow",children:o})})})]})})}function eYP(e){let{data:t,headerMainFieldOverride:l,scrollSurfaceHandlers:a}=e,i=eYN((null==l?void 0:l.trim())||String(t.main_field??"").trim(),t);return(0,ev.jsx)("div",{className:"rc-tooltip-time-root","data-pisell-floor-room-scroll-surface":"",...a,children:(0,ev.jsx)("div",{className:"rc-tooltip-time-stack rc-tooltip-time-stack--title-only",children:(0,ev.jsx)("div",{className:"rc-tooltip-time-title-anchor rc-tooltip-time-title-anchor--overflow",children:(0,ev.jsx)("span",{className:"rc-tooltip-time-title rc-tooltip-time-title--overflow",children:i||"—"})})})})}function eYA(e){if(null==e)return null;let t=String(e).trim();if(!t)return null;let l=t.match(/^(\d{1,2}):(\d{2})/);return l?`${l[1].padStart(2,"0")}:${l[2]}`:null}function eYD(e){if(null==e)return null;let t=String(e).trim(),l=t.slice(0,10);if(/^\d{4}-\d{2}-\d{2}$/.test(l))return l;let a=em()(t);return a.isValid()?a.format("YYYY-MM-DD"):null}function eYI(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(String(e).trim());if(Number.isFinite(t)&&!(t<0))return Math.round(t)}function eYE(e){if(null==e||""===e)return null;let t="number"==typeof e?e:Number(String(e).trim());return Number.isFinite(t)?t:null}function eYz(e){let t=function(e){if(!e)return null;let t=eYE(e.customer_id);if(null!=t)return t;let l=e.customer;return l&&"object"==typeof l?eYE(l.id):null}(e);return null!=t&&0!==t&&1!==t}function eYL(e){return null==e||""===e?null:"number"==typeof e&&Number.isFinite(e)||""!==String(e).trim()?e:null}function eYO(e){if(null==e||""===e)return null;if("number"==typeof e&&Number.isFinite(e))return Math.max(0,Math.round(e));let t=Number(String(e).replace(/,/g,"").trim());return Number.isFinite(t)?Math.max(0,Math.round(t)):null}function eYR(e){if(e&&"object"==typeof e){let t,l="string"==typeof e.name?e.name.trim():"";if("string"==typeof e.phone&&/\d/.test(e.phone))t=e.phone;else{let l=e.phone;l&&"string"==typeof l.phone&&/\d/.test(l.phone)&&(t=l.phone)}if(l||t)return{name:l,...t?{phone:t}:{}}}return null}function eY$(e){let t=e.metadata,l=eYR(null==t?void 0:t.holder);if(l)return l;let a=eYR(e.holder);if(a)return a;let i=e.holder_data,n=Array.isArray(i)?i[0]:i;if(n&&"object"==typeof n){if("string"==typeof n.name&&n.name.trim())return{name:n.name.trim()};let e=n.data,t=null==e?void 0:e.customer_name;if("string"==typeof t&&t.trim())return{name:t.trim()}}return null}function eYF(e){let t=function(e){let t="string"==typeof e.customer_name?e.customer_name.trim():"";if(t)return t;let l=e.customer;if(!l||"object"!=typeof l)return"";let a="string"==typeof l.display_name?l.display_name.trim():"";if(a)return a;let i="string"==typeof l.nickname?l.nickname.trim():"";return i?i:["string"==typeof l.first_name?l.first_name.trim():"","string"==typeof l.last_name?l.last_name.trim():""].filter(Boolean).join(" ").trim()}(e),l=function(e){let t="string"==typeof e.phone&&/\d/.test(e.phone)?e.phone:void 0;if(t)return t;let l=e.customer;if(!l||"object"!=typeof l)return;let a=l.phone??l.mobile;return"string"==typeof a&&/\d/.test(a)?a:void 0}(e);return t||l?{name:t,...l?{phone:l}:{}}:null}function eYB(e){let t=e.contacts_info;if(!t||"object"!=typeof t)return null;let l=["string"==typeof t.first_name?t.first_name.trim():"","string"==typeof t.last_name?t.last_name.trim():""].filter(Boolean).join(" "),a=t.phone,i=null==a?void 0:a.phone,n="string"==typeof i&&/\d/.test(i)?i:void 0;return l||n?{name:l,...n?{phone:n}:{}}:null}function eYH(e){let t=e.order,l=[],a=eY$(e);if(a&&(a.name||a.phone)&&l.push({source:"holder",name:a.name,...a.phone?{phone:a.phone}:{}}),t){let e=eYB(t);e&&(e.name||e.phone)&&l.push({source:"contacts_info",name:e.name,...e.phone?{phone:e.phone}:{}})}if(t&&eYz(t)){let e=eYF(t);e&&(e.name||e.phone)&&l.push({source:"customer",name:e.name,...e.phone?{phone:e.phone}:{}})}return l.length?l:void 0}function eYq(e){let t=e.order,l=eY$(e);if(l&&(l.name||l.phone))return{name:l.name,...l.phone?{phone:l.phone}:{}};if(t){let e=eYB(t);if(e&&(e.name||e.phone))return{name:e.name,...e.phone?{phone:e.phone}:{}}}if(t&&eYz(t)){let e=eYF(t);if(e&&(e.name||e.phone))return{name:e.name,...e.phone?{phone:e.phone}:{}}}}function eYV(e,t){let l,a,i=null!=e.booking_id&&""!==String(e.booking_id)?String(e.booking_id):`b_${e.id??t}`,n=e.id,s=null!=n&&""!==String(n).trim()?String(n).trim():void 0,r=e.order,o="string"==typeof(null==r?void 0:r.schedule_date)?r.schedule_date.trim():"",d=eYD(e.start_date)??eYD(e.select_date)??(o?eYD(o):null)??eYD(null==r?void 0:r.create_date),c=o.includes(" ")?eYA(o.split(/\s+/).slice(-1)[0]??""):null,u=eYA(e.start_time)??c??eYA(null==r?void 0:r.start_time),p=eYD(e.end_date)??d??eYD(null==r?void 0:r.create_date),m=eYA(e.end_time)??eYA(null==r?void 0:r.end_time),g=null;if(d&&u){let e=em()(`${d} ${u}`);e.isValid()&&(g=e)}if(!g&&e.start_at){let t=em()(String(e.start_at));t.isValid()&&(g=t)}let h=null;if(p&&m){let e=em()(`${p} ${m}`);e.isValid()&&(h=e)}if(!h&&e.end_at){let t=em()(String(e.end_at));t.isValid()&&(h=t)}if(!h&&g&&"number"==typeof e.duration&&Number.isFinite(e.duration)&&"minutes"===String(e.sub_type)){let t=g.add(e.duration,"minute");t.isValid()&&(h=t)}!h&&g&&(h=g.add(2,"hour"));let v=(null==g?void 0:g.isValid())?g.format("YYYY-MM-DD"):d??"",f=(null==g?void 0:g.isValid())?g.format("HH:mm"):u??"--:--",y=(null==h?void 0:h.isValid())?h.format("YYYY-MM-DD"):p??v,x=(null==h?void 0:h.isValid())?h.format("HH:mm"):m??"--:--",b=e.number,_="number"==typeof b&&Number.isFinite(b)?b:Number(b)||0,k=eYI(e.lateTime),w=eYI(e.timeoutTime),j=eYI(e.remainingReserveTime),S=function(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(String(e).trim());if(Number.isFinite(t))return Math.min(100,Math.max(0,Math.round(t)))}(e.progressPercent),M=null==r?void 0:r.payment_status,N=null!=M&&""!==String(M).trim()?String(M).trim():"",C=N.toLowerCase(),T=""===N?void 0:"paid"===C?"paid":"partially_paid"===C?"unpaid":N,P=function(e,t,l){let a=String(l??"").trim().toLowerCase(),i=null==t?void 0:t.summary,n=()=>{let l=e.amount??e.total??e.grand_total??(null==t?void 0:t.total_amount)??(null==i?void 0:i.total_amount)??0;return"string"==typeof l||"number"==typeof l?l:0};if("paid"===a){let l=(null==i?void 0:i.total_amount)??(null==t?void 0:t.total_amount)??e.amount??e.total??n();return"string"==typeof l||"number"==typeof l?l:n()}if("payment_processing"===a||"unpaid"===a){let e=eYL(null==i?void 0:i.total_amount);if(null!=e)return e;let t=eYL(null==i?void 0:i.amount_gap);return null!=t?t:n()}let s=eYL(null==i?void 0:i.amount_gap);if(null!=s)return s;let r=eYL(null==i?void 0:i.total_amount);return null!=r?r:n()}(e,r,C),A=function(e){let t,l=Array.isArray(t=e.products)?t.filter(e=>e&&"object"==typeof e).length:null;if(null!=l)return l;let a=e.order,i=null==a?void 0:a.summary;return eYO(null==i?void 0:i.product_quantity)??0}(e),D=null!=(a=Array.isArray(l=e.products)?l.reduce((e,t)=>t&&"object"==typeof t?e+Math.max(1,eYO(t.product_quantity)??1):e,0):null)?a:void 0,I=eYq(e),E=eYH(e),z=function(e){let t=eYY(e);if("reserved"===t||"occupied"===t||"locked"===t||"empty"===t)return t}(e),L=e.is_next??e.isNext;return{booking_id:i,...s?{recordId:s}:{},start_date:v||d||"",start_time:f,end_date:y||v||"",end_time:x,number:_,...I?{holder:I}:{},...E?{contactTiers:E}:{},...z?{hostBookingStatus:z}:{},amount:"string"==typeof P||"number"==typeof P?P:0,product_quantity:A,...null!=D?{product_total_quantity:D}:{},...null!=k&&k>0?{lateTime:k}:{},...null!=w&&w>0?{timeoutTime:w}:{},...null!=j&&j>0?{remainingReserveTime:j}:{},...void 0!==S?{progressPercent:S}:{},...void 0!==T?{order_payment_status:T}:{},...!0===L||"true"===L||1===L||"1"===L?{isNext:!0}:{}}}function eYY(e){return String(e.status??"").trim().toLowerCase()}function eYU(e,t){var l,a;let i=null!=e.capacityLabel&&""!==String(e.capacityLabel).trim()?e.capacityLabel:"—",n=t.trim()||e.code||"";if("maintenance"===e.cardStatus)return{main_field:n,capacity:i,status:"locked",sub_status:"",bookings:[]};if("available"===e.cardStatus)return{main_field:n,capacity:i,status:"empty",sub_status:"",bookings:[]};let s=[];s=(null==(l=e.floorMapSourceBookings)?void 0:l.length)?e.floorMapSourceBookings.map((e,t)=>eYV(e,t)):(null==(a=e.slots)?void 0:a.length)?e.slots.map((t,l)=>{let a,i,n,s,r;return a=e.floorMapReferenceDay??em()().format("YYYY-MM-DD"),i=t.time.replace(/ .*/,"").trim()||"12:00",s=(n=em()(`${a} ${i}`)).add(2,"hour"),r=t.name.trim(),{booking_id:`slot_${l}`,start_date:n.format("YYYY-MM-DD"),start_time:n.format("HH:mm"),end_date:s.format("YYYY-MM-DD"),end_time:s.format("HH:mm"),number:e.partySize??0,...r?{holder:{name:r},contactTiers:[{source:"holder",name:r}]}:{},amount:0,product_quantity:0,hostBookingStatus:"reserved"}}):[function(e){var t,l;let a,i=e.floorMapReferenceDay??em()().format("YYYY-MM-DD"),n=(e.time??"12:00").trim().split(/\s+/)[0]??"12:00",s=em()(`${i} ${n}`);if(null==(t=e.timeEnd)?void 0:t.trim()){let t=e.timeEnd.trim().split(/\s+/)[0];(!(a=em()(`${i} ${t}`)).isValid()||a.valueOf()<=s.valueOf())&&(a=s.add(2,"hour"))}else a=s.add(2,"hour");let r=e.guestPhone&&!e.guestPhone.includes("*")?e.guestPhone:void 0,o=(null==(l=e.guestName)?void 0:l.trim())??"",d=o||r?{name:o,...r?{phone:r}:{}}:void 0,c=d?[{source:"holder",name:d.name,...d.phone?{phone:d.phone}:{}}]:void 0,u=e.priceDisplay??0,p=null!=e.startsInMinutes&&Number.isFinite(e.startsInMinutes)&&e.startsInMinutes>0?Math.round(e.startsInMinutes):void 0,m=null!=e.lateMinutes&&Number.isFinite(e.lateMinutes)&&e.lateMinutes>0?Math.round(e.lateMinutes):void 0,g=null!=e.delayMinutes&&Number.isFinite(e.delayMinutes)&&e.delayMinutes>0?Math.round(e.delayMinutes):void 0,h="occupied"===e.cardStatus||"barBusy"===e.cardStatus?"occupied":"booked"===e.cardStatus?"reserved":void 0;return{booking_id:`syn_${e.id}`,start_date:s.format("YYYY-MM-DD"),start_time:s.format("HH:mm"),end_date:a.format("YYYY-MM-DD"),end_time:a.format("HH:mm"),number:e.partySize??0,...d?{holder:d}:{},...c?{contactTiers:c}:{},amount:u,product_quantity:0,...null!=p?{remainingReserveTime:p}:{},...null!=m?{lateTime:m}:{},...null!=g?{timeoutTime:g}:{},...h?{hostBookingStatus:h}:{},...!0===e.isPaid?{order_payment_status:"paid"}:{},...!0===e.isNext?{isNext:!0}:{}}}(e)];let r=e.floorMapSourceBookings,o="occupied"===e.cardStatus||"barBusy"===e.cardStatus,d="booked"===e.cardStatus;if((null==r?void 0:r.length)&&((null==r?void 0:r.some(e=>"occupied"===eYY(e)))?o=!0:(o=!1,(null==r?void 0:r.some(e=>"reserved"===eYY(e)))&&(d=!0))),o){let t="payed";return{main_field:n,capacity:i,status:"occupied",sub_status:t=!0===e.hostIsTimeout||null!=e.delayMinutes&&e.delayMinutes>0?"timeout":!1===e.isPaid?"payment_required":"payed",bookings:s.length>1?function(e){if(e.length<=1||1!==e.filter(e=>"occupied"===e.hostBookingStatus).length)return e;let t=eYu(e),l=t.findIndex(e=>"occupied"===e.hostBookingStatus);return l<0?e:[t[l],...t.slice(l+1),...t.slice(0,l)]}(s):s}}if(d){let t="not_arrived";return"late"===e.hostReservedStatus?t="late":"not_arrived"===e.hostReservedStatus?t="not_arrived":null!=e.lateMinutes&&e.lateMinutes>0&&(t="late"),{main_field:n,capacity:i,status:"reserved",sub_status:t,bookings:s.length>1?eYf(s):s}}return{main_field:n,capacity:i,status:"empty",sub_status:"",bookings:[]}}function eYW(e){let t=e=>null!=e&&""!==String(e).trim()?String(e).trim():"";return t(e.booking_id)||t(e.booking_uid)||t(e.id)||"—"}function eYG(e,t){let l,a,i,n=(null==t?void 0:t.capacityLabel)!=null&&""!==String(t.capacityLabel).trim()?t.capacityLabel:"—",s=(a=e.order??{},(i=e=>null!=e&&""!==String(e).trim()?String(e).trim():"")(e.booking_id)||i(e.id)||i(a.shop_full_order_number)||i(a.order_number)||"—").trim()||(null==t?void 0:t.code)||"",r=eYV(e,0),o="occupied"===String(e.status??"").trim().toLowerCase()?"occupied":"reserved";l="occupied"===o?null!=r.timeoutTime&&r.timeoutTime>0?"timeout":"unpaid"===r.order_payment_status?"payment_required":"payed":null!=r.lateTime&&r.lateTime>0?"late":"not_arrived";let d=e.order??{},c=null!=d.shop_full_order_number&&""!==String(d.shop_full_order_number).trim()?String(d.shop_full_order_number).trim():"",u=d.summary,p=null!=d.currency_symbol&&""!==String(d.currency_symbol).trim()?String(d.currency_symbol).trim():"$",m=(null==u?void 0:u.total_amount)!=null&&""!==String(u.total_amount).trim()?String(u.total_amount).trim():"",g=m?`${eN.getText("pisell-reservation.booking-detail.total")}: ${m.startsWith(p)?m:`${p}${m}`}`:"";return{main_field:s,capacity:n,status:o,sub_status:l,bookings:[{...r,items_summary_suffix:g||r.items_summary_suffix,order_display_number:c||r.order_display_number}]}}function eYQ(e){switch(e){case"comfortable":return 3;case"compact":return 2;case"mini":return 1;default:return 0}}function eYK(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rect";return"micro"===e||"mini"===e&&"circle"===t}let eYJ=(0,ef.createContext)("comfortable");function eYZ(){return(0,ef.useContext)(eYJ)}let eYX=(0,ef.createContext)({discUnifiedLayoutEnabled:!0,tooltipTimeDensityEnabled:!0});function eY0(){return(0,ef.useContext)(eYX)}function eY2(e,t){let l=t.length>0?t.reduce((e,t)=>{let l=Number(t.number);return e+(Number.isFinite(l)?l:0)},0):null,a=eN.getText("pisell-reservation.room-cap-prefix");return null!=l?`${a}: ${l}/${e.capacity}`:`${a}: ${e.capacity}`}let eY1=()=>(0,ev.jsxs)("svg",{className:"rc-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ev.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,ev.jsx)("polyline",{points:"12 6 12 12 16 14"})]}),eY4=()=>(0,ev.jsxs)("svg",{className:"rc-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ev.jsx)("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),(0,ev.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,ev.jsx)("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),(0,ev.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}),eY3=()=>(0,ev.jsxs)("svg",{className:"rc-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ev.jsx)("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),(0,ev.jsx)("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),(0,ev.jsx)("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),eY8=()=>(0,ev.jsxs)("svg",{className:"rc-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ev.jsx)("line",{x1:"12",y1:"1",x2:"12",y2:"23"}),(0,ev.jsx)("path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"})]});function eY6(e){let t=(0,ef.useRef)(null),l=(0,ef.useRef)(null),[a,i]=(0,ef.useState)(0);return(0,ef.useLayoutEffect)(()=>{let e=t.current,a=l.current;if(e&&a){let t=a.scrollWidth-e.clientWidth;i(t>0?t+20:0)}},[e.children]),(0,ev.jsx)("div",{className:"rc-compact__middle",ref:t,children:(0,ev.jsx)("div",{className:t_()("rc-compact__scroll",a>0&&"rc-compact__scroll--animate"),ref:l,style:a>0?{"--scroll-dist":`-${a}px`}:void 0,children:e.children})})}function eY5(e){let{isTimeout:t}=e,l=Math.min(100,Math.max(0,e.percent));return(0,ev.jsx)("div",{className:"rc-progress",children:(0,ev.jsx)("div",{className:"rc-progress__bar",children:(0,ev.jsx)("div",{className:t_()("rc-progress__fill",t&&"rc-progress__fill--warn"),style:{width:`${l}%`}})})})}function eY7(e){let{segments:t,className:l}=e;return t.length?(0,ev.jsx)("span",{className:l,children:t.map((e,t)=>(0,ev.jsxs)("span",{className:"rc-contact-chunk",children:[t>0?eV5:null,e]},t))}):null}function eY9(e){let t="paid"===e.variant?"rc-stamp--paid":"rc-stamp--unpaid";return(0,ev.jsx)("div",{className:t_()("rc-stamp",t),children:(0,ev.jsx)("span",{children:e.label})})}function eUe(e){let{nextLabel:t,guestSegments:l,guestLine:a,timeRange:i}=e,n=l&&l.length>0||null!=a&&""!==String(a).trim();return(0,ev.jsxs)("div",{className:"rc-next",children:[(0,ev.jsx)("span",{className:"rc-next__label",children:t}),n?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{className:"rc-next__sep",children:"\xb7"}),l&&l.length>0?(0,ev.jsx)("span",{className:"rc-next__guest-chunks",children:l.map((e,t)=>(0,ev.jsxs)("span",{className:"rc-contact-chunk",children:[t>0?eV5:null,e]},t))}):(0,ev.jsx)("span",{children:a})]}):null,(0,ev.jsx)("span",{className:"rc-next__sep",children:"\xb7"}),(0,ev.jsx)("span",{children:i})]})}function eUt(e){let{model:t,scrollSurfaceHandlers:l,nextBookingPrefix:a,bodyStatusTag:i,pinProgressToBottom:n=!0}=e,{checkoutDomKey:s,contactName:r,contactPhoneMasked:o,showContactPhone:d,guestContactSegments:c,timeLabel:u,partySize:p,countdown:m,reservedLateOverrun:g,occupiedTimeoutOverrun:h,orderNumberDisplay:v,paymentAmountClass:f,paymentBadgeClass:y,paymentBadgeText:x,paymentStampText:b,paymentStampVariant:_,amountDisplay:k,amountPrefixLabel:w,showLargeAmountRow:j,showProgress:S,showPaymentStamp:M,showAmountInlineBadge:N,showCompactCommerceRow:C,itemsCountLabel:T,itemsCountInsideScroll:P,showEdgeProgressRing:A,showEdgeProgressRectBorder:D,progressPercent:I,progressIsTimeout:E,nextGuestLine:z,nextGuestContactSegments:L,nextTimeRange:O}=t,R=c.length>0||r||d&&o,$=null!=O;return c.length,!c.length&&R&&ev.Fragment,c.length,!c.length&&R&&ev.Fragment,"compact"===t.layout?(0,ev.jsxs)("div",{className:"rc-compact","data-pisell-floor-checkout-booking":s,children:[(0,ev.jsxs)("div",{className:t_()("rc-compact__row",!1),children:[(0,ev.jsx)("div",{className:"rc-compact__left",children:c.length?(0,ev.jsx)(eY7,{segments:c,className:"rc-compact__name rc-compact__name--chunks"}):null}),(0,ev.jsxs)(eY6,{children:[null,(0,ev.jsxs)("span",{children:[(0,ev.jsx)(eY1,{}),u]}),(0,ev.jsx)("span",{className:"rc-sep",children:"\xb7"}),(0,ev.jsxs)("span",{children:[(0,ev.jsx)(eY4,{}),p]}),m?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{className:"rc-sep",children:"\xb7"}),(0,ev.jsxs)("span",{className:"rc-highlight--info",children:[(0,ev.jsx)(eY1,{}),m]})]}):null,g?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{className:"rc-sep",children:"\xb7"}),(0,ev.jsxs)("span",{className:"rc-highlight--danger",children:[(0,ev.jsx)(eY3,{}),g]})]}):null,h?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{className:"rc-sep",children:"\xb7"}),(0,ev.jsxs)("span",{className:"rc-highlight--overtime",children:[(0,ev.jsx)(eY3,{}),h]})]}):null,P?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{className:"rc-sep",children:"\xb7"}),(0,ev.jsx)("span",{className:t_()("rc-compact__items-count","rc-compact__items-count--in-scroll"),children:T})]}):null]}),C?(0,ev.jsx)("div",{className:"rc-compact__right",children:(0,ev.jsxs)("div",{className:"rc-compact__right-stack",children:[(0,ev.jsxs)("div",{className:"rc-compact__pay-row",children:[(0,ev.jsxs)("span",{className:t_()("rc-compact__amount","rc-amount__main",f),children:[(0,ev.jsx)(eY8,{}),k]}),(0,ev.jsx)("span",{className:t_()("rc-compact__badge",y),children:x})]}),P?null:(0,ev.jsx)("div",{className:"rc-compact__items-count",children:T})]})}):null]}),n?(0,ev.jsx)("div",{className:"rc-body__progress-grow",children:!S||A||D?null:(0,ev.jsx)(eY5,{percent:I,isTimeout:E})}):!S||A||D?null:(0,ev.jsx)(eY5,{percent:I,isTimeout:E})]}):(0,ev.jsxs)("div",{className:"rc-body","data-pisell-floor-checkout-booking":s,"data-pisell-floor-room-scroll-surface":"",...l,children:[v?(0,ev.jsxs)("div",{className:"rc-order-line",children:[(0,ev.jsx)("span",{className:"rc-order-line__number",children:v}),i?(0,ev.jsx)("span",{className:t_()("rc-tag","rc-order-line__status",`rc-tag--appointment-${i.tone}`),children:i.label}):null]}):null,R&&1?(0,ev.jsx)("div",{className:"rc-contact",children:c.length?(0,ev.jsx)(eY7,{segments:c,className:"rc-contact__name rc-contact__chunks"}):(0,ev.jsxs)(ev.Fragment,{children:[r?(0,ev.jsx)("span",{className:"rc-contact__name",children:r}):null,d&&o?(0,ev.jsx)("span",{className:"rc-contact__phone",children:o}):null]})}):null,(0,ev.jsxs)("div",{className:t_()("rc-time-row",!1),children:[null,(0,ev.jsxs)("span",{children:[(0,ev.jsx)(eY1,{}),u]}),(0,ev.jsx)("span",{className:"rc-sep",children:"\xb7"}),(0,ev.jsxs)("span",{children:[(0,ev.jsx)(eY4,{}),p]}),m?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{className:"rc-sep",children:"\xb7"}),(0,ev.jsxs)("span",{className:"rc-highlight--info",children:[(0,ev.jsx)(eY1,{}),m]})]}):null,g?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{className:"rc-sep",children:"\xb7"}),(0,ev.jsxs)("span",{className:"rc-highlight--danger",children:[(0,ev.jsx)(eY3,{}),g]})]}):null,h?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{className:"rc-sep",children:"\xb7"}),(0,ev.jsxs)("span",{className:"rc-highlight--overtime",children:[(0,ev.jsx)(eY3,{}),h]})]}):null]}),j?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsxs)("div",{className:t_()("rc-amount",N&&"rc-amount--with-badge",f),children:[(0,ev.jsxs)("span",{className:"rc-amount__main",children:[w?(0,ev.jsx)("span",{className:"rc-amount__prefix",children:w}):null,(0,ev.jsx)(eY8,{}),k]}),N?(0,ev.jsx)("span",{className:t_()("rc-compact__badge",y),children:x}):null]}),(0,ev.jsx)("div",{className:"rc-items-count",children:T})]}):null,M?(0,ev.jsx)(eY9,{variant:_,label:b}):null,n?(0,ev.jsx)("div",{className:"rc-body__progress-grow",children:!S||A||D?null:(0,ev.jsx)(eY5,{percent:I,isTimeout:E})}):!S||A||D?null:(0,ev.jsx)(eY5,{percent:I,isTimeout:E}),$?(0,ev.jsx)(eUe,{nextLabel:a,guestSegments:L,guestLine:z,timeRange:O}):null]})}function eUl(e){let{roomTitle:t,capacityLine:l,status:a,statusLabel:i,showStatusTag:n=!0,paymentUnpaidFill:s=!1,bookingCount:r,completeBookingCount:o}=e,d=null!=l&&""!==String(l).trim(),c="number"==typeof r&&Number.isFinite(r)&&r>0,u="number"==typeof o&&Number.isFinite(o)&&o>=0?o:0;return(0,ev.jsxs)("div",{className:t_()("rc-header",s&&"rc-header--payment-unpaid-fill"),children:[(0,ev.jsxs)("div",{className:"rc-header__left",children:[(0,ev.jsxs)("span",{className:"rc-room-name-line",children:[(0,ev.jsx)("span",{className:"rc-room-name",children:t}),c?(0,ev.jsxs)("span",{className:"rc-room-name-count",children:["(",u,"/",r,")"]}):null]}),d?(0,ev.jsx)("span",{className:"rc-capacity",children:l}):null]}),n?(0,ev.jsx)("span",{className:t_()("rc-tag",`rc-tag--${a}`),children:i}):null]})}function eUa(e){let{className:t,checkoutBookingKey:l,header:a,children:i,ribbonSlot:n,cornerSlot:s,shellShape:r="rect",tooltipTimeStandaloneMain:o=!1}=e,d=eYZ(),{discUnifiedLayoutEnabled:c}=eY0(),u="circle"===r&&c||eYK(d,r)?(0,ev.jsxs)("div",{className:o?"rc-tooltip-time-main":"rc-unified",children:[null!=a?a:null,i]}):(0,ev.jsxs)(ev.Fragment,{children:[null!=a?a:null,i]});return(0,ev.jsxs)("div",{className:t_()(t,"rc-shell"),"data-pisell-floor-checkout-booking":l,children:[n,s,u]})}let eUi="pisell-reservation.room-view-all",eUn="pisell-reservation.room-next-prefix";function eUs(e,t){return eN.getText(e).replace(/\{n\}/g,String(t))}let eUr={onTouchStart:e=>e.stopPropagation(),onTouchMove:e=>e.stopPropagation(),onTouchEnd:e=>e.stopPropagation(),onWheel:e=>e.stopPropagation()};function eUo(e,t){var l,a;null==t||t.stopPropagation(),null==t||null==(a=t.nativeEvent)||null==(l=a.stopImmediatePropagation)||l.call(a),window.setTimeout(()=>e(!1),50)}let eUd={onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()},eUc="pisell-res-floor-view-all-modal-wrap";function eUu(e,t,l,a){if(t<1||"micro"===a)return 0;if("circle"!==e)return Math.min(3,t);let i=null!=l&&Number.isFinite(l)&&l>0?l:null;if(null==i||i<48)return t>3?1:Math.min(3,t);let n=Math.round(Math.max(7,Math.min(18,.065*i))),s=Math.max(0,i-2*n),r=Math.min(115,Math.max(54,.35*s)),o=Math.max(0,s-r-10),d=Math.round(Math.max(42,Math.min(64,.15*s))),c=Math.min(3,t);if(o<46&&t>c)return 0;let u=0;for(let e=c;e>=0;e--){let l=t>e;if(e*d+(l?46+6*(e>0):0)<=o){u=e;break}}return u}function eUp(e,t){return(null==t?void 0:t.trim())||e.main_field}function eUm(e){let{data:t,occupancyBookings:l,hideCapacity:a=!1,headerMainFieldOverride:i,paymentUnpaidFill:n=!1}=e,s=void 0!==l?l:t.bookings,r=a?null:eY2(t,s);return(0,ev.jsx)(eUl,{roomTitle:eUp(t,i),capacityLine:r,status:t.status,statusLabel:function(e){switch(e){case"empty":return eN.getText("pisell-reservation.room-status-empty");case"reserved":return eN.getText("pisell-reservation.room-status-reserved");case"occupied":return eN.getText("pisell-reservation.room-status-occupied");case"locked":return eN.getText("pisell-reservation.room-status-locked");default:return""}}(t.status),paymentUnpaidFill:n,bookingCount:t.bookingCount,completeBookingCount:t.completeBookingCount})}function eUg(e,t,l){let a=eY2(e,t),i=eUs("pisell-reservation.room-modal-bookings",t.length),n=eYN(eUp(e,l),e);return(0,ev.jsxs)("div",{className:"rc-view-all-modal-title",children:[n," \xb7 ",i," \xb7 ",a]})}function eUh(e){let{cardType:t,booking:l,data:a,compact:i=!1,shellShape:n="rect",bodyStatusTag:s}=e,r=function(e){var t,l,a;let i,{cardType:n,booking:s,data:r,compact:o}=e,d=e.shellShape??"rect",c=e.nowMs??Date.now(),u="not_arrived"===n||"late"===n,p="payed"===n||"payment_required"===n||"timeout"===n,m=eN.getText("pisell-reservation.room-time-start"),g=eN.getText(eYw),h=function(e,t){let l=String(e.start_time??"").trim();if(!l)return t;let a=eYa(e)?`${eYl(e.start_date)} `:"";return`${a}${l} ${t}`.trim()}(s,m),v=eYi(s,g),f=String(s.end_time??"").trim().length>0,y=u?!o&&f?`${h} \xb7 ${v}`:h:eYi(s,eN.getText(eYw)),x=o&&u?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),l=e.remainingReserveTime;if(null!=l&&Number.isFinite(l)){let e=Math.max(0,Math.round(l));if(e>0)return e}let{start:a}=eV9(e.start_date,e.start_time,e.end_date,e.end_time);if(!Number.isFinite(a))return null;let i=Math.floor((a-t)/6e4);return i<0?null:i}(s):function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),l=e.bookings[0];if(!l||"reserved"!==e.status)return null;let a=l.remainingReserveTime;if(null!=a&&Number.isFinite(a)){let e=Math.max(0,Math.round(a));if(e>0)return e}return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),l=e.bookings[0];if(!l||"reserved"!==e.status)return null;let{start:a}=eV9(l.start_date,l.start_time,l.end_date,l.end_time);if(!Number.isFinite(a))return null;let i=Math.floor((a-t)/6e4);return i<0?null:i}(e,t)}(r),b="not_arrived"===n&&null!=x&&x>0?(i=eYr(Math.round(x)),eN.getText("pisell-reservation.room-in-minutes").replace(/\{d\}/g,i)):null,_=null!=s.lateTime&&Number.isFinite(s.lateTime)&&s.lateTime>0?eYr(s.lateTime):null,k="late"===n&&_?`${eN.getText("pisell-reservation.late")} +${_}`:null,w=null!=s.timeoutTime&&Number.isFinite(s.timeoutTime)&&s.timeoutTime>0?eYr(s.timeoutTime):null,j="timeout"===n&&w?`+${w}`:null,S=eYk(s.order_payment_status),M=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();return eYp(e)??function(e){let t=e.bookings;if(t.length<2||1!==t.filter(e=>"occupied"===e.hostBookingStatus).length)return null;let l=eYu(t),a=l.findIndex(e=>"occupied"===e.hostBookingStatus);return a<0||a>=l.length-1?null:l[a+1]}(e)??("reserved"!==e.status||e.bookings.length<2||e.bookings.some(e=>"occupied"===e.hostBookingStatus)?null:e.bookings[1]??null)??function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),l=e.bookings;if(l.length<2||!eYd(l[0],t))return null;for(let e=1;e<l.length;e++)if(eYc(l[e],t))return l[e];return null}(e,t)}(r,c),N=s.holder,C=eYg(s,u),T=C.length>0,P=(null==N||null==(t=N.name)?void 0:t.trim())??"",A=!T&&u&&(null==N?void 0:N.phone)?eYx(N.phone):null,D=C.join(eV5),I=null,E=[],z=null;M&&(I=(E=eYg(M,!0)).length?E.join(eV5):null,z=eYn(M));let L=eYs(s),O=(null==(l=s.order_display_number)?void 0:l.trim())||null,R=p&&"paid"!==S?eN.getText("pisell-reservation.booking-detail.strip-due-label"):null,$=s.product_quantity??0,F=s.product_total_quantity,B=null!=F&&F>0&&$>0?eN.getText("pisell-reservation.room-items-summary").replace(/\{items\}/g,String($)).replace(/\{qty\}/g,String(F)):eN.getText("pisell-reservation.room-items-total").replace(/\{n\}/g,String($)),H=null==(a=s.items_summary_suffix)?void 0:a.trim(),q=H?`${B} \xb7 ${H}`:B,V=!o&&(p||u)&&!0,Y="circle"===d&&p&&!o,U=o&&p&&!0;return{layout:o?"compact":"full",checkoutDomKey:eY_(s),cardType:n,contactName:P,contactPhoneMasked:A,showContactPhone:u,guestContactSegments:C,guestNameCompact:D,timeLabel:y,partySize:s.number,amountDisplay:s.amount,orderNumberDisplay:O,amountPrefixLabel:R,countdown:b,reservedLateOverrun:k,occupiedTimeoutOverrun:j,paymentAmountClass:"paid"===S?"rc-highlight--paid":"rc-highlight--unpaid",paymentBadgeClass:eYj(S),paymentBadgeText:eN.getText(eYS(S)),paymentStampText:eN.getText(eYS(S)),paymentIsPaid:"paid"===S,paymentStampVariant:S,showLargeAmountRow:V,showProgress:p,showPaymentStamp:!o&&p&&("rect"===d||!Y),showInlinePaymentBadge:Y,showAmountInlineBadge:!o&&p&&Y,showCompactCommerceRow:U,itemsCountLabel:q,itemsCountInsideScroll:U,showEdgeProgressRing:"circle"===d&&!o&&p,showEdgeProgressRectBorder:"rect"===d&&!o&&p&&!1,progressPercent:L,progressIsTimeout:"timeout"===n,nextGuestLine:I,nextGuestContactSegments:E,nextTimeRange:z}}({cardType:t,booking:l,data:a,compact:i,shellShape:n,nowMs:Date.now(),floorDensity:"comfortable"});return(0,ev.jsx)(eUt,{model:r,scrollSurfaceHandlers:eUr,nextBookingPrefix:eN.getText(eUn),bodyStatusTag:s,pinProgressToBottom:"circle"!==n})}let eUv={not_arrived:"rc rc--reserved",late:"rc rc--reserved",payed:"rc rc--occupied",payment_required:"rc rc--occupied rc--occupied-pay",timeout:"rc rc--occupied rc--occupied-timeout"};function eUf(e){let{data:t,cardType:l,hideHeader:a=!1,hideHeaderCapacity:i=!1,headerMainFieldOverride:n,shellShape:s="rect",bodyStatusTag:r}=e,o=eYZ(),{discUnifiedLayoutEnabled:d,tooltipTimeDensityEnabled:c}=eY0(),u=eYv(t);if(!u)return(0,ev.jsx)(eUy,{data:t,shellShape:s,hideHeaderCapacity:i,headerMainFieldOverride:n});let p="payed"===l||"payment_required"===l||"timeout"===l,m=eYk(u.order_payment_status),g=p&&"unpaid"===m&&"circle"===s&&d;if(c&&eYK(o,s)){var h;let e="rect"===s&&p&&((null==(h=t.bookings)?void 0:h.length)??0)===1;return(0,ev.jsx)(eUa,{className:t_()(eUv[l],"rc--tooltip-time"),shellShape:s,checkoutBookingKey:eY_(u),tooltipTimeStandaloneMain:!0,children:(0,ev.jsx)(eYT,{data:t,booking:u,cardType:l,shellShape:s,hideInnerLinearProgress:e,headerMainFieldOverride:n,scrollSurfaceHandlers:eUr})})}return(0,ev.jsx)(eUa,{className:eUv[l],shellShape:s,checkoutBookingKey:eY_(u),header:a?void 0:(0,ev.jsx)(eUm,{data:t,hideCapacity:i,headerMainFieldOverride:n,paymentUnpaidFill:g}),children:(0,ev.jsx)(eUh,{cardType:l,booking:u,data:t,shellShape:s,bodyStatusTag:r})})}function eUy(e){let{data:t,hideHeader:l,hideHeaderCapacity:a,headerMainFieldOverride:i,shellShape:n="rect"}=e,s=eYZ(),{tooltipTimeDensityEnabled:r}=eY0();return r&&eYK(s,n)?(0,ev.jsx)(eUa,{className:"rc rc--empty rc--tooltip-time",shellShape:n,tooltipTimeStandaloneMain:!0,children:(0,ev.jsx)(eYP,{data:t,headerMainFieldOverride:i,scrollSurfaceHandlers:eUr})}):(0,ev.jsx)(eUa,{className:"rc rc--empty",shellShape:n,header:l?void 0:(0,ev.jsx)(eUm,{data:t,hideCapacity:a,headerMainFieldOverride:i})})}let eUx={empty:eUy,multi_occupied:function(e){let{data:t,shellShape:l="rect",elementLayoutHeightPx:a,hideHeader:i=!1,hideHeaderCapacity:n,headerMainFieldOverride:s}=e,r=eYZ(),[o,d]=(0,ef.useState)(!1),c=t.bookings.filter(e=>!0!==e.isNext),u=c.length>0?c:t.bookings,p=eYp(t),m=u.length,g=eUu(l,m,a,r),h=u.slice(0,g),v=m>h.length,f="payed"===t.sub_status?"paid":"unpaid",{discUnifiedLayoutEnabled:y}=eY0(),x="unpaid"===f&&(eYK(r,l)||"circle"===l&&y),b=(0,ev.jsx)(lL.PisellModal,{open:o,onCancel:e=>eUo(d,e),maskProps:eUd,focusTriggerAfterClose:!1,wrapClassName:eUc,title:eUg(t,t.bookings,s),footer:null,destroyOnClose:!0,width:560,children:(0,ev.jsx)(eYJ.Provider,{value:"comfortable",children:(0,ev.jsx)("div",{className:t_()("pisell-res-floor-room-card","pisell-res-floor-room-card--modal-shell"),children:(0,ev.jsx)("div",{className:"rc--occupied rc--multi",children:(0,ev.jsx)("div",{className:"rc-multi-modal-body",...eUr,children:t.bookings.map((e,l)=>{let a=eYs(e)>=100?"timeout":"payed"===t.sub_status?"payed":"payment_required";return(0,ev.jsx)(eUh,{cardType:a,booking:e,data:t,compact:!0,shellShape:"rect"},`${eY_(e)}-${l}`)})})})})})});if("micro"===r){let e=eUp(t,s);return(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)(eUa,{className:t_()("rc rc--occupied rc--multi",o&&"rc--floor-detail-open"),shellShape:l,header:i?void 0:(0,ev.jsx)(eUm,{data:t,occupancyBookings:t.bookings,hideCapacity:n,headerMainFieldOverride:s,paymentUnpaidFill:x}),children:(0,ev.jsxs)("div",{className:"rc-multi-micro-summary","data-pisell-floor-room-scroll-surface":"",...eUr,children:[(0,ev.jsxs)("span",{className:"rc-multi-micro-summary__text",children:[e," \xb7 ","\xd7",t.bookings.length]}),(0,ev.jsx)("button",{type:"button",className:"rc-multi-more",onClick:e=>{e.stopPropagation(),d(!0)},children:eUs(eUi,t.bookings.length)})]})}),b]})}return(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)(eUa,{className:t_()("rc rc--occupied rc--multi",o&&"rc--floor-detail-open"),shellShape:l,header:i?void 0:(0,ev.jsx)(eUm,{data:t,occupancyBookings:t.bookings,hideCapacity:n,headerMainFieldOverride:s,paymentUnpaidFill:x}),children:(0,ev.jsxs)("div",{className:"rc-multi-list","data-pisell-floor-room-scroll-surface":"",...eUr,children:[h.map(e=>{let a=eYs(e)>=100?"timeout":"payed"===t.sub_status?"payed":"payment_required";return(0,ev.jsx)(eUh,{cardType:a,booking:e,data:t,compact:!0,shellShape:l},eY_(e))}),p&&"micro"!==r&&!v?(0,ev.jsx)(eUe,{nextLabel:eN.getText(eUn),guestSegments:"micro"!==r?eYg(p,!0):[],timeRange:eYn(p)}):null,v?(0,ev.jsx)("button",{type:"button",className:"rc-multi-more",onClick:e=>{e.stopPropagation(),d(!0)},children:eUs(eUi,t.bookings.length)}):null]})}),b]})},multi_reserved:function(e){let{data:t,shellShape:l="rect",elementLayoutHeightPx:a,hideHeader:i=!1,hideHeaderCapacity:n,headerMainFieldOverride:s}=e,r=eYZ(),[o,d]=(0,ef.useState)(!1),c=eYf([...t.bookings]),u=c.filter(e=>!0!==e.isNext),p=u.length>0?u:c,m=eYp(t),g=p.length,h=eUu(l,g,a,r),v=p.slice(0,h),f=g>v.length,y=Date.now(),x=(0,ev.jsx)(lL.PisellModal,{open:o,onCancel:e=>eUo(d,e),maskProps:eUd,focusTriggerAfterClose:!1,wrapClassName:eUc,title:eUg(t,c,s),footer:null,destroyOnClose:!0,width:560,children:(0,ev.jsx)(eYJ.Provider,{value:"comfortable",children:(0,ev.jsx)("div",{className:t_()("pisell-res-floor-room-card","pisell-res-floor-room-card--modal-shell"),children:(0,ev.jsx)("div",{className:"rc--reserved rc--multi",children:(0,ev.jsx)("div",{className:"rc-multi-modal-body",...eUr,children:c.map((e,l)=>(0,ev.jsx)(eUh,{cardType:eYo(e,Date.now()),booking:e,data:t,compact:!0,shellShape:"rect"},`${eY_(e)}-${l}`))})})})})});if("micro"===r){let e=eUp(t,s);return(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)(eUa,{className:t_()("rc rc--reserved rc--multi",o&&"rc--floor-detail-open"),shellShape:l,header:i?void 0:(0,ev.jsx)(eUm,{data:t,occupancyBookings:c,hideCapacity:n,headerMainFieldOverride:s}),children:(0,ev.jsxs)("div",{className:"rc-multi-micro-summary","data-pisell-floor-room-scroll-surface":"",...eUr,children:[(0,ev.jsxs)("span",{className:"rc-multi-micro-summary__text",children:[e," \xb7 ","\xd7",c.length]}),(0,ev.jsx)("button",{type:"button",className:"rc-multi-more",onClick:e=>{e.stopPropagation(),d(!0)},children:eUs(eUi,c.length)})]})}),x]})}return(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)(eUa,{className:t_()("rc rc--reserved rc--multi",o&&"rc--floor-detail-open"),shellShape:l,header:i?void 0:(0,ev.jsx)(eUm,{data:t,occupancyBookings:c,hideCapacity:n,headerMainFieldOverride:s}),children:(0,ev.jsxs)("div",{className:"rc-multi-list","data-pisell-floor-room-scroll-surface":"",...eUr,children:[v.map(e=>{let a=eYo(e,y);return(0,ev.jsx)(eUh,{cardType:a,booking:e,data:t,compact:!0,shellShape:l},eY_(e))}),m&&"micro"!==r&&!f?(0,ev.jsx)(eUe,{nextLabel:eN.getText(eUn),guestSegments:"micro"!==r?eYg(m,!0):[],timeRange:eYn(m)}):null,f?(0,ev.jsx)("button",{type:"button",className:"rc-multi-more",onClick:e=>{e.stopPropagation(),d(!0)},children:eUs(eUi,c.length)}):null]})}),x]})},locked:function(e){let{data:t,hideHeader:l=!1,hideHeaderCapacity:a,headerMainFieldOverride:i,shellShape:n="rect"}=e,s=a?null:eY2(t,[]);return(0,ev.jsx)(eUa,{className:"rc rc--locked",shellShape:n,header:l?void 0:(0,ev.jsx)(eUl,{roomTitle:eUp(t,i),capacityLine:s,status:"locked",statusLabel:"",showStatusTag:!1}),children:(0,ev.jsxs)("div",{className:"rc-body rc-body--center","data-pisell-floor-room-scroll-surface":"",...eUr,children:[(0,ev.jsx)("div",{className:"rc-lock-icon",children:(0,ev.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ev.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,ev.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}),(0,ev.jsx)("span",{className:"rc-locked-text",children:eN.getText("pisell-reservation.room-status-locked")})]})})}};function eUb(e){let{data:t,shellShape:l="rect",elementLayoutHeightPx:a,hideHeader:i=!1,hideHeaderCapacity:n=!1,headerMainFieldOverride:s,bodyStatusTag:r}=e,o=eYy(t),d=eUx[o];return d?(0,ev.jsx)(d,{data:t,shellShape:l,elementLayoutHeightPx:a,hideHeader:i,hideHeaderCapacity:n,headerMainFieldOverride:s,bodyStatusTag:r}):o in eUv?(0,ev.jsx)(eUf,{data:t,cardType:o,hideHeader:i,hideHeaderCapacity:n,headerMainFieldOverride:s,shellShape:l,bodyStatusTag:r}):(0,ev.jsx)(eUy,{data:t,shellShape:l,elementLayoutHeightPx:a,hideHeader:i,hideHeaderCapacity:n,headerMainFieldOverride:s,bodyStatusTag:r})}function eU_(e){let{discUnifiedLayoutEnabled:t=!0,tooltipTimeDensityEnabled:l=!0,...a}=e;return(0,ev.jsx)(eYX.Provider,{value:{discUnifiedLayoutEnabled:t,tooltipTimeDensityEnabled:l},children:(0,ev.jsx)(eUb,{...a})})}function eUk(e){return null==e?"":String(e).trim()}function eUw(e){if(null==e)return"";if("string"==typeof e)return e.trim();if("object"!=typeof e)return"";for(let t of["auto","zh-CN","zh-HK","en","ja","pt","original","kitchen"]){let l=e[t];if(null!=l&&eUk(l))return eUk(l)}for(let t of Object.values(e)){if(null!=t&&"string"==typeof t&&eUk(t))return eUk(t);if(null!=t&&"object"==typeof t&&null!==t&&!Array.isArray(t)){let e=eUw(t);if(e)return e}}return""}function eUj(e){if(null==e||""===e)return 0;if("number"==typeof e&&Number.isFinite(e))return e;let t=Number(String(e).replace(/,/g,"").trim());return Number.isFinite(t)?t:0}function eUS(e){let t=e.option_group_item_id??e.id,l="number"==typeof t&&Number.isFinite(t)?t:Number(String(t??0).replace(/\D/g,""))||0,a=eUw(e.name),i=eUw(e.group_name),n=i&&a?`${i}:${a}`:a||i||"—",s=Math.max(1,Math.round(eUj(e.num)||1)),r=eUj(e.add_price);return{id:l,name:n,num:s,price:r,total:r*s}}let eUM=new Set(["refunded","partially_refunded"]);function eUN(e){let t=e.order,l=null==t?void 0:t.payment_status,a=e.payment_status;return String((null!=l&&""!==String(l).trim()?l:a)??"").trim().toLowerCase()}function eUC(e){return"paid"===eUN(e)}let eUT="pisell-res-booking-detail-modal",eUP="pisell-reservation.booking-detail",eUA={onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()},eUD={background:"var(--color-primary, var(--ant-color-primary, #5d3f9f))",borderColor:"var(--color-primary, var(--ant-color-primary, #5d3f9f))"},eUI={bookings:[],completedBookings:[],unpaidBookings:[]},eUE=[{key:"current-occupied",labelKey:"tab-current-occupied"},{key:"ended",labelKey:"tab-ended"},{key:"unpaid",labelKey:"tab-unpaid"}];function eUz(e){return eN.getText(`${eUP}.${e}`)}function eUL(e){e.preventDefault(),e.stopPropagation()}let eUO=[{key:"action-edit",icon:(0,ev.jsx)(hC,{})},{key:"action-cart",icon:(0,ev.jsx)(lL.Iconfont,{type:"pisell2-coins-hand"})},{key:"action-print",icon:(0,ev.jsx)(SM,{})},{key:"action-list",icon:(0,ev.jsx)(AF,{})}];function eUR(e){let{bookingRaw:t,tableRow:l,isCancellingOrder:a,isCompletingBooking:i,getApp:n,onActionCellClick:s}=e,r=(0,ef.useMemo)(()=>eYG(t,l??null),[t,l]),o=(0,ef.useMemo)(()=>eYW(t),[t]),d=(0,ef.useMemo)(()=>{let e,l;return e=String((null==t?void 0:t.appointment_status)??"").trim(),(l={new:{label:eN.getText("pisell2.text.status.new"),tone:"new"},confirmed:{label:eN.getText("pisell2.text.status.confirmed"),tone:"confirmed"},arrived:{label:eN.getText("pisell2.text.status.arrived"),tone:"arrived"},started:{label:eN.getText("pisell2.text.status.started"),tone:"started"},cancelled:{label:eN.getText("pisell2.text.status.cancelled"),tone:"cancelled"},no_show:{label:eN.getText("pisell2.text.status.no_show"),tone:"no-show"},completed:{label:eN.getText("pisell2.text.status.completed"),tone:"completed"}})[e]??l.new},[t]),c=(0,ef.useMemo)(()=>eCI(t),[t]),u=(0,ef.useMemo)(()=>eUC(t),[t]),p=(0,ef.useMemo)(()=>eUM.has(eUN(t)),[t]),m=(0,ef.useMemo)(()=>{var e;let l;return e=null==r?void 0:r.status,l=eCI(t)?null:"occupied"===e?{key:"action-complete",icon:(0,ev.jsx)(lL.Iconfont,{type:"pisell2-check-square-broken"})}:{key:"action-start",icon:(0,ev.jsx)(lL.Iconfont,{type:"pisell2-send-01"})},[eUO[1],eUO[0],{key:"action-form",icon:(0,ev.jsx)(lL.Iconfont,{type:"pisell2-edit-05"})},...l?[l]:[],...eUO.slice(2),{key:"action-close",icon:(0,ev.jsx)(u1,{})}]},[null==r?void 0:r.status,t]),g=(0,ef.useMemo)(()=>{let e;return(!Array.isArray(e=t.products)?[]:e.filter(e=>e&&"object"==typeof e)).map((e,t)=>(function(e,t,l){var a,i,n;let s,r,o,d=e.product_title,c=(null==l||null==(n=l.app)||null==(i=n.locales)||null==(a=i.translation)?void 0:a.call(i,d))||eUw(d)||eUk(e.name)||eUk(e.title)||"—",u=e.product_sku,p=Math.max(1,Math.round(eUj(e.product_quantity)||1)),{price:m,total:g,origin_total:h}=(s=eUj(e.payment_price),r=eUj(e.selling_price),{price:s,total:r,origin_total:(o=eUj(e.original_price))>0?o:void 0}),v=function(e){if(!e)return;let t=eUw(e.subtitle);if(t)return t;let l=function(e){if(!Array.isArray(e))return"";let t=[];for(let l of e){if(!l||"object"!=typeof l)continue;let e=eUw(l.group),a=eUw(l.item);e&&a?t.push(`${e}:${a}`):a?t.push(a):e&&t.push(e)}return t.join(" \xb7 ")}(e.variant);if(l)return l;let a=e.option;if(!Array.isArray(a)||0===a.length)return;let i=a.filter(e=>e&&"object"==typeof e).map(e=>{let t=eUw(e.group_name),l=eUw(e.name);return t&&l?`${t}:${l}`:l||t}).filter(Boolean);return i.length?i.join(" \xb7 "):void 0}(u),f=function(e){if(!e)return;let t=e.option;if(!Array.isArray(t)||0===t.length)return;let l=t.filter(e=>e&&"object"==typeof e).map(e=>eUS(e));return l.length?l:void 0}(u),y=function(e){let t=e.product_bundle;if(!Array.isArray(t)||0===t.length)return;let l=t.filter(e=>e&&"object"==typeof e).map((e,t)=>{let l,a,i,n,s,r,o,d;return a="number"==typeof(l=e.bundle_id)&&Number.isFinite(l)?l:Number(String(l??t).replace(/\D/g,""))||t,i=Math.max(1,Math.round(eUj(e.num)||1)),n=eUj(e.custom_price??e.price),r=(s=eUj(e.bundle_payment_price))>0?s:n*i,d=Array.isArray(o=e.option)?o.filter(e=>e&&"object"==typeof e).map(e=>eUS(e)):void 0,{id:a,name:eUw(e.bundle_title)||"—",num:i,price:i>0?r/i:n,total:r,origin_total:void 0,price_type:eUk(e.price_type)||void 0,options:d&&d.length?d:void 0}});return l.length?l:void 0}(e),x=eUk(e.note)||void 0,b=e.like_status,_=null!=b&&eUk(b)?eUk(b):void 0,k=e.resource_id??e.relation_id,w=null!=k&&""!==String(k)?k:void 0,j=e.relation_form_name,S=null!=j&&eUk(j)?eUk(j):void 0,M=e.image??e.product_image??(null==u?void 0:u.image),N=null!=M&&eUk(M)?eUk(M):void 0;return{_id:function(e,t){let l=e.order_detail_id;if(null!=l&&""!==String(l))return l;let a=e.booking_uid;if(null!=a&&""!==String(a))return String(a);let i=e.product_id;return null!=i&&""!==String(i)?`${String(i)}-${t}`:`line-${t}`}(e,t),id:function(e,t){let l=e.product_id;if("number"==typeof l&&Number.isFinite(l))return l;let a=Number(String(l??"").replace(/\D/g,""));return Number.isFinite(a)&&a>0?a:t}(e,t),name:c,price:m,total:g,num:p,origin_total:h,image:N,isShowNote:!!x,note:x,like_status:_,bundle:y,options:f,isShowAction:!1,product_option_string:v,discount_reason:void 0,relation_products:void 0,resource_id:w,relation_form_name:S,holder_title:void 0,start_date:eUk(e.start_date)||void 0,end_date:eUk(e.end_date)||void 0,is_show_duration:void 0,is_show_week:void 0}})(e,t,{app:null==n?void 0:n()}))},[t,n]),h=(0,ef.useMemo)(()=>(function(e){if(!e)return"$";let t=e.currency_symbol;return null!=t&&""!==String(t).trim()?String(t).trim():"$"})(t.order),[t.order]);return(0,ev.jsxs)("div",{className:`${eUT}__booking-card`,children:[(0,ev.jsx)("div",{className:`${eUT}__room-card-slot pisell-res-floor-room-card`,onMouseDown:eUL,onClick:eUL,children:(0,ev.jsx)(eU_,{data:r,shellShape:"rect",hideHeader:!0,hideHeaderCapacity:!0,headerMainFieldOverride:o,bodyStatusTag:d})}),(0,ev.jsx)("div",{className:c?`${eUT}__action-grid ${eUT}__action-grid--cols-3`:`${eUT}__action-grid`,role:"group","aria-label":eUz("action-grid-aria"),children:m.map(e=>{let{key:l,icon:n}=e,r="action-cart"===l&&u,o=p&&("action-cart"===l||"action-edit"===l),d=function(e){switch(e){case"action-edit":return`${eUT}__action-cell--tint-edit`;case"action-cart":return`${eUT}__action-cell--tint-checkout`;case"action-form":return`${eUT}__action-cell--tint-form`;case"action-start":return`${eUT}__action-cell--tint-start`;case"action-complete":return`${eUT}__action-cell--tint-complete`;default:return""}}(l),c=[`${eUT}__action-cell`,d,r?`${eUT}__action-cell--paid`:"",o?`${eUT}__action-cell--refund-disabled`:""].filter(Boolean).join(" "),m=r?(0,ev.jsx)(rE,{}):n,g=r?"action-paid":l;return(0,ev.jsxs)("button",{type:"button",className:c,disabled:r||o||"action-close"===l&&a||"action-complete"===l&&i,onClick:e=>s(t,l,e),children:[ey().isValidElement(m)?ey().cloneElement(m,{className:`${eUT}__action-icon`,"aria-hidden":!0}):null,(0,ev.jsx)("span",{className:`${eUT}__action-label`,children:eUz(g)})]},l)})}),(0,ev.jsx)("div",{className:`${eUT}__products-section`,children:(0,ev.jsx)("div",{className:`${eUT}__products-list`,children:0===g.length?(0,ev.jsx)("div",{className:`${eUT}__products-empty`,children:eUz("empty-items")}):g.map(e=>(0,ev.jsx)("div",{className:`${eUT}__product-card-slot`,children:(0,ev.jsx)(lL.ProductCard,{dataSource:{...e,symbol:h},isShowImage:!1,isShowHolder:!1,isShowNote:!1,isShowDelete:!1,isShowPackageNote:!1,isShowEditProduct:!1})},String(e._id)))})})]})}function eU$(e){var t;let{open:l,onClose:a,onActionSuccess:i,raw:n,tableRow:s,sceneElementName:r,reservationBiz:o,associatedMenuListIds:d,reservationRuleProduct:c,floorDayBookingList:u,currentTime:p,followWallClock:m,singleBookingMode:g}=e,[h,v]=(0,ef.useState)("current-occupied"),f=ik(),y=null==f||null==(t=f.appHelper)?void 0:t.utils,{resourceBookingItem:x,resourceBookingItemLoading:b,activeTabBookings:_}=function(e,t){let{open:l,raw:a,tableRow:i,floorDayBookingList:n,currentTime:s,followWallClock:r,pisellos:o,disabled:d}=t,[c,u]=(0,ef.useState)(null),[p,m]=(0,ef.useState)(!1),g=(0,ef.useRef)(0);(0,ef.useEffect)(()=>{(!l||null==a||d)&&(u(null),m(!1),g.current+=1)},[l,a,d]),(0,ef.useEffect)(()=>{let e;if(!l||null==a||d)return;let t=null==o?void 0:o.getModule;if("function"!=typeof t)return;try{e=t.call(o,"sales")}catch{return}let c=null==e?void 0:e.getResourceBookingItem;if("function"!=typeof c)return;let p=eCT(i);if(null==p)return;let h="YYYY-MM-DD HH:mm",v=s?em()(s).format(h):em()().format(h),f=r?v:em()().format(h),y=Array.isArray(n)?n:[],x=++g.current;m(!0),y.length;let b=e=>{if(g.current!==x)return void g.current;let t=function(e){if(null==e||"object"!=typeof e)return eUI;let t=e=>Array.isArray(e)?e:[];return{bookings:t(e.bookings),completedBookings:t(e.completedBookings),unpaidBookings:t(e.unpaidBookings)}}(e);t.bookings.length,t.completedBookings.length,t.unpaidBookings.length,u(t),m(!1)},_=()=>{g.current===x&&(u(eUI),m(!1))};try{let t=c.call(e,{resourceId:p,currentTime:v,bookingList:y,deviceTime:f});null!=t&&"function"==typeof t.then?t.then(b).catch(_):b(t)}catch{_()}},[l,a,i,n,s,r,o,d]);let h=(0,ef.useMemo)(()=>c?("current-occupied"===e?c.bookings:"ended"===e?c.completedBookings:c.unpaidBookings).filter(e=>null!=e&&"object"==typeof e):[],[c,e]);return{resourceBookingItem:c,resourceBookingItemLoading:p,activeTabBookings:h}}(h,{open:l,raw:n,tableRow:s,floorDayBookingList:u,currentTime:p,followWallClock:m,pisellos:null==y?void 0:y.pisellos,disabled:g}),k=(0,ef.useMemo)(()=>null==x?null:{"current-occupied":x.bookings.length,ended:x.completedBookings.length,unpaid:x.unpaidBookings.length},[x]),{editBookingModalRef:w,isCancellingOrder:j,isCompletingBooking:S,handleResourceChangeConfirmed:M,handleActionCellClick:N}=function(e){var t,l,a;let{raw:i,tableRow:n,reservationBiz:s,associatedMenuListIds:r,onActionSuccess:o,appHelperUtils:d}=e,[c,u]=(0,ef.useState)(!1),[p,m]=(0,ef.useState)(!1),g=(0,ef.useRef)(null),h=(0,ef.useRef)(null),v=ik();null==v||null==(a=v.appHelper)||null==(l=a.utils)||null==(t=l.isIOS)||t.call(l);let f=(0,ef.useCallback)((e,t)=>{ex.Modal.confirm({title:eUz(function(e){switch(e){case"action-close":return"confirm-close-title";case"action-start":default:return"confirm-start-title";case"action-complete":return"confirm-complete-title"}}(e)),okText:eUz(function(e){switch(e){case"action-close":return"confirm-close-ok";case"action-start":default:return"confirm-start-ok";case"action-complete":return"confirm-complete-ok"}}(e)),cancelText:eUz(function(e){switch(e){case"action-close":return"confirm-close-cancel";case"action-start":default:return"confirm-start-cancel";case"action-complete":return"confirm-complete-cancel"}}(e)),centered:!0,okButtonProps:"action-close"===e?{danger:!0}:{style:eUD},onOk:t})},[]),y=(0,ef.useCallback)(async e=>{if(c)return;let{action:t,pisellos:l}=d||{},a=eCM(e);if(null==a)return void ex.message.error("Cancel order failed: missing order id");try{u(!0);let e=eCA(l),i=null==e?void 0:e.cancelOrder;if("function"!=typeof i)return void ex.message.error("Cancel order failed: Sales module is unavailable");await i.call(e,[a]),ex.message.success("Cancel order successfully"),eCD(t,a),await (null==o?void 0:o())}catch(e){console.error("[ReservationBookingDetailModal] cancel order failed",e),ex.message.error("Cancel order failed")}finally{u(!1)}},[d,c,o]),x=(0,ef.useCallback)(async e=>{let{action:t,pisellos:l}=d||{},a=eCM(e),i=eCN(e);if(null==i)return void ex.message.error("Complete booking failed: missing booking id");try{m(!0);let e=eCA(l),n=null==e?void 0:e.changeBookingStatus;if("function"!=typeof n)return void ex.message.error("Complete booking failed: Sales module is unavailable");await n.call(e,{booking_id:i,appointment_status:"started"}),ex.message.success("Complete booking successfully"),eCD(t,a),await (null==o?void 0:o())}catch(e){console.error("[ReservationBookingDetailModal] complete booking failed",e),ex.message.error("Complete booking failed")}finally{m(!1)}},[d,o]),b=(0,ef.useCallback)(async e=>{if(p)return;let{action:t,pisellos:l}=d||{},a=eCM(e),i=eCN(e);if(null==i)return void ex.message.error("Complete booking failed: missing booking id");try{m(!0);let e=eCA(l),n=null==e?void 0:e.changeBookingStatus;if("function"!=typeof n)return void ex.message.error("Complete booking failed: Sales module is unavailable");await n.call(e,{booking_id:i,appointment_status:"completed"}),ex.message.success("Complete booking successfully"),eCD(t,a),await (null==o?void 0:o())}catch(e){console.error("[ReservationBookingDetailModal] complete booking failed",e),ex.message.error("Complete booking failed")}finally{m(!1)}},[d,p,o]),_=(0,ef.useCallback)(()=>{let{action:e}=d||{},t=h.current??i,l=t?eCM(t):void 0;"function"==typeof e&&(e({type:"pisell1.closeSelectFloorMapResource",data:{},callback:()=>{}}),eCD(e,l)),h.current=null,null==o||o()},[d,o,i]),k=(0,ef.useCallback)(async(e,t,l)=>{if(eUL(l),!e)return;let{action:a,NativePage:i}=d||{},o=eCM(e),c=eCT(n),u=eCC(e,"start_at","start_date","start_time"),p=eCC(e,"end_at","end_date","end_time");switch(t){case"action-edit":"function"==typeof a&&null!=o&&a({type:"pisell1.handleOpenCachedBigSale",data:{order_id:o,business_code:null!=s&&""!==String(s).trim()?String(s).trim():""},callback:()=>{}});break;case"action-cart":if(eUC(e))return void ex.message.info(eUz("order-already-paid"));"function"==typeof a&&null!=o&&a({type:"pisell1.handleOpenPayment",data:{order:{id:o}},callback:e=>{if("toast-close"===VS(e).type)return}});break;case"action-print":"function"==typeof a&&a({type:"webpos.handlePrint",data:{data:e,type:"0"},callback:()=>{}});break;case"action-list":"function"==typeof a&&a({type:"pisell1.handleOpenSaleDetail",data:{osProps:{orderId:o,syncDetailOnOrderChange:!0}},callback:()=>{}});break;case"action-form":if("function"!=typeof a)return void ex.message.error("Change resource failed: action is unavailable");if(!c)return void ex.message.error("Change resource failed: missing source resource");if(!u||!p)return void ex.message.error("Change resource failed: missing booking time");{let t=em()(u);if(!t.isValid())return void ex.message.error("Change resource failed: invalid booking time");a({type:"pisell1.handleSelectFloorMapResource",data:{reservationBiz:s,associatedMenuListIds:r,scheduleValue:{date:t.startOf("day"),at:t},onClick:t=>{var l,a,i;let s,r,o=null==t||null==(l=t.resource)?void 0:l.id;if(null==o||""===String(o).trim())return void ex.message.error("Change resource failed: missing target resource");if(String(c)===String(o))return void ex.message.error(eUz("resource-already-bound"));let d=function(e){var t,l,a,i,n;let s=(null==(t=e.resource)?void 0:t.raw)&&"object"==typeof e.resource.raw?e.resource.raw:e.row,r=(null==(l=e.resource)?void 0:l.id)??(null==s?void 0:s.id);if(null!=r&&""!==String(r).trim())return{...s,id:r,form_id:(null==(a=e.resource)?void 0:a.form_id)??(null==s?void 0:s.form_id),code:(null==(i=e.resource)?void 0:i.code)??(null==s?void 0:s.code),main_field:(null==(n=e.resource)?void 0:n.main_field)??(null==s?void 0:s.main_field)}}(t);(s=eCP(n),r=eCP(d),s&&r&&s!==r)?ex.message.error(eUz("resource-type-mismatch")):(h.current=e,null==(i=g.current)||null==(a=i.open)||a.call(i,{event:e,fromResourceId:c,toResourceId:String(o),toResource:d,toStartDate:u,toEndDate:p,mode:"resource-only"}))}},callback:()=>{}})}break;case"action-close":f("action-close",()=>y(e));break;case"action-start":f("action-start",()=>x(e));break;case"action-complete":f("action-complete",()=>b(e))}},[d,s,r,n,f,y,x,b]);return{editBookingModalRef:g,isCancellingOrder:c,isCompletingBooking:p,handleResourceChangeConfirmed:_,handleActionCellClick:k}}({raw:n,tableRow:s,reservationBiz:o,associatedMenuListIds:d,onActionSuccess:i,appHelperUtils:y});(0,ef.useEffect)(()=>{v("current-occupied")},[null==n?void 0:n.id,null==n?void 0:n.booking_uid,null==n?void 0:n.booking_id]);let C=(0,ef.useMemo)(()=>{var e;if(null==s)return eN.getText(`${eUP}.modal-title`);let t=eYb(s,null!=r&&""!==String(r).trim()?String(r).trim():void 0).trim(),l=null==(e=s.code)?void 0:e.trim();return eYN(t||l||eN.getText("pisell-reservation.room-kind-bound"),s)},[s,r]),T=!!(l&&null!=n),P=(0,ef.useCallback)(e=>{eUL(e),a(e)},[a]),A=(0,ef.useCallback)(e=>{eUL(e),eCU({appHelperUtils:y,reservationBiz:o,associatedMenuListIds:d,reservationRuleProduct:c,row:s??null})},[y,o,d,c,s]),D=(0,ef.useMemo)(()=>(0,ev.jsxs)("div",{className:`${eUT}__header`,children:[(0,ev.jsx)("button",{type:"button",className:`${eUT}__header-action ${eUT}__header-action--left`,onClick:P,children:eUz("header-close")}),(0,ev.jsx)("div",{className:`${eUT}__header-title`,children:C}),(0,ev.jsx)("button",{type:"button",className:`${eUT}__header-action ${eUT}__header-action--right`,onClick:A,children:eUz("header-new-order")})]}),[C,P,A]),I=null==y?void 0:y.getApp;return(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)(iB,{renderType:"modal",props:{platform:"pc",open:T,onCancel:a,maskProps:eUA,focusTriggerAfterClose:!1,title:D,closable:!1,footer:null,destroyOnClose:!0,width:560,wrapClassName:`${eUT}-wrap pisell-pc-modal`},children:n?(0,ev.jsx)("div",{className:eUT,children:(0,ev.jsx)("div",{className:`${eUT}__body`,children:g?(0,ev.jsx)("div",{className:`${eUT}__bookings-list`,role:"tabpanel","aria-label":eUz("tab-current-occupied"),children:(0,ev.jsx)(eUR,{bookingRaw:n,tableRow:s,isCancellingOrder:j,isCompletingBooking:S,getApp:I,onActionCellClick:N})}):(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("div",{className:`${eUT}__tabs`,role:"tablist","aria-label":eUz("tabs-aria"),children:eUE.map(e=>{let{key:t,labelKey:l}=e,a=h===t,i=null==k?void 0:k[t];return(0,ev.jsxs)("button",{type:"button",role:"tab","aria-selected":a,className:`${eUT}__tab${a?` ${eUT}__tab--active`:""}`,onClick:e=>{eUL(e),v(t)},children:[eUz(l),null!=i?(0,ev.jsxs)("span",{className:`${eUT}__tab-count`,children:[" ","(",i,")"]}):null]},t)})}),(0,ev.jsx)("div",{className:`${eUT}__bookings-list`,role:"tabpanel","aria-label":eUz(`tab-${h}`),children:0===_.length?b?null:(0,ev.jsx)("div",{className:`${eUT}__bookings-empty`,children:eUz("empty-tab-bookings")}):_.map((e,t)=>{let l=String(e.id??e.booking_uid??e.booking_id??t);return(0,ev.jsx)(eUR,{bookingRaw:e,tableRow:s,isCancellingOrder:j,isCompletingBooking:S,getApp:I,onActionCellClick:N},l)})})]})})}):null}),(0,ev.jsx)(eAF,{ref:w,open:!1,onCancel:()=>{},onOk:M})]})}let eUF={"pisell-reservation.page-title":"Reservation","pisell-reservation.page-title-venue":"Venue control","pisell-reservation.hud-open-table-aria":"Open table of resources on the floor map","pisell-reservation.hud-expand-aria":"Expand resources list","pisell-reservation.hud-collapse-aria":"Collapse resources list","pisell-reservation.hud-table-drawer-title":"Resources on map","pisell-reservation.hud-drawer-resource-canvas-placeholder":"Filter by area (canvas)","pisell-reservation.hud-sheet-close-aria":"Close resources list","pisell-reservation.new":"+ New","pisell-reservation.new-modal-title":"New","pisell-reservation.new-modal-placeholder":"No available routes","pisell-reservation.cancel":"Cancel","pisell-reservation.edit-map":"Edit floor map","pisell-reservation.edit-map-done":"Done","pisell-reservation.floor-map-appearance-dark":"Dark background","pisell-reservation.floor-map-appearance-light":"Light background","pisell-reservation.follow-current":"Current","pisell-reservation.view-grid":"Table","pisell-reservation.view-floor":"Floor map","pisell-reservation.view-calendar":"Calendar","pisell-reservation.view-resource-wall":"Wall","pisell-reservation.resource-wall-resources":"Resources on wall","pisell-reservation.payment-status-bucket-unpaid":"Unpaid","pisell-reservation.payment-status-bucket-paid":"Paid","pisell-reservation.booking-status-bucket-on-site":"On site","pisell-reservation.booking-status-bucket-no-show":"No show","pisell-reservation.booking-status-bucket-completed":"Completed","pisell-reservation.calendar-granularity-resource":"Resource","pisell-reservation.calendar-granularity-day":"Day","pisell-reservation.calendar-granularity-week":"Week","pisell-reservation.calendar-granularity-month":"Month","pisell-reservation.calendar-write-not-available":"This action is not available yet. Please use the floor map or table when supported.","pisell-reservation.follow-live-time":"Live time","pisell-reservation.follow-custom-time":"Custom time","pisell-reservation.follow-live-hint":"You are following the current time","pisell-reservation.follow-custom-hint":"You are using a custom time","pisell-reservation.switch-to-custom-time":"Switch to custom time","pisell-reservation.switch-to-live-time":"Switch to current time","pisell-reservation.non-current-hint":"You are not on current time","pisell-reservation.at-current-time":"You are on the current time","pisell-reservation.at-current-time-short":"Now","pisell-reservation.go-current":"Go to current time","pisell-reservation.schedule-data-loading":"Loading bookings…","pisell-reservation.grid.code":"Table","pisell-reservation.grid.area":"Area","pisell-reservation.grid.status":"Status","pisell-reservation.grid.guest":"Guest","pisell-reservation.grid.time":"Time","pisell-reservation.grid.party":"Party","pisell-reservation.canvas.main":"Main Area","pisell-reservation.canvas.secondary":"Secondary Area","pisell-reservation.canvas.vip":"VIP Area","pisell-reservation.maintenance":"Maintenance","pisell-reservation.next":"NEXT","pisell-reservation.party":"party","pisell-reservation.more":"more","pisell-reservation.late":"late","pisell-reservation.floor-hud.total":"Total","pisell-reservation.floor-hud.interactive-title":"Today sales","pisell-reservation.floor-map.data-source-label":"Resource","pisell-reservation.floor-map.category-background":"Decorations","pisell-reservation.floor-map.palette-image-bg":"Image (background)","pisell-reservation.floor-plan.save-failed":"Failed to save floor plan","pisell-reservation.card-placeholder.hint-select-row":"Data source selected. Choose a row in the sidebar.","pisell-reservation.card-placeholder.hint-bind-datasource":"No row bound: select a data source and record in the sidebar.","pisell-reservation.card-placeholder.hint-new-slot":"New table placeholder. Bind a record in the sidebar.","pisell-reservation.card-placeholder.hint-row-not-found":"Record not found: check binding or data list.","pisell-reservation.resource-grid.id":"ID","pisell-reservation.resource-grid.name":"Name","pisell-reservation.resource-grid.form-code":"Form code","pisell-reservation.resource-grid.capacity":"Capacity","pisell-reservation.resource-grid.schedule":"Schedule","pisell-reservation.resource-grid.form-id":"Form ID","pisell-reservation.resource-grid.card-status":"Card status","pisell-reservation.room-kind-bound":"Bound resource","pisell-reservation.room-kind-bound-round":"Bound round table","pisell-reservation.room-status-occupied":"Occupied","pisell-reservation.room-status-reserved":"Reserved","pisell-reservation.room-status-empty":"Empty","pisell-reservation.room-status-locked":"Locked","pisell-reservation.room-empty-body":"Not in use","pisell-reservation.room-status-unbound":"Unbound","pisell-reservation.room-paid":"Paid","pisell-reservation.room-unpaid":"Unpaid","pisell-reservation.room-payment-needed":"Collect money","pisell-reservation.room-items-total":"Total {n} items","pisell-reservation.room-items-summary":"{items} items \xb7 {qty} pcs","pisell-reservation.room-modal-bookings":"{n} bookings","pisell-reservation.room-cap-prefix":"Cap","pisell-reservation.room-time-end":"End","pisell-reservation.room-time-start":"Start","pisell-reservation.room-in-minutes":"in {d}","pisell-reservation.room-view-all":"View all {n} bookings","pisell-reservation.room-occupancy-sum":"Guests {current} / {capacity}","pisell-reservation.room-next-prefix":"Next","pisell-reservation.room-guest-unknown":"Guest","pisell-reservation.room-collapse":"Collapse","pisell-reservation.booking-detail.modal-title":"Details","pisell-reservation.booking-detail.booking-id":"Booking ID","pisell-reservation.booking-detail.status":"Status","pisell-reservation.booking-detail.contact":"Guest","pisell-reservation.booking-detail.phone":"Phone","pisell-reservation.booking-detail.time":"Time","pisell-reservation.booking-detail.staff":"Staff","pisell-reservation.booking-detail.staff-unassigned":"Unassigned","pisell-reservation.booking-detail.table":"Table","pisell-reservation.booking-detail.payment":"Payment","pisell-reservation.booking-detail.total":"Total","pisell-reservation.booking-detail.tab-info":"Info","pisell-reservation.booking-detail.tab-notes":"Notes","pisell-reservation.booking-detail.tab-form":"Form","pisell-reservation.booking-detail.empty-notes":"No notes","pisell-reservation.booking-detail.empty-items":"No line items","pisell-reservation.booking-detail.empty-tab-bookings":"No sales","pisell-reservation.booking-detail.empty-form":"No extra fields","pisell-reservation.booking-detail.header-close":"Close","pisell-reservation.booking-detail.header-new-order":"New","pisell-reservation.booking-detail.tabs-aria":"Booking detail tabs","pisell-reservation.booking-detail.tab-current-occupied":"Current occupied","pisell-reservation.booking-detail.tab-ended":"Ended","pisell-reservation.booking-detail.tab-unpaid":"Unpaid","pisell-reservation.booking-detail.booking-label":"Booking","pisell-reservation.booking-detail.strip-items-total":"{count} items Order total : {total}","pisell-reservation.booking-detail.strip-due-label":"Due:","pisell-reservation.booking-detail.see-all":"See all","pisell-reservation.booking-detail.header-mode-aria":"Detail header view","pisell-reservation.booking-detail.header-mode-order-strip":"Summary strip","pisell-reservation.booking-detail.header-mode-room-card":"Room card","pisell-reservation.booking-detail.action-grid-aria":"Booking actions","pisell-reservation.booking-detail.action-edit":"Edit","pisell-reservation.booking-detail.action-cart":"Checkout","pisell-reservation.booking-detail.action-paid":"Paid","pisell-reservation.booking-detail.action-print":"Print receipts","pisell-reservation.booking-detail.action-form":"Change resource","pisell-reservation.booking-detail.action-list":"Order detail","pisell-reservation.booking-detail.action-close":"Cancel","pisell-reservation.booking-detail.action-start":"Start","pisell-reservation.booking-detail.action-complete":"Complete","pisell-reservation.booking-detail.resource-already-bound":"This order is already bound to this resource. Please select another resource.","pisell-reservation.booking-detail.resource-type-mismatch":"Resource type does not match. Please select another resource.","pisell-reservation.select-resource.title":"Select resource","pisell-reservation.booking-detail.confirm-close-title":"Do you want to cancel?","pisell-reservation.booking-detail.confirm-close-ok":"Confirm","pisell-reservation.booking-detail.confirm-close-cancel":"Don't cancel","pisell-reservation.booking-detail.confirm-close-content":"This action cannot be undone.","pisell-reservation.booking-detail.confirm-start-title":"Do you want to start now?","pisell-reservation.booking-detail.confirm-start-ok":"Start","pisell-reservation.booking-detail.confirm-start-cancel":"Cancel","pisell-reservation.booking-detail.confirm-start-content":"Please confirm before continuing.","pisell-reservation.booking-detail.confirm-complete-title":"Mark as complete?","pisell-reservation.booking-detail.confirm-complete-ok":"Complete","pisell-reservation.booking-detail.confirm-complete-cancel":"Cancel","pisell-reservation.booking-detail.confirm-complete-content":"Please confirm before closing this booking.","pisell-reservation.booking-detail.to-pay":"To pay","pisell-reservation.booking-detail.order-open":"Open","pisell-reservation.booking-detail.order-already-paid":"Order already paid.","pisell-reservation.booking-detail.meta-host-status":"Booking on card","pisell-reservation.booking-detail.meta-line-amount":"Order amount","pisell-reservation.booking-detail.meta-timeout":"Overtime","pisell-reservation.booking-detail.meta-progress":"Progress","pisell-reservation.booking-detail.meta-arrival":"Until start","pisell-reservation.booking-detail.status-enum.started":"Started","pisell-reservation.booking-detail.status-enum.confirmed":"Confirmed","pisell-reservation.booking-detail.status-enum.active":"Active","pisell-reservation.booking-detail.status-enum.checked_in":"Checked in","pisell-reservation.booking-detail.status-enum.checkin":"Check-in","pisell-reservation.booking-detail.status-enum.in_progress":"In progress","pisell-reservation.booking-detail.status-enum.pending":"Pending","pisell-reservation.booking-detail.status-enum.pending_payment":"Pending payment","pisell-reservation.booking-detail.status-enum.draft":"Draft","pisell-reservation.booking-detail.status-enum.waiting":"Waiting","pisell-reservation.booking-detail.status-enum.hold":"On hold","pisell-reservation.booking-detail.status-enum.cancelled":"Cancelled","pisell-reservation.booking-detail.status-enum.canceled":"Canceled","pisell-reservation.booking-detail.status-enum.void":"Void","pisell-reservation.booking-detail.status-enum.refunded":"Refunded"},eUB={"pisell-reservation.page-title":"预约","pisell-reservation.page-title-venue":"场控","pisell-reservation.hud-open-table-aria":"打开画布已绑定资源列表","pisell-reservation.hud-expand-aria":"展开画布资源列表","pisell-reservation.hud-collapse-aria":"收起画布资源列表","pisell-reservation.hud-table-drawer-title":"画布资源列表","pisell-reservation.hud-drawer-resource-canvas-placeholder":"按画布区域筛选","pisell-reservation.hud-sheet-close-aria":"关闭画布资源列表","pisell-reservation.new":"+ 新建","pisell-reservation.new-modal-title":"新建","pisell-reservation.new-modal-placeholder":"暂无可跳转路由","pisell-reservation.cancel":"取消","pisell-reservation.edit-map":"编辑平面图","pisell-reservation.edit-map-done":"完成编辑","pisell-reservation.floor-map-appearance-dark":"暗色背景","pisell-reservation.floor-map-appearance-light":"浅色背景","pisell-reservation.follow-current":"当前","pisell-reservation.view-grid":"表格","pisell-reservation.view-floor":"平面图","pisell-reservation.view-calendar":"日历","pisell-reservation.view-resource-wall":"大屏","pisell-reservation.resource-wall-resources":"大屏显示资源","pisell-reservation.payment-status-bucket-unpaid":"未支付","pisell-reservation.payment-status-bucket-paid":"已支付","pisell-reservation.booking-status-bucket-on-site":"在场","pisell-reservation.booking-status-bucket-no-show":"未到店","pisell-reservation.booking-status-bucket-completed":"已完成","pisell-reservation.calendar-granularity-resource":"资源","pisell-reservation.calendar-granularity-day":"日","pisell-reservation.calendar-granularity-week":"周","pisell-reservation.calendar-granularity-month":"月","pisell-reservation.calendar-write-not-available":"该操作暂未开放,请在平面图或表格中操作(与平面图写能力对齐后可用)。","pisell-reservation.follow-live-time":"当前时间","pisell-reservation.follow-custom-time":"自定义时间","pisell-reservation.follow-live-hint":"现在为当前时间","pisell-reservation.follow-custom-hint":"当前为自定义时间","pisell-reservation.switch-to-custom-time":"切换为自定义时间","pisell-reservation.switch-to-live-time":"切换为当前时间","pisell-reservation.non-current-hint":"您处于非当前状态","pisell-reservation.at-current-time":"您处于当前时间","pisell-reservation.at-current-time-short":"当前","pisell-reservation.go-current":"去当前","pisell-reservation.schedule-data-loading":"预约数据加载中…","pisell-reservation.grid.code":"台号","pisell-reservation.grid.area":"区域","pisell-reservation.grid.status":"状态","pisell-reservation.grid.guest":"客人","pisell-reservation.grid.time":"时间","pisell-reservation.grid.party":"人数","pisell-reservation.canvas.main":"主区域","pisell-reservation.canvas.secondary":"副区域","pisell-reservation.canvas.vip":"VIP 区","pisell-reservation.maintenance":"维护中","pisell-reservation.next":"下一桌","pisell-reservation.party":"位","pisell-reservation.more":"更多","pisell-reservation.late":"迟到","pisell-reservation.floor-hud.total":"总计","pisell-reservation.floor-hud.interactive-title":"今日营业","pisell-reservation.floor-map.data-source-label":"资源","pisell-reservation.floor-map.category-background":"装饰","pisell-reservation.floor-map.palette-image-bg":"图片(底图)","pisell-reservation.floor-plan.save-failed":"平面图保存失败","pisell-reservation.card-placeholder.hint-select-row":"已选择数据源,请在侧栏选择数据行","pisell-reservation.card-placeholder.hint-bind-datasource":"未绑定数据行:请在侧栏选择数据源与记录","pisell-reservation.card-placeholder.hint-new-slot":"新桌位占位,可在侧栏绑定具体记录","pisell-reservation.card-placeholder.hint-row-not-found":"未找到对应记录:请检查绑定或数据列表","pisell-reservation.resource-grid.id":"ID","pisell-reservation.resource-grid.name":"名称","pisell-reservation.resource-grid.form-code":"表单编码","pisell-reservation.resource-grid.capacity":"容量","pisell-reservation.resource-grid.schedule":"日程","pisell-reservation.resource-grid.form-id":"表单 ID","pisell-reservation.resource-grid.card-status":"卡片状态","pisell-reservation.room-kind-bound":"绑定资源","pisell-reservation.room-kind-bound-round":"绑定圆桌","pisell-reservation.room-status-occupied":"使用中","pisell-reservation.room-status-reserved":"已预订","pisell-reservation.room-status-empty":"空闲","pisell-reservation.room-status-locked":"已锁定","pisell-reservation.room-empty-body":"暂无预约","pisell-reservation.room-status-unbound":"未绑定","pisell-reservation.room-paid":"已付","pisell-reservation.room-unpaid":"未付","pisell-reservation.room-payment-needed":"需收款","pisell-reservation.room-items-total":"共 {n} 件商品","pisell-reservation.room-items-summary":"共 {items} 项,{qty} 件","pisell-reservation.room-modal-bookings":"{n} 条预约","pisell-reservation.room-cap-prefix":"可容","pisell-reservation.room-time-end":"结束","pisell-reservation.room-time-start":"开始","pisell-reservation.room-in-minutes":"还有 {d}","pisell-reservation.room-view-all":"查看全部 {n} 条预约","pisell-reservation.room-occupancy-sum":"人数 {current}/{capacity}","pisell-reservation.room-next-prefix":"下一档","pisell-reservation.room-guest-unknown":"客人","pisell-reservation.room-collapse":"收起","pisell-reservation.booking-detail.modal-title":"详情","pisell-reservation.booking-detail.booking-id":"预约号","pisell-reservation.booking-detail.status":"状态","pisell-reservation.booking-detail.contact":"联系人","pisell-reservation.booking-detail.phone":"电话","pisell-reservation.booking-detail.time":"时间","pisell-reservation.booking-detail.staff":"员工","pisell-reservation.booking-detail.staff-unassigned":"未分配","pisell-reservation.booking-detail.table":"桌位","pisell-reservation.booking-detail.payment":"支付","pisell-reservation.booking-detail.total":"合计","pisell-reservation.booking-detail.tab-info":"信息","pisell-reservation.booking-detail.tab-notes":"备注","pisell-reservation.booking-detail.tab-form":"表单","pisell-reservation.booking-detail.empty-notes":"无备注","pisell-reservation.booking-detail.empty-items":"无商品行","pisell-reservation.booking-detail.empty-tab-bookings":"暂无订单","pisell-reservation.booking-detail.empty-form":"无额外字段","pisell-reservation.booking-detail.header-close":"关闭","pisell-reservation.booking-detail.header-new-order":"创建订单","pisell-reservation.booking-detail.tabs-aria":"预约详情切换","pisell-reservation.booking-detail.tab-current-occupied":"占用中","pisell-reservation.booking-detail.tab-ended":"已结束","pisell-reservation.booking-detail.tab-unpaid":"未付款","pisell-reservation.booking-detail.booking-label":"预约","pisell-reservation.booking-detail.strip-items-total":"{count} 件商品 订单合计:{total}","pisell-reservation.booking-detail.strip-due-label":"应付:","pisell-reservation.booking-detail.see-all":"查看全部","pisell-reservation.booking-detail.header-mode-aria":"详情顶部展示","pisell-reservation.booking-detail.header-mode-order-strip":"信息条","pisell-reservation.booking-detail.header-mode-room-card":"房间卡","pisell-reservation.booking-detail.action-grid-aria":"操作","pisell-reservation.booking-detail.action-edit":"编辑","pisell-reservation.booking-detail.action-cart":"结账","pisell-reservation.booking-detail.action-paid":"已支付","pisell-reservation.booking-detail.action-print":"打印小票","pisell-reservation.booking-detail.action-form":"更换资源","pisell-reservation.booking-detail.action-list":"订单详情","pisell-reservation.booking-detail.action-close":"取消","pisell-reservation.booking-detail.action-start":"开始预约","pisell-reservation.booking-detail.action-complete":"结束","pisell-reservation.booking-detail.resource-already-bound":"当前订单已经绑定过该资源,请选择其他资源","pisell-reservation.booking-detail.resource-type-mismatch":"资源类型不一致,请选择其他资源","pisell-reservation.select-resource.title":"选择资源","pisell-reservation.booking-detail.confirm-close-title":"是否要取消?","pisell-reservation.booking-detail.confirm-close-ok":"确认","pisell-reservation.booking-detail.confirm-close-cancel":"放弃","pisell-reservation.booking-detail.confirm-close-content":"取消后无法恢复,请确认是否继续。","pisell-reservation.booking-detail.confirm-start-title":"是否现在开始?","pisell-reservation.booking-detail.confirm-start-ok":"开始","pisell-reservation.booking-detail.confirm-start-cancel":"取消","pisell-reservation.booking-detail.confirm-start-content":"确认后将执行开始预约操作。","pisell-reservation.booking-detail.confirm-complete-title":"是否完成?","pisell-reservation.booking-detail.confirm-complete-ok":"完成","pisell-reservation.booking-detail.confirm-complete-cancel":"取消","pisell-reservation.booking-detail.confirm-complete-content":"确认后将执行结束预约操作。","pisell-reservation.booking-detail.to-pay":"应付","pisell-reservation.booking-detail.order-open":"未结","pisell-reservation.booking-detail.order-already-paid":"订单已支付","pisell-reservation.booking-detail.meta-host-status":"卡片预约状态","pisell-reservation.booking-detail.meta-line-amount":"订单金额","pisell-reservation.booking-detail.meta-timeout":"超时","pisell-reservation.booking-detail.meta-progress":"进行进度","pisell-reservation.booking-detail.meta-arrival":"距开始","pisell-reservation.booking-detail.status-enum.started":"已开始","pisell-reservation.booking-detail.status-enum.confirmed":"已确认","pisell-reservation.booking-detail.status-enum.active":"进行中","pisell-reservation.booking-detail.status-enum.checked_in":"已签到","pisell-reservation.booking-detail.status-enum.checkin":"签到","pisell-reservation.booking-detail.status-enum.in_progress":"进行中","pisell-reservation.booking-detail.status-enum.pending":"待处理","pisell-reservation.booking-detail.status-enum.pending_payment":"待支付","pisell-reservation.booking-detail.status-enum.draft":"草稿","pisell-reservation.booking-detail.status-enum.waiting":"等待中","pisell-reservation.booking-detail.status-enum.hold":"保留","pisell-reservation.booking-detail.status-enum.cancelled":"已取消","pisell-reservation.booking-detail.status-enum.canceled":"已取消","pisell-reservation.booking-detail.status-enum.void":"已作废","pisell-reservation.booking-detail.status-enum.refunded":"已退款"},eUH={"pisell-reservation.page-title":"預約","pisell-reservation.page-title-venue":"場控","pisell-reservation.hud-open-table-aria":"打開畫布已綁定資源列表","pisell-reservation.hud-expand-aria":"展開畫布資源列表","pisell-reservation.hud-collapse-aria":"收起畫布資源列表","pisell-reservation.hud-table-drawer-title":"畫布資源列表","pisell-reservation.hud-drawer-resource-canvas-placeholder":"按畫布區域篩選","pisell-reservation.hud-sheet-close-aria":"關閉畫布資源列表","pisell-reservation.new":"+ 新增","pisell-reservation.new-modal-title":"新增","pisell-reservation.new-modal-placeholder":"暫無可跳轉路由","pisell-reservation.cancel":"取消","pisell-reservation.edit-map":"編輯平面圖","pisell-reservation.edit-map-done":"完成編輯","pisell-reservation.floor-map-appearance-dark":"暗色背景","pisell-reservation.floor-map-appearance-light":"淺色背景","pisell-reservation.follow-current":"當前","pisell-reservation.view-grid":"表格","pisell-reservation.view-floor":"平面圖","pisell-reservation.view-calendar":"日曆","pisell-reservation.view-resource-wall":"大屏","pisell-reservation.resource-wall-resources":"大屏顯示資源","pisell-reservation.payment-status-bucket-unpaid":"未支付","pisell-reservation.payment-status-bucket-paid":"已支付","pisell-reservation.booking-status-bucket-on-site":"在場","pisell-reservation.booking-status-bucket-no-show":"未到店","pisell-reservation.booking-status-bucket-completed":"已完成","pisell-reservation.calendar-granularity-resource":"資源","pisell-reservation.calendar-granularity-day":"日","pisell-reservation.calendar-granularity-week":"週","pisell-reservation.calendar-granularity-month":"月","pisell-reservation.calendar-write-not-available":"該操作暫未開放,請在平面圖或表格中操作(與平面圖寫能力對齊後可用)。","pisell-reservation.follow-live-time":"當前時間","pisell-reservation.follow-custom-time":"自訂時間","pisell-reservation.follow-live-hint":"現在為當前時間","pisell-reservation.follow-custom-hint":"目前為自訂時間","pisell-reservation.switch-to-custom-time":"切換為自訂時間","pisell-reservation.switch-to-live-time":"切換為當前時間","pisell-reservation.non-current-hint":"您處於非當前狀態","pisell-reservation.at-current-time":"您處於當前時間","pisell-reservation.at-current-time-short":"當前","pisell-reservation.go-current":"去當前","pisell-reservation.schedule-data-loading":"預約資料載入中…","pisell-reservation.grid.code":"檯號","pisell-reservation.grid.area":"區域","pisell-reservation.grid.status":"狀態","pisell-reservation.grid.guest":"客人","pisell-reservation.grid.time":"時間","pisell-reservation.grid.party":"人數","pisell-reservation.canvas.main":"主區域","pisell-reservation.canvas.secondary":"副區域","pisell-reservation.canvas.vip":"VIP 區","pisell-reservation.maintenance":"維護中","pisell-reservation.next":"下一檯","pisell-reservation.party":"位","pisell-reservation.more":"更多","pisell-reservation.late":"遲到","pisell-reservation.floor-hud.total":"總計","pisell-reservation.floor-hud.interactive-title":"今日營業","pisell-reservation.floor-map.data-source-label":"資源","pisell-reservation.floor-map.category-background":"裝飾","pisell-reservation.floor-map.palette-image-bg":"圖片(底圖)","pisell-reservation.floor-plan.save-failed":"平面圖儲存失敗","pisell-reservation.card-placeholder.hint-select-row":"已選擇資料來源,請在側欄選擇資料列","pisell-reservation.card-placeholder.hint-bind-datasource":"未綁定資料列:請在側欄選擇資料來源與記錄","pisell-reservation.card-placeholder.hint-new-slot":"新桌位佔位,可在側欄綁定具體記錄","pisell-reservation.card-placeholder.hint-row-not-found":"找不到對應記錄:請檢查綁定或資料清單","pisell-reservation.resource-grid.id":"ID","pisell-reservation.resource-grid.name":"名稱","pisell-reservation.resource-grid.form-code":"表單編碼","pisell-reservation.resource-grid.capacity":"容量","pisell-reservation.resource-grid.schedule":"日程","pisell-reservation.resource-grid.form-id":"表單 ID","pisell-reservation.resource-grid.card-status":"卡片狀態","pisell-reservation.room-kind-bound":"綁定資源","pisell-reservation.room-kind-bound-round":"綁定圓桌","pisell-reservation.room-status-occupied":"使用中","pisell-reservation.room-status-reserved":"已預訂","pisell-reservation.room-status-empty":"空閒","pisell-reservation.room-status-locked":"已鎖定","pisell-reservation.room-empty-body":"暫無預約","pisell-reservation.room-status-unbound":"未綁定","pisell-reservation.room-paid":"已付","pisell-reservation.room-unpaid":"未付","pisell-reservation.room-payment-needed":"需收款","pisell-reservation.room-items-total":"共 {n} 件商品","pisell-reservation.room-items-summary":"共 {items} 項,{qty} 件","pisell-reservation.room-modal-bookings":"{n} 條預約","pisell-reservation.room-cap-prefix":"可容","pisell-reservation.room-time-end":"結束","pisell-reservation.room-time-start":"開始","pisell-reservation.room-in-minutes":"還有 {d}","pisell-reservation.room-view-all":"查看全部 {n} 條預約","pisell-reservation.room-occupancy-sum":"人數 {current}/{capacity}","pisell-reservation.room-next-prefix":"下一檔","pisell-reservation.room-guest-unknown":"客人","pisell-reservation.room-collapse":"收起","pisell-reservation.booking-detail.modal-title":"詳情","pisell-reservation.booking-detail.booking-id":"預約號","pisell-reservation.booking-detail.status":"狀態","pisell-reservation.booking-detail.contact":"聯絡人","pisell-reservation.booking-detail.phone":"電話","pisell-reservation.booking-detail.time":"時間","pisell-reservation.booking-detail.staff":"員工","pisell-reservation.booking-detail.staff-unassigned":"未分配","pisell-reservation.booking-detail.table":"桌位","pisell-reservation.booking-detail.payment":"支付","pisell-reservation.booking-detail.total":"合計","pisell-reservation.booking-detail.tab-info":"資訊","pisell-reservation.booking-detail.tab-notes":"備註","pisell-reservation.booking-detail.tab-form":"表單","pisell-reservation.booking-detail.empty-notes":"無備註","pisell-reservation.booking-detail.empty-items":"無商品行","pisell-reservation.booking-detail.empty-tab-bookings":"暫無訂單","pisell-reservation.booking-detail.empty-form":"無額外欄位","pisell-reservation.booking-detail.header-close":"關閉","pisell-reservation.booking-detail.header-new-order":"建立訂單","pisell-reservation.booking-detail.tabs-aria":"預約詳情切換","pisell-reservation.booking-detail.tab-current-occupied":"當前占用中的","pisell-reservation.booking-detail.tab-ended":"已經結束的","pisell-reservation.booking-detail.tab-unpaid":"未付款的","pisell-reservation.booking-detail.booking-label":"預約","pisell-reservation.booking-detail.strip-items-total":"{count} 件商品 訂單合計:{total}","pisell-reservation.booking-detail.strip-due-label":"應付:","pisell-reservation.booking-detail.see-all":"查看全部","pisell-reservation.booking-detail.header-mode-aria":"詳情頂部展示","pisell-reservation.booking-detail.header-mode-order-strip":"資訊條","pisell-reservation.booking-detail.header-mode-room-card":"房間卡","pisell-reservation.booking-detail.action-grid-aria":"操作","pisell-reservation.booking-detail.action-edit":"編輯","pisell-reservation.booking-detail.action-cart":"結帳","pisell-reservation.booking-detail.action-paid":"已支付","pisell-reservation.booking-detail.action-print":"列印收據","pisell-reservation.booking-detail.action-form":"更改資源","pisell-reservation.booking-detail.action-list":"訂單詳情","pisell-reservation.booking-detail.action-close":"取消","pisell-reservation.booking-detail.action-start":"開始預約","pisell-reservation.booking-detail.action-complete":"完成","pisell-reservation.booking-detail.resource-already-bound":"當前訂單已經綁定過該資源,請選擇其他資源","pisell-reservation.booking-detail.resource-type-mismatch":"資源類型不一致,請選擇其他資源","pisell-reservation.select-resource.title":"選擇資源","pisell-reservation.booking-detail.confirm-close-title":"是否要取消?","pisell-reservation.booking-detail.confirm-close-ok":"確認","pisell-reservation.booking-detail.confirm-close-cancel":"放棄","pisell-reservation.booking-detail.confirm-close-content":"取消後無法恢復,請確認是否繼續。","pisell-reservation.booking-detail.confirm-start-title":"是否現在開始?","pisell-reservation.booking-detail.confirm-start-ok":"開始","pisell-reservation.booking-detail.confirm-start-cancel":"取消","pisell-reservation.booking-detail.confirm-start-content":"確認後將執行開始預約操作。","pisell-reservation.booking-detail.confirm-complete-title":"是否完成?","pisell-reservation.booking-detail.confirm-complete-ok":"完成","pisell-reservation.booking-detail.confirm-complete-cancel":"取消","pisell-reservation.booking-detail.confirm-complete-content":"確認後將執行完成預約操作。","pisell-reservation.booking-detail.to-pay":"應付","pisell-reservation.booking-detail.order-open":"未結","pisell-reservation.booking-detail.order-already-paid":"訂單已支付","pisell-reservation.booking-detail.meta-host-status":"卡片預約狀態","pisell-reservation.booking-detail.meta-line-amount":"訂單金額","pisell-reservation.booking-detail.meta-timeout":"超時","pisell-reservation.booking-detail.meta-progress":"進行進度","pisell-reservation.booking-detail.meta-arrival":"距開始","pisell-reservation.booking-detail.status-enum.started":"已開始","pisell-reservation.booking-detail.status-enum.confirmed":"已確認","pisell-reservation.booking-detail.status-enum.active":"進行中","pisell-reservation.booking-detail.status-enum.checked_in":"已簽到","pisell-reservation.booking-detail.status-enum.checkin":"簽到","pisell-reservation.booking-detail.status-enum.in_progress":"進行中","pisell-reservation.booking-detail.status-enum.pending":"待處理","pisell-reservation.booking-detail.status-enum.pending_payment":"待支付","pisell-reservation.booking-detail.status-enum.draft":"草稿","pisell-reservation.booking-detail.status-enum.waiting":"等待中","pisell-reservation.booking-detail.status-enum.hold":"保留","pisell-reservation.booking-detail.status-enum.cancelled":"已取消","pisell-reservation.booking-detail.status-enum.canceled":"已取消","pisell-reservation.booking-detail.status-enum.void":"已作廢","pisell-reservation.booking-detail.status-enum.refunded":"已退款"},eUq="pisell-reservation.floor-map.palette-image-bg",eUV=new Set([eUF[eUq],eUB[eUq],eUH[eUq],"图片(底图)"]),eUY="pisell-reservation.floor-map.category-background",eUU="pisell-reservation.floor-map.data-source-label",eUW="pisell-floor-map-layout.palette.builtin-shape",eUG="pisell-reservation.room-kind-bound",eUQ="pisell-reservation.room-kind-bound-round",eUK=new Set(["image","floorMapBg","floor_map_image"]);function eUJ(e){let t=new Set;return e.filter(e=>!t.has(e.value)&&(t.add(e.value),!0))}function eUZ(e,t){if(!(null==t?void 0:t.length))return e;let l=new Map(e.map(e=>[e.value,e])),a=eUJ(t.filter(e=>!(eUK.has(e.value)||e.value!==lL.FLOOR_MAP_IMAGE_ELEMENT_KIND&&eUV.has(e.label)))).filter(e=>e.value!==lL.FLOOR_MAP_IMAGE_ELEMENT_KIND).filter(e=>e.value!==lL.FLOOR_MAP_BUILTIN_SHAPE_ELEMENT_KIND).filter(e=>!eU8.has(e.value)).map(e=>{let t=l.get(e.value);return t?{...t,...e,nameAsTitleConfigurable:e.nameAsTitleConfigurable??t.nameAsTitleConfigurable}:e}),i=new Set(a.map(e=>e.value)),n=[...a];for(let t of e)i.has(t.value)||(n.push(t),i.add(t.value));return eUJ(n)}function eUX(e,t){if(!(null==t?void 0:t.length))return e;let l=new Map(e.map(e=>[e.id,e.order??0])),a=new Set(t.map(e=>e.id)),i=[...t];for(let t of e)a.has(t.id)||(i.push(t),a.add(t.id));return[...i].map(e=>l.has(e.id)?{...e,order:l.get(e.id)}:e).sort((e,t)=>(e.order??0)-(t.order??0))}let eU0={en:"Main Area","zh-CN":"主区域","zh-HK":"主區域",ja:"Main Area",pt:"Main Area"},eU2={en:"Secondary Area","zh-CN":"副区域","zh-HK":"副區域",ja:"Secondary Area",pt:"Secondary Area"},eU1={en:"VIP Area","zh-CN":"VIP 区","zh-HK":"VIP 區",ja:"VIP Area",pt:"VIP Area"},eU4="reservationBoundTable",eU3="reservationBoundRoundTable",eU8=new Set(["reservationTable","reservationPartyBench","reservationBarSeat"]),eU6=[{id:"t1",code:"VIP 1号厅",area:"Main",cardStatus:"occupied",guestName:"张总",guestPhone:"135****6789",time:"13:00",timeEnd:"15:30",partySize:8,capacityLabel:"12",priceDisplay:"$ 1288",isPaid:!0,delayMinutes:13,progress:.62,progressTone:"warning",nextGuest:"Alex",nextTime:"14:30"},{id:"t2",code:"T-2",area:"Main",cardStatus:"occupied",guestName:"Tom",guestPhone:"138****1024",time:"13:30",partySize:4,priceDisplay:"$ 680",isPaid:!1,topAccentOrange:!0,elapsedLabel:"1h45m",progress:.35,progressTone:"success"},{id:"t3",code:"T-3",area:"Main",cardStatus:"booked",guestName:"Grace",time:"14:08",partySize:5,startsInMinutes:8},{id:"t4",code:"T-4",area:"Main",cardStatus:"booked",guestName:"Rachel Wu",guestPhone:"186****5511",time:"14:00",partySize:4,lateMinutes:8,nextGuest:"David",nextTime:"15:00"},{id:"t5",code:"T-5",area:"Main",cardStatus:"booked",guestName:"Sophia",time:"12:00",partySize:4},{id:"t6",code:"大包 C2",area:"Main",cardStatus:"booked",capacityLabel:"10",slots:[{name:"James",time:"10:00-12:00",progress:.45},{name:"Wang Li",time:"12:30-14:00",progress:.28}],moreCount:4},{id:"t7",code:"T-7",area:"Main",cardStatus:"available"},{id:"t8",code:"T-8",area:"Main",cardStatus:"maintenance",capacityLabel:"6p"},{id:"p1",code:"P-1",area:"Private",cardStatus:"occupied",slots:[{name:"Michael",time:"13:45"},{name:"Grace",time:"14:00"}],moreCount:3},{id:"p2",code:"P-2",area:"Private",cardStatus:"booked",guestName:"Mark",time:"13:00",partySize:2},{id:"b1",code:"B-1",area:"Bar",cardStatus:"barBusy",time:"14:00",partySize:2,barRemainingLabel:"1h10m"},{id:"b2",code:"B-2",area:"Bar",cardStatus:"occupied",time:"13:45",partySize:1,barRemainingLabel:"55m"},{id:"b3",code:"B-3",area:"Bar",cardStatus:"booked",time:"13:30",partySize:4},{id:"b4",code:"B-4",area:"Bar",cardStatus:"occupied",barSlots:[{name:"Sarah",time:"13:50"},{name:"Kevin",time:"14:15"}]},{id:"b5",code:"B-5",area:"Bar",cardStatus:"available"},{id:"b6",code:"B-6",area:"Bar",cardStatus:"booked",time:"13:30",partySize:4},{id:"b7",code:"B-7",area:"Bar",cardStatus:"maintenance"},{id:"mock-rw-available",code:"Mock\xb7空场(绿)",area:"WallDemo",cardStatus:"available"},{id:"mock-rw-ending",code:"Mock\xb7将结束(橙)",area:"WallDemo",cardStatus:"occupied",guestName:"倒计时≤10分",time:"14:00",delayMinutes:56},{id:"mock-rw-expired",code:"Mock\xb7已超时(红)",area:"WallDemo",cardStatus:"occupied",guestName:"应已清场",time:"11:00",delayMinutes:60},{id:"mock-rw-maint",code:"Mock\xb7维护态",area:"WallDemo",cardStatus:"maintenance",capacityLabel:"8p"},{id:"mock-rw-lights-off",code:"Mock\xb7灯已关",area:"WallDemo",cardStatus:"occupied",guestName:"场上无人",time:"13:00",delayMinutes:30,resourceWallLightState:"off"},{id:"mock-rw-lights-off-soon",code:"Mock\xb7即将关灯",area:"WallDemo",cardStatus:"occupied",guestName:"场上进行中",time:"15:00",delayMinutes:25,resourceWallLightState:"on_soon_off",resourceWallLightOffInMin:6},{id:"mock-rw-lights-on-soon",code:"Mock\xb7即将开灯",area:"WallDemo",cardStatus:"booked",guestName:"下一场将开",time:"16:00",startsInMinutes:12,resourceWallLightState:"off_soon_on",resourceWallLightOnInMin:8,nextGuest:"下一场\xb7李娜",nextTime:"16:00"}],eU5="tables",eU7="main";function eU9(){return[{id:"dining",label:eN.getText(eUU),order:0},{id:"background",label:eN.getText(eUY),order:1}]}function eWe(){return[{value:lL.FLOOR_MAP_IMAGE_ELEMENT_KIND,label:eN.getText(eUq),categoryId:"background",dataBindingPolicy:"none",showInPalette:!0},{value:lL.FLOOR_MAP_BUILTIN_SHAPE_ELEMENT_KIND,label:eN.getText(eUW),categoryId:"background",dataBindingPolicy:"none",showInPalette:!0},{value:eU4,label:eN.getText(eUG),categoryId:"dining",dataBindingPolicy:"optional",allowedDataSourceKeys:[eU5],showInPalette:!0,nameAsTitleConfigurable:!0},{value:eU3,label:eN.getText(eUQ),categoryId:"dining",dataBindingPolicy:"optional",allowedDataSourceKeys:[eU5],defaultShape:"circle",showInPalette:!0,nameAsTitleConfigurable:!0}]}let eWt="secondary",eWl=[{instanceId:"res_t1",canvasId:eU7,x:40,y:40,width:150,height:100,name:"T-1",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"t1"}},{instanceId:"res_t2",canvasId:eU7,x:210,y:40,width:150,height:100,name:"T-2",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"t2"}},{instanceId:"res_t3",canvasId:eU7,x:380,y:40,width:150,height:100,name:"T-3",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"t3"}},{instanceId:"res_p2",canvasId:eU7,x:550,y:40,width:140,height:100,name:"P-2",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"p2"}},{instanceId:"res_t4",canvasId:eU7,x:40,y:170,width:150,height:100,name:"T-4",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"t4"}},{instanceId:"res_t5",canvasId:eU7,x:210,y:170,width:150,height:100,name:"T-5",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"t5"}},{instanceId:"res_t6",canvasId:eU7,x:380,y:170,width:150,height:100,name:"T-6",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"t6"}},{instanceId:"res_p1",canvasId:eU7,x:710,y:40,width:240,height:240,name:"P-1",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"p1"}},{instanceId:"res_t7",canvasId:eU7,x:40,y:300,width:150,height:100,name:"T-7",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"t7"}},{instanceId:"res_t8",canvasId:eU7,x:210,y:300,width:150,height:100,name:"T-8",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"t8"}},{instanceId:"res_b1",canvasId:eU7,x:40,y:440,width:90,height:90,name:"B-1",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"b1"}},{instanceId:"res_b2",canvasId:eU7,x:150,y:440,width:90,height:90,name:"B-2",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"b2"}},{instanceId:"res_b3",canvasId:eU7,x:260,y:440,width:90,height:90,name:"B-3",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"b3"}},{instanceId:"res_b4",canvasId:eU7,x:370,y:440,width:90,height:90,name:"B-4",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"b4"}},{instanceId:"res_b5",canvasId:eU7,x:480,y:440,width:90,height:90,name:"B-5",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"b5"}},{instanceId:"res_b6",canvasId:eU7,x:590,y:440,width:90,height:90,name:"B-6",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"b6"}},{instanceId:"res_b7",canvasId:eU7,x:700,y:440,width:90,height:90,name:"B-7",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"b7"}},{instanceId:"res_mock_rw_available",canvasId:eU7,x:30,y:560,width:100,height:80,name:"Mock\xb7空场",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"mock-rw-available"}},{instanceId:"res_mock_rw_ending",canvasId:eU7,x:148,y:560,width:100,height:80,name:"Mock\xb7将结束",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"mock-rw-ending"}},{instanceId:"res_mock_rw_expired",canvasId:eU7,x:266,y:560,width:100,height:80,name:"Mock\xb7超时",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"mock-rw-expired"}},{instanceId:"res_mock_rw_maint",canvasId:eU7,x:384,y:560,width:100,height:80,name:"Mock\xb7维护",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"mock-rw-maint"}},{instanceId:"res_mock_rw_lights_off",canvasId:eU7,x:502,y:560,width:100,height:80,name:"Mock\xb7灯关",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"mock-rw-lights-off"}},{instanceId:"res_mock_rw_lights_off_soon",canvasId:eU7,x:620,y:560,width:100,height:80,name:"Mock\xb7将关灯",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"mock-rw-lights-off-soon"}},{instanceId:"res_mock_rw_lights_on_soon",canvasId:eU7,x:738,y:560,width:100,height:80,name:"Mock\xb7将开灯",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"mock-rw-lights-on-soon"}}];function eWa(){return{canvases:[{id:eU7,name:eU0,order:0,enabled:!0},{id:eWt,name:eU2,order:1,enabled:!0},{id:"vip",name:eU1,order:2,enabled:!0}],canvasUi:{canCreate:!0,canEdit:!0},elementKindCategories:eU9(),elementKinds:eWe(),sceneElements:eWl.map(e=>({...e,dataBinding:e.dataBinding?{...e.dataBinding}:void 0}))}}eWl.map(e=>{let t={dataSourceKey:e.dataBinding.dataSourceKey,id:String(e.dataBinding.recordId),floorMapId:e.canvasId,x:e.x,y:e.y,name:String(e.name??""),width:e.width,height:e.height,elementKind:String(e.elementKind??"")};return"circle"===e.shape&&(t.shape="circle"),t});var eWi=JSON.parse('{"name":{"en":"Reservation","ja":"予約","pt":"Reserva","zh-CN":"预约","zh-HK":"預約"},"layout":{"canvases":[{"id":"main","name":{"en":"Main Area","ja":"メインエリア","pt":"\xc1rea Principal","zh-CN":"主区域","zh-HK":"主區域"},"order":0,"enabled":true,"mapLayer":{"showGrid":false}},{"id":"secondary","name":{"en":"Secondary Area","ja":"Secondary Area","pt":"Secondary Area","zh-CN":"副区域","zh-HK":"副區域"},"order":1,"enabled":true,"mapLayer":{"showGrid":false}},{"id":"vip","name":{"en":"VIP Area","ja":"VIP Area","pt":"VIP Area","zh-CN":"VIP 区","zh-HK":"VIP 區"},"order":2,"enabled":true,"mapLayer":{"showGrid":false}}],"canvasUi":{"canCreate":true,"canEdit":true},"elementKindCategories":[{"id":"dining","label":"Resource","order":0},{"id":"background","label":"Decorations","order":1}],"elementKinds":[{"value":"floorMapImage","label":"Image (background)","categoryId":"background","dataBindingPolicy":"none","showInPalette":true},{"label":"Bound resource","value":"reservationBoundTable","categoryId":"dining","showInPalette":true,"dataBindingPolicy":"optional","allowedDataSourceKeys":["tables"],"nameAsTitleConfigurable":true},{"label":"Bound round table","value":"reservationBoundRoundTable","categoryId":"dining","defaultShape":"circle","showInPalette":true,"dataBindingPolicy":"optional","allowedDataSourceKeys":["tables"],"nameAsTitleConfigurable":true}],"sceneElements":[]},"canvas_width":1920,"canvas_height":1080,"code":"pisell_reservation"}');let eWn=(0,lL.createShopFloorPlanClient)({http:{get:(e,t,l)=>z_.Em.getRequest().get(e,t??{},l??{}),post:(e,t,l)=>z_.Em.getRequest().post(e,t??{},l??{}),put:(e,t,l)=>z_.Em.getRequest().put(e,t??{},l??{})},useShopApi:!0,getSaveFailedMessage:()=>eN.getText("pisell-reservation.floor-plan.save-failed")});eWn.getShopFloorPlanByCode.bind(eWn),eWn.postShopFloorPlan.bind(eWn);let eWs=eWn.putShopFloorPlan.bind(eWn),eWr=eWn.unsubscribeShopFloorPlanCodeQuery.bind(eWn);async function eWo(e,t){return eWn.ensureShopFloorPlanByCode(e,{...t,buildDefaultPostBody:eWd})}function eWd(e){let t=null==e?void 0:e.trim();if(!t)throw Error("floor plan code is required");return{code:t,name:{...eWi.name},layout:JSON.parse(JSON.stringify(eWi.layout)),canvas_width:eWi.canvas_width,canvas_height:eWi.canvas_height,...void 0!==eWi.sort?{sort:eWi.sort}:{},...void 0!==eWi.status?{status:eWi.status}:{}}}async function eWc(e,t,l){let a=(0,lL.buildFloorPlanPutBody)(t,l);return(l.putFloorPlan??eWs)(e,a)}function eWu(e){let t=e instanceof Error?e.message:String(e);(0,lL.PisellToast)({content:t})}function eWp(e){let t=e instanceof Error?e.message:String(e);(0,lL.PisellToast)({content:t})}let eWm=()=>({ticket:eN.getText("pisell2.salesManagement.business.ticket_order"),appointment_booking:eN.getText("pisell2.salesManagement.business.appointment_booking")}),eWg={ticket:"#CEEAB0",appointment_booking:"#C7D7FE"},eWh=ex.Tag,eWv=(e,t)=>{let l=Number(e||0);return`${t||"$"}${l.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`},eWf=e=>e.filter(e=>null!=e&&""!==e),eWy={text:{fontSize:12,color:"#475467",lineHeight:"18px"}},eWx=(e,t)=>e&&t?`${e} ${t}`:e||t||"",eWb=(e,t)=>{if(null==e||""===e)return"";if("string"==typeof e||"number"==typeof e){let l=String(e).trim();if(!l)return"";let a=null!=t&&""!==t?String(t).trim():"";if(a&&!l.startsWith("+")&&!l.startsWith(a)){let e=a.startsWith("+")?a:`+${a}`;return`${e} ${l}`}return l}return"object"==typeof e?eWb((null==e?void 0:e.phone)||(null==e?void 0:e.number),((null==e?void 0:e.country_calling_code)||(null==e?void 0:e.countryCallingCode))??t):""},eW_=e=>{let t=null==e?void 0:e.order,l=null==t?void 0:t.contacts_info,a=Array.isArray(l)?l[0]:l||(Array.isArray(null==t?void 0:t.contacts)?t.contacts[0]:null);if(!a)return{contact:null,phone:"",email:"",compareValue:"-"};let i=eWb(null==a?void 0:a.phone,null==a?void 0:a.country_calling_code),n=String(a.email||"").trim(),s=[null==a?void 0:a.display_name,null==a?void 0:a.first_name,null==a?void 0:a.last_name,i,n].filter(Boolean).join("|");return{contact:a,phone:i,email:n,compareValue:s||"-"}},eWk=e=>{let{className:t,dataSource:l,labels:a,style:i,variant:n}=e,s="phone"===n,r="string"==typeof(null==l?void 0:l.note)?l.note.trim():"",o=(0,ef.useMemo)(()=>{var e;return(e=null==l?void 0:l.internalNotes)?Array.isArray(e)?e.map((e,t)=>"string"==typeof e||"number"==typeof e?{id:t,content:String(e)}:e&&"object"==typeof e?e:{id:t,content:String(e)}).filter(e=>(null==e?void 0:e.content)!=null&&(null==e?void 0:e.content)!==""):"string"==typeof e||"number"==typeof e?[{id:0,content:String(e)}]:[]:[]},[null==l?void 0:l.internalNotes]),d=(0,ef.useMemo)(()=>{let e=[];return r&&e.push({label:(null==a?void 0:a.orderNote)||eN.getText("pisell2.salesManagement.booking.notes.orderNotes"),content:r}),e},[r,o,null==a?void 0:a.orderNote,null==a?void 0:a.internalNote]),c=d.slice(0,2),u=d.length>0,[p,m]=(0,ef.useState)(!1);if(!d.length)return null;let g=r?[{id:0,content:r}]:[],h=!!(null==l?void 0:l.apis);return(0,ev.jsxs)("div",{className:["pisell-sales-management-booking-notes-preview",`pisell-sales-management-booking-notes-preview--${n||"desktop"}`,t].filter(Boolean).join(" "),style:i,onClick:e=>e.stopPropagation(),children:[(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",cursor:"pointer"},onClick:e=>{e.stopPropagation(),m(!0)},children:[c.map((e,t)=>(0,ev.jsxs)("div",{style:{...eWy.text,fontSize:14,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[(0,ev.jsxs)("span",{children:[e.label,":"]})," ",(0,ev.jsx)("span",{style:{color:"#eaa96f"},children:e.content})]},`${e.label}-${t}`)),u?(0,ev.jsxs)("div",{style:{color:"#7f56d9",display:"flex",alignItems:"center"},children:[(null==a?void 0:a.more)||eN.getText("pisell2.salesManagement.booking.view-more"),(0,ev.jsx)(lL.Icon,{size:20,type:"pisell2-chevron-right-double"})]}):null]}),(0,ev.jsx)(iB,{renderType:s?"drawer":"modal",props:s?{open:p,title:eN.getText("pisell2.salesManagement.booking.notes.title"),placement:"bottom",width:"100%",height:"auto",platform:"h5",footer:null,onClose:()=>m(!1),destroyOnClose:!0,bodyStyle:{overflowX:"hidden"}}:{open:p,title:eN.getText("pisell2.salesManagement.booking.notes.title"),width:600,platform:"pc",footer:null,onCancel:()=>m(!1),destroyOnClose:!0,bodyStyle:{overflowX:"hidden"}},children:(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[(0,ev.jsx)(VE,{noteType:"order",maxLength:1,title:`${eN.getText("pisell2.salesManagement.booking.notes.orderNotes")}:`,describe:"",notes:g,apis:null==l?void 0:l.apis,placeholder:eN.getText("pisell2.salesManagement.booking.notes.addOrderNotes"),isEdit:h,onChange:null==l?void 0:l.onChange}),!1]})})]})};eWk.displayName="BookingNotesPreview";let eWw=iW(eWk),eWj=e=>{var t;let l=ik(),a=(null==l||null==(t=l.appHelper)?void 0:t.utils)||{},{value:i,uniqueTables:n,bookingLabels:s,textStyles:r,relationId:o,relationType:d,customer:c}=e,u=Array.isArray(i)?i:[],[p,m]=(0,ef.useState)(!1),[g,h]=(0,ef.useState)(null),v=rP(BU,{manual:!0}),[f,y]=(0,ef.useState)(!1),[x,b]=(0,ef.useState)(!1),_=(0,ef.useMemo)(()=>u.reduce((e,t)=>{let l=null==t?void 0:t.form_id;if(null!=l){let t=String(l);e[t]=(e[t]||0)+1}return e},{}),[u]),k=(0,ef.useMemo)(()=>(n||[]).map(e=>{var t,l,a,i;let n=(null==e||null==(a=e.form)||null==(l=a.setting)||null==(t=l.title)?void 0:t.original)||(null==e||null==(i=e.form)?void 0:i.title)||"";if(!n)return null;let s=null==e?void 0:e.form_id,r=null!=s&&_[String(s)]||0;return{title:`${n} (${r})`,baseTitle:n,formId:s,count:r,table:e}}).filter(e=>e),[n,_]),w=k.length<=3,j=w?k:k.slice(0,3),S=k.length-j.length,M=(0,ef.useCallback)((e,t)=>{t.stopPropagation(),h(e),m(!0),b(!1),v.loading||f||(y(!0),v.run({relation_type:d||"appointment_booking",relation_id:o}))},[v,o,f,d]),N=(0,ef.useMemo)(()=>Array.isArray(v.data)?v.data:[],[v.data]),C=(0,ef.useMemo)(()=>(null==g?void 0:g.formId)?N.find(e=>String(null==e?void 0:e.form_id)===String(null==g?void 0:g.formId)):null,[g,N]);if(0===k.length)return(0,ev.jsx)("div",{style:{minWidth:0,maxWidth:"100%",textAlign:"center"},children:"-"});let T=(0,ev.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:k.map((e,t)=>{let l=e.count>0;return(0,ev.jsx)("div",{style:{fontSize:12,color:l?"#7f56d9":"#98A2B3",textDecoration:l?"underline":"none",whiteSpace:"nowrap",lineHeight:"18px",cursor:l?"pointer":"default"},onClick:t=>{l&&M(e,t)},children:e.title},`${e.title}-${t}`)})});return(0,ev.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{minWidth:0,maxWidth:"100%",overflow:"hidden",boxSizing:"border-box"},children:[w?(0,ev.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:j.map((e,t)=>(0,ev.jsx)("div",{style:{...(null==r?void 0:r.text)||{},color:"#7f56d9",textDecoration:"underline",cursor:"pointer",textAlign:"left",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},onClick:t=>M(e,t),children:e.title},`${e.title}-${t}`))}):(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[j.map((e,t)=>(0,ev.jsx)("div",{style:{...(null==r?void 0:r.text)||{},color:"#475467",textDecoration:"none",cursor:"default",textAlign:"left",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title},`${e.title}-${t}`)),S>0?(0,ev.jsx)(ex.Tooltip,{title:T,open:!p&&x,onOpenChange:e=>{p||b(e)},children:(0,ev.jsx)("div",{style:{...(null==r?void 0:r.text)||{},color:"#7f56d9",textDecoration:"underline",cursor:"default",alignSelf:"flex-start"},children:`+${S} ${eN.getText("pisell2.salesManagement.booking.common.more")}`})}):null]}),(0,ev.jsx)(lL.PisellModal,{open:p,title:null==s?void 0:s.forms,width:600,footer:null,destroyOnClose:!0,onCancel:()=>m(!1),children:v.loading||!f?(0,ev.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"48px 0"},children:(0,ev.jsx)(ex.Spin,{})}):C?(0,ev.jsx)(B_,{forms:[C],value:{[C.form_id]:C.form_record||[]},onChange:()=>{},addCallback:()=>{},client:c,action:a.action}):null})]})},eWS=(e,t)=>{var l,a,i;let n=ik(),s=null==n||null==(l=n.appHelper)?void 0:l.utils,r=null==t?void 0:t.onOpenDetail,o=null==s?void 0:s.translationOriginal,d=null==n||null==(i=n.engine)||null==(a=i.props)?void 0:a.locale,c=BK(),u=null==e?void 0:e.businessCode,p=(0,ef.useMemo)(()=>{let t=eVE(),l={online_store:eN.getText("pisell2.salesManagement.booking.platform.online_store"),wholesalebusiness:eN.getText("pisell2.salesManagement.booking.platform.wholesalebusiness"),"table-order":eN.getText("pisell2.salesManagement.booking.platform.table-order"),mobile_order:eN.getText("pisell2.salesManagement.booking.platform.mobile_order"),kiosk:eN.getText("pisell2.salesManagement.booking.platform.kiosk"),pos:eN.getText("pisell2.salesManagement.booking.platform.pos")},a=eVk(),i=eWm(),n={bookingBrief:eN.getText("pisell2.salesManagement.booking.column.bookingBrief"),serviceTime:eN.getText("pisell2.salesManagement.booking.column.serviceTime"),customer:eN.getText("pisell2.salesManagement.booking.column.customer"),contact:eN.getText("pisell2.salesManagement.booking.column.contact"),holder:eN.getText("pisell2.salesManagement.booking.column.holder"),services:eN.getText("pisell2.salesManagement.booking.column.services"),pax:eN.getText("pisell2.salesManagement.booking.column.pax"),resource:eN.getText("pisell2.salesManagement.booking.column.resource"),forms:eN.getText("pisell2.salesManagement.booking.column.forms"),orderInfo:eN.getText("pisell2.salesManagement.booking.column.orderInfo"),paymentMethod:eN.getText("pisell2.salesManagement.booking.column.paymentMethod"),bookingId:eN.getText("pisell2.salesManagement.booking.column.bookingId"),orderOrigin:eN.getText("pisell2.salesManagement.booking.column.orderOrigin"),updated:eN.getText("pisell2.salesManagement.booking.column.updated"),orderNote:eN.getText("pisell2.salesManagement.booking.common.orderNote"),internalNote:eN.getText("pisell2.salesManagement.booking.common.internalNote"),more:eN.getText("pisell2.salesManagement.booking.common.more"),createdBy:eN.getText("pisell2.salesManagement.booking.common.createdBy"),guest:eN.getText("pisell2.salesManagement.order.common.guest"),walkIn:eN.getText("pisell2.salesManagement.order.common.walkIn")},{relationTables:s}=e||{};return{BOOKING_STATUS_LABEL_MAP:t,BOOKING_PLATFORM_LABEL_MAP:l,PAYMENT_STATUS_LABEL_MAP:a,BUSINESS_LABEL_MAP:i,bookingLabels:n,uniqueTables:(Array.isArray(s)?s:[]).filter(e=>["appointment_booking","ticket","party_room","therapist","table-order","voucher_ticket","mobile_order"].includes(e.relation_type)).reduce((e,t)=>(e.some(e=>e.form_id===t.form_id)||e.push(t),e),[])}},[null==e?void 0:e.relationTables,d]),m=(0,ef.useCallback)(e=>{let{BOOKING_STATUS_LABEL_MAP:t,BOOKING_PLATFORM_LABEL_MAP:l,PAYMENT_STATUS_LABEL_MAP:a,BUSINESS_LABEL_MAP:i,bookingLabels:n,uniqueTables:r}=p;return[{title:n.bookingBrief,key:"booking_brief",width:188,render:(l,a)=>{var i,s,r;let o=eWx(null==a?void 0:a.start_date,null==a?void 0:a.start_time)||(null==a?void 0:a.start_at),d=null==a?void 0:a.appointment_status,c=t[d]||d||"-",u=eVz[d]||"",p=null==a||null==(i=a.order)?void 0:i.note,m=null==a?void 0:a.notes,g=BY(null==a||null==(s=a.order)?void 0:s.id);return(0,ev.jsxs)("div",{className:"pisell-sales-grid-booking-brief",children:[(0,ev.jsx)(VR,{dataSource:null==a||null==(r=a.order)?void 0:r.customer}),o?(0,ev.jsx)(lL.PisellDateTimeDisplay,{value:o,layout:"inline",textAlign:"left",timeFormat:{padHour:!0},dateFormat:{order:"DMY",showYear:!1,shortMonth:!0,showRelativeDay:!0,useCommaBeforeYear:!1},fields:{fieldOrder:["time","weekday","date"]}}):null,(0,ev.jsx)("div",{children:(0,ev.jsx)(eWh,{style:{backgroundColor:u,whiteSpace:"nowrap",border:"none",fontWeight:500},children:c})}),(0,ev.jsx)(eWw,{dataSource:{note:p,internalNotes:m,apis:g,bookingId:null==a?void 0:a.id,onChange:(t,l,a)=>{e.refresh()}},labels:{orderNote:n.orderNote,internalNote:n.internalNote,more:n.more},style:{maxWidth:"100%"}})]})}},{title:n.resource,dataIndex:"relation_form_name",key:"relation_form_name",align:"center",width:100,render:e=>e?(0,ev.jsx)("div",{style:eWy.text,children:e}):"-"},{title:n.serviceTime,key:"service_time",align:"center",width:165,render:(e,t)=>{let l=eWx(null==t?void 0:t.start_date,null==t?void 0:t.start_time)||(null==t?void 0:t.start_at),a=eWx(null==t?void 0:t.end_date,null==t?void 0:t.end_time)||(null==t?void 0:t.end_at);return l&&a?(0,ev.jsx)("div",{style:{textAlign:"center"},children:(0,ev.jsx)(lL.PisellTimeRangeDisplay,{startAt:l,endAt:a})}):null},uniformCompare:(e,t)=>{let{start_date:l="",start_time:a="",end_date:i="",end_time:n=""}=t;return`${l}${a}${i}${n}`}},{title:n.customer,key:"customer",align:"center",width:118,uniformCompare:(e,t)=>{let l=t.order,a=null==l?void 0:l.customer;if(!a)return"-";let i=null==a?void 0:a.guest_code;return i?`${i}`:1===a.user_id?"walk-in":a},render:(e,t)=>{let l=t.order,a=null==l?void 0:l.customer;if(null==a?void 0:a.guest_code)return(0,ev.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:(0,ev.jsx)("div",{style:{fontWeight:"bold"},children:n.guest})});let i=eWf([eWb((null==a?void 0:a.phone)||(null==t?void 0:t.phone),(null==a?void 0:a.country_calling_code)||(null==t?void 0:t.country_calling_code)),null==a?void 0:a.email]);return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[(0,ev.jsx)(VR,{dataSource:a,style:{fontSize:14}}),i.map((e,t)=>(0,ev.jsx)("div",{style:eWy.text,children:e},`${e}-${t}`))]})}},{title:n.contact,key:"contact",align:"center",width:150,uniformCompare:(e,t)=>{var l;return null==(l=eW_(t))?void 0:l.compareValue},render:(e,t)=>{let{contact:l,phone:a,email:i}=eW_(t);if(!l)return"-";let n=eWf([a,i]);return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[(0,ev.jsx)(VR,{dataSource:l,style:{fontSize:14}}),n.map((e,t)=>(0,ev.jsx)("div",{style:eWy.text,children:e},`${e}-${t}`))]})}},{title:n.holder,dataIndex:"holder_data",key:"holder_data",align:"center",width:110,uniformCompare:(e,t)=>e||"-",render:(e,t)=>{var l;let a;if(!e)return"-";let i=Array.isArray(e)?e[0]:e;if(!i)return"-";let n=(null==(l=i.data)?void 0:l.customer_phone)||i.customer_phone;n&&(a=eWb(n));let s=eWf([a]);return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[(0,ev.jsx)(VR,{dataSource:{display_name:i.main_field||t.holder_name||""},style:{fontSize:14}}),s.map((e,t)=>(0,ev.jsx)("div",{style:{...eWy.text,whiteSpace:"nowrap"},children:e},`${e}-${t}`))]})}},{title:n.services,key:"services",align:"center",width:120,render:(e,t)=>{var l;let a=Array.isArray(l=(e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch{return e}})(null==t?void 0:t.order_detail))?l:null==l?[]:[l],i=a.slice(0,3),r=a.length-i.length,o=i.map(e=>{let t=s.translation(e.product_title),l=null==e?void 0:e.product_quantity;return t?l?`${t} x${l}`:String(t):null}).filter(e=>e);return(r>0&&o.push(`+${r} ${n.more}`),0===o.length)?null:(0,ev.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:o.map((e,t)=>(0,ev.jsx)("div",{style:eWy.text,children:e},`${e}-${t}`))})},uniformCompare:(e,t)=>(null==t?void 0:t.order_detail)||""},{title:n.pax,dataIndex:"number",key:"number",align:"center",width:110,render:(e,t)=>{let l=null==t?void 0:t.number;return(0,ev.jsx)("span",{style:{...eWy.text,textAlign:"center"},children:l??"-"})}},{title:n.forms,key:"appointment_form",width:132,align:"center",render:(e,t)=>{var l;return(0,ev.jsx)("div",{style:{width:"100%",maxWidth:132,margin:"0 auto",minWidth:0},children:(0,ev.jsx)(eWj,{value:null==t?void 0:t.appointment_form,uniqueTables:r,bookingLabels:n,textStyles:eWy,relationId:t.parent_id||t.id,relationType:t.item_type,customer:null==(l=t.order)?void 0:l.customer})})}},{title:n.paymentMethod,key:"payment_method",dataIndex:["order","payments"],width:180,align:"center",render:(e,t)=>{let l=(null==t?void 0:t.order)||{},a=Array.isArray(null==l?void 0:l.payments)?l.payments:[],i=null==l?void 0:l.currency_symbol;return 0===a.length?"-":(0,ev.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start"},children:a.map((e,t)=>{var l,a,n;let s=((null==e?void 0:e.voucher_id)?(null==o?void 0:o(null==e||null==(l=e.fund_record)?void 0:l.wallet_pass_name))||(null==e||null==(n=e.fund_record)||null==(a=n.wallet_pass_name)?void 0:a.default):"")||BJ(e,c),r=Number(null==e?void 0:e.amount),d=null==e?void 0:e.payment_time;return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[(0,ev.jsxs)("div",{style:{fontSize:14,lineHeight:"20px",color:"#101828",fontWeight:500,whiteSpace:"nowrap"},children:[(0,ev.jsx)("span",{children:s}),Number.isFinite(r)?(0,ev.jsxs)("span",{children:[": ",eWv(r,i)]}):null]}),d?(0,ev.jsx)(lL.PisellDateTimeDisplay,{value:d,layout:"inline",textAlign:"left",timeFormat:{padHour:!0},dateFormat:{showYear:!1,shortMonth:!0,showRelativeDay:!0,useCommaBeforeYear:!1},fields:{fieldOrder:["time","weekday","date"]},style:{...eWy.text,whiteSpace:"nowrap"}}):null]},(null==e?void 0:e.order_payment_id)||t)})})}},{title:n.orderInfo,key:"order_info",width:124,align:"center",render:(e,t)=>{let l=(null==t?void 0:t.order)||{},i=null==l?void 0:l.shop_full_order_number,n=null==l?void 0:l.total_amount,s=null==l?void 0:l.currency_symbol,r=null==l?void 0:l.payment_status,o=a[r]||"-",d=eVw[r]||"";return(0,ev.jsxs)("div",{className:"pisell-sales-grid-order-info",style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[(0,ev.jsx)("div",{style:{fontWeight:600,textDecoration:"underline",color:"var(--theme-color, #7f56d9)"},children:i||"-"}),null!=n?(0,ev.jsx)("div",{style:eWy.text,children:eWv(n,s)}):null,o?(0,ev.jsx)("div",{children:(0,ev.jsx)(eWh,{style:{backgroundColor:d,whiteSpace:"nowrap",border:"none",fontWeight:500},children:o})}):null]})}},{title:n.bookingId,dataIndex:"booking_id",key:"booking_id",align:"center",width:120,render:e=>(0,ev.jsx)("span",{style:{...eWy.text,textAlign:"center",fontSize:14,fontWeight:400},children:e})},{title:n.orderOrigin,key:"order_origin",width:160,align:"center",render:(e,t)=>{var a,s,r,o,d;let c=(null==t||null==(a=t.order)?void 0:a.business_code)||(null==t?void 0:t.business_code),u=i[c],p=(null==t||null==(s=t.order)?void 0:s.platform)||(null==t||null==(r=t.order)?void 0:r.order_sales_channel),m=l[p]||p,g=(null==t?void 0:t.device_name)||(null==t?void 0:t.device)||(null==t?void 0:t.terminal),h=(null==t?void 0:t.created_at)||(null==t||null==(o=t.order)?void 0:o.created_at),v=(null==t||null==(d=t.order)?void 0:d.create_account)||(null==t?void 0:t.create_account)||(null==t?void 0:t.operator_name),f=eWf([m,g]);return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[u?(0,ev.jsx)("div",{children:(0,ev.jsx)(eWh,{color:eWg[c],style:{color:"black",fontWeight:500},children:u})}):null,f.map((e,t)=>(0,ev.jsx)("div",{style:eWy.text,children:e},`${e}-${t}`)),v?(0,ev.jsxs)("div",{style:{display:"flex",alignItems:"center",...eWy.text},children:[(0,ev.jsxs)("span",{children:[n.createdBy,":"]}),(0,ev.jsx)(VR,{dataSource:v,style:{fontSize:12}})]}):null,(0,ev.jsx)(lL.PisellDateTimeDisplay,{value:h,layout:"inline",textAlign:"left",timeFormat:{padHour:!0},dateFormat:{order:"DMY",showYear:!1,shortMonth:!0,showRelativeDay:!0,useCommaBeforeYear:!1},fields:{fieldOrder:["time","weekday","date"]},style:{whiteSpace:"nowrap"}})]})}},{title:n.updated,key:"updated",width:132,align:"center",render:(e,t)=>{var a,i;let n=(null==t?void 0:t.updated_at)||(null==t||null==(a=t.order)?void 0:a.updated_at),s=(null==t||null==(i=t.order)?void 0:i.platform)||(null==t?void 0:t.order_platform),r=eWf([l[s]||s]);return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[(0,ev.jsx)(lL.PisellDateTimeDisplay,{value:n,layout:"inline",textAlign:"left",timeFormat:{padHour:!0},dateFormat:{order:"DMY",showYear:!1,shortMonth:!0,showRelativeDay:!0,useCommaBeforeYear:!1},fields:{fieldOrder:["time","weekday","date"]},style:{whiteSpace:"nowrap"}}),r.map((e,t)=>(0,ev.jsx)("div",{style:eWy.text,children:e},`${e}-${t}`))]})}}]},[p,o,c]);return(0,ef.useMemo)(()=>({key:"monitor",label:"Monitor",getChildComponentProps:e=>{let t,l,a;return{grid:{bordered:!0,collapseUniformColumns:!0,columns:m(e),defaultHiddenColumnKeys:["order_origin","updated"],scroll:{x:"max-content",autoCalc:!0,scrollToFirstRowOnChange:!0},rowSelection:!1,onRow:e=>({onClick:()=>{var t;if(e.id){if(r)return void r({orderId:null==(t=e.order)?void 0:t.id,record:e});null==s||s.action({type:"pisell1.handleOpenSaleDetail",data:{osProps:{orderId:e.order.id,osKey:"sales-management-item-detail",businessCode:u,syncDetailOnOrderChange:!0}}})}}})},toolBar:{search:{showConfirmButton:!1},sort:{list:[{type:"time",isCustom:!0,name:"after_execution_time",label:eN.getText("pisell2.salesManagement.booking.sort.afterExecutionTime"),getSortItems:()=>[{key:"after_execution_time:asc",label:eN.getText("pisell2.salesManagement.sort.oldestFirst")}]},{type:"time",isCustom:!0,name:"start_at",label:eN.getText("pisell2.salesManagement.booking.sort.startAt"),getSortItems:()=>[{key:"start_at:asc",label:eN.getText("pisell2.salesManagement.sort.oldestFirst")},{key:"start_at:desc",label:eN.getText("pisell2.salesManagement.sort.latestFirst")}]},{type:"time",isCustom:!0,name:"end_at",label:eN.getText("pisell2.salesManagement.booking.sort.endAt"),getSortItems:()=>[{key:"end_at:asc",label:eN.getText("pisell2.salesManagement.sort.oldestFirst")},{key:"end_at:desc",label:eN.getText("pisell2.salesManagement.sort.latestFirst")}]},{type:"time",isCustom:!0,name:"created_at",label:eN.getText("pisell2.salesManagement.booking.sort.createdAt"),getSortItems:()=>[{key:"created_at:asc",label:eN.getText("pisell2.salesManagement.sort.oldestFirst")},{key:"created_at:desc",label:eN.getText("pisell2.salesManagement.sort.newestFirst")}]},{type:"time",isCustom:!0,name:"updated_at",label:eN.getText("pisell2.salesManagement.booking.sort.updatedAt"),getSortItems:()=>[{key:"updated_at:asc",label:eN.getText("pisell2.salesManagement.sort.oldestFirst")},{key:"updated_at:desc",label:eN.getText("pisell2.salesManagement.sort.newestFirst")}],other:{style:{width:"100%"}}}]},filter:{hiddenQuickFilter:!0,defaultFilterValue:{quickFilter:[],otherFilter:(t=eVE(),l=eVj(),a=eVk(),[{name:"appointment_status",type:"single",key:"appointmentStatus",label:eN.getText("pisell2.salesManagement.booking.filter.bookingStatus.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.booking.filter.bookingStatus.placeholder"),options:Object.entries(t).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"number_between",type:"numberRange",key:"number_between",label:eN.getText("pisell2.salesManagement.booking.filter.paxRange.label"),other:{placeholder:eN.getText("pisell2.salesManagement.booking.filter.paxRange.placeholder"),minInputNumberProps:{min:0,precision:0},maxInputNumberProps:{min:0,precision:0}}},{name:"form_record_ids",type:"custom",key:"formRecordIds",label:eN.getText("pisell2.salesManagement.booking.filter.resource.label"),sort:!0,localFilter:!1,other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",component:eVI}},{name:"order_sales_channel",type:"single",key:"orderSalesChannel",label:eN.getText("pisell2.salesManagement.booking.filter.salesChannel.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.booking.filter.salesChannel.placeholder"),options:()=>eVs().then(e=>e.map(e=>({label:e.name,value:e.code})))}},{name:"total_amount_between",type:"numberRange",key:"total_amount_between",label:eN.getText("pisell2.salesManagement.booking.filter.orderAmount.label"),other:{placeholder:eN.getText("pisell2.salesManagement.booking.filter.orderAmount.placeholder")}},{name:"order_status",type:"single",key:"order_status",label:eN.getText("pisell2.salesManagement.booking.filter.orderStatus.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.booking.filter.orderStatus.placeholder"),options:Object.entries(l).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"order_payment_status",type:"single",key:"orderPaymentStatus",label:eN.getText("pisell2.salesManagement.booking.filter.paymentStatus.label"),other:{allowClear:!0,mode:"multiple",placeholder:eN.getText("pisell2.salesManagement.booking.filter.paymentStatus.placeholder"),options:Object.entries(a).map(e=>{let[t,l]=e;return{label:l,value:t}}),maxTagCount:"responsive"}},{name:"customer_id",type:"single",key:"customer_id",label:eN.getText("pisell2.salesManagement.booking.filter.customer.label"),other:{allowClear:!0,isSearchServer:!0,showSearch:!0,placeholder:eN.getText("pisell2.salesManagement.booking.filter.customer.placeholder"),options:e=>eVi(e).then(e=>e.map(e=>({label:e.display_name,value:e.id})))}},{name:"payment_method",type:"single",key:"payment_method",label:eN.getText("pisell2.salesManagement.booking.filter.paymentMethod.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.booking.filter.paymentMethod.placeholder"),options:()=>eVr().then(e=>Array.from(new Map(e.map(e=>[e.code,{label:e.name,value:e.code}])).values()))}},{name:"created_at_between",type:"rangePicker",key:"createdAtBetween",label:eN.getText("pisell2.salesManagement.booking.filter.orderDate.label"),other:{placeholder:eN.getText("pisell2.salesManagement.booking.filter.orderDate.placeholder"),showTime:!0}},{name:"updated_at_between",type:"rangePicker",key:"updatedAtBetween",label:eN.getText("pisell2.salesManagement.booking.filter.updatedDate.label"),other:{placeholder:eN.getText("pisell2.salesManagement.booking.filter.updatedDate.placeholder"),showTime:!0}}]),values:{}}},quickFilter:{hideFilterNamesOnFloorMap:["booking_time_start_between"],filterList:[{type:"rangePicker",name:"booking_time_start_between",key:"bookingTimeStartBetween",props:{placeholder:eN.getText("pisell2.salesManagement.booking.filter.bookingDate.label"),showTime:!0}}]}},batchActionBar:{overflowThreshold:2}}}}),[m,s,d,r,u])},eWM={en:{"pisell2.salesManagement.business.online_store":"Online Store","pisell2.salesManagement.business.ticket_order":"Ticket Order","pisell2.salesManagement.business.appointment_booking":"Appointment Booking","pisell2.salesManagement.sort.balanceDue":"Balance Due","pisell2.salesManagement.sort.oldestFirst":"Oldest First","pisell2.salesManagement.sort.newestFirst":"Newest First","pisell2.salesManagement.sort.latestFirst":"Newest First","pisell2.salesManagement.booking.column.bookingBrief":"Booking Brief","pisell2.salesManagement.booking.column.serviceTime":"Service Time","pisell2.salesManagement.booking.column.customer":"Customer","pisell2.salesManagement.booking.column.contact":"Contact","pisell2.salesManagement.booking.column.holder":"Holder","pisell2.salesManagement.booking.column.services":"Services","pisell2.salesManagement.booking.column.pax":"Pax","pisell2.salesManagement.booking.column.resource":"Resource","pisell2.salesManagement.booking.column.forms":"Forms","pisell2.salesManagement.booking.column.orderInfo":"Order Info","pisell2.salesManagement.booking.column.bookingId":"Booking ID","pisell2.salesManagement.booking.column.orderOrigin":"Order Origin","pisell2.salesManagement.booking.column.updated":"Updated","pisell2.salesManagement.booking.status.new":"New","pisell2.salesManagement.booking.status.confirmed":"Confirmed","pisell2.salesManagement.booking.status.arrived":"Arrived","pisell2.salesManagement.booking.status.started":"Started","pisell2.salesManagement.booking.status.cancelled":"Cancelled","pisell2.salesManagement.booking.status.no_show":"No show","pisell2.salesManagement.booking.status.completed":"Completed","pisell2.salesManagement.booking.platform.online_store":"Online Store","pisell2.salesManagement.booking.platform.wholesalebusiness":"Wholesale Business","pisell2.salesManagement.booking.platform.table-order":"Table Order","pisell2.salesManagement.booking.platform.mobile_order":"Mobile Order","pisell2.salesManagement.booking.platform.kiosk":"Kiosk","pisell2.salesManagement.booking.platform.pos":"POS","pisell2.salesManagement.booking.view-more":"View more","pisell2.salesManagement.booking.common.orderNote":"Order Note","pisell2.salesManagement.booking.common.internalNote":"Internal Note","pisell2.salesManagement.booking.common.more":"more","pisell2.salesManagement.booking.common.createdBy":"Created by","pisell2.salesManagement.booking.notes.title":"Notes","pisell2.salesManagement.booking.notes.orderNotes":"Order notes","pisell2.salesManagement.booking.notes.internalNotes":"Internal notes","pisell2.salesManagement.booking.notes.addOrderNotes":"Add Order note","pisell2.salesManagement.booking.notes.addInternalNotes":"Add Internal note","pisell2.salesManagement.booking.notes.internalVisibleOnlyTip":"Visible only to your team members","pisell2.salesManagement.booking.filter.bookingStatus.label":"Booking Status","pisell2.salesManagement.booking.filter.bookingStatus.placeholder":"Please select booking status","pisell2.salesManagement.booking.filter.bookingDate.label":"Booking Date & Time","pisell2.salesManagement.booking.filter.bookingDate.placeholder":"Please select booking date","pisell2.salesManagement.booking.filter.holder.label":"Holder","pisell2.salesManagement.booking.filter.holder.placeholder":"Please enter holder","pisell2.salesManagement.booking.filter.paxRange.label":"Pax Range","pisell2.salesManagement.booking.filter.paxRange.placeholder":"Please enter pax range","pisell2.salesManagement.booking.filter.resource.label":"Resource","pisell2.salesManagement.booking.filter.resource.placeholder":"Please select resource","pisell2.salesManagement.booking.filter.resource.none":"No Resource","pisell2.salesManagement.booking.filter.salesChannel.label":"Sales Channel","pisell2.salesManagement.booking.filter.salesChannel.placeholder":"Please select sales channel","pisell2.salesManagement.booking.filter.orderAmount.label":"Order Amount","pisell2.salesManagement.booking.filter.orderAmount.placeholder":"Please enter order amount","pisell2.salesManagement.booking.filter.orderStatus.label":"Order Status","pisell2.salesManagement.booking.filter.orderStatus.placeholder":"Please select order status","pisell2.salesManagement.booking.filter.paymentStatus.label":"Payment Status","pisell2.salesManagement.booking.filter.paymentStatus.placeholder":"Please select payment status","pisell2.salesManagement.booking.filter.customer.label":"Customer","pisell2.salesManagement.booking.filter.customer.placeholder":"Please select customer","pisell2.salesManagement.booking.filter.includeItems.label":"Include Items","pisell2.salesManagement.booking.filter.includeItems.placeholder":"Please select items","pisell2.salesManagement.booking.filter.paymentMethod.label":"Payment Method","pisell2.salesManagement.booking.filter.paymentMethod.placeholder":"Please select payment method","pisell2.salesManagement.booking.column.paymentMethod":"Payment Method","pisell2.salesManagement.booking.filter.orderDate.label":"Order Date","pisell2.salesManagement.booking.filter.orderDate.placeholder":"Please select order date","pisell2.salesManagement.booking.filter.updatedDate.label":"Updated Date","pisell2.salesManagement.booking.filter.updatedDate.placeholder":"Please select updated date","pisell2.salesManagement.booking.sort.afterExecutionTime":"After Execution Time","pisell2.salesManagement.booking.sort.startAt":"Start Time","pisell2.salesManagement.booking.sort.endAt":"End Time","pisell2.salesManagement.booking.sort.createdAt":"Created Time","pisell2.salesManagement.booking.sort.updatedAt":"Last Updated","pisell2.salesManagement.booking.sort.totalAmount":"Total Amount","pisell2.salesManagement.booking.sort.refundedAmount":"Refunded Amount","pisell2.salesManagement.booking.sort.customerName":"Customer Name","pisell2.salesManagement.order.column.saleBrief":"Sale Brief","pisell2.salesManagement.order.column.customer":"Customer","pisell2.salesManagement.order.column.contact":"Contact","pisell2.salesManagement.order.column.paymentInfo":"Payment Info","pisell2.salesManagement.order.column.paymentMethod":"Payment Method","pisell2.salesManagement.order.column.items":"Items","pisell2.salesManagement.order.column.paymentStatus":"Payment Status","pisell2.salesManagement.order.column.orderOrigin":"Order Origin","pisell2.salesManagement.order.column.shippingMethod":"Shipping Method","pisell2.salesManagement.order.column.fulfillmentMethod":"Fulfillment","pisell2.salesManagement.order.column.orderStatus":"Order Status","pisell2.salesManagement.order.column.fulfillmentStatus":"Fulfillment Status","pisell2.salesManagement.order.column.updated":"Updated","pisell2.salesManagement.order.column.orderId":"Sale ID","pisell2.salesManagement.order.common.orderNote":"Order Note","pisell2.salesManagement.order.common.internalNote":"Internal Note","pisell2.salesManagement.order.common.createdBy":"Created by","pisell2.salesManagement.order.common.guest":"Guest","pisell2.salesManagement.order.common.walkIn":"Walk-in","pisell2.salesManagement.order.paymentStatus.authorized":"Authorized","pisell2.salesManagement.order.paymentStatus.paid":"Paid","pisell2.salesManagement.order.paymentStatus.partially_paid":"Partially Paid","pisell2.salesManagement.order.paymentStatus.partially_refunded":"Partially Refunded","pisell2.salesManagement.order.paymentStatus.payment_pending":"Payment Pending","pisell2.salesManagement.order.paymentStatus.refunded":"Refunded","pisell2.salesManagement.order.paymentStatus.unpaid":"Unpaid","pisell2.salesManagement.order.paymentStatus.voided":"Voided","pisell2.salesManagement.order.paymentStatus.payment_processing":"Payment Processing","pisell2.salesManagement.order.platform.online_store":"Online Store","pisell2.salesManagement.order.platform.wholesalebusiness":"Wholesale Business","pisell2.salesManagement.order.platform.table-order":"Table Order","pisell2.salesManagement.order.platform.mobile_order":"Mobile Order","pisell2.salesManagement.order.platform.kiosk":"Kiosk","pisell2.salesManagement.order.platform.pos":"POS","pisell2.salesManagement.order.orderStatus.open":"Open","pisell2.salesManagement.order.orderStatus.completed":"Completed","pisell2.salesManagement.order.orderStatus.cancelled":"Cancelled","pisell2.salesManagement.order.fulfillmentStatus.fulfilled":"Fulfilled","pisell2.salesManagement.order.fulfillmentStatus.unfulfilled":"Unfulfilled","pisell2.salesManagement.order.fulfillmentStatus.fulfilling":"Fulfilling","pisell2.salesManagement.order.fulfillmentStatus.partial_fulfilled":"Partially Fulfilled","pisell2.salesManagement.order.deliveryType.nil":"No Delivery Required","pisell2.salesManagement.order.deliveryType.shipping":"Shipping","pisell2.salesManagement.order.deliveryType.local_delivery":"Local Delivery","pisell2.salesManagement.order.deliveryType.pickup":"Pickup","pisell2.salesManagement.order.deliveryType.shop_service":"Shop Service","pisell2.salesManagement.order.shopServiceType.dine-in":"Dine-in","pisell2.salesManagement.order.shopServiceType.takeaway":"Takeaway","pisell2.salesManagement.order.common.itemsCount":" items","pisell2.salesManagement.order.common.totalAmount":"Total","pisell2.salesManagement.order.common.paidAmount":"Paid","pisell2.salesManagement.order.common.dueAmount":"Due","pisell2.salesManagement.order.common.refundedAmount":"Refunded","pisell2.salesManagement.order.quickFilter.orderDate.placeholder":"Please select order date","pisell2.salesManagement.order.filter.orderStatus.label":"Order Status","pisell2.salesManagement.order.filter.orderStatus.placeholder":"Please select order status","pisell2.salesManagement.order.filter.paymentStatus.label":"Payment Status","pisell2.salesManagement.order.filter.paymentStatus.placeholder":"Please select payment status","pisell2.salesManagement.order.filter.fulfillmentStatus.label":"Fulfillment Status","pisell2.salesManagement.order.filter.fulfillmentStatus.placeholder":"Please select fulfillment status","pisell2.salesManagement.order.filter.customer.label":"Customer","pisell2.salesManagement.order.filter.customer.placeholder":"Please select customer","pisell2.salesManagement.order.filter.salesChannel.label":"Sales Channel","pisell2.salesManagement.order.filter.salesChannel.placeholder":"Please select sales channel","pisell2.salesManagement.order.filter.paymentMethod.label":"Payment Method","pisell2.salesManagement.order.filter.paymentMethod.placeholder":"Please select payment method","pisell2.salesManagement.order.filter.totalAmount.label":"Order Amount Range","pisell2.salesManagement.order.filter.totalAmount.placeholder":"Please enter","pisell2.salesManagement.order.filter.tags.label":"Tags","pisell2.salesManagement.order.filter.tags.placeholder":"Please select tags","pisell2.salesManagement.order.filter.deliveryType.label":"Delivery Type","pisell2.salesManagement.order.filter.deliveryType.placeholder":"Please select delivery type","pisell2.salesManagement.order.filter.fulfillmentMethod.label":"Fulfillment","pisell2.salesManagement.order.filter.fulfillmentMethod.placeholder":"Please select fulfillment","pisell2.salesManagement.order.filter.deliveryZone.label":"Delivery Zone","pisell2.salesManagement.order.filter.deliveryZone.placeholder":"Please select delivery zone","pisell2.salesManagement.order.filter.pickupLocation.label":"Pickup Location","pisell2.salesManagement.order.filter.pickupLocation.placeholder":"Please select pickup location","pisell2.salesManagement.order.filter.trackingNumber.label":"Tracking Number","pisell2.salesManagement.order.filter.trackingNumber.placeholder":"Please enter tracking number","pisell2.salesManagement.order.filter.logistics.label":"Logistics Company","pisell2.salesManagement.order.filter.logistics.placeholder":"Please select logistics company","pisell2.salesManagement.order.filter.zipCode.label":"Zip Code","pisell2.salesManagement.order.filter.zipCode.placeholder":"Please enter zip code","pisell2.salesManagement.order.sort.createdAt":"Created Time","pisell2.salesManagement.order.sort.updatedAt":"Updated Time","pisell2.salesManagement.order.sort.totalAmount":"Order Amount","pisell2.salesManagement.order.sort.customerName":"Customer Name"},"zh-CN":{"pisell2.salesManagement.business.online_store":"在线店铺","pisell2.salesManagement.business.ticket_order":"票务订单","pisell2.salesManagement.business.appointment_booking":"预约","pisell2.salesManagement.sort.balanceDue":"待收金额","pisell2.salesManagement.sort.oldestFirst":"最早优先","pisell2.salesManagement.sort.newestFirst":"最新优先","pisell2.salesManagement.sort.latestFirst":"最晚优先","pisell2.salesManagement.booking.column.bookingBrief":"预约摘要","pisell2.salesManagement.booking.column.serviceTime":"服务时间","pisell2.salesManagement.booking.column.customer":"客户","pisell2.salesManagement.booking.column.contact":"联系人","pisell2.salesManagement.booking.column.holder":"持有人","pisell2.salesManagement.booking.column.services":"服务项目","pisell2.salesManagement.booking.column.pax":"参与人数","pisell2.salesManagement.booking.column.resource":"资源","pisell2.salesManagement.booking.column.forms":"表单","pisell2.salesManagement.booking.column.orderInfo":"订单信息","pisell2.salesManagement.booking.column.bookingId":"预约编号","pisell2.salesManagement.booking.column.orderOrigin":"订单来源","pisell2.salesManagement.booking.column.updated":"更新","pisell2.salesManagement.booking.status.new":"新建","pisell2.salesManagement.booking.status.confirmed":"已确认","pisell2.salesManagement.booking.status.arrived":"已到达","pisell2.salesManagement.booking.status.started":"已开始","pisell2.salesManagement.booking.status.cancelled":"已取消","pisell2.salesManagement.booking.status.no_show":"未到场","pisell2.salesManagement.booking.status.completed":"已完成","pisell2.salesManagement.booking.platform.online_store":"在线店铺","pisell2.salesManagement.booking.platform.wholesalebusiness":"批发业务","pisell2.salesManagement.booking.platform.table-order":"扫码点餐","pisell2.salesManagement.booking.platform.mobile_order":"移动点餐","pisell2.salesManagement.booking.platform.kiosk":"Kiosk","pisell2.salesManagement.booking.platform.pos":"终端","pisell2.salesManagement.booking.common.orderNote":"订单备注","pisell2.salesManagement.booking.common.internalNote":"内部备注","pisell2.salesManagement.booking.view-more":"查看更多","pisell2.salesManagement.booking.common.more":"更多","pisell2.salesManagement.booking.common.createdBy":"创建人","pisell2.salesManagement.booking.notes.title":"备注","pisell2.salesManagement.booking.notes.orderNotes":"订单备注","pisell2.salesManagement.booking.notes.internalNotes":"内部备注","pisell2.salesManagement.booking.notes.addOrderNotes":"添加订单备注","pisell2.salesManagement.booking.notes.addInternalNotes":"添加内部备注","pisell2.salesManagement.booking.notes.internalVisibleOnlyTip":"仅团队成员可见","pisell2.salesManagement.booking.filter.bookingStatus.label":"预约状态","pisell2.salesManagement.booking.filter.bookingStatus.placeholder":"请选择预约状态","pisell2.salesManagement.booking.filter.bookingDate.label":"预约日期&时间","pisell2.salesManagement.booking.filter.bookingDate.placeholder":"请选择预约日期","pisell2.salesManagement.booking.filter.holder.label":"持有人","pisell2.salesManagement.booking.filter.holder.placeholder":"请输入持有人","pisell2.salesManagement.booking.filter.paxRange.label":"参与人数区间","pisell2.salesManagement.booking.filter.paxRange.placeholder":"请输入参与人数区间","pisell2.salesManagement.booking.filter.resource.label":"资源","pisell2.salesManagement.booking.filter.resource.placeholder":"请选择资源","pisell2.salesManagement.booking.filter.resource.none":"无资源","pisell2.salesManagement.booking.filter.salesChannel.label":"销售渠道","pisell2.salesManagement.booking.filter.salesChannel.placeholder":"请选择销售渠道","pisell2.salesManagement.booking.filter.orderAmount.label":"订单金额区间","pisell2.salesManagement.booking.filter.orderAmount.placeholder":"请输入订单金额区间","pisell2.salesManagement.booking.filter.orderStatus.label":"订单状态","pisell2.salesManagement.booking.filter.orderStatus.placeholder":"请选择订单状态","pisell2.salesManagement.booking.filter.paymentStatus.label":"支付状态","pisell2.salesManagement.booking.filter.paymentStatus.placeholder":"请选择支付状态","pisell2.salesManagement.booking.filter.customer.label":"客户","pisell2.salesManagement.booking.filter.customer.placeholder":"请选择客户","pisell2.salesManagement.booking.filter.includeItems.label":"商品包含","pisell2.salesManagement.booking.filter.includeItems.placeholder":"请选择商品","pisell2.salesManagement.booking.filter.paymentMethod.label":"支付方式","pisell2.salesManagement.booking.filter.paymentMethod.placeholder":"请选择支付方式","pisell2.salesManagement.booking.column.paymentMethod":"支付方式","pisell2.salesManagement.booking.filter.orderDate.label":"下单时间","pisell2.salesManagement.booking.filter.orderDate.placeholder":"请选择下单时间","pisell2.salesManagement.booking.filter.updatedDate.label":"更新时间","pisell2.salesManagement.booking.filter.updatedDate.placeholder":"请选择更新时间","pisell2.salesManagement.booking.sort.afterExecutionTime":"现场执行时间","pisell2.salesManagement.booking.sort.startAt":"开始时间","pisell2.salesManagement.booking.sort.endAt":"结束时间","pisell2.salesManagement.booking.sort.createdAt":"创建时间","pisell2.salesManagement.booking.sort.updatedAt":"更新时间","pisell2.salesManagement.booking.sort.totalAmount":"订单金额","pisell2.salesManagement.booking.sort.refundedAmount":"退款金额","pisell2.salesManagement.booking.sort.customerName":"客户名称","pisell2.salesManagement.order.column.saleBrief":"销售摘要","pisell2.salesManagement.order.column.customer":"客户","pisell2.salesManagement.order.column.contact":"联系人","pisell2.salesManagement.order.column.paymentInfo":"支付信息","pisell2.salesManagement.order.column.paymentMethod":"支付方式","pisell2.salesManagement.order.column.items":"商品数量","pisell2.salesManagement.order.column.paymentStatus":"支付状态","pisell2.salesManagement.order.column.orderOrigin":"订单来源","pisell2.salesManagement.order.column.shippingMethod":"配送方式","pisell2.salesManagement.order.column.fulfillmentMethod":"交割方式","pisell2.salesManagement.order.column.orderStatus":"订单状态","pisell2.salesManagement.order.column.fulfillmentStatus":"处理状态","pisell2.salesManagement.order.column.updated":"更新","pisell2.salesManagement.order.column.orderId":"销售编号","pisell2.salesManagement.order.common.orderNote":"订单备注","pisell2.salesManagement.order.common.internalNote":"内部备注","pisell2.salesManagement.order.common.createdBy":"创建人","pisell2.salesManagement.order.common.guest":"匿名客户","pisell2.salesManagement.order.common.walkIn":"Walk-in","pisell2.salesManagement.order.paymentStatus.authorized":"已授权","pisell2.salesManagement.order.paymentStatus.paid":"已付款","pisell2.salesManagement.order.paymentStatus.partially_paid":"部分付款","pisell2.salesManagement.order.paymentStatus.partially_refunded":"部分退款","pisell2.salesManagement.order.paymentStatus.payment_pending":"等待付款","pisell2.salesManagement.order.paymentStatus.refunded":"已退款","pisell2.salesManagement.order.paymentStatus.unpaid":"未付款","pisell2.salesManagement.order.paymentStatus.voided":"已作废","pisell2.salesManagement.order.paymentStatus.payment_processing":"待支付","pisell2.salesManagement.order.platform.online_store":"在线店铺","pisell2.salesManagement.order.platform.wholesalebusiness":"批发业务","pisell2.salesManagement.order.platform.table-order":"扫码点餐","pisell2.salesManagement.order.platform.mobile_order":"移动点餐","pisell2.salesManagement.order.platform.kiosk":"Kiosk","pisell2.salesManagement.order.platform.pos":"终端","pisell2.salesManagement.order.orderStatus.open":"未完成","pisell2.salesManagement.order.orderStatus.completed":"已完成","pisell2.salesManagement.order.orderStatus.cancelled":"已取消","pisell2.salesManagement.order.fulfillmentStatus.fulfilled":"已处理","pisell2.salesManagement.order.fulfillmentStatus.unfulfilled":"未处理","pisell2.salesManagement.order.fulfillmentStatus.fulfilling":"处理中","pisell2.salesManagement.order.fulfillmentStatus.partial_fulfilled":"部分处理","pisell2.salesManagement.order.deliveryType.nil":"无需配送","pisell2.salesManagement.order.deliveryType.shipping":"物流配送","pisell2.salesManagement.order.deliveryType.local_delivery":"本地配送","pisell2.salesManagement.order.deliveryType.pickup":"到店自提","pisell2.salesManagement.order.deliveryType.shop_service":"到店服务","pisell2.salesManagement.order.shopServiceType.dine-in":"堂食","pisell2.salesManagement.order.shopServiceType.takeaway":"外带","pisell2.salesManagement.order.common.itemsCount":" 件商品","pisell2.salesManagement.order.common.totalAmount":"总金额","pisell2.salesManagement.order.common.paidAmount":"已付金额","pisell2.salesManagement.order.common.dueAmount":"待付金额","pisell2.salesManagement.order.common.refundedAmount":"已退金额","pisell2.salesManagement.order.quickFilter.orderDate.placeholder":"请选择下单时间","pisell2.salesManagement.order.filter.orderStatus.label":"订单状态","pisell2.salesManagement.order.filter.orderStatus.placeholder":"请选择订单状态","pisell2.salesManagement.order.filter.paymentStatus.label":"支付状态","pisell2.salesManagement.order.filter.paymentStatus.placeholder":"请选择支付状态","pisell2.salesManagement.order.filter.fulfillmentStatus.label":"处理状态","pisell2.salesManagement.order.filter.fulfillmentStatus.placeholder":"请选择处理状态","pisell2.salesManagement.order.filter.customer.label":"客户","pisell2.salesManagement.order.filter.customer.placeholder":"请选择客户","pisell2.salesManagement.order.filter.salesChannel.label":"销售渠道","pisell2.salesManagement.order.filter.salesChannel.placeholder":"请选择销售渠道","pisell2.salesManagement.order.filter.paymentMethod.label":"支付方式","pisell2.salesManagement.order.filter.paymentMethod.placeholder":"请选择支付方式","pisell2.salesManagement.order.filter.totalAmount.label":"订单金额区间","pisell2.salesManagement.order.filter.totalAmount.placeholder":"请输入","pisell2.salesManagement.order.filter.tags.label":"标签","pisell2.salesManagement.order.filter.tags.placeholder":"请选择标签","pisell2.salesManagement.order.filter.deliveryType.label":"配送方式","pisell2.salesManagement.order.filter.deliveryType.placeholder":"请选择配送方式","pisell2.salesManagement.order.filter.fulfillmentMethod.label":"交割方式","pisell2.salesManagement.order.filter.fulfillmentMethod.placeholder":"请选择交割方式","pisell2.salesManagement.order.filter.deliveryZone.label":"配送区域","pisell2.salesManagement.order.filter.deliveryZone.placeholder":"请选择配送区域","pisell2.salesManagement.order.filter.pickupLocation.label":"自提点","pisell2.salesManagement.order.filter.pickupLocation.placeholder":"请选择自提点","pisell2.salesManagement.order.filter.trackingNumber.label":"物流单号","pisell2.salesManagement.order.filter.trackingNumber.placeholder":"请输入物流单号","pisell2.salesManagement.order.filter.logistics.label":"快递公司","pisell2.salesManagement.order.filter.logistics.placeholder":"请选择快递公司","pisell2.salesManagement.order.filter.zipCode.label":"邮编","pisell2.salesManagement.order.filter.zipCode.placeholder":"请输入邮编","pisell2.salesManagement.order.sort.createdAt":"创建时间","pisell2.salesManagement.order.sort.updatedAt":"更新时间","pisell2.salesManagement.order.sort.totalAmount":"订单金额","pisell2.salesManagement.order.sort.customerName":"客户名称"},"zh-HK":{"pisell2.salesManagement.business.online_store":"在線店鋪","pisell2.salesManagement.business.ticket_order":"票務訂單","pisell2.salesManagement.business.appointment_booking":"預約","pisell2.salesManagement.sort.balanceDue":"待收金額","pisell2.salesManagement.sort.oldestFirst":"最早優先","pisell2.salesManagement.sort.newestFirst":"最新優先","pisell2.salesManagement.sort.latestFirst":"最晚優先","pisell2.salesManagement.booking.column.bookingBrief":"預約摘要","pisell2.salesManagement.booking.column.serviceTime":"服務時間","pisell2.salesManagement.booking.column.customer":"客戶","pisell2.salesManagement.booking.column.contact":"聯絡人","pisell2.salesManagement.booking.column.holder":"持有人","pisell2.salesManagement.booking.column.services":"服務項目","pisell2.salesManagement.booking.column.pax":"參與人數","pisell2.salesManagement.booking.column.resource":"資源","pisell2.salesManagement.booking.column.forms":"表單","pisell2.salesManagement.booking.column.orderInfo":"訂單資訊","pisell2.salesManagement.booking.column.bookingId":"預約編號","pisell2.salesManagement.booking.column.orderOrigin":"訂單來源","pisell2.salesManagement.booking.column.updated":"更新","pisell2.salesManagement.booking.status.new":"新建","pisell2.salesManagement.booking.status.confirmed":"已確認","pisell2.salesManagement.booking.status.arrived":"已到達","pisell2.salesManagement.booking.status.started":"已開始","pisell2.salesManagement.booking.status.cancelled":"已取消","pisell2.salesManagement.booking.status.no_show":"未到場","pisell2.salesManagement.booking.status.completed":"已完成","pisell2.salesManagement.booking.platform.online_store":"在線店鋪","pisell2.salesManagement.booking.platform.wholesalebusiness":"批發業務","pisell2.salesManagement.booking.platform.table-order":"掃碼點餐","pisell2.salesManagement.booking.platform.mobile_order":"移動點餐","pisell2.salesManagement.booking.platform.kiosk":"Kiosk","pisell2.salesManagement.booking.platform.pos":"終端","pisell2.salesManagement.booking.common.orderNote":"訂單備註","pisell2.salesManagement.booking.common.internalNote":"內部備註","pisell2.salesManagement.booking.view-more":"查看更多","pisell2.salesManagement.booking.common.more":"更多","pisell2.salesManagement.booking.common.createdBy":"建立人","pisell2.salesManagement.booking.notes.title":"備註","pisell2.salesManagement.booking.notes.orderNotes":"訂單備註","pisell2.salesManagement.booking.notes.internalNotes":"內部備註","pisell2.salesManagement.booking.notes.addOrderNotes":"添加訂單備註","pisell2.salesManagement.booking.notes.addInternalNotes":"添加內部備註","pisell2.salesManagement.booking.notes.internalVisibleOnlyTip":"僅團隊成員可見","pisell2.salesManagement.booking.filter.bookingStatus.label":"預約狀態","pisell2.salesManagement.booking.filter.bookingStatus.placeholder":"請選擇預約狀態","pisell2.salesManagement.booking.filter.bookingDate.label":"預約日期&時間","pisell2.salesManagement.booking.filter.bookingDate.placeholder":"請選擇預約日期","pisell2.salesManagement.booking.filter.holder.label":"持有人","pisell2.salesManagement.booking.filter.holder.placeholder":"請輸入持有人","pisell2.salesManagement.booking.filter.paxRange.label":"參與人數區間","pisell2.salesManagement.booking.filter.paxRange.placeholder":"請輸入參與人數區間","pisell2.salesManagement.booking.filter.resource.label":"資源","pisell2.salesManagement.booking.filter.resource.placeholder":"請選擇資源","pisell2.salesManagement.booking.filter.resource.none":"無資源","pisell2.salesManagement.booking.filter.salesChannel.label":"銷售渠道","pisell2.salesManagement.booking.filter.salesChannel.placeholder":"請選擇銷售渠道","pisell2.salesManagement.booking.filter.orderAmount.label":"訂單金額區間","pisell2.salesManagement.booking.filter.orderAmount.placeholder":"請輸入訂單金額區間","pisell2.salesManagement.booking.filter.orderStatus.label":"訂單狀態","pisell2.salesManagement.booking.filter.orderStatus.placeholder":"請選擇訂單狀態","pisell2.salesManagement.booking.filter.paymentStatus.label":"支付狀態","pisell2.salesManagement.booking.filter.paymentStatus.placeholder":"請選擇支付狀態","pisell2.salesManagement.booking.filter.customer.label":"客戶","pisell2.salesManagement.booking.filter.customer.placeholder":"請選擇客戶","pisell2.salesManagement.booking.filter.includeItems.label":"商品包含","pisell2.salesManagement.booking.filter.includeItems.placeholder":"請選擇商品","pisell2.salesManagement.booking.filter.paymentMethod.label":"支付方式","pisell2.salesManagement.booking.filter.paymentMethod.placeholder":"請選擇支付方式","pisell2.salesManagement.booking.column.paymentMethod":"支付方式","pisell2.salesManagement.booking.filter.orderDate.label":"下單時間","pisell2.salesManagement.booking.filter.orderDate.placeholder":"請選擇下單時間","pisell2.salesManagement.booking.filter.updatedDate.label":"更新時間","pisell2.salesManagement.booking.filter.updatedDate.placeholder":"請選擇更新時間","pisell2.salesManagement.booking.sort.afterExecutionTime":"現場執行時間","pisell2.salesManagement.booking.sort.startAt":"開始時間","pisell2.salesManagement.booking.sort.endAt":"結束時間","pisell2.salesManagement.booking.sort.createdAt":"創建時間","pisell2.salesManagement.booking.sort.updatedAt":"更新時間","pisell2.salesManagement.booking.sort.totalAmount":"訂單金額","pisell2.salesManagement.booking.sort.refundedAmount":"退款金額","pisell2.salesManagement.booking.sort.customerName":"客戶名稱","pisell2.salesManagement.order.column.saleBrief":"銷售摘要","pisell2.salesManagement.order.column.customer":"客戶","pisell2.salesManagement.order.column.contact":"聯絡人","pisell2.salesManagement.order.column.paymentInfo":"支付資訊","pisell2.salesManagement.order.column.paymentMethod":"支付方式","pisell2.salesManagement.order.column.items":"商品數量","pisell2.salesManagement.order.column.paymentStatus":"支付狀態","pisell2.salesManagement.order.column.orderOrigin":"訂單來源","pisell2.salesManagement.order.column.shippingMethod":"配送方式","pisell2.salesManagement.order.column.fulfillmentMethod":"交割方式","pisell2.salesManagement.order.column.orderStatus":"訂單狀態","pisell2.salesManagement.order.column.fulfillmentStatus":"處理狀態","pisell2.salesManagement.order.column.updated":"更新","pisell2.salesManagement.order.column.orderId":"銷售編號","pisell2.salesManagement.order.common.orderNote":"訂單備註","pisell2.salesManagement.order.common.internalNote":"內部備註","pisell2.salesManagement.order.common.createdBy":"建立人","pisell2.salesManagement.order.common.guest":"匿名客戶","pisell2.salesManagement.order.common.walkIn":"Walk-in","pisell2.salesManagement.order.paymentStatus.authorized":"已授權","pisell2.salesManagement.order.paymentStatus.paid":"已付款","pisell2.salesManagement.order.paymentStatus.partially_paid":"部分付款","pisell2.salesManagement.order.paymentStatus.partially_refunded":"部分退款","pisell2.salesManagement.order.paymentStatus.payment_pending":"等待付款","pisell2.salesManagement.order.paymentStatus.refunded":"已退款","pisell2.salesManagement.order.paymentStatus.unpaid":"未付款","pisell2.salesManagement.order.paymentStatus.voided":"已作廢","pisell2.salesManagement.order.paymentStatus.payment_processing":"待支付","pisell2.salesManagement.order.platform.online_store":"在線店鋪","pisell2.salesManagement.order.platform.wholesalebusiness":"批發業務","pisell2.salesManagement.order.platform.table-order":"掃碼點餐","pisell2.salesManagement.order.platform.mobile_order":"移動點餐","pisell2.salesManagement.order.platform.kiosk":"Kiosk","pisell2.salesManagement.order.platform.pos":"終端","pisell2.salesManagement.order.orderStatus.open":"未完成","pisell2.salesManagement.order.orderStatus.completed":"已完成","pisell2.salesManagement.order.orderStatus.cancelled":"已取消","pisell2.salesManagement.order.fulfillmentStatus.fulfilled":"已處理","pisell2.salesManagement.order.fulfillmentStatus.unfulfilled":"未處理","pisell2.salesManagement.order.fulfillmentStatus.fulfilling":"處理中","pisell2.salesManagement.order.fulfillmentStatus.partial_fulfilled":"部分處理","pisell2.salesManagement.order.deliveryType.nil":"無需配送","pisell2.salesManagement.order.deliveryType.shipping":"物流配送","pisell2.salesManagement.order.deliveryType.local_delivery":"本地配送","pisell2.salesManagement.order.deliveryType.pickup":"到店自提","pisell2.salesManagement.order.deliveryType.shop_service":"到店服務","pisell2.salesManagement.order.shopServiceType.dine-in":"堂食","pisell2.salesManagement.order.shopServiceType.takeaway":"外帶","pisell2.salesManagement.order.common.itemsCount":" 件商品","pisell2.salesManagement.order.common.totalAmount":"總金額","pisell2.salesManagement.order.common.paidAmount":"已付金額","pisell2.salesManagement.order.common.dueAmount":"待付金額","pisell2.salesManagement.order.common.refundedAmount":"已退金額","pisell2.salesManagement.order.quickFilter.orderDate.placeholder":"請選擇下單時間","pisell2.salesManagement.order.filter.orderStatus.label":"訂單狀態","pisell2.salesManagement.order.filter.orderStatus.placeholder":"請選擇訂單狀態","pisell2.salesManagement.order.filter.paymentStatus.label":"支付狀態","pisell2.salesManagement.order.filter.paymentStatus.placeholder":"請選擇支付狀態","pisell2.salesManagement.order.filter.fulfillmentStatus.label":"處理狀態","pisell2.salesManagement.order.filter.fulfillmentStatus.placeholder":"請選擇處理狀態","pisell2.salesManagement.order.filter.customer.label":"客戶","pisell2.salesManagement.order.filter.customer.placeholder":"請選擇客戶","pisell2.salesManagement.order.filter.salesChannel.label":"銷售渠道","pisell2.salesManagement.order.filter.salesChannel.placeholder":"請選擇銷售渠道","pisell2.salesManagement.order.filter.paymentMethod.label":"支付方式","pisell2.salesManagement.order.filter.paymentMethod.placeholder":"請選擇支付方式","pisell2.salesManagement.order.filter.totalAmount.label":"訂單金額區間","pisell2.salesManagement.order.filter.totalAmount.placeholder":"請輸入","pisell2.salesManagement.order.filter.tags.label":"標籤","pisell2.salesManagement.order.filter.tags.placeholder":"請選擇標籤","pisell2.salesManagement.order.filter.deliveryType.label":"配送方式","pisell2.salesManagement.order.filter.deliveryType.placeholder":"請選擇配送方式","pisell2.salesManagement.order.filter.fulfillmentMethod.label":"交割方式","pisell2.salesManagement.order.filter.fulfillmentMethod.placeholder":"請選擇交割方式","pisell2.salesManagement.order.filter.deliveryZone.label":"配送區域","pisell2.salesManagement.order.filter.deliveryZone.placeholder":"請選擇配送區域","pisell2.salesManagement.order.filter.pickupLocation.label":"自提點","pisell2.salesManagement.order.filter.pickupLocation.placeholder":"請選擇自提點","pisell2.salesManagement.order.filter.trackingNumber.label":"物流單號","pisell2.salesManagement.order.filter.trackingNumber.placeholder":"請輸入物流單號","pisell2.salesManagement.order.filter.logistics.label":"快遞公司","pisell2.salesManagement.order.filter.logistics.placeholder":"請選擇快遞公司","pisell2.salesManagement.order.filter.zipCode.label":"郵編","pisell2.salesManagement.order.filter.zipCode.placeholder":"請輸入郵編","pisell2.salesManagement.order.sort.createdAt":"創建時間","pisell2.salesManagement.order.sort.updatedAt":"更新時間","pisell2.salesManagement.order.sort.totalAmount":"訂單金額","pisell2.salesManagement.order.sort.customerName":"客戶名稱"},ja:{"pisell2.salesManagement.business.online_store":"オンラインストア","pisell2.salesManagement.business.ticket_order":"チケット注文","pisell2.salesManagement.business.appointment_booking":"予約","pisell2.salesManagement.sort.balanceDue":"未払い残高","pisell2.salesManagement.sort.oldestFirst":"古い順","pisell2.salesManagement.sort.newestFirst":"新しい順","pisell2.salesManagement.sort.latestFirst":"最新順","pisell2.salesManagement.booking.column.bookingBrief":"予約概要","pisell2.salesManagement.booking.column.serviceTime":"サービス時間","pisell2.salesManagement.booking.column.customer":"顧客","pisell2.salesManagement.booking.column.contact":"連絡先","pisell2.salesManagement.booking.column.holder":"予約者","pisell2.salesManagement.booking.column.services":"サービス","pisell2.salesManagement.booking.column.pax":"人数","pisell2.salesManagement.booking.column.resource":"リソース","pisell2.salesManagement.booking.column.forms":"フォーム","pisell2.salesManagement.booking.column.orderInfo":"注文情報","pisell2.salesManagement.booking.column.bookingId":"予約ID","pisell2.salesManagement.booking.column.orderOrigin":"注文元","pisell2.salesManagement.booking.column.updated":"更新","pisell2.salesManagement.booking.status.new":"新規","pisell2.salesManagement.booking.status.confirmed":"確認済み","pisell2.salesManagement.booking.status.arrived":"到着済み","pisell2.salesManagement.booking.status.started":"開始済み","pisell2.salesManagement.booking.status.cancelled":"キャンセル済み","pisell2.salesManagement.booking.status.no_show":"無断キャンセル","pisell2.salesManagement.booking.status.completed":"完了","pisell2.salesManagement.booking.platform.online_store":"オンラインストア","pisell2.salesManagement.booking.platform.wholesalebusiness":"卸売ビジネス","pisell2.salesManagement.booking.platform.table-order":"テーブル注文","pisell2.salesManagement.booking.platform.mobile_order":"モバイル注文","pisell2.salesManagement.booking.platform.kiosk":"キオスク","pisell2.salesManagement.booking.platform.pos":"POS","pisell2.salesManagement.booking.view-more":"もっと見る","pisell2.salesManagement.booking.common.orderNote":"注文メモ","pisell2.salesManagement.booking.common.internalNote":"内部メモ","pisell2.salesManagement.booking.common.more":"もっと見る","pisell2.salesManagement.booking.common.createdBy":"作成者","pisell2.salesManagement.booking.notes.title":"メモ","pisell2.salesManagement.booking.notes.orderNotes":"注文メモ","pisell2.salesManagement.booking.notes.internalNotes":"内部メモ","pisell2.salesManagement.booking.notes.addOrderNotes":"注文メモを追加","pisell2.salesManagement.booking.notes.addInternalNotes":"内部メモを追加","pisell2.salesManagement.booking.notes.internalVisibleOnlyTip":"チームメンバーにのみ表示されます","pisell2.salesManagement.booking.filter.bookingStatus.label":"予約ステータス","pisell2.salesManagement.booking.filter.bookingStatus.placeholder":"予約ステータスを選択してください","pisell2.salesManagement.booking.filter.bookingDate.label":"予約日時","pisell2.salesManagement.booking.filter.bookingDate.placeholder":"予約日を選択してください","pisell2.salesManagement.booking.filter.holder.label":"予約者","pisell2.salesManagement.booking.filter.holder.placeholder":"予約者を入力してください","pisell2.salesManagement.booking.filter.paxRange.label":"人数範囲","pisell2.salesManagement.booking.filter.paxRange.placeholder":"人数範囲を入力してください","pisell2.salesManagement.booking.filter.resource.label":"リソース","pisell2.salesManagement.booking.filter.resource.placeholder":"リソースを選択してください","pisell2.salesManagement.booking.filter.resource.none":"リソースなし","pisell2.salesManagement.booking.filter.salesChannel.label":"販売チャネル","pisell2.salesManagement.booking.filter.salesChannel.placeholder":"販売チャネルを選択してください","pisell2.salesManagement.booking.filter.orderAmount.label":"注文金額","pisell2.salesManagement.booking.filter.orderAmount.placeholder":"注文金額を入力してください","pisell2.salesManagement.booking.filter.orderStatus.label":"注文ステータス","pisell2.salesManagement.booking.filter.orderStatus.placeholder":"注文ステータスを選択してください","pisell2.salesManagement.booking.filter.paymentStatus.label":"支払いステータス","pisell2.salesManagement.booking.filter.paymentStatus.placeholder":"支払いステータスを選択してください","pisell2.salesManagement.booking.filter.customer.label":"顧客","pisell2.salesManagement.booking.filter.customer.placeholder":"顧客を選択してください","pisell2.salesManagement.booking.filter.includeItems.label":"含まれる商品","pisell2.salesManagement.booking.filter.includeItems.placeholder":"商品を選択してください","pisell2.salesManagement.booking.filter.paymentMethod.label":"支払い方法","pisell2.salesManagement.booking.filter.paymentMethod.placeholder":"支払い方法を選択してください","pisell2.salesManagement.booking.column.paymentMethod":"支払い方法","pisell2.salesManagement.booking.filter.orderDate.label":"注文日","pisell2.salesManagement.booking.filter.orderDate.placeholder":"注文日を選択してください","pisell2.salesManagement.booking.filter.updatedDate.label":"更新日","pisell2.salesManagement.booking.filter.updatedDate.placeholder":"更新日を選択してください","pisell2.salesManagement.booking.sort.afterExecutionTime":"現場実行時間","pisell2.salesManagement.booking.sort.startAt":"開始時間","pisell2.salesManagement.booking.sort.endAt":"終了時間","pisell2.salesManagement.booking.sort.createdAt":"作成時間","pisell2.salesManagement.booking.sort.updatedAt":"最終更新","pisell2.salesManagement.booking.sort.totalAmount":"合計金額","pisell2.salesManagement.booking.sort.refundedAmount":"返金額","pisell2.salesManagement.booking.sort.customerName":"顧客名","pisell2.salesManagement.order.column.saleBrief":"販売概要","pisell2.salesManagement.order.column.customer":"顧客","pisell2.salesManagement.order.column.contact":"連絡先","pisell2.salesManagement.order.column.paymentInfo":"支払い情報","pisell2.salesManagement.order.column.paymentMethod":"支払い方法","pisell2.salesManagement.order.column.items":"商品","pisell2.salesManagement.order.column.paymentStatus":"支払いステータス","pisell2.salesManagement.order.column.orderOrigin":"注文元","pisell2.salesManagement.order.column.shippingMethod":"配送方法","pisell2.salesManagement.order.column.fulfillmentMethod":"受け渡し方法","pisell2.salesManagement.order.column.orderStatus":"注文ステータス","pisell2.salesManagement.order.column.fulfillmentStatus":"処理ステータス","pisell2.salesManagement.order.column.updated":"更新","pisell2.salesManagement.order.column.orderId":"セールスID","pisell2.salesManagement.order.common.orderNote":"注文メモ","pisell2.salesManagement.order.common.internalNote":"内部メモ","pisell2.salesManagement.order.common.createdBy":"作成者","pisell2.salesManagement.order.common.guest":"ゲスト","pisell2.salesManagement.order.common.walkIn":"Walk-in","pisell2.salesManagement.order.paymentStatus.authorized":"承認済み","pisell2.salesManagement.order.paymentStatus.paid":"支払済み","pisell2.salesManagement.order.paymentStatus.partially_paid":"一部支払い","pisell2.salesManagement.order.paymentStatus.partially_refunded":"一部返金済み","pisell2.salesManagement.order.paymentStatus.payment_pending":"支払い待ち","pisell2.salesManagement.order.paymentStatus.refunded":"返金済み","pisell2.salesManagement.order.paymentStatus.unpaid":"未払い","pisell2.salesManagement.order.paymentStatus.voided":"無効","pisell2.salesManagement.order.paymentStatus.payment_processing":"支払い処理中","pisell2.salesManagement.order.platform.online_store":"オンラインストア","pisell2.salesManagement.order.platform.wholesalebusiness":"卸売ビジネス","pisell2.salesManagement.order.platform.table-order":"テーブル注文","pisell2.salesManagement.order.platform.mobile_order":"モバイル注文","pisell2.salesManagement.order.platform.kiosk":"キオスク","pisell2.salesManagement.order.platform.pos":"POS","pisell2.salesManagement.order.orderStatus.open":"未完了","pisell2.salesManagement.order.orderStatus.completed":"完了","pisell2.salesManagement.order.orderStatus.cancelled":"キャンセル済み","pisell2.salesManagement.order.fulfillmentStatus.fulfilled":"処理済み","pisell2.salesManagement.order.fulfillmentStatus.unfulfilled":"未処理","pisell2.salesManagement.order.fulfillmentStatus.fulfilling":"処理中","pisell2.salesManagement.order.fulfillmentStatus.partial_fulfilled":"一部処理済み","pisell2.salesManagement.order.deliveryType.nil":"配送不要","pisell2.salesManagement.order.deliveryType.shipping":"配送","pisell2.salesManagement.order.deliveryType.local_delivery":"ローカル配送","pisell2.salesManagement.order.deliveryType.pickup":"店頭受取","pisell2.salesManagement.order.deliveryType.shop_service":"店舗サービス","pisell2.salesManagement.order.shopServiceType.dine-in":"店内飲食","pisell2.salesManagement.order.shopServiceType.takeaway":"テイクアウト","pisell2.salesManagement.order.common.itemsCount":" 件の商品","pisell2.salesManagement.order.common.totalAmount":"合計","pisell2.salesManagement.order.common.paidAmount":"支払済み","pisell2.salesManagement.order.common.dueAmount":"未払い","pisell2.salesManagement.order.common.refundedAmount":"返金済み","pisell2.salesManagement.order.quickFilter.orderDate.placeholder":"注文日を選択してください","pisell2.salesManagement.order.filter.orderStatus.label":"注文ステータス","pisell2.salesManagement.order.filter.orderStatus.placeholder":"注文ステータスを選択してください","pisell2.salesManagement.order.filter.paymentStatus.label":"支払いステータス","pisell2.salesManagement.order.filter.paymentStatus.placeholder":"支払いステータスを選択してください","pisell2.salesManagement.order.filter.fulfillmentStatus.label":"処理ステータス","pisell2.salesManagement.order.filter.fulfillmentStatus.placeholder":"処理ステータスを選択してください","pisell2.salesManagement.order.filter.customer.label":"顧客","pisell2.salesManagement.order.filter.customer.placeholder":"顧客を選択してください","pisell2.salesManagement.order.filter.salesChannel.label":"販売チャネル","pisell2.salesManagement.order.filter.salesChannel.placeholder":"販売チャネルを選択してください","pisell2.salesManagement.order.filter.paymentMethod.label":"支払い方法","pisell2.salesManagement.order.filter.paymentMethod.placeholder":"支払い方法を選択してください","pisell2.salesManagement.order.filter.totalAmount.label":"注文金額範囲","pisell2.salesManagement.order.filter.totalAmount.placeholder":"入力してください","pisell2.salesManagement.order.filter.tags.label":"タグ","pisell2.salesManagement.order.filter.tags.placeholder":"タグを選択してください","pisell2.salesManagement.order.filter.deliveryType.label":"配送タイプ","pisell2.salesManagement.order.filter.deliveryType.placeholder":"配送タイプを選択してください","pisell2.salesManagement.order.filter.fulfillmentMethod.label":"受け渡し方法","pisell2.salesManagement.order.filter.fulfillmentMethod.placeholder":"受け渡し方法を選択してください","pisell2.salesManagement.order.filter.deliveryZone.label":"配送ゾーン","pisell2.salesManagement.order.filter.deliveryZone.placeholder":"配送ゾーンを選択してください","pisell2.salesManagement.order.filter.pickupLocation.label":"受取場所","pisell2.salesManagement.order.filter.pickupLocation.placeholder":"受取場所を選択してください","pisell2.salesManagement.order.filter.trackingNumber.label":"追跡番号","pisell2.salesManagement.order.filter.trackingNumber.placeholder":"追跡番号を入力してください","pisell2.salesManagement.order.filter.logistics.label":"物流会社","pisell2.salesManagement.order.filter.logistics.placeholder":"物流会社を選択してください","pisell2.salesManagement.order.filter.zipCode.label":"郵便番号","pisell2.salesManagement.order.filter.zipCode.placeholder":"郵便番号を入力してください","pisell2.salesManagement.order.sort.createdAt":"作成時間","pisell2.salesManagement.order.sort.updatedAt":"更新時間","pisell2.salesManagement.order.sort.totalAmount":"注文金額","pisell2.salesManagement.order.sort.customerName":"顧客名"},pt:{"pisell2.salesManagement.business.online_store":"Loja Online","pisell2.salesManagement.business.ticket_order":"Pedido de Ingresso","pisell2.salesManagement.business.appointment_booking":"Reserva de Agendamento","pisell2.salesManagement.sort.balanceDue":"Saldo Devido","pisell2.salesManagement.sort.oldestFirst":"Mais Antigos Primeiro","pisell2.salesManagement.sort.newestFirst":"Mais Recentes Primeiro","pisell2.salesManagement.sort.latestFirst":"Mais Recentes Primeiro","pisell2.salesManagement.booking.column.bookingBrief":"Resumo da Reserva","pisell2.salesManagement.booking.column.serviceTime":"Hor\xe1rio do Servi\xe7o","pisell2.salesManagement.booking.column.customer":"Cliente","pisell2.salesManagement.booking.column.contact":"Contato","pisell2.salesManagement.booking.column.holder":"Titular","pisell2.salesManagement.booking.column.services":"Servi\xe7os","pisell2.salesManagement.booking.column.pax":"Pessoas","pisell2.salesManagement.booking.column.resource":"Recurso","pisell2.salesManagement.booking.column.forms":"Formul\xe1rios","pisell2.salesManagement.booking.column.orderInfo":"Informa\xe7\xf5es do Pedido","pisell2.salesManagement.booking.column.bookingId":"ID da Reserva","pisell2.salesManagement.booking.column.orderOrigin":"Origem do Pedido","pisell2.salesManagement.booking.column.updated":"Atualizado","pisell2.salesManagement.booking.status.new":"Novo","pisell2.salesManagement.booking.status.confirmed":"Confirmado","pisell2.salesManagement.booking.status.arrived":"Chegou","pisell2.salesManagement.booking.status.started":"Iniciado","pisell2.salesManagement.booking.status.cancelled":"Cancelado","pisell2.salesManagement.booking.status.no_show":"N\xe3o compareceu","pisell2.salesManagement.booking.status.completed":"Conclu\xeddo","pisell2.salesManagement.booking.platform.online_store":"Loja Online","pisell2.salesManagement.booking.platform.wholesalebusiness":"Neg\xf3cio Atacadista","pisell2.salesManagement.booking.platform.table-order":"Pedido na Mesa","pisell2.salesManagement.booking.platform.mobile_order":"Pedido M\xf3vel","pisell2.salesManagement.booking.platform.kiosk":"Quiosque","pisell2.salesManagement.booking.platform.pos":"POS","pisell2.salesManagement.booking.view-more":"Ver mais","pisell2.salesManagement.booking.common.orderNote":"Nota do Pedido","pisell2.salesManagement.booking.common.internalNote":"Nota Interna","pisell2.salesManagement.booking.common.more":"mais","pisell2.salesManagement.booking.common.createdBy":"Criado por","pisell2.salesManagement.booking.notes.title":"Notas","pisell2.salesManagement.booking.notes.orderNotes":"Notas do pedido","pisell2.salesManagement.booking.notes.internalNotes":"Notas internas","pisell2.salesManagement.booking.notes.addOrderNotes":"Adicionar nota do pedido","pisell2.salesManagement.booking.notes.addInternalNotes":"Adicionar nota interna","pisell2.salesManagement.booking.notes.internalVisibleOnlyTip":"Vis\xedvel apenas para membros da sua equipe","pisell2.salesManagement.booking.filter.bookingStatus.label":"Status da Reserva","pisell2.salesManagement.booking.filter.bookingStatus.placeholder":"Selecione o status da reserva","pisell2.salesManagement.booking.filter.bookingDate.label":"Data e Hora da Reserva","pisell2.salesManagement.booking.filter.bookingDate.placeholder":"Selecione a data da reserva","pisell2.salesManagement.booking.filter.holder.label":"Titular","pisell2.salesManagement.booking.filter.holder.placeholder":"Insira o titular","pisell2.salesManagement.booking.filter.paxRange.label":"Faixa de Pessoas","pisell2.salesManagement.booking.filter.paxRange.placeholder":"Insira a faixa de pessoas","pisell2.salesManagement.booking.filter.resource.label":"Recurso","pisell2.salesManagement.booking.filter.resource.placeholder":"Selecione o recurso","pisell2.salesManagement.booking.filter.resource.none":"Sem Recurso","pisell2.salesManagement.booking.filter.salesChannel.label":"Canal de Vendas","pisell2.salesManagement.booking.filter.salesChannel.placeholder":"Selecione o canal de vendas","pisell2.salesManagement.booking.filter.orderAmount.label":"Valor do Pedido","pisell2.salesManagement.booking.filter.orderAmount.placeholder":"Insira o valor do pedido","pisell2.salesManagement.booking.filter.orderStatus.label":"Status do Pedido","pisell2.salesManagement.booking.filter.orderStatus.placeholder":"Selecione o status do pedido","pisell2.salesManagement.booking.filter.paymentStatus.label":"Status do Pagamento","pisell2.salesManagement.booking.filter.paymentStatus.placeholder":"Selecione o status do pagamento","pisell2.salesManagement.booking.filter.customer.label":"Cliente","pisell2.salesManagement.booking.filter.customer.placeholder":"Selecione o cliente","pisell2.salesManagement.booking.filter.includeItems.label":"Itens Inclu\xeddos","pisell2.salesManagement.booking.filter.includeItems.placeholder":"Selecione os itens","pisell2.salesManagement.booking.filter.paymentMethod.label":"M\xe9todo de Pagamento","pisell2.salesManagement.booking.filter.paymentMethod.placeholder":"Selecione o m\xe9todo de pagamento","pisell2.salesManagement.booking.column.paymentMethod":"M\xe9todo de Pagamento","pisell2.salesManagement.booking.filter.orderDate.label":"Data do Pedido","pisell2.salesManagement.booking.filter.orderDate.placeholder":"Selecione a data do pedido","pisell2.salesManagement.booking.filter.updatedDate.label":"Data de Atualiza\xe7\xe3o","pisell2.salesManagement.booking.filter.updatedDate.placeholder":"Selecione a data de atualiza\xe7\xe3o","pisell2.salesManagement.booking.sort.afterExecutionTime":"Ap\xf3s o Hor\xe1rio de Execu\xe7\xe3o","pisell2.salesManagement.booking.sort.startAt":"Hora de In\xedcio","pisell2.salesManagement.booking.sort.endAt":"Hora de T\xe9rmino","pisell2.salesManagement.booking.sort.createdAt":"Hora de Cria\xe7\xe3o","pisell2.salesManagement.booking.sort.updatedAt":"\xdaltima Atualiza\xe7\xe3o","pisell2.salesManagement.booking.sort.totalAmount":"Valor Total","pisell2.salesManagement.booking.sort.refundedAmount":"Valor Reembolsado","pisell2.salesManagement.booking.sort.customerName":"Nome do Cliente","pisell2.salesManagement.order.column.saleBrief":"Resumo da Venda","pisell2.salesManagement.order.column.customer":"Cliente","pisell2.salesManagement.order.column.contact":"Contato","pisell2.salesManagement.order.column.paymentInfo":"Informa\xe7\xf5es de Pagamento","pisell2.salesManagement.order.column.paymentMethod":"M\xe9todo de Pagamento","pisell2.salesManagement.order.column.items":"Itens","pisell2.salesManagement.order.column.paymentStatus":"Status do Pagamento","pisell2.salesManagement.order.column.orderOrigin":"Origem do Pedido","pisell2.salesManagement.order.column.shippingMethod":"M\xe9todo de Envio","pisell2.salesManagement.order.column.fulfillmentMethod":"M\xe9todo de Atendimento","pisell2.salesManagement.order.column.orderStatus":"Status do Pedido","pisell2.salesManagement.order.column.fulfillmentStatus":"Status de Atendimento","pisell2.salesManagement.order.column.updated":"Atualizado","pisell2.salesManagement.order.column.orderId":"ID de Venda","pisell2.salesManagement.order.common.orderNote":"Nota do Pedido","pisell2.salesManagement.order.common.internalNote":"Nota Interna","pisell2.salesManagement.order.common.createdBy":"Criado por","pisell2.salesManagement.order.common.guest":"Convidado","pisell2.salesManagement.order.common.walkIn":"Walk-in","pisell2.salesManagement.order.paymentStatus.authorized":"Autorizado","pisell2.salesManagement.order.paymentStatus.paid":"Pago","pisell2.salesManagement.order.paymentStatus.partially_paid":"Parcialmente Pago","pisell2.salesManagement.order.paymentStatus.partially_refunded":"Parcialmente Reembolsado","pisell2.salesManagement.order.paymentStatus.payment_pending":"Pagamento Pendente","pisell2.salesManagement.order.paymentStatus.refunded":"Reembolsado","pisell2.salesManagement.order.paymentStatus.unpaid":"N\xe3o Pago","pisell2.salesManagement.order.paymentStatus.voided":"Anulado","pisell2.salesManagement.order.paymentStatus.payment_processing":"Processando Pagamento","pisell2.salesManagement.order.platform.online_store":"Loja Online","pisell2.salesManagement.order.platform.wholesalebusiness":"Neg\xf3cio Atacadista","pisell2.salesManagement.order.platform.table-order":"Pedido na Mesa","pisell2.salesManagement.order.platform.mobile_order":"Pedido M\xf3vel","pisell2.salesManagement.order.platform.kiosk":"Quiosque","pisell2.salesManagement.order.platform.pos":"POS","pisell2.salesManagement.order.orderStatus.open":"Aberto","pisell2.salesManagement.order.orderStatus.completed":"Conclu\xeddo","pisell2.salesManagement.order.orderStatus.cancelled":"Cancelado","pisell2.salesManagement.order.fulfillmentStatus.fulfilled":"Atendido","pisell2.salesManagement.order.fulfillmentStatus.unfulfilled":"N\xe3o Atendido","pisell2.salesManagement.order.fulfillmentStatus.fulfilling":"Atendendo","pisell2.salesManagement.order.fulfillmentStatus.partial_fulfilled":"Parcialmente Atendido","pisell2.salesManagement.order.deliveryType.nil":"Sem Entrega Necess\xe1ria","pisell2.salesManagement.order.deliveryType.shipping":"Envio","pisell2.salesManagement.order.deliveryType.local_delivery":"Entrega Local","pisell2.salesManagement.order.deliveryType.pickup":"Retirada","pisell2.salesManagement.order.deliveryType.shop_service":"Servi\xe7o na Loja","pisell2.salesManagement.order.shopServiceType.dine-in":"Refei\xe7\xe3o no Local","pisell2.salesManagement.order.shopServiceType.takeaway":"Para Viagem","pisell2.salesManagement.order.common.itemsCount":" itens","pisell2.salesManagement.order.common.totalAmount":"Total","pisell2.salesManagement.order.common.paidAmount":"Pago","pisell2.salesManagement.order.common.dueAmount":"Devido","pisell2.salesManagement.order.common.refundedAmount":"Reembolsado","pisell2.salesManagement.order.quickFilter.orderDate.placeholder":"Selecione a data do pedido","pisell2.salesManagement.order.filter.orderStatus.label":"Status do Pedido","pisell2.salesManagement.order.filter.orderStatus.placeholder":"Selecione o status do pedido","pisell2.salesManagement.order.filter.paymentStatus.label":"Status do Pagamento","pisell2.salesManagement.order.filter.paymentStatus.placeholder":"Selecione o status do pagamento","pisell2.salesManagement.order.filter.fulfillmentStatus.label":"Status de Atendimento","pisell2.salesManagement.order.filter.fulfillmentStatus.placeholder":"Selecione o status de atendimento","pisell2.salesManagement.order.filter.customer.label":"Cliente","pisell2.salesManagement.order.filter.customer.placeholder":"Selecione o cliente","pisell2.salesManagement.order.filter.salesChannel.label":"Canal de Vendas","pisell2.salesManagement.order.filter.salesChannel.placeholder":"Selecione o canal de vendas","pisell2.salesManagement.order.filter.paymentMethod.label":"M\xe9todo de Pagamento","pisell2.salesManagement.order.filter.paymentMethod.placeholder":"Selecione o m\xe9todo de pagamento","pisell2.salesManagement.order.filter.totalAmount.label":"Faixa de Valor do Pedido","pisell2.salesManagement.order.filter.totalAmount.placeholder":"Insira","pisell2.salesManagement.order.filter.tags.label":"Tags","pisell2.salesManagement.order.filter.tags.placeholder":"Selecione as tags","pisell2.salesManagement.order.filter.deliveryType.label":"Tipo de Entrega","pisell2.salesManagement.order.filter.deliveryType.placeholder":"Selecione o tipo de entrega","pisell2.salesManagement.order.filter.fulfillmentMethod.label":"M\xe9todo de Atendimento","pisell2.salesManagement.order.filter.fulfillmentMethod.placeholder":"Selecione o m\xe9todo de atendimento","pisell2.salesManagement.order.filter.deliveryZone.label":"Zona de Entrega","pisell2.salesManagement.order.filter.deliveryZone.placeholder":"Selecione a zona de entrega","pisell2.salesManagement.order.filter.pickupLocation.label":"Local de Retirada","pisell2.salesManagement.order.filter.pickupLocation.placeholder":"Selecione o local de retirada","pisell2.salesManagement.order.filter.trackingNumber.label":"N\xfamero de Rastreamento","pisell2.salesManagement.order.filter.trackingNumber.placeholder":"Insira o n\xfamero de rastreamento","pisell2.salesManagement.order.filter.logistics.label":"Empresa de Log\xedstica","pisell2.salesManagement.order.filter.logistics.placeholder":"Selecione a empresa de log\xedstica","pisell2.salesManagement.order.filter.zipCode.label":"CEP","pisell2.salesManagement.order.filter.zipCode.placeholder":"Insira o CEP","pisell2.salesManagement.order.sort.createdAt":"Hora de Cria\xe7\xe3o","pisell2.salesManagement.order.sort.updatedAt":"Hora de Atualiza\xe7\xe3o","pisell2.salesManagement.order.sort.totalAmount":"Valor do Pedido","pisell2.salesManagement.order.sort.customerName":"Nome do Cliente"},ja:{"pisell2.salesManagement.business.online_store":"オンラインストア","pisell2.salesManagement.business.ticket_order":"チケット注文","pisell2.salesManagement.business.appointment_booking":"予約","pisell2.salesManagement.sort.balanceDue":"未払い残高","pisell2.salesManagement.sort.oldestFirst":"古い順","pisell2.salesManagement.sort.newestFirst":"新しい順","pisell2.salesManagement.sort.latestFirst":"最新順","pisell2.salesManagement.booking.column.bookingBrief":"予約概要","pisell2.salesManagement.booking.column.serviceTime":"サービス時間","pisell2.salesManagement.booking.column.customer":"顧客","pisell2.salesManagement.booking.column.contact":"連絡先","pisell2.salesManagement.booking.column.holder":"予約者","pisell2.salesManagement.booking.column.services":"サービス","pisell2.salesManagement.booking.column.pax":"人数","pisell2.salesManagement.booking.column.resource":"リソース","pisell2.salesManagement.booking.column.forms":"フォーム","pisell2.salesManagement.booking.column.orderInfo":"注文情報","pisell2.salesManagement.booking.column.bookingId":"予約ID","pisell2.salesManagement.booking.column.orderOrigin":"注文元","pisell2.salesManagement.booking.column.updated":"更新","pisell2.salesManagement.booking.status.new":"新規","pisell2.salesManagement.booking.status.confirmed":"確認済み","pisell2.salesManagement.booking.status.arrived":"到着済み","pisell2.salesManagement.booking.status.started":"開始済み","pisell2.salesManagement.booking.status.cancelled":"キャンセル済み","pisell2.salesManagement.booking.status.no_show":"無断キャンセル","pisell2.salesManagement.booking.status.completed":"完了","pisell2.salesManagement.booking.platform.online_store":"オンラインストア","pisell2.salesManagement.booking.platform.wholesalebusiness":"卸売ビジネス","pisell2.salesManagement.booking.platform.table-order":"テーブル注文","pisell2.salesManagement.booking.platform.mobile_order":"モバイル注文","pisell2.salesManagement.booking.platform.kiosk":"キオスク","pisell2.salesManagement.booking.platform.pos":"POS","pisell2.salesManagement.booking.view-more":"もっと見る","pisell2.salesManagement.booking.common.orderNote":"注文メモ","pisell2.salesManagement.booking.common.internalNote":"内部メモ","pisell2.salesManagement.booking.common.more":"もっと見る","pisell2.salesManagement.booking.common.createdBy":"作成者","pisell2.salesManagement.booking.notes.title":"メモ","pisell2.salesManagement.booking.notes.orderNotes":"注文メモ","pisell2.salesManagement.booking.notes.internalNotes":"内部メモ","pisell2.salesManagement.booking.notes.addOrderNotes":"注文メモを追加","pisell2.salesManagement.booking.notes.addInternalNotes":"内部メモを追加","pisell2.salesManagement.booking.notes.internalVisibleOnlyTip":"チームメンバーにのみ表示されます","pisell2.salesManagement.booking.filter.bookingStatus.label":"予約ステータス","pisell2.salesManagement.booking.filter.bookingStatus.placeholder":"予約ステータスを選択してください","pisell2.salesManagement.booking.filter.bookingDate.label":"予約日時","pisell2.salesManagement.booking.filter.bookingDate.placeholder":"予約日を選択してください","pisell2.salesManagement.booking.filter.holder.label":"予約者","pisell2.salesManagement.booking.filter.holder.placeholder":"予約者を入力してください","pisell2.salesManagement.booking.filter.paxRange.label":"人数範囲","pisell2.salesManagement.booking.filter.paxRange.placeholder":"人数範囲を入力してください","pisell2.salesManagement.booking.filter.resource.label":"リソース","pisell2.salesManagement.booking.filter.resource.placeholder":"リソースを選択してください","pisell2.salesManagement.booking.filter.resource.none":"リソースなし","pisell2.salesManagement.booking.filter.salesChannel.label":"販売チャネル","pisell2.salesManagement.booking.filter.salesChannel.placeholder":"販売チャネルを選択してください","pisell2.salesManagement.booking.filter.orderAmount.label":"注文金額","pisell2.salesManagement.booking.filter.orderAmount.placeholder":"注文金額を入力してください","pisell2.salesManagement.booking.filter.orderStatus.label":"注文ステータス","pisell2.salesManagement.booking.filter.orderStatus.placeholder":"注文ステータスを選択してください","pisell2.salesManagement.booking.filter.paymentStatus.label":"支払いステータス","pisell2.salesManagement.booking.filter.paymentStatus.placeholder":"支払いステータスを選択してください","pisell2.salesManagement.booking.filter.customer.label":"顧客","pisell2.salesManagement.booking.filter.customer.placeholder":"顧客を選択してください","pisell2.salesManagement.booking.filter.includeItems.label":"含まれる商品","pisell2.salesManagement.booking.filter.includeItems.placeholder":"商品を選択してください","pisell2.salesManagement.booking.filter.paymentMethod.label":"支払い方法","pisell2.salesManagement.booking.filter.paymentMethod.placeholder":"支払い方法を選択してください","pisell2.salesManagement.booking.filter.orderDate.label":"注文日","pisell2.salesManagement.booking.filter.orderDate.placeholder":"注文日を選択してください","pisell2.salesManagement.booking.filter.updatedDate.label":"更新日","pisell2.salesManagement.booking.filter.updatedDate.placeholder":"更新日を選択してください","pisell2.salesManagement.booking.sort.afterExecutionTime":"現場実行時間","pisell2.salesManagement.booking.sort.startAt":"開始時間","pisell2.salesManagement.booking.sort.endAt":"終了時間","pisell2.salesManagement.booking.sort.createdAt":"作成時間","pisell2.salesManagement.booking.sort.updatedAt":"最終更新","pisell2.salesManagement.booking.sort.totalAmount":"合計金額","pisell2.salesManagement.booking.sort.refundedAmount":"返金額","pisell2.salesManagement.booking.sort.customerName":"顧客名","pisell2.salesManagement.order.column.saleBrief":"販売概要","pisell2.salesManagement.order.column.customer":"顧客","pisell2.salesManagement.order.column.contact":"連絡先","pisell2.salesManagement.order.column.paymentInfo":"支払い情報","pisell2.salesManagement.order.column.items":"商品","pisell2.salesManagement.order.column.paymentStatus":"支払いステータス","pisell2.salesManagement.order.column.orderOrigin":"注文元","pisell2.salesManagement.order.column.shippingMethod":"配送方法","pisell2.salesManagement.order.column.orderStatus":"注文ステータス","pisell2.salesManagement.order.column.fulfillmentStatus":"処理ステータス","pisell2.salesManagement.order.column.updated":"更新","pisell2.salesManagement.order.column.orderId":"セールスID","pisell2.salesManagement.order.common.orderNote":"注文メモ","pisell2.salesManagement.order.common.internalNote":"内部メモ","pisell2.salesManagement.order.common.createdBy":"作成者","pisell2.salesManagement.order.common.guest":"ゲスト","pisell2.salesManagement.order.common.walkIn":"Walk-in"},pt:{"pisell2.salesManagement.business.online_store":"Loja Online","pisell2.salesManagement.business.ticket_order":"Pedido de Ingresso","pisell2.salesManagement.business.appointment_booking":"Reserva de Agendamento","pisell2.salesManagement.sort.balanceDue":"Saldo Devido","pisell2.salesManagement.sort.oldestFirst":"Mais Antigos Primeiro","pisell2.salesManagement.sort.newestFirst":"Mais Recentes Primeiro","pisell2.salesManagement.sort.latestFirst":"Mais Recentes Primeiro","pisell2.salesManagement.booking.column.bookingBrief":"Resumo da Reserva","pisell2.salesManagement.booking.column.serviceTime":"Hor\xe1rio do Servi\xe7o","pisell2.salesManagement.booking.column.customer":"Cliente","pisell2.salesManagement.booking.column.contact":"Contato","pisell2.salesManagement.booking.column.holder":"Titular","pisell2.salesManagement.booking.column.services":"Servi\xe7os","pisell2.salesManagement.booking.column.pax":"Pessoas","pisell2.salesManagement.booking.column.resource":"Recurso","pisell2.salesManagement.booking.column.forms":"Formul\xe1rios","pisell2.salesManagement.booking.column.orderInfo":"Informa\xe7\xf5es do Pedido","pisell2.salesManagement.booking.column.bookingId":"ID da Reserva","pisell2.salesManagement.booking.column.orderOrigin":"Origem do Pedido","pisell2.salesManagement.booking.column.updated":"Atualizado","pisell2.salesManagement.booking.status.new":"Novo","pisell2.salesManagement.booking.status.confirmed":"Confirmado","pisell2.salesManagement.booking.status.arrived":"Chegou","pisell2.salesManagement.booking.status.started":"Iniciado","pisell2.salesManagement.booking.status.cancelled":"Cancelado","pisell2.salesManagement.booking.status.no_show":"N\xe3o compareceu","pisell2.salesManagement.booking.status.completed":"Conclu\xeddo","pisell2.salesManagement.booking.platform.online_store":"Loja Online","pisell2.salesManagement.booking.platform.wholesalebusiness":"Neg\xf3cio Atacadista","pisell2.salesManagement.booking.platform.table-order":"Pedido na Mesa","pisell2.salesManagement.booking.platform.mobile_order":"Pedido M\xf3vel","pisell2.salesManagement.booking.platform.kiosk":"Quiosque","pisell2.salesManagement.booking.platform.pos":"POS","pisell2.salesManagement.booking.view-more":"Ver mais","pisell2.salesManagement.booking.common.orderNote":"Nota do Pedido","pisell2.salesManagement.booking.common.internalNote":"Nota Interna","pisell2.salesManagement.booking.common.more":"mais","pisell2.salesManagement.booking.common.createdBy":"Criado por","pisell2.salesManagement.booking.notes.title":"Notas","pisell2.salesManagement.booking.notes.orderNotes":"Notas do pedido","pisell2.salesManagement.booking.notes.internalNotes":"Notas internas","pisell2.salesManagement.booking.notes.addOrderNotes":"Adicionar nota do pedido","pisell2.salesManagement.booking.notes.addInternalNotes":"Adicionar nota interna","pisell2.salesManagement.booking.notes.internalVisibleOnlyTip":"Vis\xedvel apenas para membros da sua equipe","pisell2.salesManagement.booking.filter.bookingStatus.label":"Status da Reserva","pisell2.salesManagement.booking.filter.bookingStatus.placeholder":"Selecione o status da reserva","pisell2.salesManagement.booking.filter.bookingDate.label":"Data e Hora da Reserva","pisell2.salesManagement.booking.filter.bookingDate.placeholder":"Selecione a data da reserva","pisell2.salesManagement.booking.filter.holder.label":"Titular","pisell2.salesManagement.booking.filter.holder.placeholder":"Insira o titular","pisell2.salesManagement.booking.filter.paxRange.label":"Faixa de Pessoas","pisell2.salesManagement.booking.filter.paxRange.placeholder":"Insira a faixa de pessoas","pisell2.salesManagement.booking.filter.resource.label":"Recurso","pisell2.salesManagement.booking.filter.resource.placeholder":"Selecione o recurso","pisell2.salesManagement.booking.filter.resource.none":"Sem Recurso","pisell2.salesManagement.booking.filter.salesChannel.label":"Canal de Vendas","pisell2.salesManagement.booking.filter.salesChannel.placeholder":"Selecione o canal de vendas","pisell2.salesManagement.booking.filter.orderAmount.label":"Valor do Pedido","pisell2.salesManagement.booking.filter.orderAmount.placeholder":"Insira o valor do pedido","pisell2.salesManagement.booking.filter.orderStatus.label":"Status do Pedido","pisell2.salesManagement.booking.filter.orderStatus.placeholder":"Selecione o status do pedido","pisell2.salesManagement.booking.filter.paymentStatus.label":"Status do Pagamento","pisell2.salesManagement.booking.filter.paymentStatus.placeholder":"Selecione o status do pagamento","pisell2.salesManagement.booking.filter.customer.label":"Cliente","pisell2.salesManagement.booking.filter.customer.placeholder":"Selecione o cliente","pisell2.salesManagement.booking.filter.includeItems.label":"Itens Inclu\xeddos","pisell2.salesManagement.booking.filter.includeItems.placeholder":"Selecione os itens","pisell2.salesManagement.booking.filter.paymentMethod.label":"M\xe9todo de Pagamento","pisell2.salesManagement.booking.filter.paymentMethod.placeholder":"Selecione o m\xe9todo de pagamento","pisell2.salesManagement.booking.filter.orderDate.label":"Data do Pedido","pisell2.salesManagement.booking.filter.orderDate.placeholder":"Selecione a data do pedido","pisell2.salesManagement.booking.filter.updatedDate.label":"Data de Atualiza\xe7\xe3o","pisell2.salesManagement.booking.filter.updatedDate.placeholder":"Selecione a data de atualiza\xe7\xe3o","pisell2.salesManagement.booking.sort.afterExecutionTime":"Ap\xf3s o Hor\xe1rio de Execu\xe7\xe3o","pisell2.salesManagement.booking.sort.startAt":"Hora de In\xedcio","pisell2.salesManagement.booking.sort.endAt":"Hora de T\xe9rmino","pisell2.salesManagement.booking.sort.createdAt":"Hora de Cria\xe7\xe3o","pisell2.salesManagement.booking.sort.updatedAt":"\xdaltima Atualiza\xe7\xe3o","pisell2.salesManagement.booking.sort.totalAmount":"Valor Total","pisell2.salesManagement.booking.sort.refundedAmount":"Valor Reembolsado","pisell2.salesManagement.booking.sort.customerName":"Nome do Cliente","pisell2.salesManagement.order.column.saleBrief":"Resumo da Venda","pisell2.salesManagement.order.column.customer":"Cliente","pisell2.salesManagement.order.column.contact":"Contato","pisell2.salesManagement.order.column.paymentInfo":"Informa\xe7\xf5es de Pagamento","pisell2.salesManagement.order.column.items":"Itens","pisell2.salesManagement.order.column.paymentStatus":"Status do Pagamento","pisell2.salesManagement.order.column.orderOrigin":"Origem do Pedido","pisell2.salesManagement.order.column.shippingMethod":"M\xe9todo de Envio","pisell2.salesManagement.order.column.orderStatus":"Status do Pedido","pisell2.salesManagement.order.column.fulfillmentStatus":"Status de Atendimento","pisell2.salesManagement.order.column.updated":"Atualizado","pisell2.salesManagement.order.column.orderId":"ID de Venda","pisell2.salesManagement.order.common.orderNote":"Nota do Pedido","pisell2.salesManagement.order.common.internalNote":"Nota Interna","pisell2.salesManagement.order.common.createdBy":"Criado por","pisell2.salesManagement.order.common.guest":"Convidado","pisell2.salesManagement.order.common.walkIn":"Walk-in"}},eWN="pisell-reservation.venue-wall-page.v1",eWC="pisell-reservation.table-page.v1",eWT={start:"02:00",end:"02:00"},eWP={en:{...eVJ.en,...eWM.en,...eUF},"zh-CN":{...eVJ["zh-CN"],...eWM["zh-CN"],...eUB},"zh-HK":{...eVJ["zh-HK"],...eWM["zh-HK"],...eUH},ja:{...eVJ.ja??{},...eWM.ja??{},"pisell-reservation.page-title":"予約","pisell-reservation.page-title-venue":"会場オペレーション","pisell-reservation.new":"+ 新規","pisell-reservation.new-modal-title":"新規","pisell-reservation.new-modal-placeholder":"利用できるルートがありません","pisell-reservation.cancel":"キャンセル","pisell-reservation.edit-map":"フロア図を編集","pisell-reservation.edit-map-done":"編集を完了","pisell-reservation.floor-map-appearance-dark":"暗い背景","pisell-reservation.floor-map-appearance-light":"明るい背景","pisell-reservation.follow-current":"現在","pisell-reservation.view-grid":"表","pisell-reservation.view-floor":"フロア図","pisell-reservation.view-calendar":"カレンダー","pisell-reservation.view-resource-wall":"ウォール","pisell-reservation.resource-wall-resources":"ウォール表示リソース","pisell-reservation.payment-status-bucket-unpaid":"未払い","pisell-reservation.payment-status-bucket-paid":"支払済み","pisell-reservation.booking-status-bucket-on-site":"来店中","pisell-reservation.booking-status-bucket-no-show":"不来店","pisell-reservation.booking-status-bucket-completed":"完了","pisell-reservation.calendar-granularity-resource":"リソース","pisell-reservation.calendar-granularity-day":"日","pisell-reservation.calendar-granularity-week":"週","pisell-reservation.calendar-granularity-month":"月","pisell-reservation.calendar-write-not-available":"この操作はまだ利用できません。フロア図または表で操作してください。","pisell-reservation.follow-live-time":"現在時刻","pisell-reservation.follow-custom-time":"カスタム時刻","pisell-reservation.follow-live-hint":"現在時刻に追従しています","pisell-reservation.follow-custom-hint":"カスタム時刻を使用しています","pisell-reservation.switch-to-custom-time":"カスタム時刻に切り替え","pisell-reservation.switch-to-live-time":"現在時刻に切り替え","pisell-reservation.non-current-hint":"現在時刻ではありません","pisell-reservation.at-current-time":"現在時刻を表示中です","pisell-reservation.at-current-time-short":"現在","pisell-reservation.go-current":"現在へ","pisell-reservation.schedule-data-loading":"予約データを読み込み中…","pisell-reservation.hud-open-table-aria":"フロアマップ上のバインド済みリソース一覧を開く","pisell-reservation.hud-table-drawer-title":"マップ上のリソース","pisell-reservation.hud-drawer-resource-canvas-placeholder":"キャンバス(エリア)で絞り込み","pisell-reservation.hud-sheet-close-aria":"リソース一覧を閉じる","pisell-reservation.hud-expand-aria":"リソース一覧を展開","pisell-reservation.hud-collapse-aria":"リソース一覧を閉じる","pisell-reservation.grid.code":"卓番","pisell-reservation.grid.area":"エリア","pisell-reservation.grid.status":"状態","pisell-reservation.grid.guest":"ゲスト","pisell-reservation.grid.time":"時間","pisell-reservation.grid.party":"人数","pisell-reservation.canvas.main":"メインエリア","pisell-reservation.canvas.secondary":"サブエリア","pisell-reservation.canvas.vip":"VIP エリア","pisell-reservation.maintenance":"メンテナンス中","pisell-reservation.next":"次","pisell-reservation.party":"名","pisell-reservation.more":"その他","pisell-reservation.late":"遅刻","pisell-reservation.floor-hud.total":"合計","pisell-reservation.floor-hud.interactive-title":"本日売上","pisell-reservation.floor-map.data-source-label":"リソース","pisell-reservation.floor-map.category-background":"装飾","pisell-reservation.floor-map.palette-image-bg":"画像(背景)","pisell-reservation.floor-plan.save-failed":"フロア図の保存に失敗しました","pisell-reservation.card-placeholder.hint-select-row":"データソースは選択済みです。サイドバーで行を選択してください。","pisell-reservation.card-placeholder.hint-bind-datasource":"行が未連携です。サイドバーでデータソースとレコードを選択してください。","pisell-reservation.card-placeholder.hint-new-slot":"新しい卓のプレースホルダーです。サイドバーでレコードを紐付けられます。","pisell-reservation.card-placeholder.hint-row-not-found":"レコードが見つかりません。連携とデータ一覧を確認してください。","pisell-reservation.resource-grid.id":"ID","pisell-reservation.resource-grid.name":"名称","pisell-reservation.resource-grid.form-code":"フォームコード","pisell-reservation.resource-grid.capacity":"収容人数","pisell-reservation.resource-grid.schedule":"スケジュール","pisell-reservation.resource-grid.form-id":"フォーム ID","pisell-reservation.resource-grid.card-status":"カード状態","pisell-reservation.room-kind-bound":"リソース(紐付け済み)","pisell-reservation.room-kind-bound-round":"丸テーブル(紐付け)","pisell-reservation.room-status-occupied":"使用中","pisell-reservation.room-status-reserved":"予約済み","pisell-reservation.room-status-empty":"空席","pisell-reservation.room-status-locked":"ロック","pisell-reservation.room-empty-body":"予約なし","pisell-reservation.room-status-unbound":"未連携","pisell-reservation.room-paid":"支払済み","pisell-reservation.room-unpaid":"未払い","pisell-reservation.room-payment-needed":"会計","pisell-reservation.room-items-total":"商品 {n} 点","pisell-reservation.room-items-summary":"{items} 点 \xb7 合計 {qty} 個","pisell-reservation.room-modal-bookings":"予約 {n} 件","pisell-reservation.room-cap-prefix":"定員","pisell-reservation.room-time-end":"終了","pisell-reservation.room-time-start":"開始","pisell-reservation.room-in-minutes":"あと {d}","pisell-reservation.room-view-all":"予約 {n} 件をすべて表示","pisell-reservation.room-occupancy-sum":"人数 {current}/{capacity}","pisell-reservation.room-next-prefix":"次枠","pisell-reservation.room-guest-unknown":"ゲスト","pisell-reservation.room-collapse":"折りたたむ","pisell-reservation.booking-detail.modal-title":"詳細","pisell-reservation.booking-detail.booking-id":"予約番号","pisell-reservation.booking-detail.status":"状態","pisell-reservation.booking-detail.contact":"ゲスト","pisell-reservation.booking-detail.phone":"電話","pisell-reservation.booking-detail.time":"時間","pisell-reservation.booking-detail.staff":"スタッフ","pisell-reservation.booking-detail.staff-unassigned":"未割当","pisell-reservation.booking-detail.table":"卓","pisell-reservation.booking-detail.payment":"支払い","pisell-reservation.booking-detail.total":"合計","pisell-reservation.booking-detail.tab-info":"情報","pisell-reservation.booking-detail.tab-notes":"メモ","pisell-reservation.booking-detail.tab-form":"フォーム","pisell-reservation.booking-detail.empty-notes":"メモなし","pisell-reservation.booking-detail.empty-items":"明細なし","pisell-reservation.booking-detail.empty-tab-bookings":"売上がありません","pisell-reservation.booking-detail.empty-form":"追加項目なし","pisell-reservation.booking-detail.header-close":"閉じる","pisell-reservation.booking-detail.header-new-order":"新規注文","pisell-reservation.booking-detail.tabs-aria":"予約詳細タブ","pisell-reservation.booking-detail.tab-current-occupied":"現在利用中","pisell-reservation.booking-detail.tab-ended":"終了済み","pisell-reservation.booking-detail.tab-unpaid":"未払い","pisell-reservation.booking-detail.booking-label":"予約","pisell-reservation.booking-detail.strip-items-total":"{count} 点 注文合計:{total}","pisell-reservation.booking-detail.strip-due-label":"お支払い:","pisell-reservation.booking-detail.see-all":"すべて表示","pisell-reservation.booking-detail.header-mode-aria":"詳細ヘッダー表示","pisell-reservation.booking-detail.header-mode-order-strip":"情報バー","pisell-reservation.booking-detail.header-mode-room-card":"ルームカード","pisell-reservation.booking-detail.action-grid-aria":"操作","pisell-reservation.booking-detail.action-edit":"編集","pisell-reservation.booking-detail.action-cart":"会計","pisell-reservation.booking-detail.action-paid":"支払済み","pisell-reservation.booking-detail.action-print":"領収書印刷","pisell-reservation.booking-detail.action-form":"リソース変更","pisell-reservation.booking-detail.action-list":"注文詳細","pisell-reservation.booking-detail.action-close":"キャンセル","pisell-reservation.booking-detail.action-start":"開始","pisell-reservation.booking-detail.action-complete":"完了","pisell-reservation.booking-detail.resource-already-bound":"この注文はすでにこのリソースに紐付いています。別のリソースを選択してください。","pisell-reservation.booking-detail.resource-type-mismatch":"リソース種別が一致しません。別のリソースを選択してください。","pisell-reservation.select-resource.title":"リソースを選択","pisell-reservation.booking-detail.confirm-close-title":"取り消しますか?","pisell-reservation.booking-detail.confirm-close-ok":"確定","pisell-reservation.booking-detail.confirm-close-cancel":"やめる","pisell-reservation.booking-detail.confirm-close-content":"この操作は元に戻せません。","pisell-reservation.booking-detail.confirm-start-title":"今すぐ開始しますか?","pisell-reservation.booking-detail.confirm-start-ok":"開始","pisell-reservation.booking-detail.confirm-start-cancel":"キャンセル","pisell-reservation.booking-detail.confirm-start-content":"続行する前に確認してください。","pisell-reservation.booking-detail.confirm-complete-title":"完了にしますか?","pisell-reservation.booking-detail.confirm-complete-ok":"完了","pisell-reservation.booking-detail.confirm-complete-cancel":"キャンセル","pisell-reservation.booking-detail.confirm-complete-content":"この予約を終了する前に確認してください。","pisell-reservation.booking-detail.to-pay":"お支払い","pisell-reservation.booking-detail.order-open":"未会計","pisell-reservation.booking-detail.order-already-paid":"注文は既に支払済みです","pisell-reservation.booking-detail.meta-host-status":"カード上の状態","pisell-reservation.booking-detail.meta-line-amount":"注文金額","pisell-reservation.booking-detail.meta-timeout":"超過","pisell-reservation.booking-detail.meta-progress":"進行状況","pisell-reservation.booking-detail.meta-arrival":"開始まで","pisell-reservation.booking-detail.status-enum.started":"開始済み","pisell-reservation.booking-detail.status-enum.confirmed":"確定","pisell-reservation.booking-detail.status-enum.active":"進行中","pisell-reservation.booking-detail.status-enum.checked_in":"チェックイン済","pisell-reservation.booking-detail.status-enum.checkin":"チェックイン","pisell-reservation.booking-detail.status-enum.in_progress":"進行中","pisell-reservation.booking-detail.status-enum.pending":"保留","pisell-reservation.booking-detail.status-enum.pending_payment":"未払い","pisell-reservation.booking-detail.status-enum.draft":"下書き","pisell-reservation.booking-detail.status-enum.waiting":"待機","pisell-reservation.booking-detail.status-enum.hold":"保留","pisell-reservation.booking-detail.status-enum.cancelled":"キャンセル","pisell-reservation.booking-detail.status-enum.canceled":"キャンセル","pisell-reservation.booking-detail.status-enum.void":"無効","pisell-reservation.booking-detail.status-enum.refunded":"返金済"},pt:{...eVJ.pt??{},...eWM.pt??{},"pisell-reservation.page-title":"Reserva","pisell-reservation.page-title-venue":"Controlo do espa\xe7o","pisell-reservation.new":"+ Novo","pisell-reservation.new-modal-title":"Novo","pisell-reservation.new-modal-placeholder":"Sem rotas dispon\xedveis","pisell-reservation.cancel":"Cancelar","pisell-reservation.edit-map":"Editar planta","pisell-reservation.edit-map-done":"Concluir edi\xe7\xe3o","pisell-reservation.floor-map-appearance-dark":"Fundo escuro","pisell-reservation.floor-map-appearance-light":"Fundo claro","pisell-reservation.follow-current":"Actual","pisell-reservation.view-grid":"Tabela","pisell-reservation.view-floor":"Planta","pisell-reservation.view-calendar":"Calend\xe1rio","pisell-reservation.view-resource-wall":"Painel","pisell-reservation.resource-wall-resources":"Recursos no painel","pisell-reservation.payment-status-bucket-unpaid":"N\xe3o pago","pisell-reservation.payment-status-bucket-paid":"Pago","pisell-reservation.booking-status-bucket-on-site":"No local","pisell-reservation.booking-status-bucket-no-show":"N\xe3o compareceu","pisell-reservation.booking-status-bucket-completed":"Conclu\xeddo","pisell-reservation.calendar-granularity-resource":"Recursos","pisell-reservation.calendar-granularity-day":"Dia","pisell-reservation.calendar-granularity-week":"Semana","pisell-reservation.calendar-granularity-month":"M\xeas","pisell-reservation.calendar-write-not-available":"Esta a\xe7\xe3o ainda n\xe3o est\xe1 dispon\xedvel. Utilize a planta ou a tabela.","pisell-reservation.follow-live-time":"Hora actual","pisell-reservation.follow-custom-time":"Hora personalizada","pisell-reservation.follow-live-hint":"A seguir a hora actual","pisell-reservation.follow-custom-hint":"A usar hora personalizada","pisell-reservation.switch-to-custom-time":"Mudar para hora personalizada","pisell-reservation.switch-to-live-time":"Mudar para hora actual","pisell-reservation.non-current-hint":"N\xe3o est\xe1 na hora actual","pisell-reservation.at-current-time":"Est\xe1 na hora actual","pisell-reservation.at-current-time-short":"Agora","pisell-reservation.go-current":"Ir para actual","pisell-reservation.schedule-data-loading":"A carregar reservas…","pisell-reservation.hud-open-table-aria":"Abrir tabela de recursos ligados na planta","pisell-reservation.hud-table-drawer-title":"Recursos no mapa","pisell-reservation.hud-drawer-resource-canvas-placeholder":"Filtrar por \xe1rea (canvas)","pisell-reservation.hud-sheet-close-aria":"Fechar lista de recursos","pisell-reservation.hud-expand-aria":"Expandir lista de recursos","pisell-reservation.hud-collapse-aria":"Fechar lista de recursos","pisell-reservation.grid.code":"Mesa","pisell-reservation.grid.area":"Zona","pisell-reservation.grid.status":"Estado","pisell-reservation.grid.guest":"Cliente","pisell-reservation.grid.time":"Hora","pisell-reservation.grid.party":"Pessoas","pisell-reservation.canvas.main":"Zona principal","pisell-reservation.canvas.secondary":"Zona secund\xe1ria","pisell-reservation.canvas.vip":"Zona VIP","pisell-reservation.maintenance":"Em manuten\xe7\xe3o","pisell-reservation.next":"SEGUINTE","pisell-reservation.party":"pessoas","pisell-reservation.more":"mais","pisell-reservation.late":"atraso","pisell-reservation.floor-hud.total":"Total","pisell-reservation.floor-hud.interactive-title":"Vendas de hoje","pisell-reservation.floor-map.data-source-label":"Recurso","pisell-reservation.floor-map.category-background":"Decora\xe7\xf5es","pisell-reservation.floor-map.palette-image-bg":"Imagem (fundo)","pisell-reservation.floor-plan.save-failed":"Falha ao guardar a planta","pisell-reservation.card-placeholder.hint-select-row":"Fonte de dados seleccionada. Escolha uma linha na barra lateral.","pisell-reservation.card-placeholder.hint-bind-datasource":"Sem linha ligada: seleccione fonte e registo na barra lateral.","pisell-reservation.card-placeholder.hint-new-slot":"Marcador de nova mesa. Pode ligar um registo na barra lateral.","pisell-reservation.card-placeholder.hint-row-not-found":"Registo n\xe3o encontrado: verifique a liga\xe7\xe3o ou a lista.","pisell-reservation.resource-grid.id":"ID","pisell-reservation.resource-grid.name":"Nome","pisell-reservation.resource-grid.form-code":"C\xf3digo do formul\xe1rio","pisell-reservation.resource-grid.capacity":"Capacidade","pisell-reservation.resource-grid.schedule":"Agenda","pisell-reservation.resource-grid.form-id":"ID do formul\xe1rio","pisell-reservation.resource-grid.card-status":"Estado do cart\xe3o","pisell-reservation.room-kind-bound":"Recurso ligado","pisell-reservation.room-kind-bound-round":"Mesa redonda (ligada)","pisell-reservation.room-status-occupied":"Ocupada","pisell-reservation.room-status-reserved":"Reservada","pisell-reservation.room-status-empty":"Livre","pisell-reservation.room-status-locked":"Bloqueada","pisell-reservation.room-empty-body":"Sem reservas","pisell-reservation.room-status-unbound":"Sem liga\xe7\xe3o","pisell-reservation.room-paid":"Pago","pisell-reservation.room-unpaid":"N\xe3o pago","pisell-reservation.room-payment-needed":"Cobrar","pisell-reservation.room-items-total":"Total {n} itens","pisell-reservation.room-items-summary":"{items} itens \xb7 {qty} un.","pisell-reservation.room-modal-bookings":"{n} reservas","pisell-reservation.room-cap-prefix":"Cap.","pisell-reservation.room-time-end":"Fim","pisell-reservation.room-time-start":"In\xedcio","pisell-reservation.room-in-minutes":"em {d}","pisell-reservation.room-view-all":"Ver todas as {n} reservas","pisell-reservation.room-occupancy-sum":"Pessoas {current}/{capacity}","pisell-reservation.room-next-prefix":"Seguinte","pisell-reservation.room-guest-unknown":"Cliente","pisell-reservation.room-collapse":"Recolher","pisell-reservation.booking-detail.modal-title":"Detalhes","pisell-reservation.booking-detail.booking-id":"ID da reserva","pisell-reservation.booking-detail.status":"Estado","pisell-reservation.booking-detail.contact":"Cliente","pisell-reservation.booking-detail.phone":"Telefone","pisell-reservation.booking-detail.time":"Hora","pisell-reservation.booking-detail.staff":"Staff","pisell-reservation.booking-detail.staff-unassigned":"N\xe3o atribu\xeddo","pisell-reservation.booking-detail.table":"Mesa","pisell-reservation.booking-detail.payment":"Pagamento","pisell-reservation.booking-detail.total":"Total","pisell-reservation.booking-detail.tab-info":"Info","pisell-reservation.booking-detail.tab-notes":"Notas","pisell-reservation.booking-detail.tab-form":"Formul\xe1rio","pisell-reservation.booking-detail.empty-notes":"Sem notas","pisell-reservation.booking-detail.empty-items":"Sem linhas","pisell-reservation.booking-detail.empty-tab-bookings":"Sem vendas","pisell-reservation.booking-detail.empty-form":"Sem campos extra","pisell-reservation.booking-detail.header-close":"Fechar","pisell-reservation.booking-detail.header-new-order":"Novo pedido","pisell-reservation.booking-detail.tabs-aria":"Abas do detalhe da reserva","pisell-reservation.booking-detail.tab-current-occupied":"Em uso agora","pisell-reservation.booking-detail.tab-ended":"Encerrados","pisell-reservation.booking-detail.tab-unpaid":"N\xe3o pagos","pisell-reservation.booking-detail.booking-label":"Reserva","pisell-reservation.booking-detail.strip-items-total":"{count} itens Total do pedido : {total}","pisell-reservation.booking-detail.strip-due-label":"A pagar:","pisell-reservation.booking-detail.see-all":"Ver tudo","pisell-reservation.booking-detail.header-mode-aria":"Vista do cabe\xe7alho","pisell-reservation.booking-detail.header-mode-order-strip":"Resumo","pisell-reservation.booking-detail.header-mode-room-card":"Cart\xe3o da mesa","pisell-reservation.booking-detail.action-grid-aria":"A\xe7\xf5es da reserva","pisell-reservation.booking-detail.action-edit":"Editar","pisell-reservation.booking-detail.action-cart":"Checkout","pisell-reservation.booking-detail.action-paid":"Pago","pisell-reservation.booking-detail.action-print":"Imprimir recibos","pisell-reservation.booking-detail.action-form":"Alterar recurso","pisell-reservation.booking-detail.action-list":"Detalhe do pedido","pisell-reservation.booking-detail.action-close":"Cancelar","pisell-reservation.booking-detail.action-start":"Iniciar","pisell-reservation.booking-detail.action-complete":"Concluir","pisell-reservation.booking-detail.resource-already-bound":"Este pedido j\xe1 est\xe1 associado a este recurso. Selecione outro recurso.","pisell-reservation.booking-detail.resource-type-mismatch":"O tipo de recurso n\xe3o corresponde. Selecione outro recurso.","pisell-reservation.select-resource.title":"Seleccionar recurso","pisell-reservation.booking-detail.confirm-close-title":"Deseja cancelar?","pisell-reservation.booking-detail.confirm-close-ok":"Confirmar","pisell-reservation.booking-detail.confirm-close-cancel":"Desistir","pisell-reservation.booking-detail.confirm-close-content":"Esta a\xe7\xe3o n\xe3o pode ser desfeita.","pisell-reservation.booking-detail.confirm-start-title":"Come\xe7ar agora?","pisell-reservation.booking-detail.confirm-start-ok":"Iniciar","pisell-reservation.booking-detail.confirm-start-cancel":"Cancelar","pisell-reservation.booking-detail.confirm-start-content":"Confirme antes de continuar.","pisell-reservation.booking-detail.confirm-complete-title":"Concluir?","pisell-reservation.booking-detail.confirm-complete-ok":"Concluir","pisell-reservation.booking-detail.confirm-complete-cancel":"Cancelar","pisell-reservation.booking-detail.confirm-complete-content":"Confirme antes de encerrar esta reserva.","pisell-reservation.booking-detail.to-pay":"A pagar","pisell-reservation.booking-detail.order-open":"Aberto","pisell-reservation.booking-detail.order-already-paid":"Pedido j\xe1 pago.","pisell-reservation.booking-detail.meta-host-status":"Estado no cart\xe3o","pisell-reservation.booking-detail.meta-line-amount":"Valor do pedido","pisell-reservation.booking-detail.meta-timeout":"Excesso de tempo","pisell-reservation.booking-detail.meta-progress":"Progresso","pisell-reservation.booking-detail.meta-arrival":"At\xe9 o in\xedcio","pisell-reservation.booking-detail.status-enum.started":"Iniciado","pisell-reservation.booking-detail.status-enum.confirmed":"Confirmado","pisell-reservation.booking-detail.status-enum.active":"Ativo","pisell-reservation.booking-detail.status-enum.checked_in":"Check-in","pisell-reservation.booking-detail.status-enum.checkin":"Check-in","pisell-reservation.booking-detail.status-enum.in_progress":"Em curso","pisell-reservation.booking-detail.status-enum.pending":"Pendente","pisell-reservation.booking-detail.status-enum.pending_payment":"Pagamento pendente","pisell-reservation.booking-detail.status-enum.draft":"Rascunho","pisell-reservation.booking-detail.status-enum.waiting":"Em espera","pisell-reservation.booking-detail.status-enum.hold":"Em espera","pisell-reservation.booking-detail.status-enum.cancelled":"Cancelado","pisell-reservation.booking-detail.status-enum.canceled":"Cancelado","pisell-reservation.booking-detail.status-enum.void":"Anulado","pisell-reservation.booking-detail.status-enum.refunded":"Reembolsado"}},eWA="pisell-reservation.hud-table-drawer-title",eWD="pisell-reservation.resource-wall-resources",eWI="pisell-reservation.resource-wall-filter",eWE=["resource_wall_resource_ids"],eWz="pisell-reservation.at-current-time",eWL="pisell-reservation.go-current",eWO=new Set(["booking_ticket","sales2"]);function eWR(e){let t=null==e?void 0:e.type;return"start_time"!==t&&"end_time"!==t?null:function(e){let t=e.trim();if(!t)return null;let l=t.split(":").map(e=>e.trim()),a=Number(l[0]),i=Number(l[1]??"0"),n=Number(l[2]??"0");return!Number.isFinite(a)||!Number.isFinite(i)||!Number.isFinite(n)||a<0||a>23||i<0||i>59||n<0||n>59?null:`${String(a).padStart(2,"0")}:${String(i).padStart(2,"0")}`}(String((null==e?void 0:e.time)??""))}let eW$=[];function eWF(e){return eWR(e)??eWT.start}function eWB(e,t){let[l,a]=t.split(":"),i=Number(l),n=Number(a??"0");return e.hour(i).minute(n).second(0).millisecond(0)}function eWH(e){return"end_time"===String((null==e?void 0:e.type)??"")}function eWq(e,t){let l,a,i,n,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eWT,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:em()(),o=em()(e).startOf("day");if(o.isSame(r.startOf("day"),"day")){let e=(0,lL.pickReferenceDateContainingNow)(s,r);return(0,lL.getRangeBounds)(s,e)}return l=eWF(t),a=o.startOf("day"),n=(i=eWB(eWH(t)?a.subtract(1,"day"):a,l)).add(1,"day"),[i,n]}function eWV(e){return[em()(e[0]).format("YYYY-MM-DD HH:mm:ss"),em()(e[1]).subtract(1,"second").format("YYYY-MM-DD HH:mm:ss")]}function eWY(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eWT,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:em()();return eWV(eWq(e,t,l,a))}function eWU(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:em()(),t=arguments.length>1?arguments[1]:void 0,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eWT,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:em()();return{filter:{values:{order_payment_status:eVO,booking_time_start_between:eWY(e.startOf("day"),t,l,a)}}}}function eWW(e,t){var l,a;let i=(null==t?void 0:t.listPageSize)??50,n=(null==t?void 0:t.getInitialSearchParams)??(()=>eWU(em()())),s=null==t?void 0:t.extraRequestParams,r=(null==t?void 0:t.subscribeRealtimePush)??!0,[o,d]=(0,ef.useState)({pageNumber:1,pageSize:i}),[c,u]=(0,ef.useState)(()=>n()),p=(0,ef.useRef)((0,eH.LP)()),m=(0,ef.useRef)(null),g=(0,ef.useRef)(null),h=(0,ef.useRef)(null),v=(0,ef.useRef)(!0),[f,y]=(0,ef.useState)(0);(0,ef.useEffect)(()=>(v.current=!0,()=>{v.current=!1,null!=h.current&&(cancelAnimationFrame(h.current),h.current=null),g.current=null}),[]);let x=(0,ef.useMemo)(()=>{let{keyword:e,filter:t,sort:l}=c;return{keyword:e,sort:l,...(null==t?void 0:t.values)||{},...null!=s?s:{},skip:o.pageNumber,num:o.pageSize}},[c,o.pageNumber,o.pageSize,s]),b=rP(i0(async e=>r?eVV(e,{osServer:!0,subscriberId:p.current,callback:e=>{let t=(null==e?void 0:e.data)??e;null!=t&&Array.isArray(t.list)&&(g.current=t,null==h.current&&(h.current=requestAnimationFrame(()=>{var e;h.current=null;let t=g.current;g.current=null,null!=t&&v.current&&(null==(e=m.current)||e.call(m,eVq(t)),y(e=>e+1))})))}}):eVV(e,{osServer:!0})),{manual:!0});m.current=b.mutate,(0,ef.useEffect)(()=>{e&&b.run(x)},[e,x]),(0,ef.useEffect)(()=>{if(!e||!r)return;let t=p.current;return()=>{eVU(t)}},[e,r]);let _=(0,ef.useCallback)((e,t)=>{e<1||t<1||d({pageNumber:e,pageSize:t})},[]),k=(0,ef.useCallback)(e=>{u(e||{}),d(e=>({...e,pageNumber:1}))},[]),w=(0,ef.useCallback)(()=>{u(n()),d(e=>({...e,pageNumber:1}))},[n]),j=(0,ef.useCallback)(e=>{u(t=>e({...t})),d(e=>({...e,pageNumber:1}))},[]),S=(0,ef.useCallback)(()=>{b.run(x)},[b,x]),M=(0,ef.useCallback)(()=>b.runAsync(x),[b,x]),N=null==(l=b.data)?void 0:l.list,C=(0,ef.useMemo)(()=>Array.isArray(N)&&0!==N.length?N:eW$,[N]),T=(null==(a=b.data)?void 0:a.count)??0;return{data:C,loading:b.loading,total:T,pagination:o,onPageChange:_,searchParams:c,onSearch:k,onReset:w,refresh:S,refreshAsync:M,patchSearchParams:j,pushDataVersion:f}}function eWG(e){let t=String(e.status??e.booking_status??e.order_status??"").trim().toLowerCase();return!!t&&("empty"===t||"reserved"!==t&&"occupied"!==t&&"locked"!==t)}function eWQ(e,t){if(!e)return;let l=e.relation_id;"number"==typeof l&&l>0?t.add(String(Math.trunc(l))):"string"==typeof l&&""!==l&&"0"!==l&&t.add(l);let a=e.children;if(Array.isArray(a))for(let e of a)eWQ(e,t)}function eWK(e){let t=new Set,l=e.event_resources;if(Array.isArray(l))for(let e of l)eWQ(e,t);let a=e.resources;if(Array.isArray(a))for(let e of a)eWQ(e,t);return[...t]}function eWJ(e){let t=e.metadata;if((null==t?void 0:t.multiple_resource_flag)!==1)return!1;let l=e.product_uid;if(null!=l&&""!==String(l))return!1;let a=e.resources;return!Array.isArray(a)||0===a.length}function eWZ(e){let t=e.relation_form_name;if(t)return t;let l=Array.isArray(e.event_resources)?e.event_resources[0]:void 0,a=Array.isArray(e.resources)?e.resources[0]:void 0,i=l??a,n=null==i?void 0:i.metadata,s=(null==n?void 0:n.resource_name)??(null==n?void 0:n.form_name);if("string"==typeof s&&s)return s;let r=e.booking_id;return null!=r&&""!==r?String(r):String(e.id??"")}function eWX(e){var t;let l=eYq(e);return(null==l||null==(t=l.name)?void 0:t.trim())||""}function eW0(e){let t=e.start_at;if(t&&em()(t).isValid())return em()(t).format("YYYY-MM-DD");let l=e.start_date;if("string"==typeof l&&/^\d{4}-\d{2}-\d{2}/.test(l))return l.slice(0,10)}function eW2(e){let t=e.start_at||(e.start_date&&e.start_time?`${e.start_date} ${e.start_time}`:null);if(!t)return"";let l=em()(t);return l.isValid()?l.format("HH:mm"):""}function eW1(e){if("reserved"!==String(e.status))return;let t=String(e.reserved_status??"");return"late"===t?"late":"not_arrived"===t?"not_arrived":void 0}function eW4(e){if("occupied"===String(e.status))return!0===e.isTimeout||void 0}function eW3(e){let t=eW1(e),l=eW4(e),a={};return null!=t&&(a.hostReservedStatus=t),!0===l&&(a.hostIsTimeout=!0),a}function eW8(e,t,l){let a;return{id:e,code:l??eWZ(t),cardStatus:"occupied"===(a=String(t.status??""))?"occupied":"reserved"===a?"booked":"locked"===a?"maintenance":"available",...eW3(t),guestName:eWX(t)||void 0,time:eW2(t)||void 0,floorMapSourceBookings:[t],floorMapReferenceDay:eW0(t),partySize:(()=>{let e=t.number;if("number"==typeof e&&Number.isFinite(e))return e;if(null!=e&&""!==e){let t=Number(e);return Number.isFinite(t)?t:void 0}})()}}function eW6(e,t){let l=t.find(e=>e.relation_form_name),a=(null==l?void 0:l.relation_form_name)?String(l.relation_form_name):eWZ(t[0]),i=[...t].sort((e,t)=>em()(e.start_at||`${String(e.start_date??"")} ${String(e.start_time??"")}`.trim()).valueOf()-em()(t.start_at||`${String(t.start_date??"")} ${String(t.start_time??"")}`.trim()).valueOf());if(1===i.length)return eW8(e,i[0],a);let n=i.some(e=>"locked"===String(e.status)),s=i.some(e=>"occupied"===String(e.status)),r=n?"maintenance":s?"occupied":"booked",o={};if("occupied"===r){let e=i.find(e=>"occupied"===String(e.status));e&&eW4(e)&&(o.hostIsTimeout=!0)}if("booked"===r){let e=i.find(e=>"reserved"===String(e.status)),t=e?eW1(e):void 0;null!=t&&(o.hostReservedStatus=t)}return{id:e,code:a||e,cardStatus:r,..."maintenance"===r?{hostReservedStatus:void 0,hostIsTimeout:void 0}:o,floorMapSourceBookings:i,floorMapReferenceDay:eW0(i[0]),slots:i.map(e=>({name:eWX(e)||"",time:eW2(e)||"-"}))}}function eW5(e){if(!Array.isArray(e)||0===e.length)return[];let t=e.filter(e=>!!e&&"object"==typeof e&&!(eWG(e)||eWJ(e))),l=new Map,a=[];for(let e of t){let t=eWK(e);if(t.length>0)for(let a of t){let t=l.get(a)??[];t.push(e),l.set(a,t)}else a.push(e)}let i=[];for(let[e,t]of l)i.push(eW6(e,t));for(let e of a){let t=null!=e.id?String(e.id):`booking_${i.length}`;i.push(eW8(t,e))}return i}function eW7(e){if(null==e||"object"!=typeof e)return null;let t=function(e){let t=e.id;if("number"==typeof t&&Number.isFinite(t)){let e=Math.trunc(t);return e>0?String(e):null}if("string"==typeof t){let e=t.trim();if(!e||"0"===e)return null;let l=Number(e);if(Number.isFinite(l)&&l>0)return String(Math.trunc(l));if(/^\d+$/.test(e))return e}return null}(e);return null==t?null:{id:t,code:function(e){if(null==e||"string"!=typeof e)return"";let t=e.split(" ## ")[0];return(null==t?void 0:t.trim())??""}(e.main_field)||t,main_field:"string"==typeof e.main_field?e.main_field:void 0,form_id:e.form_id,cardStatus:"available",area:"string"==typeof e.form_code&&e.form_code.trim()?e.form_code:void 0,capacityLabel:null!=e.capacity&&""!==String(e.capacity).trim()?String(e.capacity):void 0}}function eW9(e,t){if(0===e.length)return[];let l=new Map;for(let e of t)l.set(e.id,e);return e.map(e=>{let t=l.get(e.id);return t?{...e,cardStatus:t.cardStatus,guestName:t.guestName,guestPhone:t.guestPhone,time:t.time,timeEnd:t.timeEnd,partySize:t.partySize,startsInMinutes:t.startsInMinutes,priceDisplay:t.priceDisplay,isPaid:t.isPaid,delayMinutes:t.delayMinutes,lateMinutes:t.lateMinutes,elapsedLabel:t.elapsedLabel,progress:t.progress,progressTone:t.progressTone,topAccentOrange:t.topAccentOrange,nextGuest:t.nextGuest,nextTime:t.nextTime,slots:t.slots,moreCount:t.moreCount,barSlots:t.barSlots,barRemainingLabel:t.barRemainingLabel,floorMapSourceBookings:t.floorMapSourceBookings,floorMapReferenceDay:t.floorMapReferenceDay,hostReservedStatus:t.hostReservedStatus,hostIsTimeout:t.hostIsTimeout}:e})}function eGe(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)&&t>=0?t:void 0}let eGt=[],eGl=[];function eGa(e,t){let l=String(e??"").trim();return!l||l===t}function eGi(e,t){return e.diff(t,"minute",!0)/60}function eGn(e,t){let l=Math.floor(t),a=Math.min(59,Math.max(0,Math.round((t-l)*60)));return em()(`${e} ${String(l).padStart(2,"0")}:${String(a).padStart(2,"0")}`,"YYYY-MM-DD HH:mm")}function eGs(e,t){let l=String(e.booking_id??e.booking_uid??e.id??"").trim();if(l)for(let e of t){let t=e.floorMapSourceBookings;if(Array.isArray(t)&&t.some(e=>{let t=String(e.id??"").trim(),a=String(e.booking_id??"").trim(),i=String(e.booking_uid??"").trim();return t===l||a===l||i===l}))return e}}function eGr(e){let t=e&&"object"==typeof e?{...e}:{},l=t.filter,a="object"!=typeof l||null===l||Array.isArray(l)?{}:{...l},i=a.values,n="object"!=typeof i||null===i||Array.isArray(i)?{}:{...i};return Array.isArray(n.order_payment_status)&&0!==n.order_payment_status.length||(n.order_payment_status=void 0),{...t,filter:{...a,values:n}}}function eGo(e,t,l){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:eWT,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:em()(),n="object"==typeof e.filter&&e.filter?e.filter:{},s="object"==typeof n.values&&n.values?n.values:{},r=eWY(t,l,a,i);return!function(e,t){if(!Array.isArray(e)||!Array.isArray(t)||2!==e.length||2!==t.length)return!1;try{for(let l=0;l<2;l++){let a=em()(e[l]).valueOf(),i=em()(t[l]).valueOf();if(!Number.isFinite(a)||!Number.isFinite(i)||a!==i)return!1}return!0}catch{return!1}}(s.booking_time_start_between,r)?{...e,filter:{...n,values:{...s,booking_time_start_between:r}}}:e}function eGd(e){let t="object"==typeof e.filter&&e.filter?e.filter:{},l="object"==typeof t.values&&t.values?t.values:{};if(!("compact_fields"in l)&&!("enable_remote_memory_cache"in l))return e;let a={...l};return delete a.compact_fields,delete a.enable_remote_memory_cache,{...e,filter:{...t,values:a}}}function eGc(e){if("u"<typeof window||!e)return"floorMap";try{let t=localStorage.getItem(e);if("grid"===t||"floorMap"===t||"calendar"===t||"resourceWall"===t)return t}catch{}return"floorMap"}function eGu(e){return`pisell-reservation.floor-map.appearance:${e||"default"}`}function eGp(e){if("u"<typeof window)return"light";try{let t=localStorage.getItem(eGu(e));if("dark"===t||"light"===t)return t}catch{}return"light"}function eGm(e){return"light"===e.mode?(0,ev.jsxs)("svg",{"data-icon":"sun",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,ev.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,ev.jsx)("path",{d:"M12 2.5V5"}),(0,ev.jsx)("path",{d:"M12 19V21.5"}),(0,ev.jsx)("path",{d:"M21.5 12H19"}),(0,ev.jsx)("path",{d:"M5 12H2.5"}),(0,ev.jsx)("path",{d:"M18.72 5.28L16.95 7.05"}),(0,ev.jsx)("path",{d:"M7.05 16.95L5.28 18.72"}),(0,ev.jsx)("path",{d:"M18.72 18.72L16.95 16.95"}),(0,ev.jsx)("path",{d:"M7.05 7.05L5.28 5.28"})]}):(0,ev.jsx)("svg",{"data-icon":"moon",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,ev.jsx)("path",{d:"M18 15.5a7 7 0 0 1-9.5-9.5 8.5 8.5 0 1 0 9.5 9.5Z"})})}function eGg(e){let t="light"===e.mode?eN.getText("pisell-reservation.floor-map-appearance-dark"):eN.getText("pisell-reservation.floor-map-appearance-light");return(0,ev.jsx)("button",{type:"button",className:"pisell-floor-map-layout-view-controls-tool-btn pisell-floor-map-layout-view-controls-dock-collapsed-extras-btn",title:t,"aria-label":t,onClick:e.onToggle,children:(0,ev.jsx)(eGm,{mode:e.mode})})}function eGh(e){let{bodyView:t}=(0,lL.useRecordBoardContext)();return(0,ef.useEffect)(()=>{var l;e.bodyViewRef.current=t,null==(l=e.onBodyViewChange)||l.call(e,t)},[t,e.bodyViewRef,e.onBodyViewChange]),null}function eGv(e){let{bodyView:t}=(0,lL.useRecordBoardContext)(),l=(0,ef.useRef)(null);return(0,ef.useEffect)(()=>{let a=l.current;e.isInternalListData&&("floorMap"===t||"calendar"===t||"resourceWall"===t)&&null!==a&&"floorMap"!==a&&"calendar"!==a&&"resourceWall"!==a&&e.patchSearchParams(t=>eGd(eGo(t,e.schedule.date,e.operatingDayBoundary,e.timelineRange,em()()))),e.isInternalListData&&("calendar"===a||"resourceWall"===a)&&"floorMap"===t&&e.patchSearchParams(t=>eGd(eGo(t,e.schedule.date,e.operatingDayBoundary,e.timelineRange,em()()))),e.isInternalListData&&"calendar"===a&&("grid"===t||"resourceWall"===t)&&e.patchSearchParams(t=>eGd(eGo(t,e.schedule.date,e.operatingDayBoundary,e.timelineRange,em()()))),l.current=t},[t,e.schedule.date.valueOf(),e.isInternalListData,e.patchSearchParams,e.schedule.date,e.operatingDayBoundary,e.timelineRange]),null}function eGf(){let{bodyViewSwitchable:e}=(0,lL.useRecordBoardContext)(),t=(0,lL.useRecordBoardShellBodyMeta)(),l=(null==t?void 0:t.hasGridContent)??!0,a=null==t?void 0:t.hasFloorMapSlot,i=null==t?void 0:t.hasCalendarSlot,n=null==t?void 0:t.hasResourceWallSlot,s=null==t?void 0:t.effectiveFloorMapProps,r=!!(a&&null!=s),o=!!i,d=!!n;return{allowBodyViewToggle:+!!l+ +!!r+ +!!o+ +!!d>=2&&!1!==e,bodyViewSegmentedOptions:(0,ef.useMemo)(()=>{let e=[];return r&&e.push({label:eN.getText("pisell-reservation.view-floor"),value:"floorMap"}),o&&e.push({label:eN.getText("pisell-reservation.view-calendar"),value:"calendar"}),d&&e.push({label:eN.getText("pisell-reservation.view-resource-wall"),value:"resourceWall"}),l&&e.push({label:eN.getText("pisell-reservation.view-grid"),value:"grid"}),e},[r,o,d,l])}}function eGy(){let{bodyView:e,setBodyView:t}=(0,lL.useRecordBoardContext)(),{allowBodyViewToggle:l,bodyViewSegmentedOptions:a}=eGf();return l&&("grid"===e||"resourceWall"===e)?(0,ev.jsx)(ex.Select,{className:"pisell-reservation-mobile-toolbar-body-view-select",popupClassName:"pisell-reservation-body-view-select-dropdown",popupMatchSelectWidth:!1,size:"small",value:e,onChange:e=>t(e),options:a.map(e=>({label:e.label,value:e.value}))}):null}function eGx(e){var t,l,a,i,n,s,r;let{bodyView:o,setBodyView:d}=(0,lL.useRecordBoardContext)(),{allowBodyViewToggle:c,bodyViewSegmentedOptions:u}=eGf();if("grid"===o||"resourceWall"===o)return e.extraTabs?(0,ev.jsx)(ev.Fragment,{children:e.extraTabs}):null;let p=e.phoneLayout?"middle":"large",m=c?e.phoneLayout?(0,ev.jsx)(ex.Select,{className:"pisell-reservation-body-view-select",popupClassName:"pisell-reservation-body-view-select-dropdown",popupMatchSelectWidth:!1,size:"middle",value:o,onChange:e=>d(e),options:u.map(e=>({label:e.label,value:e.value}))}):(0,ev.jsx)(ex.Segmented,{className:"pisell-reservation-body-view-segmented",size:p,value:o,onChange:e=>d(e),options:u}):null,g=(0,ev.jsxs)("div",{className:"pisell-reservation-schedule-start-merge",children:[e.scheduleStartSlot,m]}),h=(0,ev.jsx)("div",{className:"pisell-reservation-follow-time-slot",children:e.phoneLayout?e.followWallClock?(0,ev.jsxs)("span",{className:"pisell-reservation-follow-current-chip pisell-reservation-follow-current-chip--on","aria-live":"polite","aria-label":eN.getText(eWz),children:[(0,ev.jsx)("span",{className:"pisell-reservation-follow-current-chip-dot"}),(0,ev.jsx)("span",{className:"pisell-reservation-follow-current-chip-label",children:eN.getText("pisell-reservation.at-current-time-short")})]}):(0,ev.jsx)("button",{type:"button",className:"pisell-reservation-follow-current-chip pisell-reservation-follow-current-chip--off",onClick:e.onFollowWallClockToggle,"aria-pressed":!1,"aria-label":eN.getText(eWL),children:(0,ev.jsx)("span",{className:"pisell-reservation-follow-current-chip-label",children:eN.getText(eWL)})}):e.followWallClock?(0,ev.jsx)("span",{className:"pisell-reservation-follow-time-hint pisell-reservation-follow-time-hint--at-current","aria-live":"polite",children:eN.getText(eWz)}):(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{className:"pisell-reservation-follow-time-hint pisell-reservation-follow-time-hint--off-current","aria-live":"polite",children:eN.getText("pisell-reservation.non-current-hint")}),(0,ev.jsx)("button",{type:"button",className:"pisell-reservation-follow-current-btn pisell-reservation-follow-current-btn--go-current",onClick:e.onFollowWallClockToggle,"aria-pressed":!1,children:(0,ev.jsx)("span",{className:"pisell-reservation-follow-current-btn-label",children:eN.getText(eWL)})})]})}),v="calendar"===o?"resource"===e.calendarGranularity?"month":e.calendarGranularity??"day":"day";return(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)(lL.PisellReservationScheduleBand,{value:e.schedule,onChange:e.onScheduleChange,scheduleRowClassName:e.phoneLayout&&!c?"pisell-reservation-schedule-band-schedule-row--phone-single-line":void 0,hideTimeNavigator:"calendar"===o,scheduleProps:{...e.scheduleProps,navigationLocked:!!(null==(t=e.scheduleProps)?void 0:t.navigationLocked),..."calendar"===o?{navigationUnit:v}:{}},timeNavigatorProps:{range:eWT,businessHours:eWT,...e.timeNavigatorProps,showNowButton:(null==(l=e.timeNavigatorProps)?void 0:l.showNowButton)??!1,snapToStep:!1,cursorMode:e.phoneLayout?"axis-moves":"cursor-moves",onUserInteraction:()=>{var t,l;e.onTimeNavigatorUserInteraction(),null==(l=e.timeNavigatorProps)||null==(t=l.onUserInteraction)||t.call(l)},userInteractionLocked:!!(null==(a=e.timeNavigatorProps)?void 0:a.userInteractionLocked),loadDensity:e.loadDensity,horizontalAxisCellSizePx:e.phoneLayout?(null==(i=e.timeNavigatorProps)?void 0:i.horizontalAxisCellSizePx)??40:null==(n=e.timeNavigatorProps)?void 0:n.horizontalAxisCellSizePx,horizontalTrackHeightPx:e.phoneLayout?(null==(s=e.timeNavigatorProps)?void 0:s.horizontalTrackHeightPx)??36:null==(r=e.timeNavigatorProps)?void 0:r.horizontalTrackHeightPx},scheduleStartSlot:g,scheduleAfterDateSlot:h,scheduleEndSlot:e.scheduleEndSlot}),e.extraTabs]})}function eGb(e){let{bodyView:t}=(0,lL.useRecordBoardContext)();return"floorMap"===t||"calendar"===t?null:(0,ev.jsx)(ev.Fragment,{children:e.extra??null})}function eG_(e){let{bodyView:t}=(0,lL.useRecordBoardContext)(),l=(0,lL.useRecordBoardShellBodyMeta)(),a="calendar"===t&&!!(null==l?void 0:l.hasCalendarSlot)&&null!=e.calendarGranularity&&null!=e.onCalendarGranularityChange,i=e.phoneLayout?"middle":"large",n=[{label:eN.getText("pisell-reservation.calendar-granularity-resource"),value:"resource"},{label:eN.getText("pisell-reservation.calendar-granularity-day"),value:"day"},{label:eN.getText("pisell-reservation.calendar-granularity-week"),value:"week"},{label:eN.getText("pisell-reservation.calendar-granularity-month"),value:"month"}];return(0,ev.jsxs)("div",{className:"pisell-reservation-schedule-end-slots",children:[a?e.phoneLayout?(0,ev.jsx)(ex.Select,{className:"pisell-reservation-body-view-select pisell-reservation-calendar-granularity-select",popupClassName:"pisell-reservation-body-view-select-dropdown pisell-reservation-calendar-granularity-select-dropdown",popupMatchSelectWidth:!1,size:"middle",value:e.calendarGranularity,onChange:t=>{var l;return null==(l=e.onCalendarGranularityChange)?void 0:l.call(e,t)},options:n.map(e=>({label:e.label,value:e.value}))}):(0,ev.jsx)(ex.Segmented,{className:"pisell-reservation-body-view-segmented pisell-reservation-calendar-granularity-segmented",size:i,value:e.calendarGranularity,onChange:t=>{var l;return null==(l=e.onCalendarGranularityChange)?void 0:l.call(e,t)},options:n}):null,(0,ev.jsx)("button",{type:"button",className:e.phoneLayout?"pisell-reservation-new-btn pisell-reservation-new-btn--phone":"pisell-reservation-new-btn",onClick:()=>{var t;return null==(t=e.onNewReservation)?void 0:t.call(e)},children:eN.getText("pisell-reservation.new")})]})}function eGk(e){return(0,ev.jsx)(eGg,{mode:e.appearanceMode,onToggle:e.onToggleAppearanceMode})}function eGw(e){let{bodyView:t}=(0,lL.useRecordBoardContext)();if((0,ef.useEffect)(()=>{"floorMap"!==t&&e.mapEditInternal&&e.setMapEditInternal(!1)},[t,e.mapEditInternal,e.setMapEditInternal]),"floorMap"!==t||e.isFloorModeControlled)return null;let l=eN.getText(e.mapEditInternal?"pisell-reservation.edit-map-done":"pisell-reservation.edit-map"),a=()=>{if(e.mapEditInternal){var t,l;null==(l=e.floorMapLayoutRef.current)||null==(t=l.saveLayout)||t.call(l)}e.setMapEditInternal(e=>!e)};return e.phoneLayout?(0,ev.jsx)("button",{type:"button",className:e.mapEditInternal?"pisell-floor-map-layout-view-controls-tool-btn pisell-floor-map-layout-view-controls-tool-btn--active":"pisell-floor-map-layout-view-controls-tool-btn",title:l,"aria-label":l,"aria-pressed":e.mapEditInternal,onClick:a,children:e.mapEditInternal?(0,ev.jsx)(uj,{}):(0,ev.jsx)(hC,{})}):(0,ev.jsx)("div",{className:"pisell-reservation-floor-map-dock-actions",children:(0,ev.jsx)(ex.Button,{type:"primary",size:"middle",className:"pisell-reservation-topbar-edit-btn",onClick:a,children:l})})}function eGj(){return(0,ev.jsx)("span",{className:"pisell-reservation-page-title",children:eN.getText("pisell-reservation.page-title")})}function eGS(){return(0,ev.jsx)("span",{className:"pisell-reservation-page-title",children:eN.getText("pisell-reservation.page-title-venue")})}function eGM(e){return null==e?null:String(e).trim()||null}function eGN(e,t){if(!t)return[null,null,null];if(t.getCategoryPath){let l=t.getCategoryPath(e);return[eGM(null==l?void 0:l[0]),eGM(null==l?void 0:l[1]),eGM(null==l?void 0:l[2])]}if(t.nestedPathField){let l=(0,lL.parseNestedPathSegments)(e[t.nestedPathField],3);return[eGM(l[0]),eGM(l[1]),eGM(l[2])]}let l=[null,null,null],a=t.levels??[];for(let t=0;t<3;t++){var i;let n=null==(i=a[t])?void 0:i.field;n&&(l[t]=eGM(e[n]))}return l}function eGC(e){let t="string"==typeof e.title?e.title:"string"==typeof e.name?e.name:"",l=String(e.id??"").trim();return`${t} ${l}`.toLowerCase()}let eGT="pisell-pro-resource-picker",eGP="pisell-floor-map-layout.resource-picker";function eGA(e){let t=e.title??e.name??e.label??e.id??"",l=e.subtitle??e.desc??e.description,a=null==l?"":String(l).trim();return{title:String(t).trim(),subtitles:a?[a]:[]}}let eGD=new Set(["-1","-2","0"]);function eGI(e){var t,l;let{open:a,onClose:i,onConfirm:n,records:s,mode:r="multiple",value:o,title:d,disabledIds:c,categoryConfig:u,getSearchText:p,getCardMeta:m,renderCard:g,renderFilterBar:h,selectorValueType:v="primitive",selectorShowStepper:f="auto",getOptionRuleConfig:y,zIndex:x=1100,width:b=880,className:_,platform:k="pc"}=e,w="object"===v,j=m??eGA,S=p??eGC,M=(0,ef.useMemo)(()=>new Set((c??[]).map(e=>String(e))),[c]),[N,C]=(0,ef.useState)(""),[T,P]=(0,ef.useState)(["0"]),[A,D]=(0,ef.useState)([]),[I,E]=(0,ef.useState)([]),z=(0,ef.useRef)(!1),{engine:L}=ik(),O=(null==L||null==(t=L.props)?void 0:t.locale)??"zh-CN";(0,ef.useEffect)(()=>{a&&eN.init(lL.floorMapLayoutLocales,O)},[a,O]),(0,ef.useEffect)(()=>{if(!a){C(""),P(["0"]),z.current=!1;return}if(!z.current){if(w)E([]);else D(o?o.map(e=>String(e??"").trim()).filter(Boolean):[]);z.current=!0}},[a,o,w]);let R=(0,ef.useMemo)(()=>(function(e,t){if(!t||0===e.length)return[];let l=[],a=(e,t,l)=>{let a=e.find(e=>e.id===t);return a||(a={id:t,name:l,children:[]},e.push(a)),a};for(let i of e){let e=eGN(i,t),n=l;for(let t=0;t<3;t++){let l=e[t];if(!l)break;let i=a(n,l,l);i.children||(i.children=[]),n=i.children}}let i=e=>(e.forEach(e=>{e.children&&0===e.children.length?delete e.children:e.children&&i(e.children)}),e.sort((e,t)=>String(e.name).localeCompare(String(t.name),"zh-CN")),e);return i(l)})(s,u),[s,u]),$=(0,ef.useMemo)(()=>(function(e){let t=[null,null,null];if(!e)return t;for(let l=0;l<3;l++){let a=e[l];null!=a&&""!==a&&(t[l]=String(a))}return t})(T).map(e=>null!=e&&eGD.has(e)?null:e),[T]),F=(0,ef.useMemo)(()=>({keyword:N,onKeywordChange:C,tabbarDataSource:R,tabbarValue:T,onTabbarValueChange:P}),[N,R,T]),B=(0,ef.useMemo)(()=>{let e=N.trim().toLowerCase();return s.filter(t=>!!function(e,t,l){if(!l)return!0;let a=eGN(e,l);for(let e=0;e<3;e++){let l=t[e];if(null!=l&&a[e]!==l)return!1}return!0}(t,$,u)&&(!e||S(t).includes(e)))},[s,$,u,N,S]),H=(0,ef.useMemo)(()=>B.map(e=>{let t=String(e.id??"").trim(),l=j(e);return{id:t,title:l.title,label:l.title,value:t,disabled:M.has(t),...y?{ruleConfig:y(e)}:{},__record:e,__meta:l}}),[B,M,j,y]),q=(0,ef.useMemo)(()=>H.map(e=>String(e.id??"")).filter(e=>e&&!M.has(e)),[H,M]),V=(0,ef.useMemo)(()=>w?I.filter(e=>e.quantity>0).length:A.length,[w,I,A]),Y=(0,ef.useMemo)(()=>0!==q.length&&(w?q.every(e=>I.some(t=>t.value===e&&t.quantity>0)):q.every(e=>A.includes(e))),[w,q,I,A]),U=(0,ef.useMemo)(()=>w?I.some(e=>q.includes(e.value)&&e.quantity>0):A.some(e=>q.includes(e)),[w,I,A,q]),W=(0,ef.useCallback)(()=>{w?E(e=>{let t=new Map(e.map(e=>[e.value,e]));for(let e of q){let l=t.get(e);t.set(e,{value:e,quantity:(null==l?void 0:l.quantity)&&l.quantity>0?l.quantity:1})}return[...t.values()].filter(e=>e.quantity>0)}):D(e=>{let t=new Set(e);for(let e of q)t.add(e);return[...t]})},[w,q]),G=(0,ef.useCallback)(()=>{"single"===r?w?E([]):D([]):w?E(e=>e.filter(e=>!q.includes(e.value))):D(e=>e.filter(e=>!q.includes(e)))},[r,w,q]),Q=(0,ef.useCallback)(e=>{if(null==e||""===e)return[];if(!Array.isArray(e)){if("object"==typeof e&&null!==e&&"value"in e){let t=String(e.value??"").trim();return t?[{value:t,quantity:Math.max(0,Math.floor(Number(e.quantity??0)))}]:[]}let t=String(e).trim();return t?[{value:t,quantity:1}]:[]}return e.map(e=>{if("object"==typeof e&&null!==e&&"value"in e)return{value:String(e.value??"").trim(),quantity:Math.max(0,Math.floor(Number(e.quantity??0)))};let t=String(e??"").trim();return t?{value:t,quantity:1}:null}).filter(e=>!!(null==e?void 0:e.value))},[]),K=(0,ef.useCallback)(e=>{if(w)return void E(Q(e).filter(e=>e.quantity>0));if("single"===r)return void(null==e||""===e?D([]):"object"==typeof e&&null!==e&&"value"in e?D([String(e.value)]):D([String(e)]));if(!Array.isArray(e))return;let t=new Set(q),l=e.map(e=>"object"==typeof e&&null!==e&&"value"in e?String(e.value):String(e)).filter(e=>t.has(e));D(e=>[...new Set([...e.filter(e=>!t.has(e)),...l])])},[w,r,q,Q]),J=(0,ef.useMemo)(()=>{if(w)return I;if("single"===r)return A[0]??"";let e=new Set(q);return A.filter(t=>e.has(t))},[w,r,I,A,q]),Z=(0,ef.useCallback)(()=>{w?n(I.filter(e=>e.quantity>0)):n(A.filter(Boolean)),i()},[w,I,A,n,i]),X=(0,ef.useCallback)(e=>{var t;let{dataSource:l,indicator:a,numberSelector:i,actions:n}=e,s=l.__record,r=l.__meta,o=String(l.id??""),d=w?!!l.selected:A.includes(o),c=M.has(o),u=s&&g?g(s,{selected:d,disabled:c}):null,p=null==r?void 0:r.image,m=null==p?null:"string"==typeof p?(0,ev.jsx)("img",{className:`${eGT}-card-image-img`,src:p,alt:(null==r?void 0:r.title)??"",draggable:!1}):p;return(0,ev.jsxs)("button",{type:"button",disabled:c,onClick:()=>{if(c)return;let e=l._key??o;n.update(e,{quantity:+!d})},className:t_()(`${eGT}-card`,{[`${eGT}-card--selected`]:d,[`${eGT}-card--disabled`]:c,[`${eGT}-card--with-stepper`]:!!i}),children:[(0,ev.jsx)("span",{className:`${eGT}-card-body`,children:u||(0,ev.jsxs)(ev.Fragment,{children:[m?(0,ev.jsx)("span",{className:`${eGT}-card-image`,children:m}):null,(0,ev.jsxs)("span",{className:`${eGT}-card-text`,children:[(0,ev.jsx)("span",{className:`${eGT}-card-title`,children:(null==r?void 0:r.title)??l.title}),null==r||null==(t=r.subtitles)?void 0:t.map((e,t)=>(0,ev.jsx)("span",{className:`${eGT}-card-sub`,children:e},`${o}-sub-${t}`)),(null==r?void 0:r.badges)&&r.badges.length>0?(0,ev.jsx)("span",{className:`${eGT}-card-badges`,children:r.badges.map((e,t)=>(0,ev.jsxs)("span",{className:`${eGT}-card-badge`,children:[e.icon?(0,ev.jsx)("span",{className:`${eGT}-card-badge-icon`,children:e.icon}):null,e.text]},`${o}-badge-${t}`))}):null]})]})}),(0,ev.jsx)("span",{className:`${eGT}-card-actions`,onClick:e=>e.stopPropagation(),children:i??a})]})},[w,A,M,g]),ee=(0,ef.useMemo)(()=>{let e=eN.getText(`${eGP}.confirm`);return V>0?`${e} (${V})`:e},[V]);return(0,ev.jsx)(iB,{renderType:"modal",props:{platform:k,open:a,title:d,onCancel:i,destroyOnClose:!0,width:b,zIndex:x,wrapClassName:t_()(`${eGT}-modal`,_),headerDivider:!1,footerDivider:!1,style:{maxHeight:"95%"},footer:(0,ev.jsxs)("div",{className:`${eGT}-footer`,children:[(0,ev.jsx)(ex.Button,{onClick:i,children:eN.getText(`${eGP}.cancel`)}),(0,ev.jsx)(ex.Button,{type:"primary",onClick:Z,disabled:0===V,children:ee})]})},children:(0,ev.jsxs)("div",{className:eGT,children:[(0,ev.jsx)("div",{className:`${eGT}-filter-bar`,children:h?h(F):(0,ev.jsx)(VJ,{triggerType:"input",value:N,onChange:C,onSearch:C,placeholder:eN.getText(`${eGP}.search-ph`),showHistory:!1,showConfirmButton:!1})}),(0,ev.jsxs)("div",{className:`${eGT}-toolbar`,children:["multiple"===r?(0,ev.jsxs)("div",{className:`${eGT}-toolbar-left`,children:[(0,ev.jsx)(ex.Checkbox,{indeterminate:U&&!Y,checked:Y,disabled:0===q.length,onChange:e=>{e.target.checked?W():G()},children:eN.getText(`${eGP}.select-all`)}),(0,ev.jsx)("button",{type:"button",className:`${eGT}-link`,onClick:G,disabled:0===V,children:eN.getText(`${eGP}.deselect-all`)})]}):(0,ev.jsx)("span",{className:`${eGT}-hint`,children:eN.getText(`${eGP}.single-hint`)}),(0,ev.jsx)("span",{className:`${eGT}-count`,children:(l=s.length,eN.getText(`${eGP}.selected-count`).replace("{count}",String(V)).replace("{total}",String(l)))})]}),(0,ev.jsx)("div",{className:`${eGT}-list`,children:0===H.length?(0,ev.jsx)("div",{className:`${eGT}-empty`,children:eN.getText(`${eGP}.empty`)}):(0,ev.jsx)(zb,{dataSource:H,mode:r,valueType:v,variant:"card",itemLayout:"horizontal",showStepper:f,value:J,onChange:K,renderItem:X,layout:{type:"antdGrid",responsive:{minWidth:160,maxColumns:4,gap:4,defaultColumns:2}},headerProps:{visible:!1}})})]})})}eN.init(lL.floorMapLayoutLocales,"zh-CN");let eGE="floorMapImage",eGz="image",eGL="icon",eGO="pisell-floor-map-layout.toolbar";function eGR(e){var t;let{open:l,categoryLabel:a,entries:i,onClose:n,onConfirm:s,renderEntryPreview:r,platform:o}=e,{engine:d}=ik(),c=(null==d||null==(t=d.props)?void 0:t.locale)??"zh-CN";(0,ef.useEffect)(()=>{l&&eN.init(lL.floorMapLayoutLocales,c)},[l,c]);let u=(0,ef.useMemo)(()=>i.map(e=>({id:e.key,title:e.label,__category:e.kind.value===eGE?eGz:eGL,__entry:e})),[i]),p=(0,ef.useMemo)(()=>{let e=i.some(e=>e.kind.value===eGE),t=i.some(e=>e.kind.value!==eGE),l=[];return e&&l.push({id:eGz,name:eN.getText(`${eGO}.view-all-modal-category-image`)}),t&&l.push({id:eGL,name:eN.getText(`${eGO}.view-all-modal-category-icon`)}),l},[i,c]);return(0,ev.jsx)(eGI,{open:l,title:a,onClose:n,platform:o,onConfirm:e=>{let t={};for(let l of e){let e=l.value.trim();e&&(t[e]=Math.max(0,Math.floor(l.quantity)))}s(function(e,t){let l=[];for(let a of e){let e=Math.max(0,Math.floor(t[a.key]??0));for(let t=0;t<e;t+=1)l.push({elementKind:a.kind.value,...a.builtinShapeKey?{builtinShapeKey:a.builtinShapeKey}:{}})}return l}(i,t))},records:u,mode:"multiple",value:[],selectorValueType:"object",selectorShowStepper:!0,getOptionRuleConfig:()=>({max:99}),getSearchText:e=>String(e.title??"").toLowerCase(),categoryConfig:{levels:[{field:"__category"}]},renderFilterBar:e=>(0,ev.jsx)(lL.PisellTabbarTemplate1,{className:"pisell-pro-resource-picker-tabbar",style:{position:"sticky",top:0,zIndex:10,padding:6,background:"rgb(250, 250, 250)"},dataSource:p,value:Array.isArray(e.tabbarValue)&&e.tabbarValue.length?e.tabbarValue:["0"],onChange:e.onTabbarValueChange,onSearch:e.onKeywordChange,maxLevel:1}),getCardMeta:e=>{let t=e.__entry;return{title:String(e.title??""),subtitles:[],image:t?r(t):void 0}}})}function eG$(e,t){let l="booked"===e.cardStatus,a=eYh(t,l).trim()||eYh(t,!0).trim();if(a)return a;let i=function(e,t){let l=e.floorMapSourceBookings;if(!Array.isArray(l)||0===l.length)return;let a=String(t.booking_id??"").trim();if(a&&!a.startsWith("syn_")){let e=l.find(e=>{let t=String(e.booking_id??e.id??"").trim();return""!==t&&t===a});if(e)return e}return l.find(e=>{let t=e.is_next??e.isNext;return!0===t||"true"===t||1===t||"1"===t})}(e,t);if(i){let e=eYq(i),t=eYm(e,l).trim()||eYm(e,!0).trim();if(t)return t}return eYg(t,!0).join(eV5).trim()}function eGF(e,t){let l,a,i,n,s,r="available",o=e.hostBookingStatus;if("reserved"===o){let{start:l}=eYe(e);if(Number.isFinite(l)){let e=eYt(l),n=eYt(l)+6e4;t>=n?(r="late",i=Math.max(0,Math.ceil((t-n)/6e4))):(r="boardingSoon",a=Math.max(0,Math.ceil((e-t)/6e4)))}else r="boardingSoon"}else if("occupied"===o){let{start:a,end:i}=eYe(e);if(Number.isFinite(a)&&(n=eYt(a)),Number.isFinite(i)){let e=eYt(i)+6e4;s=e,l=Math.max(0,Math.ceil((i-t)/6e4));let a=Math.ceil((e-t)/6e4);r=t>=e?"expired":a<=10&&a>0?"endingSoon":"inUse"}else r="inUse"}return{status:r,remainingMin:l,startsInMin:a,lateMin:i,sessionStartMs:n,sessionEndMs:s}}function eGB(e){let t,l,{cardStatus:a}=e,i="available"===a||"maintenance"===a,n=Date.now(),s=String(e.code||e.main_field||e.id||"").trim(),r=eYU(e,s),o=r.bookings??[],d="",c="",u={status:"available",remainingMin:void 0,startsInMin:void 0,lateMin:void 0,sessionStartMs:void 0,sessionEndMs:void 0};if(o.length>0){let a=function(e,t){if(0===e.length)return{mode:"empty",current:null,next:null};let l=[...e].sort((e,t)=>eYe(e).start-eYe(t).start),a=l.findIndex(e=>eYd(e,t));if(a>=0){let e=l[a],t=a+1<l.length?l[a+1]:null;return{mode:t?"both":"currentOnly",current:e,next:t}}let i=l.findIndex(e=>{let{start:l}=eYe(e);return Number.isFinite(l)&&t<l});if(i>=0){let e=l[i],{start:a}=eYe(e);if(i>0){let{end:n}=eYe(l[i-1]);if(Number.isFinite(n)&&t>=n&&Number.isFinite(a)&&t<a)return{mode:"nextOnly",current:null,next:e}}let n=i+1<l.length?l[i+1]:null;return{mode:n?"both":"single",current:e,next:n}}return{mode:"empty",current:null,next:null}}(o,n);if("nextOnly"===a.mode&&a.next){let s=a.next;d=eYn(s).trim(),c=eG$(e,s).trim(),u=i?{status:"available",remainingMin:void 0,startsInMin:void 0,lateMin:void 0,sessionStartMs:void 0,sessionEndMs:void 0}:eGF(s,n),t=void 0,l=!0}else if("empty"===a.mode)t=void 0,d="",c="Available to Book",u={status:"available",remainingMin:void 0,startsInMin:void 0,lateMin:void 0,sessionStartMs:void 0,sessionEndMs:void 0};else if(a.current){let s=a.current,r=eYc(s,n);d=eYn(s).trim(),c=eG$(e,s).trim(),u=i?{status:"available",remainingMin:void 0,startsInMin:void 0,lateMin:void 0,sessionStartMs:void 0,sessionEndMs:void 0}:eGF(s,n),a.next&&!r&&(t=[function(e,t,l){let a=eG$(e,t).trim(),i=eYn(t).trim(),{start:n}=eYe(t),s=0;return Number.isFinite(n)&&(s=Math.max(0,Math.ceil((n-l)/6e4))),{time:i||"—",booking:a||"—",startInMin:s}}(e,a.next,n)]),r&&(l=!0)}}else{let l=eYv(r),a=l?eYn(l).trim():"",s=String(e.time??"").trim(),o=String(e.timeEnd??"").trim(),p=s&&o?`${s.replace(/ .*/,"")} - ${o.replace(/ .*/,"")}`:s||"";d=a||p,!i&&l&&(u=eGF(l,n)),c=i?"Available to Book":function(e){let t=String(e.code||e.main_field||e.id||"").trim(),l=eYU(e,t),a=eYv(l),i="booked"===e.cardStatus,n=a?eYh(a,i).trim():"";if(n)return n;for(let e of l.bookings){let t=eYh(e,i).trim();if(t)return t}return""}(e),t=void 0}if(!d&&0===o.length){let t=String(e.time??"").trim(),l=String(e.timeEnd??"").trim();d=t&&l?`${t.replace(/ .*/,"")} - ${l.replace(/ .*/,"")}`:t||""}return{resourceId:String(e.id),resource:e.code||e.main_field||String(e.id),area:e.area,status:u.status,currentTime:d,currentBooking:c,remainingMin:u.remainingMin,startsInMin:u.startsInMin,lateMin:u.lateMin,sessionStartMs:u.sessionStartMs,sessionEndMs:u.sessionEndMs,nextList:t,...l?{wallUseNextLabelHideNextRow:!0}:{}}}function eGH(){return{date:em()().startOf("day"),at:em()()}}let eGq="YYYY-MM-DD HH:mm";function eGV(e){let t=Math.min(100,Math.max(0,e.percent)),l=e.isTimeout?"#f5c542":"var(--rc-pay-paid)";return(0,ev.jsx)("div",{className:"pisell-res-floor-room-card__disc-edge-progress","aria-hidden":!0,children:(0,ev.jsxs)("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",children:[(0,ev.jsx)("ellipse",{cx:50,cy:50,rx:49.125,ry:49.125,pathLength:100,fill:"none",stroke:"rgba(0, 0, 0, 0.22)",strokeWidth:1.75}),(0,ev.jsx)("ellipse",{cx:50,cy:50,rx:49.125,ry:49.125,pathLength:100,fill:"none",stroke:l,strokeWidth:1.75,strokeLinecap:"round",strokeDasharray:`${t} 100`,transform:"rotate(-90 50 50)",style:{transition:"stroke-dasharray 0.6s ease"}})]})})}function eGY(e){let t=Math.min(100,Math.max(0,e.percent)),l=e.isTimeout?"#f5c542":"var(--rc-pay-paid)";return(0,ev.jsx)("div",{className:"pisell-res-floor-room-card__rect-edge-progress","aria-hidden":!0,children:(0,ev.jsxs)("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",children:[(0,ev.jsx)("rect",{x:.95,y:.95,width:98.1,height:98.1,rx:6,ry:6,pathLength:100,fill:"none",stroke:"rgba(0, 0, 0, 0.22)",strokeWidth:1.9,strokeLinejoin:"round"}),(0,ev.jsx)("rect",{x:.95,y:.95,width:98.1,height:98.1,rx:6,ry:6,pathLength:100,fill:"none",stroke:l,strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:`${t} 100`,transform:"rotate(-90 50 50)",style:{transition:"stroke-dasharray 0.6s ease"}})]})})}function eGU(e){var t,l;let{data:a,theme:i="default",shellShape:n="rect",elementLayoutHeightPx:s,hideHeaderCapacity:r=!1,density:o="auto",viewportScale:d=1,discUnifiedLayoutEnabled:c=!0,tooltipTimeDensityEnabled:u=!0}=e,p=(0,ef.useRef)(null),m=((null==(t=a.bookings)?void 0:t.length)??0)>1,g=function(e){let{rootRef:t,density:l,viewportScale:a}=e,[i,n]=(0,ef.useState)("comfortable"),s=(0,ef.useRef)(null),r=(0,ef.useCallback)(()=>{let e,l=t.current;if(!l)return;let i=l.offsetWidth,r=l.offsetHeight,o=function(e,t){let l=!Number.isFinite(e)||e<=0?"micro":e>=180?"comfortable":e>=124?"compact":e>=86?"mini":"micro";return null==t?l:eYQ(l)===eYQ(t)?t:eYQ(l)>eYQ(t)?"comfortable"===l&&e<186||"compact"===l&&e<130||"mini"===l&&e<92?t:l:"compact"===l&&"comfortable"===t&&e>174||"mini"===l&&"compact"===t&&e>118||"micro"===l&&"mini"===t&&e>80?t:l}((e=Number.isFinite(a)&&a>0?a:1,Math.min(Number.isFinite(i)&&i>0?i:0,Number.isFinite(r)&&r>0?r:0)*e),s.current);s.current=o,n(e=>e===o?e:o)},[t,a]);return((0,ef.useLayoutEffect)(()=>{"auto"===l&&r()},[l,r,a]),(0,ef.useEffect)(()=>{if("auto"!==l)return;let e=t.current;if(!e||"u"<typeof ResizeObserver)return;let a=new ResizeObserver(()=>r());return a.observe(e),()=>a.disconnect()},[l,r,t]),"auto"!==l)?l:i}({rootRef:p,density:o,viewportScale:d}),h=(0,ef.useMemo)(()=>m?"comfortable":"auto"===o?g:o,[m,o,g]),v=(0,ef.useMemo)(()=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rect";return"micro"===e||"mini"===e&&"circle"===t?"micro":"comfortable"})(h,n),[h,n]),f="circle"===n?{"data-shape":"circle"}:{},y="circle"===n?function(e){let t=eYy(e);if("payed"!==t&&"payment_required"!==t&&"timeout"!==t)return null;let l=eYv(e);return l?{percent:eYs(l),isTimeout:"timeout"===t}:null}(a):null,x=eYy(a),b="rect"===n&&eYK(h,n)&&((null==(l=a.bookings)?void 0:l.length)??0)===1?function(e){let t=eYy(e);if("payed"!==t&&"payment_required"!==t&&"timeout"!==t)return null;let l=eYv(e);return l?{percent:eYs(l),isTimeout:"timeout"===t}:null}(a):null,_=Number.isFinite(d)&&d>0?d:1,k=m?1:Math.min(_,1),[,w]=(0,ef.useReducer)(e=>e+1,0);return(0,ef.useEffect)(()=>{let e=window.setInterval(()=>{w()},6e4);return()=>window.clearInterval(e)},[]),(0,ev.jsx)("div",{ref:p,className:"pisell-res-floor-room-card","data-theme":"default"===i?void 0:i,"data-density":v,"data-disc-layout":c?"unified":"legacy","data-tooltip-time":u&&eYK(h,n)?"on":"off","data-reserved-halo":"not_arrived"===x||"late"===x||"multi_reserved"===x?"on":"off","data-rect-edge-progress":b?"on":"off",style:{"--floor-card-vs":String(k)},...f,children:(0,ev.jsx)(eYJ.Provider,{value:h,children:(0,ev.jsxs)("div",{className:"pisell-res-floor-room-card__viewport-compensate",children:[(0,ev.jsx)(eU_,{data:a,shellShape:n,elementLayoutHeightPx:s,hideHeaderCapacity:r,discUnifiedLayoutEnabled:c,tooltipTimeDensityEnabled:u}),y?(0,ev.jsx)(eGV,{percent:y.percent,isTimeout:y.isTimeout}):null,b?(0,ev.jsx)(eGY,{percent:b.percent,isTimeout:b.isTimeout}):null]})})})}let eGW="pisell-reservation.room-kind-bound";function eGG(e,t){return(0,lL.findFloorMapRowByDataBinding)(e,t)}function eGQ(e){let{title:t,hint:l,shape:a}=e;return(0,ev.jsxs)("div",{className:t_()("pisell-reservation-card-placeholder","circle"===a&&"pisell-reservation-card-placeholder--circle"),children:[(0,ev.jsx)("div",{className:"pisell-reservation-card-placeholder-title",children:t}),l?(0,ev.jsx)("div",{className:"pisell-reservation-card-placeholder-hint",children:l}):null]})}function eGK(e){var t,l;let a,i,n,s,r,o,d,c;return[String(e.id??""),String(e.booking_id??e.booking_uid??""),String(e.start_time??""),String(e.end_time??""),String(e.appointment_status??""),String(e.order_payment_status??""),String(e.status??""),String((null==(t=e.order)?void 0:t.order_payment_status)??""),String((null==(a=e.order)?void 0:a.payment_status)??(null==a?void 0:a.order_payment_status)??e.payment_status??e.order_payment_status??""),(n=null==(i=e.order)?void 0:i.summary,r=Array.isArray(s=e.products)?s.filter(e=>e&&"object"==typeof e).length:-1,[String((null==n?void 0:n.total_amount)??""),String((null==n?void 0:n.expect_amount)??""),String((null==n?void 0:n.product_quantity)??""),String(r)].join(":")),(d=(l=e).order,c=eWK(l).sort().join(","),[!(null==(o=eYH(l))?void 0:o.length)?"":o.map(e=>{let t=null!=e.phone&&""!==String(e.phone).trim()?String(e.phone).trim():"";return`${e.source}:${String(e.name??"").trim()}:${t}`}).join(">"),String(l.number??""),String(l.notes??""),String(l.start_at??""),String(l.end_at??""),String((null==d?void 0:d.schedule_date)??""),function(e){let t=e.order;if(!t)return"";let l=t.customer_id;if(null!=l&&""!==String(l).trim())return String(l);let a=t.customer,i=null==a?void 0:a.id;return null!=i&&""!==String(i).trim()?String(i):""}(l),String(l.duration??""),String(l.sub_type??""),c,String(l.is_next??l.isNext??""),String(l.lateTime??""),String(l.timeoutTime??""),String(l.remainingReserveTime??""),String(l.progressPercent??"")].join("|"))].join("|")}function eGJ(e){return[String(e.id??""),String(e.code??""),String(e.main_field??""),String(e.bookingCount??""),String(e.completeBookingCount??"")].join("|")}let eGZ={stopPropagation:()=>{},preventDefault:()=>{},nativeEvent:{stopImmediatePropagation:()=>{}}},eGX={en:{"pisell-reservation.booking-change.fallback-court":"Court","pisell-reservation.booking-change.fallback-customer":"Customer","pisell-reservation.booking-change.title":"Booking information","pisell-reservation.booking-change.description":"Update customer, court, date and time for this booking.","pisell-reservation.booking-change.customer":"Customer","pisell-reservation.booking-change.no-phone":"No phone","pisell-reservation.booking-change.no-email":"No email","pisell-reservation.booking-change.change":"Change","pisell-reservation.booking-change.court":"Court","pisell-reservation.booking-change.new-date":"New date","pisell-reservation.booking-change.new-start-time":"New start time","pisell-reservation.booking-change.new-end-time":"New end time","pisell-reservation.booking-change.loading-resources":"Loading available resources...","pisell-reservation.booking-change.previous-booking-info":"Previous booking info","pisell-reservation.booking-change.original":"Original","pisell-reservation.booking-change.updated":"Updated","pisell-reservation.booking-change.drop-target":"Drop target","pisell-reservation.booking-change.conflict":"The selected date, court, or time range is unavailable. Please choose an available option.","pisell-reservation.booking-change.cancel":"Cancel","pisell-reservation.booking-change.confirm":"Confirm","pisell-reservation.booking-change.loading":"Loading...","pisell-reservation.booking-change.submitting":"Submitting...","pisell-reservation.booking-change.submit-failed":"Submit failed. Please try again.","pisell-reservation.booking-change.unavailable-time":"Unavailable {time}","pisell-reservation.booking-change.browser-only":"bookingChangeModal can only open in a browser environment.","pisell-reservation.booking-change.replaced":"A new booking change modal replaced the current one."},"zh-CN":{"pisell-reservation.booking-change.fallback-court":"场地","pisell-reservation.booking-change.fallback-customer":"客户","pisell-reservation.booking-change.title":"预约信息","pisell-reservation.booking-change.description":"更新该预约的客户、场地、日期和时间。","pisell-reservation.booking-change.customer":"客户","pisell-reservation.booking-change.no-phone":"暂无电话","pisell-reservation.booking-change.no-email":"暂无邮箱","pisell-reservation.booking-change.change":"更换","pisell-reservation.booking-change.court":"场地","pisell-reservation.booking-change.new-date":"新日期","pisell-reservation.booking-change.new-start-time":"新开始时间","pisell-reservation.booking-change.new-end-time":"新结束时间","pisell-reservation.booking-change.loading-resources":"正在加载可用资源...","pisell-reservation.booking-change.previous-booking-info":"原预约信息","pisell-reservation.booking-change.original":"原始","pisell-reservation.booking-change.updated":"更新后","pisell-reservation.booking-change.drop-target":"拖拽目标","pisell-reservation.booking-change.conflict":"当前选择的日期、场地或时间段不可用,请重新选择可用时段。","pisell-reservation.booking-change.cancel":"取消","pisell-reservation.booking-change.confirm":"确认","pisell-reservation.booking-change.loading":"加载中...","pisell-reservation.booking-change.submitting":"提交中...","pisell-reservation.booking-change.submit-failed":"提交失败,请稍后重试。","pisell-reservation.booking-change.unavailable-time":"不可用 {time}","pisell-reservation.booking-change.browser-only":"bookingChangeModal 仅可在浏览器环境中打开。","pisell-reservation.booking-change.replaced":"新的 bookingChangeModal 已替换当前弹窗。"},"zh-HK":{"pisell-reservation.booking-change.fallback-court":"場地","pisell-reservation.booking-change.fallback-customer":"客戶","pisell-reservation.booking-change.title":"預約資訊","pisell-reservation.booking-change.description":"更新此預約的客戶、場地、日期與時間。","pisell-reservation.booking-change.customer":"客戶","pisell-reservation.booking-change.no-phone":"暫無電話","pisell-reservation.booking-change.no-email":"暫無郵箱","pisell-reservation.booking-change.change":"更換","pisell-reservation.booking-change.court":"場地","pisell-reservation.booking-change.new-date":"新日期","pisell-reservation.booking-change.new-start-time":"新開始時間","pisell-reservation.booking-change.new-end-time":"新結束時間","pisell-reservation.booking-change.loading-resources":"正在載入可用資源...","pisell-reservation.booking-change.previous-booking-info":"原預約資訊","pisell-reservation.booking-change.original":"原始","pisell-reservation.booking-change.updated":"更新後","pisell-reservation.booking-change.drop-target":"拖拽目標","pisell-reservation.booking-change.conflict":"目前選擇的日期、場地或時段不可用,請重新選擇可用時段。","pisell-reservation.booking-change.cancel":"取消","pisell-reservation.booking-change.confirm":"確認","pisell-reservation.booking-change.loading":"載入中...","pisell-reservation.booking-change.submitting":"提交中...","pisell-reservation.booking-change.submit-failed":"提交失敗,請稍後重試。","pisell-reservation.booking-change.unavailable-time":"不可用 {time}","pisell-reservation.booking-change.browser-only":"bookingChangeModal 僅可在瀏覽器環境中開啟。","pisell-reservation.booking-change.replaced":"新的 bookingChangeModal 已取代目前彈窗。"},ja:{"pisell-reservation.booking-change.fallback-court":"コート","pisell-reservation.booking-change.fallback-customer":"顧客","pisell-reservation.booking-change.title":"予約情報","pisell-reservation.booking-change.description":"この予約の顧客、コート、日付、時間を更新します。","pisell-reservation.booking-change.customer":"顧客","pisell-reservation.booking-change.no-phone":"電話なし","pisell-reservation.booking-change.no-email":"メールなし","pisell-reservation.booking-change.change":"変更","pisell-reservation.booking-change.court":"コート","pisell-reservation.booking-change.new-date":"新しい日付","pisell-reservation.booking-change.new-start-time":"新しい開始時間","pisell-reservation.booking-change.new-end-time":"新しい終了時間","pisell-reservation.booking-change.loading-resources":"利用可能なリソースを読み込み中...","pisell-reservation.booking-change.previous-booking-info":"変更前の予約情報","pisell-reservation.booking-change.original":"元の内容","pisell-reservation.booking-change.updated":"更新後","pisell-reservation.booking-change.drop-target":"ドロップ先","pisell-reservation.booking-change.conflict":"選択した日付、コート、または時間帯は利用できません。別の候補を選択してください。","pisell-reservation.booking-change.cancel":"キャンセル","pisell-reservation.booking-change.confirm":"確認","pisell-reservation.booking-change.loading":"読み込み中...","pisell-reservation.booking-change.submitting":"送信中...","pisell-reservation.booking-change.submit-failed":"送信に失敗しました。しばらくしてからもう一度お試しください。","pisell-reservation.booking-change.unavailable-time":"利用不可 {time}","pisell-reservation.booking-change.browser-only":"bookingChangeModal はブラウザ環境でのみ開けます。","pisell-reservation.booking-change.replaced":"新しい bookingChangeModal が現在のモーダルを置き換えました。"},pt:{"pisell-reservation.booking-change.fallback-court":"Quadra","pisell-reservation.booking-change.fallback-customer":"Cliente","pisell-reservation.booking-change.title":"Informacoes da reserva","pisell-reservation.booking-change.description":"Atualize o cliente, a quadra, a data e o horario desta reserva.","pisell-reservation.booking-change.customer":"Cliente","pisell-reservation.booking-change.no-phone":"Sem telefone","pisell-reservation.booking-change.no-email":"Sem e-mail","pisell-reservation.booking-change.change":"Alterar","pisell-reservation.booking-change.court":"Quadra","pisell-reservation.booking-change.new-date":"Nova data","pisell-reservation.booking-change.new-start-time":"Novo horario de inicio","pisell-reservation.booking-change.new-end-time":"Novo horario de termino","pisell-reservation.booking-change.loading-resources":"Carregando recursos disponiveis...","pisell-reservation.booking-change.previous-booking-info":"Informacoes anteriores da reserva","pisell-reservation.booking-change.original":"Original","pisell-reservation.booking-change.updated":"Atualizado","pisell-reservation.booking-change.drop-target":"Destino do arraste","pisell-reservation.booking-change.conflict":"A data, a quadra ou o intervalo selecionado nao esta disponivel. Escolha outra opcao.","pisell-reservation.booking-change.cancel":"Cancelar","pisell-reservation.booking-change.confirm":"Confirmar","pisell-reservation.booking-change.loading":"Carregando...","pisell-reservation.booking-change.submitting":"Enviando...","pisell-reservation.booking-change.submit-failed":"Falha no envio. Tente novamente mais tarde.","pisell-reservation.booking-change.unavailable-time":"Indisponivel {time}","pisell-reservation.booking-change.browser-only":"bookingChangeModal so pode ser aberto em um navegador.","pisell-reservation.booking-change.replaced":"Um novo bookingChangeModal substituiu o modal atual."}};function eG0(e){if(!(!e||"object"!=typeof e||Array.isArray(e)))return e}function eG2(e){return Array.isArray(e)?e.map(e=>eG0(e)).filter(Boolean):[]}function eG1(e){if(null!=e&&""!==e)return String(e)}function eG4(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,l=Number(e);return Number.isFinite(l)?l:t}function eG3(e){var t;return eG0(null==(t=eG0(e))?void 0:t.metadata)||{}}function eG8(e){let t=Math.round(60*e),l=Math.floor(t/60);return`${String(l).padStart(2,"0")}:${String(t%60).padStart(2,"0")}`}function eG6(e,t){if(!Number.isFinite(e)||0===t.length)return e;let l=t[0],a=Math.abs(e-l);for(let i of t){let t=Math.abs(e-i);t<a-1e-9&&(a=t,l=i)}return l}function eG5(e,t){let l,a,i,n=new Date(`${e}T00:00:00`);if(Number.isNaN(n.getTime()))return{date:e,time:eG8(t)};let s=Math.round(60*t);return n.setMinutes(n.getMinutes()+s),{date:(l=n.getFullYear(),a=`${n.getMonth()+1}`.padStart(2,"0"),i=`${n.getDate()}`.padStart(2,"0"),`${l}-${a}-${i}`),time:`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}`}}function eG7(e){let t=eG0(e);if(t&&Array.isArray(t.resource_ids))return{status:eG4(t.status,0),resource_ids:t.resource_ids.map(e=>Number(e)).filter(e=>Number.isFinite(e))}}function eG9(e){return eG0(e.raw)||{}}function eQe(e){return{form_id:e.form_id,relation_type:e.relation_type,relation_id:e.relation_id,capacity:eG4(e.capacity,0),like_status:e.like_status,metadata:eG3(e),children:eG2(e.children).map(eQe)}}let eQt=null;function eQl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en";eN.init(eGX,e||"en")}function eQa(e){return eN.getText(e)}function eQi(e,t){return Object.keys(t).reduce((e,l)=>e.replace(RegExp(`\\{${l}\\}`,"g"),String(t[l])),eQa(e))}function eQn(){if(!eQt)return;let{container:e}=eQt;eQt=null,iM().unmountComponentAtNode(e),document.body.contains(e)&&document.body.removeChild(e)}eQl();let eQs=e=>{var t,l,a,i;let{options:n,onResolve:s,onReject:r}=e,o=ik();eQl((null==o||null==(l=o.engine)||null==(t=l.props)?void 0:t.locale)||"en");let{item:d,courts:c=[],visibleCourts:u,bookings:p=[],selectedCustomer:m=null,title:g=eQa("pisell-reservation.booking-change.title"),description:h=eQa("pisell-reservation.booking-change.description"),confirmText:v=eQa("pisell-reservation.booking-change.confirm"),cancelText:f=eQa("pisell-reservation.booking-change.cancel"),closeOnBackdrop:y=!0,zIndex:x=1072,theme:b="dark"}=n,_=(0,ef.useRef)(null),k=(0,ef.useRef)(!1),w=(0,ef.useRef)(null),[j,S]=(0,ef.useState)(!1),[M,N]=(0,ef.useState)(!1),[C,T]=(0,ef.useState)(""),[P,A]=(0,ef.useState)({targetCourtId:n.targetCourtId,targetDate:n.targetDate,targetHour:n.targetHour}),D=null==o||null==(i=o.appHelper)||null==(a=i.utils)?void 0:a.request,[I,E]=(0,ef.useState)([]),z=(0,ef.useMemo)(()=>{let e;return"string"==typeof(e=eG9(d).order_id)||"number"==typeof e?e:null},[d]),L=(0,ef.useMemo)(()=>{let e;return(e=eG2(eG9(d).resources)).length>0?e.map(eQe):eG2(d.resources).map(eQe)},[d]);(0,ef.useEffect)(()=>{D&&z_.Em.setRequest(D)},[D]);let{data:O}=rP(async()=>{let e=await z_.Em.getRequest().get(`/shop/order/appointment/${z}`,{});return eG0(null==e?void 0:e.data)},{ready:!!(D&&z),refreshDeps:[D,z]}),R=(0,ef.useMemo)(()=>{var e,t;if(!O)return[];let l=eG2(null==(e=eG0(O.bookings))?void 0:e.list),a=String(null==(t=d.raw)?void 0:t.id),i=l.find(e=>String(e.id)===a);return i?eG2(i.event_resources):[]},[O,d]),$=(0,ef.useMemo)(()=>{let e=new Map(L.map(e=>[String(e.form_id),e.metadata.form_name||""]));for(let t of R){let l=String((eG0(t.metadata)||{}).form_name||"");l&&e.set(String(t.form_id),l)}return e},[R,L]);(0,ef.useEffect)(()=>{0!==R.length&&E(R.map(e=>String(e.relation_id)===d.courtId?P.targetCourtId:String(e.relation_id)))},[R]);let F=(0,ef.useMemo)(()=>{let e=(u&&u.length>0?u:c)||[];return e.length>0?e:Array.from(new Set([d.courtId,n.targetCourtId].filter(Boolean))).map(e=>({id:e,name:e}))},[c,d.courtId,n.targetCourtId,u]),{data:B=[],loading:H}=rP(async()=>{let e=await z_.Em.getRequest().get("/shop/schedule/resource/list",{date:P.targetDate});return(function(e){if(Array.isArray(e))return eG2(e);let t=eG0(e);return Array.isArray(null==t?void 0:t.list)?eG2(t.list):Array.isArray(null==t?void 0:t.data)?eG2(t.data):[]})(null==e?void 0:e.data).map(e=>(function(e,t){let l=eG1(e.id),a=eG1(e.main_field);if(!l||!a)return null;let i=eG7(e.combined_resource);return{id:l,name:a,form_id:e.form_id,relation_id:e.id,resource_id:e.id,relation_type:"form",capacity:eG4(e.capacity,0),like_status:"common",metadata:{form_name:t,resource_name:a,...i?{combined_resource:i}:{}},raw:e}})(e,$.get(String(e.form_id))||"")).filter(Boolean)},{ready:!!D,refreshDeps:[D,P.targetDate]}),q=(0,ef.useMemo)(()=>(function(e){let t=new Map;for(let l of e)for(let e of l)(null==e?void 0:e.id)&&t.set(e.id,{...t.get(e.id),...e,metadata:{...eG3(t.get(e.id)),...eG3(e)}});return Array.from(t.values())})([F,B]),[F,B]),V=(0,ef.useMemo)(()=>new Map(q.map(e=>[e.id,{id:e.id,name:e.name,form_id:e.form_id,relation_id:e.relation_id,relation_type:e.relation_type,resource_id:e.resource_id,capacity:eG4(e.capacity,0),like_status:e.like_status,metadata:eG3(e),raw:eG0(e.raw)}])),[q]),Y=(0,ef.useMemo)(()=>(function(e){var t;let{orderDetail:l,selectedCustomer:a,fallbackCustomerText:i}=e;if(a)return a;let n=(null==l?void 0:l.customer_with_extra)||(null==l?void 0:l.customer),s=null==l?void 0:l.contacts_info;return{name:(null==n?void 0:n.display_name)||(null==n?void 0:n.nickname)||i,phone:(null==s||null==(t=s.phone)?void 0:t.phone)||(null==n?void 0:n.phone)||"",email:(null==s?void 0:s.email)||(null==n?void 0:n.email)||"",memberId:(null==n?void 0:n.member_id)||""}})({orderDetail:O,selectedCustomer:m,fallbackCustomerText:eQa("pisell-reservation.booking-change.fallback-customer")}),[m,O]),U=(0,ef.useMemo)(()=>n.hourSlots&&n.hourSlots.length>0?n.hourSlots:Array.from({length:24},(e,t)=>t),[n.hourSlots]),W=n.formatHourLabel||eG8,G=n.isBusinessHour||(()=>!0),Q=(0,ef.useMemo)(()=>{let e=U.filter(e=>G(e));return e.length>0?e:U},[U,G]),K=(0,ef.useMemo)(()=>(function(e){if(e.length<2)return 1;let t=[...e].sort((e,t)=>e-t),l=1/0;for(let e=1;e<t.length;e+=1){let a=t[e]-t[e-1];a>0&&a<l&&(l=a)}return Number.isFinite(l)?l:1})(U),[U]),J=n.firstTimelineHour??Math.min(...U)??0,Z=n.endTimelineExclusive??Math.max(...U)+K,X=(0,ef.useRef)(null);(0,ef.useLayoutEffect)(()=>{if(0===Q.length)return;let e=`${d.id}|${n.targetDate}|${n.targetCourtId}|${n.targetHour}|${Q.join(",")}`;if(X.current===e)return;let t=d.endHour-d.startHour;if(!Number.isFinite(t)||t<0){X.current=e;return}let l=function(e,t,l){if(!Number.isFinite(t)||t<0||0===l.length)return e;let a=eG6(e+t,l),i=eG6(a-t,l),n=eG6(i+t,l);return eG6(n-t,l)}(n.targetHour,t,Q);X.current=e,Math.abs(l-n.targetHour)>.001&&A(e=>({...e,targetHour:l}))},[Q,d.endHour,d.id,d.startHour,n.targetCourtId,n.targetDate,n.targetHour]);let ee=d.endHour-d.startHour,et=P.targetHour,el=et+ee,ea=Q.find(e=>.001>Math.abs(e-et))??eG6(et,Q),ei=Q.find(e=>.001>Math.abs(e-el))??eG6(el,Q),en=d.date,es=W(d.startHour),er=W(d.endHour),eo=R.some((e,t)=>void 0!==I[t]&&I[t]!==String(e.relation_id)),ed=R.length>0?eo:d.courtId!==P.targetCourtId,ec=en!==P.targetDate||d.startHour!==et||ed,eu=d.date!==n.targetDate||d.startHour!==n.targetHour||d.courtId!==n.targetCourtId,ep=n.hasConflict||(()=>!1),em=ep(p,P.targetCourtId,P.targetDate,et,el,d.id),eg=(e,t)=>{k.current||(k.current=!0,S(!1),w.current=window.setTimeout(()=>{"resolve"===e?s(t):r(t)},180))},eh=e=>{M||eg("reject",{type:e})};(0,ef.useEffect)(()=>{let e=window.requestAnimationFrame(()=>{S(!0)}),t=document.body.style.overflow;document.body.style.overflow="hidden";let l=e=>{"Escape"===e.key&&eh("escape")};return window.addEventListener("keydown",l),()=>{window.cancelAnimationFrame(e),window.removeEventListener("keydown",l),document.body.style.overflow=t,w.current&&window.clearTimeout(w.current)}},[]);let ey=async()=>{if(em||M)return;T("");let e={item:d,original:{targetCourtId:n.targetCourtId,targetDate:n.targetDate,targetHour:n.targetHour},draft:P,customer:Y,duration:ee,nextEndHour:el,changed:ec,submitPayload:function(e){let{item:t,draft:l,duration:a,nextEndHour:i,currentEventResources:n,resourceCourtIds:s,resourceCourtMap:r,orderDetail:o}=e,d=eG9(t),c=eG3(d),u=eG5(l.targetDate,l.targetHour),p=eG5(l.targetDate,i),m={...c},g=n.map((e,t)=>{let l=s[t],a=String(e.relation_id);if(l&&l!==a){let t=r.get(l);if(t){var i;let l,a,n;return i=eQe(e),l={...i.metadata,...t.metadata,form_name:t.metadata.form_name,resource_name:t.metadata.resource_name},(a=eG7(t.metadata.combined_resource))?l.combined_resource=a:delete l.combined_resource,n=function(e,t){let l=eG7(e.metadata.combined_resource);if(!l||0===l.resource_ids.length)return;let a=l.resource_ids.map(e=>t.get(String(e))).filter(e=>!!e).map(e=>({form_id:e.form_id,relation_type:e.relation_type,relation_id:e.relation_id,capacity:e.capacity,like_status:e.like_status,metadata:{...e.metadata,form_name:e.metadata.form_name,resource_name:e.metadata.resource_name}}));return a.length>0?a:void 0}(t,r),{form_id:t.form_id,relation_type:t.relation_type,relation_id:t.relation_id,capacity:t.capacity,like_status:t.like_status,metadata:l,...n?{children:n}:{}}}}return function e(t){let l=eG2(t.children).map(e);return{form_id:t.form_id,relation_type:t.relation_type||"form",relation_id:t.relation_id,capacity:eG4(t.capacity,0),like_status:t.like_status||"common",metadata:eG0(t.metadata)||{},...l.length>0?{children:l}:{}}}(e)});return{id:d.id,relation_id:d.relation_id,like_status:d.like_status,relation_type:d.relation_type,is_all:eG4(d.is_all,0),schedule_id:function(e,t){var l;let a=e.schedule_id;if(null!=a&&""!==a)return a;let i=e.id;if(null==i||""===i)return;let n=((null==t||null==(l=t.bookings)?void 0:l.list)||[]).find(e=>String(null==e?void 0:e.id)===String(i));return null==n?void 0:n.schedule_id}(d,o),sub_type:d.sub_type,select_date:l.targetDate,number:d.number,metadata:m,resources:g,start_date:u.date,start_time:u.time,end_date:p.date,end_time:p.time,duration:Math.max(0,Math.round(60*a))}}({item:d,draft:P,duration:ee,nextEndHour:el,currentEventResources:R,resourceCourtIds:I,resourceCourtMap:V,orderDetail:O})};if(!n.onSubmit)return void eg("resolve",e);N(!0);try{let t=await n.onSubmit({...e,options:n});eg("resolve",{...e,submitResult:t})}catch(e){T((null==e?void 0:e.message)||n.submitErrorMessage||eQa("pisell-reservation.booking-change.submit-failed"))}finally{N(!1)}};return(0,ev.jsx)("div",{className:["pisell-booking-change-modal",j?"is-visible":"","light"===b?"is-light":"is-dark"].filter(Boolean).join(" "),style:{zIndex:x},onMouseDown:e=>{e.target===e.currentTarget&&y&&eh("backdrop")},children:(0,ev.jsxs)("div",{ref:_,className:"pisell-booking-change-modal__panel",onMouseDown:e=>e.stopPropagation(),children:[(0,ev.jsx)("div",{className:"pisell-booking-change-modal__title",children:g}),(0,ev.jsx)("div",{className:"pisell-booking-change-modal__description",children:h}),(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__body",children:[(0,ev.jsx)("div",{className:"pisell-booking-change-modal__card",children:(0,ev.jsx)("div",{className:"pisell-booking-change-modal__customer",children:(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__customer-info",children:[(0,ev.jsx)("div",{className:"pisell-booking-change-modal__section-label",children:eQa("pisell-reservation.booking-change.customer")}),(0,ev.jsx)("div",{className:"pisell-booking-change-modal__customer-name",children:Y.name}),(0,ev.jsx)("div",{className:"pisell-booking-change-modal__customer-meta",children:Y.phone||eQa("pisell-reservation.booking-change.no-phone")}),(0,ev.jsx)("div",{className:"pisell-booking-change-modal__customer-meta",children:Y.email||eQa("pisell-reservation.booking-change.no-email")}),Y.memberId&&(0,ev.jsx)("div",{className:"pisell-booking-change-modal__customer-meta",children:Y.memberId})]})})}),(0,ev.jsx)("div",{className:"pisell-booking-change-modal__grid",children:(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__field",style:{gridColumn:"1 / -1"},children:[(0,ev.jsx)("label",{className:"pisell-booking-change-modal__field-label",children:eQa("pisell-reservation.booking-change.new-date")}),(0,ev.jsx)("input",{type:"date",value:P.targetDate,onChange:e=>A(t=>({...t,targetDate:e.target.value})),className:"pisell-booking-change-modal__control"})]})}),(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__grid",children:[(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__field",children:[(0,ev.jsx)("label",{className:"pisell-booking-change-modal__field-label",children:eQa("pisell-reservation.booking-change.new-start-time")}),(0,ev.jsx)("select",{value:ea,onChange:e=>A(t=>({...t,targetHour:Number(e.target.value)})),className:"pisell-booking-change-modal__control",children:Q.map(e=>{let t=e+ee>Z||ep(p,P.targetCourtId,P.targetDate,e,e+ee,d.id);return(0,ev.jsx)("option",{value:e,disabled:t,children:t?eQi("pisell-reservation.booking-change.unavailable-time",{time:W(e)}):W(e)},e)})})]}),(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__field",children:[(0,ev.jsx)("label",{className:"pisell-booking-change-modal__field-label",children:eQa("pisell-reservation.booking-change.new-end-time")}),(0,ev.jsx)("select",{value:ei,onChange:e=>{let t=Number(e.target.value);A(e=>({...e,targetHour:t-ee}))},className:"pisell-booking-change-modal__control",children:Q.map(e=>{let t=e-ee,l=t<J||ep(p,P.targetCourtId,P.targetDate,t,e,d.id);return(0,ev.jsx)("option",{value:e,disabled:l,children:l?eQi("pisell-reservation.booking-change.unavailable-time",{time:W(e)}):W(e)},`end-${e}`)})})]})]}),R.length>0&&(0,ev.jsx)("div",{className:"pisell-booking-change-modal__grid",children:R.map((e,t)=>{let l=eG0(e.metadata)||{},a=String(l.form_name||e.form_id),i=String(e.relation_id),n=String(l.resource_name||i),s=B.filter(t=>String(t.form_id)===String(e.form_id)),r=s.some(e=>e.id===i);return(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__field",children:[(0,ev.jsx)("label",{className:"pisell-booking-change-modal__field-label",children:a}),(0,ev.jsxs)("select",{value:I[t]??i,onChange:e=>{let l=e.target.value;E(e=>{let a=[...e];return a[t]=l,a})},disabled:H,className:"pisell-booking-change-modal__control",children:[!r&&(0,ev.jsx)("option",{value:i,children:n}),s.map(e=>(0,ev.jsx)("option",{value:e.id,children:e.name},e.id))]})]},t)})}),ec&&(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__card",children:[(0,ev.jsx)("div",{className:"pisell-booking-change-modal__section-label",children:eQa("pisell-reservation.booking-change.previous-booking-info")}),(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__compare-grid",children:[(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__compare-card",children:[(0,ev.jsx)("div",{className:"pisell-booking-change-modal__compare-title",children:eQa("pisell-reservation.booking-change.original")}),(0,ev.jsx)("div",{className:"pisell-booking-change-modal__compare-value",children:en}),(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__compare-value",children:[es," - ",er]}),R.length>0&&(0,ev.jsx)("div",{className:"pisell-booking-change-modal__resource-list",children:R.map((e,t)=>(0,ev.jsx)("div",{className:"pisell-booking-change-modal__resource-item",children:(0,ev.jsx)("div",{className:"pisell-booking-change-modal__resource-name",children:String((eG0(e.metadata)||{}).resource_name||e.relation_id)})},t))})]}),(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__compare-card is-highlighted",children:[(0,ev.jsx)("div",{className:"pisell-booking-change-modal__compare-title",children:eu?eQa("pisell-reservation.booking-change.drop-target"):eQa("pisell-reservation.booking-change.updated")}),(0,ev.jsx)("div",{className:"pisell-booking-change-modal__compare-value",children:P.targetDate}),(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__compare-value",children:[W(et)," - ",W(el)]}),R.length>0&&(0,ev.jsx)("div",{className:"pisell-booking-change-modal__resource-list",children:R.map((e,t)=>{let l=I[t],a=String(e.relation_id),i=String((eG0(e.metadata)||{}).resource_name||a);if(l&&l!==a){let e=V.get(l);e&&(i=String(e.metadata.resource_name||e.name))}return(0,ev.jsx)("div",{className:"pisell-booking-change-modal__resource-item",children:(0,ev.jsx)("div",{className:"pisell-booking-change-modal__resource-name",children:i})},t)})})]})]})]})]}),em&&(0,ev.jsx)("div",{className:"pisell-booking-change-modal__error",children:eQa("pisell-reservation.booking-change.conflict")}),!em&&C&&(0,ev.jsx)("div",{className:"pisell-booking-change-modal__error",children:C}),(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__footer",children:[(0,ev.jsx)("button",{type:"button",onClick:()=>eh("cancel"),disabled:M,className:"pisell-booking-change-modal__ghost-button",children:f}),(0,ev.jsx)("button",{type:"button",disabled:em||M||H,onClick:ey,className:"pisell-booking-change-modal__primary-button",children:M?eQa("pisell-reservation.booking-change.submitting"):v})]})]})})},eQr=function(e){if("u"<typeof window||"u"<typeof document)return Promise.reject({type:"programmatic-close",message:eQa("pisell-reservation.booking-change.browser-only")});eQt&&function(e){if(!eQt)return;let{reject:t}=eQt;eQn(),t(e)}({type:"replaced",message:eQa("pisell-reservation.booking-change.replaced")});let t=document.createElement("div");return document.body.appendChild(t),new Promise((l,a)=>{eQt={container:t,reject:a},iM().render((0,ev.jsx)(eQs,{options:e,onResolve:e=>{eQn(),l(e)},onReject:e=>{eQn(),a(e)}}),t)})};function eQo(e){return{id:e.id,courtId:e.courtId,date:e.date,startHour:e.startHour,endHour:e.endHour,name:e.name,kind:e.kind,phone:e.phone,raw:e.raw}}async function eQd(e){let{calendarItem:t,draft:l,calendarResources:a,calendarBookings:i,effectiveTimelineRange:n,anchorDate:s,slotStepMinutes:r,onSuccessRefresh:o}=e;if("booking"!==t.kind)return!1;let d=eQo(t),c=a.map(e=>({id:String(e.id),name:e.name,form_id:String(e.form_id??e.id),relation_id:String(e.id),resource_id:String(e.id),relation_type:"form"})),u=i.map(eQo),p=(0,lL.buildCalendarTimelineSlotStartsFromRange)(n,s,r),m=r/60,g=p[0]??0,h=p.length?p[p.length-1]+m:24;try{return await eQr({item:d,targetCourtId:l.targetCourtId,targetDate:l.targetDate,targetHour:l.targetHour,courts:c,visibleCourts:c,bookings:u,hourSlots:p,firstTimelineHour:g,endTimelineExclusive:h,theme:"dark",title:"确认调整预约",description:"拖拽后请确认场地、日期与时段,提交后生效。",confirmText:"确认改约",cancelText:"取消",getBookingDetailData:(e,t)=>{var l;return{customer:{name:e.name||"—",phone:"string"==typeof e.phone?e.phone:"",email:""},headerSummary:{customerName:e.name||"",resourceLabel:(null==(l=t.find(t=>t.id===e.courtId))?void 0:l.name)||e.courtId}}},isBusinessHour:e=>!!p.length&&p.some(t=>1e-6>Math.abs(t-e)),hasConflict:(e,t,l,a,i,n)=>e.some(e=>e.id!==n&&e.courtId===t&&e.date===l&&!(i<=e.startHour||a>=e.endHour)),onSubmit:async e=>{let t=function(e){let t=e.raw;if(!t)return null;for(let e of[t.order_id,t.booking_uid,t.booking_id,t.id])if(null!=e&&""!==String(e).trim())return"number"==typeof e?e:String(e);return null}(e.item);if(null==t)throw Error("无法解析订单编号,请从预约详情改约");await z_.Em.getRequest().put(`/shop/v1.1/order/appointment/child-booking/${t}`,e.submitPayload),await o(),ex.message.success("改约已保存")}}),!0}catch{return!1}}let eQc={en:{"pisell-reservation.block-time.title":"Create blocked time","pisell-reservation.block-time.close-aria":"Close blocked time modal","pisell-reservation.block-time.field-title":"Title","pisell-reservation.block-time.field-note":"Note","pisell-reservation.block-time.field-resource":"Court","pisell-reservation.block-time.field-time-range":"Time range","pisell-reservation.block-time.placeholder-title":"Enter blocked time title","pisell-reservation.block-time.placeholder-note":"Optional","pisell-reservation.block-time.no-resource":"Please select a court","pisell-reservation.block-time.default-title":"Blocked time","pisell-reservation.block-time.cancel":"Cancel","pisell-reservation.block-time.confirm":"Save","pisell-reservation.block-time.submitting":"Saving...","pisell-reservation.block-time.warn-select-time":"Please select a valid blocked time range.","pisell-reservation.block-time.warn-end-after-start":"End time must be later than start time.","pisell-reservation.block-time.warn-select-resource":"Please select a valid court.","pisell-reservation.block-time.submit-failed":"Save failed. Please try again later.","pisell-reservation.block-time.browser-only":"blockTimeModal can only open in a browser environment.","pisell-reservation.block-time.replaced":"A new blockTimeModal replaced the current modal."},"zh-CN":{"pisell-reservation.block-time.title":"新建屏蔽时间","pisell-reservation.block-time.close-aria":"关闭屏蔽时间弹窗","pisell-reservation.block-time.field-title":"标题","pisell-reservation.block-time.field-note":"备注","pisell-reservation.block-time.field-resource":"场地","pisell-reservation.block-time.field-time-range":"时间范围","pisell-reservation.block-time.placeholder-title":"请输入屏蔽时间标题","pisell-reservation.block-time.placeholder-note":"选填","pisell-reservation.block-time.no-resource":"请选择场地","pisell-reservation.block-time.default-title":"屏蔽时间","pisell-reservation.block-time.cancel":"取消","pisell-reservation.block-time.confirm":"保存","pisell-reservation.block-time.submitting":"保存中...","pisell-reservation.block-time.warn-select-time":"请选择有效的屏蔽时间范围。","pisell-reservation.block-time.warn-end-after-start":"结束时间必须晚于开始时间。","pisell-reservation.block-time.warn-select-resource":"请选择有效的场地。","pisell-reservation.block-time.submit-failed":"保存失败,请稍后重试。","pisell-reservation.block-time.browser-only":"blockTimeModal 仅可在浏览器环境中打开。","pisell-reservation.block-time.replaced":"新的 blockTimeModal 已替换当前弹窗。"},"zh-HK":{"pisell-reservation.block-time.title":"新增屏蔽時間","pisell-reservation.block-time.close-aria":"關閉屏蔽時間彈窗","pisell-reservation.block-time.field-title":"標題","pisell-reservation.block-time.field-note":"備註","pisell-reservation.block-time.field-resource":"場地","pisell-reservation.block-time.field-time-range":"時間範圍","pisell-reservation.block-time.placeholder-title":"請輸入屏蔽時間標題","pisell-reservation.block-time.placeholder-note":"選填","pisell-reservation.block-time.no-resource":"請選擇場地","pisell-reservation.block-time.default-title":"屏蔽時間","pisell-reservation.block-time.cancel":"取消","pisell-reservation.block-time.confirm":"保存","pisell-reservation.block-time.submitting":"保存中...","pisell-reservation.block-time.warn-select-time":"請選擇有效的屏蔽時間範圍。","pisell-reservation.block-time.warn-end-after-start":"結束時間必須晚於開始時間。","pisell-reservation.block-time.warn-select-resource":"請選擇有效的場地。","pisell-reservation.block-time.submit-failed":"保存失敗,請稍後重試。","pisell-reservation.block-time.browser-only":"blockTimeModal 僅可在瀏覽器環境中開啟。","pisell-reservation.block-time.replaced":"新的 blockTimeModal 已取代目前彈窗。"}},{RangePicker:eQu}=ex.DatePicker,eQp=null;function eQm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en";eN.init(eQc,e||"en")}function eQg(e){return eN.getText(e)}function eQh(){if(!eQp)return;let{container:e}=eQp;eQp=null,iM().unmountComponentAtNode(e),document.body.contains(e)&&document.body.removeChild(e)}eQm();let eQv=e=>{var t,l;let{options:a,onResolve:i,onReject:n}=e,s=ik();eQm((null==s||null==(l=s.engine)||null==(t=l.props)?void 0:t.locale)||"en");let{resources:r,initialName:o,initialNote:d="",initialResourceId:c,initialTimeRange:u=null,blockedSalesChannels:p=["online_store"],minuteStep:m=60,title:g=eQg("pisell-reservation.block-time.title"),confirmText:h=eQg("pisell-reservation.block-time.confirm"),cancelText:v=eQg("pisell-reservation.block-time.cancel"),closeOnBackdrop:f=!0,zIndex:y=1072,theme:x="dark"}=a,b=(0,ef.useRef)(!1),_=(0,ef.useRef)(null),[k,w]=(0,ef.useState)(!1),[j,S]=(0,ef.useState)(!1),[M,N]=(0,ef.useState)(""),[C,T]=(0,ef.useState)({name:o||eQg("pisell-reservation.block-time.default-title"),note:d,resourceId:null==c?"":String(c),timeRange:u}),P=(0,ef.useMemo)(()=>{let e=Math.round(Number(m));return!Number.isFinite(e)||e<1||e>=60?60:Math.max(1,e)},[m]),A=(0,ef.useMemo)(()=>Array.isArray(r)?r:[],[r]),D=(e,t)=>{b.current||(b.current=!0,w(!1),_.current=window.setTimeout(()=>{"resolve"===e?i(t):n(t)},180))},I=e=>{j||D("reject",{type:e})};(0,ef.useEffect)(()=>{let e=window.requestAnimationFrame(()=>{w(!0)}),t=document.body.style.overflow;document.body.style.overflow="hidden";let l=e=>{"Escape"===e.key&&I("escape")};return window.addEventListener("keydown",l),()=>{window.cancelAnimationFrame(e),window.removeEventListener("keydown",l),document.body.style.overflow=t,_.current&&window.clearTimeout(_.current)}},[]);let E=async()=>{if(j)return;N("");let e=function(e,t){var l,a;if(!(null==(l=e.timeRange)?void 0:l[0])||!(null==(a=e.timeRange)?void 0:a[1]))return ex.message.warning(eQg("pisell-reservation.block-time.warn-select-time")),null;let[i,n]=e.timeRange;if(!n.isAfter(i))return ex.message.warning(eQg("pisell-reservation.block-time.warn-end-after-start")),null;let s=Number(e.resourceId);return!Number.isFinite(s)||s<=0?(ex.message.warning(eQg("pisell-reservation.block-time.warn-select-resource")),null):{name:e.name.trim()||eQg("pisell-reservation.block-time.default-title"),note:e.note.trim(),resource_ids:[s],blocked_sales_channels:t,start_time:i.format("YYYY-MM-DD HH:mm"),end_time:n.format("YYYY-MM-DD HH:mm")}}(C,p);if(!e)return;let t={draft:C,submitPayload:e};if(!a.onSubmit)return void D("resolve",t);S(!0);try{let l=await a.onSubmit({draft:C,submitPayload:e,options:a});if(!1===l)return;D("resolve",{...t,submitResult:l})}catch(t){let e=a.submitErrorMessage||eQg("pisell-reservation.block-time.submit-failed");N((null==t?void 0:t.message)||e)}finally{S(!1)}};return(0,ev.jsx)("div",{className:["pisell-block-time-modal",k?"is-visible":"","light"===x?"is-light":"is-dark"].filter(Boolean).join(" "),style:{zIndex:y},onMouseDown:e=>{e.target===e.currentTarget&&f&&I("backdrop")},children:(0,ev.jsxs)("div",{className:"pisell-block-time-modal__panel",onMouseDown:e=>e.stopPropagation(),children:[(0,ev.jsxs)("div",{className:"pisell-block-time-modal__header",children:[(0,ev.jsx)("div",{className:"pisell-block-time-modal__title",children:g}),(0,ev.jsx)("button",{type:"button","aria-label":eQg("pisell-reservation.block-time.close-aria"),onClick:()=>I("cancel"),className:"pisell-block-time-modal__close",children:(0,ev.jsx)("span",{className:"pisell-block-time-modal__close-icon",children:(0,ev.jsx)(u6,{})})})]}),(0,ev.jsxs)("div",{className:"pisell-block-time-modal__body",children:[(0,ev.jsxs)("div",{className:"pisell-block-time-modal__field",children:[(0,ev.jsx)("label",{className:"pisell-block-time-modal__label",children:eQg("pisell-reservation.block-time.field-title")}),(0,ev.jsx)("input",{value:C.name,onChange:e=>T(t=>({...t,name:e.target.value})),placeholder:eQg("pisell-reservation.block-time.placeholder-title"),className:"pisell-block-time-modal__control"})]}),(0,ev.jsxs)("div",{className:"pisell-block-time-modal__field",children:[(0,ev.jsx)("label",{className:"pisell-block-time-modal__label",children:eQg("pisell-reservation.block-time.field-note")}),(0,ev.jsx)("input",{value:C.note,onChange:e=>T(t=>({...t,note:e.target.value})),placeholder:eQg("pisell-reservation.block-time.placeholder-note"),className:"pisell-block-time-modal__control"})]}),(0,ev.jsxs)("div",{className:"pisell-block-time-modal__field",children:[(0,ev.jsx)("label",{className:"pisell-block-time-modal__label",children:eQg("pisell-reservation.block-time.field-resource")}),(0,ev.jsxs)("select",{value:C.resourceId,onChange:e=>T(t=>({...t,resourceId:e.target.value})),className:"pisell-block-time-modal__control",children:[(0,ev.jsx)("option",{value:"",children:eQg("pisell-reservation.block-time.no-resource")}),A.map(e=>(0,ev.jsx)("option",{value:String(e.id),children:e.name},String(e.id)))]})]}),(0,ev.jsxs)("div",{className:"pisell-block-time-modal__field",children:[(0,ev.jsx)("label",{className:"pisell-block-time-modal__label",children:eQg("pisell-reservation.block-time.field-time-range")}),(0,ev.jsx)(eQu,{...{className:"pisell-block-time-modal__range",style:{width:"100%"},showTime:{format:"HH:mm",minuteStep:P},format:"YYYY-MM-DD HH:mm",value:C.timeRange??void 0,onChange:e=>T(t=>({...t,timeRange:e??null}))}})]})]}),M&&(0,ev.jsx)("div",{className:"pisell-block-time-modal__error",children:M}),(0,ev.jsxs)("div",{className:"pisell-block-time-modal__footer",children:[(0,ev.jsx)("button",{type:"button",disabled:j,onClick:()=>I("cancel"),className:"pisell-block-time-modal__ghost-button",children:v}),(0,ev.jsx)("button",{type:"button",disabled:j,onClick:()=>void E(),className:"pisell-block-time-modal__primary-button",children:j?eQg("pisell-reservation.block-time.submitting"):h})]})]})})},eQf=function(e){if("u"<typeof window||"u"<typeof document)return Promise.reject({type:"programmatic-close",message:eQg("pisell-reservation.block-time.browser-only")});eQp&&function(e){if(!eQp)return;let{reject:t}=eQp;eQh(),t(e)}({type:"replaced",message:eQg("pisell-reservation.block-time.replaced")});let t=document.createElement("div");return document.body.appendChild(t),new Promise((l,a)=>{eQp={container:t,reject:a},iM().render((0,ev.jsx)(eQv,{options:e,onResolve:e=>{eQh(),l(e)},onReject:e=>{eQh(),a(e)}}),t)})};function eQy(e){let{raw:t,tableRow:l}=e,[,a]=(0,ef.useReducer)(e=>e+1,0);(0,ef.useEffect)(()=>{let e=window.setInterval(()=>a(),6e4);return()=>window.clearInterval(e)},[]);let i=(0,ef.useMemo)(()=>eYG(t,l),[t,l]),n=(0,ef.useMemo)(()=>eYW(t),[t]);return(0,ev.jsx)("div",{className:"pisell-res-floor-room-card",style:{width:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box",minHeight:0,minWidth:0,display:"flex",flexDirection:"column"},children:(0,ev.jsx)("div",{style:{flex:1,minWidth:0,minHeight:0,width:"100%",display:"flex",flexDirection:"column"},children:(0,ev.jsx)(eU_,{data:i,shellShape:"rect",hideHeader:!0,hideHeaderCapacity:!0,headerMainFieldOverride:n})})})}function eQx(e){let{args:t,tables:l,calendarDragSuppressDetailRef:a}=e,i=t.booking.item,n=()=>{let e=a.current;null!=e.timer&&(clearTimeout(e.timer),e.timer=null),e.bookingId=i.id,e.timer=setTimeout(()=>{e.bookingId=null,e.timer=null},650)},s=e=>{let l=a.current;if(l.bookingId===i.id){l.bookingId=null,null!=l.timer&&(clearTimeout(l.timer),l.timer=null),e.preventDefault(),e.stopPropagation();return}e.stopPropagation(),t.onOpenDetail(i)};if("block"===i.kind)return(0,ev.jsx)("button",{type:"button",className:"absolute inset-0 rounded-2xl px-2 py-2 text-left",onClick:e=>{e.stopPropagation(),t.onOpenDetail(i)},children:(0,ev.jsx)("div",{className:"truncate text-sm font-medium",children:i.name})});let r=i.raw;if(!r)return(0,ev.jsx)("button",{type:"button",draggable:!0,onDragStart:e=>{e.stopPropagation(),t.onDragStart(i)},onDragEnd:e=>{e.stopPropagation(),n()},onClick:s,className:"absolute inset-0 rounded-2xl px-2 py-2 text-left",children:(0,ev.jsx)("div",{className:"truncate text-sm",children:i.name})});let o=eGs(r,l);return(0,ev.jsx)("div",{className:"absolute inset-0 min-h-0 cursor-grab overflow-hidden rounded-2xl active:cursor-grabbing",draggable:!0,onDragStart:e=>{e.stopPropagation(),t.onDragStart(i)},onDragEnd:e=>{e.stopPropagation(),n()},onClick:s,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),e.stopPropagation(),t.onOpenDetail(i))},role:"button",tabIndex:0,children:(0,ev.jsx)(eQy,{raw:r,tableRow:o??null,overlayWidthPx:t.overlayWidthPx})})}function eQb(e){let{value:t,onChange:l,options:a=[]}=e;return(0,ev.jsx)(ex.Select,{mode:"multiple",allowClear:!0,showSearch:!0,optionFilterProp:"label",placeholder:eN.getText(eWD),value:t??[],onChange:e=>null==l?void 0:l(e),options:a,style:{minWidth:260,maxWidth:420}})}let eQ_="pisell-reservation-mobile-table-col--booking-brief",eQk="pisell-reservation-mobile-table-col--order-info",eQw={customer:"pisell-reservation-mobile-table-col--customer",contact:"pisell-reservation-mobile-table-col--contact",holder_data:"pisell-reservation-mobile-table-col--holder-data"},eQj={booking_brief:124,relation_form_name:88,service_time:128,order_info:100,customer:96,contact:100,holder_data:88,services:88,number:72,appointment_form:92,booking_id:72,order_origin:96,updated:88,actions:72};function eQS(e,t){return e.map(e=>{if("rangePicker"!==String(e.type))return e;let l="object"==typeof e.props&&null!==e.props?{...e.props}:{},a="object"==typeof e.other&&null!==e.other?{...e.other}:{},i="object"==typeof a.formItemProps&&null!==a.formItemProps?a.formItemProps:{},n="string"==typeof l.placeholder?l.placeholder:"string"==typeof a.placeholder?a.placeholder:void 0;delete l.placeholder,delete a.placeholder,delete l.showTime,delete a.showTime;let s="object"==typeof i.style&&null!==i.style?i.style:{};return{...e,type:"custom",other:{...a,component:lL.PisellMobileDateRangePicker,formItemProps:{...i,...(null==t?void 0:t.rangeFormItemClassName)?{className:t_()(t.rangeFormItemClassName,"string"==typeof i.className?i.className:void 0)}:{},...(null==t?void 0:t.compactFormItem)?{style:{marginBottom:0,...s}}:{}}},props:{...l,format:"DD/MM/YYYY",...n?{placeholder:n}:{},...(null==t?void 0:t.rangePickerVariant)?{variant:t.rangePickerVariant}:{},style:{width:"100%",minWidth:0,maxWidth:"100%",..."object"==typeof l.style&&null!==l.style?l.style:{}}}}})}function eQM(e){let t=e.baseToolBar??{},l="string"==typeof t.className?t.className:void 0,a="object"==typeof t.search&&null!==t.search?t.search:{},i="string"==typeof a.containerClassName?a.containerClassName:void 0,n=t_()(i,"pisell-reservation-mobile-search-modal");return{...t,toolbarDensity:"compact-narrow",filter:"object"==typeof t.filter&&null!==t.filter?{...t.filter,phoneLayout:!0}:{phoneLayout:!0},quickFilter:!!e.quickFilterFilterList&&e.quickFilterFilterList.length>0&&{filterList:e.quickFilterFilterList},search:e.searchGetContainer?{...a,containerClassName:n,getContainer:e.searchGetContainer,modalWidth:"min(calc(100% - 24px), 360px)",modalStyle:{..."object"==typeof a.modalStyle&&null!==a.modalStyle&&!Array.isArray(a.modalStyle)?a.modalStyle:{},marginLeft:"auto",marginRight:"auto"}}:{...a,containerClassName:n},className:t_()(l,"pisell-record-board-toolbar--narrow-stack","pisell-reservation-mobile-table-toolbar")}}function eQN(e){let t=e??{},l=Array.isArray(t.columns)?t.columns:[],a=(0,lL.adaptColumnsForPhoneLayout)(l.map(e=>{var t,l,a;let i;return"order_info"!==String((a="service_time"!==String((l=!(i=eQw[String((t="booking_brief"!==String(e.key??e.dataIndex??"")?e:{...e,ellipsis:!1,className:t_()("string"==typeof e.className?e.className:void 0,eQ_),onCell:()=>({className:eQ_})}).key??t.dataIndex??"")])?t:{...t,ellipsis:!1,className:t_()("string"==typeof t.className?t.className:void 0,i),onCell:()=>({className:i})}).key??l.dataIndex??"")?l:{...l,className:t_()("string"==typeof l.className?l.className:void 0,"pisell-reservation-mobile-table-col--service-time")}).key??a.dataIndex??"")?a:{...a,ellipsis:!1,className:t_()("string"==typeof a.className?a.className:void 0,eQk),onCell:()=>({className:eQk})}}),{widthCapsByKey:eQj,defaultWidthRatio:.78}),{x:i,...n}="object"==typeof t.scroll&&null!==t.scroll?t.scroll:{};return{...t,columns:a,infiniteScroll:!1!==t.infiniteScroll,virtual:t.virtual,size:"small",className:t_()("string"==typeof t.className?t.className:void 0,"pisell-reservation-mobile-table-grid"),scroll:{...n,autoCalc:!0}}}let eQC=(0,ef.forwardRef)(function(e,t){let{router:l,app:a}=e,i=(0,ef.useMemo)(()=>l&&"object"==typeof l?Object.entries(l).reduce((e,t)=>{let[l,a]=t;if(!a||"object"!=typeof a)return e;let i=a.page_type,n=a.proCodeId;if("proCode"!==i||"string"!=typeof n||!eWO.has(n))return e;let s="string"==typeof a.page_name&&a.page_name.trim()?a.page_name.trim():l,r="string"==typeof a.router&&a.router.trim()?a.router.trim():l;return!r||r.toLowerCase().includes("food")||/\/:[^/]+/.test(r)||e.push({pageName:s,router:r}),e},[]):[],[l]),[n,s]=(0,ef.useState)(!1),r=i0(e=>{var t,l;e&&(s(!1),null==a||null==(l=a.history)||null==(t=l.push)||t.call(l,e))}),o=i0(()=>{1===i.length?r(i[0].router):s(!0)});(0,ef.useImperativeHandle)(t,()=>({requestOpen:o}),[o]);let d=i0(()=>{s(!1)});return(0,ev.jsx)(lL.PisellModal,{platform:"pc",open:n,title:eN.getText("pisell-reservation.new-modal-title"),onCancel:d,maskClosable:!0,footer:null,width:520,wrapClassName:"pisell-reservation-new-modal-wrap",destroyOnClose:!0,children:(0,ev.jsx)("div",{className:"pisell-reservation-new-modal-placeholder",children:i.length>0?(0,ev.jsx)("div",{className:"pisell-reservation-new-modal-route-list",children:i.map(e=>(0,ev.jsxs)("button",{type:"button",className:"pisell-reservation-new-modal-route-item",onClick:()=>r(e.router),children:[(0,ev.jsx)("span",{className:"pisell-reservation-new-modal-route-name",children:e.pageName}),(0,ev.jsx)(lL.Icon,{type:"icon-right-arrow",className:"pisell-reservation-new-modal-route-arrow"})]},`${e.router}-${e.pageName}`))}):(0,ev.jsx)("p",{className:"pisell-reservation-new-modal-empty",children:eN.getText("pisell-reservation.new-modal-placeholder")})})})});function eQT(e){try{return JSON.parse(JSON.stringify(e??{}))}catch{return{...e??{}}}}function eQP(e){let t=e.start_at;if("string"==typeof t&&t){let e=em()(t);if(e.isValid())return e.valueOf()}let l=eWx(e.start_date,e.start_time);if(l){let e=em()(l);if(e.isValid())return e.valueOf()}return 0}function eQA(e){let t=e.created_at;if("string"==typeof t&&t){let e=em()(t);if(e.isValid())return e.valueOf()}return 0}function eQD(e){if(!Array.isArray(e)||e.length<2)return null;let t=em()(e[0]),l=em()(e[1]);if(!t.isValid()||!l.isValid())return null;let a=t.valueOf(),i=l.valueOf();return a<=i?[a,i]:[i,a]}function eQI(e,t){if(!Array.isArray(t)||0===t.length)return!0;let l=new Set(t.map(e=>String(e)));return Array.isArray(e)?e.some(e=>l.has(String(e))):null!=e&&""!==e&&l.has(String(e))}function eQE(e,t){if(null==t||"object"!=typeof t||Array.isArray(t))return!0;let l=null!=t.min&&""!==t.min?Number(t.min):NaN,a=null!=t.max&&""!==t.max?Number(t.max):NaN,i=Number.isFinite(l),n=Number.isFinite(a);return!i&&!n||!!Number.isFinite(e)&&(!i||!(e<l))&&(!n||!(e>a))}function eQz(e){if(null==e||""===e)return null;if("number"==typeof e&&Number.isFinite(e))return e;let t=Number(String(e).replace(/,/g,"").trim());return Number.isFinite(t)?t:null}let eQL="pisell-reservation.floor-hud.interactive-title";function eQO(e,t){let l=0,a=0,i=0,n=0,s=0,r=0,o=t??{};for(let t of e){if(!function(e){let t=e.elementKind;return!!t&&t!==lL.FLOOR_MAP_IMAGE_ELEMENT_KIND&&t!==lL.FLOOR_MAP_STAGE_ELEMENT_KIND}(t))continue;l+=1;let e=eGG(t,o);if(!e){r+=1;continue}switch(e.cardStatus){case"available":default:a+=1;break;case"booked":i+=1;break;case"occupied":case"barBusy":n+=1;break;case"maintenance":s+=1}}return{total:l,idle:a,booked:i,occupied:n,maintenance:s,unbound:r}}function eQR(e){let t=[{label:eN.getText("pisell-reservation.floor-hud.total"),value:e.total},{label:eN.getText("pisell-reservation.room-status-empty"),value:e.idle},{label:eN.getText("pisell-reservation.room-status-reserved"),value:e.booked}];return e.occupied>0&&t.push({label:eN.getText("pisell-reservation.room-status-occupied"),value:e.occupied}),e.maintenance>0&&t.push({label:eN.getText("pisell-reservation.room-status-locked"),value:e.maintenance}),e.unbound>0&&t.push({label:eN.getText("pisell-reservation.room-status-unbound"),value:e.unbound}),t}function eQ$(e){return(0,ev.jsx)(ev.Fragment,{children:e.rows.map((e,t)=>(0,ev.jsxs)(ey().Fragment,{children:[t>0?(0,ev.jsx)("span",{className:"pisell-reservation-floor-map-hud-sep","aria-hidden":!0,children:"\xb7"}):null,(0,ev.jsxs)("span",{className:"pisell-reservation-floor-map-hud-inline-item",children:[(0,ev.jsx)("span",{className:"pisell-reservation-floor-map-hud-label",children:e.label}),(0,ev.jsx)("span",{className:"pisell-reservation-floor-map-hud-value",children:e.value})]})]},e.label))})}function eQF(e){let{items:t,dataSources:l,actionMode:a,onAction:i,embedded:n,className:s}=e,r=(0,ef.useMemo)(()=>eQO(t,l),[t,l]),o=(0,ef.useMemo)(()=>eQR(r),[r]);if(0===r.total){if("collapse"===a){let e=eN.getText("pisell-reservation.hud-collapse-aria"),t=eN.getText("pisell-reservation.hud-table-drawer-title");return(0,ev.jsx)("div",{className:t_()("pisell-reservation-floor-map-hud","pisell-reservation-floor-map-hud--interactive-title-bar",n&&"pisell-reservation-floor-map-hud--embedded","pisell-reservation-floor-map-hud-title-bar--minimal",s),role:"region","aria-label":t,children:(0,ev.jsxs)("div",{className:"pisell-reservation-floor-map-hud-title-bar-layout",children:[(0,ev.jsx)("span",{className:"pisell-reservation-floor-map-hud-heading",children:eN.getText(eQL)}),(0,ev.jsx)("div",{className:"pisell-reservation-floor-map-hud-title-bar-stats"}),(0,ev.jsx)("button",{type:"button",className:"pisell-reservation-floor-map-hud-chevron-btn","aria-expanded":!0,"aria-label":e,onClick:e=>{e.stopPropagation(),i()},children:(0,ev.jsx)(g0,{rotate:90})})]})})}return null}let d="expand"===a?eN.getText("pisell-reservation.hud-expand-aria"):eN.getText("pisell-reservation.hud-collapse-aria"),c=eN.getText("pisell-reservation.hud-table-drawer-title");return(0,ev.jsx)("div",{className:t_()("pisell-reservation-floor-map-hud","pisell-reservation-floor-map-hud--interactive-title-bar",n&&"pisell-reservation-floor-map-hud--embedded",s),role:"region","aria-label":c,children:(0,ev.jsxs)("div",{className:"pisell-reservation-floor-map-hud-title-bar-layout",children:[(0,ev.jsx)("span",{className:"pisell-reservation-floor-map-hud-heading",children:eN.getText(eQL)}),(0,ev.jsx)("div",{className:"pisell-reservation-floor-map-hud-title-bar-stats",children:(0,ev.jsx)(eQ$,{rows:o})}),(0,ev.jsx)("button",{type:"button",className:"pisell-reservation-floor-map-hud-chevron-btn","aria-expanded":"collapse"===a,"aria-label":d,onClick:e=>{e.stopPropagation(),i()},children:"expand"===a?(0,ev.jsx)(g0,{rotate:90}):(0,ev.jsx)(g0,{rotate:-90})})]})})}function eQB(e){let t=(0,ef.useMemo)(()=>eQO(e.items,e.dataSources),[e.items,e.dataSources]);if(e.interactive&&e.onRequestOpenTable){let l=!!e.tableDrawerOpen;return 0!==t.total||l?(0,ev.jsx)(eQF,{items:e.items,dataSources:e.dataSources,actionMode:l?"collapse":"expand",onAction:()=>{var t;return l?null==(t=e.onRequestCloseTable)?void 0:t.call(e):e.onRequestOpenTable()}}):null}if(0===t.total)return null;let l=eQR(t);return e.phoneLayout?(0,ev.jsx)("div",{className:t_()("pisell-reservation-floor-map-hud","pisell-reservation-floor-map-hud--phone-inline"),role:"status",children:(0,ev.jsx)("div",{className:"pisell-reservation-floor-map-hud-inline-stats",children:(0,ev.jsx)(eQ$,{rows:l})})}):(0,ev.jsx)("div",{className:"pisell-reservation-floor-map-hud",role:"status",children:(0,ev.jsx)("ul",{className:"pisell-reservation-floor-map-hud-list",children:l.map(e=>(0,ev.jsxs)("li",{className:"pisell-reservation-floor-map-hud-row",children:[(0,ev.jsx)("span",{className:"pisell-reservation-floor-map-hud-label",children:e.label}),(0,ev.jsx)("span",{className:"pisell-reservation-floor-map-hud-value",children:e.value})]},e.label))})})}function eQH(e){let{items:t,setItems:l}=e;return(0,ef.useEffect)(()=>{l(t)},[t,l]),null}function eQq(e){if("number"==typeof e&&Number.isFinite(e)){let t=Math.trunc(e);return t>0?String(t):null}if("string"==typeof e){let t=e.trim();if(!t||"0"===t)return null;let l=Number(t);if(Number.isFinite(l)&&l>0)return String(Math.trunc(l));if(/^\d+$/.test(t))return t}return null}function eQV(e){if(null==e||"string"!=typeof e)return"";let t=e.split(" ## ")[0];return(null==t?void 0:t.trim())??""}function eQY(e){let t=e.parent_id??e.parentId;if(null==t||""===t)return null;if("number"==typeof t&&Number.isFinite(t)){let e=Math.trunc(t);return e>0?String(e):null}return eQq(t)}function eQU(e,t){return e.keys.some(e=>t.has(e))}function eQW(e){let{value:t,onChange:l,buckets:a}=e,i=(0,ef.useMemo)(()=>new Set(Array.isArray(t)?t.map(String):[]),[t]),n=(0,ef.useCallback)(e=>{null==l||l(function(e,t){let l=new Set(t.map(String));if(eQU(e,l))for(let t of e.keys)l.delete(t);else for(let t of e.keys)l.add(t);return Array.from(l)}(e,Array.isArray(t)?t:[]))},[t,l]);return(0,ev.jsx)("div",{className:"reservation-bucket-button-group",children:a.map(e=>{let t=eQU(e,i);return(0,ev.jsxs)("button",{type:"button",title:e.label,className:t_()("reservation-bucket-button-group__item",{"reservation-bucket-button-group__item--checked":t}),onClick:()=>n(e),"aria-pressed":t,children:[(0,ev.jsx)("span",{className:"reservation-bucket-button-group__dot","aria-hidden":"true"}),(0,ev.jsx)("span",{className:"reservation-bucket-button-group__label",children:e.label})]},e.id)})})}function eQG(e){let t=(0,ef.useMemo)(()=>[{id:"on_site",label:eN.getText("pisell-reservation.booking-status-bucket-on-site"),keys:["arrived","started"]},{id:"no_show",label:eN.getText("pisell-reservation.booking-status-bucket-no-show"),keys:["no_show"]},{id:"completed",label:eN.getText("pisell-reservation.booking-status-bucket-completed"),keys:["completed"]}],[]);return(0,ev.jsx)(eQW,{value:e.value,onChange:e.onChange,buckets:t})}function eQQ(e){let t=(0,ef.useMemo)(()=>[{id:"unpaid",label:eN.getText("pisell-reservation.payment-status-bucket-unpaid"),keys:["unpaid","partially_paid","payment_processing"]},{id:"paid",label:eN.getText("pisell-reservation.payment-status-bucket-paid"),keys:["paid","partially_refunded","refunded"]}],[]);return(0,ev.jsx)(eQW,{value:e.value,onChange:e.onChange,buckets:t})}let eQK={style:{marginBottom:0}};function eQJ(){return(0,ev.jsxs)("div",{className:"reservation-hud-drawer-quick-filter-stack",children:[(0,ev.jsx)(ex.Form.Item,{name:"appointment_status",noStyle:!0,...eQK,children:(0,ev.jsx)(eQG,{})}),(0,ev.jsx)(ex.Form.Item,{name:"order_payment_status",noStyle:!0,...eQK,children:(0,ev.jsx)(eQQ,{})})]})}function eQZ(e){let t=e=>{if(!e)return!1;if(e.occupiedCardColor||e.availableCardColor)return!0;let t=e.statusToneOverrides;return null!=t&&Object.keys(t).length>0};return t(e.light)||t(e.dark)}function eQX(e){let t=new Set,l=[];for(let a of e){let e=String(a).trim();!e||t.has(e)||(t.add(e),l.push(e))}return l}function eQ0(e,t){let l={filterValuePatches:{}};if(!e)return l;try{let a=JSON.parse(e);if(Array.isArray(a))return{resourceIds:a.map(String),resourceWallResourceIdsInFile:!0,filterValuePatches:{}};if(!a||"object"!=typeof a)return l;let i=Object.prototype.hasOwnProperty.call(a,"resource_wall_resource_ids"),n=a.resource_wall_resource_ids,s=i?Array.isArray(n)?n.map(String):[]:void 0,r={},o=a.filter_values;if(o&&"object"==typeof o)for(let e of t)"resource_wall_resource_ids"!==e&&Object.prototype.hasOwnProperty.call(o,e)&&(r[e]=o[e]);let d=a.venueWallStatusToneOverrides,c=a.venueWallAppearanceTheme,u=c&&"object"==typeof c?c:void 0;!u&&d&&"object"==typeof d&&Object.keys(d).length>0&&(u={light:{statusToneOverrides:d},dark:{statusToneOverrides:d}});let p=a.venueWallAppearanceMode,m=function(e){if(null==e||"object"!=typeof e)return;let t=(e,t,l,a)=>{let i="number"==typeof e?e:Number(e);return Number.isFinite(i)?Math.max(t,Math.min(l,Math.round(i))):a},l="number"==typeof e.heroMaxWidthRatio?e.heroMaxWidthRatio:Number(e.heroMaxWidthRatio),a=Number.isFinite(l)?Math.max(.4,Math.min(.8,l)):lL.DEFAULT_RESOURCE_WALL_LAYOUT_PERSIST.heroMaxWidthRatio;return{layoutKey:"string"==typeof e.layoutKey&&e.layoutKey.length>0?e.layoutKey:lL.DEFAULT_RESOURCE_WALL_LAYOUT_PERSIST.layoutKey,customCols:t(e.customCols,1,6,lL.DEFAULT_RESOURCE_WALL_LAYOUT_PERSIST.customCols),customRows:t(e.customRows,1,6,lL.DEFAULT_RESOURCE_WALL_LAYOUT_PERSIST.customRows),pageDurationSec:t(e.pageDurationSec,3,60,lL.DEFAULT_RESOURCE_WALL_LAYOUT_PERSIST.pageDurationSec),boardingSoonBeforeMin:t(e.boardingSoonBeforeMin,1,60,lL.DEFAULT_RESOURCE_WALL_LAYOUT_PERSIST.boardingSoonBeforeMin),heroMaxWidthRatio:a}}(a.venueWallResourceLayout);return{resourceIds:s,resourceWallResourceIdsInFile:i,filterValuePatches:r,venueWallAppearanceTheme:u,venueWallAppearanceMode:"light"===p||"dark"===p?p:void 0,venueWallResourceLayout:m}}catch{return l}}let eQ2="transform 0.2s ease-out",eQ1=e=>{let{onClose:t,closeOffsetPx:l=80,drawerRef:a}=e,i=(0,ef.useRef)(null),n=(0,ef.useRef)(!1),s=(0,ef.useRef)(0),[r,o]=(0,ef.useState)(!1),d=(0,ef.useCallback)((e,t)=>{let l=null==a?void 0:a.current;if(!l)return;let i=e<0?0:e;l.style.transition=t?eQ2:"none",l.style.transform=0===i?"":`translateY(${i}px)`},[a]),c=(0,ef.useCallback)(()=>{let e=null==a?void 0:a.current;e&&(e.style.transition="",e.style.transform="")},[a]),u=(0,ef.useCallback)(e=>{0===e.button&&(i.current=e.clientY,n.current=!1,s.current=0,o(!0),e.currentTarget.setPointerCapture(e.pointerId))},[]),p=(0,ef.useCallback)(e=>{let t=i.current;if(null==t)return;let l=e.clientY-t;s.current=l,Math.abs(l)>4&&(n.current=!0),l>0?d(l,!1):d(0,!1)},[d]),m=(0,ef.useCallback)(e=>{let r=i.current;i.current=null,o(!1);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}if(null==r)return void c();let u=s.current;if(!n.current){c(),t();return}if(u>=l){let e=null==a?void 0:a.current;e?(e.style.transition=eQ2,e.style.transform="translateY(100%)",window.setTimeout(()=>{t()},200)):t();return}d(0,!0);let p=null==a?void 0:a.current;if(p){let e=()=>{p.style.transition="",p.removeEventListener("transitionend",e)};p.addEventListener("transitionend",e)}},[d,l,a,t,c]),g=(0,ef.useCallback)(e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t())},[t]);return(0,ev.jsx)("div",{className:"pisell-reservation-hud-drawer-handle"+(r?" pisell-reservation-hud-drawer-handle--dragging":""),role:"button",tabIndex:0,"aria-label":"Close drawer",onPointerDown:u,onPointerMove:p,onPointerUp:m,onPointerCancel:m,onKeyDown:g,children:(0,ev.jsx)("span",{className:"pisell-reservation-hud-drawer-handle-bar","aria-hidden":"true"})})};function eQ4(e){let{floorMapHudTableDrawer:t,showVenueHudDock:l,hudDrawerOpen:a,hudDrawerRef:i,hudMapItems:n,dataSources:s,handleOpenHudTableDrawer:r,closeHudTableDrawer:o,rowKey:d,hudDrawerPagedRows:c,hudDrawerLoading:u,hudDrawerFilteredTotal:p,hudDrawerBookingPagination:m,hudDrawerOnPageChange:g,hudDrawerLocalSearchParams:h,hudDrawerOnSearch:v,hudDrawerOnReset:f,hudDrawerGrid:y,hudDrawerToolBar:x,batchActionBar:b,hudDrawerResourceRootBuckets:_,handleHudDrawerFormRecordIdsChange:k}=e;return((0,ef.useLayoutEffect)(()=>{if("u"<typeof window)return;if(!a){let e=i.current;e&&(e.style.height="",e.style.maxHeight="");return}let e=i.current;if(!e)return;let t=function(e){let t=getComputedStyle(e).transform;if(!t||"none"===t)return 1;try{let e=new DOMMatrixReadOnly(t),l=Math.abs(e.a),a=Math.abs(e.d);if(!Number.isFinite(l)||!Number.isFinite(a)||Math.abs(l-a)>.03)return 1;return l>1e-6?l:1}catch{return 1}}(document.body);return t>0&&Math.abs(t-1)>.001?(e.style.height=`calc(98vh / ${t})`,e.style.maxHeight=`calc(98vh / ${t})`):(e.style.height="",e.style.maxHeight=""),()=>{let e=i.current;e&&(e.style.height="",e.style.maxHeight="")}},[a,i]),l)?(0,ev.jsxs)(ev.Fragment,{children:[a?null:(0,ev.jsx)("div",{className:"pisell-reservation-hud-title",role:"button",tabIndex:0,"aria-label":eN.getText(eWA),onClick:r,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),r())},children:(0,ev.jsx)(eQF,{items:n,dataSources:s,actionMode:"expand",onAction:r,embedded:!0,className:"pisell-reservation-hud-title-inner"})}),a?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("div",{className:"pisell-reservation-hud-drawer-mask",onClick:o,"aria-hidden":"true"}),(0,ev.jsxs)("div",{className:"pisell-reservation-hud-drawer",role:"dialog","aria-modal":"false","aria-label":eN.getText(eWA),ref:i,children:[(0,ev.jsx)(eQ1,{onClose:o,drawerRef:i}),(0,ev.jsx)("div",{className:"pisell-reservation-hud-drawer-record-board",children:(0,ev.jsxs)("div",{className:"pisell-reservation-hud-drawer-split",children:[(0,ev.jsx)("div",{className:"pisell-reservation-hud-drawer-split-main",children:(0,ev.jsx)(lL.PisellRecordBoard,{layoutVariant:"phone",columnVisibilityStorageKey:"pisell-reservation.hud-booking-drawer.columns.v2",rowKey:d,data:c,loading:u,total:p,pagination:m,onPageChange:g,searchParams:h,onSearch:v,onReset:f,grid:y,toolBar:x,batchActionBar:b,defaultBodyView:"grid",bodyViewSwitchable:!1,lockedBodyView:"grid",children:(0,ev.jsx)(lL.PisellRecordBoard.ShellFrame,{belowToolbar:void 0,children:(0,ev.jsx)(lL.PisellRecordBoard.GridLayout,{})})})}),null]})})]})]}):null]}):null}let eQ3={get:async()=>({data:{}}),post:async()=>({data:{}}),put:async()=>({data:{}}),remove:async()=>({data:{}}),custom:async()=>({data:{}})},eQ8=e=>{var t,l,a,i,n,s,r,o,d,c,u,p,m,g,h,v,f;let y,x,b,_,k,w,j,S,M,N,{gridDataSourceKey:C="tables",dataSources:T,scheduleValue:P,onScheduleChange:A,reservationBiz:D,associatedMenuListIds:I,toolBar:E,floorMap:z,scheduleStartSlot:L,scheduleEndSlot:O,onNewReservation:R,timeNavigatorProps:$,scheduleProps:F,fab:B,defaultBodyView:H,data:q,total:V,pagination:Y,onPageChange:U,onSearch:W,onReset:G,searchParams:Q,loading:K,rowKey:J="id",__id:Z,className:X,style:ee,floorPlanId:et,floorPlanCanvasWidth:el,floorPlanCanvasHeight:ea,floorPlanCode:ei,floorPlanName:en,floorPlanSort:es,floorPlanStatus:er,onFloorPlanPersisted:eo,putFloorPlan:ed,onFloorMapBookingClick:ec,bodyViewSwitchable:eu=!0,lockedBodyView:ep,bodyViewStorageKey:eg,floorMapHudTableDrawer:eh=!1,variant:eb,forceFollowWallClock:e_,resourceSelectMode:ek,...ew}=e,ej="phone"===eb,eS=null==q||Array.isArray(q)&&0===q.length&&void 0===V&&void 0===U,eM=null===et?null:void 0===et?1:et,eC=ik(),eT=null==eC||null==(l=eC.appHelper)||null==(t=l.utils)?void 0:t.request;z_.Em.setRequest(eT??eQ3);let eP=iw(),eA=(0,ef.useRef)(eP);eA.current=eP;let eD="function"==typeof(null==eP?void 0:eP.getModule),eI=(null==eC||null==(i=eC.engine)||null==(a=i.props)?void 0:a.locale)||"zh-CN",eE=null==eC||null==(r=eC.appHelper)||null==(s=r.utils)||null==(n=s.getApp)?void 0:n.call(s),ez=null==eE||null==(d=eE.router)||null==(o=d.getRoutes)?void 0:o.call(d),eL=null==eE||null==(u=eE.history)||null==(c=u.useParams)?void 0:c.call(u),eO=D??(null==eL?void 0:eL.business_code),eR=(0,ef.useMemo)(()=>{let e=null!=eO&&""!==eO?String(eO).trim():"";return e?{business_code:e}:{}},[eO]),{reservationRuleProduct:e$,reservationAssociatedMenuListIds:eF}=eCq(eC,eO),eB=I??eF,eq=eO||ei||"pisell_reservation",eV=(0,ef.useMemo)(()=>{let e=String(eI).toLowerCase();return e.startsWith("zh-cn")?"zh-cn":e.startsWith("zh-tw")||e.startsWith("zh-hk")?"zh-tw":"en"},[eI]),eY=(0,ef.useMemo)(()=>{try{var e,t,l,a,i,n,s,r;let o=null==eC||null==(s=eC.appHelper)||null==(n=s.utils)||null==(i=n.getApp)||null==(a=i.call(n))||null==(l=a.data)||null==(t=l.store)||null==(e=t.getStore)?void 0:e.call(t),d=null==o||null==(r=o.getDataByModel)?void 0:r.call(o,"core","core");return function(e){let t;if(null==e||"object"!=typeof e)return;null!=e.core&&"object"==typeof e.core&&(t=e.core.operating_day_boundary),null==t&&(t=e.operating_day_boundary);var l=t;if(null==l)return;if(!Array.isArray(l))return l;let a=e=>l.find(t=>null!=t&&"object"==typeof t&&String(t.type)===e);return a("start_time")??a("end_time")??l[0]}(d)}catch(e){return}},[eC]),eU=(0,ef.useMemo)(()=>{let e;return(e=eWR(eY))?{start:e,end:e}:{start:eWT.start,end:eWT.end}},[eY]),eW=(0,ef.useMemo)(()=>(null==$?void 0:$.range)??eU,[null==$?void 0:$.range,eU]);(0,ef.useEffect)(()=>{var e,t;let l=null==eC||null==(t=eC.appHelper)||null==(e=t.utils)?void 0:e.request;l&&z_.Em.setRequest(l)},[null==eC||null==(m=eC.appHelper)||null==(p=m.utils)?void 0:p.request]),eN.init(eWP,eI);let eG=(0,ef.useCallback)(()=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eWT;return eWU(em()().startOf("day"),e,t)})(eY,eW),[eY,eW]),eQ=(y=rP(i0(async()=>eCE({num:999})),{manual:!0}),(0,ef.useEffect)(()=>{eS&&y.run()},[eS,y.run]),x=(0,ef.useCallback)((e,t)=>{},[]),b=(0,ef.useCallback)(e=>{y.refresh()},[y]),_=(0,ef.useCallback)(()=>{y.refresh()},[y]),k=(0,ef.useCallback)(e=>{y.refresh()},[y]),w=(0,ef.useMemo)(()=>({}),[]),j=null==(h=y.data)?void 0:h.list,S=(0,ef.useMemo)(()=>Array.isArray(j)&&0!==j.length?j:eW$,[j]),M=(null==(v=y.data)?void 0:v.count)??0,N=(0,ef.useMemo)(()=>({pageNumber:1,pageSize:999}),[]),{data:S,loading:y.loading,total:M,pagination:N,onPageChange:x,searchParams:w,onSearch:b,onReset:_,refresh:y.refresh,refreshAsync:y.refreshAsync,patchSearchParams:k}),[eK,eJ]=(0,ef.useState)(()=>eGc(eg)),eZ=ep??eK,eX=eWW(eS&&"grid"===eZ,{listPageSize:20,getInitialSearchParams:eG,extraRequestParams:eR,subscribeRealtimePush:!0}),e0=(0,ef.useMemo)(()=>!!e_||"resourceWall"===ep||"resourceWall"===eK,[e_,ep,eK]),{baseFloorConfig:e2,floorPlanRemoteId:e1,setRemoteFloorPlanView:e4}=function(e){let{resolvedFloorPlanId:t,effectiveFloorPlanCode:l,gridDataSourceKey:a,floorMapConfigFromProp:i,engineLocale:n}=e,[s,r]=(0,ef.useState)(null),[o,d]=(0,ef.useState)(null),c=(0,ef.useRef)((0,eH.LP)("floor-plan-code"));(0,ef.useEffect)(()=>{if(null==t){r(null),d(null);return}r(null),d(null)},[t,l,a]);let u=(0,ef.useCallback)(e=>{var t,l;"number"==typeof e.id&&Number.isFinite(e.id)&&d(Math.trunc(e.id));let i=(0,lL.parseLayoutFieldToViewConfigPatch)(e.layout);i?r(i):Array.isArray(e.layout)&&e.layout.length>0&&r({sceneElements:(t=e.layout,l={canvasId:"main",dataSourceKey:a},(0,lL.shopLayoutToSceneElements)(t,{canvasId:l.canvasId,dataSourceKey:l.dataSourceKey,rectElementKind:eU4,circleElementKind:eU3}))})},[a]);return(0,lL.useShopFloorPlanSubscription)({enabled:null!=t,code:l,subscriberId:c.current,ensureByCode:eWo,unsubscribeQuery:eWr,onDetail:u,onLoadError:eWp}),{baseFloorConfig:(0,ef.useMemo)(()=>{var e,t,l;let a,n,r={canvases:[{id:eU7,name:eU0,order:0,enabled:!0},{id:eWt,name:eU2,order:1,enabled:!0},{id:"vip",name:eU1,order:2,enabled:!0}],canvasUi:{canCreate:!0,canEdit:!0},elementKindCategories:eU9(),elementKinds:eWe(),sceneElements:[]},o=i?{...r,...i,canvases:i.canvases??r.canvases,canvasUi:{...r.canvasUi,...i.canvasUi},elementKinds:eUZ(r.elementKinds??[],i.elementKinds),elementKindCategories:eUX(r.elementKindCategories??[],i.elementKindCategories),sceneElements:i.sceneElements??r.sceneElements,edges:i.edges??r.edges,datasourceComponents:i.datasourceComponents??r.datasourceComponents}:r;return null!=s&&(o=(0,lL.mergeFloorPlanViewRemote)(o,s)),a=null==(t=(e=o={...o,elementKinds:eUZ(r.elementKinds??[],o.elementKinds),elementKindCategories:eUX(r.elementKindCategories??[],o.elementKindCategories)}).elementKindCategories)?void 0:t.map(e=>"background"===e.id?{...e,label:eN.getText(eUY)}:"dining"===e.id?{...e,label:eN.getText(eUU)}:e),n=null==(l=e.elementKinds)?void 0:l.map(e=>e.value===lL.FLOOR_MAP_IMAGE_ELEMENT_KIND?{...e,label:eN.getText(eUq)}:e.value===lL.FLOOR_MAP_BUILTIN_SHAPE_ELEMENT_KIND?{...e,label:eN.getText(eUW)}:e.value===eU4?{...e,label:eN.getText(eUG)}:e.value===eU3?{...e,label:eN.getText(eUQ)}:e),{...e,elementKindCategories:a??e.elementKindCategories,elementKinds:n??e.elementKinds}},[i,s,n]),floorPlanRemoteId:o,setRemoteFloorPlanView:r}}({resolvedFloorPlanId:eM,effectiveFloorPlanCode:eq,gridDataSourceKey:C,floorMapConfigFromProp:null==z?void 0:z.floorMapConfig,engineLocale:eI}),e3=(0,ef.useMemo)(()=>{let e=null==z?void 0:z.floorMapConfig;if(!e)return e2;let t=e.sceneElements,l=Array.isArray(t)&&t.length>0;return{...e2,...e,sceneElements:l?t:e2.sceneElements??t}},[null==z?void 0:z.floorMapConfig,e2]),e8=(0,ef.useMemo)(()=>(function(e,t){if(!Array.isArray(e)||0===e.length)return eGt;let l=new Set,a=[];for(let i of e){let e=null==i?void 0:i.dataBinding;if(!e||!eGa(e.dataSourceKey,t))continue;let n=function(e){let t=e.trim();if(!t||"0"===t)return null;let l=Number(t);return Number.isFinite(l)&&l>0?Math.trunc(l):/^\d+$/.test(t)?Math.trunc(Number(t)):null}(String(e.recordId??""));null==n||l.has(n)||(l.add(n),a.push(n))}return a})(e3.sceneElements,C),[e3.sceneElements,C]),e6=(0,ef.useMemo)(()=>{if(!eS)return[];let e=eX.searchParams,t=null==e?void 0:e.filter;if(!t||"object"!=typeof t||null===t)return[];let l=t.values;if(!l||"object"!=typeof l)return[];let a=l[lL.DEFAULT_RESOURCE_WALL_FILTER_FIELD_KEY];return Array.isArray(a)?a.map(String).filter(Boolean):[]},[eS,eX.searchParams]),[e5,e7]=(0,ef.useState)(!1),e9=(0,ef.useCallback)(()=>{e7(!0)},[]),te=eS&&!eQ.loading&&"grid"!==eZ&&("calendar"!==eZ||e5),tt=(0,ef.useMemo)(()=>"resourceWall"===eK&&e6.length>0?{...eR,form_record_ids:(e=>{let t=[];for(let l of e){let e=String(l).trim();if(!e)continue;let a=Number(e);Number.isFinite(a)&&a>0&&/^\d+$/.test(e)?t.push(Math.trunc(a)):t.push(e)}return t})(e6),enable_remote_memory_cache:!0}:{...eR,form_record_ids:e8,enable_remote_memory_cache:!0},[eR,eK,e6,e8]),tl=eWW(te,{listPageSize:9999,extraRequestParams:tt,getInitialSearchParams:(0,ef.useCallback)(()=>eWU(em()(),eY,eW),[eY,eW])}),ta=rP(B$),ti=eWS((0,ef.useMemo)(()=>({relationTables:ta.data}),[ta.data])),tn=(0,ef.useMemo)(()=>({refresh:()=>{eQ.refresh(),eX.refresh(),tl.refresh()},refreshAsync:async()=>{await Promise.all([eQ.refreshAsync(),eX.refreshAsync(),tl.refreshAsync()])},currentPerspective:"monitor"}),[eQ.refresh,eQ.refreshAsync,eX.refresh,eX.refreshAsync,tl.refresh,tl.refreshAsync]),ts=(0,ef.useMemo)(()=>{let e=ti.getChildComponentProps;return e?e(tn):{}},[ti,tn]),tr=(0,ef.useMemo)(()=>eVL(Z),[Z]),{internalSchedule:to,setInternalSchedule:td,schedule:tc,debouncedSchedule:tu,flushCommittedSchedule:tp,queueCommittedSchedule:tm}=function(e){let{scheduleValueProp:t}=e,[l,a]=(0,ef.useState)(eGH),i=t??l,n=(0,ef.useRef)(i);n.current=i;let[s,r]=(0,ef.useState)(()=>t??eGH()),o=(0,ef.useRef)(null),d=(0,ef.useCallback)(e=>{null!=o.current&&(window.clearTimeout(o.current),o.current=null),r(e)},[]),c=(0,ef.useCallback)(e=>{null!=o.current&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=null,r(e)},300)},[]);(0,ef.useEffect)(()=>()=>{null!=o.current&&window.clearTimeout(o.current)},[]);let u=null!=i.at&&em()(i.at).isValid()?em()(i.at).valueOf():null,p=em()(i.date).startOf("day").valueOf();return(0,ef.useEffect)(()=>{void 0!==t&&c(n.current)},[u,p,t,c]),{internalSchedule:l,setInternalSchedule:a,schedule:i,debouncedSchedule:s,scheduleRef:n,flushCommittedSchedule:d,queueCommittedSchedule:c}}({scheduleValueProp:P}),tg=(0,ef.useMemo)(()=>{var e;let t,l=em()(tc.date).startOf("day").isSame(em()().startOf("day"),"day");return{...$??{},range:eW,snapToStep:!1,cursorMode:ej?"axis-moves":"cursor-moves",referenceDate:(null==$?void 0:$.referenceDate)??(l?void 0:(e=tc.date,t=em()(e).startOf("day"),"end_time"===String((null==eY?void 0:eY.type)??"")?t.subtract(1,"day"):t))}},[$,eW,tc.date,eY,ej]),{followWallClock:th,setFollowWallClock:tv,onFollowWallClockToggle:tf,onTimeNavigatorUserInteraction:ty}=function(e,t,l,a){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],[n,s]=(0,ef.useState)(!0),r=(0,ef.useRef)(a),o=(0,ef.useRef)(e);o.current=e;let d=void 0!==e,c=i||n;(0,ef.useEffect)(()=>{i&&s(!0)},[i]),(0,ef.useEffect)(()=>{r.current=a}),(0,ef.useEffect)(()=>{if(!c)return;let e=null,a=!1,i=()=>{var e;let a=em()().startOf("minute"),i={date:a.startOf("day"),at:a};void 0===o.current&&t(i),null==(e=r.current)||e.call(r,i),l(i)},n=()=>{if(!a){let t;e=window.setTimeout(()=>{a||(i(),n())},Math.max(0,(t=em()()).startOf("minute").add(1,"minute").diff(t)))}};return i(),n(),()=>{a=!0,null!=e&&window.clearTimeout(e)}},[c,l,d]);let u=(0,ef.useCallback)(e=>{i||s(e)},[i]);return{followWallClock:c,setFollowWallClock:u,onFollowWallClockToggle:(0,ef.useCallback)(()=>{i||s(e=>!e)},[i]),onTimeNavigatorUserInteraction:(0,ef.useCallback)(()=>{i||s(!1)},[i])}}(P,td,tp,A,e0),{salesResourceBookings:tx,salesTimelineHighlights:tb}=function(e){let{isInternalListData:t,pisellosRef:l,hasPisellosGetModule:a,debouncedSchedule:i,followWallClock:n,resourceBoardLoading:s,floorDayBookingLoading:r,floorDayBookingData:o,floorDayBookingDataVersion:d,scheduleDate:c,timeNavigatorPropsProp:u,timelineRange:p,operatingDayBoundary:m}=e,[g,h]=(0,ef.useState)(null),v=(0,ef.useRef)(0),f=(0,ef.useRef)(!1),y=(0,ef.useRef)(""),x=(null==i?void 0:i.at)!=null&&em()(i.at).isValid()?em()(i.at).valueOf():null,b=(0,ef.useMemo)(()=>{if(!Array.isArray(o)||0===o.length)return"__empty__";let e=5381,t=t=>{for(let l=0;l<t.length;l++)e=(e<<5)+e^t.charCodeAt(l);e=(e<<5)+e+31|0};for(let e=0;e<o.length;e++){let l=o[e];if(!l){t("null");continue}t(String(l.booking_id??l.id??l.bookingId??"")),t(String(l.status??"")),t(String(l.start_time??l.start_date??"")),t(String(l.end_time??l.end_date??""));let a=l.order;t(String((null==a?void 0:a.payment_status)??l.order_payment_status??""))}return`${o.length}:${e}`},[o]),_=(0,ef.useRef)(o);_.current=o,(0,ef.useEffect)(()=>{let e,o=l.current;if(!t||!(null==o?void 0:o.getModule))return void h(e=>null==e?e:null);if(!(null==i?void 0:i.at)||!em()(i.at).isValid()||s||r)return;let c=_.current;if(!Array.isArray(c))return;let u=`${x??"na"}|${b}|v${d}|${+!!a}|fw${+!!n}`;if(u!==y.current&&(y.current=u,f.current=!1),f.current)return;try{e=o.getModule("sales")}catch{h(e=>null==e?e:null);return}let p=null==e?void 0:e.getResourceBookingList;if("function"!=typeof p)return void h(e=>null==e?e:null);let m=++v.current,g="YYYY-MM-DD HH:mm",k=em()(i.at).format(g),w=n?k:em()().format(g),j=e=>{v.current!==m||(h(function(e){if(null==e)return[];if(Array.isArray(e))return e;if("object"==typeof e){if(Array.isArray(e.list))return e.list;if(Array.isArray(e.data))return e.data;if(Array.isArray(e.records))return e.records}return[]}(e)),f.current=!1)},S=()=>{v.current===m&&h(e=>null==e?e:null)};try{let t=p.call(e,k,c,w);null!=t&&"function"==typeof t.then?t.then(j).catch(e=>{f.current=!0,S()}):j(t)}catch(e){f.current=!0,S()}},[t,a,s,r,b,d,x,n,l]);let[k,w]=(0,ef.useState)(null),j=(0,ef.useRef)(0),S=(0,ef.useRef)(!1),M=em()(c).startOf("day").valueOf();return(0,ef.useEffect)(()=>{t||w(null)},[t]),(0,ef.useEffect)(()=>{let e;if(!t)return;let a=l.current;if(!(null==a?void 0:a.getModule)||s||r)return;let i=_.current;if(!Array.isArray(i))return;try{e=a.getModule("sales")}catch{return}let n=null==e?void 0:e.getTimelineHighlights;if("function"!=typeof n){w(null),S.current||(S.current=!0,console.warn("[PisellReservation] sales.getTimelineHighlights 未注册或非函数;时间轴密度退回本地计算"));return}let o=++j.current,{startStr:d,endStr:u}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eWT,l=arguments.length>2?arguments[2]:void 0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:em()(),[i,n]=eWq(e,l,t,a);return{startStr:i.format(eGq),endStr:n.format(eGq)}}(c,p,m,em()()),g=e=>{j.current!==o||w(function(e){let t;if(Array.isArray(e))t=e;else if(null==e||"object"!=typeof e)return null;else if(Symbol.iterator in e)try{t=Array.from(e)}catch{return null}else{let l=Object.keys(e).filter(e=>/^\d+$/.test(e)).sort((e,t)=>Number(e)-Number(t));if(0===l.length)return null;t=l.map(t=>e[t])}let l=t.map(e=>{let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?Math.max(0,Math.round(t)):0});return l.length>0?l:null}(e))};try{let t=n.call(e,i,d,u);null!=t&&"function"==typeof t.then?t.then(g).catch(e=>{}):g(t)}catch(e){}},[t,a,s,r,b,M,x,p.start,p.end,l,m]),{salesResourceBookings:g,salesTimelineHighlights:k}}({isInternalListData:eS,pisellosRef:eA,hasPisellosGetModule:eD,debouncedSchedule:tu,followWallClock:th,resourceBoardLoading:eQ.loading,floorDayBookingLoading:tl.loading,floorDayBookingData:tl.data,floorDayBookingDataVersion:tl.pushDataVersion,scheduleDate:tc.date,timeNavigatorPropsProp:$,timelineRange:eW,operatingDayBoundary:eY}),tk=(0,ef.useMemo)(()=>(function(e){let{dataSourcesProp:t,gridDataSourceKey:l,isInternalListData:a,resourceList:i,floorDayBookingList:n,schedule:s,dataProp:r,salesResourceBookings:o}=e,d=null==t?void 0:t[l];if(Array.isArray(d)&&d.length>0)return d;if(a)return null!=o&&function(e){if(!Array.isArray(e)||0===e.length)return!1;let t=e[0];return!!t&&"object"==typeof t&&!!Array.isArray(t.bookings)&&(null==t.schedule_event_id||null!=t.form_record_id||null!=t.resource_id||"string"==typeof t.main_field)&&(null!=t.form_record_id||null!=t.resource_id||"string"==typeof t.main_field||null!=t.id&&null==t.schedule_event_id)}(o)?function(e){let t=[];for(let l of e){let e;if(!l||"object"!=typeof l)continue;let a=function(e){let t=e.form_record_id??e.resource_id??e.id;if(null==t)return null;let l=e.form_id,a=e.capacity;return{id:"number"==typeof t||"string"==typeof t?t:String(t),form_id:"number"==typeof l?l:null!=l&&""!==l?Number(l):void 0,main_field:"string"==typeof e.main_field?e.main_field:void 0,form_code:"string"==typeof e.form_code?e.form_code:void 0,capacity:"number"==typeof a?a:null!=a&&""!==String(a).trim()?Number(a):void 0}}(l);if(!a)continue;let i=eW7(a);if(!i)continue;let n=Array.isArray(l.bookings)?l.bookings:[],s=eGe(l.bookingCount),r=eGe(l.compeleteBookingCount)??eGe(l.completeBookingCount),o=function(e,t){if(!Array.isArray(t))return null;let l=t.filter(e=>!!e&&"object"==typeof e&&!(eWG(e)||eWJ(e)));return 0===l.length?null:eW6(e,l)}(i.id,n);e=o?function(e,t){if(!t.length)return e;let l=t[0],a={...e,...eW3(l)},i=l.order;return"paid"===(null==i?void 0:i.payment_status)&&(a.isPaid=!0),"late"!==a.hostReservedStatus&&"late"===String(l.reserved_status)&&"reserved"!==String(l.status)&&(a.hostReservedStatus="late",null==a.lateMinutes&&(a.lateMinutes=1)),a}(eW9([i],[o])[0],n):function(e,t){let l=String(t.status??"");return"locked"===l?{...e,cardStatus:"maintenance"}:"empty"===l?{...e,cardStatus:"available",hostReservedStatus:void 0,hostIsTimeout:void 0}:"occupied"===l?{...e,cardStatus:"occupied",hostIsTimeout:!0===t.isTimeout||void 0,hostReservedStatus:void 0}:"reserved"===l?{...e,cardStatus:"booked",hostIsTimeout:void 0,...eW3(t)}:e}(i,l),null!=s&&(e.bookingCount=s),null!=r&&(e.completeBookingCount=r),t.push(e)}return t}(o):eW9(function(e){if(!Array.isArray(e)||0===e.length)return[];let t=[];for(let l of e){let e=eW7(l);e&&t.push(e)}return t}(i),eW5(null!=o?o:n));return eW5(r??[])})({dataSourcesProp:T,gridDataSourceKey:C,isInternalListData:eS,resourceList:eQ.data,floorDayBookingList:tl.data,schedule:tc,dataProp:q,salesResourceBookings:tx}),[T,C,eS,eQ.data,tl.data,tx,q]),tw=(0,ef.useMemo)(()=>{let e=function(e,t){if(!Array.isArray(e)||0===e.length)return eGl;let l=new Set,a=[];for(let i of e){let e=null==i?void 0:i.dataBinding;if(!e||!eGa(e.dataSourceKey,t))continue;let n=String(e.recordId??"").trim();n&&"0"!==n&&(l.has(n)||(l.add(n),a.push(n)))}return a}(e3.sceneElements,C);if(e.length>0)return e;let t=[...new Set(tk.map(e=>String(e.id)).filter(e=>""!==e&&"undefined"!==e&&"null"!==e))];if(t.length>0)return t;let l=new Set,a=tl.data;if(Array.isArray(a)){for(let e of a)if(e&&"object"==typeof e)for(let t of eWK(e))t&&l.add(t)}return[...l]},[e3.sceneElements,C,tk,tl.data]),tj=(0,ef.useMemo)(()=>new Set(tw),[tw]),tS=(0,ef.useMemo)(()=>(function(e){let{orderedResourceIds:t,tables:l}=e,a=new Map(l.map(e=>[String(e.id),e]));return t.map(e=>{let t=a.get(e);return{id:e,name:(null==t?void 0:t.code)||(null==t?void 0:t.main_field)||e,groupType:null==t?void 0:t.area,form_id:e}})})({orderedResourceIds:tw,tables:tk}),[tw,tk]),tM=(0,ef.useMemo)(()=>(function(e){let{bookings:t,canvasResourceIdSet:l}=e;if(!Array.isArray(t))return[];let a=l.size>0,i=[],n=0;for(let e of t){if(!e||"object"!=typeof e||function(e){let t=e.metadata;if((null==t?void 0:t.multiple_resource_flag)!==1)return!1;let l=e.product_uid;if(null!=l&&""!==String(l))return!1;let a=e.resources;return!Array.isArray(a)||0===a.length}(e))continue;let t=eWK(e).filter(e=>a?l.has(e):!!e);if(0===t.length)continue;let s=function(e){let t=e.start_at||(e.start_date&&e.start_time?`${e.start_date} ${e.start_time}`:"");if(!t)return null;let l=em()(t);return l.isValid()?l:null}(e);if(!s)continue;let r=function(e,t){let l=function(e){let t=e.end_at||(e.end_date&&e.end_time?`${e.end_date} ${e.end_time}`:"");if(!t)return null;let l=em()(t);return l.isValid()?l:null}(e);if(l)return l;let a=String(e.status??e.booking_status??e.order_status??"").trim().toLowerCase();return"occupied"===a||"locked"===a?t.endOf("day"):t.add(2,"hour")}(e,s);if(!r.isAfter(s))continue;let o=eWX(e)||String(e.relation_form_name??e.booking_id??"Booking"),d=e.phone??e.mobile??e.customer_phone,c="string"==typeof d?d:void 0,u=function(e){let t=String(e.status??e.booking_status??e.order_status??"").trim().toLowerCase();return"locked"===t?"block":"occupied"===t?"checked_in":"reserved"===t?"late"===String(e.reserved_status??"")?"late":"new":void 0}(e),p=String(e.booking_id??e.id??`bk_${n++}`),m="locked"===String(e.status??e.booking_status??e.order_status??"").trim().toLowerCase()?"block":"booking",g=s.startOf("day"),h=eGi(s,g),v=r.startOf("day"),f=0===r.hour()&&0===r.minute()&&0===r.second(),y=f?v.subtract(1,"day"):v,x=f?24:eGi(r,y),b=g.format("YYYY-MM-DD"),_=y.format("YYYY-MM-DD");for(let l of t)i.push({id:`${p}_${l}`,courtId:l,date:b,startHour:h,endDate:_===b?void 0:_,endHour:x,name:o,kind:m,phone:c,statusTag:u,raw:e})}let s=new Set,r=[];for(let e of i)s.has(e.id)||(s.add(e.id),r.push(e));return r})({bookings:tl.data,canvasResourceIdSet:tj}),[tl.data,tj]),tN=(0,ef.useMemo)(()=>tk.map(eGB),[tk]),tC=(0,ef.useMemo)(()=>`${em()(tu.date).startOf("day").valueOf()}_${em()(tu.at).valueOf()}`,[tu.date,tu.at]),tT=(0,ef.useRef)(eGc(eg)),tP=(0,ef.useRef)(null),tA=(0,ef.useRef)(null),tD=(0,ef.useRef)(Q);(0,ef.useEffect)(()=>{tD.current=Q},[Q]);let tI=(0,ef.useRef)(W),tE=(0,ef.useRef)(A);(0,ef.useEffect)(()=>{tI.current=W,tE.current=A}),(0,ef.useEffect)(()=>{if(eS&&"calendar"!==tT.current){let e=tu.date;tl.patchSearchParams(t=>eGo(t,e,eY,eW,em()()))}if(("floorMap"===tT.current||"calendar"===tT.current||"resourceWall"===tT.current)&&!eS){var e;null==(e=tI.current)||e.call(tI,{...tD.current??{},reservationDate:tu.date.toISOString(),reservationAt:tu.at.toISOString()})}},[tu,eS,tl.patchSearchParams,eY,eW]);let tz=(0,ef.useCallback)(e=>{e0||tv(!1),void 0===P&&td(e),null==A||A(e),tm(e)},[P,A,tv,tm,e0]),tL=(0,ef.useMemo)(()=>({...T,[C]:tk}),[C,tk,T]),tO=(null==z?void 0:z.mode)!==void 0,[tR,t$]=(0,ef.useState)(!1),tF=(null==z?void 0:z.mode)??(tR?"edit":"read"),{showVenueHudDock:tB,handleOpenHudTableDrawer:tH,closeHudTableDrawer:tq,hudDrawerRef:tV,hudDrawerOpen:tY,hudMapItems:tU,hudDrawerResourceRootBuckets:tW,hudDrawerPagedRows:tG,hudDrawerFilteredTotal:tQ,hudDrawerLoading:tK,hudDrawerBookingPagination:tJ,hudDrawerOnSearch:tZ,hudDrawerOnReset:tX,hudDrawerOnPageChange:t0,hudDrawerToolBar:t2,hudDrawerLocalSearchParams:t1,handleHudDrawerFormRecordIdsChange:t4,reservationFloorMapViewportOverlay:t3,renderItemByKind:t8}=function(e){let{floorMapHudTableDrawer:t,dataSources:l,gridDataSourceKey:a,isInternalListData:i,floorDayBookingData:n,searchParamsProp:s,dataProp:r,loadingProp:o,bookingChildProps:d,resourceBoardData:c,phoneLayout:u,hideViewportHudStats:p=!1}=e,m=(0,ef.useRef)([]),[g,h]=(0,ef.useState)([]),[v,f]=(0,ef.useState)(!1),y=(0,ef.useRef)(null),[x,b]=(0,ef.useState)(null),[_,k]=(0,ef.useState)({}),w=(0,ef.useRef)({}),[j,S]=(0,ef.useState)({pageNumber:1,pageSize:20}),M=(0,ef.useMemo)(()=>t&&(v||eQO(g,l).total>0),[t,v,g,l]),N=(0,ef.useCallback)(()=>{let e=new Set((function(e,t,l){let a=t??{},i=a[l]??[],n=new Set;for(let t of e){if(!function(e){let t=e.elementKind;return!!t&&t!==lL.FLOOR_MAP_IMAGE_ELEMENT_KIND&&t!==lL.FLOOR_MAP_STAGE_ELEMENT_KIND}(t))continue;let e=eGG(t,a);(null==e?void 0:e.id)!=null&&n.add(String(e.id))}return i.filter(e=>n.has(String(e.id)))})(m.current,l,a).map(e=>String(e.id)).filter(Boolean)),t=eQT(i?n.searchParams:s??{});!function(e){let t=e.filter;if("object"!=typeof t||null===t||Array.isArray(t))return;let l=t.values;if("object"!=typeof l||null===l||Array.isArray(l))return;let a={...l};delete a.booking_time_start_between,e.filter={...t,values:a}}(t),function(e){let t=e.filter;if("object"!=typeof t||null===t||Array.isArray(t))return;let l=t.values;if("object"!=typeof l||null===l||Array.isArray(l))return;let a={...l};a.appointment_status=[],a.order_payment_status=[],a.form_record_ids=[],e.filter={...t,values:a}}(t),w.current=t,k(t),b(e),S({pageNumber:1,pageSize:20}),f(!0)},[l,a,i,n.searchParams,s]),C=(0,ef.useCallback)(()=>{f(!1),b(null),k({}),S({pageNumber:1,pageSize:20})},[]);(0,ef.useEffect)(()=>{if(!t||!v)return;let e=e=>{"Escape"===e.key&&C()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,v,C]);let T=(0,ef.useMemo)(()=>(function(e){if(!Array.isArray(e)||0===e.length)return[];let t=e.filter(e=>null!=e&&"object"==typeof e&&!Array.isArray(e)),l=function(e){let t=new Set;for(let l of e){let e=eQq(l.id);e&&t.add(e)}let l=new Map;for(let a of e){let e=eQq(a.id);if(!e)continue;let i=eQY(a);i&&t.has(i)&&(l.has(i)||l.set(i,[]),l.get(i).push(e))}let a=[],i=new Set;for(let l of e){let e=eQq(l.id);if(!e||i.has(e))continue;let n=eQY(l);n&&t.has(n)||(a.push(l),i.add(e))}a.sort((e,t)=>("number"==typeof e.sort&&Number.isFinite(e.sort)?e.sort:0)-("number"==typeof t.sort&&Number.isFinite(t.sort)?t.sort:0));let n=[];for(let e of a){let t=eQq(e.id);if(!t)continue;let a=eQV(e.main_field),i="string"==typeof e.form_code&&""!==e.form_code.trim()?String(e.form_code).trim():"",s=(a||i||t).trim(),r=function(e){let t=[],a=[e];for(;a.length;){let e=a.pop();t.push(e);let i=l.get(e);if(null==i?void 0:i.length)for(let e of i)a.push(e)}return t}(t);n.push({id:`resourceRoot:${t}`,label:s,keys:r})}return n}(t);if(l.length<=20)return l;let a=new Map;for(let e of t){if(!eQq(e.id))continue;let t=function(e){let t=e.form_id??e.formId;if("number"==typeof t&&Number.isFinite(t)){let e=Math.trunc(t);return e>0?String(e):null}if("string"==typeof t){let e=t.trim();if(!e||"0"===e)return null;let l=Number(e);if(Number.isFinite(l)&&l>0)return String(Math.trunc(l));if(/^\d+$/.test(e))return e}return null}(e)??"__nof__";a.has(t)||a.set(t,[]),a.get(t).push(e)}let i=[...a.entries()].map(e=>{let[t,l]=e,a=1/0;for(let e of l){let t="number"==typeof e.sort&&Number.isFinite(e.sort)?e.sort:1/0;t<a&&(a=t)}Number.isFinite(a)||(a=0);let i=function(e){let t=new Set;for(let l of e){let e="string"==typeof l.form_code?l.form_code.trim():"";e&&t.add(e)}if(t.size>=1)return[...t].sort((e,t)=>e.localeCompare(t))[0]??"Resource";let l="";for(let t of e){let e=eQV(t.main_field);e&&(!l||e.length<l.length)&&(l=e)}return l||"Other"}(l),n=new Set;for(let e of l){let t=eQq(e.id);t&&n.add(t)}return{sortKey:a,bucket:{id:`resourceForm:${t}`,label:i,keys:[...n]}}});return i.sort((e,t)=>e.sortKey-t.sortKey),i.map(e=>e.bucket)})(c.data),[c.data]),P=(0,ef.useMemo)(()=>{var e,l;let a,s,o,d,c;return t&&v&&x&&0!==x.size?(e=i?n.data:r??[],l=Array.isArray(e)&&0!==x.size?e.filter(e=>eWK(e).some(e=>x.has(e))):[],a=l,"string"==typeof(s=_.keyword)&&s.trim()&&(a=a.filter(e=>(function(e,t){let l=t.trim().toLowerCase();if(!l)return!0;let a=[],i=e=>{if(null==e)return;let t=String(e).toLowerCase().trim();t&&a.push(t)};i(e.id),i(e.booking_id);let n=e.order;if(n){i(n.shop_full_order_number),i(n.note);let e=n.customer;e&&(i(e.name),i(e.first_name),i(e.last_name),i(e.company_name));let t=n.contacts_info;t&&(i(t.first_name),i(t.last_name),i(t.phone),i(t.email))}return i(e.notes),a.some(e=>e.includes(l))})(e,s))),Object.keys(d=(o=_.filter)&&"object"==typeof o&&null!==o&&"object"==typeof o.values&&null!==o.values&&!Array.isArray(o.values)?o.values:{}).length>0&&(a=a.filter(e=>(function(e,t){var l;let a=t.order_payment_status;if(Array.isArray(a)&&a.length>0){let t,l,i="partially_paid"===(l=String((null==(t=e.order)?void 0:t.payment_status)??e.payment_status??"").trim().toLowerCase())?"unpaid":l,n=new Set(a.map(e=>String(e).toLowerCase()));if(""===i||!n.has(i))return!1}let i=t.appointment_status;if(Array.isArray(i)&&i.length>0&&!eQI(e.appointment_status,i))return!1;let n=t.order_status;if(Array.isArray(n)&&n.length>0){let t=e.order;if(!eQI((null==t?void 0:t.order_status)??(null==t?void 0:t.status),n))return!1}let s=t.order_sales_channel;if(Array.isArray(s)&&s.length>0){let t=e.order;if(!eQI(null==t?void 0:t.order_sales_channel,s))return!1}let r=t.payment_method;if(Array.isArray(r)&&r.length>0){let t=e.order;if(!eQI((null==t?void 0:t.payment_method)??(null==t?void 0:t.pay_method)??(null==t?void 0:t.payment_methods),r))return!1}let o=t.customer_id;if(Array.isArray(o)&&o.length>0){let t=e.order,a=(null==t?void 0:t.customer_id)??(null==t||null==(l=t.customer)?void 0:l.id);if(null==a||!o.map(String).includes(String(a)))return!1}let d=t.form_record_ids;if(Array.isArray(d)&&d.length>0){let t=new Set(d.map(e=>String(e)));if(!eWK(e).some(e=>t.has(e)))return!1}let c=t.number_between;if(null!=c&&"object"==typeof c){let t="number"==typeof e.number&&Number.isFinite(e.number)?e.number:Number(e.number);if(!eQE(Number.isFinite(t)?t:NaN,c))return!1}let u=e.order,p=null==u?void 0:u.summary,m=t.total_amount_between;if(null!=m&&"object"==typeof m){let t=eQz(null==p?void 0:p.total_amount)??eQz(null==u?void 0:u.total_amount)??eQz(e.amount??e.total);if(null==t||!eQE(t,m))return!1}let g=eQD(t.created_at_between);if(g){let t=eQA(e);if(0===t)return!1;let[l,a]=g;if(t<l||t>a)return!1}let h=e.updated_at,v=eQD(t.updated_at_between);if(v){let e="string"==typeof h&&h?em()(h).valueOf():0;if(!e)return!1;let[t,l]=v;if(e<t||e>l)return!1}let f=eQD(t.booking_time_start_between);if(f){let[t,l]=f,a=eQP(e);if(0===a||a<t||a>l)return!1}return!0})(e,d))),"string"==typeof(c=_.sort)&&c&&(a=function(e,t){if(!t||!String(t).includes(":"))return e;let[l,a]=String(t).split(":"),i="desc"===a,n=[...e],s=e=>{switch(l){case"start_at":case"after_execution_time":return eQP(e);case"end_at":var t=e;let a=t.end_at;if("string"==typeof a&&a){let e=em()(a);if(e.isValid())return e.valueOf()}let i=eWx(t.end_date,t.end_time);if(i){let e=em()(i);if(e.isValid())return e.valueOf()}return 0;case"created_at":return eQA(e);default:return 0}};return n.sort((e,t)=>{let l=s(e),a=s(t);return l===a?0:i?a-l:l-a}),n}(a,c)),a):[]},[t,v,x,i,n.data,r,_]),A=P.length,D=Math.max(1,Math.ceil(A/j.pageSize)||1);(0,ef.useEffect)(()=>{j.pageNumber<=D||S(e=>({...e,pageNumber:D}))},[D,j.pageNumber]);let I=(0,ef.useMemo)(()=>{let{pageNumber:e,pageSize:t}=j,l=Math.max(1,t),a=Math.min(P.length,e*l);return P.slice(0,a)},[P,j]),E=(0,ef.useMemo)(()=>{var e;let t,l,a,i,n=d.toolBar;return l="string"==typeof(t=eQM({baseToolBar:(e={baseToolBar:null==n||"object"!=typeof n||Array.isArray(n)?{}:n,searchGetContainer:()=>y.current??document.body,quickFilterComponent:eQJ}).baseToolBar,searchGetContainer:e.searchGetContainer,quickFilterFilterList:[{type:"custom",key:"hudQuickFiltersRow",other:{component:e.quickFilterComponent,compositeFilterFieldNames:["appointment_status","order_payment_status"],formItemProps:{style:{marginBottom:0}}}}]})).className?t.className:void 0,i=(a="object"==typeof t.search&&null!==t.search?t.search:void 0)&&"object"==typeof a.modalStyle&&null!==a.modalStyle&&!Array.isArray(a.modalStyle)?a.modalStyle:{},{...t,mergeCompactNarrowTrailingWithQuickFilterRow:!0,search:e.searchGetContainer&&a?{...a,modalWidth:"100%",modalStyle:{...i,marginLeft:0,marginRight:0,width:"100%",maxWidth:"100%"}}:t.search,className:t_()(l,"pisell-reservation-hud-table-toolbar")}},[d.toolBar]),z=i?n.loading:o??!1,L=(0,ef.useMemo)(()=>({pageNumber:j.pageNumber,pageSize:j.pageSize}),[j.pageNumber,j.pageSize]),O=(0,ef.useCallback)(e=>{S(e=>({...e,pageNumber:1})),k(t=>(function(e,t){let l={...e,...t},a="object"==typeof e.filter&&null!==e.filter?e.filter:{};if("object"==typeof t.filter&&null!==t.filter&&!Array.isArray(t.filter)){let e=t.filter,i="object"!=typeof a.values||null===a.values||Array.isArray(a.values)?{}:a.values,n="object"!=typeof e.values||null===e.values||Array.isArray(e.values)?void 0:e.values;l.filter={...a,...e,values:null!=n?{...i,...n}:i}}return eGr(l)})(t,e))},[]),R=(0,ef.useCallback)(e=>{O({filter:{values:{form_record_ids:e}}})},[O]),$=(0,ef.useCallback)(()=>{S(e=>({...e,pageNumber:1})),k(eQT(w.current))},[]),F=(0,ef.useCallback)((e,t)=>{S({pageNumber:e,pageSize:t})},[]),B=(0,ef.useMemo)(()=>{let e;return e=(e,t,a)=>(function(e,t,l){var a;let i=eGG(e,t),n=e.elementKind===eU3||"circle"===e.shape?"circle":"rect";if(!i){let l=function(e,t){let l,a=e._sceneElement,i=eN.getText(eGW),n=(null==a?void 0:a.name)!=null?String(a.name).trim():"";switch((0,lL.getFloorMapBindingPlaceholderReason)(e,t)){case"missing_data_source_key":l=eN.getText("pisell-reservation.card-placeholder.hint-bind-datasource");break;case"missing_record_id":l=eN.getText("pisell-reservation.card-placeholder.hint-select-row");break;case"new_unsaved_slot":l=eN.getText("pisell-reservation.card-placeholder.hint-new-slot");break;default:l=eN.getText("pisell-reservation.card-placeholder.hint-row-not-found")}return{title:n||i,hint:l,shape:e.elementKind===eU3||"circle"===e.shape?"circle":"rect"}}(e,t);return(0,ev.jsx)(eGQ,{title:l.title,hint:l.hint,shape:l.shape})}let s=eYb(i,(null==(a=e._sceneElement)?void 0:a.name)!=null?String(e._sceneElement.name).trim():void 0),r=(0,lL.resolveSceneElementDisplayTitle)({sceneElement:e._sceneElement,recordTitle:s,fallback:i.code||eN.getText(eGW)}),o=eYU(i,r),d=null!=i.bookingCount&&i.bookingCount>0?{...o,bookingCount:i.bookingCount,completeBookingCount:i.completeBookingCount??0}:o,c=null!=e.height&&Number.isFinite(e.height)&&e.height>0?e.height:e.width;return(0,ev.jsx)(eGU,{data:d,shellShape:n,hideHeaderCapacity:!0,elementLayoutHeightPx:null!=c&&Number.isFinite(c)&&c>0&&"circle"===n?c:void 0,viewportScale:null==l?void 0:l.viewportScale})})(e,l,a),{[lL.FLOOR_MAP_IMAGE_ELEMENT_KIND]:(e,t,l)=>(0,lL.renderFloorMapFallbackPlaceholder)(e),[lL.FLOOR_MAP_BUILTIN_SHAPE_ELEMENT_KIND]:(e,t,l)=>(0,lL.renderFloorMapFallbackPlaceholder)(e),[eU4]:e,[eU3]:e,reservationTable:e,reservationPartyBench:e,reservationBarSeat:e}},[l]),H=(0,ef.useCallback)(e=>{let l=e.items;return(m.current=l,t)?(0,ev.jsx)(eQH,{items:l,setItems:h}):p?null:(0,ev.jsx)(eQB,{items:l,dataSources:e.dataSources,interactive:!1,phoneLayout:u})},[t,u,p]);return{hudItemsRef:m,hudMapItems:g,setHudMapItems:h,hudDrawerRef:y,hudDrawerOpen:v,showVenueHudDock:M,handleOpenHudTableDrawer:N,closeHudTableDrawer:C,hudDrawerResourceRootBuckets:T,hudDrawerPagedRows:I,hudDrawerFilteredTotal:A,hudDrawerLoading:z,hudDrawerBookingPagination:L,hudDrawerOnSearch:O,hudDrawerOnReset:$,hudDrawerOnPageChange:F,hudDrawerToolBar:E,hudDrawerLocalSearchParams:_,handleHudDrawerFormRecordIdsChange:R,reservationFloorMapViewportOverlay:H,renderItemByKind:B}}({floorMapHudTableDrawer:eh,dataSources:tL,gridDataSourceKey:C,isInternalListData:eS,floorDayBookingData:tl,searchParamsProp:Q,dataProp:q,loadingProp:K,bookingChildProps:ts,resourceBoardData:eQ,phoneLayout:ej,hideViewportHudStats:ej&&"edit"===tF}),[t6,t5]=(0,ef.useState)(()=>eGp(eq));(0,ef.useEffect)(()=>{t5(eGp(eq))},[eq]);let t7=(0,ef.useCallback)(()=>{t5(e=>{let t="light"===e?"dark":"light";if("u">typeof window)try{localStorage.setItem(eGu(eq),t)}catch{}return t})},[eq]),{bookingDetailOpen:t9,bookingDetailRaw:le,bookingDetailRow:lt,bookingDetailSceneName:ll,bookingDetailSingleMode:la,closeBookingDetailModal:li,closeBookingDetailNow:ln,floorMapItemClickBefore:ls,openBookingDetailFromRaw:lr,readModeSelectedFloorItemId:lo}=function(e){let{engineCtx:t,onFloorMapBookingClick:l,dataSources:a,mergedTableRows:i,reservationBiz:n,resourceSelectMode:s,associatedMenuListIds:r,reservationRuleProduct:o}=e,[d,c]=(0,ef.useState)(!1),[u,p]=(0,ef.useState)(null),[m,g]=(0,ef.useState)(null),[h,v]=(0,ef.useState)(null),[f,y]=(0,ef.useState)(void 0),[x,b]=(0,ef.useState)(!1),_=(0,ef.useRef)(m);_.current=m;let k=(0,ef.useRef)(""),w=(0,ef.useRef)("");(0,ef.useEffect)(()=>{if(!d){k.current="",p(null);return}let e=_.current;if(!e)return;let t=w.current;if(!t)return;let l=i.find(e=>String(e.id??"").trim()===t);if(!l)return;let a=function(e,t){let l=String(e.booking_id??e.booking_uid??e.id??"").trim();if(!l)return;let a=t.floorMapSourceBookings;if(Array.isArray(a))for(let e of a){if(!e||"object"!=typeof e)continue;let t=String(e.id??"").trim(),a=String(e.booking_id??"").trim(),i=String(e.booking_uid??"").trim();if(t===l||a===l||i===l)return e}}(e,l),n=`${eGJ(l)}#${a?eGK(a):"gone"}`;n!==k.current&&(k.current=n,l.id,l.code,String(l.main_field??""),l.bookingCount,l.completeBookingCount,Array.isArray(l.floorMapSourceBookings)&&l.floorMapSourceBookings.length,v(l),a&&g(a))},[d,i]);let j=(0,ef.useCallback)(()=>{c(!1),g(null),v(null),y(void 0),b(!1),w.current=""},[]),S=(0,ef.useCallback)(e=>{var t,l;null==e||e.stopPropagation(),null==e||null==(l=e.nativeEvent)||null==(t=l.stopImmediatePropagation)||t.call(l),window.setTimeout(()=>{j()},50)},[j]),M=(0,ef.useCallback)(e=>{var i,s,r,o,d,u,m,h,f;let x,_,{rec:j,rowResolved:S,event:M,sceneElementName:N,floorMapItemId:C,singleBookingMode:T}=e;if(!0===(null==l?void 0:l({event:M??eGZ,raw:j,row:S,dataSources:a,mode:"read"})))return;let P=null==t||null==(i=t.appHelper)?void 0:i.utils,A=Number((null==P||null==(s=P.getData)?void 0:s.call(P,"shop_id"))??(null==P||null==(m=P.store)||null==(u=m.getState)||null==(d=u.call(m))||null==(o=d.global)||null==(r=o.globalConfig)?void 0:r.id)),D=Number.isFinite(A)&&2155===A,I=(x=j.id,_=j.booking_id,null!=x&&""!==String(x).trim()||null!=_&&""!==String(_).trim());if(D&&"dine_in"!==n&&I)return void(!function(){if("u"<typeof window)return!1;try{return"1"===window.localStorage.getItem("pisell_floor_map_use_legacy_checkout_drawer")}catch{return!1}}()?null==P||null==(f=P.action)||f.call(P,{type:"pisell1.handleOpenSaleDetail",data:{osProps:{orderId:null==j?void 0:j.order_id,syncDetailOnOrderChange:!0}},callback:()=>{}}):null==P||null==(h=P.action)||h.call(P,{type:"pisell1.handleOpenHostCheckoutDrawer",data:{item:j}}));let E=null==N?void 0:N.trim();y(E&&""!==E?E:void 0),w.current=String(S.id??"").trim(),k.current=`${eGJ(S)}#${I?eGK(j):"gone"}`,g(j),v(S),null!=C&&""!==String(C).trim()?p(String(C)):p(null),b(!!T),c(!0)},[a,t,l,n]);return{bookingDetailOpen:d,bookingDetailRaw:m,bookingDetailRow:h,bookingDetailSceneName:f,bookingDetailSingleMode:x,readModeSelectedFloorItemId:u,closeBookingDetailModal:S,closeBookingDetailNow:j,floorMapItemClickBefore:(0,ef.useCallback)(e=>{var a,i,d,c,u,p,m,g,h;if("edit"===e.mode)return;let v=e.item.elementKind??(null==(a=e.item._sceneElement)?void 0:a.elementKind);if(v===lL.FLOOR_MAP_IMAGE_ELEMENT_KIND||v===lL.FLOOR_MAP_BUILTIN_SHAPE_ELEMENT_KIND||v===lL.FLOOR_MAP_STAGE_ELEMENT_KIND)return;let f=eGG(e.item,e.dataSources),y=null==f?void 0:f.floorMapSourceBookings,x=function(e,t){var l;if(!(null==t?void 0:t.length))return;let a=e.target;if(!a)return t[0];let i=a.closest("[data-pisell-floor-checkout-booking]"),n=null==i||null==(l=i.getAttribute("data-pisell-floor-checkout-booking"))?void 0:l.trim();if(n){let e=t.find(e=>{let t=e.id,l=e.booking_id;return String(t??"")===n||String(l??"")===n});if(e&&"object"==typeof e)return e}let s=t[0];return s&&"object"==typeof s?s:void 0}(e.event,y);if(null==s?void 0:s.enabled){let t=f??{id:String((null==(m=e.item._sceneElement)||null==(p=m.dataBinding)?void 0:p.recordId)??e.item.id??"unknown"),code:(null==(g=e.item._sceneElement)?void 0:g.name)!=null?String(e.item._sceneElement.name):"—",cardStatus:"available"};s.onSelectResource({item:e.item,row:t,orderId:function(e,t){for(let l of[e,...Array.isArray(t)?t:[]]){if(!l||"object"!=typeof l)continue;let e=eCM(l);if(null!=e)return e}}(x,t.floorMapSourceBookings),bookingRaw:x,resource:{id:t.id,relation_id:t.id,form_id:t.form_id,code:t.code,main_field:t.main_field,raw:t}});return}let b=(()=>{if(!x||"object"!=typeof x)return!1;let e=x.id,t=x.booking_id;return null!=e&&""!==String(e).trim()||null!=t&&""!==String(t).trim()})(),_=f??{id:String((null==(d=e.item._sceneElement)||null==(i=d.dataBinding)?void 0:i.recordId)??"unknown"),code:(null==(c=e.item._sceneElement)?void 0:c.name)!=null?String(e.item._sceneElement.name):"—",cardStatus:"available"},k=(null==(u=e.item._sceneElement)?void 0:u.name)!=null?String(e.item._sceneElement.name).trim():void 0,w="number"==typeof(null==f?void 0:f.bookingCount)&&Number.isFinite(f.bookingCount)?f.bookingCount:0;if(!b&&0===w){if(!0===(null==l?void 0:l({event:e.event,raw:{},row:_,dataSources:e.dataSources,mode:"read"})))return;eCU({appHelperUtils:null==t||null==(h=t.appHelper)?void 0:h.utils,reservationBiz:n,associatedMenuListIds:r,reservationRuleProduct:o,row:_});return}M({rec:b?x:{},rowResolved:_,event:e.event,sceneElementName:k,floorMapItemId:String(e.item.id)})},[M,s,l,t,n,r,o]),openBookingDetailFromRaw:(0,ef.useCallback)(e=>{let t=e.raw,l=t.id,a=t.booking_id;if((null==l||""===String(l).trim())&&(null==a||""===String(a).trim()))return;let i=e.row??{id:String(l??a??"unknown"),code:String(t.relation_form_name??a??"—"),cardStatus:"booked"};M({rec:t,rowResolved:i,sceneElementName:e.sceneElementName,singleBookingMode:e.singleBookingMode})},[M])}}({engineCtx:eC,onFloorMapBookingClick:ec,dataSources:tL,mergedTableRows:tk,reservationBiz:eO,resourceSelectMode:ek,associatedMenuListIds:eB,reservationRuleProduct:e$}),ld=(0,ef.useCallback)(async()=>{ln(),await tn.refreshAsync()},[ln,tn]),{reservationCalendarSlotProps:lc,calendarGranularity:lu,setCalendarGranularity:lp}=function(e){let{isInternalListData:t,floorDayBookingData:l,operatingDayBoundary:a,tables:i,openBookingDetailFromRaw:n,schedule:s,handleScheduleChange:r,calendarResources:o,calendarBookings:d,effectiveTimelineRange:c,runtimeContext:u,onCalendarViewportFirstPatch:p}=e,m=(0,ef.useRef)({bookingId:null,timer:null}),[g,h]=(0,ef.useState)("week"),v=(0,ef.useRef)(new Set),f=(0,ef.useRef)(null),y=(0,ef.useRef)(!1),x=(0,ef.useCallback)(e=>{let t=em()(e).startOf("day"),l=em()(s.at);r({date:t,at:t.hour(l.hour()).minute(l.minute()).second(0).millisecond(0)})},[r,s.at]),b=(0,ef.useRef)(!1),_=(0,ef.useCallback)(e=>{t&&(b.current||(b.current=!0,null==p||p()),l.patchSearchParams(t=>{var l,i,n,s;let r,o,d,c=(l=t,i=e.rangeStart,n=e.rangeEnd,s=a,o="object"==typeof(r="object"==typeof l.filter&&l.filter?l.filter:{}).values&&r.values?r.values:{},d=eWV(function(e,t,l){let a=eWF(l),i=em()(e).startOf("day"),n=em()(t).startOf("day");if(n.isBefore(i)){let e=i;i=n,n=e}return eWH(l)?[eWB(i.subtract(1,"day"),a),eWB(n,a)]:[eWB(i,a),eWB(n.add(1,"day"),a)]}(new Date(i.getTime()-2592e6),n,s)),{...l,filter:{...r,values:{...o,booking_time_start_between:d}}}),u=c.filter&&"object"==typeof c.filter?c.filter:{},p=u.values&&"object"==typeof u.values?{...u.values}:{};return"week"===e.view||"month"===e.view||"resource"===e.view?(p.enable_remote_memory_cache=!0,p.compact_fields=!0):(delete p.enable_remote_memory_cache,delete p.compact_fields),{...c,filter:{...u,values:p}}}))},[t,l.patchSearchParams,a,p]),k=(0,ef.useCallback)(e=>{let t=e.raw;return!!t&&"object"==typeof t&&(n({raw:t,row:eGs(t,i),singleBookingMode:!0}),!0)},[n,i]),w=(0,ef.useMemo)(()=>({beforePersist:()=>(ex.message.warning(eN.getText("pisell-reservation.calendar-write-not-available")),!1)}),[]),j=(0,ef.useCallback)(e=>(0,ev.jsx)(eQx,{args:e,tables:i,calendarDragSuppressDetailRef:m}),[i]),S=i0(async e=>{let{mergedRange:t,slotStepMinutes:l}=e;try{return await eQf({resources:o,initialResourceId:t.courtId,initialTimeRange:[eGn(t.date,t.startHour),eGn(t.date,t.endHour)],minuteStep:l,blockedSalesChannels:["online_store"],onSubmit:async e=>{let{submitPayload:t}=e;await z_.Em.getRequest().post("/shop/schedule/blocked-time",t),ex.message.success("保存成功"),await u.refreshAsync()}}),!0}catch{return!1}}),M=i0(async e=>eQd({calendarItem:e.item,draft:e.draft,calendarResources:o,calendarBookings:d,effectiveTimelineRange:c,anchorDate:s.date.toDate(),slotStepMinutes:30,onSuccessRefresh:async()=>{await u.refreshAsync()}})),N=(0,ef.useMemo)(()=>`${g}_${em()(s.date).startOf("day").valueOf()}_${em()(s.at).valueOf()}`,[g,s.date,s.at]);(0,ef.useEffect)(()=>{let e=y.current,t=l.loading;if(!e&&t)f.current=N;else if(e&&t&&f.current!==N)f.current=N;else if(e&&!t){let e=f.current??N;v.current.add(e),f.current=null}y.current=t},[l.loading,N]),(0,ef.useMemo)(()=>"week"!==g&&"month"!==g&&"resource"!==g&&!!l.loading&&!v.current.has(N),[l.loading,N,g]);let C=i0(e=>{let t=e=>{var t;return(null==(t=o.find(t=>String(t.id)===String(e)))?void 0:t.name)??e};if("day"===e.mode)return void e.groups.map(e=>({resourceId:e.courtId,resourceName:t(e.courtId),date:e.date,startHour:e.startHour,endHour:e.endHour}));let{courtId:l,dates:a,startHour:i,endHour:n}=e;t(l),a.length>1?(a[0],a[a.length-1]):a[0]});return{reservationCalendarSlotProps:(0,ef.useMemo)(()=>({persistGuard:w,resources:o,bookings:d,loading:!1,onViewportChange:_,onBookingClick:k,timelineRange:c,calendarView:g,onCalendarViewChange:h,anchorDate:s.date.toDate(),onAnchorDateChange:x,slotStepMinutes:30,renderBooking:j,blockedTimeSalesChannels:["online_store"],onBlockedTimePanelRequest:S,onBookingMoveRequest:M,onCreateBookingFromSelection:C,tickFillMode:"snap"}),[w,o,d,_,k,g,s.date,x,c,j,S,M,C]),calendarGranularity:g,setCalendarGranularity:h}}({isInternalListData:eS,floorDayBookingData:tl,operatingDayBoundary:eY,tables:tk,openBookingDetailFromRaw:lr,schedule:tc,handleScheduleChange:tz,calendarResources:tS,calendarBookings:tM,effectiveTimelineRange:eW,runtimeContext:tn,onCalendarViewportFirstPatch:e9}),lm=function(e){let{floorMapProp:t,baseFloorConfig:l,dataSources:a,renderItemByKind:i,gridDataSourceKey:n,effectiveMapMode:s,resolvedFloorPlanId:r,floorPlanRemoteId:o,effectiveFloorPlanCode:d,floorPlanCanvasWidth:c,floorPlanCanvasHeight:u,floorPlanName:p,floorPlanSort:m,floorPlanStatus:g,onFloorPlanPersisted:h,putFloorPlan:v,isFloorModeControlled:f,mapEditInternal:y,setMapEditInternal:x,floorMapLayoutRef:b,reservationFloorMapViewportOverlay:_,setRemoteFloorPlanView:k,floorMapItemClickBefore:w,engineLocale:j,floorMapHudTableDrawer:S=!1,readModeSelectedItemId:M,editTopBarPhoneLayout:N,appearanceMode:C,onToggleAppearanceMode:T}=e;return(0,ef.useMemo)(()=>{var e;let j={[n]:eN.getText("pisell-reservation.floor-map.data-source-label")},P={[n]:[{key:"code",label:eN.getText("pisell-reservation.grid.code"),type:"string"},{key:"guestName",label:eN.getText("pisell-reservation.grid.guest"),type:"string"},{key:"time",label:eN.getText("pisell-reservation.grid.time"),type:"string"},{key:"partySize",label:eN.getText("pisell-reservation.grid.party"),type:"number"},{key:"cardStatus",label:eN.getText("pisell-reservation.resource-grid.card-status"),type:"string"},{key:"area",label:eN.getText("pisell-reservation.grid.area"),type:"string"}]},{getMergedItemWrapperStyle:A,...D}=t??{},I=D.onSave,E=o??r,z=null!=E&&Number.isFinite(E)&&Math.floor(E)===E&&E>0,L=(0,lL.wrapFloorMapOnSaveWithRemotePersist)({canPersist:z,persistTargetId:E??0,persist:(e,t)=>eWc(e,t,{canvasWidth:c,canvasHeight:u,code:d,name:p,sort:m,status:g,putFloorPlan:null!=v?(e,t)=>v(e,t):void 0}),setRemoteFloorPlanView:k,onFloorPlanPersisted:h,prevOnSave:I,onPersistError:eWu}),O=(null==t?void 0:t.dataSources)??a,R=d?`reservation-code:${d}`:null!=r?`reservation:${r}`:"reservation:default",$="light"===C?"#e8e8e8":void 0;return{mapLayer:{showGrid:!0,snapStep:1,...null==$?{}:{backgroundColor:$},...D.mapLayer},cellSize:D.cellSize??10,itemUnit:D.itemUnit??"pixel",dataSourceLabels:j,dataSourceFormColumns:P,...D,floorMapConfig:D.floorMapConfig??l,dataSources:O,renderItemByKind:(null==t?void 0:t.renderItemByKind)??i,appearanceMode:C,mode:s,toolbarShowSave:D.toolbarShowSave??!1,showDataSourceRecordFormBlock:D.showDataSourceRecordFormBlock??!1,zoom:{defaultScale:1,min:.4,max:2.2,step:.1,...D.zoom,autoFitOnMount:(null==(e=D.zoom)?void 0:e.autoFitOnMount)!==!1},controls:{showZoom:!0,showReset:!0,showFitBounds:!0,showGridToggle:!0,...D.controls},pan:{enabled:!0,boundary:"none",...D.pan},onItemClick:(e,l,a)=>{var i;null==w||w({item:e,index:l,event:a,mode:s,dataSources:O}),null==t||null==(i=t.onItemClick)||i.call(t,e,l,a)},getMergedItemWrapperStyle:A,onSave:L,onExitEdit:D.onExitEdit??(f?void 0:()=>{x(!1)}),floorMapViewportOverlay:D.floorMapViewportOverlay??_,viewportOverlayPlacement:S?"bottom-start":D.viewportOverlayPlacement,viewportOverlayClassName:D.viewportOverlayClassName,canvasTabsBarTrailing:D.canvasTabsBarTrailing,viewportPersist:D.viewportPersist,viewportPersistNamespace:D.viewportPersistNamespace??R,viewportDockToolButtons:D.viewportDockToolButtons??(0,ev.jsx)(eGk,{appearanceMode:C,onToggleAppearanceMode:T}),viewportDockTrailing:!1===D.viewportDockTrailing?(0,ev.jsx)(ey().Fragment,{}):D.viewportDockTrailing??(0,ev.jsx)(eGw,{isFloorModeControlled:f,mapEditInternal:y,setMapEditInternal:x,floorMapLayoutRef:b,phoneLayout:N}),readModeSelectedItemId:M??D.readModeSelectedItemId,editTopBarPhoneLayout:D.editTopBarPhoneLayout??N,enableEdges:!1,renderResourcePickerModal:D.renderResourcePickerModal??(e=>(0,ev.jsx)(eGI,{...e,platform:N?"h5":"pc",categoryConfig:(0,lL.getFloorMapCardPickerCategoryConfig)(),getSearchText:lL.floorMapResourcePickerRecordSearchText,getCardMeta:lL.getFloorMapResourcePickerCardMeta,renderFilterBar:e=>(0,ev.jsx)(lL.PisellTabbarTemplate1,{className:"pisell-pro-resource-picker-tabbar",style:{position:"sticky",top:0,zIndex:10,padding:6,background:"rgb(250, 250, 250)"},dataSource:e.tabbarDataSource,value:e.tabbarValue,onChange:e.onTabbarValueChange,onSearch:e.onKeywordChange,maxLevel:3})})),renderPaletteViewAllModal:D.renderPaletteViewAllModal??(e=>(0,ev.jsx)(eGR,{...e,platform:N?"h5":"pc"}))}},[l,a,t,S,_,i,n,C,s,r,o,d,c,u,p,m,g,h,v,f,y,b,T,k,w,j,M,N])}({floorMapProp:z,baseFloorConfig:e2,dataSources:tL,renderItemByKind:t8,gridDataSourceKey:C,effectiveMapMode:tF,resolvedFloorPlanId:eM,floorPlanRemoteId:e1,effectiveFloorPlanCode:eq,floorPlanCanvasWidth:el,floorPlanCanvasHeight:ea,floorPlanName:en,floorPlanSort:es,floorPlanStatus:er,onFloorPlanPersisted:eo,putFloorPlan:ed,isFloorModeControlled:tO,mapEditInternal:tR,setMapEditInternal:t$,floorMapLayoutRef:tP,reservationFloorMapViewportOverlay:t3,setRemoteFloorPlanView:e4,floorMapItemClickBefore:ls,engineLocale:eI,floorMapHudTableDrawer:eh,readModeSelectedItemId:lo,editTopBarPhoneLayout:ej,appearanceMode:t6,onToggleAppearanceMode:t7}),lg=eS?eX.data:q??[],lh=function(e){let[t,l]=(0,ef.useState)(!1),a=(0,ef.useRef)(null);return(0,ef.useEffect)(()=>(null!=a.current&&(window.clearTimeout(a.current),a.current=null),e?a.current=window.setTimeout(()=>{a.current=null,l(!0)},200):l(!1),()=>{null!=a.current&&(window.clearTimeout(a.current),a.current=null)}),[e]),t}(!eS&&(K??!1)),lv=eS?eX.total:V??0,lf=eS?eX.pagination:Y??{pageNumber:1,pageSize:20},ly=eS?eX.onPageChange:U,lx=eS?eX.searchParams:Q??{},lb=eV_({enabled:ej,isInternalListData:eS,rowKey:J,data:lg,pagination:lf,searchParams:lx}),l_=ej?lb:lg,lk=(0,ef.useCallback)(e=>{eX.onSearch(eGr(e))},[eX.onSearch]),lw=eS?lk:W,lj=eS?eX.onReset:G,{venueWallAppearanceTheme:lS,setVenueWallAppearanceTheme:lM,venueWallAppearanceMode:lN,setVenueWallAppearanceMode:lC,venueWallResourceLayout:lT,setVenueWallResourceLayout:lP}=function(e){let{bodyViewStorageKey:t,isInternalListData:l,searchParams:a,onSearch:i,venueWallCards:n,floorDayBookingLoading:s}=e,r=(0,ef.useRef)(!1),[o]=(0,ef.useState)(()=>(function(e){let t=`${eWI}:${e??"default"}`,l=null;try{"u">typeof localStorage&&(l=localStorage.getItem(t))}catch{l=null}let a=eQ0(l,eWE);return{venueWallAppearanceTheme:null!=a.venueWallAppearanceTheme&&eQZ(a.venueWallAppearanceTheme)?a.venueWallAppearanceTheme:{},venueWallAppearanceMode:"light"===a.venueWallAppearanceMode||"dark"===a.venueWallAppearanceMode?a.venueWallAppearanceMode:"light",venueWallResourceLayout:a.venueWallResourceLayout??lL.DEFAULT_RESOURCE_WALL_LAYOUT_PERSIST}})(t)),[d,c]=(0,ef.useState)(o.venueWallAppearanceTheme),[u,p]=(0,ef.useState)(o.venueWallAppearanceMode),[m,g]=(0,ef.useState)(o.venueWallResourceLayout),h=`${eWI}:${t??"default"}`;return(0,ef.useEffect)(()=>{if(!l||r.current)return;let e=null==a?void 0:a.filter,t=e&&"object"==typeof e&&null!==e&&"object"==typeof e.values&&null!==e.values?e.values:{},n={filterValuePatches:{}};try{let e=localStorage.getItem(h);n=eQ0(e,eWE)}catch{}(null==n?void 0:n.venueWallAppearanceTheme)!=null&&eQZ(n.venueWallAppearanceTheme)&&c(n.venueWallAppearanceTheme),("light"===n.venueWallAppearanceMode||"dark"===n.venueWallAppearanceMode)&&p(n.venueWallAppearanceMode),null!=n.venueWallResourceLayout&&g(n.venueWallResourceLayout);let s=t.resource_wall_resource_ids;if(Array.isArray(s)&&s.length>0){let e=Object.keys(n.filterValuePatches).length>0;i&&e&&i({...a,filter:{..."object"==typeof a.filter&&null!==a.filter?a.filter:{},values:{..."object"==typeof t?t:{},...n.filterValuePatches,resource_wall_resource_ids:s.map(String)}}}),r.current=!0;return}let o=!0===n.resourceWallResourceIdsInFile,d=n.resourceIds??[],u=o?eQX(d):[],m=Object.keys(n.filterValuePatches).length>0;r.current=!0,!i||(o||0!==u.length||m)&&i({...a,filter:{..."object"==typeof a.filter&&null!==a.filter?a.filter:{},values:{..."object"==typeof t?t:{},...n.filterValuePatches,resource_wall_resource_ids:u}}})},[l,h,i,a]),(0,ef.useEffect)(()=>{if(!l||!r.current||s||0===n.length)return;let e=null==a?void 0:a.filter;if(!e||"object"!=typeof e||null===e)return;let t=e.values;if(!t||"object"!=typeof t||Array.isArray(t))return;let o=t.resource_wall_resource_ids;if(!Array.isArray(o))return;let d=o.map(e=>String(e)),c=new Set(n.map(e=>String(e.resourceId))),u=d.filter(e=>c.has(e));u.length!==d.length&&(null==i||i({...a,filter:{...e,values:{...t,resource_wall_resource_ids:u}}}))},[l,n,s,a,i]),(0,ef.useEffect)(()=>{if(!l)return;let e=null==a?void 0:a.filter;if(!e||"object"!=typeof e||null===e||"object"!=typeof e.values||null===e.values)return;let t=e.values,i=t.resource_wall_resource_ids;if(!Array.isArray(i))return;let n=eQX(i.map(String)),s={};for(let e of eWE)"resource_wall_resource_ids"!==e&&Object.prototype.hasOwnProperty.call(t,e)&&(s[e]=t[e]);let r={v:1,resource_wall_resource_ids:n};Object.keys(s).length>0&&(r.filter_values=s),eQZ(d)&&(r.venueWallAppearanceTheme=d),r.venueWallAppearanceMode=u,r.venueWallResourceLayout=m;try{localStorage.setItem(h,JSON.stringify(r))}catch{}},[l,a,h,d,u,m]),{venueWallAppearanceTheme:d,setVenueWallAppearanceTheme:c,venueWallAppearanceMode:u,setVenueWallAppearanceMode:p,venueWallResourceLayout:m,setVenueWallResourceLayout:g}}({bodyViewStorageKey:eg,isInternalListData:eS,searchParams:lx,onSearch:lw,venueWallCards:tN,floorDayBookingLoading:tl.loading});f={isInternalListData:eS,resourceList:eQ.data,resourceListLoading:eQ.loading,salesResourceBookings:tx,debouncedScheduleKey:tC,debouncedSchedule:tu,gridBookingData:eX,floorDayBookingData:tl,tables:tk,dataProp:q??void 0,dataSourcesProp:T,gridDataSourceKey:C,floorConfigForBindings:e3,floorBoundFormRecordIds:e8,shellBodyView:eK,calendarGranularity:lu,schedule:tc,effectiveTimelineRange:eW,calendarOrderedResourceIds:tw,calendarResources:tS,calendarBookings:tM,venueWallCards:tN,searchParams:lx,floorBookingExtraParams:tt},(0,ef.useEffect)(()=>{},[f.isInternalListData,f.salesResourceBookings]),(0,ef.useEffect)(()=>{},[f.debouncedScheduleKey,f.debouncedSchedule.date,f.debouncedSchedule.at,f.isInternalListData,f.gridBookingData.data,f.gridBookingData.loading,f.floorDayBookingData.data,f.floorDayBookingData.loading,f.tables,f.dataProp,f.dataSourcesProp,f.gridDataSourceKey,f.floorConfigForBindings.sceneElements,f.floorBoundFormRecordIds]),(0,ef.useEffect)(()=>{},[f.shellBodyView,f.calendarGranularity,f.schedule.date,f.schedule.at,f.effectiveTimelineRange,f.floorDayBookingData.loading,f.floorDayBookingData.data,f.calendarOrderedResourceIds,f.calendarResources,f.calendarBookings]),(0,ef.useEffect)(()=>{},[f.shellBodyView,f.venueWallCards,f.floorDayBookingData.loading,f.searchParams,f.floorBookingExtraParams]);let{toolBarMerged:lA}=function(e){let{toolBarProp:t,bookingToolBar:l,isInternalListData:a,tables:i,schedule:n,handleScheduleChange:s,scheduleStartSlotProp:r,scheduleEndSlotProp:o,schedulePropsProp:d,mergedTimeNavigatorProps:c,followWallClock:u,onFollowWallClockToggle:p,onTimeNavigatorUserInteraction:m,calendarGranularity:g,setCalendarGranularity:h,onNewReservation:v,salesTimelineHighlights:f,floorDayBookingData:y,data:x,effectiveTimelineRange:b,bodyView:_,phoneLayout:k}=e,w=(0,ef.useMemo)(()=>(0,ev.jsx)(eG_,{onNewReservation:v,calendarGranularity:g,onCalendarGranularityChange:h,phoneLayout:k}),[v,g,h,k]),j=(0,ef.useMemo)(()=>{let e=o??w;return(0,ev.jsx)("div",{onClick:e=>{let t=e.target;(null==t?void 0:t.closest(".pisell-reservation-schedule-end-slots"))&&e.stopPropagation()},children:e})},[o,w]),S=(0,ef.useMemo)(()=>i.map(e=>{let t=String(e.id),l=null!=e.code&&""!==String(e.code).trim()?String(e.code):"",a=null!=e.name&&""!==String(e.name).trim()?String(e.name):"";return{value:t,label:l||a||t}}),[i]),M=(0,ef.useMemo)(()=>{let e=null==l?void 0:l.quickFilter;if(!1===e||null==e||!a)return e;let t=e.filterList,i=Array.isArray(t)?[...t]:[];return i.some(e=>String(e.key??e.name??"")===lL.DEFAULT_RESOURCE_WALL_FILTER_FIELD_KEY)?e:{..."object"==typeof e&&null!==e?e:{},filterList:[...i,{type:"custom",key:lL.DEFAULT_RESOURCE_WALL_FILTER_FIELD_KEY,name:lL.DEFAULT_RESOURCE_WALL_FILTER_FIELD_KEY,label:eN.getText(eWD),other:{component:eQb,options:S}}]}},[l,a,S]),N=(0,ef.useCallback)(async e=>{let{referenceDate:t,stepMinutes:l}=e,i=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eWT;return(0,lL.getHorizontalAxisSlotCount)(l,e.startOf("day"),t)}(t,l,b);if(null!=f&&f.length>0){let e;return e=Math.max(1,i),f.length===e?[...f]:f.length>e?f.slice(0,e):[...f,...Array(e-f.length).fill(0)]}return function(e,t,l){let a=t.startOf("day"),i=Math.max(1,Math.round(1440/Math.max(1,l))),n=Array(i).fill(0);for(let t of e){let e=t.bookingTimeStart??t.start_at??(t.start_date&&t.start_time?`${t.start_date} ${t.start_time}`:void 0);if(!e||"string"!=typeof e)continue;let s=em()(e);if(!s.isValid()||!s.isSame(a,"day"))continue;let r=Math.min(i-1,Math.floor((60*s.hour()+s.minute())/l));n[r]+=1}return n.some(e=>e>0)?n:n.map((e,t)=>Math.max(0,Math.round(2+2*Math.sin(t/Math.max(1,i-1)*Math.PI*2)+Math.sin(t/Math.max(1,i-1)*Math.PI*6))))}(a?y:x,t,l)},[a,y,x,f,b.start,b.end]);return{toolBarMerged:(0,ef.useMemo)(()=>{let e,a,{tabs:i,topLeft:o,topRight:h,bottomLeft:v,quickFilter:f,...y}=t??{},x=void 0!==f?f:M,b={...l??{},...y},w=k?"grid"===_||"resourceWall"===_?eQM({baseToolBar:b,quickFilterFilterList:x&&"object"==typeof x&&Array.isArray(x.filterList)?x.filterList:void 0}):(a="string"==typeof(e=b??{}).className?e.className:void 0,{...e,className:t_()(a,"pisell-record-board-toolbar--narrow-stack")}):b,S=k&&x&&"object"==typeof x&&Array.isArray(x.filterList)?{...x,size:"small",filterList:eQS(x.filterList,{rangeFormItemClassName:"pisell-reservation-mobile-toolbar-range-filter-item",compactFormItem:!0})}:x,C=w.filter,T=k&&C&&"object"==typeof C?function(e){let t=e.defaultFilterValue;if("object"!=typeof t||null===t)return e;let l=t.otherFilter;return Array.isArray(l)?{...e,defaultFilterValue:{...t,otherFilter:eQS(l,{rangePickerVariant:"filter"})}}:e}(C):C,P=w.search,A="object"==typeof P&&null!==P?P:{},D="function"==typeof A.inputRender?A.inputRender:void 0,I=!1!==P&&{searchDebounce:300,...A,enableScanner:A.enableScanner??!0,inputRender:D??(e=>(0,ev.jsx)(qN,{ctx:e,showSearchButton:!1!==A.showConfirmButton}))};return{...w,search:I,...T?{filter:T}:{},...k?{}:{collapseActions:"gear"},quickFilter:S,hideBodyViewToggle:k&&("grid"===_||"resourceWall"===_),tabs:k&&("grid"===_||"resourceWall"===_)?null:(0,ev.jsx)(eGx,{extraTabs:i,schedule:n,onScheduleChange:s,scheduleProps:d,timeNavigatorProps:c,scheduleStartSlot:r??(k?null:(0,ev.jsx)(eGj,{})),scheduleEndSlot:j,followWallClock:u,onFollowWallClockToggle:p,onTimeNavigatorUserInteraction:m,loadDensity:N,calendarGranularity:g,phoneLayout:k}),topLeft:(0,ev.jsxs)(ev.Fragment,{children:[k?(0,ev.jsx)(eGy,{}):null,o]}),topRight:(0,ev.jsx)(eGb,{extra:h}),bottomLeft:v??null}},[l,M,t,n,s,r,j,u,p,m,c,d,N,g,k,_])}}({toolBarProp:E,bookingToolBar:ts.toolBar,isInternalListData:eS,tables:tk,schedule:tc,handleScheduleChange:tz,scheduleStartSlotProp:L,scheduleEndSlotProp:O,schedulePropsProp:F,mergedTimeNavigatorProps:tg,followWallClock:th,onFollowWallClockToggle:tf,onTimeNavigatorUserInteraction:ty,calendarGranularity:lu,setCalendarGranularity:lp,onNewReservation:()=>{var e;return null==(e=tA.current)?void 0:e.requestOpen()},salesTimelineHighlights:tb,floorDayBookingData:tl.data,data:lg,effectiveTimelineRange:eW,phoneLayout:ej,bodyView:eK}),lD=(0,ef.useMemo)(()=>ts.grid,[ts.grid]),lI=(0,ef.useMemo)(()=>{if(null==lD||"object"!=typeof lD)return lD;if(ej)return eQN(lD);let e=!1!==lD.infiniteScroll;return{...lD,infiniteScroll:e}},[ej,lD]),lE=(0,ef.useMemo)(()=>null==lD||"object"!=typeof lD?lD:eQN(lD),[lD]),lz=(0,ef.useMemo)(()=>{let e=null!=lE&&"object"==typeof lE&&"scroll"in lE&&null!=lE.scroll&&"object"==typeof lE.scroll?{...lE.scroll}:{};return null==lE||"object"!=typeof lE?{size:"small",infiniteScroll:!0,scroll:{...e,autoCalc:!0}}:{...lE,size:"small",infiniteScroll:!0,scroll:{...e,autoCalc:!0}}},[lE]),lO=(null==lI||null==(g=lI.scroll)?void 0:g.autoCalc)??!0,lR=(0,ef.useMemo)(()=>({cards:tN,loading:tl.loading,filterFieldKey:lL.DEFAULT_RESOURCE_WALL_FILTER_FIELD_KEY,appearanceTheme:lS,onAppearanceThemeChange:lM,appearanceMode:lN,onAppearanceModeChange:lC,resourceWallLayout:lT,onResourceWallLayoutChange:lP}),[tN,tl.loading,lS,lN,lT]);return(0,ev.jsx)(ej8,{dateAdapter:eSy,adapterLocale:eV,children:(0,ev.jsxs)("div",{className:t_()("pisell-reservation-page",ej&&"pisell-reservation-page--phone",X),style:ee,children:[(0,ev.jsxs)(lL.PisellRecordBoard,{...ew,columnVisibilityStorageKey:tr,layoutVariant:ej?"phone":"default",fillHeight:lO,rowKey:J,data:l_,dataSources:tL,loading:lh,total:lv,pagination:lf,onPageChange:ly,searchParams:lx,onSearch:lw,onReset:lj,grid:lI,toolBar:lA,search:ts.search,batchActionBar:ts.batchActionBar,floorMap:lm,calendar:lc,resourceWall:lR,defaultBodyView:"floorMap",bodyViewStorageKey:eg,bodyViewSwitchable:eu,lockedBodyView:ep,floorMapLayoutRef:tP,children:[(0,ev.jsx)(eGh,{bodyViewRef:tT,onBodyViewChange:eJ}),(0,ev.jsx)(eGv,{schedule:tc,isInternalListData:eS,patchSearchParams:tl.patchSearchParams,operatingDayBoundary:eY,timelineRange:eW}),(0,ev.jsxs)(lL.PisellRecordBoard.ShellFrame,{children:[(0,ev.jsx)(lL.PisellRecordBoard.GridLayout,{}),(0,ev.jsx)(lL.PisellRecordBoard.FloorMap,{}),(0,ev.jsx)(lL.PisellRecordBoard.Calendar,{...lc}),(0,ev.jsx)(lL.PisellRecordBoard.ResourceWall,{})]})]}),(0,ev.jsx)(eQC,{ref:tA,router:ez,app:eE}),(0,ev.jsx)(eU$,{open:t9,onClose:li,onActionSuccess:ld,raw:le,tableRow:lt,sceneElementName:ll,reservationBiz:eO,associatedMenuListIds:eB,reservationRuleProduct:e$,floorDayBookingList:tl.data,currentTime:tu.at,followWallClock:th,singleBookingMode:la}),B?(0,ev.jsx)("div",{className:"pisell-reservation-fab",children:B}):null,(0,ev.jsx)(eQ4,{floorMapHudTableDrawer:eh,showVenueHudDock:tB,hudDrawerOpen:tY,hudDrawerRef:tV,hudMapItems:tU,dataSources:tL,handleOpenHudTableDrawer:tH,closeHudTableDrawer:tq,rowKey:J,hudDrawerPagedRows:tG,hudDrawerLoading:tK,hudDrawerFilteredTotal:tQ,hudDrawerBookingPagination:tJ,hudDrawerOnPageChange:t0,hudDrawerLocalSearchParams:t1,hudDrawerOnSearch:tZ,hudDrawerOnReset:tX,hudDrawerGrid:lz,hudDrawerToolBar:t2,batchActionBar:ts.batchActionBar,hudDrawerResourceRootBuckets:tW,handleHudDrawerFormRecordIdsChange:t4})]})})},eQ6=e=>{let t=eVb(e.variant);return(0,ev.jsx)(eQ8,{...e,bodyViewStorageKey:e.bodyViewStorageKey??"pisell-reservation.body-view.v2",variant:t})},eQ5=eQ6,eQ7=eQ6,eQ9=e=>{let t=eVb(e.variant),{scheduleStartSlot:l,scheduleProps:a,timeNavigatorProps:i,...n}=e,s=(0,ef.useMemo)(()=>({...a,navigationLocked:!0,navigationLockedDisplay:"labelOnly"}),[a]);return(0,ev.jsx)(eQ8,{...n,variant:t,scheduleStartSlot:l??(0,ev.jsx)(eGS,{}),scheduleProps:s,timeNavigatorProps:i,bodyViewSwitchable:!1,lockedBodyView:"floorMap",bodyViewStorageKey:void 0,floorMapHudTableDrawer:!0})},eKe=e=>{let{bodyViewStorageKey:t,floorMapHudTableDrawer:l,...a}=e;return(0,ev.jsx)(eQ8,{...a,bodyViewStorageKey:t??eWN,bodyViewSwitchable:!1,lockedBodyView:"resourceWall",floorMapHudTableDrawer:l??!1})},eKt=e=>{let t=eVb(e.variant),{bodyViewStorageKey:l,floorMapHudTableDrawer:a,...i}=e;return(0,ev.jsx)(eQ8,{...i,variant:t,bodyViewStorageKey:l??eWC,bodyViewSwitchable:!1,lockedBodyView:"grid",floorMapHudTableDrawer:a??!1})},eKl={padding:0,height:"100%"};function eKa(){return(0,ev.jsx)("div",{className:"pisell-select-floor-map-resource-dialog-skeleton",children:(0,ev.jsxs)("div",{className:"pisell-select-floor-map-resource-dialog-skeleton__toolbar",children:[(0,ev.jsx)(ex.Skeleton.Button,{active:!0,block:!0}),(0,ev.jsx)(ex.Skeleton.Button,{active:!0,block:!0}),(0,ev.jsx)(ex.Skeleton.Button,{active:!0,block:!0})]})})}let eKi=function(e){var t,l;let{open:a,onClose:i,onClick:n,reservationBiz:s,businessCode:r,associatedMenuListIds:o,scheduleValue:d,floorPlanId:c,floorPlanCode:u,floorPlanCanvasWidth:p,floorPlanCanvasHeight:m,dataSources:g,floorMap:h,title:v}=e,f=ik(),y=(null==f||null==(l=f.engine)||null==(t=l.props)?void 0:t.locale)||"zh-CN",[x,b]=(0,ef.useState)(!1);eN.init(eWP,y),(0,ef.useEffect)(()=>{if(!a)return void b(!1);let e=window.setTimeout(()=>{b(!0)},200);return()=>{window.clearTimeout(e)}},[a]);let _=(0,ef.useCallback)(e=>{null==n||n(e)},[n]),k=(0,ef.useMemo)(()=>({enabled:!0,onSelectResource:_}),[_]),w=(0,ef.useMemo)(()=>(function(e){if(null==e)return;let t="string"==typeof e?e:e.at,l=em()(t);if(!l.isValid())return;let a="string"==typeof e?void 0:e.date,i=em()(a);return{date:null!=a&&i.isValid()?i.startOf("day"):l.startOf("day"),at:l}})(d),[d]);return(0,ev.jsx)(iB,{renderType:"modal",props:{height:"99%",platform:"pc",open:a,onCancel:i,title:v??eN.getText("pisell-reservation.select-resource.title"),footer:null,destroyOnClose:!0,width:"99%",className:"pisell-select-floor-map-resource-dialog-modal",bodyStyle:eKl,wrapClassName:"pisell-select-floor-map-resource-dialog"},children:(0,ev.jsx)("div",{className:"pisell-select-floor-map-resource-dialog-content",children:x?(0,ev.jsx)(eQ8,{reservationBiz:s??r,associatedMenuListIds:o,scheduleValue:w,floorPlanId:c,floorPlanCode:u,floorPlanCanvasWidth:p,floorPlanCanvasHeight:m,dataSources:g,floorMap:h,bodyViewSwitchable:!1,lockedBodyView:"floorMap",resourceSelectMode:k}):(0,ev.jsx)(eKa,{})})})},eKn={en:{"pisell-topology.edit-map":"Edit topology","pisell-topology.edit-map-done":"Done","pisell-topology.auto-arrange":"Auto arrange","pisell-topology.scope.show-all":"Show all","pisell-topology.scope.focus":"This device only","pisell-topology.floor-plan.save-failed":"Failed to save topology floor plan","pisell-topology.device-status.online":"online","pisell-topology.device-status.offline":"offline","pisell-topology.device-status.warning":"warning","pisell-topology.device-status.unknown":"unknown","pisell-topology.device-status.removed":"removed","pisell-topology.legend.title":"Connections","pisell-topology.legend.ethernet":"Ethernet","pisell-topology.legend.usb":"USB","pisell-topology.legend.bluetooth":"Bluetooth","pisell-topology.legend.wifi":"Wi-Fi","pisell-topology.canvas.devices":"Devices","pisell-topology.category.devices":"Devices","pisell-topology.category.area":"Area"},"zh-CN":{"pisell-topology.edit-map":"编辑拓扑","pisell-topology.edit-map-done":"完成编辑","pisell-topology.auto-arrange":"自动排列","pisell-topology.scope.show-all":"显示全部","pisell-topology.scope.focus":"只看本机","pisell-topology.floor-plan.save-failed":"拓扑平面图保存失败","pisell-topology.device-status.online":"在线","pisell-topology.device-status.offline":"离线","pisell-topology.device-status.warning":"告警","pisell-topology.device-status.unknown":"未知","pisell-topology.device-status.removed":"已下线","pisell-topology.legend.title":"连接方式","pisell-topology.legend.ethernet":"以太网","pisell-topology.legend.usb":"USB","pisell-topology.legend.bluetooth":"蓝牙","pisell-topology.legend.wifi":"Wi-Fi","pisell-topology.canvas.devices":"设备","pisell-topology.category.devices":"设备","pisell-topology.category.area":"分区"},"zh-HK":{"pisell-topology.edit-map":"編輯拓撲","pisell-topology.edit-map-done":"完成編輯","pisell-topology.auto-arrange":"自動排列","pisell-topology.scope.show-all":"顯示全部","pisell-topology.scope.focus":"只看本機","pisell-topology.floor-plan.save-failed":"拓撲平面圖儲存失敗","pisell-topology.device-status.online":"在線","pisell-topology.device-status.offline":"離線","pisell-topology.device-status.warning":"告警","pisell-topology.device-status.unknown":"未知","pisell-topology.device-status.removed":"已下線","pisell-topology.legend.title":"連接方式","pisell-topology.legend.ethernet":"乙太網","pisell-topology.legend.usb":"USB","pisell-topology.legend.bluetooth":"藍牙","pisell-topology.legend.wifi":"Wi-Fi","pisell-topology.canvas.devices":"設備","pisell-topology.category.devices":"設備","pisell-topology.category.area":"分區"}};function eKs(e){return(0,lL.getFloorMapDisplayLocale)(e)}function eKr(e,t){var l,a,i,n,s,r;return(null==(l=eKn[eN.formatLocale(t)])?void 0:l[e])??(null==(a=eKn["zh-CN"])?void 0:a[e])??(null==(i=eKn.zh)?void 0:i[e])??(null==(n=eKn["zh-HK"])?void 0:n[e])??(null==(s=eKn.tc)?void 0:s[e])??(null==(r=eKn.en)?void 0:r[e])}function eKo(e){return eKr("pisell-topology.canvas.devices",e)??"设备"}let eKd="#98A2B3",eKc="#475467",eKu="#FFFFFF",eKp="#F2F4F7",eKm="#12B76A",eKg="#F79009",eKh="#1570EF",eKv="#6938EF",eKf={viewBox:"0 0 80 56",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0};function eKy(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"26",y:"6",width:"28",height:"38",rx:"3",fill:eKu,stroke:eKc,strokeWidth:"1.5"}),(0,ev.jsx)("rect",{x:"29",y:"9",width:"22",height:"28",rx:"1.5",fill:"#EAECF0"}),(0,ev.jsx)("circle",{cx:"40",cy:"41",r:"1.4",fill:eKc}),(0,ev.jsx)("rect",{x:"20",y:"46",width:"40",height:"5",rx:"1.5",fill:eKp,stroke:eKc,strokeWidth:"1.2"}),(0,ev.jsx)("path",{d:"M30 12h16M30 16h12M30 20h14",stroke:"#CFD4DC",strokeWidth:"1.2",strokeLinecap:"round"})]})}function eKx(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("path",{d:"M22 14h36c0-3.5-2-5-5-5H27c-3 0-5 1.5-5 5z",fill:eKu,stroke:eKc,strokeWidth:"1.4"}),(0,ev.jsx)("path",{d:"M24 12c2-3 6-3 10-2s10 2 14 1",fill:"none",stroke:eKd,strokeWidth:"1.2",strokeLinecap:"round"}),(0,ev.jsx)("rect",{x:"18",y:"14",width:"44",height:"32",rx:"3",fill:eKu,stroke:eKc,strokeWidth:"1.5"}),(0,ev.jsx)("rect",{x:"22",y:"20",width:"36",height:"4",rx:"1",fill:eKp,stroke:eKd,strokeWidth:"1"}),(0,ev.jsx)("rect",{x:"24",y:"30",width:"32",height:"10",rx:"1.5",fill:eKp,stroke:eKd,strokeWidth:"1"}),(0,ev.jsx)("circle",{cx:"52",cy:"35",r:"1.3",fill:eKm}),(0,ev.jsx)("circle",{cx:"48",cy:"35",r:"1.3",fill:eKg})]})}function eKb(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"3",y:"18",width:"74",height:"22",rx:"3",fill:eKu,stroke:eKc,strokeWidth:"1.5"}),(0,ev.jsx)("text",{x:"11",y:"33",fontFamily:"ui-sans-serif, -apple-system, Helvetica, Arial",fontWeight:"700",fontSize:"9",fill:eKc,children:"SW"}),Array.from({length:12}).map((e,t)=>(0,ev.jsx)("rect",{x:26+4*t,y:"23",width:"2.4",height:"12",rx:"0.5",fill:t%3==0?eKm:t%3==1?eKg:"#D0D5DD"},t)),(0,ev.jsx)("path",{d:"M65 24l3 4-3 4M68 24l3 4-3 4",fill:"none",stroke:eKc,strokeWidth:"1.2",strokeLinecap:"round"}),(0,ev.jsx)("rect",{x:"3",y:"40",width:"74",height:"3",rx:"1",fill:"#EAECF0"})]})}function eK_(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"22",y:"8",width:"36",height:"36",rx:"4",fill:eKu,stroke:eKc,strokeWidth:"1.5"}),(0,ev.jsx)("circle",{cx:"40",cy:"26",r:"1.6",fill:eKc}),(0,ev.jsx)("path",{d:"M34 28a8 8 0 0 1 12 0M31 32a12 12 0 0 1 18 0",fill:"none",stroke:eKc,strokeWidth:"1.4",strokeLinecap:"round"}),(0,ev.jsx)("circle",{cx:"26",cy:"40",r:"1",fill:eKd}),(0,ev.jsx)("circle",{cx:"54",cy:"40",r:"1",fill:eKm})]})}function eKk(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"14",y:"10",width:"52",height:"36",rx:"3",fill:eKp,stroke:eKc,strokeWidth:"1.5"}),(0,ev.jsx)("path",{d:"M34 22c0-3 2.5-5 6-5s6 2 6 5c0 2.5-2 3.5-3.5 4.5-1.5 1-2.5 1.7-2.5 3.5",fill:"none",stroke:eKc,strokeWidth:"1.6",strokeLinecap:"round"}),(0,ev.jsx)("circle",{cx:"40",cy:"36",r:"1.3",fill:eKc})]})}function eKw(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("path",{d:"M20 16l-3-7M40 16l0-9M60 16l3-7",stroke:eKc,strokeWidth:"1.4",strokeLinecap:"round"}),(0,ev.jsx)("circle",{cx:"17",cy:"9",r:"1.4",fill:eKc}),(0,ev.jsx)("circle",{cx:"40",cy:"7",r:"1.4",fill:eKc}),(0,ev.jsx)("circle",{cx:"63",cy:"9",r:"1.4",fill:eKc}),(0,ev.jsx)("rect",{x:"8",y:"18",width:"64",height:"22",rx:"3",fill:eKu,stroke:eKc,strokeWidth:"1.5"}),Array.from({length:6}).map((e,t)=>(0,ev.jsx)("circle",{cx:18+9*t,cy:"29",r:"1.6",fill:0===t?eKm:5===t?eKg:eKh,opacity:1===t?.4:1},t)),(0,ev.jsx)("rect",{x:"8",y:"38",width:"64",height:"3",rx:"1",fill:"#EAECF0"})]})}let eKj={topologyRouter:eKw,topologySwitch:eKb,topologyAp:eK_,topologyCashier:function(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"14",y:"10",width:"52",height:"32",rx:"3",fill:eKu,stroke:eKc,strokeWidth:"1.5"}),(0,ev.jsx)("rect",{x:"18",y:"14",width:"32",height:"14",rx:"1.5",fill:"#FFF6ED",stroke:eKg,strokeWidth:"1.2"}),(0,ev.jsx)("rect",{x:"18",y:"32",width:"44",height:"8",rx:"1",fill:eKp,stroke:eKd,strokeWidth:"1"}),(0,ev.jsx)("circle",{cx:"56",cy:"20",r:"2",fill:eKg})]})},topologyGate:function(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"14",y:"10",width:"14",height:"36",rx:"2",fill:eKu,stroke:eKm,strokeWidth:"1.5"}),(0,ev.jsx)("rect",{x:"52",y:"10",width:"14",height:"36",rx:"2",fill:eKu,stroke:eKm,strokeWidth:"1.5"}),(0,ev.jsx)("path",{d:"M28 28h24",stroke:eKm,strokeWidth:"2",strokeLinecap:"round"})]})},topologyKiosk:function(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"22",y:"4",width:"36",height:"40",rx:"3",fill:eKu,stroke:eKv,strokeWidth:"1.5"}),(0,ev.jsx)("rect",{x:"26",y:"8",width:"28",height:"22",rx:"1.5",fill:"#F4F3FF",stroke:eKv,strokeWidth:"1.2"}),(0,ev.jsx)("rect",{x:"28",y:"34",width:"24",height:"4",rx:"1",fill:"#F4F3FF"}),(0,ev.jsx)("rect",{x:"14",y:"44",width:"52",height:"6",rx:"1.5",fill:eKp,stroke:eKc,strokeWidth:"1.2"})]})},topologyIntegratedPos:eKy,topologyPrinter:eKx,topologyAmusement:eKk,"topologyDevice:pos":eKy,"topologyDevice:receipt_printer":eKx,"topologyDevice:label_printer":function(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"14",y:"14",width:"44",height:"28",rx:"3",fill:eKu,stroke:eKc,strokeWidth:"1.5"}),(0,ev.jsx)("rect",{x:"20",y:"20",width:"32",height:"6",rx:"1",fill:eKp,stroke:eKd,strokeWidth:"1"}),(0,ev.jsx)("circle",{cx:"50",cy:"36",r:"1.4",fill:eKm}),(0,ev.jsx)("rect",{x:"58",y:"22",width:"14",height:"20",rx:"1.5",fill:eKu,stroke:eKc,strokeWidth:"1.4"}),(0,ev.jsx)("path",{d:"M62 26h6M62 30h6M62 34h6M62 38h6",stroke:eKd,strokeWidth:"0.9",strokeLinecap:"round"})]})},"topologyDevice:switch":eKb,"topologyDevice:info_display":function(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"6",y:"4",width:"68",height:"40",rx:"3",fill:eKu,stroke:eKc,strokeWidth:"1.5"}),(0,ev.jsx)("rect",{x:"10",y:"8",width:"60",height:"32",rx:"1.5",fill:"#EAECF0"}),(0,ev.jsx)("path",{d:"M14 36l8-12 6 7 8-15 12 18 8-9",stroke:eKh,strokeWidth:"1.4",fill:"none",strokeLinejoin:"round"}),(0,ev.jsx)("rect",{x:"34",y:"44",width:"12",height:"4",fill:eKp,stroke:eKc,strokeWidth:"1.2"}),(0,ev.jsx)("rect",{x:"22",y:"48",width:"36",height:"3",rx:"1",fill:eKp,stroke:eKc,strokeWidth:"1.2"})]})},"topologyDevice:terminal":function(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"26",y:"4",width:"28",height:"48",rx:"3",fill:eKu,stroke:eKc,strokeWidth:"1.5"}),(0,ev.jsx)("rect",{x:"29",y:"8",width:"22",height:"18",rx:"1.5",fill:"#EAECF0"}),Array.from({length:12}).map((e,t)=>{let l=t%3,a=Math.floor(t/3);return(0,ev.jsx)("rect",{x:30+7*l,y:29+5*a,width:"5",height:"3.4",rx:"0.6",fill:eKp,stroke:eKd,strokeWidth:"0.7"},t)})]})},"topologyDevice:chenlei":eKk,"topologyDevice:test1":eK_,"topologyDevice:unknown":eKw},eKS="pisell-topology-device-card";function eKM(e,t){return eKr(`pisell-topology.device-status.${e}`,t)??e}function eKN(e){var t,l,a,i,n,s;let{item:r,device:o}=e,d=r.elementKind??"",c=eKj[d]??eKw,u=eKs(ik()),p=(null==(l=r._sceneElement)||null==(t=l.dataBinding)?void 0:t.recordId)!=null?String(r._sceneElement.dataBinding.recordId):void 0,m=null!=p&&null==o,g=(null==(a=r.name)?void 0:a.trim())||(null==o||null==(i=o.name)?void 0:i.trim())||(null==o||null==(n=o.model)?void 0:n.trim())||(m?p:d),h=m?"unknown":(null==o?void 0:o.status)??"online",v=null==o||null==(s=o.ip)?void 0:s.trim(),f=m?eKM("removed",u):eKM(h,u);return(0,ev.jsxs)("div",{className:t_()(eKS,{[`${eKS}--ghost`]:m}),children:[(0,ev.jsxs)("div",{className:`${eKS}__main`,children:[(0,ev.jsx)("span",{className:t_()(`${eKS}__status`,m?`${eKS}__status--removed`:`${eKS}__status--${h}`),children:f}),(0,ev.jsx)("div",{className:`${eKS}__icon`,children:(0,ev.jsx)(c,{})})]}),(0,ev.jsxs)("div",{className:`${eKS}__footer`,children:[(0,ev.jsx)("div",{className:`${eKS}__name`,title:g,children:g}),v?(0,ev.jsx)("div",{className:`${eKS}__ip`,title:v,children:v}):null]})]})}function eKC(e){let{mapEditInternal:t,setMapEditInternal:l,floorMapLayoutRef:a,forceEditMode:i,phoneLayout:n,onAutoArrange:s,autoArrangePending:r}=e,o=eKs(ik()),d=i||t,c=eKr(d?"pisell-topology.edit-map-done":"pisell-topology.edit-map",o)??"",u=eKr("pisell-topology.auto-arrange",o)??"",p=d&&"function"==typeof s,m=()=>{if(d){var e,t;null==(t=a.current)||null==(e=t.saveLayout)||e.call(t),i||l(!1);return}l(!0)};return n?(0,ev.jsxs)(ev.Fragment,{children:[p?(0,ev.jsx)("button",{type:"button",className:"pisell-floor-map-layout-view-controls-tool-btn",title:u,"aria-label":u,disabled:r,onClick:s,children:(0,ev.jsx)(PV,{})}):null,(0,ev.jsx)("button",{type:"button",className:d?"pisell-floor-map-layout-view-controls-tool-btn pisell-floor-map-layout-view-controls-tool-btn--active":"pisell-floor-map-layout-view-controls-tool-btn",title:c,"aria-label":c,"aria-pressed":d,onClick:m,children:d?(0,ev.jsx)(uj,{}):(0,ev.jsx)(hC,{})})]}):(0,ev.jsxs)("div",{className:"pisell-topology-floor-map-dock-actions",children:[p?(0,ev.jsx)(ex.Button,{size:"middle",icon:(0,ev.jsx)(PV,{}),className:"pisell-topology-floor-map-edit-btn",loading:r,onClick:s,children:u}):null,(0,ev.jsx)(ex.Button,{type:"primary",size:"middle",className:"pisell-topology-floor-map-edit-btn",onClick:m,children:c})]})}function eKT(e){let{scope:t,onChange:l,phoneLayout:a}=e,i=eKs(ik()),n="focused"===t,s=n?eKr("pisell-topology.scope.show-all",i)??"":eKr("pisell-topology.scope.focus",i)??"",r=()=>{l(n?"all":"focused")};return a?(0,ev.jsx)("button",{type:"button",className:"pisell-floor-map-layout-view-controls-tool-btn",title:s,"aria-label":s,"aria-pressed":!n,onClick:r,children:n?(0,ev.jsx)(oT,{}):(0,ev.jsx)(rQ,{})}):(0,ev.jsx)(ex.Button,{size:"middle",icon:n?(0,ev.jsx)(oT,{}):(0,ev.jsx)(rQ,{}),className:"pisell-topology-scope-toggle-btn",onClick:r,children:s})}let eKP="pisell-topology-connection-legend",eKA=[{i18nKey:"pisell-topology.legend.ethernet",color:"#94a3b8",dashed:!1},{i18nKey:"pisell-topology.legend.usb",color:"#8b5cf6",dashed:!1},{i18nKey:"pisell-topology.legend.bluetooth",color:"#3b82f6",dashed:!0},{i18nKey:"pisell-topology.legend.wifi",color:"#06b6d4",dashed:!0}];function eKD(){let e=eKs(ik());return(0,ev.jsxs)("div",{className:eKP,children:[(0,ev.jsx)("div",{className:`${eKP}__title`,children:eKr("pisell-topology.legend.title",e)}),(0,ev.jsx)("ul",{className:`${eKP}__list`,children:eKA.map(t=>(0,ev.jsxs)("li",{className:`${eKP}__row`,children:[(0,ev.jsx)("svg",{className:`${eKP}__line`,width:28,height:10,viewBox:"0 0 28 10","aria-hidden":!0,children:(0,ev.jsx)("line",{x1:1,y1:5,x2:27,y2:5,stroke:t.color,strokeWidth:2,strokeLinecap:"round",strokeDasharray:t.dashed?"4 3":void 0})}),(0,ev.jsx)("span",{className:`${eKP}__label`,children:eKr(t.i18nKey,e)})]},t.i18nKey))})]})}let eKI="devices",eKE="topologyDevice:",eKz="devices",eKL=["pos","receipt_printer","label_printer","switch","info_display","terminal","chenlei","test1"],eKO={pos:"POS",receipt_printer:"小票打印机",label_printer:"标签打印机",switch:"交换机",info_display:"显示屏",terminal:"终端",chenlei:"chenlei",test1:"test1"};function eKR(e){return`${eKE}${e}`}let eK$=[...eKL.map(eKR),`${eKE}unknown`];function eKF(e,t){if("string"==typeof e)return e.trim()||t;if(!e||"object"!=typeof e)return t;for(let t of[e["zh-CN"],e["zh-HK"],e.en,e.original])if("string"==typeof t&&t.trim())return t.trim();return t}function eKB(e){var t;return eKF(e.name,void 0)??eKF(null==(t=e.model)?void 0:t.name,void 0)??e.number??`#${e.id}`}function eKH(e,t){let l=new Map;for(let t of e)l.set(String(t.id),new Set);for(let e of t){let t=String(e.source_device_id),a=String(e.target_device_id);t!==a&&l.has(t)&&l.has(a)&&(l.get(t).add(a),l.get(a).add(t))}return l}function eKq(e,t){let l=new Set,a=[];for(let i of e){let e=String(i.id);if(l.has(e))continue;let n=[e],s=[];for(;n.length;){let e=n.shift();if(!l.has(e))for(let a of(l.add(e),s.push(e),t.get(e)??[]))l.has(a)||n.push(a)}a.push(s)}return a}let eKV=["smart","dumb","integrated"];function eKY(e){return"dumb"===e.type_kind?"dumb":"integrated"===e.type_kind?"integrated":"smart"}function eKU(e,t,l,a){let i=t.get(e);if(!i||0===i.size)return a;let n=0,s=0;for(let e of i){let t=l.get(e);null!=t&&(n+=t,s+=1)}return 0===s?a:n/s}function eKW(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:56,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1400,a=0,i=0,n=0,s=0,r=0,o=[];for(let d of e)a>0&&a+d.width>l&&(i+=n+t,a=0,n=0),o.push({cluster:d,offsetX:a,offsetY:i}),a+=d.width+t,n=Math.max(n,d.height),s=Math.max(s,a-t),r=Math.max(r,i+d.height);return{placements:o,totalRight:s,totalBottom:r}}function eKG(e,t,l,a){return{instanceId:`topology-device-${e.id}`,canvasId:"main",x:Math.round(t),y:Math.round(l),width:132,height:72,elementKind:eKZ(e,a),name:eKB(e),dataBinding:{dataSourceKey:eKI,recordId:String(e.id)}}}function eKQ(e,t){let l=new Map;if(0===e.length)return{positions:l,width:0,height:0};let a=new Map(e.map(e=>[String(e.id),e])),i=eKH(e,t),n=eKq(e,i),s=n.filter(e=>e.length>1),r=n.filter(e=>1===e.length).map(e=>e[0]),{placements:o,totalBottom:d}=eKW(s.map(e=>(function(e,t,l){if(1===e.length)return{positions:new Map([[e[0],{x:0,y:0}]]),width:132,height:72,size:1};let a={smart:[],dumb:[],integrated:[]};for(let t of e){let e=l.get(t);e&&a[eKY(e)].push(t)}let i=eKV.map(e=>a[e]);i[0].length>0&&(i[0]=function(e,t){if(e.length<=1)return[...e];let l=[...e].sort((l,a)=>{var i,n;let s=(null==(i=t.get(l))?void 0:i.size)??0,r=(null==(n=t.get(a))?void 0:n.size)??0;return r!==s?r-s:e.indexOf(l)-e.indexOf(a)}),a=[];return l.forEach((e,t)=>{t%2==0?a.push(e):a.unshift(e)}),a}(i[0],t));for(let e=1;e<i.length;e++)!function(e,t,l){if(e.length<=1||0===t.length)return;let a=new Map(t.map((e,t)=>[e,t]));e.sort((t,i)=>eKU(t,l,a,e.length)-eKU(i,l,a,e.length))}(i[e],i[e-1],t);let n=i.filter(e=>e.length>0),s=Math.max(...n.map(e=>132*e.length+(e.length-1)*56),132),r=72*n.length+(n.length-1)*56,o=new Map,d=0;for(let e of i){if(0===e.length)continue;let t=(s-(132*e.length+(e.length-1)*56))/2;e.forEach((e,l)=>{o.set(e,{x:t+188*l,y:d})}),d+=128}return{positions:o,width:s,height:r,size:e.length}})(e,i,a)).sort((e,t)=>t.size-e.size)),c=0,u=0;for(let e of o)for(let[t,a]of e.cluster.positions){let i=e.offsetX+a.x,n=e.offsetY+a.y;l.set(t,{x:i,y:n}),c=Math.max(c,i+132),u=Math.max(u,n+72)}if(r.length>0){let e=function(e,t){let l={smart:[],dumb:[],integrated:[]};for(let a of e){let e=t.get(a);e&&l[eKY(e)].push(a)}return l}(r,a),t=d>0?d+56:0;for(let a of eKV){let i=e[a];if(0===i.length)continue;let n=function(e,t,l){if(0===e.length)return{width:0,height:0};let a=Math.max(1,Math.min(e.length,Math.ceil(Math.sqrt(1.5*e.length)))),i=Math.ceil(e.length/a);return e.forEach((e,i)=>{let n=Math.floor(i/a);l.set(e,{x:0+i%a*188,y:t+128*n})}),{width:132*a+(a-1)*56,height:72*i+(i-1)*56}}(i,t,l);c=Math.max(c,n.width),u=Math.max(u,t+n.height),t+=n.height+56}}return{positions:l,width:c,height:u}}function eKK(e){return`topology-device-${e}`}let eKJ="topology-device-";function eKZ(e,t){let l=(e.type_code??"").trim();return(l&&t.get(l))??`${eKE}unknown`}let eKX={ethernet:{},lan:{},wired:{},usb:{color:"#8b5cf6"},bluetooth:{color:"#3b82f6",dashed:!0},bt:{color:"#3b82f6",dashed:!0},wifi:{color:"#06b6d4",dashed:!0},"wi-fi":{color:"#06b6d4",dashed:!0},wireless:{color:"#06b6d4",dashed:!0}};function eK0(e,t){let l=new Map(t.map(e=>[String(e.id),e])),a=e=>{let t=l.get(e);return t?eKV.indexOf(eKY(t)):0};return e.filter(e=>{let t=String(e.source_device_id),a=String(e.target_device_id);return l.has(t)&&l.has(a)&&t!==a}).map(e=>{var t,l,i;let n,s,r=String(e.source_device_id),o=String(e.target_device_id),d=a(r),c=a(o);d<c?(n="bottom",s="top"):d>c?(n="top",s="bottom"):(n="bottom",s="top");let u=(i=null==(t=e.config)?void 0:t.connection_type)?eKX[i.trim().toLowerCase()]??{}:{};return{id:`topology-connection-${e.id}`,sourceId:eKK(r),targetId:eKK(o),sourceAnchor:n,targetAnchor:s,status:function(e){switch(e){case"connected":case"online":return"online";case"disconnected":case"offline":return"offline";case"warning":return"warning";default:return"unknown"}}(e.status),...u.color?{color:u.color}:{},...u.dashed?{dashed:!0}:{},extensions:{connectionType:(null==(l=e.config)?void 0:l.connection_type)??null}}})}function eK2(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en";return[{id:"main",name:eKo(e),order:0,enabled:!0,mapLayer:{showGrid:!1,backgroundColor:"#ffffff"}}]}function eK1(e){let{rawDevices:t,rawConnections:l,savedSceneElements:a,savedEdges:i}=e,n=e.displayLocale??"en",{categories:s,kinds:r,typeCodeToKind:o}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en",t=new Map,l=eKL.map(e=>{let l=eKR(e);return t.set(e,l),{value:l,label:eKO[e]??e,categoryId:eKz,dataBindingPolicy:"optional",allowedDataSourceKeys:[eKI],showInPalette:!1}});return l.push({value:`${eKE}unknown`,label:"Unknown",categoryId:eKz,dataBindingPolicy:"optional",allowedDataSourceKeys:[eKI],showInPalette:!1}),l.push({value:lL.FLOOR_MAP_SELECTION_ZONE_ELEMENT_KIND,label:eKr("pisell-topology.category.area",e)??"分区",categoryId:eKz,dataBindingPolicy:"none",showInPalette:!1}),{categories:[{id:eKz,label:eKr("pisell-topology.category.devices",e)??"设备",order:0}],kinds:l,typeCodeToKind:t}}(n),d={[eKI]:t.map(e=>{var t;return{id:String(e.id),name:eKB(e),model:eKF(null==(t=e.model)?void 0:t.name,void 0)??e.model_code??void 0,sn:e.number??void 0,status:function(e){switch(e.status){case"online":return"online";case"offline":return"offline";case"warning":return"warning";default:return"unknown"}}(e),ip:function(e){let t=e.data;if(t&&"object"==typeof t){let e=t.network;if(e&&"object"==typeof e&&!Array.isArray(e)){let t=e.local_ip;if("string"==typeof t&&t.trim())return t.trim()}}}(e)}})};if(!a||0===a.length){let{sceneElements:e}=function(e,t,l){if(0===e.length)return{sceneElements:[]};let a=(function(e){let t=new Map,l=[];for(let n of e){let e=function(e){var t;let l=(null==(t=e.workarea)?void 0:t.id)??e.workarea_id;if(null==l)return null;let a=String(l).trim();return a&&"0"!==a?a:null}(n);if(null==e){l.push(n);continue}let s=t.get(e);if(!s){var a,i;s={workareaId:e,name:eKF(null==(a=n.workarea)?void 0:a.name,void 0)??`Workarea ${e}`,sort:"number"==typeof(null==(i=n.workarea)?void 0:i.sort)?n.workarea.sort:0,devices:[]},t.set(e,s)}s.devices.push(n)}let n=[...t.values()].sort((e,t)=>e.sort-t.sort||e.name.localeCompare(t.name));return l.length>0&&n.push({workareaId:null,name:"",sort:Number.MAX_SAFE_INTEGER,devices:l}),n})(e).map(e=>{let l=null!=e.workareaId,a=new Set(e.devices.map(e=>String(e.id))),i=t.filter(e=>a.has(String(e.source_device_id))&&a.has(String(e.target_device_id))),n=eKQ(e.devices,i),s=32*!!l,r=20*!!l;return{group:e,hasZone:l,block:n,innerPad:s,titleTop:r,outerW:n.width+2*s,outerH:n.height+2*s+r}}),i=eKW(a.map(e=>({positions:e.block.positions,width:e.outerW,height:e.outerH,size:e.group.devices.length})),32),n=[];return i.placements.forEach((e,t)=>{let{offsetX:i,offsetY:s}=e,r=a[t],o=40+i,d=40+s;r.hasZone&&n.push({instanceId:`topology-workarea-${r.group.workareaId}`,canvasId:"main",x:Math.round(o),y:Math.round(d),width:Math.round(r.outerW),height:Math.round(r.outerH),elementKind:lL.FLOOR_MAP_SELECTION_ZONE_ELEMENT_KIND,name:r.group.name,zIndex:-50});let c=o+r.innerPad,u=d+r.innerPad+r.titleTop;for(let e of r.group.devices){let t=r.block.positions.get(String(e.id))??{x:0,y:0};n.push(eKG(e,c+t.x,u+t.y,l))}}),{sceneElements:n}}(t,l,o),a=eK0(l,t);return{config:{canvases:eK2(n),canvasUi:{canCreate:!1,canEdit:!1},elementKindCategories:s,elementKinds:r,sceneElements:e,edges:a},dataSources:d,addedDeviceIds:t.map(e=>String(e.id)),ghostInstanceIds:[],ghostDeviceIds:[],keptDeviceIds:[]}}let c=new Map,u=[];for(let e of a){var p;let t=null==(p=e.dataBinding)?void 0:p.recordId,l="string"==typeof t&&t.trim()?t:function(e){if(!e.startsWith(eKJ))return null;let t=e.slice(eKJ.length);return t.length>0?t:null}(e.instanceId);l?c.set(l,e):u.push(e)}let m=new Map(t.map(e=>[String(e.id),e])),g=[],h=[],v=[];for(let e of t){let t=String(e.id),l=c.get(t);l?(g.push({...l,elementKind:eKZ(e,o),name:eKB(e),dataBinding:{dataSourceKey:eKI,recordId:t}}),v.push(t)):h.push(e)}let f=[],y=[],x=[];for(let[e,t]of c)m.has(e)||(f.push(t),y.push(t.instanceId),x.push(e));let b=function(e,t,l,a,i){if(0===e.length)return[];let n=40,s=[...l,...a];for(let e of s){let t=(e.y??0)+(e.height??72);t>n&&(n=t)}s.length>0&&(n+=112);let{sceneElements:r}=function(e,t,l){if(0===e.length)return{sceneElements:[]};let{positions:a}=eKQ(e,t);return{sceneElements:e.map(e=>{let t=a.get(String(e.id))??{x:0,y:0};return eKG(e,40+t.x,40+t.y,l)})}}(e,t,i),o=n-40;return 0===o?r:r.map(e=>({...e,y:(e.y??0)+o}))}(h,l,[...g,...u],f,o),_=[...u,...g,...b,...f],k=new Map((i??[]).map(e=>[e.id,e])),w=eK0(l,t).map(e=>{let t=k.get(e.id);return(null==t?void 0:t.routing)?{...e,routing:t.routing}:e});return{config:{canvases:eK2(n),canvasUi:{canCreate:!1,canEdit:!1},elementKindCategories:s,elementKinds:r,sceneElements:_,edges:w},dataSources:d,addedDeviceIds:h.map(e=>String(e.id)),ghostInstanceIds:y,ghostDeviceIds:x,keptDeviceIds:v}}let eK4={isPisell2:!0},eK3={with:["type","model","workarea"],structure:["standalone","composite"]};async function eK8(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eK3,t=e.structure??eK3.structure??[],l={with:e.with??["type","model","workarea"],"structure[]":t,...null!=e.workarea_id?{workarea_id:e.workarea_id}:{},...e.type_kind?{type_kind:e.type_kind}:{},...null!=e.profile_id?{profile_id:e.profile_id}:{}},a={method:"GET",url:"/tenant/device",params:l},i=await z_.Em.getRequest().get(a.url,l,eK4);return{request:a,response:i}}let eK6={with:[],type:"dumb"};async function eK5(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eK6,t={with:e.with??[],type:e.type??"dumb",...null!=e.source_device_id?{source_device_id:e.source_device_id}:{},...null!=e.target_device_id?{target_device_id:e.target_device_id}:{}},l={method:"GET",url:"/tenant/device/connection",params:t},a=await z_.Em.getRequest().get(l.url,t,eK4);return{request:l,response:a}}var eK7=JSON.parse('{"name":{"en":"Topology","ja":"トポロジ","pt":"Topologia","zh-CN":"设备拓扑","zh-HK":"設備拓撲"},"layout":{},"canvas_width":1920,"canvas_height":1080,"sort":0,"status":1}');let eK9="topologyRouter",eJe="topologySwitch",eJt="topologyAp",eJl=(0,lL.createShopFloorPlanClient)({http:{get:(e,t,l)=>z_.Em.getRequest().get(e,t??{},l??{}),post:(e,t,l)=>z_.Em.getRequest().post(e,t??{},l??{}),put:(e,t,l)=>z_.Em.getRequest().put(e,t??{},l??{})},useShopApi:!0,getSaveFailedMessage:()=>eKr("pisell-topology.floor-plan.save-failed",eKs(void 0))||"Failed to save topology floor plan"});eJl.getShopFloorPlanByCode.bind(eJl);let eJa=eJl.putShopFloorPlan.bind(eJl),eJi=eJl.unsubscribeShopFloorPlanCodeQuery.bind(eJl);function eJn(e){let t,l=null==e?void 0:e.trim();if(!l)throw Error("floor plan code is required");return{code:l,name:{...eK7.name},layout:(0,lL.viewConfigToLayoutPayload)({canvases:[{id:"main",name:"Actual Topology",order:0,enabled:!0,mapLayer:{showGrid:!1,backgroundColor:"#ffffff"}}],canvasUi:{canCreate:!0,canEdit:!0},elementKindCategories:[{id:"layout",label:"Layout",order:-1},{id:"network",label:"Network",order:0},{id:"pos",label:"POS",order:1},{id:"gate",label:"Gate",order:2},{id:"amusement",label:"Amusement",order:3}],elementKinds:(t={dataBindingPolicy:"optional",allowedDataSourceKeys:[eKI],showInPalette:!0},[{value:lL.FLOOR_MAP_SELECTION_ZONE_ELEMENT_KIND,label:"Area",categoryId:"layout",dataBindingPolicy:"none",showInPalette:!0},{value:eK9,label:"Router",categoryId:"network",...t},{value:eJe,label:"Switch",categoryId:"network",...t},{value:eJt,label:"AP",categoryId:"network",...t},{value:"topologyCashier",label:"Cashier",categoryId:"pos",...t},{value:"topologyGate",label:"Gate",categoryId:"gate",...t},{value:"topologyKiosk",label:"Kiosk",categoryId:"pos",...t},{value:"topologyIntegratedPos",label:"Integrated POS",categoryId:"pos",...t},{value:"topologyPrinter",label:"打印机",categoryId:"pos",...t},{value:"topologyAmusement",label:"Amusement",categoryId:"amusement",...t}]),sceneElements:[{instanceId:"gw-1",canvasId:"main",x:360,y:40,width:120,height:88,elementKind:eK9,name:"Gateway",dataBinding:{dataSourceKey:"devices",recordId:"gw-1"}},{instanceId:"sw-core",canvasId:"main",x:340,y:180,width:140,height:88,elementKind:eJe,name:"MainRack_CoreSW",dataBinding:{dataSourceKey:"devices",recordId:"sw-core"}},{instanceId:"sw-sub",canvasId:"main",x:160,y:320,width:120,height:88,elementKind:eJe,name:"SubRack_Switch",dataBinding:{dataSourceKey:"devices",recordId:"sw-sub"}},{instanceId:"ap-group",canvasId:"main",x:520,y:320,width:100,height:88,elementKind:eJt,name:"AP Group",dataBinding:{dataSourceKey:"devices",recordId:"ap-group"}}],edges:[{id:"e-gw-sw",sourceId:"gw-1",targetId:"sw-core",sourceAnchor:"bottom",targetAnchor:"top",sourceLabel:"WAN",targetLabel:"Gi48",status:"online"},{id:"e-sw-sub",sourceId:"sw-core",targetId:"sw-sub",sourceAnchor:"left",targetAnchor:"top",sourceLabel:"Gi1",targetLabel:"Te51",status:"online"},{id:"e-sw-ap",sourceId:"sw-core",targetId:"ap-group",sourceAnchor:"right",targetAnchor:"top",sourceLabel:"Gi2",targetLabel:"Po1",status:"online"}]}),canvas_width:eK7.canvas_width,canvas_height:eK7.canvas_height,...void 0!==eK7.sort?{sort:eK7.sort}:{},...void 0!==eK7.status?{status:eK7.status}:{}}}async function eJs(e,t){let{buildDefaultPostBody:l,...a}=t??{};return eJl.ensureShopFloorPlanByCode(e,{...a,buildDefaultPostBody:l??eJn})}async function eJr(e,t,l){let a=(0,lL.buildFloorPlanPutBody)(t,l);return(l.putFloorPlan??eJa)(e,a)}function eJo(e){(0,lL.PisellToast)({content:e instanceof Error?e.message:String(e)})}function eJd(e){(0,lL.PisellToast)({content:e instanceof Error?e.message:String(e)})}let eJc=`${eKE}unknown`;function eJu(e){let t=null==e?void 0:e.trim();if(!t)throw Error("floor plan code is required");return{code:t,name:{"zh-CN":"拓扑"},layout:{canvases:[{id:"main",name:"Devices",order:0,enabled:!0}],canvasUi:{canCreate:!1,canEdit:!1},sceneElements:[],edges:[]},canvas_width:1920,canvas_height:1080}}let eJp="pisell-topology",eJm={get:async()=>({data:[]}),post:async()=>({data:{}}),put:async()=>({data:{}}),remove:async()=>({data:{}}),custom:async()=>({data:{}})};function eJg(e){var t;let{className:l,style:a,devices:i,overviewHud:n,mode:s="read",floorPlanCode:r,floorPlanCanvasWidth:o,floorPlanCanvasHeight:d,floorPlanName:c,floorPlanSort:u,floorPlanStatus:p,putFloorPlan:m,onFloorPlanPersisted:g}=e,h=(null==r?void 0:r.trim())||"pisell_topology",v=ik(),f=eKs(v),{request:y,isWebPos:x}=(null==v||null==(t=v.appHelper)?void 0:t.utils)||{},b=eVR(x),_=(0,ef.useMemo)(()=>{try{var e,t,l;let a=null==v||null==(l=v.appHelper)||null==(t=l.utils)||null==(e=t.getApp)?void 0:e.call(t),i=null==a?void 0:a.storage;if(!(null==i?void 0:i.getStorage))return null;let n=i.getStorage("iotDevice");if(!n)return null;let s="string"==typeof n?JSON.parse(n):n,r=null==s?void 0:s.id;return null!=r&&""!==r?String(r):null}catch{return null}},[v]),k=eFF();(0,ef.useEffect)(()=>{eN.init({en:eKn.en??{},"zh-CN":eKn["zh-CN"]??eKn.zh??{},"zh-HK":eKn["zh-HK"]??eKn.tc??{}},f),eN.init(eFB,f),(0,lL.initFloorMapLayoutLocales)(f)},[f]),z_.Em.setRequest(y??eJm),(0,ef.useEffect)(()=>{y&&z_.Em.setRequest(y)},[y]);let[w,j]=(0,ef.useState)([]),[S,M]=(0,ef.useState)([]),[N,C]=(0,ef.useState)(()=>!!(i&&i.length>0));(0,ef.useEffect)(()=>{if(i&&i.length>0){M([]),C(!0);return}C(!1);let e=!1;return Promise.all([eK8(),eK5()]).then(t=>{let[l,a]=t;if(e)return;let i=function(e){if(Array.isArray(e))return e;if(e&&"object"==typeof e){let t=e.data;if(Array.isArray(t))return t}return[]}(l.response),n=function(e){if(Array.isArray(e))return e;if(e&&"object"==typeof e){let t=e.data;if(Array.isArray(t))return t}return[]}(a.response);j(i),M(n)}).catch(t=>{e||(console.error("[PisellTopology] 拉取设备 / 连接失败:",t),j([]),M([]))}).finally(()=>{e||C(!0)}),()=>{e=!0}},[i]);let T=(0,ef.useMemo)(()=>i&&0!==i.length?i.map((e,t)=>({id:e.id??`prop-${t}`,type_code:"unknown",name:e.name??null,model:e.model?{name:{original:e.model}}:null,number:e.sn??null,status:e.status??null})):[],[i]),P=T.length>0?T:w,A=function(e){let{rawDevices:t,translation:l}=e,[a,i]=(0,ef.useState)(!1),[n,s]=(0,ef.useState)(),r=(0,ef.useMemo)(()=>new Map(t.map(e=>[String(e.id),e])),[t]);return{open:a,record:n,openByItem:(0,ef.useCallback)(e=>{var t,a,n;let o=null==(a=e._sceneElement)||null==(t=a.dataBinding)?void 0:t.recordId;if(null==o||!Number.isFinite(Number(o)))return;let d=r.get(String(o));s((n=String(o),eBT({id:Number(n),type_kind:(null==d?void 0:d.type_kind)??"smart",type_code:(null==d?void 0:d.type_code)??"unknown",model_code:(null==d?void 0:d.model_code)??"",name:(null==d?void 0:d.name)??{original:`#${n}`},number:(null==d?void 0:d.number)??void 0,status:null==d?void 0:d.status,link:null==d?void 0:d.link,data:(null==d?void 0:d.data)??null,type:null==d?void 0:d.type,model:null==d?void 0:d.model},l))),i(!0)},[r,l]),close:(0,ef.useCallback)(()=>i(!1),[])}}({rawDevices:P,translation:k}),[D,I]=(0,ef.useState)(!1),[E,z]=(0,ef.useState)("focused"),L="edit"===s||D?"edit":"read",O="edit"===s,R=!i||0===i.length,{floorPlanRemoteId:$,savedSceneElements:F,savedEdges:B,isLoaded:H,applyLocalSave:q,setRemoteFloorPlanView:V}=function(e){let{floorPlanCode:t,enabled:l=!0,subscribeFloorPlanPush:a=!1}=e,[i,n]=(0,ef.useState)(null),[s,r]=(0,ef.useState)(void 0),[o,d]=(0,ef.useState)(void 0),c=(0,ef.useRef)((0,eH.LP)("topology-floor-plan-code")),u=(0,ef.useCallback)((e,t)=>eJs(e,{...t,buildDefaultPostBody:eJu}),[]),p=(0,ef.useCallback)(e=>{"number"==typeof e.id&&Number.isFinite(e.id)&&n(Math.trunc(e.id));let t=(0,lL.parseLayoutFieldToViewConfigPatch)(e.layout);if(t){r(t.sceneElements??[]),d(t.edges??[]);return}if(Array.isArray(e.layout)){r(e.layout.length>0?(0,lL.shopLayoutToSceneElements)(e.layout,{canvasId:"main",dataSourceKey:eKI,rectElementKind:eJc,circleElementKind:eJc}):[]),d([]);return}r([]),d([])},[]);return(0,ef.useEffect)(()=>{l||(n(null),r(void 0),d(void 0))},[l,t]),(0,ef.useEffect)(()=>{if(!l||!t||a)return;let e=!1;return u(t).then(t=>{!e&&t&&p(t)}).catch(t=>{e||eJd(t)}),()=>{e=!0}},[l,t,a,u,p]),(0,lL.useShopFloorPlanSubscription)({enabled:l&&!!t&&a,code:t,subscriberId:c.current,ensureByCode:u,unsubscribeQuery:eJi,onDetail:p,onLoadError:eJd}),{floorPlanRemoteId:i,savedSceneElements:s,savedEdges:o,isLoaded:void 0!==s,applyLocalSave:(0,ef.useCallback)(e=>{r(e.sceneElements),d(e.edges)},[]),setRemoteFloorPlanView:(0,ef.useCallback)(e=>{if(null==e){r(void 0),d(void 0);return}null!=e.sceneElements&&r(e.sceneElements),null!=e.edges&&d(e.edges)},[])}}({floorPlanCode:h,enabled:R,subscribeFloorPlanPush:b}),Y=N&&(!R||H),U=(0,ef.useMemo)(()=>Y?eK1({rawDevices:P,rawConnections:S,savedSceneElements:R?F:void 0,savedEdges:R?B:void 0,displayLocale:f}):null,[Y,P,S,R,F,B,f]),W=(0,ef.useMemo)(()=>{if(null==_)return null;let e=function(e,t,l){if(!e.some(e=>String(e.id)===l))return null;let a=eKH(e,t);for(let t of eKq(e,a))if(t.includes(l))return new Set(t);return new Set([l])}(P,S,_);return e?{rawDevices:P.filter(t=>e.has(String(t.id))),rawConnections:S.filter(t=>e.has(String(t.source_device_id))&&e.has(String(t.target_device_id)))}:null},[_,P,S]),G=null!=W&&"read"===L,Q=G&&"focused"===E?"focused":"all",K=(0,ef.useMemo)(()=>"focused"===Q&&W?eK1({rawDevices:W.rawDevices,rawConnections:W.rawConnections,savedSceneElements:void 0,savedEdges:void 0,displayLocale:f}):null,[Q,W,f]),J="focused"===Q?K:U,Z=(0,ef.useMemo)(()=>{let e="edit"===L,t=null==J?void 0:J.config;return t?{...t,canvasUi:{canCreate:e,canEdit:e}}:{canvases:[{id:"main",name:eKo(f),order:0,enabled:!0,mapLayer:{showGrid:!1,backgroundColor:"#ffffff"}}],canvasUi:{canCreate:e,canEdit:e},elementKinds:[],sceneElements:[],edges:[]}},[J,L,f]),X=(null==J?void 0:J.dataSources)??{devices:[]},ee=(0,ef.useRef)(null);(0,ef.useEffect)(()=>{var e;if(!R||!Y||!U||!H||null==$||0===P.length||((null==(e=U.config.sceneElements)?void 0:e.length)??0)===0||0===U.addedDeviceIds.length||"edit"===L)return;let t=Symbol("topology-autosave");ee.current=t;let l=U.config.sceneElements??[],a=U.config.edges??[];eJr($,U.config,{canvasWidth:o,canvasHeight:d,code:h,name:c,sort:u,status:p,putFloorPlan:null!=m?(e,t)=>m(e,t):void 0}).then(()=>{ee.current===t&&(q({sceneElements:l,edges:a}),null==g||g())}).catch(e=>{console.warn("[PisellTopology] auto-save floor-plan failed:",e)})},[R,Y,H,$,U,P.length,L,h,o,d,c,u,p,m,g,q]);let et=(0,ef.useMemo)(()=>new Map((X[eKI]??[]).map(e=>[e.id,e])),[X]),el=(0,ef.useMemo)(()=>(function(e,t){let l={};for(let a of(l[lL.FLOOR_MAP_SELECTION_ZONE_ELEMENT_KIND]=e=>{var t;return(0,ev.jsx)(lL.FloorMapSelectionZoneElement,{name:e.name??(null==(t=e._sceneElement)?void 0:t.name)})},e))l[a]=e=>{var l;let a=null==(l=e._sceneElement)?void 0:l.dataBinding,i=(null==a?void 0:a.recordId)!=null?t.get(String(a.recordId)):void 0;return(0,ev.jsx)(eKN,{item:e,device:i})};return l})(eK$,et),[et]),ea=(0,ef.useRef)(null),ei=(0,ef.useRef)(Q);(0,ef.useEffect)(()=>{if(ei.current===Q)return;ei.current=Q;let e=setTimeout(()=>{var e,t;null==(t=ea.current)||null==(e=t.fitBounds)||e.call(t)},60);return()=>clearTimeout(e)},[Q]);let en=(0,ef.useMemo)(()=>{let t=R&&null!=$&&Number.isFinite($)&&$>0;return(0,lL.wrapFloorMapOnSaveWithRemotePersist)({canPersist:t,persistTargetId:$??0,persist:(e,t)=>eJr(e,t,{canvasWidth:o,canvasHeight:d,code:h,name:c,sort:u,status:p,putFloorPlan:null!=m?(e,t)=>m(e,t):void 0}),setRemoteFloorPlanView:V,onFloorPlanPersisted:g,prevOnSave:e.onSave,onPersistError:eJo})},[R,$,o,d,h,c,u,p,m,V,g,e.onSave]),es=(0,ef.useCallback)(()=>{var e,t;if(0===P.length)return;let{config:l}=eK1({rawDevices:P,rawConnections:S,displayLocale:f}),a={...Z,...l,canvasUi:Z.canvasUi};null==(t=ea.current)||null==(e=t.applySceneSnapshot)||e.call(t,a)},[P,S,Z,f]);return(0,ev.jsxs)("div",{className:`${eJp}-root`,children:[(0,ev.jsx)("div",{className:`${eJp}-legend-anchor`,children:(0,ev.jsx)(eKD,{})}),(0,ev.jsx)(lL.PisellFloorMapLayout,{ref:ea,className:t_()(eJp,l),style:{width:"100%",height:"100%",minHeight:0,flex:1,...a},items:[],renderItem:()=>null,floorMapConfig:Z,dataSources:X,loading:!Y,mode:L,itemUnit:"pixel",enableEdges:!0,enableHover:!1,onItemClick:e=>{"read"===L&&A.openByItem(e)},toolbarShowSave:"edit"===L,onSave:en,renderItemByKind:el,floorMapViewportOverlay:!1!==n&&(!0===n||void 0===n?void 0:n),viewportOverlayPlacement:"top-start",controls:{showZoom:!0,showFitBounds:!0,showReset:!0,showGridToggle:!1,horizontalAlign:"end"},onExitEdit:O?void 0:()=>I(!1),viewportDockTrailing:(0,ev.jsxs)("div",{className:`${eJp}-dock-trailing`,children:[G?(0,ev.jsx)(eKT,{scope:Q,onChange:z}):null,(0,ev.jsx)(eKC,{mapEditInternal:D,setMapEditInternal:I,floorMapLayoutRef:ea,forceEditMode:O,onAutoArrange:R?es:void 0})]}),pan:{enabled:!0},zoom:{autoFitOnMount:!0,min:.25,max:2}}),A.record?(0,ev.jsx)(eBQ,{open:A.open,record:A.record,readonly:!0,getText:eN.getText,translation:k,onClose:A.close},A.record.id):null]})}let eJh=eJg,eJv=new class{initPeripheralsListener(e){var t,l;this.isInitialized||(this.isInitialized=!0,null==e||null==(l=e.utils)||null==(t=l.mountFunction)||t.call(l,"global","peripheralsResult",e=>{try{let t=JSON.parse(e||"{}"),l=this.listeners[0];l&&l.callback(t)}catch(e){console.error(e)}}))}addListener(e,t,l){let a=this.listeners.findIndex(e=>e.key===t);-1!==a&&this.listeners.splice(a,1),this.listeners.unshift({key:t,callback:l}),this.initPeripheralsListener(e)}removeListener(e){let t=this.listeners.findIndex(t=>t.key===e);-1!==t&&this.listeners.splice(t,1)}getActiveListener(){var e;return(null==(e=this.listeners[0])?void 0:e.key)||null}setActiveListener(e){let t=this.listeners.findIndex(t=>t.key===e);if(-1===t||0===t)return;let[l]=this.listeners.splice(t,1);this.listeners.unshift(l)}destroy(){this.listeners=[]}constructor(){(0,eD._)(this,"isInitialized",!1),(0,eD._)(this,"listeners",[]),this.listeners=[]}},eJf=()=>{var e,t;return null==(t=ik().appHelper)||null==(e=t.utils)?void 0:e.getApp},eJy=e=>{let[t,l]=(0,ef.useState)(null),a=()=>{l({visible:!1})};return{modalProps:t||{},visible:null==t?void 0:t.visible,open:t=>{l({key:e,...t||{},visible:!0,onCancel:()=>{var e;a(),null==t||null==(e=t.onCancel)||e.call(t)},onOk:e=>{var l;a(),null==t||null==(l=t.onOk)||l.call(t,e)}})},close:a}},eJx=()=>{var e,t;let l=ik(),a=(null==l||null==(t=l.appHelper)||null==(e=t.utils)?void 0:e.request)||{};return{get:(e,t,l)=>null==a?void 0:a.get(e,t,l),post:(e,t,l)=>null==a?void 0:a.post(e,t,l),put:(e,t,l)=>null==a?void 0:a.put(e,t,l),remove:(e,t,l)=>null==a?void 0:a.remove(e,t,l)}},eJb=()=>{var e,t;ik();let l=new URLSearchParams((null==(t=window)||null==(e=t.location)?void 0:e.search)||{}).get("goal_shop_id");return{goalShopId:l?Number(l):void 0,isNormalShop:!!l}},eJ_=()=>{var e,t,l,a,i,n,s,r,o,d,c,u,p;let m=ik(),g=(null==m||null==(e=m.appHelper)?void 0:e.utils)||{};return(null==g||null==(s=g.getStore)||null==(n=s.call(g))||null==(i=n.getState)||null==(a=i.call(n))||null==(l=a.global)||null==(t=l.shop)?void 0:t.id)||(null==g||null==(r=g.getData)?void 0:r.call(g,"shop_id"))||(null==(p=g.store)||null==(u=p.getState)||null==(c=u.call(p))||null==(d=c.global)||null==(o=d.globalConfig)?void 0:o.id)||void 0},eJk=()=>{let e=ij();return"h5"===e||"pc"===e},eJw={en:{"pisell2.text.ecocup.cup-id":"Cup ID","pisell2.text.ecocup.button.return":"Return","pisell2.text.ecocup.button.others":"others","pisell2.text.ecocup.button.missing":"Missing","pisell2.text.ecocup.button.broken":"Broken","pisell2.text.ecocup.button.clear-all":"Clear All","pisell2.text.ecocup.button.mark-as-return":"Return","pisell2.text.ecocup.button.mark-as-missing":"Mark as Missing","pisell2.text.ecocup.button.mark-as-broken":"Mark as Broken","pisell2.text.ecocup.button.cancel":"Cancel","pisell2.text.ecocup.button.confirm":"Confirm","pisell2.text.ecocup.button.remove":"Remove","pisell2.text.ecocup.button.dismiss":"Dismiss","pisell2.text.ecocup.button.transfer":"Transfer to my store","pisell2.text.ecocup.toast.success-return":"Returned success","pisell2.text.ecocup.toast.success-missing":"Mark as missing success","pisell2.text.ecocup.toast.success-broken":"Mark as broken success","pisell2.text.ecocup.toast.success-transfer":"Transferred success","pisell2.text.ecocup.toast.fail-no-match-customer":"No matching customer found","pisell2.text.cup-project.title":"ECO Cup Project","pisell2.text.cup-project.search-bar.placeholder":"mobile number or cup code","pisell2.text.cup-project.footer.button.new-customer":"New Customer","pisell2.text.cup-project.footer.button.customer-list":"Customer list","pisell2.text.cup-project.footer.button.cup-list":"Cup list","pisell2.text.cup-project.footer.button.setting":"Setting","pisell2.text.cup-project.footer.button.register-cups":"Register Cups to Inventory","pisell2.text.cup-project.search-bar.result.header.name":"Name","pisell2.text.cup-project.search-bar.result.header.registrationTime":"Registration Time","pisell2.text.cup-project.search-bar.result.header.phone":"Phone Number","pisell2.text.cup-project.search-bar.result.header.email":"Email address","pisell2.text.cup-project.search-bar.result.header.membership":"Membership","pisell2.text.ecocup.title":"Eco-Cup","pisell2.text.ecocup.status.placeholder":"Select Status","pisell2.text.ecocup.status.shop.placeholder":"Select Shop","pisell2.text.ecocup.scan-or-search":"mobile number or cup code","pisell2.text.ecocup.available-to-rent":"Stock Available to Rent Now","pisell2.text.ecocup.rent":"Rent","pisell2.text.ecocup.broken":"Broken","pisell2.text.ecocup.cup-rent":"Cup Rent (During Selected Period)","pisell2.text.ecocup.cup-returned":"Cup Returned (During Selected Period)","pisell2.text.ecocup.eco.cup-rent":"Cup Rent (all shops during selected period)","pisell2.text.ecocup.eco.cup-returned":"Cup Returned (all shops during selected period)","pisell2.text.ecocup.table.cup-code":"Cup Code","pisell2.text.ecocup.table.customer":"Customer","pisell2.text.ecocup.table.status":"Status","pisell2.text.ecocup.table.shop-of-rent":"Shop of Rent","pisell2.text.ecocup.table.time-of-rent":"Time of Rent","pisell2.text.ecocup.table.shop-of-return":"Shop of Return","pisell2.text.ecocup.table.time-of-return":"Time of Return","pisell2.text.ecocup.table.operated-at":"Operated at","pisell2.text.ecocup.table.actions":"actions","pisell2.text.ecocup.status.rent":"Rent","pisell2.text.ecocup.status.in-stock":"In stock","pisell2.text.ecocup.status.all":"All","pisell2.text.ecocup.status.shop-changed":"Shop changed","pisell2.text.ecocup.status.overtime":"Overtime","pisell2.text.ecocup.status.expire-soon":"Expire soon","pisell2.text.ecocup.status.borrowing":"borrowing","pisell2.text.ecocup.status.returned":"Returned","pisell2.text.ecocup.action.return":"Return","pisell2.text.ecocup.action.more":"more","pisell2.text.ecocup.action.more.missing":"Missing","pisell2.text.ecocup.action.more.broken":"Broken","pisell2.text.ecocup.table.time-of-rent.relative":e=>`${e} ${1===e?"day":"days"} ago`,"pisell2.text.ecocup.table.time-of-return.today":"Today","pisell2.text.ecocup.share.title":"Share","pisell2.text.ecocup.export.title":"Export","pisell2.text.ecocup.customer.list.title":"Customer List","pisell2.text.ecocup.customer.list.customer":"Cutomer","pisell2.text.ecocup.customer.list.registed":"Registed","pisell2.text.ecocup.customer.list.email":"Email","pisell2.text.ecocup.customer.list.mobile":"Mobile","pisell2.text.ecocup.customer.list.cup.borrowed":"Cup borrowed","pisell2.text.ecocup.customer.list.cup.returned":"Cup returned","pisell2.text.ecocup.customer.list.customer.profile":"Customer Profile","pisell2.text.ecocup.customer.list.search.placeholder":"mobile number","pisell2.text.ecocup.add-customer-modal.title":"Add Customer","pisell2.text.ecocup.add-customer-modal.first-name":"First Name","pisell2.text.ecocup.add-customer-modal.first-name-placeholder":"First Name","pisell2.text.ecocup.add-customer-modal.first-name-required":"First Name is required","pisell2.text.ecocup.add-customer-modal.last-name":"Last Name","pisell2.text.ecocup.add-customer-modal.last-name-placeholder":"Last Name","pisell2.text.ecocup.add-customer-modal.last-name-required":"Last Name is required","pisell2.text.ecocup.add-customer-modal.phone":"Phone","pisell2.text.ecocup.add-customer-modal.phone-placeholder":"Phone","pisell2.text.ecocup.add-customer-modal.phone-error":"Please enter a valid phone number","pisell2.text.ecocup.add-customer-modal.phone-required":"Phone is required","pisell2.text.ecocup.add-customer-modal.email":"Email","pisell2.text.ecocup.add-customer-modal.email-placeholder":"Email","pisell2.text.ecocup.add-customer-modal.email-required":"Email is required","pisell2.text.ecocup.add-customer-modal.membership":"Customer Group","pisell2.text.ecocup.add-customer-modal.success":"Customer added successfully","pisell2.text.ecocup.cup-action-modal.title-return":"Cup Return","pisell2.text.ecocup.cup-action-modal.title-missing":"Cup Missing","pisell2.text.ecocup.cup-action-modal.title-broken":"Cup Broken","pisell2.text.ecocup.cup-action-modal.cup-id":"Cup ID","pisell2.text.ecocup.cup-action-modal.cup-tip":"Rent at","pisell2.text.ecocup.cup-info-card.title.rentInfo":"Rent at","pisell2.text.ecocup.cup-info-card.title.markInfo":"Marked by","pisell2.text.ecocup.cup-info-card.title.belongInfo":"Belongs to","pisell2.text.ecocup.cup-info-card.title.otherBelongInfo":"This cup belongs to","pisell2.text.ecocup.cup-info-card.title.multiple-shop":"multiple shop detected","pisell2.text.ecocup.cup-info-card.title.multiple-time":"multiple time detected","pisell2.text.ecocup.cup-info-card.title.multiple-customer":"Multiple customers","pisell2.text.ecocup.customer-first-modal.title":"Rent/Return Cup(s)","pisell2.text.ecocup.customer-first-modal.search-tip":"Please scan/input the correct ECO Cup code.","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder":"mobile number or cup code","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder-cup":"cup code","pisell2.text.ecocup.customer-first-modal.over-max":"Please Remove {{num}} cup(s)","pisell2.text.ecocup.customer-first-modal.no-customer":"Please Log in customer","pisell2.text.ecocup.search-bar.search-tip":"Please scan/input the correct ECO Cup code.","pisell2.text.ecocup.cup-status-modal.title-other_rent":e=>`Cup Return ${e>1?`(${e} cups)`:""}`,"pisell2.text.ecocup.cup-status-modal.title-other_in_stock":"Cup not in your inventory","pisell2.text.ecocup.cup-status-modal.title-missing":"Cup Marked as Missing","pisell2.text.ecocup.cup-status-modal.title-broken":"Cup Marked as Broken","pisell2.text.ecocup.cup-status-modal.title-not_found":"Cup not in your inventory","pisell2.text.ecocup.cup-status-modal.tip":"Please add to inventory first before renting","pisell2.text.ecocup.cup-status-modal.tip-in-stock":"Please report to Eco-cup admin for further actions","pisell2.text.ecocup.setting.expire-time":"Expire Time","pisell2.text.ecocup.setting.expire-time-placeholder":"Expire Time","pisell2.text.ecocup.setting.expire-time-required":"Expire Time is required","pisell2.text.ecocup.setting.expire-time-max":"Expire Time must be less than 365 days","pisell2.text.ecocup.setting.expire-time-min":"Expire Time must be greater than 0","pisell2.text.ecocup.setting.max-rent-count-max":"Max Rent Count must be less than 9999","pisell2.text.ecocup.setting.max-rent-count-min":"Max Rent Count must be greater than 0","pisell2.text.ecocup.setting.days":"Days","pisell2.text.ecocup.setting.regular":"Regular","pisell2.text.ecocup.setting.regular-placeholder":"Regular","pisell2.text.ecocup.setting.regular-required":"Regular is required","pisell2.text.ecocup.setting.business":"Business","pisell2.text.ecocup.setting.business-placeholder":"Business","pisell2.text.ecocup.setting.business-required":"Business is required","pisell2.text.ecocup.setting.admin":"Admin","pisell2.text.ecocup.setting.admin-placeholder":"Admin","pisell2.text.ecocup.setting.admin-required":"Admin is required","pisell2.text.ecocup.setting.success":"Settings saved successfully","pisell2.text.ecocup.export.fail":"Export failed","pisell2.text.ecocup.export.success":"Export success","pisell2.text.ecocup.cup-status-modal.search-bar.title":"Scan multiple cups and return together","pisell2.text.ecocup.toast.success-copy-link":"Link copied to clipboard"},"zh-CN":{"pisell2.text.ecocup.cup-id":"Cup ID","pisell2.text.ecocup.button.return":"Return","pisell2.text.ecocup.button.others":"others","pisell2.text.ecocup.button.missing":"Missing","pisell2.text.ecocup.button.broken":"Broken","pisell2.text.ecocup.button.clear-all":"Clear All","pisell2.text.ecocup.button.mark-as-return":"Return","pisell2.text.ecocup.button.mark-as-missing":"Mark as Missing","pisell2.text.ecocup.button.mark-as-broken":"Mark as Broken","pisell2.text.ecocup.button.cancel":"Cancel","pisell2.text.ecocup.button.confirm":"Confirm","pisell2.text.ecocup.button.remove":"Remove","pisell2.text.ecocup.button.dismiss":"Dismiss","pisell2.text.ecocup.button.transfer":"Transfer to my store","pisell2.text.ecocup.toast.success-return":"Returned success","pisell2.text.ecocup.toast.success-missing":"Mark as missing success","pisell2.text.ecocup.toast.success-broken":"Mark as broken success","pisell2.text.ecocup.toast.success-transfer":"Transferred success","pisell2.text.ecocup.toast.fail-no-match-customer":"No matching customer found","pisell2.text.cup-project.title":"ECO Cup Project","pisell2.text.cup-project.search-bar.placeholder":"mobile number or cup code","pisell2.text.cup-project.footer.button.new-customer":"New Customer","pisell2.text.cup-project.footer.button.customer-list":"Customer list","pisell2.text.cup-project.footer.button.cup-list":"Cup list","pisell2.text.cup-project.footer.button.setting":"Setting","pisell2.text.cup-project.footer.button.register-cups":"Register Cups to Inventory","pisell2.text.cup-project.search-bar.result.header.name":"Name","pisell2.text.cup-project.search-bar.result.header.registrationTime":"Registration Time","pisell2.text.cup-project.search-bar.result.header.phone":"Phone Number","pisell2.text.cup-project.search-bar.result.header.email":"Email address","pisell2.text.cup-project.search-bar.result.header.membership":"Membership","pisell2.text.ecocup.title":"Eco-Cup","pisell2.text.ecocup.status.placeholder":"Select Status","pisell2.text.ecocup.status.shop.placeholder":"Select Shop","pisell2.text.ecocup.scan-or-search":"mobile number or cup code","pisell2.text.ecocup.available-to-rent":"Available to rent now","pisell2.text.ecocup.rent":"Rent","pisell2.text.ecocup.broken":"Broken","pisell2.text.ecocup.cup-rent":"Cup Rent (During Selected Period)","pisell2.text.ecocup.cup-returned":"Cup Returned (During Selected Period)","pisell2.text.ecocup.eco.cup-rent":"Cup Rent (all shops during selected period)","pisell2.text.ecocup.eco.cup-returned":"Cup Returned (all shops during selected period)","pisell2.text.ecocup.table.cup-code":"Cup Code","pisell2.text.ecocup.table.customer":"Customer","pisell2.text.ecocup.table.status":"Status","pisell2.text.ecocup.table.shop-of-rent":"Shop of Rent","pisell2.text.ecocup.table.time-of-rent":"Time of Rent","pisell2.text.ecocup.table.shop-of-return":"Shop of Return","pisell2.text.ecocup.table.time-of-return":"Time of Return","pisell2.text.ecocup.table.operated-at":"Operated at","pisell2.text.ecocup.table.actions":"actions","pisell2.text.ecocup.status.rent":"Rent","pisell2.text.ecocup.status.in-stock":"In stock","pisell2.text.ecocup.status.all":"All","pisell2.text.ecocup.status.shop-changed":"Shop changed","pisell2.text.ecocup.status.overtime":"Overtime","pisell2.text.ecocup.status.expire-soon":"Expire soon","pisell2.text.ecocup.status.borrowing":"borrowing","pisell2.text.ecocup.status.returned":"Returned","pisell2.text.ecocup.action.return":"Return","pisell2.text.ecocup.action.more":"more","pisell2.text.ecocup.action.more.missing":"Missing","pisell2.text.ecocup.action.more.broken":"Broken","pisell2.text.ecocup.table.time-of-rent.relative":e=>`${e} ${e>1?"days":"day"} ago`,"pisell2.text.ecocup.table.time-of-return.today":"Today","pisell2.text.ecocup.share.title":"Share","pisell2.text.ecocup.export.title":"Export","pisell2.text.ecocup.customer.list.title":"Customer List","pisell2.text.ecocup.customer.list.customer":"Cutomer","pisell2.text.ecocup.customer.list.registed":"Registed","pisell2.text.ecocup.customer.list.email":"Email","pisell2.text.ecocup.customer.list.mobile":"Mobile","pisell2.text.ecocup.customer.list.cup.borrowed":"Cup borrowed","pisell2.text.ecocup.customer.list.cup.returned":"Cup returned","pisell2.text.ecocup.customer.list.customer.profile":"Customer Profile","pisell2.text.ecocup.customer.list.search.placeholder":"mobile number","pisell2.text.ecocup.add-customer-modal.title":"Add Customer","pisell2.text.ecocup.add-customer-modal.first-name":"First Name","pisell2.text.ecocup.add-customer-modal.first-name-placeholder":"First Name","pisell2.text.ecocup.add-customer-modal.first-name-required":"First Name is required","pisell2.text.ecocup.add-customer-modal.last-name":"Last Name","pisell2.text.ecocup.add-customer-modal.last-name-placeholder":"Last Name","pisell2.text.ecocup.add-customer-modal.last-name-required":"Last Name is required","pisell2.text.ecocup.add-customer-modal.phone":"Phone","pisell2.text.ecocup.add-customer-modal.phone-placeholder":"Phone","pisell2.text.ecocup.add-customer-modal.phone-required":"Phone is required","pisell2.text.ecocup.add-customer-modal.phone-error":"Please enter a valid phone number","pisell2.text.ecocup.add-customer-modal.email":"Email","pisell2.text.ecocup.add-customer-modal.email-placeholder":"Email","pisell2.text.ecocup.add-customer-modal.email-required":"Email is required","pisell2.text.ecocup.add-customer-modal.membership":"Customer Group","pisell2.text.ecocup.add-customer-modal.success":"Customer added successfully","pisell2.text.ecocup.cup-action-modal.title-return":"Cup Return","pisell2.text.ecocup.cup-action-modal.title-missing":"Cup Missing","pisell2.text.ecocup.cup-action-modal.title-broken":"Cup Broken","pisell2.text.ecocup.cup-action-modal.cup-id":"Cup ID","pisell2.text.ecocup.cup-action-modal.cup-tip":"Rent at","pisell2.text.ecocup.cup-info-card.title.rentInfo":"Rent at","pisell2.text.ecocup.cup-info-card.title.markInfo":"Marked by","pisell2.text.ecocup.cup-info-card.title.belongInfo":"Belongs to","pisell2.text.ecocup.cup-info-card.title.otherBelongInfo":"This cup belongs to","pisell2.text.ecocup.cup-info-card.title.multiple-shop":"multiple shop detected","pisell2.text.ecocup.cup-info-card.title.multiple-time":"multiple time detected","pisell2.text.ecocup.cup-info-card.title.multiple-customer":"Multiple customers","pisell2.text.ecocup.customer-first-modal.title":"Rent/Return Cup(s)","pisell2.text.ecocup.customer-first-modal.search-tip":"Please scan/input the correct ECO Cup code.","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder":"mobile number or cup code","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder-cup":"cup code","pisell2.text.ecocup.customer-first-modal.over-max":"Please Remove {{num}} cup(s)","pisell2.text.ecocup.customer-first-modal.no-customer":"Please Log in customer","pisell2.text.ecocup.search-bar.search-tip":"Please scan/input the correct ECO Cup code.","pisell2.text.ecocup.cup-status-modal.title-other_rent":e=>`Cup Return ${e>1?`(${e} cups)`:""}`,"pisell2.text.ecocup.cup-status-modal.title-other_in_stock":"Cup not in your inventory","pisell2.text.ecocup.cup-status-modal.title-missing":"Cup Marked as Missing","pisell2.text.ecocup.cup-status-modal.title-broken":"Cup Marked as Broken","pisell2.text.ecocup.cup-status-modal.title-not_found":"Cup not in your inventory","pisell2.text.ecocup.cup-status-modal.tip":"Please add to inventory first before renting","pisell2.text.ecocup.cup-status-modal.tip-in-stock":"Please report to Eco-cup admin for further actions","pisell2.text.ecocup.setting.expire-time":"Expire Time","pisell2.text.ecocup.setting.expire-time-placeholder":"Expire Time","pisell2.text.ecocup.setting.expire-time-required":"Expire Time is required","pisell2.text.ecocup.setting.expire-time-max":"Expire Time must be less than 365 days","pisell2.text.ecocup.setting.expire-time-min":"Expire Time must be greater than 0","pisell2.text.ecocup.setting.max-rent-count-max":"Max Rent Count must be less than 9999","pisell2.text.ecocup.setting.max-rent-count-min":"Max Rent Count must be greater than 0","pisell2.text.ecocup.setting.days":"Days","pisell2.text.ecocup.setting.regular":"Regular","pisell2.text.ecocup.setting.regular-placeholder":"Regular","pisell2.text.ecocup.setting.regular-required":"Regular is required","pisell2.text.ecocup.setting.business":"Business","pisell2.text.ecocup.setting.business-placeholder":"Business","pisell2.text.ecocup.setting.business-required":"Business is required","pisell2.text.ecocup.setting.admin":"Admin","pisell2.text.ecocup.setting.admin-placeholder":"Admin","pisell2.text.ecocup.setting.admin-required":"Admin is required","pisell2.text.ecocup.setting.success":"Settings saved successfully","pisell2.text.ecocup.export.fail":"Export failed","pisell2.text.ecocup.export.success":"Export success","pisell2.text.ecocup.cup-status-modal.search-bar.title":"Scan multiple cups and return together","pisell2.text.ecocup.toast.success-copy-link":"Link copied to clipboard"},"zh-HK":{"pisell2.text.ecocup.cup-id":"Cup ID","pisell2.text.ecocup.button.return":"Return","pisell2.text.ecocup.button.others":"others","pisell2.text.ecocup.button.missing":"Missing","pisell2.text.ecocup.button.broken":"Broken","pisell2.text.ecocup.button.clear-all":"Clear All","pisell2.text.ecocup.button.mark-as-return":"Return","pisell2.text.ecocup.button.mark-as-missing":"Mark as Missing","pisell2.text.ecocup.button.mark-as-broken":"Mark as Broken","pisell2.text.ecocup.button.cancel":"Cancel","pisell2.text.ecocup.button.confirm":"Confirm","pisell2.text.ecocup.button.remove":"Remove","pisell2.text.ecocup.button.dismiss":"Dismiss","pisell2.text.ecocup.button.transfer":"Transfer to my store","pisell2.text.ecocup.toast.success-return":"Returned success","pisell2.text.ecocup.toast.success-missing":"Mark as missing success","pisell2.text.ecocup.toast.success-broken":"Mark as broken success","pisell2.text.ecocup.toast.success-transfer":"Transferred success","pisell2.text.ecocup.toast.fail-no-match-customer":"No matching customer found","pisell2.text.cup-project.title":"ECO Cup Project","pisell2.text.cup-project.search-bar.placeholder":"mobile number or cup code","pisell2.text.cup-project.footer.button.new-customer":"New Customer","pisell2.text.cup-project.footer.button.customer-list":"Customer list","pisell2.text.cup-project.footer.button.cup-list":"Cup list","pisell2.text.cup-project.footer.button.setting":"Setting","pisell2.text.cup-project.footer.button.register-cups":"Register Cups to Inventory","pisell2.text.cup-project.search-bar.result.header.name":"Name","pisell2.text.cup-project.search-bar.result.header.registrationTime":"Registration Time","pisell2.text.cup-project.search-bar.result.header.phone":"Phone Number","pisell2.text.cup-project.search-bar.result.header.email":"Email address","pisell2.text.cup-project.search-bar.result.header.membership":"Membership","pisell2.text.ecocup.title":"Eco-Cup","pisell2.text.ecocup.status.placeholder":"Select Status","pisell2.text.ecocup.status.shop.placeholder":"Select Shop","pisell2.text.ecocup.scan-or-search":"mobile number or cup code","pisell2.text.ecocup.available-to-rent":"Available to rent now","pisell2.text.ecocup.rent":"Rent","pisell2.text.ecocup.broken":"Broken","pisell2.text.ecocup.cup-rent":"Cup Rent (During Selected Period)","pisell2.text.ecocup.cup-returned":"Cup Returned (During Selected Period)","pisell2.text.ecocup.eco.cup-rent":"Cup Rent (all shops during selected period)","pisell2.text.ecocup.eco.cup-returned":"Cup Returned (all shops during selected period)","pisell2.text.ecocup.table.cup-code":"Cup Code","pisell2.text.ecocup.table.customer":"Customer","pisell2.text.ecocup.table.status":"Status","pisell2.text.ecocup.table.shop-of-rent":"Shop of Rent","pisell2.text.ecocup.table.time-of-rent":"Time of Rent","pisell2.text.ecocup.table.shop-of-return":"Shop of Return","pisell2.text.ecocup.table.time-of-return":"Time of Return","pisell2.text.ecocup.table.operated-at":"Operated at","pisell2.text.ecocup.table.actions":"actions","pisell2.text.ecocup.status.rent":"Rent","pisell2.text.ecocup.status.in-stock":"In stock","pisell2.text.ecocup.status.all":"All","pisell2.text.ecocup.status.shop-changed":"Shop changed","pisell2.text.ecocup.status.overtime":"Overtime","pisell2.text.ecocup.status.expire-soon":"Expire soon","pisell2.text.ecocup.status.borrowing":"borrowing","pisell2.text.ecocup.status.returned":"Returned","pisell2.text.ecocup.action.return":"Return","pisell2.text.ecocup.action.more":"more","pisell2.text.ecocup.action.more.missing":"Missing","pisell2.text.ecocup.action.more.broken":"Broken","pisell2.text.ecocup.table.time-of-rent.relative":e=>`${e} ${1===e?"day":"days"} ago`,"pisell2.text.ecocup.table.time-of-return.today":"Today","pisell2.text.ecocup.share.title":"Share","pisell2.text.ecocup.export.title":"Export","pisell2.text.ecocup.customer.list.title":"Customer List","pisell2.text.ecocup.customer.list.customer":"Cutomer","pisell2.text.ecocup.customer.list.registed":"Registed","pisell2.text.ecocup.customer.list.email":"Email","pisell2.text.ecocup.customer.list.mobile":"Mobile","pisell2.text.ecocup.customer.list.cup.borrowed":"Cup borrowed","pisell2.text.ecocup.customer.list.cup.returned":"Cup returned","pisell2.text.ecocup.customer.list.customer.profile":"Customer Profile","pisell2.text.ecocup.customer.list.search.placeholder":"mobile number","pisell2.text.ecocup.add-customer-modal.title":"Add Customer","pisell2.text.ecocup.add-customer-modal.first-name":"First Name","pisell2.text.ecocup.add-customer-modal.first-name-placeholder":"First Name","pisell2.text.ecocup.add-customer-modal.first-name-required":"First Name is required","pisell2.text.ecocup.add-customer-modal.last-name":"Last Name","pisell2.text.ecocup.add-customer-modal.last-name-placeholder":"Last Name","pisell2.text.ecocup.add-customer-modal.last-name-required":"Last Name is required","pisell2.text.ecocup.add-customer-modal.phone":"Phone","pisell2.text.ecocup.add-customer-modal.phone-placeholder":"Phone","pisell2.text.ecocup.add-customer-modal.phone-required":"Phone is required","pisell2.text.ecocup.add-customer-modal.phone-error":"Please enter a valid phone number","pisell2.text.ecocup.add-customer-modal.email":"Email","pisell2.text.ecocup.add-customer-modal.email-placeholder":"Email","pisell2.text.ecocup.add-customer-modal.email-required":"Email is required","pisell2.text.ecocup.add-customer-modal.membership":"Customer Group","pisell2.text.ecocup.add-customer-modal.success":"Customer added successfully","pisell2.text.ecocup.cup-action-modal.title-return":"Cup Return","pisell2.text.ecocup.cup-action-modal.title-missing":"Cup Missing","pisell2.text.ecocup.cup-action-modal.title-broken":"Cup Broken","pisell2.text.ecocup.cup-action-modal.cup-id":"Cup ID","pisell2.text.ecocup.cup-action-modal.cup-tip":"Rent at","pisell2.text.ecocup.cup-info-card.title.rentInfo":"Rent at","pisell2.text.ecocup.cup-info-card.title.markInfo":"Marked by","pisell2.text.ecocup.cup-info-card.title.belongInfo":"Belongs to","pisell2.text.ecocup.cup-info-card.title.otherBelongInfo":"This cup belongs to","pisell2.text.ecocup.cup-info-card.title.multiple-shop":"multiple shop detected","pisell2.text.ecocup.cup-info-card.title.multiple-time":"multiple time detected","pisell2.text.ecocup.cup-info-card.title.multiple-customer":"Multiple customers","pisell2.text.ecocup.customer-first-modal.title":"Rent/Return Cup(s)","pisell2.text.ecocup.customer-first-modal.search-tip":"Please scan/input the correct ECO Cup code.","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder":"mobile number or cup code","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder-cup":"cup code","pisell2.text.ecocup.customer-first-modal.over-max":"Please Remove {{num}} cup(s)","pisell2.text.ecocup.customer-first-modal.no-customer":"Please Log in customer","pisell2.text.ecocup.search-bar.search-tip":"Please scan/input the correct ECO Cup code.","pisell2.text.ecocup.cup-status-modal.title-other_rent":e=>`Cup Return ${e>1?`(${e} cups)`:""}`,"pisell2.text.ecocup.cup-status-modal.title-other_in_stock":"Cup not in your inventory","pisell2.text.ecocup.cup-status-modal.title-missing":"Cup Marked as Missing","pisell2.text.ecocup.cup-status-modal.title-broken":"Cup Marked as Broken","pisell2.text.ecocup.cup-status-modal.title-not_found":"Cup not in your inventory","pisell2.text.ecocup.cup-status-modal.tip":"Please add to inventory first before renting","pisell2.text.ecocup.cup-status-modal.tip-in-stock":"Please report to Eco-cup admin for further actions","pisell2.text.ecocup.setting.expire-time":"Expire Time","pisell2.text.ecocup.setting.expire-time-placeholder":"Expire Time","pisell2.text.ecocup.setting.expire-time-required":"Expire Time is required","pisell2.text.ecocup.setting.expire-time-max":"Expire Time must be less than 365 days","pisell2.text.ecocup.setting.expire-time-min":"Expire Time must be greater than 0","pisell2.text.ecocup.setting.max-rent-count-max":"Max Rent Count must be less than 9999","pisell2.text.ecocup.setting.max-rent-count-min":"Max Rent Count must be greater than 0","pisell2.text.ecocup.setting.days":"Days","pisell2.text.ecocup.setting.regular":"Regular","pisell2.text.ecocup.setting.regular-placeholder":"Regular","pisell2.text.ecocup.setting.regular-required":"Regular is required","pisell2.text.ecocup.setting.business":"Business","pisell2.text.ecocup.setting.business-placeholder":"Business","pisell2.text.ecocup.setting.business-required":"Business is required","pisell2.text.ecocup.setting.admin":"Admin","pisell2.text.ecocup.setting.admin-placeholder":"Admin","pisell2.text.ecocup.setting.admin-required":"Admin is required","pisell2.text.ecocup.setting.success":"Settings saved successfully","pisell2.text.ecocup.export.fail":"Export failed","pisell2.text.ecocup.export.success":"Export success","pisell2.text.ecocup.cup-status-modal.search-bar.title":"Scan multiple cups and return together","pisell2.text.ecocup.toast.success-copy-link":"Link copied to clipboard"},ja:{"pisell2.text.ecocup.cup-id":"カップID","pisell2.text.ecocup.button.return":"返却","pisell2.text.ecocup.button.others":"その他","pisell2.text.ecocup.button.missing":"紛失","pisell2.text.ecocup.button.broken":"破損","pisell2.text.ecocup.button.clear-all":"すべてクリア","pisell2.text.ecocup.button.mark-as-return":"返却済みとしてマーク","pisell2.text.ecocup.button.mark-as-missing":"紛失としてマーク","pisell2.text.ecocup.button.mark-as-broken":"破損としてマーク","pisell2.text.ecocup.button.cancel":"キャンセル","pisell2.text.ecocup.button.confirm":"確認","pisell2.text.ecocup.button.remove":"削除","pisell2.text.ecocup.button.dismiss":"閉じる","pisell2.text.ecocup.button.transfer":"自分の店舗に転送","pisell2.text.ecocup.toast.success-return":"返却成功","pisell2.text.ecocup.toast.success-missing":"紛失としてマーク成功","pisell2.text.ecocup.toast.success-broken":"破損としてマーク成功","pisell2.text.ecocup.toast.success-transfer":"転送成功","pisell2.text.ecocup.toast.fail-no-match-customer":"一致する顧客が見つかりませんでした","pisell2.text.cup-project.title":"ECOカッププロジェクト","pisell2.text.cup-project.search-bar.placeholder":"携帯電話番号またはカップコード","pisell2.text.cup-project.footer.button.new-customer":"新規顧客","pisell2.text.cup-project.footer.button.customer-list":"顧客リスト","pisell2.text.cup-project.footer.button.cup-list":"カップリスト","pisell2.text.cup-project.footer.button.register-cups":"在庫にカップを登録","pisell2.text.cup-project.search-bar.result.header.name":"名前","pisell2.text.cup-project.search-bar.result.header.registrationTime":"登録時間","pisell2.text.cup-project.search-bar.result.header.phone":"電話番号","pisell2.text.cup-project.search-bar.result.header.email":"メールアドレス","pisell2.text.cup-project.search-bar.result.header.membership":"会員","pisell2.text.ecocup.title":"エコカップ","pisell2.text.ecocup.status.placeholder":"ステータスを選択","pisell2.text.ecocup.status.shop.placeholder":"店舗を選択","pisell2.text.ecocup.scan-or-search":"携帯電話番号またはカップコード","pisell2.text.ecocup.available-to-rent":"現在レンタル可能","pisell2.text.ecocup.rent":"レンタル","pisell2.text.ecocup.broken":"破損","pisell2.text.ecocup.cup-rent":"カップレンタル","pisell2.text.ecocup.cup-returned":"カップ返却","pisell2.text.ecocup.eco.cup-rent":"全店舗によるカップレンタル","pisell2.text.ecocup.eco.cup-returned":"全店舗によるカップ返却","pisell2.text.ecocup.table.cup-code":"カップコード","pisell2.text.ecocup.table.customer":"顧客","pisell2.text.ecocup.table.status":"ステータス","pisell2.text.ecocup.table.shop-of-rent":"レンタル店舗","pisell2.text.ecocup.table.time-of-rent":"レンタル時間","pisell2.text.ecocup.table.shop-of-return":"返却店舗","pisell2.text.ecocup.table.time-of-return":"返却時間","pisell2.text.ecocup.table.operated-at":"操作時間","pisell2.text.ecocup.table.actions":"操作","pisell2.text.ecocup.status.rent":"レンタル","pisell2.text.ecocup.status.in-stock":"在庫あり","pisell2.text.ecocup.status.all":"すべて","pisell2.text.ecocup.status.shop-changed":"店舗変更","pisell2.text.ecocup.status.overtime":"時間超過","pisell2.text.ecocup.status.expire-soon":"まもなく期限切れ","pisell2.text.ecocup.status.borrowing":"借用中","pisell2.text.ecocup.status.returned":"返却済み","pisell2.text.ecocup.action.return":"返却","pisell2.text.ecocup.action.more":"その他","pisell2.text.ecocup.action.more.missing":"紛失","pisell2.text.ecocup.action.more.broken":"破損","pisell2.text.ecocup.table.time-of-rent.relative":e=>`${e}日前`,"pisell2.text.ecocup.table.time-of-return.today":"今日","pisell2.text.ecocup.customer.list.title":"顧客リスト","pisell2.text.ecocup.customer.list.customer":"顧客","pisell2.text.ecocup.customer.list.registed":"登録済み","pisell2.text.ecocup.customer.list.email":"メール","pisell2.text.ecocup.customer.list.mobile":"携帯電話","pisell2.text.ecocup.customer.list.cup.borrowed":"借用カップ","pisell2.text.ecocup.customer.list.cup.returned":"返却カップ","pisell2.text.ecocup.customer.list.customer.profile":"顧客プロフィール","pisell2.text.ecocup.customer.list.search.placeholder":"携帯電話番号","pisell2.text.ecocup.add-customer-modal.title":"顧客を追加","pisell2.text.ecocup.add-customer-modal.first-name":"名","pisell2.text.ecocup.add-customer-modal.first-name-placeholder":"名","pisell2.text.ecocup.add-customer-modal.first-name-required":"名は必須です","pisell2.text.ecocup.add-customer-modal.last-name":"姓","pisell2.text.ecocup.add-customer-modal.last-name-placeholder":"姓","pisell2.text.ecocup.add-customer-modal.last-name-required":"姓は必須です","pisell2.text.ecocup.add-customer-modal.phone":"電話","pisell2.text.ecocup.add-customer-modal.phone-placeholder":"電話","pisell2.text.ecocup.add-customer-modal.phone-error":"有効な電話番号を入力してください","pisell2.text.ecocup.add-customer-modal.phone-required":"電話は必須です","pisell2.text.ecocup.add-customer-modal.email":"メール","pisell2.text.ecocup.add-customer-modal.email-placeholder":"メール","pisell2.text.ecocup.add-customer-modal.email-required":"メールは必須です","pisell2.text.ecocup.add-customer-modal.membership":"顧客グループ","pisell2.text.ecocup.add-customer-modal.success":"顧客の追加に成功しました","pisell2.text.ecocup.cup-action-modal.title-return":"カップ返却","pisell2.text.ecocup.cup-action-modal.title-missing":"カップ紛失","pisell2.text.ecocup.cup-action-modal.title-broken":"カップ破損","pisell2.text.ecocup.cup-action-modal.cup-id":"カップID","pisell2.text.ecocup.cup-action-modal.cup-tip":"レンタル時間","pisell2.text.ecocup.cup-info-card.title.rentInfo":"レンタル時間","pisell2.text.ecocup.cup-info-card.title.markInfo":"マーク者","pisell2.text.ecocup.cup-info-card.title.belongInfo":"所属","pisell2.text.ecocup.customer-first-modal.title":"カップをレンタル/返却","pisell2.text.ecocup.customer-first-modal.search-tip":"正しいECOカップコードをスキャン/入力してください。","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder":"携帯電話番号またはカップコード","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder-cup":"カップコード","pisell2.text.ecocup.customer-first-modal.over-max":"{{num}}個のカップを削除してください","pisell2.text.ecocup.customer-first-modal.no-customer":"顧客にログインしてください","pisell2.text.ecocup.search-bar.search-tip":"正しいECOカップコードをスキャン/入力してください。","pisell2.text.ecocup.cup-status-modal.title-other_rent":"警告:このカップは他の人が借用しています","pisell2.text.ecocup.cup-status-modal.title-other_in_stock":"このカップは別の店舗に登録されています","pisell2.text.ecocup.cup-status-modal.title-missing":"カップが紛失としてマークされました","pisell2.text.ecocup.cup-status-modal.title-broken":"カップが破損としてマークされました","pisell2.text.ecocup.cup-status-modal.title-not_found":"カップが在庫にありません","pisell2.text.ecocup.cup-status-modal.tip":"レンタルする前にまず在庫に追加してください"},pt:{"pisell2.text.ecocup.cup-id":"ID do Copo","pisell2.text.ecocup.button.return":"Devolver","pisell2.text.ecocup.button.others":"outros","pisell2.text.ecocup.button.missing":"Perdido","pisell2.text.ecocup.button.broken":"Quebrado","pisell2.text.ecocup.button.clear-all":"Limpar Tudo","pisell2.text.ecocup.button.mark-as-return":"Marcar como Devolvido","pisell2.text.ecocup.button.mark-as-missing":"Marcar como Perdido","pisell2.text.ecocup.button.mark-as-broken":"Marcar como Quebrado","pisell2.text.ecocup.button.cancel":"Cancelar","pisell2.text.ecocup.button.confirm":"Confirmar","pisell2.text.ecocup.button.remove":"Remover","pisell2.text.ecocup.button.dismiss":"Dispensar","pisell2.text.ecocup.button.transfer":"Transferir para minha loja","pisell2.text.ecocup.toast.success-return":"Devolu\xe7\xe3o bem-sucedida","pisell2.text.ecocup.toast.success-missing":"Marcado como perdido com sucesso","pisell2.text.ecocup.toast.success-broken":"Marcado como quebrado com sucesso","pisell2.text.ecocup.toast.success-transfer":"Transfer\xeancia bem-sucedida","pisell2.text.ecocup.toast.fail-no-match-customer":"Nenhum cliente correspondente encontrado","pisell2.text.cup-project.title":"Projeto ECO Cup","pisell2.text.cup-project.search-bar.placeholder":"n\xfamero de celular ou c\xf3digo do copo","pisell2.text.cup-project.footer.button.new-customer":"Novo Cliente","pisell2.text.cup-project.footer.button.customer-list":"Lista de clientes","pisell2.text.cup-project.footer.button.cup-list":"Lista de copos","pisell2.text.cup-project.footer.button.register-cups":"Registrar Copos no Invent\xe1rio","pisell2.text.cup-project.search-bar.result.header.name":"Nome","pisell2.text.cup-project.search-bar.result.header.registrationTime":"Hora de Registro","pisell2.text.cup-project.search-bar.result.header.phone":"N\xfamero de Telefone","pisell2.text.cup-project.search-bar.result.header.email":"Endere\xe7o de E-mail","pisell2.text.cup-project.search-bar.result.header.membership":"Associa\xe7\xe3o","pisell2.text.ecocup.title":"Eco-Cup","pisell2.text.ecocup.status.placeholder":"Selecionar Status","pisell2.text.ecocup.status.shop.placeholder":"Selecionar Loja","pisell2.text.ecocup.scan-or-search":"n\xfamero de celular ou c\xf3digo do copo","pisell2.text.ecocup.available-to-rent":"Dispon\xedvel para alugar agora","pisell2.text.ecocup.rent":"Alugar","pisell2.text.ecocup.broken":"Quebrado","pisell2.text.ecocup.cup-rent":"Aluguel de Copo","pisell2.text.ecocup.cup-returned":"Copo Devolvido","pisell2.text.ecocup.eco.cup-rent":"Aluguel de Copo por todas as lojas","pisell2.text.ecocup.eco.cup-returned":"Copo Devolvido por todas as lojas","pisell2.text.ecocup.table.cup-code":"C\xf3digo do Copo","pisell2.text.ecocup.table.customer":"Cliente","pisell2.text.ecocup.table.status":"Status","pisell2.text.ecocup.table.shop-of-rent":"Loja de Aluguel","pisell2.text.ecocup.table.time-of-rent":"Hora de Aluguel","pisell2.text.ecocup.table.shop-of-return":"Loja de Devolu\xe7\xe3o","pisell2.text.ecocup.table.time-of-return":"Hora de Devolu\xe7\xe3o","pisell2.text.ecocup.table.operated-at":"Operado em","pisell2.text.ecocup.table.actions":"a\xe7\xf5es","pisell2.text.ecocup.status.rent":"Alugar","pisell2.text.ecocup.status.in-stock":"Em estoque","pisell2.text.ecocup.status.all":"Todos","pisell2.text.ecocup.status.shop-changed":"Loja alterada","pisell2.text.ecocup.status.overtime":"Tempo esgotado","pisell2.text.ecocup.status.expire-soon":"Expira em breve","pisell2.text.ecocup.status.borrowing":"emprestando","pisell2.text.ecocup.status.returned":"Devolvido","pisell2.text.ecocup.action.return":"Devolver","pisell2.text.ecocup.action.more":"mais","pisell2.text.ecocup.action.more.missing":"Perdido","pisell2.text.ecocup.action.more.broken":"Quebrado","pisell2.text.ecocup.table.time-of-rent.relative":e=>`${e} ${1===e?"dia":"dias"} atr\xe1s`,"pisell2.text.ecocup.table.time-of-return.today":"Hoje","pisell2.text.ecocup.customer.list.title":"Lista de Clientes","pisell2.text.ecocup.customer.list.customer":"Cliente","pisell2.text.ecocup.customer.list.registed":"Registrado","pisell2.text.ecocup.customer.list.email":"E-mail","pisell2.text.ecocup.customer.list.mobile":"Celular","pisell2.text.ecocup.customer.list.cup.borrowed":"Copo emprestado","pisell2.text.ecocup.customer.list.cup.returned":"Copo devolvido","pisell2.text.ecocup.customer.list.customer.profile":"Perfil do Cliente","pisell2.text.ecocup.customer.list.search.placeholder":"n\xfamero de celular","pisell2.text.ecocup.add-customer-modal.title":"Adicionar Cliente","pisell2.text.ecocup.add-customer-modal.first-name":"Primeiro Nome","pisell2.text.ecocup.add-customer-modal.first-name-placeholder":"Primeiro Nome","pisell2.text.ecocup.add-customer-modal.first-name-required":"Primeiro Nome \xe9 obrigat\xf3rio","pisell2.text.ecocup.add-customer-modal.last-name":"Sobrenome","pisell2.text.ecocup.add-customer-modal.last-name-placeholder":"Sobrenome","pisell2.text.ecocup.add-customer-modal.last-name-required":"Sobrenome \xe9 obrigat\xf3rio","pisell2.text.ecocup.add-customer-modal.phone":"Telefone","pisell2.text.ecocup.add-customer-modal.phone-placeholder":"Telefone","pisell2.text.ecocup.add-customer-modal.phone-error":"Por favor, insira um n\xfamero de telefone v\xe1lido","pisell2.text.ecocup.add-customer-modal.phone-required":"Telefone \xe9 obrigat\xf3rio","pisell2.text.ecocup.add-customer-modal.email":"E-mail","pisell2.text.ecocup.add-customer-modal.email-placeholder":"E-mail","pisell2.text.ecocup.add-customer-modal.email-required":"E-mail \xe9 obrigat\xf3rio","pisell2.text.ecocup.add-customer-modal.membership":"Grupo de Clientes","pisell2.text.ecocup.add-customer-modal.success":"Cliente adicionado com sucesso","pisell2.text.ecocup.cup-action-modal.title-return":"Devolu\xe7\xe3o do Copo","pisell2.text.ecocup.cup-action-modal.title-missing":"Copo Perdido","pisell2.text.ecocup.cup-action-modal.title-broken":"Copo Quebrado","pisell2.text.ecocup.cup-action-modal.cup-id":"ID do Copo","pisell2.text.ecocup.cup-action-modal.cup-tip":"Alugado em","pisell2.text.ecocup.cup-info-card.title.rentInfo":"Alugado em","pisell2.text.ecocup.cup-info-card.title.markInfo":"Marcado por","pisell2.text.ecocup.cup-info-card.title.belongInfo":"Pertence a","pisell2.text.ecocup.customer-first-modal.title":"Alugar/Devolver Copo(s)","pisell2.text.ecocup.customer-first-modal.search-tip":"Por favor, escaneie/insira o c\xf3digo correto do ECO Cup.","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder":"n\xfamero de celular ou c\xf3digo do copo","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder-cup":"c\xf3digo do copo","pisell2.text.ecocup.customer-first-modal.over-max":"Por favor, remova {{num}} copo(s)","pisell2.text.ecocup.customer-first-modal.no-customer":"Por favor, fa\xe7a login do cliente","pisell2.text.ecocup.search-bar.search-tip":"Por favor, escaneie/insira o c\xf3digo correto do ECO Cup.","pisell2.text.ecocup.cup-status-modal.title-other_rent":"Aviso: Este Copo foi emprestado por Outros","pisell2.text.ecocup.cup-status-modal.title-other_in_stock":"Este Copo est\xe1 registrado em outra loja","pisell2.text.ecocup.cup-status-modal.title-missing":"Copo Marcado como Perdido","pisell2.text.ecocup.cup-status-modal.title-broken":"Copo Marcado como Quebrado","pisell2.text.ecocup.cup-status-modal.title-not_found":"Copo n\xe3o est\xe1 em seu invent\xe1rio","pisell2.text.ecocup.cup-status-modal.tip":"Por favor, adicione ao invent\xe1rio primeiro antes de alugar"}},eJj=[{key:"add-new-customer",icon:"pisell2-plus-circle",type:"primary",size:"large",languageKey:"pisell2.text.cup-project.footer.button.new-customer"},{key:"customer-list",icon:"pisell2-file-check-02",type:"primary",size:"large",languageKey:"pisell2.text.cup-project.footer.button.customer-list"},{key:"cup-list",icon:"pisell2-file-check-02",type:"primary",size:"large",languageKey:"pisell2.text.cup-project.footer.button.cup-list"},{key:"setting",icon:"pisell2-settings-02",type:"primary",size:"large",languageKey:"pisell2.text.cup-project.footer.button.setting"}],eJS=[{key:"name",label:"pisell2.text.cup-project.search-bar.result.header.name"},{key:"registrationTime",label:"pisell2.text.cup-project.search-bar.result.header.registrationTime"},{key:"phone",label:"pisell2.text.cup-project.search-bar.result.header.phone"},{key:"email",label:"pisell2.text.cup-project.search-bar.result.header.email"},{key:"membership",label:"pisell2.text.cup-project.search-bar.result.header.membership"}],eJM=e=>{let{type:t,data:l,isMultipleShop:a,isMultipleTime:i}=e;return(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-info-card",children:[(0,ev.jsx)("div",{children:eN.getText(`pisell2.text.ecocup.cup-info-card.title.${t}`)}),a?eN.getText("pisell2.text.ecocup.cup-info-card.title.multiple-shop"):(0,ev.jsx)("div",{children:(null==l?void 0:l.shop)||"-"}),i?eN.getText("pisell2.text.ecocup.cup-info-card.title.multiple-time"):(0,ev.jsx)("div",{children:(null==l?void 0:l.time)?em()(null==l?void 0:l.time).format("HH:mm DD/MM/YYYY"):"-"})]})},eJN=e=>{var t;let{id:l,nickname:a,display_name:i,phone:n,country_calling_code:s,cover:r,isMultiple:o}=e;if(!l&&!a&&!i&&!n&&!o)return null;let d=n?`${s} ${n}`:"-",c=i||a||"";return(0,ev.jsxs)("div",{className:"pisell2-ecocup-customer-card",children:[(0,ev.jsx)("div",{className:"pisell2-ecocup-customer-card-avatar",children:o?(0,ev.jsx)("div",{className:"pisell2-ecocup-customer-card-avatar-text"}):r?(0,ev.jsx)("img",{src:iK(r,360),alt:"avatar"}):(0,ev.jsx)("div",{className:"pisell2-ecocup-customer-card-avatar-text",children:(null==c||null==(t=c.charAt(0))?void 0:t.toUpperCase())||""})}),(0,ev.jsxs)("div",{className:"pisell2-ecocup-customer-card-info",children:[(0,ev.jsx)("div",{className:"pisell2-ecocup-customer-card-info-name",children:o?eN.getText("pisell2.text.ecocup.cup-info-card.title.multiple-customer"):c||""}),(0,ev.jsx)("div",{className:"pisell2-ecocup-customer-card-info-phone",children:o?"-":d||""}),o?(0,ev.jsx)("div",{children:"-"}):null]})]})},eJC=e=>{var t,l,a;let{visible:i,onCancel:n,onOk:s,data:r}=e,{scanStatus:o,cupData:d}=r||{},c=(()=>{let{put:e}=eJx(),[t,l]=(0,ef.useState)(!1),{goalShopId:a}=eJb();return{run:i0(async(t,i)=>{try{l(!0);let n=await e(`/shop/wallet/eco/cup/action/${t}`,{action:i,goal_shop_id:a});if((null==n?void 0:n.code)==200)return!0;return!1}catch(e){return console.error(e),!1}finally{l(!1)}}),loading:t}})(),[u,p]=(0,ef.useState)([]),m=(()=>{let{post:e}=eJx(),[t,l]=(0,ef.useState)(!1);return{run:i0(async t=>{try{l(!0);let a=await e("/shop/wallet/eco/cups-return",{eco_cup_ids:t});if((null==a?void 0:a.code)==200)return!0;return!1}catch(e){return console.error(e),!1}finally{l(!1)}}),loading:t}})();(0,ef.useEffect)(()=>{d?p(Array.isArray(d)?d:[d]):p([])},[d]);let g=(0,ef.useMemo)(()=>"other_rent"===o,[o]),h=!g,v=(0,ef.useMemo)(()=>{var e,t,l;if(0===u.length)return{hasMultipleCustomers:!1,hasMultipleShops:!1,hasMultipleTimes:!1,uniqueCustomer:null,uniqueShop:null,uniqueTime:null};let a=new Set(u.map(e=>null==e?void 0:e.customer_id).filter(e=>e)),i=new Set(u.map(e=>null==e?void 0:e.current_shop_id).filter(e=>e)),n=new Set(u.map(e=>null==e?void 0:e.operated_at).filter(e=>e));return{hasMultipleCustomers:a.size>1,hasMultipleShops:i.size>1,hasMultipleTimes:n.size>1,uniqueCustomer:null==(e=u[0])?void 0:e.customer,uniqueShop:null==(t=u[0])?void 0:t.current_shop,uniqueTime:null==(l=u[0])?void 0:l.operated_at}},[u]),f=(0,ef.useMemo)(()=>h?{backgroundColor:"#FEE4E2",color:"#F04438"}:{backgroundColor:"#F6F2FF",color:"#7F56DA"},[h]),y=(0,ef.useMemo)(()=>"other_in_stock"===o?"otherBelongInfo":"in_stock"===o?"belongInfo":g||"rent"===o?"rentInfo":"missing"===o||"broken"===o?"markInfo":"",[o]),x=async()=>{let e;if(null==c?void 0:c.loading)return;let t=g?"return":"";if(!t){null==s||s();return}if(g){let t=u.map(e=>(null==e?void 0:e.eco_cup_id)||(null==e?void 0:e.id));e=await m.run(t)}else e=await c.run((null==d?void 0:d.eco_cup_id)||(null==d?void 0:d.id),t);e&&((0,lL.PisellToast)({content:eN.getText(`pisell2.text.ecocup.toast.success-${t}`)}),null==s||s())},b=e=>{var t;u.find(t=>{var l;return(null==t?void 0:t.id)===(null==e||null==(l=e.data)?void 0:l.id)})||(null==e||null==(t=e.data)?void 0:t.status)==="rent"&&p([...u,null==e?void 0:e.data])},_=(0,ef.useMemo)(()=>(null==u?void 0:u.length)>1&&g,[u.length,g]);return(0,ev.jsx)(lL.PisellModal,{headerDivider:!1,open:i,onCancel:()=>{null!=c&&c.loading||null==n||n()},onOk:x,title:g?eN.getText(`pisell2.text.ecocup.cup-status-modal.title-${o}`)(u.length):eN.getText(`pisell2.text.ecocup.cup-status-modal.title-${o}`),cancelText:g?eN.getText("pisell2.text.ecocup.button.cancel"):eN.getText("pisell2.text.ecocup.button.dismiss"),okText:h?eN.getText("pisell2.text.ecocup.button.confirm"):eN.getText("pisell2.text.ecocup.button.return"),okButtonProps:{loading:null==c?void 0:c.loading},cancelVisible:!h,width:580,children:(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-status-modal-content",style:{gap:g?"20px":"32px"},children:[g?(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-status-modal-content-search",children:[(0,ev.jsx)("span",{className:"tip-text",children:eN.getText("pisell2.text.ecocup.cup-status-modal.search-bar.title")}),(0,ev.jsx)("div",{className:"pisell2-ecocup-customer-first-modal-search-bar",children:(0,ev.jsx)(eJT,{scanListenerKey:"eco-cup-status-modal-scan-listener",searchType:"cup",placeholder:eN.getText("pisell2.text.ecocup.customer-first-modal.search-bar.placeholder"),onSearchResult:b,onCupStatusValidate:b})})]}):null,(0,ev.jsx)("div",{className:"pisell2-ecocup-cup-status-modal-content-cup-lists",children:u.map((e,t)=>(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-status-modal-content-cup",style:{...f,justifyContent:_?"space-between":"center"},children:[(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-status-modal-content-cup-info",children:[(0,ev.jsx)(lL.Icon,{type:"RestOutlined",size:24}),(0,ev.jsx)("span",{style:{color:h?"#F04438":"#667085"},children:eN.getText("pisell2.text.ecocup.cup-id")}),(0,ev.jsx)("span",{children:(null==e?void 0:e.eco_cup_code)||(null==e?void 0:e.code)||""})]}),_&&(0,ev.jsx)(lL.Button,{type:"primary",icon:(0,ev.jsx)(lL.Icon,{type:"pisell2-trash-01",size:24,color:"#7F56DA"}),onClick:()=>{var t;return t=null==e?void 0:e.id,void p(u.filter(e=>(null==e?void 0:e.id)!==t))},className:"info-remove",children:eN.getText("pisell2.text.ecocup.button.remove")})]},(null==e?void 0:e.id)||t))}),(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-status-modal-content-info",children:[(0,ev.jsx)("div",{style:{flex:1},children:((null==v?void 0:v.uniqueShop)||(null==v?void 0:v.hasMultipleShops))&&y?(0,ev.jsx)(eJM,{type:y,data:{shop:null==v||null==(t=v.uniqueShop)?void 0:t.name,time:null==v?void 0:v.uniqueTime,isMultipleTime:null==v?void 0:v.hasMultipleTimes,isMultipleShop:null==v?void 0:v.hasMultipleShops}}):null}),(0,ev.jsx)("div",{style:{flex:1},children:(null==u||null==(l=u[0])?void 0:l.status)==="rent"?(null==v?void 0:v.uniqueCustomer)||(null==v?void 0:v.hasMultipleCustomers)?(0,ev.jsx)(eJN,{...(null==v?void 0:v.uniqueCustomer)||{},isMultiple:null==v?void 0:v.hasMultipleCustomers}):null:(0,ev.jsx)("div",{className:"pisell2-ecocup-cup-status-modal-content-info-tip",children:(null==u||null==(a=u[0])?void 0:a.status)==="in_stock"?eN.getText("pisell2.text.ecocup.cup-status-modal.tip-in-stock"):eN.getText("pisell2.text.ecocup.cup-status-modal.tip")})})]})]})})},eJT=e=>{let t,{scanListenerKey:l,size:a="large",placeholder:i,onSearch:n,searchType:s,onSearchResult:r,customerId:o,onCupStatusValidate:d}=e,[c,u]=(0,ef.useState)(""),[p,m]=(0,ef.useState)(null),g=(0,ef.useRef)(null),{addListener:h,removeListener:v,setActiveListener:f}=(()=>{var e;let{interaction:t}=(null==(e=ik().appHelper)?void 0:e.utils)||{};return{addListener:(e,l)=>{eJv.addListener(t,e,l)},removeListener:e=>{eJv.removeListener(e)},setActiveListener:e=>{eJv.setActiveListener(e)}}})(),y=(()=>{let e=(()=>{let{get:e}=eJx(),{goalShopId:t}=eJb();return{run:l=>{if(l)return e("/shop/wallet/eco/customer",{search:l,with:["tags"],goal_shop_id:t})}}})(),t=(()=>{let{get:e}=eJx(),{goalShopId:t}=eJb();return{run:l=>{if(l)return e("/shop/wallet/eco",{type:"eco",code:l,with:["customer:id,display_name,cover,phone,country_calling_code,nickname","rentShop:id,name","returnShop:id,name","currentShop:id,name"],num:1,goal_shop_id:t})}}})(),[l,a]=(0,ef.useState)(!1);return{loading:l,run:async l=>{let{searchType:i,searchText:n=""}=l,s=/^EC[a-zA-Z0-9]{8}$/.test(n);if("cup"===i&&!s)return{status:"failed",message:eN.getText("pisell2.text.ecocup.search-bar.search-tip")};let r=i||(s?"cup":"customer"),o="cup"===r?t.run:e.run;try{var d,c;a(!0);let e=await o(n);if(null==e||null==(d=e.data)?void 0:d.list)return{status:"success",type:r,data:(null==e||null==(c=e.data)?void 0:c.list)||[]};return{status:"failed",type:r,message:(null==e?void 0:e.message)||""}}catch(e){return{status:"failed",type:r,message:(null==e?void 0:e.message)||""}}finally{a(!1)}}}})(),{getCupScanStatus:x}=(t=eJ_(),{getCupScanStatus:(e,l)=>e?(null==e?void 0:e.status)=="in_stock"&&(null==e?void 0:e.current_shop_id)!=t?"other_in_stock":(null==e?void 0:e.status)=="rent"&&(null==e?void 0:e.customer_id)!=l?"other_rent":(null==e?void 0:e.status)=="missing"?"missing":(null==e?void 0:e.status)=="broken"?"broken":void 0:"not_found"}),b=eJy("ecocup-cup-status-modal");eJ_();let _=i0((e,t)=>{m(null),u(""),null==r||r({type:e,data:t})}),k=i0(e=>{if(n)return void n(e||"");if(!e){u(""),m(null);return}y.run({searchType:s,searchText:e}).then(t=>{if((null==t?void 0:t.status)==="success"){var l,a,i;if((null==t?void 0:t.type)==="cup"){let l=(null==t||null==(a=t.data)?void 0:a[0])||null,i=x(l,o);if(d&&i&&"other_rent"===i){null==d||d({data:l||{code:e}}),u("");return}if(i)return void b.open({data:{scanStatus:i,cupData:l||{code:e}}})}let n=(null==t||null==(l=t.data)?void 0:l.length)||0;if(1===n){u(""),m(null),_(null==t?void 0:t.type,null==t||null==(i=t.data)?void 0:i[0]);return}if(0===n&&(null==t?void 0:t.type)==="customer"){(0,lL.PisellToast)({content:eN.getText("pisell2.text.ecocup.toast.fail-no-match-customer")}),m(null);return}m(null==t?void 0:t.data)}else(null==t?void 0:t.message)&&(0,lL.PisellToast)({content:null==t?void 0:t.message}),m(null)})});return(0,ef.useEffect)(()=>(h(l,e=>{u(""),m(null),k((null==e?void 0:e.value)||"")}),()=>{v(l)}),[l,k]),(0,ef.useEffect)(()=>{let e=e=>{let t=e.target;g.current&&t&&!g.current.contains(t)&&(null==p?void 0:p.length)>1&&m(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[p]),(0,ev.jsxs)("div",{ref:g,className:"ecocup-cup-search-bar",children:[(0,ev.jsx)("div",{style:{flex:1},onClick:()=>{f(l)},children:(0,ev.jsx)(qM,{value:c,onChange:u,loading:y.loading,style:{flex:1,height:"large"===a?"60px":"48px",padding:0},placeholder:i||eN.getText("pisell2.text.cup-project.search-bar.placeholder"),searchButtonProps:{placement:"inside",style:"large"===a?{height:48,padding:8,minWidth:160}:{height:32,padding:8,minWidth:120}},cameraButtonProps:{icon:["pisell2-camera-01","pisell2-qr-code-02"]},onSearch:()=>k(c)})}),(null==p?void 0:p.length)>1?(0,ev.jsxs)("div",{className:"ecocup-cup-search-bar-result",children:[(0,ev.jsx)("div",{className:"ecocup-cup-search-bar-result-header",children:null==eJS?void 0:eJS.map(e=>(0,ev.jsx)("div",{children:eN.getText(e.label)},e.key))}),(0,ev.jsx)("div",{className:"ecocup-cup-search-bar-result-content",children:null==p?void 0:p.map(e=>{var t,l;let{nickname:a,display_name:i,create_time:n,country_calling_code:s,phone:r,email:o,tags:d}=e;return(0,ev.jsxs)("div",{className:"ecocup-cup-search-bar-result-content-item",onClick:()=>_("customer",e),children:[(0,ev.jsx)("div",{children:i||a||"-"}),(0,ev.jsx)("div",{children:n?em()(n).format("DD/MM/YYYY"):"-"}),(0,ev.jsx)("div",{children:r?`(${s}) ${r}`:"-"}),(0,ev.jsx)("div",{children:o||"-"}),(0,ev.jsx)("div",{children:(0,ev.jsx)("span",{className:"ecocup-cup-search-bar-result-content-item-membership",children:(null==d||null==(t=d.find)?void 0:t.call(d,e=>(null==e?void 0:e.name)=="admin"))?"Admin":(null==d||null==(l=d.find)?void 0:l.call(d,e=>(null==e?void 0:e.name)=="business"))?"Business":"Regular"})})]},e.id)})})]}):null,b.visible&&(0,ev.jsx)(eJC,{...b.modalProps})]})},eJP=e=>{let{visible:t,onCancel:l,onOk:a,variant:i}=e,n=i||"desktop",s="phone"===n,[r]=ex.Form.useForm(),{post:o}=eJx(),[d,c]=(0,ef.useState)(!1),{goalShopId:u}=eJb(),p=()=>{d||(null==l||l(),r.resetFields())},m=async()=>{if(!d)try{let e=await r.validateFields();if(!await g(e))return;null==a||a(e),r.resetFields()}catch(e){console.error(e)}},g=async e=>{let{first_name:t,last_name:l,phone:a,email:i,membership:n}=e;try{c(!0);let e=await o("/shop/wallet/eco/customer",{goal_shop_id:u,customer:{first_name:t,last_name:l,phone:null==a?void 0:a.phone,country_calling_code:null==a?void 0:a.countryCallingCode,email:i,register_channel:"shop"},tags:[n]});if((null==e?void 0:e.code)==200)return(0,lL.PisellToast)({content:eN.getText("pisell2.text.ecocup.add-customer-modal.success")}),!0;return!1}catch(e){return console.error(e),!1}finally{c(!1)}},h=()=>(0,ev.jsxs)("div",{className:"pisell2-ecocup-add-customer-modal-footer",children:[(0,ev.jsx)(lL.Button,{size:"large",onClick:p,disabled:d,children:eN.getText("pisell2.text.ecocup.button.cancel")}),(0,ev.jsx)(lL.Button,{size:"large",type:"primary",onClick:m,loading:d,children:eN.getText("pisell2.text.ecocup.button.confirm")})]}),v=eN.getText("pisell2.text.ecocup.add-customer-modal.title"),f=t_()("pisell2-ecocup-add-customer-modal",`pisell2-ecocup-add-customer-modal--${n}`);return(0,ev.jsx)(iB,{renderType:s?"drawer":"modal",showHandlerBar:s,onHandlerBarClick:p,props:s?{open:t,placement:"bottom",width:"100%",height:"auto",style:{maxHeight:"95dvh"},title:v,onClose:p,destroyOnClose:!0,footer:h(),rootClassName:f,className:f,bodyStyle:{padding:"0 24px"}}:{open:t,title:v,onCancel:p,width:680,centered:!0,destroyOnClose:!0,footer:h(),className:f,wrapClassName:f,bodyStyle:{padding:"0 24px",maxHeight:"min(640px, calc(100dvh - 220px))",overflowY:"auto"}},children:(0,ev.jsx)("div",{className:"pisell2-ecocup-add-customer-modal-content",children:(0,ev.jsxs)(ex.Form,{form:r,size:"large",children:[(0,ev.jsxs)("div",{className:"pisell2-ecocup-add-customer-modal-content-name-wrap",children:[(0,ev.jsx)(lL.FormItemInput,{renderMode:"edit",innerRef:null,label:eN.getText("pisell2.text.ecocup.add-customer-modal.first-name"),placeholder:eN.getText("pisell2.text.ecocup.add-customer-modal.first-name-placeholder"),name:"first_name",requiredobj:{required:!0,message:eN.getText("pisell2.text.ecocup.add-customer-modal.first-name-required")}}),(0,ev.jsx)(lL.FormItemInput,{renderMode:"edit",innerRef:null,label:eN.getText("pisell2.text.ecocup.add-customer-modal.last-name"),placeholder:eN.getText("pisell2.text.ecocup.add-customer-modal.last-name-placeholder"),name:"last_name",requiredobj:{required:!0,message:eN.getText("pisell2.text.ecocup.add-customer-modal.last-name-required")}})]}),(0,ev.jsx)(lL.FormItemInput.Mobile,{renderMode:"edit",name:"phone",label:eN.getText("pisell2.text.ecocup.add-customer-modal.phone"),placeholder:eN.getText("pisell2.text.ecocup.add-customer-modal.phone-placeholder"),typeobj:{type:"phone",enabled:!0,message:eN.getText("pisell2.text.ecocup.add-customer-modal.phone-error")},requiredobj:{required:!0,message:eN.getText("pisell2.text.ecocup.add-customer-modal.phone-required")},returnFormat:"object"}),(0,ev.jsx)(lL.FormItemInput,{renderMode:"edit",innerRef:null,name:"email",label:eN.getText("pisell2.text.ecocup.add-customer-modal.email"),placeholder:eN.getText("pisell2.text.ecocup.add-customer-modal.email-placeholder"),requiredobj:{required:!0,message:eN.getText("pisell2.text.ecocup.add-customer-modal.email-required")}}),(0,ev.jsx)(lL.FormItemSelect,{renderMode:"edit",name:"membership",label:eN.getText("pisell2.text.ecocup.add-customer-modal.membership"),defaultValue:"regular",labelField:"label",valueField:"value",options:[{label:"Regular",value:"regular"},{label:"Business",value:"business"},{label:"Admin",value:"admin"}]})]})})})};eJP.displayName="AddCustomerModal";let eJA=iW(eJP),eJD=e=>{var t;let{visible:l,onCancel:a,onOk:i,data:n}=e,{type:s,cupData:r}=n||{},o=(()=>{let{put:e}=eJx(),[t,l]=(0,ef.useState)(!1),{goalShopId:a}=eJb();return{run:i0(async(t,i)=>{try{l(!0);let n=await e(`/shop/wallet/eco/cup/action/${t}`,{action:i,goal_shop_id:a});if((null==n?void 0:n.code)==200)return!0;return!1}catch(e){return console.error(e),!1}finally{l(!1)}}),loading:t}})(),d=(0,ef.useMemo)(()=>(null==n?void 0:n.type)==="missing"||(null==n?void 0:n.type)==="broken"?{backgroundColor:"#FEE4E2",color:"#F04438"}:{backgroundColor:"#F6F2FF",color:"#7F56DA"},[null==n?void 0:n.type]);return(0,ev.jsx)(lL.PisellModal,{open:l,headerDivider:!1,title:eN.getText(`pisell2.text.ecocup.cup-action-modal.title-${null==n?void 0:n.type}`),onCancel:()=>{null!=o&&o.loading||null==a||a()},onOk:()=>{null!=o&&o.loading||o.run((null==r?void 0:r.eco_cup_id)||(null==r?void 0:r.id),s).then(e=>{e&&((0,lL.PisellToast)({content:eN.getText(`pisell2.text.ecocup.toast.success-${s}`)}),null==i||i(r))})},okText:eN.getText(`pisell2.text.ecocup.button.mark-as-${null==n?void 0:n.type}`),cancelText:eN.getText("pisell2.text.ecocup.button.cancel"),okButtonProps:{loading:null==o?void 0:o.loading},width:580,destroyOnClose:!0,wrapClassName:"pisell2-ecocup-cup-action-modal",children:(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-modal-content",children:[(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-modal-content-cup",style:{...d},children:[(0,ev.jsx)(lL.Icon,{type:"RestOutlined",size:24}),(0,ev.jsx)("span",{style:{color:(null==n?void 0:n.type)==="return"?"#667085":"#F04438"},children:eN.getText("pisell2.text.ecocup.cup-action-modal.cup-id")}),(0,ev.jsx)("span",{children:(null==r?void 0:r.eco_cup_code)||(null==r?void 0:r.code)||""})]}),(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-modal-info",children:[(0,ev.jsx)("div",{className:"pisell2-ecocup-cup-action-modal-info-left",children:(0,ev.jsx)(eJM,{type:"rentInfo",data:{shop:null==r||null==(t=r.rent_shop)?void 0:t.name,time:null==r?void 0:r.rent_time}})}),(0,ev.jsx)("div",{className:"pisell2-ecocup-cup-action-modal-info-right",children:(0,ev.jsx)(eJN,{...null==n?void 0:n.customerData})})]})]})})},eJI=e=>{let{locales:t,onClick:l,buttonText:a,showFields:i=["missing","broken"]}=e,n=(0,ef.useMemo)(()=>[{key:"missing",label:t.getText("pisell2.text.ecocup.action.more.missing"),hidden:!i.includes("missing")},{key:"broken",label:t.getText("pisell2.text.ecocup.action.more.broken"),hidden:!i.includes("broken")}],[t,i]);return(0,ev.jsx)(lL.Dropdown,{trigger:["click","hover"],menu:{items:n.filter(e=>!e.hidden),onClick:e=>{e.key,l&&l(e.key)}},children:(0,ev.jsx)(lL.Button,{children:a||t.getText("pisell2.text.ecocup.action.more")})})},eJE=e=>{let{maxNum:t,currentNum:l,cups:a,customerData:i,onClearAll:n,onRemove:s,onAction:r}=e,o=eJy("ecocup-cup-action-modal"),d=(0,ef.useMemo)(()=>l>t,[l,t]),c=(e,t)=>{o.open({data:{type:e,cupData:t,customerData:i},onOk:()=>{r(e,t)}})};return(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-list",children:[d&&(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-list-over-max",children:[(0,ev.jsx)("span",{children:eN.getText("pisell2.text.ecocup.customer-first-modal.over-max").replace("{{num}}",(l-t).toString())}),(0,ev.jsx)("span",{onClick:n,children:eN.getText("pisell2.text.ecocup.button.clear-all")})]}),(0,ev.jsx)("div",{className:"pisell2-ecocup-cup-action-list-cup-list",children:a.map(e=>{var t;let l=(null==e?void 0:e.status)==="in_stock";return(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-list-cup",style:l?{backgroundColor:"#F6F2FF",border:"1px solid #F6F2FF"}:{border:"1px solid #D0D5DD"},children:[(0,ev.jsx)(lL.Icon,{type:"RestOutlined",size:24,color:"#7F56DA"}),(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-list-cup-info",children:[(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-list-cup-info-top",children:[(0,ev.jsx)("span",{children:eN.getText("pisell2.text.ecocup.cup-id")}),(0,ev.jsx)("span",{children:(null==e?void 0:e.eco_cup_code)||(null==e?void 0:e.code)||"-"})]}),!l&&(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-list-cup-info-bottom",children:[(0,ev.jsx)("span",{children:(null==e||null==(t=e.rent_shop)?void 0:t.name)||"-"}),(0,ev.jsx)("span",{children:(null==e?void 0:e.rent_time)?em()(null==e?void 0:e.rent_time).format("DD/MM/YYYY"):"-"})]})]}),l?(0,ev.jsx)(lL.Button,{type:"primary",icon:(0,ev.jsx)(lL.Icon,{type:"pisell2-trash-01",size:24,color:"#7F56DA"}),onClick:()=>s(e),className:"pisell2-ecocup-cup-action-list-cup-info-remove",children:eN.getText("pisell2.text.ecocup.button.remove")}):(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-list-cup-info-actions",children:[(0,ev.jsx)(lL.Button,{type:"primary",onClick:()=>c("return",e),children:"Return"}),(0,ev.jsx)(eJI,{locales:eN,onClick:t=>c(t,e),buttonText:eN.getText("pisell2.text.ecocup.button.others")})]})]},e.code)})}),(null==o?void 0:o.visible)&&(0,ev.jsx)(eJD,{...null==o?void 0:o.modalProps})]})},eJz=e=>{let{key:t,title:l,visible:a,onCancel:i,onOk:n,data:s}=e,[r,o]=(0,ef.useState)(),[d,c]=(0,ef.useState)([]),[u,p]=(0,ef.useState)([]),[m,g]=(0,ef.useState)(0),h=(()=>{let{get:e}=eJx(),[t,l]=(0,ef.useState)(!1),{goalShopId:a}=eJb();return{run:i0(async t=>{try{l(!0);let i=await e(`/shop/wallet/eco/customer/${t}`,{with_rent_cups_flag:1,goal_shop_id:a,with:["tags"]});if((null==i?void 0:i.code)==200)return null==i?void 0:i.data;return null}catch(e){return console.error(e),null}finally{l(!1)}}),loading:t}})(),v=(()=>{let{post:e}=eJx(),[t,l]=(0,ef.useState)(!1),{goalShopId:a}=eJb();return{run:i0(async(t,i)=>{try{l(!0);let n=await e("/shop/wallet/eco/cups-rent",{customer_id:t,eco_cup_ids:i,goal_shop_id:a});if((null==n?void 0:n.code)==200)return!0;return!1}catch(e){return console.error(e),!1}finally{l(!1)}}),loading:t}})(),f=(0,ef.useMemo)(()=>((null==d?void 0:d.length)||0)+((null==u?void 0:u.length)||0),[d,u]),y=(0,ef.useMemo)(()=>f>m,[f,m]),x=(0,ef.useMemo)(()=>(null==h?void 0:h.loading)||(null==v?void 0:v.loading),[null==h?void 0:h.loading,null==v?void 0:v.loading]);(0,ef.useEffect)(()=>{o((null==s?void 0:s.customerData)||void 0)},[null==s?void 0:s.customerData]);let b=i0(e=>{e&&h.run(e).then(e=>{e?(g((null==e?void 0:e.max_rent_count)||0),c((null==e?void 0:e.rent_cups)||[])):(g(0),c([]))})});(0,ef.useEffect)(()=>{if((null==s?void 0:s.firstType)==="cup")(null==s?void 0:s.cupData)&&p([null==s?void 0:s.cupData]);else{var e;b(null==s||null==(e=s.customerData)?void 0:e.id)}},[null==s?void 0:s.firstType,null==s?void 0:s.customerData,null==s?void 0:s.cupData,b]);let _=async()=>{if(x||!(null==r?void 0:r.id))return;let e=u.map(e=>null==e?void 0:e.id);await v.run(null==r?void 0:r.id,e)&&(p([]),b(null==r?void 0:r.id))},k=e=>{var t,l;if((null==e?void 0:e.type)==="cup"){if(u.find(t=>{var l;return(null==t?void 0:t.id)===(null==e||null==(l=e.data)?void 0:l.id)})||(null==e||null==(t=e.data)?void 0:t.status)!=="in_stock")return;p([...u,null==e?void 0:e.data])}else o(null==e?void 0:e.data),b(null==e||null==(l=e.data)?void 0:l.id)},w=()=>(0,ev.jsxs)("div",{children:[(0,ev.jsx)("div",{className:"pisell2-ecocup-customer-first-modal-title",children:"Current Customer"}),(null==r?void 0:r.id)?(0,ev.jsx)(eJN,{...r||{}}):(0,ev.jsxs)("div",{className:"pisell2-ecocup-customer-first-modal-no-customer",children:[(0,ev.jsx)("div",{className:"pisell2-ecocup-customer-first-modal-no-customer-icon"}),(0,ev.jsx)("span",{className:"pisell2-ecocup-customer-first-modal-no-customer-text",children:eN.getText("pisell2.text.ecocup.customer-first-modal.no-customer")})]})]}),j=()=>(0,ev.jsxs)("div",{className:"pisell2-ecocup-customer-first-modal-search-bar",children:[(0,ev.jsx)(eJT,{scanListenerKey:`${t}-eco-cup-customer-first-modal-scan-listener`,searchType:(null==r?void 0:r.id)?"cup":void 0,placeholder:(null==r?void 0:r.id)?eN.getText("pisell2.text.ecocup.customer-first-modal.search-bar.placeholder-cup"):eN.getText("pisell2.text.ecocup.customer-first-modal.search-bar.placeholder"),onSearchResult:k,customerId:null==r?void 0:r.id}),(0,ev.jsxs)("div",{className:"pisell2-ecocup-customer-first-modal-search-bar-limit",children:[(0,ev.jsx)("span",{children:"Max"}),(0,ev.jsxs)("div",{children:[(0,ev.jsx)("span",{style:{color:y?"#CF1322":"#000000"},children:f}),"/",m]})]})]});return(0,ev.jsx)(lL.PisellModal,{open:a,title:l||eN.getText("pisell2.text.ecocup.customer-first-modal.title"),headerDivider:!1,onCancel:()=>{x||null==i||i()},onOk:_,okText:eN.getText("pisell2.text.ecocup.button.confirm"),cancelText:eN.getText("pisell2.text.ecocup.button.dismiss"),okButtonProps:{disabled:0===u.length||y||x||!(null==r?void 0:r.id),loading:x},width:580,children:(0,ev.jsxs)("div",{className:"pisell2-ecocup-customer-first-modal",children:[(null==s?void 0:s.firstType)==="customer"?(0,ev.jsxs)(ev.Fragment,{children:[w(),j()]}):(0,ev.jsxs)(ev.Fragment,{children:[j(),w()]}),(0,ev.jsx)(eJE,{maxNum:m,currentNum:f,cups:[...d,...u],customerData:r,onClearAll:()=>p([]),onRemove:e=>{p(u.filter(t=>(null==t?void 0:t.id)!==(null==e?void 0:e.id)))},onAction:(e,t)=>{let l=(null==t?void 0:t.eco_cup_id)?"eco_cup_id":"id";c(d.filter(e=>(null==e?void 0:e[l])!==(null==t?void 0:t[l])))}})]})})},eJL=[{name:"regular",labelKey:"pisell2.text.ecocup.setting.regular",placeholderKey:"pisell2.text.ecocup.setting.regular-placeholder",requiredMessageKey:"pisell2.text.ecocup.setting.regular-required"},{name:"business",labelKey:"pisell2.text.ecocup.setting.business",placeholderKey:"pisell2.text.ecocup.setting.business-placeholder",requiredMessageKey:"pisell2.text.ecocup.setting.business-required"},{name:"admin",labelKey:"pisell2.text.ecocup.setting.admin",placeholderKey:"pisell2.text.ecocup.setting.admin-placeholder",requiredMessageKey:"pisell2.text.ecocup.setting.admin-required"}],eJO=e=>{let{visible:t,onCancel:l,variant:a}=e,i=a||"desktop",n="phone"===i,[s]=ex.Form.useForm(),{post:r,get:o}=eJx(),[d,c]=(0,ef.useState)(!1),u=()=>{d||(null==l||l(),s.resetFields())},p=async()=>{if(!d)try{let e=await s.validateFields();if(!await g(e))return;u()}catch(e){console.error(e)}},m=async()=>{let e=await o("/shop/metadata/many",{keys:["eco_cup_customer_rent_config","eco_cup_rent_expire_config"]});if((null==e?void 0:e.code)==200){let{data:t}=e,l=(null==t?void 0:t.eco_cup_rent_expire_config)||{},a=(null==t?void 0:t.eco_cup_customer_rent_config)||[],i={expire:(null==l?void 0:l.expire)||30};a.forEach(e=>{(null==e?void 0:e.name)&&(i[e.name]=Number(null==e?void 0:e.max_rent_count)||void 0)}),s.setFieldsValue(i)}};(0,ef.useEffect)(()=>{m()},[]);let g=async e=>{let{expire:t,...l}=e,a=eJL.map(e=>({name:e.name,max_rent_count:l[e.name]}));try{c(!0);let e=await r("/shop/metadata/many",{eco_cup_customer_rent_config:a,eco_cup_rent_expire_config:{expire:t,unit:"day"}});if((null==e?void 0:e.code)==200)return(0,lL.PisellToast)({content:eN.getText("pisell2.text.ecocup.setting.success")}),!0;return!1}catch(e){return console.error("提交设置失败:",e),!1}finally{c(!1)}},h=()=>(0,ev.jsxs)("div",{className:"pisell2-ecocup-setting-modal-footer",children:[(0,ev.jsx)(lL.Button,{size:"large",onClick:u,disabled:d,children:eN.getText("pisell2.text.ecocup.button.cancel")}),(0,ev.jsx)(lL.Button,{size:"large",type:"primary",onClick:p,loading:d,children:eN.getText("pisell2.text.ecocup.button.confirm")})]}),v=eN.getText("pisell2.text.cup-project.footer.button.setting"),f=t_()("pisell2-ecocup-setting-modal",`pisell2-ecocup-setting-modal--${i}`);return(0,ev.jsx)(iB,{renderType:n?"drawer":"modal",showHandlerBar:n,onHandlerBarClick:u,props:n?{open:t,placement:"bottom",width:"100%",height:"auto",style:{maxHeight:"95dvh"},title:v,onClose:u,destroyOnClose:!0,footer:h(),rootClassName:f,className:f,bodyStyle:{padding:"0 24px"}}:{open:t,title:v,onCancel:u,width:680,centered:!0,destroyOnClose:!0,footer:h(),className:f,wrapClassName:f,bodyStyle:{padding:"0 24px",maxHeight:"min(560px, calc(100dvh - 220px))",overflowY:"auto"}},children:(0,ev.jsx)("div",{className:"pisell2-ecocup-setting-modal-content",children:(0,ev.jsxs)(ex.Form,{form:s,size:"large",children:[eJL.map(e=>(0,ev.jsx)(lL.FormItemInputNumber,{renderMode:"edit",name:e.name,label:eN.getText(e.labelKey),placeholder:eN.getText(e.placeholderKey),maxobj:{enabled:!0,max:9999,message:eN.getText("pisell2.text.ecocup.setting.max-rent-count-max")},minobj:{enabled:!0,min:0,message:eN.getText("pisell2.text.ecocup.setting.max-rent-count-min")},requiredobj:{required:!0,message:eN.getText(e.requiredMessageKey)}},e.name)),(0,ev.jsx)(lL.FormItemInputNumber,{renderMode:"edit",name:"expire",label:eN.getText("pisell2.text.ecocup.setting.expire-time"),placeholder:eN.getText("pisell2.text.ecocup.setting.expire-time-placeholder"),maxobj:{enabled:!0,max:365,message:eN.getText("pisell2.text.ecocup.setting.expire-time-max")},minobj:{enabled:!0,min:0,message:eN.getText("pisell2.text.ecocup.setting.expire-time-min")},suffix:eN.getText("pisell2.text.ecocup.setting.days"),requiredobj:{required:!0,message:eN.getText("pisell2.text.ecocup.setting.expire-time-required")}})]})})})};eJO.displayName="SettingModal";let eJR=iW(eJO);function eJ$(e){let{className:t,style:l,variant:a}=e,i=LG()||"en";eN.init(eJw,i);let n=eJf(),s=eJy("ecocup-add-customer-modal"),r=eJy("ecocup-setting-modal"),o=eJy("ecocup-customer-and-cup-modal"),{goalShopId:d}=eJb();return(0,ev.jsxs)("div",{className:t_()("ecocup-cup-project",`ecocup-cup-project--${a||"desktop"}`,t),style:l,children:[(0,ev.jsx)("div",{className:"ecocup-cup-project-title",children:eN.getText("pisell2.text.cup-project.title")}),(0,ev.jsx)("div",{className:"ecocup-cup-project-search-bar",children:(0,ev.jsx)(eJT,{scanListenerKey:"eco-cup-project-scan-listener",onSearchResult:e=>{(null==e?void 0:e.type)==="customer"?o.open({data:{firstType:null==e?void 0:e.type,customerData:null==e?void 0:e.data}}):(null==e?void 0:e.type)==="cup"&&o.open({data:{firstType:null==e?void 0:e.type,cupData:null==e?void 0:e.data}})}})}),(0,ev.jsx)("div",{className:"ecocup-cup-project-actions",children:eJj.map(e=>(0,ev.jsx)(lL.Button,{type:e.type,size:"large",icon:(0,ev.jsx)(lL.Icon,{type:e.icon,size:32}),onClick:()=>(e=>{var t,l,a,i;switch(e){case"add-new-customer":s.open();break;case"customer-list":let o;o=null==n?void 0:n(),d?null==o||null==(t=o.history)||t.push(`/ecocup/customer-list?goal_shop_id=${d}`):null==o||null==(l=o.history)||l.push("/ecocup/customer-list");break;case"cup-list":let c;c=null==n?void 0:n(),d?null==c||null==(a=c.history)||a.push(`/ecocup/cup-list?goal_shop_id=${d}`):null==c||null==(i=c.history)||i.push("/ecocup/cup-list");break;case"setting":r.open()}})(e.key),className:"ecocup-cup-project-actions-button",children:eN.getText(e.languageKey)},e.key))}),s.visible&&(0,ev.jsx)(eJA,{...s.modalProps}),o.visible&&(0,ev.jsx)(eJz,{...o.modalProps}),r.visible&&(0,ev.jsx)(eJR,{...r.modalProps})]})}eJ$.displayName="EcoCupProject";let eJF=iW(eJ$),eJB=e=>e?{isShopApi:!0}:{},eJH={in_stock:"pisell2.text.ecocup.status.in-stock",rent:"pisell2.text.ecocup.status.rent",return:"pisell2.text.ecocup.status.returned",missing:"pisell2.text.ecocup.action.more.missing",broken:"pisell2.text.ecocup.action.more.broken",shop_changed:"pisell2.text.ecocup.status.shop-changed"},eJq={in_stock:{backgroundColor:"transparent",color:"#A3A3A3",border:"#A3A3A3"},rent:{backgroundColor:"#ECFDF3",color:"#067647",border:"#ABEFC6"},returned:{backgroundColor:"#000000",color:"#000000"},return:{backgroundColor:"transparent",color:"#A3A3A3",border:"#A3A3A3"},shop_changed:{backgroundColor:"transparent",color:"#A3A3A3",border:"#A3A3A3"},overtime:{backgroundColor:"#FEF3F2",color:"#F04438",border:"#F04438"},expire_soon:{backgroundColor:"#FFFAEB",color:"#F79009",border:"#FEDF89"},borrowing:{backgroundColor:"#000000",color:"#000000",border:"#FEDF89"},missing:{backgroundColor:"#FEF3F2",color:"#F04438",border:"#F04438"},broken:{backgroundColor:"#FEF3F2",color:"#F04438",border:"#F04438"}},eJV=[{label:"pisell2.text.ecocup.status.all",value:0},{label:"pisell2.text.ecocup.status.in-stock",value:"in_stock"},{label:"pisell2.text.ecocup.status.rent",value:"rent"},{label:"pisell2.text.ecocup.action.more.missing",value:"missing"},{label:"pisell2.text.ecocup.action.more.broken",value:"broken"},{label:"pisell2.text.ecocup.status.shop-changed",value:"shop_changed"}],eJY={show:!0,list:[{columnKey:"rent_time",key:"rent_time",type:"date",localFilter:!1},{columnKey:"return_time",key:"return_time",type:"date",localFilter:!1}]},eJU={show:!0,storageMode:"localStorage"},eJW=[{languageKey:"pisell2.text.ecocup.share.title",key:"share",size:"large",icon:"pisell2-share-06",type:"default"},{languageKey:"pisell2.text.ecocup.export.title",key:"export",size:"large",icon:"pisell2-download-01",type:"default"}],eJG="ecocup-cup-list",eJQ="ecocup-cup-list",eJK="ecocup-page-header",eJJ=e=>{var t;let{title:l,rightContent:a,isReturn:i=!0}=e,n=ik(),{history:s}=(null==n||null==(t=n.appHelper)?void 0:t.utils)||{},r=eJf();return(0,ev.jsxs)("div",{className:eJK,onClick:()=>{var e,t;i&&((null==r?void 0:r.history)?null==(e=r.history)||e.goBack():null==s||null==(t=s.goBack)||t.call(s))},children:[(0,ev.jsxs)("div",{className:`${eJK}-left-container`,children:[i?(0,ev.jsx)(_G,{style:{fontSize:18}}):null,(0,ev.jsx)(lL.PageHeader,{title:l,showTitle:!0})]}),(0,ev.jsx)("div",{className:`${eJK}-right-container`,onClick:e=>e.stopPropagation(),children:a||""})]})},eJZ="ecocup-cup-list",eJX="YYYY-MM-DD HH:mm:ss",eJ0=e=>{var t,l,a;let i,n,s,r,[o,d]=(0,ef.useState)([em()().startOf("day"),em()().endOf("day")]),c=eJy("ecocup-list-action-modal"),{isNormalShop:u}=eJb();eJ_();let p=eJk(),m=LG()||"en",{isEcoShare:g}={source:i=new URLSearchParams((null==(l=window)||null==(t=l.location)?void 0:t.search)||{}).get("source"),isEcoShare:!!i&&"ecoShare"===i};eN.init(eJw,m);let[h,v]=(0,ef.useState)({skip:1,num:10}),f=(0,ef.useRef)(h),{loading:y,data:x,run:b}=(e=>{let{isEcoShare:t}=e,[l,a]=(0,ef.useState)(!1),[i,n]=(0,ef.useState)({}),{get:s}=eJx(),{isNormalShop:r}=eJb(),o=eJk(),d=eJB(t);return{loading:l,data:i,run:(0,ef.useCallback)(async e=>{try{let t=r||(null==e?void 0:e.partner_shop_id);a(!0);let l={type:t?"partner":"eco",with:["customer:id,display_name","rentShop:id,name","returnShop:id,name","currentShop:id,name"],...e};t&&(l.with=["customer:id,display_name","rentShop:id,name","returnShop:id,name"]),o&&(l={num:null==e?void 0:e.num,skip:null==e?void 0:e.skip});let i=await s(o?"/h5/wallet/eco":"/shop/wallet/eco",l,d);n((null==i?void 0:i.data)||{}),a(!1)}catch(e){a(!1)}},[])}})({isEcoShare:g}),{data:_,getStatics:k}=(e=>{let{isEcoShare:t}=e,[l,a]=(0,ef.useState)({}),{get:i}=eJx(),{isNormalShop:n}=eJb(),s=eJB(t);return{data:l,getStatics:(0,ef.useCallback)(async e=>{try{let t={type:n||(null==e?void 0:e.partner_shop_id)?"partner":"eco",...e},l=await i("/shop/wallet/eco/statistics",t,s);a((null==l?void 0:l.data)||{})}catch(e){}},[])}})({isEcoShare:g}),{data:w,getEcoShopLists:j}=(e=>{let{isEcoShare:t}=e,[l,a]=(0,ef.useState)([]),{get:i}=eJx(),n=eJB(t);return{data:l,getEcoShopLists:(0,ef.useCallback)(async e=>{try{let e=await i("/shop/wallet/eco/shops",{skip:1,num:100},n);a((null==e?void 0:e.data)||[])}catch(e){}},[])}})({isEcoShare:g}),{postExportApi:S}=(()=>{let{post:e}=eJx(),t=eJ_(),l=ik();return{postExportApi:(0,ef.useCallback)(async a=>{try{var i,n;let{downloadFile:s}=(null==l||null==(i=l.appHelper)?void 0:i.utils)||{},{isPartner:r,listParams:o}=a,d={type:r?"partner":"eco",business_shop_id:r?null==o?void 0:o.partner_shop_id:t,operated_at_start:null==o?void 0:o.operated_at_start,operated_at_end:null==o?void 0:o.operated_at_end},c=await e("/shop/wallet/eco/export-url",d);if(null==c||null==(n=c.data)?void 0:n.export_url){let e=new Date().toISOString().replace(/[-:T.]/g,"").slice(0,14),t=`shop-eco-cups-${e}.csv`;s&&s(c.data.export_url,t),(0,lL.PisellToast)({content:eN.getText("pisell2.text.ecocup.export.success")});return}(0,lL.PisellToast)({content:eN.getText("pisell2.text.ecocup.export.fail")})}catch(e){}},[])}})(),{postShareApi:M}=(()=>{var e;let{post:t}=eJx(),l=eJf(),a=ik(),i=(0,ef.useMemo)(()=>{var e,t,a,i,n,s;return null==l||null==(s=l())||null==(n=s.data)||null==(i=n.store)||null==(a=i.getStore)||null==(t=a.call(i))||null==(e=t.getDataByModel)?void 0:e.call(t,"tenantCore","core")},[l]);return{postShareApi:(0,ef.useCallback)(async()=>{try{var e,n,s,r,o,d,c,u,p,m;let g=null==(r=l())||null==(s=r.data)||null==(n=s.storage)||null==(e=n.getStorage)?void 0:e.call(n,"token"),{copyToClipboard:h}=(null==a||null==(d=a.appHelper)||null==(o=d.utils)?void 0:o.businessUtils)||{};if(!g)return;let v=await t("/tenant/core/stash-token",{ttl:604800,data:{login_token:g}},{isPisell2:!0});if((null==v||null==(c=v.data)?void 0:c.token)&&(null==i||null==(u=i.tenant)?void 0:u.default_domain)){let e=`https://${null==i||null==(p=i.tenant)?void 0:p.default_domain}/admin/ecocup/cup-list`,t=`${e}?source=ecoShare&key=${null==v||null==(m=v.data)?void 0:m.token}`;h&&h(t),(0,lL.PisellToast)({content:eN.getText("pisell2.text.ecocup.toast.success-copy-link")})}}catch(e){}},[null==i||null==(e=i.tenant)?void 0:e.default_domain])}})(),N=(0,ef.useMemo)(()=>!!(u||(null==h?void 0:h.partner_shop_id)),[u,null==h?void 0:h.partner_shop_id]);(0,ef.useEffect)(()=>{f.current=h},[h]);let C=(0,ef.useCallback)(e=>{b({...(null==f?void 0:f.current)||{},...e})},[h]);(0,ef.useEffect)(()=>{var e,t;p||k({started_at:null==o||null==(e=o[0])?void 0:e.format(eJX),ended_at:null==o||null==(t=o[1])?void 0:t.format(eJX),partner_shop_id:null==h?void 0:h.partner_shop_id})},[o,p,null==h?void 0:h.partner_shop_id]),(0,ef.useEffect)(()=>{u||p||j({})},[u,p]),(0,ef.useEffect)(()=>{C()},[C]);let T=(e=>{let{onClickAction:t,locales:l,isEcoShare:a}=e,i=eJk(),n=e=>{if(!e)return"";let t=em()().diff(em()(e),"day");return 0===t?l.getText("pisell2.text.ecocup.table.time-of-return.today"):l.getText("pisell2.text.ecocup.table.time-of-rent.relative")(t)};return[{title:l.getText("pisell2.text.ecocup.table.cup-code"),dataIndex:"eco_cup_code",key:"eco_cup_code",align:"center",width:170,render:(e,t)=>e||(null==t?void 0:t.code)||""},{title:l.getText("pisell2.text.ecocup.table.customer"),dataIndex:"customer",key:"customer",align:"center",hidden:i,with:220,render:(e,t)=>{var l;return(null==t||null==(l=t.customer)?void 0:l.display_name)||""}},{title:l.getText("pisell2.text.ecocup.table.status"),dataIndex:"status",key:"status",align:"center",width:120,render:e=>{let t=eJH[e],a=eJq[e];return(0,ev.jsx)("div",{className:`${eJG}-table-status`,style:{backgroundColor:null==a?void 0:a.backgroundColor,color:null==a?void 0:a.color,border:`1px solid ${null==a?void 0:a.border}`},children:l.getText(t)})}},{title:l.getText("pisell2.text.ecocup.table.shop-of-rent"),dataIndex:"rent_shop",key:"rent_shop",align:"center",hidden:i,width:200,render:(e,t)=>{var l;return(null==t||null==(l=t.rent_shop)?void 0:l.name)||""}},{title:l.getText("pisell2.text.ecocup.table.time-of-rent"),dataIndex:"rent_time",key:"rent_time",align:"center",hidden:i,width:160,render:e=>e?(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,ev.jsx)("span",{children:em()(e).format("DD/MM/YYYY")}),(0,ev.jsx)("span",{children:n(e)})]}):""},{title:l.getText("pisell2.text.ecocup.table.shop-of-return"),dataIndex:"return_shop",key:"return_shop",align:"center",hidden:i,width:200,render:(e,t)=>{var l;return(null==t||null==(l=t.return_shop)?void 0:l.name)||""}},{title:l.getText("pisell2.text.ecocup.table.time-of-return"),dataIndex:"return_time",key:"return_time",align:"center",hidden:i,width:160,render:e=>e?em()(e).format("DD/MM/YYYY"):""},{title:l.getText("pisell2.text.ecocup.rent"),dataIndex:"rent_shop",key:"rent_shop",align:"center",hidden:!i,width:160,render:(e,t)=>{var l,a;return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(null==t||null==(l=t.rent_shop)?void 0:l.name)?(0,ev.jsx)("span",{children:null==t||null==(a=t.rent_shop)?void 0:a.name}):null,(null==t?void 0:t.rent_time)?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{children:em()(null==t?void 0:t.rent_time).format("DD/MM/YYYY")}),(0,ev.jsx)("span",{children:n(null==t?void 0:t.rent_time)})]}):null]})}},{title:l.getText("pisell2.text.ecocup.action.return"),dataIndex:"return_shop",key:"return_shop",align:"center",hidden:!i,width:160,render:(e,t)=>{var l,a;return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(null==t||null==(l=t.return_shop)?void 0:l.name)?(0,ev.jsx)("span",{children:null==t||null==(a=t.return_shop)?void 0:a.name}):null,(null==t?void 0:t.return_time)?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{children:em()(null==t?void 0:t.return_time).format("DD/MM/YYYY")}),(0,ev.jsx)("span",{children:n(null==t?void 0:t.return_time)})]}):null]})}},{title:l.getText("pisell2.text.ecocup.table.actions"),dataIndex:"actions",key:"actions",hidden:i||a,width:180,render:(e,a)=>{let i=(null==a?void 0:a.status)||"";return(null==a?void 0:a.shop_id)===(null==a?void 0:a.current_shop_id)||(null==a?void 0:a.eco_cup_id)?(0,ev.jsxs)("div",{className:`${eJG}-table-actions`,children:["rent"===i?(0,ev.jsx)(lL.Button,{type:"primary",onClick:()=>t("return",a),children:l.getText("pisell2.text.ecocup.action.return")}):null,["in_stock","rent"].includes(i)?(0,ev.jsx)(eJI,{locales:l,onClick:e=>t(e,a)}):null]}):null}}]})({onClickAction:(0,ef.useCallback)((e,t)=>{c.open({data:{type:e,cupData:t,customerData:(null==t?void 0:t.customer)||{}},onCancel:c.close,onOk:e=>{c.close(),C()}})},[c]),locales:eN,isEcoShare:g}),P=(n=(0,ef.useMemo)(()=>[{key:"cup-rent",title:N?eN.getText("pisell2.text.ecocup.cup-rent"):eN.getText("pisell2.text.ecocup.eco.cup-rent"),value:(null==_?void 0:_.rent_count)||0,type:"primary"},{key:"cup-returned",title:N?eN.getText("pisell2.text.ecocup.cup-returned"):eN.getText("pisell2.text.ecocup.eco.cup-returned"),value:(null==_?void 0:_.return_count)||0,type:"primary"},{key:"available-to-rent",title:eN.getText("pisell2.text.ecocup.available-to-rent"),value:(null==_?void 0:_.in_stock_count)||0}],[_,N]),(0,ef.useMemo)(()=>()=>(0,ev.jsx)(lL.Row,{gutter:8,className:`${eJQ}-summary`,children:n.map(e=>(0,ev.jsx)(lL.Col,{span:8,children:(0,ev.jsx)(lL.Card,{className:`${eJQ}-summary-card ${(null==e?void 0:e.type)==="primary"?`${eJQ}-summary-primary`:""}`,children:(0,ev.jsx)(lL.Statistic,{title:e.title,value:e.value,className:`${eJQ}-summary-card-statistic`})})},e.key))}),[n])),{run:A}=ns((e,t)=>{var l,a,i;let n=null==t||null==(l=t.order_by)?void 0:l.split(":"),s={...(null==t?void 0:t.filters)||{},order_by:null==n?void 0:n[0],sort:null==n?void 0:n[1],skip:(null==t||null==(a=t.pagination)?void 0:a.page)||1,num:(null==t||null==(i=t.pagination)?void 0:i.size)||10,partner_shop_id:(null==t?void 0:t.partner_shop_id)||void 0,status:(null==t?void 0:t.status)||void 0};v(e=>({...e,...s}))},{wait:200}),D=(e,t)=>{"search"===t?v(t=>({...t,search:e,skip:1})):(d(e),v(t=>{var l,a;return{...t,skip:1,operated_at_start:null==e||null==(l=e[0])?void 0:l.format(eJX),operated_at_end:null==e||null==(a=e[1])?void 0:a.format(eJX)}}))},I=(0,ef.useMemo)(()=>({pageSize:10,total:(null==x?void 0:x.count)||0,size:"large",current:(null==h?void 0:h.skip)||1,localPagination:!1}),[null==x?void 0:x.count,null==h?void 0:h.skip]),E=i0(e=>{"export"===e?S({isPartner:N,listParams:h}):"share"===e&&M()}),z=(0,ef.useMemo)(()=>u||g?null:(0,ev.jsx)("div",{className:`${eJZ}-header-right-content`,children:eJW.map(e=>(0,ev.jsx)(lL.Button,{type:e.type,size:"large",icon:(0,ev.jsx)(lL.Icon,{type:e.icon,size:22}),onClick:()=>E(e.key),className:`${eJZ}-header-right-content-button`,children:eN.getText(e.languageKey)},e.key))}),[u,E,g]);return(0,ev.jsxs)("div",{className:`${eJZ}-container`,children:[(0,ev.jsx)(lL.Page,{style:{height:"100%"},children:(0,ev.jsx)(lL.Table,{dataSource:(null==x?void 0:x.list)||[],columns:T,title:p?null:(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)(eJJ,{title:eN.getText("pisell2.text.ecocup.title"),rightContent:z,isReturn:!g}),(0,ev.jsxs)("div",{className:`${eJZ}-header`,children:[(0,ev.jsx)(lL.DatePicker.RangePicker,{inputReadOnly:!0,bordered:!1,allowClear:!1,size:"large",suffixIcon:(0,ev.jsx)(cU,{}),value:o,onChange:D,format:"DD/MM/YYYY",className:`${eJZ}-date-picker`}),(0,ev.jsx)(eJT,{scanListenerKey:"eco-cup-list-scan-listener",size:"small",placeholder:eN.getText("pisell2.text.ecocup.scan-or-search"),onSearch:e=>D(e,"search")})]})]}),align:"center",pagination:I,columnSetting:p?null:eJU,sort:p?null:eJY,filter:p?null:(a=null==h?void 0:h.skip,s=N?eJV:eJV.filter(e=>"shop_changed"!==e.value),r=[{name:eN.getText("pisell2.text.ecocup.status.all"),id:0}].concat(w||[]),{show:!0,quickFilterMaxLength:3,currentPagination:a||1,list:[{key:"status",type:"select",columnKey:"",isCustom:!0,name:"status",sort:!0,localFilter:!1,other:{size:"large",allowClear:!0,showSearch:!1,placeholder:eN.getText("pisell2.text.ecocup.status.placeholder"),defaultValue:0,options:s.map(e=>({label:eN.getText(e.label),value:e.value})),style:{width:240}}},{key:"partner_shop_id",type:"select",columnKey:"",isCustom:!0,name:"partner_shop_id",sort:!0,localFilter:!1,isHidden:u,other:{size:"large",allowClear:!0,showSearch:!1,placeholder:eN.getText("pisell2.text.ecocup.status.shop.placeholder"),defaultValue:0,options:r.map(e=>({label:(null==e?void 0:e.name)||"",value:e.id})),style:{width:240}}}]}),summary:p?null:P,className:`${eJZ}-table`,rowClassName:`${eJZ}-table-row`,loading:y,onValuesChange:A,rowKey:"id",virtual:!1,tableLayout:"",scroll:{scrollToFirstRowOnChange:!0,autoCalc:!0}})}),c.visible&&(0,ev.jsx)(eJD,{...c.modalProps})]})},eJ2={show:!0,list:[{columnKey:"display_name",key:"display_name",type:"string",localFilter:!1},{columnKey:"create_time",key:"create_time",type:"date",localFilter:!1}]},eJ1={show:!0,storageMode:"localStorage"};function eJ4(e){let t=LG()||"en",[l,a]=(0,ef.useState)({skip:1,num:20});eN.init(eJw,t);let i=eJy("ecocup-customer-list-modal"),{loading:n,data:s,run:r}=(()=>{let[e,t]=(0,ef.useState)(!1),[l,a]=(0,ef.useState)({}),{get:i}=eJx(),{goalShopId:n}=eJb();return{loading:e,data:l,run:(0,ef.useCallback)(async e=>{try{t(!0);let l={with_cup_count_flag:1,goal_shop_id:n,...e},s=await i("/shop/wallet/eco/customer",l);a((null==s?void 0:s.data)||{}),t(!1)}catch(e){t(!1)}},[])}})(),o=(0,ef.useCallback)(e=>{r({...l,...e})},[l]);(0,ef.useEffect)(()=>{o()},[o]);let d=[{title:eN.getText("pisell2.text.ecocup.customer.list.customer"),dataIndex:"display_name",key:"display_name",align:"center",width:240},{title:eN.getText("pisell2.text.ecocup.customer.list.registed"),dataIndex:"create_time",key:"create_time",align:"center",width:200,render:e=>e?em()(e).format("h:mma D MMM YYYY"):""},{title:eN.getText("pisell2.text.ecocup.customer.list.mobile"),dataIndex:"phone",key:"phone",align:"center",width:250},{title:eN.getText("pisell2.text.ecocup.customer.list.email"),dataIndex:"email",key:"email",align:"center",width:250},{title:eN.getText("pisell2.text.ecocup.customer.list.cup.borrowed"),dataIndex:"total_rent_count",key:"total_rent_count",align:"center",width:160},{title:eN.getText("pisell2.text.ecocup.customer.list.cup.returned"),dataIndex:"total_return_count",key:"total_return_count",align:"center",width:160}],{run:c}=ns((e,t)=>{var l,i,n;let s=null==t||null==(l=t.order_by)?void 0:l.split(":"),r={...(null==t?void 0:t.filters)||{},order_by:null==s?void 0:s[0],sort:null==s?void 0:s[1],skip:(null==t||null==(i=t.pagination)?void 0:i.page)||1,num:(null==t||null==(n=t.pagination)?void 0:n.size)||20};a(e=>({...e,...r}))},{wait:200});return(0,ev.jsxs)("div",{className:"ecocup-customer-list-container",children:[(0,ev.jsx)(lL.Table,{dataSource:(null==s?void 0:s.list)||[],columns:d,align:"center",title:(0,ev.jsx)(eJJ,{title:eN.getText("pisell2.text.ecocup.customer.list.title")}),pagination:{pageSize:20,total:(null==s?void 0:s.count)||0,size:"large"},columnSetting:eJ1,sort:eJ2,filter:{show:!0,quickFilterMaxLength:3,list:[{key:"search",type:"search",columnKey:"",sort:!0,localFilter:!1,isCustom:!0,name:"search",other:{size:"large",allowClear:!0,placeholder:eN.getText("pisell2.text.ecocup.customer.list.search.placeholder"),trigger:["onChange","onPressEnter"],style:{width:240}}}]},loading:n,onValuesChange:c,rowKey:"id",virtual:!1,tableLayout:"",scroll:{scrollToFirstRowOnChange:!0,autoCalc:!0},onRow:e=>({style:{cursor:"pointer"},onClick:()=>{i.open({title:eN.getText("pisell2.text.ecocup.customer.list.customer.profile"),data:{customerData:e,firstType:"customer"}})}})}),i.visible&&(0,ev.jsx)(eJz,{...i.modalProps})]})}let eJ3=e=>({nil:e.getText("pisell2.orderList.deliveryType.nil"),shipping:e.getText("pisell2.orderList.deliveryType.shipping"),local_delivery:e.getText("pisell2.orderList.deliveryType.local_delivery"),pickup:e.getText("pisell2.orderList.deliveryType.pickup"),shop_service:e.getText("pisell2.orderList.deliveryType.shop_service")}),eJ8=e=>({open:e.getText("pisell2.orderList.orderStatus.open"),completed:e.getText("pisell2.orderList.orderStatus.completed"),cancelled:e.getText("pisell2.orderList.orderStatus.cancelled")}),eJ6={open:{borderColor:"#1570EF",textColor:"#175CD3"},completed:{borderColor:"#079455",textColor:"#067647"},cancelled:{borderColor:"#D92D20",textColor:"#B42318"}},eJ5=e=>({fulfilled:e.getText("pisell2.orderList.shippingStatus.falseulfilled"),unfulfilled:e.getText("pisell2.orderList.shippingStatus.unfulfilled"),fulfilling:e.getText("pisell2.orderList.shippingStatus.fulfilling"),partial_fulfilled:e.getText("pisell2.orderList.shippingStatus.partial_fulfilled")}),eJ7={fulfilling:{borderColor:"#DC6803",textColor:"#B54708"},unfulfilled:{borderColor:"#DC6803",textColor:"#B54708"},partial_fulfilled:{borderColor:"#088AB2",textColor:"#0E7090"},fulfilled:{borderColor:"#475467",textColor:"#344054"}},eJ9=e=>({authorized:e.getText("pisell2.orderList.paymentStatus.authorized"),paid:e.getText("pisell2.orderList.paymentStatus.paid"),partially_refunded:e.getText("pisell2.orderList.paymentStatus.partially_refunded"),payment_pending:e.getText("pisell2.orderList.paymentStatus.payment_pending"),refunded:e.getText("pisell2.orderList.paymentStatus.refunded"),unpaid:e.getText("pisell2.orderList.paymentStatus.unpaid"),voided:e.getText("pisell2.orderList.paymentStatus.voided"),payment_processing:e.getText("pisell2.orderList.paymentStatus.payment_processing")}),eZe={unpaid:"#B2DDFF",payment_processing:"#FEDF89",payment_pending:"#FEDF89",authorized:"#ABEFC6",paid:"#ABEFC6",refunded:"#FECDCA",partially_refunded:"#FCCEEE",voided:"#D0D5DD"},eZt=(e,t)=>t[e]||"",{useContainerContext:eZl}=lL.PisellDataSourceContainer,eZa=e=>{let{locales:t,setValueType:l,clearSelectedData:a}=e,{serverActions:{list:i}}=eZl(),n=ex.Form.useFormInstance();return(0,ev.jsx)(ex.Button,{icon:(0,ev.jsx)(MG,{}),onClick:()=>{n.resetFields(),i.onReset(),l(void 0),a()},children:t.getText("pisell2.orderList.common.reset")})},{useContainerContext:eZi}=lL.PisellDataSourceContainer,eZn=e=>{let{locales:t,valueType:l,setValueType:a}=e,i=ex.Form.useFormInstance(),{serverActions:n}=eZi(),{list:s}=n;return(0,ev.jsxs)("div",{style:{display:"flex",gap:"8px"},children:[(0,ev.jsx)(ex.Button,{type:"primary",ghost:1!==l,onClick:()=>{let e=em()(),t={orderDate:[e.startOf("day"),e.endOf("day")],payment_status:void 0};i.setFieldsValue(t),s.onSearch(t),a(1)},children:t.getText("pisell2.orderList.filterButton.todayOrders")}),(0,ev.jsx)(ex.Button,{type:"primary",ghost:2!==l,onClick:()=>{let e=em()(),t={orderDate:[e.startOf("day"),e.endOf("day")],payment_status:["payment_processing","unpaid"]};i.setFieldsValue(t),s.onSearch(t),a(2)},children:t.getText("pisell2.orderList.filterButton.todayPending")}),(0,ev.jsx)(ex.Button,{type:"primary",ghost:3!==l,onClick:()=>{let e=em()(),t={orderDate:[e.startOf("day"),e.endOf("day")],payment_status:["refunded","partially_refunded"]};i.setFieldsValue(t),s.onSearch(t),a(3)},children:t.getText("pisell2.orderList.filterButton.todayRefunds")}),(0,ev.jsx)(ex.Button,{type:"primary",ghost:4!==l,onClick:()=>{let e=em()(),t={orderDate:[e.subtract(6,"day").startOf("day"),e.endOf("day")],payment_status:void 0};i.setFieldsValue(t),s.onSearch(t),a(4)},children:t.getText("pisell2.orderList.filterButton.last7Days")})]})},{ColumnsSetting:eZs}=lL.PisellDataSourceContainer,eZr=e=>{let{locales:t,__id:l}=e,a=(0,ef.useMemo)(()=>{let e,l,a,i;return{otherFilter:(e=eJ8(t),l=eJ9(t),a=eJ5(t),i=eJ3(t),[{name:"status",type:"select",key:"status",label:t.getText("pisell2.orderList.filter.orderStatus.label"),other:{allowClear:!0,mode:"multiple",placeholder:t.getText("pisell2.orderList.filter.orderStatus.placeholder"),options:Object.entries(e).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"payment_status",type:"select",key:"payment_status",label:t.getText("pisell2.orderList.filter.paymentStatus.label"),other:{allowClear:!0,mode:"multiple",placeholder:t.getText("pisell2.orderList.filter.paymentStatus.placeholder"),options:Object.entries(l).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"shipping_status",type:"select",key:"shipping_status",label:t.getText("pisell2.orderList.filter.shippingStatus.label"),other:{allowClear:!0,mode:"multiple",placeholder:t.getText("pisell2.orderList.filter.shippingStatus.placeholder"),options:Object.entries(a).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"customer_id",type:"select",key:"customer_id",label:t.getText("pisell2.orderList.filter.customer.label"),other:{allowClear:!0,isSearchServer:!0,showSearch:!0,placeholder:t.getText("pisell2.orderList.filter.customer.placeholder"),options:e=>eVi(e).then(e=>e.map(e=>({label:e.display_name,value:e.id})))}},{name:"order_sales_channel",type:"select",key:"order_sales_channel",label:t.getText("pisell2.orderList.filter.salesChannel.label"),other:{allowClear:!0,mode:"multiple",placeholder:t.getText("pisell2.orderList.filter.salesChannel.placeholder"),options:()=>eVs().then(e=>e.map(e=>({label:e.name,value:e.code})))}},{name:"payment_methods",type:"select",key:"payment_methods",label:t.getText("pisell2.orderList.filter.paymentMethod.label"),other:{allowClear:!0,mode:"multiple",placeholder:t.getText("pisell2.orderList.filter.paymentMethod.placeholder"),options:()=>eVr().then(e=>Array.from(new Map(e.map(e=>[e.code,{label:e.name,value:e.code}])).values()))}},{name:"total_amount",type:"numberRange",key:"total_amount",label:t.getText("pisell2.orderList.filter.totalAmount.label"),other:{placeholder:t.getText("pisell2.orderList.filter.totalAmount.placeholder")}},{name:"tag_ids",type:"select",key:"tag_ids",label:t.getText("pisell2.orderList.filter.tags.label"),other:{allowClear:!0,mode:"multiple",isSearchServer:!0,showSearch:!0,placeholder:t.getText("pisell2.orderList.filter.tags.placeholder"),options:e=>eVn(e).then(e=>e.map(e=>({label:e.name,value:e.id})))}},{name:"shipping_type",type:"select",key:"shipping_type",label:t.getText("pisell2.orderList.filter.shippingType.label"),other:{allowClear:!0,mode:"multiple",placeholder:t.getText("pisell2.orderList.filter.shippingType.placeholder"),options:Object.entries(i).filter(e=>{let[t]=e;return!["nil","shop_service"].includes(t)}).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"delivery_zone_name",type:"text",key:"delivery_zone_name",label:t.getText("pisell2.orderList.filter.deliveryZone.label"),other:{placeholder:t.getText("pisell2.orderList.filter.deliveryZone.placeholder")}},{name:"location_id",type:"select",key:"location_id",label:t.getText("pisell2.orderList.filter.pickupLocation.label"),other:{allowClear:!0,placeholder:t.getText("pisell2.orderList.filter.pickupLocation.placeholder"),options:()=>eVd().then(e=>e.map(e=>({label:e.name,value:e.id})))}},{name:"shipping_order_number",type:"text",key:"shipping_order_number",label:t.getText("pisell2.orderList.filter.trackingNumber.label"),other:{placeholder:t.getText("pisell2.orderList.filter.trackingNumber.placeholder")}},{name:"logistics_company_id",type:"select",key:"logistics_company_id",label:t.getText("pisell2.orderList.filter.logistics.label"),other:{allowClear:!0,mode:"multiple",placeholder:t.getText("pisell2.orderList.filter.logistics.placeholder"),options:()=>eVo().then(e=>e.map(e=>({label:e.name,value:e.id})))}},{name:"zip",type:"text",key:"zip",label:t.getText("pisell2.orderList.filter.zipCode.label"),other:{placeholder:t.getText("pisell2.orderList.filter.zipCode.placeholder")}}])}},[t]),i=(0,ef.useMemo)(()=>[{type:"string",isCustom:!1,name:"shop_full_order_number",label:t.getText("pisell2.orderList.sort.orderNumber")},{type:"time",isCustom:!1,name:"created_at",label:t.getText("pisell2.orderList.sort.createdAt")},{type:"time",isCustom:!1,name:"updated_at",label:t.getText("pisell2.orderList.sort.updatedAt")},{type:"string",isCustom:!1,name:"customer_name",label:t.getText("pisell2.orderList.sort.customerName")},{type:"date",isCustom:!1,name:"payment_status",label:t.getText("pisell2.orderList.sort.paymentStatus")},{type:"date",isCustom:!1,name:"shipping_status",label:t.getText("pisell2.orderList.sort.shippingStatus")},{type:"number",isCustom:!1,name:"total_amount",label:t.getText("pisell2.orderList.sort.totalAmount")},{type:"time",isCustom:!1,name:"delivery_start_at",label:t.getText("pisell2.orderList.sort.deliveryStartAt")}],[t]);return(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)(eZs,{__id:l}),(0,ev.jsx)(lL.PisellSort,{hasForm:!1,list:i}),(0,ev.jsx)(lL.PisellFilter,{placement:"bottomLeft",hasForm:!1,value:a})]})},eZo=e=>{let{locales:t}=e,l=(0,ef.useMemo)(()=>[{name:"orderDate",type:"rangePicker",key:"orderDate",label:t.getText("pisell2.orderList.quickFilter.orderDate.label"),other:{placeholder:t.getText("pisell2.orderList.quickFilter.orderDate.placeholder")}},{name:"keyword",type:"search",key:"keyword",other:{allowClear:!0,placeholder:t.getText("pisell2.orderList.quickFilter.keyword.placeholder"),trigger:["onChange"],style:{width:"400px"}}}],[t]);return(0,ev.jsx)(lL.PisellQuickFilter,{hasForm:!1,filterList:l})},{useContainerContext:eZd}=lL.PisellDataSourceContainer,eZc=e=>{let{locales:t,clearSelectedData:l,__id:a}=e,{serverActions:i,refManager:n,...s}=eZd(),[r,o]=(0,ef.useState)(void 0);return(0,ev.jsx)(ex.Form,{size:"large",layout:"vertical",initialValues:{orderDate:[em()().startOf("day"),em()().endOf("day")]},...s,children:(0,ev.jsx)(lL.PisellToolBar,{topLeft:(0,ev.jsx)(eZo,{locales:t}),topRight:(0,ev.jsx)(eZa,{locales:t,setValueType:o,clearSelectedData:l}),bottomLeft:(0,ev.jsx)(eZn,{valueType:r,setValueType:o,locales:t}),bottomRight:(0,ev.jsx)(eZr,{locales:t,__id:a})})})},{useContainerContext:eZu}=lL.PisellDataSourceContainer,eZp=e=>{let{selectedKeys:t,selectedRows:l,onClearSelection:a,locales:i}=e,n=ik(),[s,r]=(0,ef.useState)({}),{serverActions:{list:o}}=eZu(),d=(0,ef.useCallback)(e=>{o.refresh(),a()},[a]),c=(0,ef.useCallback)((e,t)=>{},[]),u=(0,ef.useCallback)(async(e,t)=>{let l=!0;lL.PisellModal.confirm({title:i.getText("pisell2.orderList.batchAction.ship.title")(e.length),cancelText:i.getText("pisell2.orderList.batchAction.button.cancel"),okText:i.getText("pisell2.orderList.batchAction.button.ok"),content:(0,ev.jsxs)("div",{children:[(0,ev.jsx)("p",{children:i.getText("pisell2.orderList.batchAction.ship.content")}),(0,ev.jsx)(ex.Checkbox,{defaultChecked:!0,onChange:e=>{l=e.target.checked},children:i.getText("page.order.fa.check")})]}),onOk:async()=>{try{r(e=>({...e,ship:!0})),await eVu({ids:e,is_notice:+!!l}),d()}catch(e){c()}finally{r(e=>({...e,ship:!1}))}}})},[d,c]),p=(0,ef.useCallback)(async(e,t)=>{lL.PisellModal.confirm({title:i.getText("page.order.table.list.button.send.invoice.tip"),cancelText:i.getText("pisell2.orderList.batchAction.button.cancel"),okText:i.getText("pisell2.orderList.batchAction.button.ok"),onOk:async()=>{try{r(e=>({...e,invoice:!0})),await eVp({order_ids:e}),d()}catch(e){c()}finally{r(e=>({...e,invoice:!1}))}}})},[d,c]),m=(0,ef.useCallback)((e,t)=>{var l,a;let i=null==(a=JSON.parse(window.app.data.storage.getStorage("core")))||null==(l=a.mypisell_data)?void 0:l.shop_id;i&&eVg({host:"",shop_id:i,ids:e})},[n]),g=(0,ef.useCallback)((e,t)=>{var l,a;let i=null==(a=JSON.parse(window.app.data.storage.getStorage("core")))||null==(l=a.mypisell_data)?void 0:l.shop_id;i&&eVh({host:"",shop_id:i,ids:e})},[n]),h=(0,ef.useCallback)(async(e,t)=>{let l=[];lL.PisellModal.confirm({title:i.getText("pisell2.orderList.batchAction.addTags.title")(e.length),width:520,cancelText:i.getText("pisell2.orderList.batchAction.button.cancel"),okText:i.getText("pisell2.orderList.batchAction.button.ok"),content:(0,ev.jsxs)("div",{style:{paddingTop:16},children:[(0,ev.jsx)("div",{style:{marginBottom:8,color:"#666"},children:i.getText("pisell2.orderList.column.tags")}),(0,ev.jsx)(lL.PisellQuickFilter,{hasForm:!1,filterList:[{name:"tag_ids",type:"select",key:"tag_ids",label:i.getText("pisell2.orderList.filter.tags.label"),other:{allowClear:!0,mode:"multiple",isSearchServer:!0,showSearch:!0,onChange:(e,t)=>{l=t.map(e=>e.label)},style:{width:"470px"},placeholder:i.getText("pisell2.orderList.filter.tags.placeholder"),options:e=>eVn(e).then(e=>e.map(e=>({label:e.name,value:e.id})))}}]})]}),onOk:async()=>{try{r(e=>({...e,addTags:!0})),await eVv({name:l,ids:e}),d()}catch(e){c()}finally{r(e=>({...e,addTags:!1}))}}})},[d,c]),v=(0,ef.useCallback)(async(e,t)=>{let l=[];lL.PisellModal.confirm({title:i.getText("pisell2.orderList.batchAction.removeTags.title")(e.length),width:520,cancelText:i.getText("pisell2.orderList.batchAction.button.cancel"),okText:i.getText("pisell2.orderList.batchAction.button.ok"),content:(0,ev.jsxs)("div",{style:{paddingTop:16},children:[(0,ev.jsx)("div",{style:{marginBottom:8,color:"#666"},children:i.getText("pisell2.orderList.column.tags")}),(0,ev.jsx)(lL.PisellQuickFilter,{hasForm:!1,filterList:[{name:"tag_ids",type:"select",key:"tag_ids",label:i.getText("pisell2.orderList.filter.tags.label"),other:{allowClear:!0,mode:"multiple",isSearchServer:!0,showSearch:!0,onChange:(e,t)=>{l=t.map(e=>e.label)},style:{width:"470px"},placeholder:i.getText("pisell2.orderList.filter.tags.placeholder"),options:e=>eVn(e).then(e=>e.map(e=>({label:e.name,value:e.id})))}}]})]}),onOk:async()=>{try{r(e=>({...e,removeTags:!0})),await eVf({name:l,ids:e}),d()}catch(e){c()}finally{r(e=>({...e,removeTags:!1}))}}})},[d,c]),f=(0,ef.useCallback)(async(e,t)=>{let l=null==t?void 0:t.filter(e=>"open"===e.status).length,a=null==t?void 0:t.filter(e=>"completed"===e.status).length,n=null==t?void 0:t.filter(e=>"cancelled"===e.status).length;lL.PisellModal.confirm({title:i.getText("page.order.cancel.title")(i.getText("pisell2.orderList.orderStatus.open")),cancelText:i.getText("pisell2.orderList.batchAction.button.cancel"),okText:i.getText("pisell2.orderList.batchAction.button.ok"),content:i.getText("page.order.lists.cancel.content")(l,a,n,i.getText("pisell2.orderList.orderStatus.completed"),!0,"void"),onOk:async()=>{try{r(e=>({...e,markAsOpen:!0})),await eVy({order_ids:e,status:"open"}),d()}catch(e){c()}finally{r(e=>({...e,markAsOpen:!1}))}}})},[d,c]),y=(0,ef.useCallback)(async(e,t)=>{let l=null==t?void 0:t.filter(e=>"open"===e.status).length,a=null==t?void 0:t.filter(e=>"completed"===e.status).length,n=null==t?void 0:t.filter(e=>"cancelled"===e.status).length;lL.PisellModal.confirm({title:i.getText("page.order.cancel.title")(i.getText("pisell2.orderList.orderStatus.completed")),cancelText:i.getText("pisell2.orderList.batchAction.button.cancel"),okText:i.getText("pisell2.orderList.batchAction.button.ok"),content:i.getText("page.order.lists.cancel.content")(l,a,n,i.getText("pisell2.orderList.orderStatus.open"),!0,""),onOk:async()=>{try{r(e=>({...e,markAsCompleted:!0})),await eVy({order_ids:e,status:"completed"}),d()}catch(e){c()}finally{r(e=>({...e,markAsCompleted:!1}))}}})},[d,c]),x=(0,ef.useCallback)(async(e,t)=>{let l=null==t?void 0:t.filter(e=>"open"===e.status).length,a=null==t?void 0:t.filter(e=>"completed"===e.status).length,n=null==t?void 0:t.filter(e=>"cancelled"===e.status).length,o=async t=>{try{r(e=>({...e,markAsCancelled:!0})),await eVy({order_ids:e,status:"cancelled",...1===t&&{is_void:t}}),d(),u.destroy()}catch(e){c()}finally{r(e=>({...e,markAsCancelled:!1}))}},u=lL.PisellModal.confirm({title:i.getText("page.order.cancel.title")(i.getText("pisell2.orderList.orderStatus.cancelled")),content:i.getText("page.order.lists.cancel.content")(l,a,n,i.getText("pisell2.orderList.orderStatus.cancelled"),!0,""),cancelText:i.getText("pisell2.orderList.batchAction.button.cancel"),footer:()=>(0,ev.jsxs)("div",{style:{display:"flex",gap:10,justifyContent:"flex-end",width:"100%"},children:[(0,ev.jsx)(ex.Button,{onClick:()=>u.destroy(),children:i.getText("pisell2.orderList.batchAction.button.cancel")},"cancel"),(0,ev.jsx)(ex.Button,{onClick:()=>o(0),loading:s.markAsCancelled,children:i.getText("pisell2.orderList.batchAction.button.onlyCancel")},"only-cancel"),(0,ev.jsx)(ex.Button,{type:"primary",onClick:()=>o(1),loading:s.markAsCancelled,children:i.getText("pisell2.orderList.batchAction.button.cancelAndVoid")},"cancel-void")]})})},[d,c,s.markAsCancelled]),b=(0,ef.useMemo)(()=>[{key:"ship",label:i.getText("page.order.table.shipping_status.mark.fulfilled"),icon:"pisell2-check-circle-broken",loading:s.ship,onClick:u},{key:"invoice",label:i.getText("page.order.table.list.button.send.invoice"),icon:"pisell2-sticker-square",loading:s.invoice,onClick:p},{key:"print-pack",label:i.getText("page.order.table.list.printpack"),icon:"pisell2-cube-01",onClick:m},{key:"print-picking",label:i.getText("page.order.table.list.printpink"),icon:"pisell2-package",onClick:g},{key:"add-tags",label:i.getText("page.order.text.addtags.button"),icon:"pisell2-tag-01",loading:s.addTags,onClick:h},{key:"remove-tags",label:i.getText("page.order.table.list.deletetag"),icon:"pisell2-tag-01",loading:s.removeTags,onClick:v},{key:"mark-as-open",label:i.getText("page.order.open"),icon:"pisell2-clipboard",loading:s.markAsOpen,onClick:f},{key:"mark-as-completed",label:i.getText("page.order.completeds"),icon:"pisell2-clipboard-check",loading:s.markAsCompleted,onClick:y},{key:"mark-as-cancelled",label:i.getText("page.order.cancelleds"),icon:"pisell2-slash-circle-01",loading:s.markAsCancelled,onClick:x}],[s.ship,s.invoice,s.addTags,s.removeTags,s.markAsOpen,s.markAsCompleted,s.markAsCancelled,s.markAsVoid,u,p,m,g,h,v,f,y,x,i]);return 0===t.length?null:(0,ev.jsx)(lL.PisellBatchActionBar,{selectedKeys:t,selectedRows:l,position:"float",offset:24,overflowThreshold:2,defaultActions:{showDefaultActions:!1},actions:b})},eZm=e=>{var t,l,a,i,n,s,r;let{biz:o,style:d,className:c,__id:u}=e,p=ik();eN.init(eVJ,(null==p||null==(l=p.engine)||null==(t=l.props)?void 0:t.locale)||"en");let m=(0,ef.useMemo)(()=>[{title:eN.getText("pisell2.orderList.column.orderNumber"),dataIndex:"shop_full_order_number",key:"shop_full_order_number",width:100,render:(e,t)=>{let{note:l}=t||{};return(0,ev.jsxs)("div",{className:"order-id-cell",children:[(0,ev.jsx)("span",{className:"order-id-link",children:e}),l&&(0,ev.jsx)(ex.Tooltip,{title:(0,ev.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:l}),children:(0,ev.jsx)("span",{className:"order-id-link-badge cursor-pointer",children:eN.getText("pisell2.orderList.common.note")})})]})}},{title:eN.getText("pisell2.orderList.column.customerInfo"),dataIndex:"customer",key:"customer",width:200,render:(e,t)=>{let{email:l,phone:a}=e||{},i=(null==e?void 0:e.customer_name)||(null==t?void 0:t.customer_name);return(null==e?void 0:e.guest_code)?(0,ev.jsx)("div",{className:"compound-cell",children:(0,ev.jsx)("div",{className:"title",children:eN.getText("pisell2.orderList.common.guest")})}):(0,ev.jsxs)("div",{className:"compound-cell",children:[(0,ev.jsx)("div",{className:"title",children:i||"-"}),(0,ev.jsx)("div",{className:"subtitle",children:a||"-"}),(0,ev.jsx)("div",{className:"subtitle",children:l||"-"})]})}},{title:eN.getText("pisell2.orderList.column.contactInfo"),dataIndex:"contacts_info",key:"contacts_info",width:200,render:(e,t)=>{let{first_name:l,last_name:a,display_name:i,phone:n,email:s}=(null==e?void 0:e.value)||{},{country_calling_code:r,country_code:o,phone:d}=n||{},c=i||`${l||""} ${a||""}`;return(0,ev.jsxs)("div",{className:"compound-cell",children:[(0,ev.jsx)("div",{className:"title",children:`${c||"-"}`}),(0,ev.jsx)("div",{className:"subtitle",children:d||"-"}),(0,ev.jsx)("div",{className:"subtitle",children:s||"-"})]})}},{title:eN.getText("pisell2.orderList.column.tags"),dataIndex:"tag",key:"tag",width:200,render:e=>Array.isArray(e)?(0,ev.jsx)("div",{className:"tags-container",children:e.map((e,t)=>(0,ev.jsx)(lL.PisellTags,{children:e.name},t))}):"-"},{title:eN.getText("pisell2.orderList.column.deliveryMethod"),dataIndex:"delivery_type",key:"delivery_type",width:160,render:(e,t)=>{let{shop_service_type:l}=t.metadata||{},a={"dine-in":eN.getText("pisell2.orderList.shopServiceType.dine-in"),takeaway:eN.getText("pisell2.orderList.shopServiceType.takeaway")},i=eJ3(eN),n=null;return"shop_service"===e&&(n=eZt(null==l?void 0:l.server_type,a)),(n=eZt(e,i))?(0,ev.jsx)(lL.PisellTags,{style:{whiteSpace:"nowrap"},children:n}):"-"}},{title:eN.getText("pisell2.orderList.column.paymentInfo"),dataIndex:"payment_status",key:"payment_status",width:140,render:(e,t)=>{var l;let a=eJ9(eN),i="partially_paid"===e?"unpaid":e,n=Number(t.total_amount||0),s=Number(t.paid_amount||0),r=Number(t.total_refund_amount||(null==t||null==(l=t.summary)?void 0:l.total_refund_amount)||0),o=Number(n-s).toFixed(2),d="";["payment_pending","payment_processing","unpaid"].includes(i)?d=`${eN.getText("pisell2.orderList.common.totalAmount")}: $${n.toFixed(2)}
|
|
110
|
+
`),`Os pedidos que voc\xea selecionou cont\xeam ${e>0?`${e} ${e>1?"pedidos":"pedido"} aberto${e>1?"s":""}, `:""}${t>0?`${t} ${t>1?"pedidos":"pedido"} conclu\xeddo${t>1?"s":""}, `:""}${l>0?`e ${l} ${l>1?"pedidos":"pedido"} cancelado${l>1?"s":""}.`:""}${s}`},"page.order.cancel.title":(e,t)=>`Tem certeza de alterar o ${t>1?"pedidos":"pedido"} para o status ${e}?`,"page.order.void":"Anular pedidos","page.order.completeds":"Completar pedidos","page.order.cancelleds":"Cancelar pedidos"}};function eVZ(e){return"monitor"===e?{filter:{values:{order_payment_status:eVO,booking_time_start_between:[em()().startOf("day"),em()().endOf("day")]}}}:{filter:{values:{payment_status:eVO,orderDate:[em()(),em()()]}},sort:"created_at:desc"}}let eVX="pisell_sales_grid_search_params_",eV0=ey().forwardRef((e,t)=>(0,ev.jsx)(ex.Select,{...e,ref:t,showSearch:!1}));eV0.Option=ex.Select.Option;let eV2={selectComponentClass:eV0,showSizeChanger:!0,pageSizeOptions:["10","20","50","100"]},eV1=e=>{var t,l,a,i,n,s,r,o,d,c,u,p,m;let{perspectives:g,currentPerspective:h,className:v,style:f,extParams:y,__id:x,data:b,loading:_,total:k,pagination:w,onPageChange:j,searchParams:S,onSearch:M,onReset:N,selectedKeys:C,selectedRows:T,onSelectionChange:P,rowKey:A,onRefresh:D,refreshAsync:I,columnRenderers:E,enableScanner:z}=e,L=ik(),O=(null==L||null==(t=L.appHelper)?void 0:t.utils)||{};eN.init(eVJ,(null==L||null==(a=L.engine)||null==(l=a.props)?void 0:l.locale)||"en"),z_.Em.setRequest(null==O?void 0:O.request);let R=void 0!==b,[$,F]=(0,ef.useState)([]),[B,H]=(0,ef.useState)([]),[q,V]=(0,ef.useState)({pageNumber:1,pageSize:20}),[Y,U]=(0,ef.useState)(()=>{let e=eVZ(h);if(x){let t=function(e){try{let t=sessionStorage.getItem(`${eVX}${e}`);if(t){let e=JSON.parse(t,(e,t)=>t&&"object"==typeof t&&t.__isDayjs?em()(t.value):t);if(e&&"object"==typeof e){let{filter:t,...l}=e;return l}return e}}catch(e){console.warn("Failed to get stored search params:",e)}return null}(x);if(t)return{...e,...t}}return e}),[W,G]=(0,ef.useState)(null),Q=(0,ef.useCallback)((e,t)=>{F(e),H(t)},[]),K=(0,ef.useCallback)((e,t)=>{e<1||t<1||V({pageNumber:e,pageSize:t})},[]),J=(0,ef.useCallback)(e=>{U(e||{}),V(e=>({...e,pageNumber:1}))},[]),Z=(0,ef.useCallback)(()=>{U(eVZ(h)),V(e=>({...e,pageNumber:1}))},[h]);(0,ef.useEffect)(()=>{x&&function(e,t){try{var l;let a;{let{filter:e,...l}=t;a=l}sessionStorage.setItem(`${eVX}${e}`,(l=a,JSON.stringify(l,(e,t)=>em().isDayjs(t)?{__isDayjs:!0,value:t.toISOString()}:t)))}catch(e){console.warn("Failed to save search params:",e)}}(x,Y)},[x,Y]),(0,ef.useEffect)(()=>{document.body.id="body"},[]);let X=rP(eVV,{manual:!0}),ee=rP(eVH,{manual:!0}),et=(0,ef.useMemo)(()=>{let{keyword:e,filter:t,sort:l}=Y;return{keyword:e,sort:l,...(null==t?void 0:t.values)||{},skip:q.pageNumber,num:q.pageSize}},[Y,q.pageNumber,q.pageSize]),el=eVx({onRefresh:(0,ef.useCallback)(e=>{D?D(e):"monitor"===h?X.run({...et,...(null==y?void 0:y.list)||{}}):ee.run({...et,...(null==y?void 0:y.list)||{}})},[h,et,X,ee,D]),onClearSelection:(0,ef.useCallback)(()=>{F([]),H([]),null==P||P([],[])},[P])}),ea="phone"===eVb(void 0),ei=(0,ef.useMemo)(()=>R&&w?w:q,[R,w,q]),en=(0,ef.useMemo)(()=>R&&void 0!==S?S:Y,[R,S,Y]),es=(0,ef.useMemo)(()=>{var e,t;return R?b??[]:"monitor"===h?(null==(e=X.data)?void 0:e.list)||[]:(null==(t=ee.data)?void 0:t.list)||[]},[R,b,h,null==(i=X.data)?void 0:i.list,null==(n=ee.data)?void 0:n.list]),er=eV_({enabled:ea,isInternalListData:!0,rowKey:A??"id",data:es,pagination:ei,searchParams:en}),eo=ea?er:es,ed=R?_??!1:"monitor"===h?X.loading:ee.loading,ec=R?k:"monitor"===h?null==(s=X.data)?void 0:s.count:null==(r=ee.data)?void 0:r.count,eu=(0,ef.useMemo)(()=>({actions:el}),[el]);(0,ef.useEffect)(()=>{R||("monitor"===h?X.run({...et,...(null==y?void 0:y.list)||{}}):ee.run({...et,...(null==y?void 0:y.list)||{}}))},[R,h,et,null==y?void 0:y.list,X,ee]);let ep=(0,ef.useMemo)(()=>R&&D?{refresh:D,refreshAsync:I??(()=>Promise.resolve()),currentPerspective:h}:{refresh:"monitor"===h?()=>X.run({...et,...(null==y?void 0:y.list)||{}}):()=>ee.run({...et,...(null==y?void 0:y.list)||{}}),refreshAsync:"monitor"===h?()=>X.runAsync({...et,...(null==y?void 0:y.list)||{}}):()=>ee.runAsync({...et,...(null==y?void 0:y.list)||{}}),currentPerspective:h},[R,D,I,h,X,ee,et,y]),eg=(0,ef.useMemo)(()=>{let e,t=(e=g.find(e=>e.key===h))||(g.length>0?g[0]:void 0);if(t)return"function"==typeof t.getChildComponentProps?{...t,childComponentProps:t.getChildComponentProps(ep)}:t},[g,h,ep]),eh=(0,ef.useMemo)(()=>{var e,t,l,a,i;let n=function(e,t){if(!(null==t?void 0:t.length)||!Array.isArray(e.columns))return e;let l=new Map(t.map(e=>[e.type,e.render]));return{...e,columns:e.columns.map(e=>{let t=null==e?void 0:e.type;if(null!=t&&l.has(t)){let a=l.get(t);return{...e,render:(e,t,l)=>a(e,t,l)}}return e})}}((null==eg||null==(e=eg.childComponentProps)?void 0:e.grid)??{},E),s=null!=n.scroll&&"object"==typeof n.scroll?{...n.scroll}:{},r=R&&void 0!==C?C:$,o=R&&void 0!==T?T:B,d=R&&P?P:Q,c=ea?function(e){let t=e&&"object"==typeof e?{...e}:{},{x:l,...a}=t;return{...a,autoCalc:t.autoCalc??!0}}(s):void 0,u=ea?{size:"small",tableLayout:"fixed",infiniteScroll:!1!==n.infiniteScroll,scroll:c,rowSelection:(t=n.rowSelection)&&"object"==typeof t?{...t,fixed:!1}:t,className:(l="string"==typeof n.className?n.className:void 0,t_()(l,"pisell-sales-grid-mobile-table-grid")),columns:Array.isArray(a=n.columns)?a.map(e=>(function(e){var t,l;let a,i=String(e.key??e.dataIndex??"");if(!i)return e;let n=(t=e.width,null!=eVW[i]?eVW[i]:null!=eVG[i]?eVG[i]:"number"==typeof t&&t>0?Math.max(64,Math.round(.72*t)):void 0);if(null==n)return e;let s=[`pisell-sales-grid-mobile-table-col--${i.replace(/_/g,"-")}`];eVQ.has(i)&&s.push("pisell-sales-grid-mobile-table-col--stack"),eVK.has(i)&&s.push("pisell-sales-grid-mobile-table-col--tag");let r=!eVQ.has(i)&&!eVK.has(i);return l={...e,width:n,ellipsis:r},a=t_()("string"==typeof l.className?l.className:void 0,...s),{...l,className:a,onCell:()=>({className:a})}})(e)):a}:{};return{...i={...n,...u,selectedKeys:r,selectedRows:o,onSelectionChange:d},infiniteScroll:!1!==i.infiniteScroll}},[eg,R,C,T,P,$,B,Q,E,ea]),ey=(0,ef.useMemo)(()=>{var e;let t=null==eg||null==(e=eg.childComponentProps)?void 0:e.toolBar,l=e=>{if(!1===e)return!1;let t="object"==typeof e&&null!==e?e:{},l="function"==typeof t.onScan?t.onScan:void 0,a="function"==typeof t.onScannerData?t.onScannerData:void 0,i="function"==typeof t.inputRender?t.inputRender:void 0,n="boolean"==typeof z?z:t.enableScanner;return{searchDebounce:300,...t,enableScanner:n,onScan:e=>{G({keyword:e,hasRequested:!1}),null==l||l(e)},onScannerData:e=>{let t="string"==typeof(null==e?void 0:e.data)?e.data:"";t&&G({keyword:t,hasRequested:!1}),null==a||a(e)},inputRender:i??(e=>(0,ev.jsx)(qN,{ctx:e,showSearchButton:!1!==t.showConfirmButton}))}};if(!t)return{search:l(void 0)};if(!ea)return{...t,search:l(t.search)};let a="string"==typeof t.className?t.className:void 0,i=t_()(a,"pisell-record-board-toolbar--narrow-stack","pisell-sales-grid-mobile-toolbar");if(!1===t.filter)return{...t,search:l(t.search),toolbarDensity:"compact-narrow",className:i};let n="object"==typeof t.filter&&null!==t.filter?t.filter:{};return{...t,search:l(t.search),toolbarDensity:"compact-narrow",filter:{...n,phoneLayout:!0},className:i}},[eg,ea,z]);(0,ef.useEffect)(()=>{if(!W)return;if(ed){W.hasRequested||G({...W,hasRequested:!0});return}if(!W.hasRequested)return;if((null==en?void 0:en.keyword)!==W.keyword)return void G(null);let e=Array.isArray(eo)?eo:[],t="number"==typeof ec?ec:e.length;if(1!==e.length||1!==t)return void G(null);let l=eh.onRow;if("function"!=typeof l)return void G(null);let a=l(e[0],0);"function"==typeof(null==a?void 0:a.onClick)&&a.onClick({}),G(null)},[W,ed,null==en?void 0:en.keyword,eo,ec,eh]);let ex=(0,ef.useMemo)(()=>{var e;return{...eV2,...null==eg||null==(e=eg.childComponentProps)?void 0:e.pagination}},[null==eg||null==(o=eg.childComponentProps)?void 0:o.pagination]),eb=(0,ef.useMemo)(()=>"monitor"===h?eVL(x)??x:x,[x,h]);return(0,ev.jsx)("div",{className:t_()("pisell-sales-grid",ea&&"pisell-sales-grid--phone",v),style:{height:"100%",minHeight:0,display:"flex",flexDirection:"column",...f},children:(0,ev.jsx)(lL.PisellRecordBoard,{__id:x,columnVisibilityStorageKey:eb,layoutType:"grid",layoutVariant:ea?"phone":"default",rowKey:A??"id",data:eo,loading:ed,total:ec??0,pagination:ei,onPageChange:R&&j?j:K,searchParams:en,onSearch:R&&M?M:J,onReset:R&&N?N:Z,fillHeight:(null==(d=eh.scroll)?void 0:d.autoCalc)??!0,grid:eh,toolBar:ey,paginationConfig:ex,search:null==eg||null==(c=eg.childComponentProps)?void 0:c.search,batchActionBar:{...eu,...null==eg||null==(u=eg.childComponentProps)?void 0:u.batchActionBar},floorMap:null==eg||null==(p=eg.childComponentProps)?void 0:p.floorMap,defaultBodyView:null==eg||null==(m=eg.childComponentProps)?void 0:m.defaultBodyView,children:(0,ev.jsx)(lL.PisellRecordBoard.ShellFrame,{children:(0,ev.jsx)(lL.PisellRecordBoard.GridLayout,{})})},h)})};eV1.displayName="PisellSalesGrid";let eV4=eV1,eV3=(0,ef.forwardRef)(function(e,t){let{autoBootstrap:l,orderId:a}=e,i=euc();return(0,ef.useImperativeHandle)(t,()=>({refresh:async function(){let{forceRemote:e=!0,preloadedSalesDetail:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(null==i?void 0:i.bookingTicket)&&!1!==l&&a&&await i.refreshSalesDetail({forceRemote:e,preloadedSalesDetail:t})}}),[i,l,a]),null}),eV8=(0,ef.forwardRef)(function(e,t){let l,{osProps:a,...i}=e,{osKey:n,orderId:s,autoBootstrap:r,preloadedSalesDetail:o,businessCode:d,bookingConfigParams:c,autoInitBookingContext:u,otherParams:p,rulesHooks:m,restoreOrderAfterPaidCheckout:g,destroyOnUnmount:h,syncDetailOnOrderChange:v}={osKey:(l=e.osProps??{}).osKey??e.osKey,orderId:l.orderId??e.orderId,autoBootstrap:l.autoBootstrap??e.autoBootstrap,preloadedSalesDetail:l.preloadedSalesDetail??e.preloadedSalesDetail,businessCode:l.businessCode??e.businessCode,bookingConfigParams:l.bookingConfigParams??e.bookingConfigParams,autoInitBookingContext:l.autoInitBookingContext??e.autoInitBookingContext,otherParams:l.otherParams??e.otherParams,rulesHooks:l.rulesHooks??e.rulesHooks,restoreOrderAfterPaidCheckout:l.restoreOrderAfterPaidCheckout??e.restoreOrderAfterPaidCheckout??!1,destroyOnUnmount:l.destroyOnUnmount??e.destroyOnUnmount,syncDetailOnOrderChange:l.syncDetailOnOrderChange??e.syncDetailOnOrderChange};return(0,ev.jsx)(ehq,{osKey:n,orderId:s,autoBootstrap:r,preloadedSalesDetail:o,businessCode:d,bookingConfigParams:c,autoInitBookingContext:u,otherParams:p,rulesHooks:m,restoreOrderAfterPaidCheckout:g,destroyOnUnmount:h,syncDetailOnOrderChange:v,children:(0,ev.jsx)(ehU,{children:(0,ev.jsxs)(ebN,{children:[(0,ev.jsx)(eV3,{ref:t,autoBootstrap:r,orderId:s}),(0,ev.jsx)(eNd,{...i})]})})})});eV8.displayName="SaleDetail";let eV6=eV8,eV5="\xa0\xb7\xa0";function eV7(e){let t=e.trim().split(":").map(e=>e.trim());if(t.length>=2){let e=String(t[0]).padStart(2,"0"),l=String(t[1]).padStart(2,"0"),a=null!=t[2]?String(t[2]).padStart(2,"0"):"00";return`${e}:${l}:${a}`}return"00:00:00"}function eV9(e,t,l,a){return{start:em()(`${e}T${eV7(t)}`).valueOf(),end:em()(`${l}T${eV7(a)}`).valueOf()}}function eYe(e){return eV9(e.start_date,e.start_time,e.end_date,e.end_time)}function eYt(e){return Number.isFinite(e)?em()(e).startOf("minute").valueOf():e}function eYl(e){let t=String(e??"").trim();if(!t)return"";let[,l,a]=t.split("-").map(Number);return l&&a?`${l}/${a}`:t}function eYa(e){let t=String(e.start_date??"").trim(),l=String(e.end_date??"").trim();return!!t&&!!l&&t!==l}function eYi(e,t){let l=String(e.end_time??"").trim();if(!l)return t;let a=eYa(e)?`${eYl(e.end_date)} `:"";return`${a}${l} ${t}`.trim()}function eYn(e){let t=String(e.start_time??"").trim(),l=String(e.end_time??"").trim();return t&&l?eYa(e)?`${eYl(e.start_date)} ${t} - ${eYl(e.end_date)} ${l}`:`${t} - ${l}`:t||l||""}function eYs(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),l=e.progressPercent;return null!=l&&Number.isFinite(l)?Math.min(100,Math.max(0,Math.round(l))):function(e,t,l,a){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:Date.now(),{start:n,end:s}=eV9(e,t,l,a);return!Number.isFinite(n)||!Number.isFinite(s)||s<=n||i<=n?0:i>=s?100:Math.round((i-n)/(s-n)*100)}(e.start_date,e.start_time,e.end_date,e.end_time,t)}function eYr(e){if(e<=0)return"0m";let t=Math.floor(e/60),l=e%60;return t>0?l>0?`${t}h ${l}m`:`${t}h`:`${l}m`}function eYo(e){return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),null!=e.lateTime&&Number.isFinite(e.lateTime)&&e.lateTime>0)?"late":"not_arrived"}function eYd(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),{start:l,end:a}=eV9(e.start_date,e.start_time,e.end_date,e.end_time);return!!Number.isFinite(l)&&!!Number.isFinite(a)&&!(a<=l)&&t>=l&&t<a}function eYc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),{start:l}=eV9(e.start_date,e.start_time,e.end_date,e.end_time);return!!Number.isFinite(l)&&t<l}function eYu(e){return[...e].sort((e,t)=>{let{start:l}=eV9(e.start_date,e.start_time,e.end_date,e.end_time),{start:a}=eV9(t.start_date,t.start_time,t.end_date,t.end_time);return l-a})}function eYp(e){let t=e.bookings.filter(e=>!0===e.isNext);return 0===t.length?null:eYu(t)[0]??null}function eYm(e,t){var l;let a=null==e||null==(l=e.name)?void 0:l.trim();if(a)return a;if(t&&(null==e?void 0:e.phone)){let t=eYx(e.phone);if(t)return t}return""}function eYg(e,t){let l=e.contactTiers;if(null==l?void 0:l.length){var a=l.map(e=>eYm({name:e.name,...e.phone?{phone:e.phone}:{}},t).trim()).filter(Boolean);let e=[];for(let t of a)t&&(0===e.length||e[e.length-1]!==t)&&e.push(t);return e}let i=eYm(e.holder,t).trim();return i?[i]:[]}function eYh(e,t){return eYg(e,t).join(eV5)}function eYv(e){return e.bookings.find(e=>!0!==e.isNext)??e.bookings[0]}function eYf(e){return e.length<=1||e.some(e=>"occupied"===e.hostBookingStatus)||!e.every(e=>null==e.hostBookingStatus||"reserved"===e.hostBookingStatus)?e:eYu(e)}function eYy(e){if("locked"===e.status)return"locked";if("empty"===e.status)return"empty";let t=e.bookings.filter(e=>!0!==e.isNext),l=t.filter(e=>"occupied"===e.hostBookingStatus).length;if(t.length>1){if("reserved"===e.status&&0===l)return"multi_reserved";let a=t.filter(e=>null!=e.hostBookingStatus);if(a.length>0){if(l>=2)return"multi_occupied";if(1===l&&"occupied"===e.status){let t=e.sub_status;return"payed"===t||"payment_required"===t||"timeout"===t?t:"payed"}if(a.every(e=>"reserved"===e.hostBookingStatus)){let t=e.sub_status;return"not_arrived"===t||"late"===t?t:"not_arrived"}}if("occupied"===e.status){let t=e.sub_status;return"payed"===t||"payment_required"===t||"timeout"===t?t:"payed"}if("reserved"===e.status){let t=e.sub_status;return"not_arrived"===t||"late"===t?t:"not_arrived"}}if("occupied"===e.status){let t=e.sub_status;return"payed"===t||"payment_required"===t||"timeout"===t?t:"payed"}if("reserved"===e.status){let t=e.sub_status;return"not_arrived"===t||"late"===t?t:"not_arrived"}return"empty"}function eYx(e){return e.length>=4?`***${e.slice(-4)}`:null}function eYb(e,t){var l,a;let i=e.main_field;if("string"==typeof i&&i.trim()){let e=null==(a=i.split(" ## ")[0])?void 0:a.trim();if(e)return e}let n=null==(l=e.code)?void 0:l.trim();if(n)return n;let s=null==t?void 0:t.trim();return s||""}function eY_(e){return null!=e.recordId&&""!==String(e.recordId).trim()?String(e.recordId).trim():e.booking_id}function eYk(e){return null==e||""===String(e).trim()?"unpaid":"paid"===String(e).trim().toLowerCase()?"paid":"unpaid"}let eYw="pisell-reservation.room-time-end";function eYj(e){return"paid"===e?"rc-compact__badge--paid":"rc-compact__badge--unpaid"}function eYS(e){return"paid"===e?"pisell-reservation.room-paid":"pisell-reservation.room-payment-needed"}function eYM(e){let t=String(e??"").trim();if(!t)return"";let l=t.split(":");if(l.length>=2){let e=parseInt(l[0],10),t=l[1].replace(/\D/g,"").slice(0,2),a=t.length>=2?t.padStart(2,"0"):`${t}0`.slice(0,2);if(Number.isFinite(e))return`${e}:${a}`}return t}function eYN(e,t){let l=t.bookingCount;if("number"!=typeof l||!Number.isFinite(l)||l<=0)return e;let a="number"==typeof t.completeBookingCount&&Number.isFinite(t.completeBookingCount)&&t.completeBookingCount>=0?t.completeBookingCount:0;return`${e} (${a}/${l})`}function eYC(e){let t=Number(e.percent),l=Math.min(100,Math.max(0,Number.isFinite(t)?t:0));return(0,ev.jsx)("div",{className:"rc-tooltip-time-bar","aria-hidden":!0,children:(0,ev.jsx)("div",{className:"rc-tooltip-time-bar__track",children:(0,ev.jsx)("div",{className:t_()("rc-tooltip-time-bar__fill",e.isTimeout&&"rc-tooltip-time-bar__fill--warn"),style:{width:`${l}%`}})})})}function eYT(e){let{data:t,booking:l,cardType:a,shellShape:i="rect",hideInnerLinearProgress:n=!1,headerMainFieldOverride:s,scrollSurfaceHandlers:r}=e,o=eYN((null==s?void 0:s.trim())||String(t.main_field??"").trim(),t),d="payed"===a||"payment_required"===a||"timeout"===a,c=d&&eYM(l.end_time)||eYM(l.start_time),u=eYs(l),p=eYk(l.order_payment_status),m=eYj(p),g=eN.getText("paid"===p?"pisell-reservation.room-paid":"pisell-reservation.room-payment-needed"),h=eN.getText(d?"pisell-reservation.room-time-end":"pisell-reservation.room-time-start"),v=`${c||"—"} ${h}`;return(0,ev.jsx)("div",{className:"rc-tooltip-time-root","data-pisell-floor-room-scroll-surface":"",...r,children:(0,ev.jsxs)("div",{className:"rc-tooltip-time-stack",children:[d&&"unpaid"===p?(0,ev.jsx)("span",{className:t_()("rc-tooltip-time-pay-badge","rc-compact__badge",m),"aria-hidden":!0,children:g}):null,d&&!n&&"circle"!==i?(0,ev.jsx)("div",{className:"rc-tooltip-time-progress",children:(0,ev.jsx)(eYC,{percent:u,isTimeout:"timeout"===a})}):null,(0,ev.jsx)("div",{className:"rc-tooltip-time-title-anchor rc-tooltip-time-title-anchor--overflow",children:(0,ev.jsx)(ex.Tooltip,{title:v,placement:"bottom",open:!0,color:"#000000",autoAdjustOverflow:!1,getPopupContainer:e=>e.closest(".pisell-res-floor-room-card__viewport-compensate")??e.closest(".pisell-res-floor-room-card")??document.body,overlayClassName:t_()("rc-tooltip-time-ant-overlay",!d&&"rc-tooltip-time-ant-overlay--reserved"),arrow:!0,children:(0,ev.jsx)("span",{className:"rc-tooltip-time-title rc-tooltip-time-title--overflow",children:o})})})]})})}function eYP(e){let{data:t,headerMainFieldOverride:l,scrollSurfaceHandlers:a}=e,i=eYN((null==l?void 0:l.trim())||String(t.main_field??"").trim(),t);return(0,ev.jsx)("div",{className:"rc-tooltip-time-root","data-pisell-floor-room-scroll-surface":"",...a,children:(0,ev.jsx)("div",{className:"rc-tooltip-time-stack rc-tooltip-time-stack--title-only",children:(0,ev.jsx)("div",{className:"rc-tooltip-time-title-anchor rc-tooltip-time-title-anchor--overflow",children:(0,ev.jsx)("span",{className:"rc-tooltip-time-title rc-tooltip-time-title--overflow",children:i||"—"})})})})}function eYA(e){if(null==e)return null;let t=String(e).trim();if(!t)return null;let l=t.match(/^(\d{1,2}):(\d{2})/);return l?`${l[1].padStart(2,"0")}:${l[2]}`:null}function eYD(e){if(null==e)return null;let t=String(e).trim(),l=t.slice(0,10);if(/^\d{4}-\d{2}-\d{2}$/.test(l))return l;let a=em()(t);return a.isValid()?a.format("YYYY-MM-DD"):null}function eYI(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(String(e).trim());if(Number.isFinite(t)&&!(t<0))return Math.round(t)}function eYE(e){if(null==e||""===e)return null;let t="number"==typeof e?e:Number(String(e).trim());return Number.isFinite(t)?t:null}function eYz(e){let t=function(e){if(!e)return null;let t=eYE(e.customer_id);if(null!=t)return t;let l=e.customer;return l&&"object"==typeof l?eYE(l.id):null}(e);return null!=t&&0!==t&&1!==t}function eYL(e){return null==e||""===e?null:"number"==typeof e&&Number.isFinite(e)||""!==String(e).trim()?e:null}function eYO(e){if(null==e||""===e)return null;if("number"==typeof e&&Number.isFinite(e))return Math.max(0,Math.round(e));let t=Number(String(e).replace(/,/g,"").trim());return Number.isFinite(t)?Math.max(0,Math.round(t)):null}function eYR(e){if(e&&"object"==typeof e){let t,l="string"==typeof e.name?e.name.trim():"";if("string"==typeof e.phone&&/\d/.test(e.phone))t=e.phone;else{let l=e.phone;l&&"string"==typeof l.phone&&/\d/.test(l.phone)&&(t=l.phone)}if(l||t)return{name:l,...t?{phone:t}:{}}}return null}function eY$(e){let t=e.metadata,l=eYR(null==t?void 0:t.holder);if(l)return l;let a=eYR(e.holder);if(a)return a;let i=e.holder_data,n=Array.isArray(i)?i[0]:i;if(n&&"object"==typeof n){if("string"==typeof n.name&&n.name.trim())return{name:n.name.trim()};let e=n.data,t=null==e?void 0:e.customer_name;if("string"==typeof t&&t.trim())return{name:t.trim()}}return null}function eYF(e){let t=function(e){let t="string"==typeof e.customer_name?e.customer_name.trim():"";if(t)return t;let l=e.customer;if(!l||"object"!=typeof l)return"";let a="string"==typeof l.display_name?l.display_name.trim():"";if(a)return a;let i="string"==typeof l.nickname?l.nickname.trim():"";return i?i:["string"==typeof l.first_name?l.first_name.trim():"","string"==typeof l.last_name?l.last_name.trim():""].filter(Boolean).join(" ").trim()}(e),l=function(e){let t="string"==typeof e.phone&&/\d/.test(e.phone)?e.phone:void 0;if(t)return t;let l=e.customer;if(!l||"object"!=typeof l)return;let a=l.phone??l.mobile;return"string"==typeof a&&/\d/.test(a)?a:void 0}(e);return t||l?{name:t,...l?{phone:l}:{}}:null}function eYB(e){let t=e.contacts_info;if(!t||"object"!=typeof t)return null;let l=["string"==typeof t.first_name?t.first_name.trim():"","string"==typeof t.last_name?t.last_name.trim():""].filter(Boolean).join(" "),a=t.phone,i=null==a?void 0:a.phone,n="string"==typeof i&&/\d/.test(i)?i:void 0;return l||n?{name:l,...n?{phone:n}:{}}:null}function eYH(e){let t=e.order,l=[],a=eY$(e);if(a&&(a.name||a.phone)&&l.push({source:"holder",name:a.name,...a.phone?{phone:a.phone}:{}}),t){let e=eYB(t);e&&(e.name||e.phone)&&l.push({source:"contacts_info",name:e.name,...e.phone?{phone:e.phone}:{}})}if(t&&eYz(t)){let e=eYF(t);e&&(e.name||e.phone)&&l.push({source:"customer",name:e.name,...e.phone?{phone:e.phone}:{}})}return l.length?l:void 0}function eYq(e){let t=e.order,l=eY$(e);if(l&&(l.name||l.phone))return{name:l.name,...l.phone?{phone:l.phone}:{}};if(t){let e=eYB(t);if(e&&(e.name||e.phone))return{name:e.name,...e.phone?{phone:e.phone}:{}}}if(t&&eYz(t)){let e=eYF(t);if(e&&(e.name||e.phone))return{name:e.name,...e.phone?{phone:e.phone}:{}}}}function eYV(e,t){let l,a,i=null!=e.booking_id&&""!==String(e.booking_id)?String(e.booking_id):`b_${e.id??t}`,n=e.id,s=null!=n&&""!==String(n).trim()?String(n).trim():void 0,r=e.order,o="string"==typeof(null==r?void 0:r.schedule_date)?r.schedule_date.trim():"",d=eYD(e.start_date)??eYD(e.select_date)??(o?eYD(o):null)??eYD(null==r?void 0:r.create_date),c=o.includes(" ")?eYA(o.split(/\s+/).slice(-1)[0]??""):null,u=eYA(e.start_time)??c??eYA(null==r?void 0:r.start_time),p=eYD(e.end_date)??d??eYD(null==r?void 0:r.create_date),m=eYA(e.end_time)??eYA(null==r?void 0:r.end_time),g=null;if(d&&u){let e=em()(`${d} ${u}`);e.isValid()&&(g=e)}if(!g&&e.start_at){let t=em()(String(e.start_at));t.isValid()&&(g=t)}let h=null;if(p&&m){let e=em()(`${p} ${m}`);e.isValid()&&(h=e)}if(!h&&e.end_at){let t=em()(String(e.end_at));t.isValid()&&(h=t)}if(!h&&g&&"number"==typeof e.duration&&Number.isFinite(e.duration)&&"minutes"===String(e.sub_type)){let t=g.add(e.duration,"minute");t.isValid()&&(h=t)}!h&&g&&(h=g.add(2,"hour"));let v=(null==g?void 0:g.isValid())?g.format("YYYY-MM-DD"):d??"",f=(null==g?void 0:g.isValid())?g.format("HH:mm"):u??"--:--",y=(null==h?void 0:h.isValid())?h.format("YYYY-MM-DD"):p??v,x=(null==h?void 0:h.isValid())?h.format("HH:mm"):m??"--:--",b=e.number,_="number"==typeof b&&Number.isFinite(b)?b:Number(b)||0,k=eYI(e.lateTime),w=eYI(e.timeoutTime),j=eYI(e.remainingReserveTime),S=function(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(String(e).trim());if(Number.isFinite(t))return Math.min(100,Math.max(0,Math.round(t)))}(e.progressPercent),M=null==r?void 0:r.payment_status,N=null!=M&&""!==String(M).trim()?String(M).trim():"",C=N.toLowerCase(),T=""===N?void 0:"paid"===C?"paid":"partially_paid"===C?"unpaid":N,P=function(e,t,l){let a=String(l??"").trim().toLowerCase(),i=null==t?void 0:t.summary,n=()=>{let l=e.amount??e.total??e.grand_total??(null==t?void 0:t.total_amount)??(null==i?void 0:i.total_amount)??0;return"string"==typeof l||"number"==typeof l?l:0};if("paid"===a){let l=(null==i?void 0:i.total_amount)??(null==t?void 0:t.total_amount)??e.amount??e.total??n();return"string"==typeof l||"number"==typeof l?l:n()}if("payment_processing"===a||"unpaid"===a){let e=eYL(null==i?void 0:i.total_amount);if(null!=e)return e;let t=eYL(null==i?void 0:i.amount_gap);return null!=t?t:n()}let s=eYL(null==i?void 0:i.amount_gap);if(null!=s)return s;let r=eYL(null==i?void 0:i.total_amount);return null!=r?r:n()}(e,r,C),A=function(e){let t,l=Array.isArray(t=e.products)?t.filter(e=>e&&"object"==typeof e).length:null;if(null!=l)return l;let a=e.order,i=null==a?void 0:a.summary;return eYO(null==i?void 0:i.product_quantity)??0}(e),D=null!=(a=Array.isArray(l=e.products)?l.reduce((e,t)=>t&&"object"==typeof t?e+Math.max(1,eYO(t.product_quantity)??1):e,0):null)?a:void 0,I=eYq(e),E=eYH(e),z=function(e){let t=eYY(e);if("reserved"===t||"occupied"===t||"locked"===t||"empty"===t)return t}(e),L=e.is_next??e.isNext;return{booking_id:i,...s?{recordId:s}:{},start_date:v||d||"",start_time:f,end_date:y||v||"",end_time:x,number:_,...I?{holder:I}:{},...E?{contactTiers:E}:{},...z?{hostBookingStatus:z}:{},amount:"string"==typeof P||"number"==typeof P?P:0,product_quantity:A,...null!=D?{product_total_quantity:D}:{},...null!=k&&k>0?{lateTime:k}:{},...null!=w&&w>0?{timeoutTime:w}:{},...null!=j&&j>0?{remainingReserveTime:j}:{},...void 0!==S?{progressPercent:S}:{},...void 0!==T?{order_payment_status:T}:{},...!0===L||"true"===L||1===L||"1"===L?{isNext:!0}:{}}}function eYY(e){return String(e.status??"").trim().toLowerCase()}function eYU(e,t){var l,a;let i=null!=e.capacityLabel&&""!==String(e.capacityLabel).trim()?e.capacityLabel:"—",n=t.trim()||e.code||"";if("maintenance"===e.cardStatus)return{main_field:n,capacity:i,status:"locked",sub_status:"",bookings:[]};if("available"===e.cardStatus)return{main_field:n,capacity:i,status:"empty",sub_status:"",bookings:[]};let s=[];s=(null==(l=e.floorMapSourceBookings)?void 0:l.length)?e.floorMapSourceBookings.map((e,t)=>eYV(e,t)):(null==(a=e.slots)?void 0:a.length)?e.slots.map((t,l)=>{let a,i,n,s,r;return a=e.floorMapReferenceDay??em()().format("YYYY-MM-DD"),i=t.time.replace(/ .*/,"").trim()||"12:00",s=(n=em()(`${a} ${i}`)).add(2,"hour"),r=t.name.trim(),{booking_id:`slot_${l}`,start_date:n.format("YYYY-MM-DD"),start_time:n.format("HH:mm"),end_date:s.format("YYYY-MM-DD"),end_time:s.format("HH:mm"),number:e.partySize??0,...r?{holder:{name:r},contactTiers:[{source:"holder",name:r}]}:{},amount:0,product_quantity:0,hostBookingStatus:"reserved"}}):[function(e){var t,l;let a,i=e.floorMapReferenceDay??em()().format("YYYY-MM-DD"),n=(e.time??"12:00").trim().split(/\s+/)[0]??"12:00",s=em()(`${i} ${n}`);if(null==(t=e.timeEnd)?void 0:t.trim()){let t=e.timeEnd.trim().split(/\s+/)[0];(!(a=em()(`${i} ${t}`)).isValid()||a.valueOf()<=s.valueOf())&&(a=s.add(2,"hour"))}else a=s.add(2,"hour");let r=e.guestPhone&&!e.guestPhone.includes("*")?e.guestPhone:void 0,o=(null==(l=e.guestName)?void 0:l.trim())??"",d=o||r?{name:o,...r?{phone:r}:{}}:void 0,c=d?[{source:"holder",name:d.name,...d.phone?{phone:d.phone}:{}}]:void 0,u=e.priceDisplay??0,p=null!=e.startsInMinutes&&Number.isFinite(e.startsInMinutes)&&e.startsInMinutes>0?Math.round(e.startsInMinutes):void 0,m=null!=e.lateMinutes&&Number.isFinite(e.lateMinutes)&&e.lateMinutes>0?Math.round(e.lateMinutes):void 0,g=null!=e.delayMinutes&&Number.isFinite(e.delayMinutes)&&e.delayMinutes>0?Math.round(e.delayMinutes):void 0,h="occupied"===e.cardStatus||"barBusy"===e.cardStatus?"occupied":"booked"===e.cardStatus?"reserved":void 0;return{booking_id:`syn_${e.id}`,start_date:s.format("YYYY-MM-DD"),start_time:s.format("HH:mm"),end_date:a.format("YYYY-MM-DD"),end_time:a.format("HH:mm"),number:e.partySize??0,...d?{holder:d}:{},...c?{contactTiers:c}:{},amount:u,product_quantity:0,...null!=p?{remainingReserveTime:p}:{},...null!=m?{lateTime:m}:{},...null!=g?{timeoutTime:g}:{},...h?{hostBookingStatus:h}:{},...!0===e.isPaid?{order_payment_status:"paid"}:{},...!0===e.isNext?{isNext:!0}:{}}}(e)];let r=e.floorMapSourceBookings,o="occupied"===e.cardStatus||"barBusy"===e.cardStatus,d="booked"===e.cardStatus;if((null==r?void 0:r.length)&&((null==r?void 0:r.some(e=>"occupied"===eYY(e)))?o=!0:(o=!1,(null==r?void 0:r.some(e=>"reserved"===eYY(e)))&&(d=!0))),o){let t="payed";return{main_field:n,capacity:i,status:"occupied",sub_status:t=!0===e.hostIsTimeout||null!=e.delayMinutes&&e.delayMinutes>0?"timeout":!1===e.isPaid?"payment_required":"payed",bookings:s.length>1?function(e){if(e.length<=1||1!==e.filter(e=>"occupied"===e.hostBookingStatus).length)return e;let t=eYu(e),l=t.findIndex(e=>"occupied"===e.hostBookingStatus);return l<0?e:[t[l],...t.slice(l+1),...t.slice(0,l)]}(s):s}}if(d){let t="not_arrived";return"late"===e.hostReservedStatus?t="late":"not_arrived"===e.hostReservedStatus?t="not_arrived":null!=e.lateMinutes&&e.lateMinutes>0&&(t="late"),{main_field:n,capacity:i,status:"reserved",sub_status:t,bookings:s.length>1?eYf(s):s}}return{main_field:n,capacity:i,status:"empty",sub_status:"",bookings:[]}}function eYW(e){let t=e=>null!=e&&""!==String(e).trim()?String(e).trim():"";return t(e.booking_id)||t(e.booking_uid)||t(e.id)||"—"}function eYG(e,t){let l,a,i,n=(null==t?void 0:t.capacityLabel)!=null&&""!==String(t.capacityLabel).trim()?t.capacityLabel:"—",s=(a=e.order??{},(i=e=>null!=e&&""!==String(e).trim()?String(e).trim():"")(e.booking_id)||i(e.id)||i(a.shop_full_order_number)||i(a.order_number)||"—").trim()||(null==t?void 0:t.code)||"",r=eYV(e,0),o="occupied"===String(e.status??"").trim().toLowerCase()?"occupied":"reserved";l="occupied"===o?null!=r.timeoutTime&&r.timeoutTime>0?"timeout":"unpaid"===r.order_payment_status?"payment_required":"payed":null!=r.lateTime&&r.lateTime>0?"late":"not_arrived";let d=e.order??{},c=null!=d.shop_full_order_number&&""!==String(d.shop_full_order_number).trim()?String(d.shop_full_order_number).trim():"",u=d.summary,p=null!=d.currency_symbol&&""!==String(d.currency_symbol).trim()?String(d.currency_symbol).trim():"$",m=(null==u?void 0:u.total_amount)!=null&&""!==String(u.total_amount).trim()?String(u.total_amount).trim():"",g=m?`${eN.getText("pisell-reservation.booking-detail.total")}: ${m.startsWith(p)?m:`${p}${m}`}`:"";return{main_field:s,capacity:n,status:o,sub_status:l,bookings:[{...r,items_summary_suffix:g||r.items_summary_suffix,order_display_number:c||r.order_display_number}]}}function eYQ(e){switch(e){case"comfortable":return 3;case"compact":return 2;case"mini":return 1;default:return 0}}function eYK(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rect";return"micro"===e||"mini"===e&&"circle"===t}let eYJ=(0,ef.createContext)("comfortable");function eYZ(){return(0,ef.useContext)(eYJ)}let eYX=(0,ef.createContext)({discUnifiedLayoutEnabled:!0,tooltipTimeDensityEnabled:!0});function eY0(){return(0,ef.useContext)(eYX)}function eY2(e,t){let l=t.length>0?t.reduce((e,t)=>{let l=Number(t.number);return e+(Number.isFinite(l)?l:0)},0):null,a=eN.getText("pisell-reservation.room-cap-prefix");return null!=l?`${a}: ${l}/${e.capacity}`:`${a}: ${e.capacity}`}let eY1=()=>(0,ev.jsxs)("svg",{className:"rc-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ev.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,ev.jsx)("polyline",{points:"12 6 12 12 16 14"})]}),eY4=()=>(0,ev.jsxs)("svg",{className:"rc-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ev.jsx)("path",{d:"M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"}),(0,ev.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,ev.jsx)("path",{d:"M23 21v-2a4 4 0 0 0-3-3.87"}),(0,ev.jsx)("path",{d:"M16 3.13a4 4 0 0 1 0 7.75"})]}),eY3=()=>(0,ev.jsxs)("svg",{className:"rc-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ev.jsx)("path",{d:"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),(0,ev.jsx)("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),(0,ev.jsx)("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),eY8=()=>(0,ev.jsxs)("svg",{className:"rc-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ev.jsx)("line",{x1:"12",y1:"1",x2:"12",y2:"23"}),(0,ev.jsx)("path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6"})]});function eY6(e){let t=(0,ef.useRef)(null),l=(0,ef.useRef)(null),[a,i]=(0,ef.useState)(0);return(0,ef.useLayoutEffect)(()=>{let e=t.current,a=l.current;if(e&&a){let t=a.scrollWidth-e.clientWidth;i(t>0?t+20:0)}},[e.children]),(0,ev.jsx)("div",{className:"rc-compact__middle",ref:t,children:(0,ev.jsx)("div",{className:t_()("rc-compact__scroll",a>0&&"rc-compact__scroll--animate"),ref:l,style:a>0?{"--scroll-dist":`-${a}px`}:void 0,children:e.children})})}function eY5(e){let{isTimeout:t}=e,l=Math.min(100,Math.max(0,e.percent));return(0,ev.jsx)("div",{className:"rc-progress",children:(0,ev.jsx)("div",{className:"rc-progress__bar",children:(0,ev.jsx)("div",{className:t_()("rc-progress__fill",t&&"rc-progress__fill--warn"),style:{width:`${l}%`}})})})}function eY7(e){let{segments:t,className:l}=e;return t.length?(0,ev.jsx)("span",{className:l,children:t.map((e,t)=>(0,ev.jsxs)("span",{className:"rc-contact-chunk",children:[t>0?eV5:null,e]},t))}):null}function eY9(e){let t="paid"===e.variant?"rc-stamp--paid":"rc-stamp--unpaid";return(0,ev.jsx)("div",{className:t_()("rc-stamp",t),children:(0,ev.jsx)("span",{children:e.label})})}function eUe(e){let{nextLabel:t,guestSegments:l,guestLine:a,timeRange:i}=e,n=l&&l.length>0||null!=a&&""!==String(a).trim();return(0,ev.jsxs)("div",{className:"rc-next",children:[(0,ev.jsx)("span",{className:"rc-next__label",children:t}),n?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{className:"rc-next__sep",children:"\xb7"}),l&&l.length>0?(0,ev.jsx)("span",{className:"rc-next__guest-chunks",children:l.map((e,t)=>(0,ev.jsxs)("span",{className:"rc-contact-chunk",children:[t>0?eV5:null,e]},t))}):(0,ev.jsx)("span",{children:a})]}):null,(0,ev.jsx)("span",{className:"rc-next__sep",children:"\xb7"}),(0,ev.jsx)("span",{children:i})]})}function eUt(e){let{model:t,scrollSurfaceHandlers:l,nextBookingPrefix:a,bodyStatusTag:i,pinProgressToBottom:n=!0}=e,{checkoutDomKey:s,contactName:r,contactPhoneMasked:o,showContactPhone:d,guestContactSegments:c,timeLabel:u,partySize:p,countdown:m,reservedLateOverrun:g,occupiedTimeoutOverrun:h,orderNumberDisplay:v,paymentAmountClass:f,paymentBadgeClass:y,paymentBadgeText:x,paymentStampText:b,paymentStampVariant:_,amountDisplay:k,amountPrefixLabel:w,showLargeAmountRow:j,showProgress:S,showPaymentStamp:M,showAmountInlineBadge:N,showCompactCommerceRow:C,itemsCountLabel:T,itemsCountInsideScroll:P,showEdgeProgressRing:A,showEdgeProgressRectBorder:D,progressPercent:I,progressIsTimeout:E,nextGuestLine:z,nextGuestContactSegments:L,nextTimeRange:O}=t,R=c.length>0||r||d&&o,$=null!=O;return c.length,!c.length&&R&&ev.Fragment,c.length,!c.length&&R&&ev.Fragment,"compact"===t.layout?(0,ev.jsxs)("div",{className:"rc-compact","data-pisell-floor-checkout-booking":s,children:[(0,ev.jsxs)("div",{className:t_()("rc-compact__row",!1),children:[(0,ev.jsx)("div",{className:"rc-compact__left",children:c.length?(0,ev.jsx)(eY7,{segments:c,className:"rc-compact__name rc-compact__name--chunks"}):null}),(0,ev.jsxs)(eY6,{children:[null,(0,ev.jsxs)("span",{children:[(0,ev.jsx)(eY1,{}),u]}),(0,ev.jsx)("span",{className:"rc-sep",children:"\xb7"}),(0,ev.jsxs)("span",{children:[(0,ev.jsx)(eY4,{}),p]}),m?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{className:"rc-sep",children:"\xb7"}),(0,ev.jsxs)("span",{className:"rc-highlight--info",children:[(0,ev.jsx)(eY1,{}),m]})]}):null,g?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{className:"rc-sep",children:"\xb7"}),(0,ev.jsxs)("span",{className:"rc-highlight--danger",children:[(0,ev.jsx)(eY3,{}),g]})]}):null,h?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{className:"rc-sep",children:"\xb7"}),(0,ev.jsxs)("span",{className:"rc-highlight--overtime",children:[(0,ev.jsx)(eY3,{}),h]})]}):null,P?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{className:"rc-sep",children:"\xb7"}),(0,ev.jsx)("span",{className:t_()("rc-compact__items-count","rc-compact__items-count--in-scroll"),children:T})]}):null]}),C?(0,ev.jsx)("div",{className:"rc-compact__right",children:(0,ev.jsxs)("div",{className:"rc-compact__right-stack",children:[(0,ev.jsxs)("div",{className:"rc-compact__pay-row",children:[(0,ev.jsxs)("span",{className:t_()("rc-compact__amount","rc-amount__main",f),children:[(0,ev.jsx)(eY8,{}),k]}),(0,ev.jsx)("span",{className:t_()("rc-compact__badge",y),children:x})]}),P?null:(0,ev.jsx)("div",{className:"rc-compact__items-count",children:T})]})}):null]}),n?(0,ev.jsx)("div",{className:"rc-body__progress-grow",children:!S||A||D?null:(0,ev.jsx)(eY5,{percent:I,isTimeout:E})}):!S||A||D?null:(0,ev.jsx)(eY5,{percent:I,isTimeout:E})]}):(0,ev.jsxs)("div",{className:"rc-body","data-pisell-floor-checkout-booking":s,"data-pisell-floor-room-scroll-surface":"",...l,children:[v?(0,ev.jsxs)("div",{className:"rc-order-line",children:[(0,ev.jsx)("span",{className:"rc-order-line__number",children:v}),i?(0,ev.jsx)("span",{className:t_()("rc-tag","rc-order-line__status",`rc-tag--appointment-${i.tone}`),children:i.label}):null]}):null,R&&1?(0,ev.jsx)("div",{className:"rc-contact",children:c.length?(0,ev.jsx)(eY7,{segments:c,className:"rc-contact__name rc-contact__chunks"}):(0,ev.jsxs)(ev.Fragment,{children:[r?(0,ev.jsx)("span",{className:"rc-contact__name",children:r}):null,d&&o?(0,ev.jsx)("span",{className:"rc-contact__phone",children:o}):null]})}):null,(0,ev.jsxs)("div",{className:t_()("rc-time-row",!1),children:[null,(0,ev.jsxs)("span",{children:[(0,ev.jsx)(eY1,{}),u]}),(0,ev.jsx)("span",{className:"rc-sep",children:"\xb7"}),(0,ev.jsxs)("span",{children:[(0,ev.jsx)(eY4,{}),p]}),m?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{className:"rc-sep",children:"\xb7"}),(0,ev.jsxs)("span",{className:"rc-highlight--info",children:[(0,ev.jsx)(eY1,{}),m]})]}):null,g?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{className:"rc-sep",children:"\xb7"}),(0,ev.jsxs)("span",{className:"rc-highlight--danger",children:[(0,ev.jsx)(eY3,{}),g]})]}):null,h?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{className:"rc-sep",children:"\xb7"}),(0,ev.jsxs)("span",{className:"rc-highlight--overtime",children:[(0,ev.jsx)(eY3,{}),h]})]}):null]}),j?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsxs)("div",{className:t_()("rc-amount",N&&"rc-amount--with-badge",f),children:[(0,ev.jsxs)("span",{className:"rc-amount__main",children:[w?(0,ev.jsx)("span",{className:"rc-amount__prefix",children:w}):null,(0,ev.jsx)(eY8,{}),k]}),N?(0,ev.jsx)("span",{className:t_()("rc-compact__badge",y),children:x}):null]}),(0,ev.jsx)("div",{className:"rc-items-count",children:T})]}):null,M?(0,ev.jsx)(eY9,{variant:_,label:b}):null,n?(0,ev.jsx)("div",{className:"rc-body__progress-grow",children:!S||A||D?null:(0,ev.jsx)(eY5,{percent:I,isTimeout:E})}):!S||A||D?null:(0,ev.jsx)(eY5,{percent:I,isTimeout:E}),$?(0,ev.jsx)(eUe,{nextLabel:a,guestSegments:L,guestLine:z,timeRange:O}):null]})}function eUl(e){let{roomTitle:t,capacityLine:l,status:a,statusLabel:i,showStatusTag:n=!0,paymentUnpaidFill:s=!1,bookingCount:r,completeBookingCount:o}=e,d=null!=l&&""!==String(l).trim(),c="number"==typeof r&&Number.isFinite(r)&&r>0,u="number"==typeof o&&Number.isFinite(o)&&o>=0?o:0;return(0,ev.jsxs)("div",{className:t_()("rc-header",s&&"rc-header--payment-unpaid-fill"),children:[(0,ev.jsxs)("div",{className:"rc-header__left",children:[(0,ev.jsxs)("span",{className:"rc-room-name-line",children:[(0,ev.jsx)("span",{className:"rc-room-name",children:t}),c?(0,ev.jsxs)("span",{className:"rc-room-name-count",children:["(",u,"/",r,")"]}):null]}),d?(0,ev.jsx)("span",{className:"rc-capacity",children:l}):null]}),n?(0,ev.jsx)("span",{className:t_()("rc-tag",`rc-tag--${a}`),children:i}):null]})}function eUa(e){let{className:t,checkoutBookingKey:l,header:a,children:i,ribbonSlot:n,cornerSlot:s,shellShape:r="rect",tooltipTimeStandaloneMain:o=!1}=e,d=eYZ(),{discUnifiedLayoutEnabled:c}=eY0(),u="circle"===r&&c||eYK(d,r)?(0,ev.jsxs)("div",{className:o?"rc-tooltip-time-main":"rc-unified",children:[null!=a?a:null,i]}):(0,ev.jsxs)(ev.Fragment,{children:[null!=a?a:null,i]});return(0,ev.jsxs)("div",{className:t_()(t,"rc-shell"),"data-pisell-floor-checkout-booking":l,children:[n,s,u]})}let eUi="pisell-reservation.room-view-all",eUn="pisell-reservation.room-next-prefix";function eUs(e,t){return eN.getText(e).replace(/\{n\}/g,String(t))}let eUr={onTouchStart:e=>e.stopPropagation(),onTouchMove:e=>e.stopPropagation(),onTouchEnd:e=>e.stopPropagation(),onWheel:e=>e.stopPropagation()};function eUo(e,t){var l,a;null==t||t.stopPropagation(),null==t||null==(a=t.nativeEvent)||null==(l=a.stopImmediatePropagation)||l.call(a),window.setTimeout(()=>e(!1),50)}let eUd={onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()},eUc="pisell-res-floor-view-all-modal-wrap";function eUu(e,t,l,a){if(t<1||"micro"===a)return 0;if("circle"!==e)return Math.min(3,t);let i=null!=l&&Number.isFinite(l)&&l>0?l:null;if(null==i||i<48)return t>3?1:Math.min(3,t);let n=Math.round(Math.max(7,Math.min(18,.065*i))),s=Math.max(0,i-2*n),r=Math.min(115,Math.max(54,.35*s)),o=Math.max(0,s-r-10),d=Math.round(Math.max(42,Math.min(64,.15*s))),c=Math.min(3,t);if(o<46&&t>c)return 0;let u=0;for(let e=c;e>=0;e--){let l=t>e;if(e*d+(l?46+6*(e>0):0)<=o){u=e;break}}return u}function eUp(e,t){return(null==t?void 0:t.trim())||e.main_field}function eUm(e){let{data:t,occupancyBookings:l,hideCapacity:a=!1,headerMainFieldOverride:i,paymentUnpaidFill:n=!1}=e,s=void 0!==l?l:t.bookings,r=a?null:eY2(t,s);return(0,ev.jsx)(eUl,{roomTitle:eUp(t,i),capacityLine:r,status:t.status,statusLabel:function(e){switch(e){case"empty":return eN.getText("pisell-reservation.room-status-empty");case"reserved":return eN.getText("pisell-reservation.room-status-reserved");case"occupied":return eN.getText("pisell-reservation.room-status-occupied");case"locked":return eN.getText("pisell-reservation.room-status-locked");default:return""}}(t.status),paymentUnpaidFill:n,bookingCount:t.bookingCount,completeBookingCount:t.completeBookingCount})}function eUg(e,t,l){let a=eY2(e,t),i=eUs("pisell-reservation.room-modal-bookings",t.length),n=eYN(eUp(e,l),e);return(0,ev.jsxs)("div",{className:"rc-view-all-modal-title",children:[n," \xb7 ",i," \xb7 ",a]})}function eUh(e){let{cardType:t,booking:l,data:a,compact:i=!1,shellShape:n="rect",bodyStatusTag:s}=e,r=function(e){var t,l,a;let i,{cardType:n,booking:s,data:r,compact:o}=e,d=e.shellShape??"rect",c=e.nowMs??Date.now(),u="not_arrived"===n||"late"===n,p="payed"===n||"payment_required"===n||"timeout"===n,m=eN.getText("pisell-reservation.room-time-start"),g=eN.getText(eYw),h=function(e,t){let l=String(e.start_time??"").trim();if(!l)return t;let a=eYa(e)?`${eYl(e.start_date)} `:"";return`${a}${l} ${t}`.trim()}(s,m),v=eYi(s,g),f=String(s.end_time??"").trim().length>0,y=u?!o&&f?`${h} \xb7 ${v}`:h:eYi(s,eN.getText(eYw)),x=o&&u?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),l=e.remainingReserveTime;if(null!=l&&Number.isFinite(l)){let e=Math.max(0,Math.round(l));if(e>0)return e}let{start:a}=eV9(e.start_date,e.start_time,e.end_date,e.end_time);if(!Number.isFinite(a))return null;let i=Math.floor((a-t)/6e4);return i<0?null:i}(s):function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),l=e.bookings[0];if(!l||"reserved"!==e.status)return null;let a=l.remainingReserveTime;if(null!=a&&Number.isFinite(a)){let e=Math.max(0,Math.round(a));if(e>0)return e}return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),l=e.bookings[0];if(!l||"reserved"!==e.status)return null;let{start:a}=eV9(l.start_date,l.start_time,l.end_date,l.end_time);if(!Number.isFinite(a))return null;let i=Math.floor((a-t)/6e4);return i<0?null:i}(e,t)}(r),b="not_arrived"===n&&null!=x&&x>0?(i=eYr(Math.round(x)),eN.getText("pisell-reservation.room-in-minutes").replace(/\{d\}/g,i)):null,_=null!=s.lateTime&&Number.isFinite(s.lateTime)&&s.lateTime>0?eYr(s.lateTime):null,k="late"===n&&_?`${eN.getText("pisell-reservation.late")} +${_}`:null,w=null!=s.timeoutTime&&Number.isFinite(s.timeoutTime)&&s.timeoutTime>0?eYr(s.timeoutTime):null,j="timeout"===n&&w?`+${w}`:null,S=eYk(s.order_payment_status),M=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now();return eYp(e)??function(e){let t=e.bookings;if(t.length<2||1!==t.filter(e=>"occupied"===e.hostBookingStatus).length)return null;let l=eYu(t),a=l.findIndex(e=>"occupied"===e.hostBookingStatus);return a<0||a>=l.length-1?null:l[a+1]}(e)??("reserved"!==e.status||e.bookings.length<2||e.bookings.some(e=>"occupied"===e.hostBookingStatus)?null:e.bookings[1]??null)??function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Date.now(),l=e.bookings;if(l.length<2||!eYd(l[0],t))return null;for(let e=1;e<l.length;e++)if(eYc(l[e],t))return l[e];return null}(e,t)}(r,c),N=s.holder,C=eYg(s,u),T=C.length>0,P=(null==N||null==(t=N.name)?void 0:t.trim())??"",A=!T&&u&&(null==N?void 0:N.phone)?eYx(N.phone):null,D=C.join(eV5),I=null,E=[],z=null;M&&(I=(E=eYg(M,!0)).length?E.join(eV5):null,z=eYn(M));let L=eYs(s),O=(null==(l=s.order_display_number)?void 0:l.trim())||null,R=p&&"paid"!==S?eN.getText("pisell-reservation.booking-detail.strip-due-label"):null,$=s.product_quantity??0,F=s.product_total_quantity,B=null!=F&&F>0&&$>0?eN.getText("pisell-reservation.room-items-summary").replace(/\{items\}/g,String($)).replace(/\{qty\}/g,String(F)):eN.getText("pisell-reservation.room-items-total").replace(/\{n\}/g,String($)),H=null==(a=s.items_summary_suffix)?void 0:a.trim(),q=H?`${B} \xb7 ${H}`:B,V=!o&&(p||u)&&!0,Y="circle"===d&&p&&!o,U=o&&p&&!0;return{layout:o?"compact":"full",checkoutDomKey:eY_(s),cardType:n,contactName:P,contactPhoneMasked:A,showContactPhone:u,guestContactSegments:C,guestNameCompact:D,timeLabel:y,partySize:s.number,amountDisplay:s.amount,orderNumberDisplay:O,amountPrefixLabel:R,countdown:b,reservedLateOverrun:k,occupiedTimeoutOverrun:j,paymentAmountClass:"paid"===S?"rc-highlight--paid":"rc-highlight--unpaid",paymentBadgeClass:eYj(S),paymentBadgeText:eN.getText(eYS(S)),paymentStampText:eN.getText(eYS(S)),paymentIsPaid:"paid"===S,paymentStampVariant:S,showLargeAmountRow:V,showProgress:p,showPaymentStamp:!o&&p&&("rect"===d||!Y),showInlinePaymentBadge:Y,showAmountInlineBadge:!o&&p&&Y,showCompactCommerceRow:U,itemsCountLabel:q,itemsCountInsideScroll:U,showEdgeProgressRing:"circle"===d&&!o&&p,showEdgeProgressRectBorder:"rect"===d&&!o&&p&&!1,progressPercent:L,progressIsTimeout:"timeout"===n,nextGuestLine:I,nextGuestContactSegments:E,nextTimeRange:z}}({cardType:t,booking:l,data:a,compact:i,shellShape:n,nowMs:Date.now(),floorDensity:"comfortable"});return(0,ev.jsx)(eUt,{model:r,scrollSurfaceHandlers:eUr,nextBookingPrefix:eN.getText(eUn),bodyStatusTag:s,pinProgressToBottom:"circle"!==n})}let eUv={not_arrived:"rc rc--reserved",late:"rc rc--reserved",payed:"rc rc--occupied",payment_required:"rc rc--occupied rc--occupied-pay",timeout:"rc rc--occupied rc--occupied-timeout"};function eUf(e){let{data:t,cardType:l,hideHeader:a=!1,hideHeaderCapacity:i=!1,headerMainFieldOverride:n,shellShape:s="rect",bodyStatusTag:r}=e,o=eYZ(),{discUnifiedLayoutEnabled:d,tooltipTimeDensityEnabled:c}=eY0(),u=eYv(t);if(!u)return(0,ev.jsx)(eUy,{data:t,shellShape:s,hideHeaderCapacity:i,headerMainFieldOverride:n});let p="payed"===l||"payment_required"===l||"timeout"===l,m=eYk(u.order_payment_status),g=p&&"unpaid"===m&&"circle"===s&&d;if(c&&eYK(o,s)){var h;let e="rect"===s&&p&&((null==(h=t.bookings)?void 0:h.length)??0)===1;return(0,ev.jsx)(eUa,{className:t_()(eUv[l],"rc--tooltip-time"),shellShape:s,checkoutBookingKey:eY_(u),tooltipTimeStandaloneMain:!0,children:(0,ev.jsx)(eYT,{data:t,booking:u,cardType:l,shellShape:s,hideInnerLinearProgress:e,headerMainFieldOverride:n,scrollSurfaceHandlers:eUr})})}return(0,ev.jsx)(eUa,{className:eUv[l],shellShape:s,checkoutBookingKey:eY_(u),header:a?void 0:(0,ev.jsx)(eUm,{data:t,hideCapacity:i,headerMainFieldOverride:n,paymentUnpaidFill:g}),children:(0,ev.jsx)(eUh,{cardType:l,booking:u,data:t,shellShape:s,bodyStatusTag:r})})}function eUy(e){let{data:t,hideHeader:l,hideHeaderCapacity:a,headerMainFieldOverride:i,shellShape:n="rect"}=e,s=eYZ(),{tooltipTimeDensityEnabled:r}=eY0();return r&&eYK(s,n)?(0,ev.jsx)(eUa,{className:"rc rc--empty rc--tooltip-time",shellShape:n,tooltipTimeStandaloneMain:!0,children:(0,ev.jsx)(eYP,{data:t,headerMainFieldOverride:i,scrollSurfaceHandlers:eUr})}):(0,ev.jsx)(eUa,{className:"rc rc--empty",shellShape:n,header:l?void 0:(0,ev.jsx)(eUm,{data:t,hideCapacity:a,headerMainFieldOverride:i})})}let eUx={empty:eUy,multi_occupied:function(e){let{data:t,shellShape:l="rect",elementLayoutHeightPx:a,hideHeader:i=!1,hideHeaderCapacity:n,headerMainFieldOverride:s}=e,r=eYZ(),[o,d]=(0,ef.useState)(!1),c=t.bookings.filter(e=>!0!==e.isNext),u=c.length>0?c:t.bookings,p=eYp(t),m=u.length,g=eUu(l,m,a,r),h=u.slice(0,g),v=m>h.length,f="payed"===t.sub_status?"paid":"unpaid",{discUnifiedLayoutEnabled:y}=eY0(),x="unpaid"===f&&(eYK(r,l)||"circle"===l&&y),b=(0,ev.jsx)(lL.PisellModal,{open:o,onCancel:e=>eUo(d,e),maskProps:eUd,focusTriggerAfterClose:!1,wrapClassName:eUc,title:eUg(t,t.bookings,s),footer:null,destroyOnClose:!0,width:560,children:(0,ev.jsx)(eYJ.Provider,{value:"comfortable",children:(0,ev.jsx)("div",{className:t_()("pisell-res-floor-room-card","pisell-res-floor-room-card--modal-shell"),children:(0,ev.jsx)("div",{className:"rc--occupied rc--multi",children:(0,ev.jsx)("div",{className:"rc-multi-modal-body",...eUr,children:t.bookings.map((e,l)=>{let a=eYs(e)>=100?"timeout":"payed"===t.sub_status?"payed":"payment_required";return(0,ev.jsx)(eUh,{cardType:a,booking:e,data:t,compact:!0,shellShape:"rect"},`${eY_(e)}-${l}`)})})})})})});if("micro"===r){let e=eUp(t,s);return(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)(eUa,{className:t_()("rc rc--occupied rc--multi",o&&"rc--floor-detail-open"),shellShape:l,header:i?void 0:(0,ev.jsx)(eUm,{data:t,occupancyBookings:t.bookings,hideCapacity:n,headerMainFieldOverride:s,paymentUnpaidFill:x}),children:(0,ev.jsxs)("div",{className:"rc-multi-micro-summary","data-pisell-floor-room-scroll-surface":"",...eUr,children:[(0,ev.jsxs)("span",{className:"rc-multi-micro-summary__text",children:[e," \xb7 ","\xd7",t.bookings.length]}),(0,ev.jsx)("button",{type:"button",className:"rc-multi-more",onClick:e=>{e.stopPropagation(),d(!0)},children:eUs(eUi,t.bookings.length)})]})}),b]})}return(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)(eUa,{className:t_()("rc rc--occupied rc--multi",o&&"rc--floor-detail-open"),shellShape:l,header:i?void 0:(0,ev.jsx)(eUm,{data:t,occupancyBookings:t.bookings,hideCapacity:n,headerMainFieldOverride:s,paymentUnpaidFill:x}),children:(0,ev.jsxs)("div",{className:"rc-multi-list","data-pisell-floor-room-scroll-surface":"",...eUr,children:[h.map(e=>{let a=eYs(e)>=100?"timeout":"payed"===t.sub_status?"payed":"payment_required";return(0,ev.jsx)(eUh,{cardType:a,booking:e,data:t,compact:!0,shellShape:l},eY_(e))}),p&&"micro"!==r&&!v?(0,ev.jsx)(eUe,{nextLabel:eN.getText(eUn),guestSegments:"micro"!==r?eYg(p,!0):[],timeRange:eYn(p)}):null,v?(0,ev.jsx)("button",{type:"button",className:"rc-multi-more",onClick:e=>{e.stopPropagation(),d(!0)},children:eUs(eUi,t.bookings.length)}):null]})}),b]})},multi_reserved:function(e){let{data:t,shellShape:l="rect",elementLayoutHeightPx:a,hideHeader:i=!1,hideHeaderCapacity:n,headerMainFieldOverride:s}=e,r=eYZ(),[o,d]=(0,ef.useState)(!1),c=eYf([...t.bookings]),u=c.filter(e=>!0!==e.isNext),p=u.length>0?u:c,m=eYp(t),g=p.length,h=eUu(l,g,a,r),v=p.slice(0,h),f=g>v.length,y=Date.now(),x=(0,ev.jsx)(lL.PisellModal,{open:o,onCancel:e=>eUo(d,e),maskProps:eUd,focusTriggerAfterClose:!1,wrapClassName:eUc,title:eUg(t,c,s),footer:null,destroyOnClose:!0,width:560,children:(0,ev.jsx)(eYJ.Provider,{value:"comfortable",children:(0,ev.jsx)("div",{className:t_()("pisell-res-floor-room-card","pisell-res-floor-room-card--modal-shell"),children:(0,ev.jsx)("div",{className:"rc--reserved rc--multi",children:(0,ev.jsx)("div",{className:"rc-multi-modal-body",...eUr,children:c.map((e,l)=>(0,ev.jsx)(eUh,{cardType:eYo(e,Date.now()),booking:e,data:t,compact:!0,shellShape:"rect"},`${eY_(e)}-${l}`))})})})})});if("micro"===r){let e=eUp(t,s);return(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)(eUa,{className:t_()("rc rc--reserved rc--multi",o&&"rc--floor-detail-open"),shellShape:l,header:i?void 0:(0,ev.jsx)(eUm,{data:t,occupancyBookings:c,hideCapacity:n,headerMainFieldOverride:s}),children:(0,ev.jsxs)("div",{className:"rc-multi-micro-summary","data-pisell-floor-room-scroll-surface":"",...eUr,children:[(0,ev.jsxs)("span",{className:"rc-multi-micro-summary__text",children:[e," \xb7 ","\xd7",c.length]}),(0,ev.jsx)("button",{type:"button",className:"rc-multi-more",onClick:e=>{e.stopPropagation(),d(!0)},children:eUs(eUi,c.length)})]})}),x]})}return(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)(eUa,{className:t_()("rc rc--reserved rc--multi",o&&"rc--floor-detail-open"),shellShape:l,header:i?void 0:(0,ev.jsx)(eUm,{data:t,occupancyBookings:c,hideCapacity:n,headerMainFieldOverride:s}),children:(0,ev.jsxs)("div",{className:"rc-multi-list","data-pisell-floor-room-scroll-surface":"",...eUr,children:[v.map(e=>{let a=eYo(e,y);return(0,ev.jsx)(eUh,{cardType:a,booking:e,data:t,compact:!0,shellShape:l},eY_(e))}),m&&"micro"!==r&&!f?(0,ev.jsx)(eUe,{nextLabel:eN.getText(eUn),guestSegments:"micro"!==r?eYg(m,!0):[],timeRange:eYn(m)}):null,f?(0,ev.jsx)("button",{type:"button",className:"rc-multi-more",onClick:e=>{e.stopPropagation(),d(!0)},children:eUs(eUi,c.length)}):null]})}),x]})},locked:function(e){let{data:t,hideHeader:l=!1,hideHeaderCapacity:a,headerMainFieldOverride:i,shellShape:n="rect"}=e,s=a?null:eY2(t,[]);return(0,ev.jsx)(eUa,{className:"rc rc--locked",shellShape:n,header:l?void 0:(0,ev.jsx)(eUl,{roomTitle:eUp(t,i),capacityLine:s,status:"locked",statusLabel:"",showStatusTag:!1}),children:(0,ev.jsxs)("div",{className:"rc-body rc-body--center","data-pisell-floor-room-scroll-surface":"",...eUr,children:[(0,ev.jsx)("div",{className:"rc-lock-icon",children:(0,ev.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,ev.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),(0,ev.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})}),(0,ev.jsx)("span",{className:"rc-locked-text",children:eN.getText("pisell-reservation.room-status-locked")})]})})}};function eUb(e){let{data:t,shellShape:l="rect",elementLayoutHeightPx:a,hideHeader:i=!1,hideHeaderCapacity:n=!1,headerMainFieldOverride:s,bodyStatusTag:r}=e,o=eYy(t),d=eUx[o];return d?(0,ev.jsx)(d,{data:t,shellShape:l,elementLayoutHeightPx:a,hideHeader:i,hideHeaderCapacity:n,headerMainFieldOverride:s,bodyStatusTag:r}):o in eUv?(0,ev.jsx)(eUf,{data:t,cardType:o,hideHeader:i,hideHeaderCapacity:n,headerMainFieldOverride:s,shellShape:l,bodyStatusTag:r}):(0,ev.jsx)(eUy,{data:t,shellShape:l,elementLayoutHeightPx:a,hideHeader:i,hideHeaderCapacity:n,headerMainFieldOverride:s,bodyStatusTag:r})}function eU_(e){let{discUnifiedLayoutEnabled:t=!0,tooltipTimeDensityEnabled:l=!0,...a}=e;return(0,ev.jsx)(eYX.Provider,{value:{discUnifiedLayoutEnabled:t,tooltipTimeDensityEnabled:l},children:(0,ev.jsx)(eUb,{...a})})}function eUk(e){return null==e?"":String(e).trim()}function eUw(e){if(null==e)return"";if("string"==typeof e)return e.trim();if("object"!=typeof e)return"";for(let t of["auto","zh-CN","zh-HK","en","ja","pt","original","kitchen"]){let l=e[t];if(null!=l&&eUk(l))return eUk(l)}for(let t of Object.values(e)){if(null!=t&&"string"==typeof t&&eUk(t))return eUk(t);if(null!=t&&"object"==typeof t&&null!==t&&!Array.isArray(t)){let e=eUw(t);if(e)return e}}return""}function eUj(e){if(null==e||""===e)return 0;if("number"==typeof e&&Number.isFinite(e))return e;let t=Number(String(e).replace(/,/g,"").trim());return Number.isFinite(t)?t:0}function eUS(e){let t=e.option_group_item_id??e.id,l="number"==typeof t&&Number.isFinite(t)?t:Number(String(t??0).replace(/\D/g,""))||0,a=eUw(e.name),i=eUw(e.group_name),n=i&&a?`${i}:${a}`:a||i||"—",s=Math.max(1,Math.round(eUj(e.num)||1)),r=eUj(e.add_price);return{id:l,name:n,num:s,price:r,total:r*s}}let eUM=new Set(["refunded","partially_refunded"]);function eUN(e){let t=e.order,l=null==t?void 0:t.payment_status,a=e.payment_status;return String((null!=l&&""!==String(l).trim()?l:a)??"").trim().toLowerCase()}function eUC(e){return"paid"===eUN(e)}let eUT="pisell-res-booking-detail-modal",eUP="pisell-reservation.booking-detail",eUA={onMouseDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation()},eUD={background:"var(--color-primary, var(--ant-color-primary, #5d3f9f))",borderColor:"var(--color-primary, var(--ant-color-primary, #5d3f9f))"},eUI={bookings:[],completedBookings:[],unpaidBookings:[]},eUE=[{key:"current-occupied",labelKey:"tab-current-occupied"},{key:"ended",labelKey:"tab-ended"},{key:"unpaid",labelKey:"tab-unpaid"}];function eUz(e){return eN.getText(`${eUP}.${e}`)}function eUL(e){e.preventDefault(),e.stopPropagation()}let eUO=[{key:"action-edit",icon:(0,ev.jsx)(hC,{})},{key:"action-cart",icon:(0,ev.jsx)(lL.Iconfont,{type:"pisell2-coins-hand"})},{key:"action-print",icon:(0,ev.jsx)(SM,{})},{key:"action-list",icon:(0,ev.jsx)(AF,{})}];function eUR(e){let{bookingRaw:t,tableRow:l,isCancellingOrder:a,isCompletingBooking:i,getApp:n,onActionCellClick:s}=e,r=(0,ef.useMemo)(()=>eYG(t,l??null),[t,l]),o=(0,ef.useMemo)(()=>eYW(t),[t]),d=(0,ef.useMemo)(()=>{let e,l;return e=String((null==t?void 0:t.appointment_status)??"").trim(),(l={new:{label:eN.getText("pisell2.text.status.new"),tone:"new"},confirmed:{label:eN.getText("pisell2.text.status.confirmed"),tone:"confirmed"},arrived:{label:eN.getText("pisell2.text.status.arrived"),tone:"arrived"},started:{label:eN.getText("pisell2.text.status.started"),tone:"started"},cancelled:{label:eN.getText("pisell2.text.status.cancelled"),tone:"cancelled"},no_show:{label:eN.getText("pisell2.text.status.no_show"),tone:"no-show"},completed:{label:eN.getText("pisell2.text.status.completed"),tone:"completed"}})[e]??l.new},[t]),c=(0,ef.useMemo)(()=>eCI(t),[t]),u=(0,ef.useMemo)(()=>eUC(t),[t]),p=(0,ef.useMemo)(()=>eUM.has(eUN(t)),[t]),m=(0,ef.useMemo)(()=>{var e;let l;return e=null==r?void 0:r.status,l=eCI(t)?null:"occupied"===e?{key:"action-complete",icon:(0,ev.jsx)(lL.Iconfont,{type:"pisell2-check-square-broken"})}:{key:"action-start",icon:(0,ev.jsx)(lL.Iconfont,{type:"pisell2-send-01"})},[eUO[1],eUO[0],{key:"action-form",icon:(0,ev.jsx)(lL.Iconfont,{type:"pisell2-edit-05"})},...l?[l]:[],...eUO.slice(2),{key:"action-close",icon:(0,ev.jsx)(u1,{})}]},[null==r?void 0:r.status,t]),g=(0,ef.useMemo)(()=>{let e;return(!Array.isArray(e=t.products)?[]:e.filter(e=>e&&"object"==typeof e)).map((e,t)=>(function(e,t,l){var a,i,n;let s,r,o,d=e.product_title,c=(null==l||null==(n=l.app)||null==(i=n.locales)||null==(a=i.translation)?void 0:a.call(i,d))||eUw(d)||eUk(e.name)||eUk(e.title)||"—",u=e.product_sku,p=Math.max(1,Math.round(eUj(e.product_quantity)||1)),{price:m,total:g,origin_total:h}=(s=eUj(e.payment_price),r=eUj(e.selling_price),{price:s,total:r,origin_total:(o=eUj(e.original_price))>0?o:void 0}),v=function(e){if(!e)return;let t=eUw(e.subtitle);if(t)return t;let l=function(e){if(!Array.isArray(e))return"";let t=[];for(let l of e){if(!l||"object"!=typeof l)continue;let e=eUw(l.group),a=eUw(l.item);e&&a?t.push(`${e}:${a}`):a?t.push(a):e&&t.push(e)}return t.join(" \xb7 ")}(e.variant);if(l)return l;let a=e.option;if(!Array.isArray(a)||0===a.length)return;let i=a.filter(e=>e&&"object"==typeof e).map(e=>{let t=eUw(e.group_name),l=eUw(e.name);return t&&l?`${t}:${l}`:l||t}).filter(Boolean);return i.length?i.join(" \xb7 "):void 0}(u),f=function(e){if(!e)return;let t=e.option;if(!Array.isArray(t)||0===t.length)return;let l=t.filter(e=>e&&"object"==typeof e).map(e=>eUS(e));return l.length?l:void 0}(u),y=function(e){let t=e.product_bundle;if(!Array.isArray(t)||0===t.length)return;let l=t.filter(e=>e&&"object"==typeof e).map((e,t)=>{let l,a,i,n,s,r,o,d;return a="number"==typeof(l=e.bundle_id)&&Number.isFinite(l)?l:Number(String(l??t).replace(/\D/g,""))||t,i=Math.max(1,Math.round(eUj(e.num)||1)),n=eUj(e.custom_price??e.price),r=(s=eUj(e.bundle_payment_price))>0?s:n*i,d=Array.isArray(o=e.option)?o.filter(e=>e&&"object"==typeof e).map(e=>eUS(e)):void 0,{id:a,name:eUw(e.bundle_title)||"—",num:i,price:i>0?r/i:n,total:r,origin_total:void 0,price_type:eUk(e.price_type)||void 0,options:d&&d.length?d:void 0}});return l.length?l:void 0}(e),x=eUk(e.note)||void 0,b=e.like_status,_=null!=b&&eUk(b)?eUk(b):void 0,k=e.resource_id??e.relation_id,w=null!=k&&""!==String(k)?k:void 0,j=e.relation_form_name,S=null!=j&&eUk(j)?eUk(j):void 0,M=e.image??e.product_image??(null==u?void 0:u.image),N=null!=M&&eUk(M)?eUk(M):void 0;return{_id:function(e,t){let l=e.order_detail_id;if(null!=l&&""!==String(l))return l;let a=e.booking_uid;if(null!=a&&""!==String(a))return String(a);let i=e.product_id;return null!=i&&""!==String(i)?`${String(i)}-${t}`:`line-${t}`}(e,t),id:function(e,t){let l=e.product_id;if("number"==typeof l&&Number.isFinite(l))return l;let a=Number(String(l??"").replace(/\D/g,""));return Number.isFinite(a)&&a>0?a:t}(e,t),name:c,price:m,total:g,num:p,origin_total:h,image:N,isShowNote:!!x,note:x,like_status:_,bundle:y,options:f,isShowAction:!1,product_option_string:v,discount_reason:void 0,relation_products:void 0,resource_id:w,relation_form_name:S,holder_title:void 0,start_date:eUk(e.start_date)||void 0,end_date:eUk(e.end_date)||void 0,is_show_duration:void 0,is_show_week:void 0}})(e,t,{app:null==n?void 0:n()}))},[t,n]),h=(0,ef.useMemo)(()=>(function(e){if(!e)return"$";let t=e.currency_symbol;return null!=t&&""!==String(t).trim()?String(t).trim():"$"})(t.order),[t.order]);return(0,ev.jsxs)("div",{className:`${eUT}__booking-card`,children:[(0,ev.jsx)("div",{className:`${eUT}__room-card-slot pisell-res-floor-room-card`,onMouseDown:eUL,onClick:eUL,children:(0,ev.jsx)(eU_,{data:r,shellShape:"rect",hideHeader:!0,hideHeaderCapacity:!0,headerMainFieldOverride:o,bodyStatusTag:d})}),(0,ev.jsx)("div",{className:c?`${eUT}__action-grid ${eUT}__action-grid--cols-3`:`${eUT}__action-grid`,role:"group","aria-label":eUz("action-grid-aria"),children:m.map(e=>{let{key:l,icon:n}=e,r="action-cart"===l&&u,o=p&&("action-cart"===l||"action-edit"===l),d=function(e){switch(e){case"action-edit":return`${eUT}__action-cell--tint-edit`;case"action-cart":return`${eUT}__action-cell--tint-checkout`;case"action-form":return`${eUT}__action-cell--tint-form`;case"action-start":return`${eUT}__action-cell--tint-start`;case"action-complete":return`${eUT}__action-cell--tint-complete`;default:return""}}(l),c=[`${eUT}__action-cell`,d,r?`${eUT}__action-cell--paid`:"",o?`${eUT}__action-cell--refund-disabled`:""].filter(Boolean).join(" "),m=r?(0,ev.jsx)(rE,{}):n,g=r?"action-paid":l;return(0,ev.jsxs)("button",{type:"button",className:c,disabled:r||o||"action-close"===l&&a||"action-complete"===l&&i,onClick:e=>s(t,l,e),children:[ey().isValidElement(m)?ey().cloneElement(m,{className:`${eUT}__action-icon`,"aria-hidden":!0}):null,(0,ev.jsx)("span",{className:`${eUT}__action-label`,children:eUz(g)})]},l)})}),(0,ev.jsx)("div",{className:`${eUT}__products-section`,children:(0,ev.jsx)("div",{className:`${eUT}__products-list`,children:0===g.length?(0,ev.jsx)("div",{className:`${eUT}__products-empty`,children:eUz("empty-items")}):g.map(e=>(0,ev.jsx)("div",{className:`${eUT}__product-card-slot`,children:(0,ev.jsx)(lL.ProductCard,{dataSource:{...e,symbol:h},isShowImage:!1,isShowHolder:!1,isShowNote:!1,isShowDelete:!1,isShowPackageNote:!1,isShowEditProduct:!1})},String(e._id)))})})]})}function eU$(e){var t;let{open:l,onClose:a,onActionSuccess:i,raw:n,tableRow:s,sceneElementName:r,reservationBiz:o,associatedMenuListIds:d,reservationRuleProduct:c,floorDayBookingList:u,currentTime:p,followWallClock:m,singleBookingMode:g}=e,[h,v]=(0,ef.useState)("current-occupied"),f=ik(),y=null==f||null==(t=f.appHelper)?void 0:t.utils,{resourceBookingItem:x,resourceBookingItemLoading:b,activeTabBookings:_}=function(e,t){let{open:l,raw:a,tableRow:i,floorDayBookingList:n,currentTime:s,followWallClock:r,pisellos:o,disabled:d}=t,[c,u]=(0,ef.useState)(null),[p,m]=(0,ef.useState)(!1),g=(0,ef.useRef)(0);(0,ef.useEffect)(()=>{(!l||null==a||d)&&(u(null),m(!1),g.current+=1)},[l,a,d]),(0,ef.useEffect)(()=>{let e;if(!l||null==a||d)return;let t=null==o?void 0:o.getModule;if("function"!=typeof t)return;try{e=t.call(o,"sales")}catch{return}let c=null==e?void 0:e.getResourceBookingItem;if("function"!=typeof c)return;let p=eCT(i);if(null==p)return;let h="YYYY-MM-DD HH:mm",v=s?em()(s).format(h):em()().format(h),f=r?v:em()().format(h),y=Array.isArray(n)?n:[],x=++g.current;m(!0),y.length;let b=e=>{if(g.current!==x)return void g.current;let t=function(e){if(null==e||"object"!=typeof e)return eUI;let t=e=>Array.isArray(e)?e:[];return{bookings:t(e.bookings),completedBookings:t(e.completedBookings),unpaidBookings:t(e.unpaidBookings)}}(e);t.bookings.length,t.completedBookings.length,t.unpaidBookings.length,u(t),m(!1)},_=()=>{g.current===x&&(u(eUI),m(!1))};try{let t=c.call(e,{resourceId:p,currentTime:v,bookingList:y,deviceTime:f});null!=t&&"function"==typeof t.then?t.then(b).catch(_):b(t)}catch{_()}},[l,a,i,n,s,r,o,d]);let h=(0,ef.useMemo)(()=>c?("current-occupied"===e?c.bookings:"ended"===e?c.completedBookings:c.unpaidBookings).filter(e=>null!=e&&"object"==typeof e):[],[c,e]);return{resourceBookingItem:c,resourceBookingItemLoading:p,activeTabBookings:h}}(h,{open:l,raw:n,tableRow:s,floorDayBookingList:u,currentTime:p,followWallClock:m,pisellos:null==y?void 0:y.pisellos,disabled:g}),k=(0,ef.useMemo)(()=>null==x?null:{"current-occupied":x.bookings.length,ended:x.completedBookings.length,unpaid:x.unpaidBookings.length},[x]),{editBookingModalRef:w,isCancellingOrder:j,isCompletingBooking:S,handleResourceChangeConfirmed:M,handleActionCellClick:N}=function(e){var t,l,a;let{raw:i,tableRow:n,reservationBiz:s,associatedMenuListIds:r,onActionSuccess:o,appHelperUtils:d}=e,[c,u]=(0,ef.useState)(!1),[p,m]=(0,ef.useState)(!1),g=(0,ef.useRef)(null),h=(0,ef.useRef)(null),v=ik();null==v||null==(a=v.appHelper)||null==(l=a.utils)||null==(t=l.isIOS)||t.call(l);let f=(0,ef.useCallback)((e,t)=>{ex.Modal.confirm({title:eUz(function(e){switch(e){case"action-close":return"confirm-close-title";case"action-start":default:return"confirm-start-title";case"action-complete":return"confirm-complete-title"}}(e)),okText:eUz(function(e){switch(e){case"action-close":return"confirm-close-ok";case"action-start":default:return"confirm-start-ok";case"action-complete":return"confirm-complete-ok"}}(e)),cancelText:eUz(function(e){switch(e){case"action-close":return"confirm-close-cancel";case"action-start":default:return"confirm-start-cancel";case"action-complete":return"confirm-complete-cancel"}}(e)),centered:!0,okButtonProps:"action-close"===e?{danger:!0}:{style:eUD},onOk:t})},[]),y=(0,ef.useCallback)(async e=>{if(c)return;let{action:t,pisellos:l}=d||{},a=eCM(e);if(null==a)return void ex.message.error("Cancel order failed: missing order id");try{u(!0);let e=eCA(l),i=null==e?void 0:e.cancelOrder;if("function"!=typeof i)return void ex.message.error("Cancel order failed: Sales module is unavailable");await i.call(e,[a]),ex.message.success("Cancel order successfully"),eCD(t,a),await (null==o?void 0:o())}catch(e){console.error("[ReservationBookingDetailModal] cancel order failed",e),ex.message.error("Cancel order failed")}finally{u(!1)}},[d,c,o]),x=(0,ef.useCallback)(async e=>{let{action:t,pisellos:l}=d||{},a=eCM(e),i=eCN(e);if(null==i)return void ex.message.error("Complete booking failed: missing booking id");try{m(!0);let e=eCA(l),n=null==e?void 0:e.changeBookingStatus;if("function"!=typeof n)return void ex.message.error("Complete booking failed: Sales module is unavailable");await n.call(e,{booking_id:i,appointment_status:"started"}),ex.message.success("Complete booking successfully"),eCD(t,a),await (null==o?void 0:o())}catch(e){console.error("[ReservationBookingDetailModal] complete booking failed",e),ex.message.error("Complete booking failed")}finally{m(!1)}},[d,o]),b=(0,ef.useCallback)(async e=>{if(p)return;let{action:t,pisellos:l}=d||{},a=eCM(e),i=eCN(e);if(null==i)return void ex.message.error("Complete booking failed: missing booking id");try{m(!0);let e=eCA(l),n=null==e?void 0:e.changeBookingStatus;if("function"!=typeof n)return void ex.message.error("Complete booking failed: Sales module is unavailable");await n.call(e,{booking_id:i,appointment_status:"completed"}),ex.message.success("Complete booking successfully"),eCD(t,a),await (null==o?void 0:o())}catch(e){console.error("[ReservationBookingDetailModal] complete booking failed",e),ex.message.error("Complete booking failed")}finally{m(!1)}},[d,p,o]),_=(0,ef.useCallback)(()=>{let{action:e}=d||{},t=h.current??i,l=t?eCM(t):void 0;"function"==typeof e&&(e({type:"pisell1.closeSelectFloorMapResource",data:{},callback:()=>{}}),eCD(e,l)),h.current=null,null==o||o()},[d,o,i]),k=(0,ef.useCallback)(async(e,t,l)=>{if(eUL(l),!e)return;let{action:a,NativePage:i}=d||{},o=eCM(e),c=eCT(n),u=eCC(e,"start_at","start_date","start_time"),p=eCC(e,"end_at","end_date","end_time");switch(t){case"action-edit":"function"==typeof a&&null!=o&&a({type:"pisell1.handleOpenCachedBigSale",data:{order_id:o,business_code:null!=s&&""!==String(s).trim()?String(s).trim():""},callback:()=>{}});break;case"action-cart":if(eUC(e))return void ex.message.info(eUz("order-already-paid"));"function"==typeof a&&null!=o&&a({type:"pisell1.handleOpenPayment",data:{order:{id:o}},callback:e=>{if("toast-close"===VS(e).type)return}});break;case"action-print":"function"==typeof a&&a({type:"webpos.handlePrint",data:{data:e,type:"0"},callback:()=>{}});break;case"action-list":"function"==typeof a&&a({type:"pisell1.handleOpenSaleDetail",data:{osProps:{orderId:o,syncDetailOnOrderChange:!0}},callback:()=>{}});break;case"action-form":if("function"!=typeof a)return void ex.message.error("Change resource failed: action is unavailable");if(!c)return void ex.message.error("Change resource failed: missing source resource");if(!u||!p)return void ex.message.error("Change resource failed: missing booking time");{let t=em()(u);if(!t.isValid())return void ex.message.error("Change resource failed: invalid booking time");a({type:"pisell1.handleSelectFloorMapResource",data:{reservationBiz:s,associatedMenuListIds:r,scheduleValue:{date:t.startOf("day"),at:t},onClick:t=>{var l,a,i;let s,r,o=null==t||null==(l=t.resource)?void 0:l.id;if(null==o||""===String(o).trim())return void ex.message.error("Change resource failed: missing target resource");if(String(c)===String(o))return void ex.message.error(eUz("resource-already-bound"));let d=function(e){var t,l,a,i,n;let s=(null==(t=e.resource)?void 0:t.raw)&&"object"==typeof e.resource.raw?e.resource.raw:e.row,r=(null==(l=e.resource)?void 0:l.id)??(null==s?void 0:s.id);if(null!=r&&""!==String(r).trim())return{...s,id:r,form_id:(null==(a=e.resource)?void 0:a.form_id)??(null==s?void 0:s.form_id),code:(null==(i=e.resource)?void 0:i.code)??(null==s?void 0:s.code),main_field:(null==(n=e.resource)?void 0:n.main_field)??(null==s?void 0:s.main_field)}}(t);(s=eCP(n),r=eCP(d),s&&r&&s!==r)?ex.message.error(eUz("resource-type-mismatch")):(h.current=e,null==(i=g.current)||null==(a=i.open)||a.call(i,{event:e,fromResourceId:c,toResourceId:String(o),toResource:d,toStartDate:u,toEndDate:p,mode:"resource-only"}))}},callback:()=>{}})}break;case"action-close":f("action-close",()=>y(e));break;case"action-start":f("action-start",()=>x(e));break;case"action-complete":f("action-complete",()=>b(e))}},[d,s,r,n,f,y,x,b]);return{editBookingModalRef:g,isCancellingOrder:c,isCompletingBooking:p,handleResourceChangeConfirmed:_,handleActionCellClick:k}}({raw:n,tableRow:s,reservationBiz:o,associatedMenuListIds:d,onActionSuccess:i,appHelperUtils:y});(0,ef.useEffect)(()=>{v("current-occupied")},[null==n?void 0:n.id,null==n?void 0:n.booking_uid,null==n?void 0:n.booking_id]);let C=(0,ef.useMemo)(()=>{var e;if(null==s)return eN.getText(`${eUP}.modal-title`);let t=eYb(s,null!=r&&""!==String(r).trim()?String(r).trim():void 0).trim(),l=null==(e=s.code)?void 0:e.trim();return eYN(t||l||eN.getText("pisell-reservation.room-kind-bound"),s)},[s,r]),T=!!(l&&null!=n),P=(0,ef.useCallback)(e=>{eUL(e),a(e)},[a]),A=(0,ef.useCallback)(e=>{eUL(e),eCU({appHelperUtils:y,reservationBiz:o,associatedMenuListIds:d,reservationRuleProduct:c,row:s??null})},[y,o,d,c,s]),D=(0,ef.useMemo)(()=>(0,ev.jsxs)("div",{className:`${eUT}__header`,children:[(0,ev.jsx)("button",{type:"button",className:`${eUT}__header-action ${eUT}__header-action--left`,onClick:P,children:eUz("header-close")}),(0,ev.jsx)("div",{className:`${eUT}__header-title`,children:C}),(0,ev.jsx)("button",{type:"button",className:`${eUT}__header-action ${eUT}__header-action--right`,onClick:A,children:eUz("header-new-order")})]}),[C,P,A]),I=null==y?void 0:y.getApp;return(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)(iB,{renderType:"modal",props:{platform:"pc",open:T,onCancel:a,maskProps:eUA,focusTriggerAfterClose:!1,title:D,closable:!1,footer:null,destroyOnClose:!0,width:560,wrapClassName:`${eUT}-wrap pisell-pc-modal`},children:n?(0,ev.jsx)("div",{className:eUT,children:(0,ev.jsx)("div",{className:`${eUT}__body`,children:g?(0,ev.jsx)("div",{className:`${eUT}__bookings-list`,role:"tabpanel","aria-label":eUz("tab-current-occupied"),children:(0,ev.jsx)(eUR,{bookingRaw:n,tableRow:s,isCancellingOrder:j,isCompletingBooking:S,getApp:I,onActionCellClick:N})}):(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("div",{className:`${eUT}__tabs`,role:"tablist","aria-label":eUz("tabs-aria"),children:eUE.map(e=>{let{key:t,labelKey:l}=e,a=h===t,i=null==k?void 0:k[t];return(0,ev.jsxs)("button",{type:"button",role:"tab","aria-selected":a,className:`${eUT}__tab${a?` ${eUT}__tab--active`:""}`,onClick:e=>{eUL(e),v(t)},children:[eUz(l),null!=i?(0,ev.jsxs)("span",{className:`${eUT}__tab-count`,children:[" ","(",i,")"]}):null]},t)})}),(0,ev.jsx)("div",{className:`${eUT}__bookings-list`,role:"tabpanel","aria-label":eUz(`tab-${h}`),children:0===_.length?b?null:(0,ev.jsx)("div",{className:`${eUT}__bookings-empty`,children:eUz("empty-tab-bookings")}):_.map((e,t)=>{let l=String(e.id??e.booking_uid??e.booking_id??t);return(0,ev.jsx)(eUR,{bookingRaw:e,tableRow:s,isCancellingOrder:j,isCompletingBooking:S,getApp:I,onActionCellClick:N},l)})})]})})}):null}),(0,ev.jsx)(eAF,{ref:w,open:!1,onCancel:()=>{},onOk:M})]})}let eUF={"pisell-reservation.page-title":"Reservation","pisell-reservation.page-title-venue":"Venue control","pisell-reservation.hud-open-table-aria":"Open table of resources on the floor map","pisell-reservation.hud-expand-aria":"Expand resources list","pisell-reservation.hud-collapse-aria":"Collapse resources list","pisell-reservation.hud-table-drawer-title":"Resources on map","pisell-reservation.hud-drawer-resource-canvas-placeholder":"Filter by area (canvas)","pisell-reservation.hud-sheet-close-aria":"Close resources list","pisell-reservation.new":"+ New","pisell-reservation.new-modal-title":"New","pisell-reservation.new-modal-placeholder":"No available routes","pisell-reservation.cancel":"Cancel","pisell-reservation.edit-map":"Edit floor map","pisell-reservation.edit-map-done":"Done","pisell-reservation.floor-map-appearance-dark":"Dark background","pisell-reservation.floor-map-appearance-light":"Light background","pisell-reservation.follow-current":"Current","pisell-reservation.view-grid":"Table","pisell-reservation.view-floor":"Floor map","pisell-reservation.view-calendar":"Calendar","pisell-reservation.view-resource-wall":"Wall","pisell-reservation.resource-wall-resources":"Resources on wall","pisell-reservation.payment-status-bucket-unpaid":"Unpaid","pisell-reservation.payment-status-bucket-paid":"Paid","pisell-reservation.booking-status-bucket-on-site":"On site","pisell-reservation.booking-status-bucket-no-show":"No show","pisell-reservation.booking-status-bucket-completed":"Completed","pisell-reservation.calendar-granularity-resource":"Resource","pisell-reservation.calendar-granularity-day":"Day","pisell-reservation.calendar-granularity-week":"Week","pisell-reservation.calendar-granularity-month":"Month","pisell-reservation.calendar-write-not-available":"This action is not available yet. Please use the floor map or table when supported.","pisell-reservation.follow-live-time":"Live time","pisell-reservation.follow-custom-time":"Custom time","pisell-reservation.follow-live-hint":"You are following the current time","pisell-reservation.follow-custom-hint":"You are using a custom time","pisell-reservation.switch-to-custom-time":"Switch to custom time","pisell-reservation.switch-to-live-time":"Switch to current time","pisell-reservation.non-current-hint":"You are not on current time","pisell-reservation.at-current-time":"You are on the current time","pisell-reservation.at-current-time-short":"Now","pisell-reservation.go-current":"Go to current time","pisell-reservation.schedule-data-loading":"Loading bookings…","pisell-reservation.grid.code":"Table","pisell-reservation.grid.area":"Area","pisell-reservation.grid.status":"Status","pisell-reservation.grid.guest":"Guest","pisell-reservation.grid.time":"Time","pisell-reservation.grid.party":"Party","pisell-reservation.canvas.main":"Main Area","pisell-reservation.canvas.secondary":"Secondary Area","pisell-reservation.canvas.vip":"VIP Area","pisell-reservation.maintenance":"Maintenance","pisell-reservation.next":"NEXT","pisell-reservation.party":"party","pisell-reservation.more":"more","pisell-reservation.late":"late","pisell-reservation.floor-hud.total":"Total","pisell-reservation.floor-hud.interactive-title":"Today sales","pisell-reservation.floor-map.data-source-label":"Resource","pisell-reservation.floor-map.category-background":"Decorations","pisell-reservation.floor-map.palette-image-bg":"Image (background)","pisell-reservation.floor-plan.save-failed":"Failed to save floor plan","pisell-reservation.card-placeholder.hint-select-row":"Data source selected. Choose a row in the sidebar.","pisell-reservation.card-placeholder.hint-bind-datasource":"No row bound: select a data source and record in the sidebar.","pisell-reservation.card-placeholder.hint-new-slot":"New table placeholder. Bind a record in the sidebar.","pisell-reservation.card-placeholder.hint-row-not-found":"Record not found: check binding or data list.","pisell-reservation.resource-grid.id":"ID","pisell-reservation.resource-grid.name":"Name","pisell-reservation.resource-grid.form-code":"Form code","pisell-reservation.resource-grid.capacity":"Capacity","pisell-reservation.resource-grid.schedule":"Schedule","pisell-reservation.resource-grid.form-id":"Form ID","pisell-reservation.resource-grid.card-status":"Card status","pisell-reservation.room-kind-bound":"Bound resource","pisell-reservation.room-kind-bound-round":"Bound round table","pisell-reservation.room-status-occupied":"Occupied","pisell-reservation.room-status-reserved":"Reserved","pisell-reservation.room-status-empty":"Empty","pisell-reservation.room-status-locked":"Locked","pisell-reservation.room-empty-body":"Not in use","pisell-reservation.room-status-unbound":"Unbound","pisell-reservation.room-paid":"Paid","pisell-reservation.room-unpaid":"Unpaid","pisell-reservation.room-payment-needed":"Collect money","pisell-reservation.room-items-total":"Total {n} items","pisell-reservation.room-items-summary":"{items} items \xb7 {qty} pcs","pisell-reservation.room-modal-bookings":"{n} bookings","pisell-reservation.room-cap-prefix":"Cap","pisell-reservation.room-time-end":"End","pisell-reservation.room-time-start":"Start","pisell-reservation.room-in-minutes":"in {d}","pisell-reservation.room-view-all":"View all {n} bookings","pisell-reservation.room-occupancy-sum":"Guests {current} / {capacity}","pisell-reservation.room-next-prefix":"Next","pisell-reservation.room-guest-unknown":"Guest","pisell-reservation.room-collapse":"Collapse","pisell-reservation.booking-detail.modal-title":"Details","pisell-reservation.booking-detail.booking-id":"Booking ID","pisell-reservation.booking-detail.status":"Status","pisell-reservation.booking-detail.contact":"Guest","pisell-reservation.booking-detail.phone":"Phone","pisell-reservation.booking-detail.time":"Time","pisell-reservation.booking-detail.staff":"Staff","pisell-reservation.booking-detail.staff-unassigned":"Unassigned","pisell-reservation.booking-detail.table":"Table","pisell-reservation.booking-detail.payment":"Payment","pisell-reservation.booking-detail.total":"Total","pisell-reservation.booking-detail.tab-info":"Info","pisell-reservation.booking-detail.tab-notes":"Notes","pisell-reservation.booking-detail.tab-form":"Form","pisell-reservation.booking-detail.empty-notes":"No notes","pisell-reservation.booking-detail.empty-items":"No line items","pisell-reservation.booking-detail.empty-tab-bookings":"No sales","pisell-reservation.booking-detail.empty-form":"No extra fields","pisell-reservation.booking-detail.header-close":"Close","pisell-reservation.booking-detail.header-new-order":"New","pisell-reservation.booking-detail.tabs-aria":"Booking detail tabs","pisell-reservation.booking-detail.tab-current-occupied":"Current occupied","pisell-reservation.booking-detail.tab-ended":"Ended","pisell-reservation.booking-detail.tab-unpaid":"Unpaid","pisell-reservation.booking-detail.booking-label":"Booking","pisell-reservation.booking-detail.strip-items-total":"{count} items Order total : {total}","pisell-reservation.booking-detail.strip-due-label":"Due:","pisell-reservation.booking-detail.see-all":"See all","pisell-reservation.booking-detail.header-mode-aria":"Detail header view","pisell-reservation.booking-detail.header-mode-order-strip":"Summary strip","pisell-reservation.booking-detail.header-mode-room-card":"Room card","pisell-reservation.booking-detail.action-grid-aria":"Booking actions","pisell-reservation.booking-detail.action-edit":"Edit","pisell-reservation.booking-detail.action-cart":"Checkout","pisell-reservation.booking-detail.action-paid":"Paid","pisell-reservation.booking-detail.action-print":"Print receipts","pisell-reservation.booking-detail.action-form":"Change resource","pisell-reservation.booking-detail.action-list":"Order detail","pisell-reservation.booking-detail.action-close":"Cancel","pisell-reservation.booking-detail.action-start":"Start","pisell-reservation.booking-detail.action-complete":"Complete","pisell-reservation.booking-detail.resource-already-bound":"This order is already bound to this resource. Please select another resource.","pisell-reservation.booking-detail.resource-type-mismatch":"Resource type does not match. Please select another resource.","pisell-reservation.select-resource.title":"Select resource","pisell-reservation.booking-detail.confirm-close-title":"Do you want to cancel?","pisell-reservation.booking-detail.confirm-close-ok":"Confirm","pisell-reservation.booking-detail.confirm-close-cancel":"Don't cancel","pisell-reservation.booking-detail.confirm-close-content":"This action cannot be undone.","pisell-reservation.booking-detail.confirm-start-title":"Do you want to start now?","pisell-reservation.booking-detail.confirm-start-ok":"Start","pisell-reservation.booking-detail.confirm-start-cancel":"Cancel","pisell-reservation.booking-detail.confirm-start-content":"Please confirm before continuing.","pisell-reservation.booking-detail.confirm-complete-title":"Mark as complete?","pisell-reservation.booking-detail.confirm-complete-ok":"Complete","pisell-reservation.booking-detail.confirm-complete-cancel":"Cancel","pisell-reservation.booking-detail.confirm-complete-content":"Please confirm before closing this booking.","pisell-reservation.booking-detail.to-pay":"To pay","pisell-reservation.booking-detail.order-open":"Open","pisell-reservation.booking-detail.order-already-paid":"Order already paid.","pisell-reservation.booking-detail.meta-host-status":"Booking on card","pisell-reservation.booking-detail.meta-line-amount":"Order amount","pisell-reservation.booking-detail.meta-timeout":"Overtime","pisell-reservation.booking-detail.meta-progress":"Progress","pisell-reservation.booking-detail.meta-arrival":"Until start","pisell-reservation.booking-detail.status-enum.started":"Started","pisell-reservation.booking-detail.status-enum.confirmed":"Confirmed","pisell-reservation.booking-detail.status-enum.active":"Active","pisell-reservation.booking-detail.status-enum.checked_in":"Checked in","pisell-reservation.booking-detail.status-enum.checkin":"Check-in","pisell-reservation.booking-detail.status-enum.in_progress":"In progress","pisell-reservation.booking-detail.status-enum.pending":"Pending","pisell-reservation.booking-detail.status-enum.pending_payment":"Pending payment","pisell-reservation.booking-detail.status-enum.draft":"Draft","pisell-reservation.booking-detail.status-enum.waiting":"Waiting","pisell-reservation.booking-detail.status-enum.hold":"On hold","pisell-reservation.booking-detail.status-enum.cancelled":"Cancelled","pisell-reservation.booking-detail.status-enum.canceled":"Canceled","pisell-reservation.booking-detail.status-enum.void":"Void","pisell-reservation.booking-detail.status-enum.refunded":"Refunded"},eUB={"pisell-reservation.page-title":"预约","pisell-reservation.page-title-venue":"场控","pisell-reservation.hud-open-table-aria":"打开画布已绑定资源列表","pisell-reservation.hud-expand-aria":"展开画布资源列表","pisell-reservation.hud-collapse-aria":"收起画布资源列表","pisell-reservation.hud-table-drawer-title":"画布资源列表","pisell-reservation.hud-drawer-resource-canvas-placeholder":"按画布区域筛选","pisell-reservation.hud-sheet-close-aria":"关闭画布资源列表","pisell-reservation.new":"+ 新建","pisell-reservation.new-modal-title":"新建","pisell-reservation.new-modal-placeholder":"暂无可跳转路由","pisell-reservation.cancel":"取消","pisell-reservation.edit-map":"编辑平面图","pisell-reservation.edit-map-done":"完成编辑","pisell-reservation.floor-map-appearance-dark":"暗色背景","pisell-reservation.floor-map-appearance-light":"浅色背景","pisell-reservation.follow-current":"当前","pisell-reservation.view-grid":"表格","pisell-reservation.view-floor":"平面图","pisell-reservation.view-calendar":"日历","pisell-reservation.view-resource-wall":"大屏","pisell-reservation.resource-wall-resources":"大屏显示资源","pisell-reservation.payment-status-bucket-unpaid":"未支付","pisell-reservation.payment-status-bucket-paid":"已支付","pisell-reservation.booking-status-bucket-on-site":"在场","pisell-reservation.booking-status-bucket-no-show":"未到店","pisell-reservation.booking-status-bucket-completed":"已完成","pisell-reservation.calendar-granularity-resource":"资源","pisell-reservation.calendar-granularity-day":"日","pisell-reservation.calendar-granularity-week":"周","pisell-reservation.calendar-granularity-month":"月","pisell-reservation.calendar-write-not-available":"该操作暂未开放,请在平面图或表格中操作(与平面图写能力对齐后可用)。","pisell-reservation.follow-live-time":"当前时间","pisell-reservation.follow-custom-time":"自定义时间","pisell-reservation.follow-live-hint":"现在为当前时间","pisell-reservation.follow-custom-hint":"当前为自定义时间","pisell-reservation.switch-to-custom-time":"切换为自定义时间","pisell-reservation.switch-to-live-time":"切换为当前时间","pisell-reservation.non-current-hint":"您处于非当前状态","pisell-reservation.at-current-time":"您处于当前时间","pisell-reservation.at-current-time-short":"当前","pisell-reservation.go-current":"去当前","pisell-reservation.schedule-data-loading":"预约数据加载中…","pisell-reservation.grid.code":"台号","pisell-reservation.grid.area":"区域","pisell-reservation.grid.status":"状态","pisell-reservation.grid.guest":"客人","pisell-reservation.grid.time":"时间","pisell-reservation.grid.party":"人数","pisell-reservation.canvas.main":"主区域","pisell-reservation.canvas.secondary":"副区域","pisell-reservation.canvas.vip":"VIP 区","pisell-reservation.maintenance":"维护中","pisell-reservation.next":"下一桌","pisell-reservation.party":"位","pisell-reservation.more":"更多","pisell-reservation.late":"迟到","pisell-reservation.floor-hud.total":"总计","pisell-reservation.floor-hud.interactive-title":"今日营业","pisell-reservation.floor-map.data-source-label":"资源","pisell-reservation.floor-map.category-background":"装饰","pisell-reservation.floor-map.palette-image-bg":"图片(底图)","pisell-reservation.floor-plan.save-failed":"平面图保存失败","pisell-reservation.card-placeholder.hint-select-row":"已选择数据源,请在侧栏选择数据行","pisell-reservation.card-placeholder.hint-bind-datasource":"未绑定数据行:请在侧栏选择数据源与记录","pisell-reservation.card-placeholder.hint-new-slot":"新桌位占位,可在侧栏绑定具体记录","pisell-reservation.card-placeholder.hint-row-not-found":"未找到对应记录:请检查绑定或数据列表","pisell-reservation.resource-grid.id":"ID","pisell-reservation.resource-grid.name":"名称","pisell-reservation.resource-grid.form-code":"表单编码","pisell-reservation.resource-grid.capacity":"容量","pisell-reservation.resource-grid.schedule":"日程","pisell-reservation.resource-grid.form-id":"表单 ID","pisell-reservation.resource-grid.card-status":"卡片状态","pisell-reservation.room-kind-bound":"绑定资源","pisell-reservation.room-kind-bound-round":"绑定圆桌","pisell-reservation.room-status-occupied":"使用中","pisell-reservation.room-status-reserved":"已预订","pisell-reservation.room-status-empty":"空闲","pisell-reservation.room-status-locked":"已锁定","pisell-reservation.room-empty-body":"暂无预约","pisell-reservation.room-status-unbound":"未绑定","pisell-reservation.room-paid":"已付","pisell-reservation.room-unpaid":"未付","pisell-reservation.room-payment-needed":"需收款","pisell-reservation.room-items-total":"共 {n} 件商品","pisell-reservation.room-items-summary":"共 {items} 项,{qty} 件","pisell-reservation.room-modal-bookings":"{n} 条预约","pisell-reservation.room-cap-prefix":"可容","pisell-reservation.room-time-end":"结束","pisell-reservation.room-time-start":"开始","pisell-reservation.room-in-minutes":"还有 {d}","pisell-reservation.room-view-all":"查看全部 {n} 条预约","pisell-reservation.room-occupancy-sum":"人数 {current}/{capacity}","pisell-reservation.room-next-prefix":"下一档","pisell-reservation.room-guest-unknown":"客人","pisell-reservation.room-collapse":"收起","pisell-reservation.booking-detail.modal-title":"详情","pisell-reservation.booking-detail.booking-id":"预约号","pisell-reservation.booking-detail.status":"状态","pisell-reservation.booking-detail.contact":"联系人","pisell-reservation.booking-detail.phone":"电话","pisell-reservation.booking-detail.time":"时间","pisell-reservation.booking-detail.staff":"员工","pisell-reservation.booking-detail.staff-unassigned":"未分配","pisell-reservation.booking-detail.table":"桌位","pisell-reservation.booking-detail.payment":"支付","pisell-reservation.booking-detail.total":"合计","pisell-reservation.booking-detail.tab-info":"信息","pisell-reservation.booking-detail.tab-notes":"备注","pisell-reservation.booking-detail.tab-form":"表单","pisell-reservation.booking-detail.empty-notes":"无备注","pisell-reservation.booking-detail.empty-items":"无商品行","pisell-reservation.booking-detail.empty-tab-bookings":"暂无订单","pisell-reservation.booking-detail.empty-form":"无额外字段","pisell-reservation.booking-detail.header-close":"关闭","pisell-reservation.booking-detail.header-new-order":"创建订单","pisell-reservation.booking-detail.tabs-aria":"预约详情切换","pisell-reservation.booking-detail.tab-current-occupied":"占用中","pisell-reservation.booking-detail.tab-ended":"已结束","pisell-reservation.booking-detail.tab-unpaid":"未付款","pisell-reservation.booking-detail.booking-label":"预约","pisell-reservation.booking-detail.strip-items-total":"{count} 件商品 订单合计:{total}","pisell-reservation.booking-detail.strip-due-label":"应付:","pisell-reservation.booking-detail.see-all":"查看全部","pisell-reservation.booking-detail.header-mode-aria":"详情顶部展示","pisell-reservation.booking-detail.header-mode-order-strip":"信息条","pisell-reservation.booking-detail.header-mode-room-card":"房间卡","pisell-reservation.booking-detail.action-grid-aria":"操作","pisell-reservation.booking-detail.action-edit":"编辑","pisell-reservation.booking-detail.action-cart":"结账","pisell-reservation.booking-detail.action-paid":"已支付","pisell-reservation.booking-detail.action-print":"打印小票","pisell-reservation.booking-detail.action-form":"更换资源","pisell-reservation.booking-detail.action-list":"订单详情","pisell-reservation.booking-detail.action-close":"取消","pisell-reservation.booking-detail.action-start":"开始预约","pisell-reservation.booking-detail.action-complete":"结束","pisell-reservation.booking-detail.resource-already-bound":"当前订单已经绑定过该资源,请选择其他资源","pisell-reservation.booking-detail.resource-type-mismatch":"资源类型不一致,请选择其他资源","pisell-reservation.select-resource.title":"选择资源","pisell-reservation.booking-detail.confirm-close-title":"是否要取消?","pisell-reservation.booking-detail.confirm-close-ok":"确认","pisell-reservation.booking-detail.confirm-close-cancel":"放弃","pisell-reservation.booking-detail.confirm-close-content":"取消后无法恢复,请确认是否继续。","pisell-reservation.booking-detail.confirm-start-title":"是否现在开始?","pisell-reservation.booking-detail.confirm-start-ok":"开始","pisell-reservation.booking-detail.confirm-start-cancel":"取消","pisell-reservation.booking-detail.confirm-start-content":"确认后将执行开始预约操作。","pisell-reservation.booking-detail.confirm-complete-title":"是否完成?","pisell-reservation.booking-detail.confirm-complete-ok":"完成","pisell-reservation.booking-detail.confirm-complete-cancel":"取消","pisell-reservation.booking-detail.confirm-complete-content":"确认后将执行结束预约操作。","pisell-reservation.booking-detail.to-pay":"应付","pisell-reservation.booking-detail.order-open":"未结","pisell-reservation.booking-detail.order-already-paid":"订单已支付","pisell-reservation.booking-detail.meta-host-status":"卡片预约状态","pisell-reservation.booking-detail.meta-line-amount":"订单金额","pisell-reservation.booking-detail.meta-timeout":"超时","pisell-reservation.booking-detail.meta-progress":"进行进度","pisell-reservation.booking-detail.meta-arrival":"距开始","pisell-reservation.booking-detail.status-enum.started":"已开始","pisell-reservation.booking-detail.status-enum.confirmed":"已确认","pisell-reservation.booking-detail.status-enum.active":"进行中","pisell-reservation.booking-detail.status-enum.checked_in":"已签到","pisell-reservation.booking-detail.status-enum.checkin":"签到","pisell-reservation.booking-detail.status-enum.in_progress":"进行中","pisell-reservation.booking-detail.status-enum.pending":"待处理","pisell-reservation.booking-detail.status-enum.pending_payment":"待支付","pisell-reservation.booking-detail.status-enum.draft":"草稿","pisell-reservation.booking-detail.status-enum.waiting":"等待中","pisell-reservation.booking-detail.status-enum.hold":"保留","pisell-reservation.booking-detail.status-enum.cancelled":"已取消","pisell-reservation.booking-detail.status-enum.canceled":"已取消","pisell-reservation.booking-detail.status-enum.void":"已作废","pisell-reservation.booking-detail.status-enum.refunded":"已退款"},eUH={"pisell-reservation.page-title":"預約","pisell-reservation.page-title-venue":"場控","pisell-reservation.hud-open-table-aria":"打開畫布已綁定資源列表","pisell-reservation.hud-expand-aria":"展開畫布資源列表","pisell-reservation.hud-collapse-aria":"收起畫布資源列表","pisell-reservation.hud-table-drawer-title":"畫布資源列表","pisell-reservation.hud-drawer-resource-canvas-placeholder":"按畫布區域篩選","pisell-reservation.hud-sheet-close-aria":"關閉畫布資源列表","pisell-reservation.new":"+ 新增","pisell-reservation.new-modal-title":"新增","pisell-reservation.new-modal-placeholder":"暫無可跳轉路由","pisell-reservation.cancel":"取消","pisell-reservation.edit-map":"編輯平面圖","pisell-reservation.edit-map-done":"完成編輯","pisell-reservation.floor-map-appearance-dark":"暗色背景","pisell-reservation.floor-map-appearance-light":"淺色背景","pisell-reservation.follow-current":"當前","pisell-reservation.view-grid":"表格","pisell-reservation.view-floor":"平面圖","pisell-reservation.view-calendar":"日曆","pisell-reservation.view-resource-wall":"大屏","pisell-reservation.resource-wall-resources":"大屏顯示資源","pisell-reservation.payment-status-bucket-unpaid":"未支付","pisell-reservation.payment-status-bucket-paid":"已支付","pisell-reservation.booking-status-bucket-on-site":"在場","pisell-reservation.booking-status-bucket-no-show":"未到店","pisell-reservation.booking-status-bucket-completed":"已完成","pisell-reservation.calendar-granularity-resource":"資源","pisell-reservation.calendar-granularity-day":"日","pisell-reservation.calendar-granularity-week":"週","pisell-reservation.calendar-granularity-month":"月","pisell-reservation.calendar-write-not-available":"該操作暫未開放,請在平面圖或表格中操作(與平面圖寫能力對齊後可用)。","pisell-reservation.follow-live-time":"當前時間","pisell-reservation.follow-custom-time":"自訂時間","pisell-reservation.follow-live-hint":"現在為當前時間","pisell-reservation.follow-custom-hint":"目前為自訂時間","pisell-reservation.switch-to-custom-time":"切換為自訂時間","pisell-reservation.switch-to-live-time":"切換為當前時間","pisell-reservation.non-current-hint":"您處於非當前狀態","pisell-reservation.at-current-time":"您處於當前時間","pisell-reservation.at-current-time-short":"當前","pisell-reservation.go-current":"去當前","pisell-reservation.schedule-data-loading":"預約資料載入中…","pisell-reservation.grid.code":"檯號","pisell-reservation.grid.area":"區域","pisell-reservation.grid.status":"狀態","pisell-reservation.grid.guest":"客人","pisell-reservation.grid.time":"時間","pisell-reservation.grid.party":"人數","pisell-reservation.canvas.main":"主區域","pisell-reservation.canvas.secondary":"副區域","pisell-reservation.canvas.vip":"VIP 區","pisell-reservation.maintenance":"維護中","pisell-reservation.next":"下一檯","pisell-reservation.party":"位","pisell-reservation.more":"更多","pisell-reservation.late":"遲到","pisell-reservation.floor-hud.total":"總計","pisell-reservation.floor-hud.interactive-title":"今日營業","pisell-reservation.floor-map.data-source-label":"資源","pisell-reservation.floor-map.category-background":"裝飾","pisell-reservation.floor-map.palette-image-bg":"圖片(底圖)","pisell-reservation.floor-plan.save-failed":"平面圖儲存失敗","pisell-reservation.card-placeholder.hint-select-row":"已選擇資料來源,請在側欄選擇資料列","pisell-reservation.card-placeholder.hint-bind-datasource":"未綁定資料列:請在側欄選擇資料來源與記錄","pisell-reservation.card-placeholder.hint-new-slot":"新桌位佔位,可在側欄綁定具體記錄","pisell-reservation.card-placeholder.hint-row-not-found":"找不到對應記錄:請檢查綁定或資料清單","pisell-reservation.resource-grid.id":"ID","pisell-reservation.resource-grid.name":"名稱","pisell-reservation.resource-grid.form-code":"表單編碼","pisell-reservation.resource-grid.capacity":"容量","pisell-reservation.resource-grid.schedule":"日程","pisell-reservation.resource-grid.form-id":"表單 ID","pisell-reservation.resource-grid.card-status":"卡片狀態","pisell-reservation.room-kind-bound":"綁定資源","pisell-reservation.room-kind-bound-round":"綁定圓桌","pisell-reservation.room-status-occupied":"使用中","pisell-reservation.room-status-reserved":"已預訂","pisell-reservation.room-status-empty":"空閒","pisell-reservation.room-status-locked":"已鎖定","pisell-reservation.room-empty-body":"暫無預約","pisell-reservation.room-status-unbound":"未綁定","pisell-reservation.room-paid":"已付","pisell-reservation.room-unpaid":"未付","pisell-reservation.room-payment-needed":"需收款","pisell-reservation.room-items-total":"共 {n} 件商品","pisell-reservation.room-items-summary":"共 {items} 項,{qty} 件","pisell-reservation.room-modal-bookings":"{n} 條預約","pisell-reservation.room-cap-prefix":"可容","pisell-reservation.room-time-end":"結束","pisell-reservation.room-time-start":"開始","pisell-reservation.room-in-minutes":"還有 {d}","pisell-reservation.room-view-all":"查看全部 {n} 條預約","pisell-reservation.room-occupancy-sum":"人數 {current}/{capacity}","pisell-reservation.room-next-prefix":"下一檔","pisell-reservation.room-guest-unknown":"客人","pisell-reservation.room-collapse":"收起","pisell-reservation.booking-detail.modal-title":"詳情","pisell-reservation.booking-detail.booking-id":"預約號","pisell-reservation.booking-detail.status":"狀態","pisell-reservation.booking-detail.contact":"聯絡人","pisell-reservation.booking-detail.phone":"電話","pisell-reservation.booking-detail.time":"時間","pisell-reservation.booking-detail.staff":"員工","pisell-reservation.booking-detail.staff-unassigned":"未分配","pisell-reservation.booking-detail.table":"桌位","pisell-reservation.booking-detail.payment":"支付","pisell-reservation.booking-detail.total":"合計","pisell-reservation.booking-detail.tab-info":"資訊","pisell-reservation.booking-detail.tab-notes":"備註","pisell-reservation.booking-detail.tab-form":"表單","pisell-reservation.booking-detail.empty-notes":"無備註","pisell-reservation.booking-detail.empty-items":"無商品行","pisell-reservation.booking-detail.empty-tab-bookings":"暫無訂單","pisell-reservation.booking-detail.empty-form":"無額外欄位","pisell-reservation.booking-detail.header-close":"關閉","pisell-reservation.booking-detail.header-new-order":"建立訂單","pisell-reservation.booking-detail.tabs-aria":"預約詳情切換","pisell-reservation.booking-detail.tab-current-occupied":"當前占用中的","pisell-reservation.booking-detail.tab-ended":"已經結束的","pisell-reservation.booking-detail.tab-unpaid":"未付款的","pisell-reservation.booking-detail.booking-label":"預約","pisell-reservation.booking-detail.strip-items-total":"{count} 件商品 訂單合計:{total}","pisell-reservation.booking-detail.strip-due-label":"應付:","pisell-reservation.booking-detail.see-all":"查看全部","pisell-reservation.booking-detail.header-mode-aria":"詳情頂部展示","pisell-reservation.booking-detail.header-mode-order-strip":"資訊條","pisell-reservation.booking-detail.header-mode-room-card":"房間卡","pisell-reservation.booking-detail.action-grid-aria":"操作","pisell-reservation.booking-detail.action-edit":"編輯","pisell-reservation.booking-detail.action-cart":"結帳","pisell-reservation.booking-detail.action-paid":"已支付","pisell-reservation.booking-detail.action-print":"列印收據","pisell-reservation.booking-detail.action-form":"更改資源","pisell-reservation.booking-detail.action-list":"訂單詳情","pisell-reservation.booking-detail.action-close":"取消","pisell-reservation.booking-detail.action-start":"開始預約","pisell-reservation.booking-detail.action-complete":"完成","pisell-reservation.booking-detail.resource-already-bound":"當前訂單已經綁定過該資源,請選擇其他資源","pisell-reservation.booking-detail.resource-type-mismatch":"資源類型不一致,請選擇其他資源","pisell-reservation.select-resource.title":"選擇資源","pisell-reservation.booking-detail.confirm-close-title":"是否要取消?","pisell-reservation.booking-detail.confirm-close-ok":"確認","pisell-reservation.booking-detail.confirm-close-cancel":"放棄","pisell-reservation.booking-detail.confirm-close-content":"取消後無法恢復,請確認是否繼續。","pisell-reservation.booking-detail.confirm-start-title":"是否現在開始?","pisell-reservation.booking-detail.confirm-start-ok":"開始","pisell-reservation.booking-detail.confirm-start-cancel":"取消","pisell-reservation.booking-detail.confirm-start-content":"確認後將執行開始預約操作。","pisell-reservation.booking-detail.confirm-complete-title":"是否完成?","pisell-reservation.booking-detail.confirm-complete-ok":"完成","pisell-reservation.booking-detail.confirm-complete-cancel":"取消","pisell-reservation.booking-detail.confirm-complete-content":"確認後將執行完成預約操作。","pisell-reservation.booking-detail.to-pay":"應付","pisell-reservation.booking-detail.order-open":"未結","pisell-reservation.booking-detail.order-already-paid":"訂單已支付","pisell-reservation.booking-detail.meta-host-status":"卡片預約狀態","pisell-reservation.booking-detail.meta-line-amount":"訂單金額","pisell-reservation.booking-detail.meta-timeout":"超時","pisell-reservation.booking-detail.meta-progress":"進行進度","pisell-reservation.booking-detail.meta-arrival":"距開始","pisell-reservation.booking-detail.status-enum.started":"已開始","pisell-reservation.booking-detail.status-enum.confirmed":"已確認","pisell-reservation.booking-detail.status-enum.active":"進行中","pisell-reservation.booking-detail.status-enum.checked_in":"已簽到","pisell-reservation.booking-detail.status-enum.checkin":"簽到","pisell-reservation.booking-detail.status-enum.in_progress":"進行中","pisell-reservation.booking-detail.status-enum.pending":"待處理","pisell-reservation.booking-detail.status-enum.pending_payment":"待支付","pisell-reservation.booking-detail.status-enum.draft":"草稿","pisell-reservation.booking-detail.status-enum.waiting":"等待中","pisell-reservation.booking-detail.status-enum.hold":"保留","pisell-reservation.booking-detail.status-enum.cancelled":"已取消","pisell-reservation.booking-detail.status-enum.canceled":"已取消","pisell-reservation.booking-detail.status-enum.void":"已作廢","pisell-reservation.booking-detail.status-enum.refunded":"已退款"},eUq="pisell-reservation.floor-map.palette-image-bg",eUV=new Set([eUF[eUq],eUB[eUq],eUH[eUq],"图片(底图)"]),eUY="pisell-reservation.floor-map.category-background",eUU="pisell-reservation.floor-map.data-source-label",eUW="pisell-floor-map-layout.palette.builtin-shape",eUG="pisell-reservation.room-kind-bound",eUQ="pisell-reservation.room-kind-bound-round",eUK=new Set(["image","floorMapBg","floor_map_image"]);function eUJ(e){let t=new Set;return e.filter(e=>!t.has(e.value)&&(t.add(e.value),!0))}function eUZ(e,t){if(!(null==t?void 0:t.length))return e;let l=new Map(e.map(e=>[e.value,e])),a=eUJ(t.filter(e=>!(eUK.has(e.value)||e.value!==lL.FLOOR_MAP_IMAGE_ELEMENT_KIND&&eUV.has(e.label)))).filter(e=>e.value!==lL.FLOOR_MAP_IMAGE_ELEMENT_KIND).filter(e=>e.value!==lL.FLOOR_MAP_BUILTIN_SHAPE_ELEMENT_KIND).filter(e=>!eU8.has(e.value)).map(e=>{let t=l.get(e.value);return t?{...t,...e,nameAsTitleConfigurable:e.nameAsTitleConfigurable??t.nameAsTitleConfigurable}:e}),i=new Set(a.map(e=>e.value)),n=[...a];for(let t of e)i.has(t.value)||(n.push(t),i.add(t.value));return eUJ(n)}function eUX(e,t){if(!(null==t?void 0:t.length))return e;let l=new Map(e.map(e=>[e.id,e.order??0])),a=new Set(t.map(e=>e.id)),i=[...t];for(let t of e)a.has(t.id)||(i.push(t),a.add(t.id));return[...i].map(e=>l.has(e.id)?{...e,order:l.get(e.id)}:e).sort((e,t)=>(e.order??0)-(t.order??0))}let eU0={en:"Main Area","zh-CN":"主区域","zh-HK":"主區域",ja:"Main Area",pt:"Main Area"},eU2={en:"Secondary Area","zh-CN":"副区域","zh-HK":"副區域",ja:"Secondary Area",pt:"Secondary Area"},eU1={en:"VIP Area","zh-CN":"VIP 区","zh-HK":"VIP 區",ja:"VIP Area",pt:"VIP Area"},eU4="reservationBoundTable",eU3="reservationBoundRoundTable",eU8=new Set(["reservationTable","reservationPartyBench","reservationBarSeat"]),eU6=[{id:"t1",code:"VIP 1号厅",area:"Main",cardStatus:"occupied",guestName:"张总",guestPhone:"135****6789",time:"13:00",timeEnd:"15:30",partySize:8,capacityLabel:"12",priceDisplay:"$ 1288",isPaid:!0,delayMinutes:13,progress:.62,progressTone:"warning",nextGuest:"Alex",nextTime:"14:30"},{id:"t2",code:"T-2",area:"Main",cardStatus:"occupied",guestName:"Tom",guestPhone:"138****1024",time:"13:30",partySize:4,priceDisplay:"$ 680",isPaid:!1,topAccentOrange:!0,elapsedLabel:"1h45m",progress:.35,progressTone:"success"},{id:"t3",code:"T-3",area:"Main",cardStatus:"booked",guestName:"Grace",time:"14:08",partySize:5,startsInMinutes:8},{id:"t4",code:"T-4",area:"Main",cardStatus:"booked",guestName:"Rachel Wu",guestPhone:"186****5511",time:"14:00",partySize:4,lateMinutes:8,nextGuest:"David",nextTime:"15:00"},{id:"t5",code:"T-5",area:"Main",cardStatus:"booked",guestName:"Sophia",time:"12:00",partySize:4},{id:"t6",code:"大包 C2",area:"Main",cardStatus:"booked",capacityLabel:"10",slots:[{name:"James",time:"10:00-12:00",progress:.45},{name:"Wang Li",time:"12:30-14:00",progress:.28}],moreCount:4},{id:"t7",code:"T-7",area:"Main",cardStatus:"available"},{id:"t8",code:"T-8",area:"Main",cardStatus:"maintenance",capacityLabel:"6p"},{id:"p1",code:"P-1",area:"Private",cardStatus:"occupied",slots:[{name:"Michael",time:"13:45"},{name:"Grace",time:"14:00"}],moreCount:3},{id:"p2",code:"P-2",area:"Private",cardStatus:"booked",guestName:"Mark",time:"13:00",partySize:2},{id:"b1",code:"B-1",area:"Bar",cardStatus:"barBusy",time:"14:00",partySize:2,barRemainingLabel:"1h10m"},{id:"b2",code:"B-2",area:"Bar",cardStatus:"occupied",time:"13:45",partySize:1,barRemainingLabel:"55m"},{id:"b3",code:"B-3",area:"Bar",cardStatus:"booked",time:"13:30",partySize:4},{id:"b4",code:"B-4",area:"Bar",cardStatus:"occupied",barSlots:[{name:"Sarah",time:"13:50"},{name:"Kevin",time:"14:15"}]},{id:"b5",code:"B-5",area:"Bar",cardStatus:"available"},{id:"b6",code:"B-6",area:"Bar",cardStatus:"booked",time:"13:30",partySize:4},{id:"b7",code:"B-7",area:"Bar",cardStatus:"maintenance"},{id:"mock-rw-available",code:"Mock\xb7空场(绿)",area:"WallDemo",cardStatus:"available"},{id:"mock-rw-ending",code:"Mock\xb7将结束(橙)",area:"WallDemo",cardStatus:"occupied",guestName:"倒计时≤10分",time:"14:00",delayMinutes:56},{id:"mock-rw-expired",code:"Mock\xb7已超时(红)",area:"WallDemo",cardStatus:"occupied",guestName:"应已清场",time:"11:00",delayMinutes:60},{id:"mock-rw-maint",code:"Mock\xb7维护态",area:"WallDemo",cardStatus:"maintenance",capacityLabel:"8p"},{id:"mock-rw-lights-off",code:"Mock\xb7灯已关",area:"WallDemo",cardStatus:"occupied",guestName:"场上无人",time:"13:00",delayMinutes:30,resourceWallLightState:"off"},{id:"mock-rw-lights-off-soon",code:"Mock\xb7即将关灯",area:"WallDemo",cardStatus:"occupied",guestName:"场上进行中",time:"15:00",delayMinutes:25,resourceWallLightState:"on_soon_off",resourceWallLightOffInMin:6},{id:"mock-rw-lights-on-soon",code:"Mock\xb7即将开灯",area:"WallDemo",cardStatus:"booked",guestName:"下一场将开",time:"16:00",startsInMinutes:12,resourceWallLightState:"off_soon_on",resourceWallLightOnInMin:8,nextGuest:"下一场\xb7李娜",nextTime:"16:00"}],eU5="tables",eU7="main";function eU9(){return[{id:"dining",label:eN.getText(eUU),order:0},{id:"background",label:eN.getText(eUY),order:1}]}function eWe(){return[{value:lL.FLOOR_MAP_IMAGE_ELEMENT_KIND,label:eN.getText(eUq),categoryId:"background",dataBindingPolicy:"none",showInPalette:!0},{value:lL.FLOOR_MAP_BUILTIN_SHAPE_ELEMENT_KIND,label:eN.getText(eUW),categoryId:"background",dataBindingPolicy:"none",showInPalette:!0},{value:eU4,label:eN.getText(eUG),categoryId:"dining",dataBindingPolicy:"optional",allowedDataSourceKeys:[eU5],showInPalette:!0,nameAsTitleConfigurable:!0},{value:eU3,label:eN.getText(eUQ),categoryId:"dining",dataBindingPolicy:"optional",allowedDataSourceKeys:[eU5],defaultShape:"circle",showInPalette:!0,nameAsTitleConfigurable:!0}]}let eWt="secondary",eWl=[{instanceId:"res_t1",canvasId:eU7,x:40,y:40,width:150,height:100,name:"T-1",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"t1"}},{instanceId:"res_t2",canvasId:eU7,x:210,y:40,width:150,height:100,name:"T-2",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"t2"}},{instanceId:"res_t3",canvasId:eU7,x:380,y:40,width:150,height:100,name:"T-3",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"t3"}},{instanceId:"res_p2",canvasId:eU7,x:550,y:40,width:140,height:100,name:"P-2",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"p2"}},{instanceId:"res_t4",canvasId:eU7,x:40,y:170,width:150,height:100,name:"T-4",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"t4"}},{instanceId:"res_t5",canvasId:eU7,x:210,y:170,width:150,height:100,name:"T-5",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"t5"}},{instanceId:"res_t6",canvasId:eU7,x:380,y:170,width:150,height:100,name:"T-6",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"t6"}},{instanceId:"res_p1",canvasId:eU7,x:710,y:40,width:240,height:240,name:"P-1",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"p1"}},{instanceId:"res_t7",canvasId:eU7,x:40,y:300,width:150,height:100,name:"T-7",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"t7"}},{instanceId:"res_t8",canvasId:eU7,x:210,y:300,width:150,height:100,name:"T-8",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"t8"}},{instanceId:"res_b1",canvasId:eU7,x:40,y:440,width:90,height:90,name:"B-1",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"b1"}},{instanceId:"res_b2",canvasId:eU7,x:150,y:440,width:90,height:90,name:"B-2",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"b2"}},{instanceId:"res_b3",canvasId:eU7,x:260,y:440,width:90,height:90,name:"B-3",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"b3"}},{instanceId:"res_b4",canvasId:eU7,x:370,y:440,width:90,height:90,name:"B-4",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"b4"}},{instanceId:"res_b5",canvasId:eU7,x:480,y:440,width:90,height:90,name:"B-5",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"b5"}},{instanceId:"res_b6",canvasId:eU7,x:590,y:440,width:90,height:90,name:"B-6",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"b6"}},{instanceId:"res_b7",canvasId:eU7,x:700,y:440,width:90,height:90,name:"B-7",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"b7"}},{instanceId:"res_mock_rw_available",canvasId:eU7,x:30,y:560,width:100,height:80,name:"Mock\xb7空场",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"mock-rw-available"}},{instanceId:"res_mock_rw_ending",canvasId:eU7,x:148,y:560,width:100,height:80,name:"Mock\xb7将结束",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"mock-rw-ending"}},{instanceId:"res_mock_rw_expired",canvasId:eU7,x:266,y:560,width:100,height:80,name:"Mock\xb7超时",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"mock-rw-expired"}},{instanceId:"res_mock_rw_maint",canvasId:eU7,x:384,y:560,width:100,height:80,name:"Mock\xb7维护",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"mock-rw-maint"}},{instanceId:"res_mock_rw_lights_off",canvasId:eU7,x:502,y:560,width:100,height:80,name:"Mock\xb7灯关",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"mock-rw-lights-off"}},{instanceId:"res_mock_rw_lights_off_soon",canvasId:eU7,x:620,y:560,width:100,height:80,name:"Mock\xb7将关灯",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"mock-rw-lights-off-soon"}},{instanceId:"res_mock_rw_lights_on_soon",canvasId:eU7,x:738,y:560,width:100,height:80,name:"Mock\xb7将开灯",zIndex:0,elementKind:eU4,dataBinding:{dataSourceKey:eU5,recordId:"mock-rw-lights-on-soon"}}];function eWa(){return{canvases:[{id:eU7,name:eU0,order:0,enabled:!0},{id:eWt,name:eU2,order:1,enabled:!0},{id:"vip",name:eU1,order:2,enabled:!0}],canvasUi:{canCreate:!0,canEdit:!0},elementKindCategories:eU9(),elementKinds:eWe(),sceneElements:eWl.map(e=>({...e,dataBinding:e.dataBinding?{...e.dataBinding}:void 0}))}}eWl.map(e=>{let t={dataSourceKey:e.dataBinding.dataSourceKey,id:String(e.dataBinding.recordId),floorMapId:e.canvasId,x:e.x,y:e.y,name:String(e.name??""),width:e.width,height:e.height,elementKind:String(e.elementKind??"")};return"circle"===e.shape&&(t.shape="circle"),t});var eWi=JSON.parse('{"name":{"en":"Reservation","ja":"予約","pt":"Reserva","zh-CN":"预约","zh-HK":"預約"},"layout":{"canvases":[{"id":"main","name":{"en":"Main Area","ja":"メインエリア","pt":"\xc1rea Principal","zh-CN":"主区域","zh-HK":"主區域"},"order":0,"enabled":true,"mapLayer":{"showGrid":false}},{"id":"secondary","name":{"en":"Secondary Area","ja":"Secondary Area","pt":"Secondary Area","zh-CN":"副区域","zh-HK":"副區域"},"order":1,"enabled":true,"mapLayer":{"showGrid":false}},{"id":"vip","name":{"en":"VIP Area","ja":"VIP Area","pt":"VIP Area","zh-CN":"VIP 区","zh-HK":"VIP 區"},"order":2,"enabled":true,"mapLayer":{"showGrid":false}}],"canvasUi":{"canCreate":true,"canEdit":true},"elementKindCategories":[{"id":"dining","label":"Resource","order":0},{"id":"background","label":"Decorations","order":1}],"elementKinds":[{"value":"floorMapImage","label":"Image (background)","categoryId":"background","dataBindingPolicy":"none","showInPalette":true},{"label":"Bound resource","value":"reservationBoundTable","categoryId":"dining","showInPalette":true,"dataBindingPolicy":"optional","allowedDataSourceKeys":["tables"],"nameAsTitleConfigurable":true},{"label":"Bound round table","value":"reservationBoundRoundTable","categoryId":"dining","defaultShape":"circle","showInPalette":true,"dataBindingPolicy":"optional","allowedDataSourceKeys":["tables"],"nameAsTitleConfigurable":true}],"sceneElements":[]},"canvas_width":1920,"canvas_height":1080,"code":"pisell_reservation"}');let eWn=(0,lL.createShopFloorPlanClient)({http:{get:(e,t,l)=>z_.Em.getRequest().get(e,t??{},l??{}),post:(e,t,l)=>z_.Em.getRequest().post(e,t??{},l??{}),put:(e,t,l)=>z_.Em.getRequest().put(e,t??{},l??{})},useShopApi:!0,getSaveFailedMessage:()=>eN.getText("pisell-reservation.floor-plan.save-failed")});eWn.getShopFloorPlanByCode.bind(eWn),eWn.postShopFloorPlan.bind(eWn);let eWs=eWn.putShopFloorPlan.bind(eWn),eWr=eWn.unsubscribeShopFloorPlanCodeQuery.bind(eWn);async function eWo(e,t){return eWn.ensureShopFloorPlanByCode(e,{...t,buildDefaultPostBody:eWd})}function eWd(e){let t=null==e?void 0:e.trim();if(!t)throw Error("floor plan code is required");return{code:t,name:{...eWi.name},layout:JSON.parse(JSON.stringify(eWi.layout)),canvas_width:eWi.canvas_width,canvas_height:eWi.canvas_height,...void 0!==eWi.sort?{sort:eWi.sort}:{},...void 0!==eWi.status?{status:eWi.status}:{}}}async function eWc(e,t,l){let a=(0,lL.buildFloorPlanPutBody)(t,l);return(l.putFloorPlan??eWs)(e,a)}function eWu(e){let t=e instanceof Error?e.message:String(e);(0,lL.PisellToast)({content:t})}function eWp(e){let t=e instanceof Error?e.message:String(e);(0,lL.PisellToast)({content:t})}let eWm=()=>({ticket:eN.getText("pisell2.salesManagement.business.ticket_order"),appointment_booking:eN.getText("pisell2.salesManagement.business.appointment_booking")}),eWg={ticket:"#CEEAB0",appointment_booking:"#C7D7FE"},eWh=ex.Tag,eWv=(e,t)=>{let l=Number(e||0);return`${t||"$"}${l.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}`},eWf=e=>e.filter(e=>null!=e&&""!==e),eWy={text:{fontSize:12,color:"#475467",lineHeight:"18px"}},eWx=(e,t)=>e&&t?`${e} ${t}`:e||t||"",eWb=(e,t)=>{if(null==e||""===e)return"";if("string"==typeof e||"number"==typeof e){let l=String(e).trim();if(!l)return"";let a=null!=t&&""!==t?String(t).trim():"";if(a&&!l.startsWith("+")&&!l.startsWith(a)){let e=a.startsWith("+")?a:`+${a}`;return`${e} ${l}`}return l}return"object"==typeof e?eWb((null==e?void 0:e.phone)||(null==e?void 0:e.number),((null==e?void 0:e.country_calling_code)||(null==e?void 0:e.countryCallingCode))??t):""},eW_=e=>{let t=null==e?void 0:e.order,l=null==t?void 0:t.contacts_info,a=Array.isArray(l)?l[0]:l||(Array.isArray(null==t?void 0:t.contacts)?t.contacts[0]:null);if(!a)return{contact:null,phone:"",email:"",compareValue:"-"};let i=eWb(null==a?void 0:a.phone,null==a?void 0:a.country_calling_code),n=String(a.email||"").trim(),s=[null==a?void 0:a.display_name,null==a?void 0:a.first_name,null==a?void 0:a.last_name,i,n].filter(Boolean).join("|");return{contact:a,phone:i,email:n,compareValue:s||"-"}},eWk=e=>{let{className:t,dataSource:l,labels:a,style:i,variant:n}=e,s="phone"===n,r="string"==typeof(null==l?void 0:l.note)?l.note.trim():"",o=(0,ef.useMemo)(()=>{var e;return(e=null==l?void 0:l.internalNotes)?Array.isArray(e)?e.map((e,t)=>"string"==typeof e||"number"==typeof e?{id:t,content:String(e)}:e&&"object"==typeof e?e:{id:t,content:String(e)}).filter(e=>(null==e?void 0:e.content)!=null&&(null==e?void 0:e.content)!==""):"string"==typeof e||"number"==typeof e?[{id:0,content:String(e)}]:[]:[]},[null==l?void 0:l.internalNotes]),d=(0,ef.useMemo)(()=>{let e=[];return r&&e.push({label:(null==a?void 0:a.orderNote)||eN.getText("pisell2.salesManagement.booking.notes.orderNotes"),content:r}),e},[r,o,null==a?void 0:a.orderNote,null==a?void 0:a.internalNote]),c=d.slice(0,2),u=d.length>0,[p,m]=(0,ef.useState)(!1);if(!d.length)return null;let g=r?[{id:0,content:r}]:[],h=!!(null==l?void 0:l.apis);return(0,ev.jsxs)("div",{className:["pisell-sales-management-booking-notes-preview",`pisell-sales-management-booking-notes-preview--${n||"desktop"}`,t].filter(Boolean).join(" "),style:i,onClick:e=>e.stopPropagation(),children:[(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",cursor:"pointer"},onClick:e=>{e.stopPropagation(),m(!0)},children:[c.map((e,t)=>(0,ev.jsxs)("div",{style:{...eWy.text,fontSize:14,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:[(0,ev.jsxs)("span",{children:[e.label,":"]})," ",(0,ev.jsx)("span",{style:{color:"#eaa96f"},children:e.content})]},`${e.label}-${t}`)),u?(0,ev.jsxs)("div",{style:{color:"#7f56d9",display:"flex",alignItems:"center"},children:[(null==a?void 0:a.more)||eN.getText("pisell2.salesManagement.booking.view-more"),(0,ev.jsx)(lL.Icon,{size:20,type:"pisell2-chevron-right-double"})]}):null]}),(0,ev.jsx)(iB,{renderType:s?"drawer":"modal",props:s?{open:p,title:eN.getText("pisell2.salesManagement.booking.notes.title"),placement:"bottom",width:"100%",height:"auto",platform:"h5",footer:null,onClose:()=>m(!1),destroyOnClose:!0,bodyStyle:{overflowX:"hidden"}}:{open:p,title:eN.getText("pisell2.salesManagement.booking.notes.title"),width:600,platform:"pc",footer:null,onCancel:()=>m(!1),destroyOnClose:!0,bodyStyle:{overflowX:"hidden"}},children:(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:[(0,ev.jsx)(VE,{noteType:"order",maxLength:1,title:`${eN.getText("pisell2.salesManagement.booking.notes.orderNotes")}:`,describe:"",notes:g,apis:null==l?void 0:l.apis,placeholder:eN.getText("pisell2.salesManagement.booking.notes.addOrderNotes"),isEdit:h,onChange:null==l?void 0:l.onChange}),!1]})})]})};eWk.displayName="BookingNotesPreview";let eWw=iW(eWk),eWj=e=>{var t;let l=ik(),a=(null==l||null==(t=l.appHelper)?void 0:t.utils)||{},{value:i,uniqueTables:n,bookingLabels:s,textStyles:r,relationId:o,relationType:d,customer:c}=e,u=Array.isArray(i)?i:[],[p,m]=(0,ef.useState)(!1),[g,h]=(0,ef.useState)(null),v=rP(BU,{manual:!0}),[f,y]=(0,ef.useState)(!1),[x,b]=(0,ef.useState)(!1),_=(0,ef.useMemo)(()=>u.reduce((e,t)=>{let l=null==t?void 0:t.form_id;if(null!=l){let t=String(l);e[t]=(e[t]||0)+1}return e},{}),[u]),k=(0,ef.useMemo)(()=>(n||[]).map(e=>{var t,l,a,i;let n=(null==e||null==(a=e.form)||null==(l=a.setting)||null==(t=l.title)?void 0:t.original)||(null==e||null==(i=e.form)?void 0:i.title)||"";if(!n)return null;let s=null==e?void 0:e.form_id,r=null!=s&&_[String(s)]||0;return{title:`${n} (${r})`,baseTitle:n,formId:s,count:r,table:e}}).filter(e=>e),[n,_]),w=k.length<=3,j=w?k:k.slice(0,3),S=k.length-j.length,M=(0,ef.useCallback)((e,t)=>{t.stopPropagation(),h(e),m(!0),b(!1),v.loading||f||(y(!0),v.run({relation_type:d||"appointment_booking",relation_id:o}))},[v,o,f,d]),N=(0,ef.useMemo)(()=>Array.isArray(v.data)?v.data:[],[v.data]),C=(0,ef.useMemo)(()=>(null==g?void 0:g.formId)?N.find(e=>String(null==e?void 0:e.form_id)===String(null==g?void 0:g.formId)):null,[g,N]);if(0===k.length)return(0,ev.jsx)("div",{style:{minWidth:0,maxWidth:"100%",textAlign:"center"},children:"-"});let T=(0,ev.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4},children:k.map((e,t)=>{let l=e.count>0;return(0,ev.jsx)("div",{style:{fontSize:12,color:l?"#7f56d9":"#98A2B3",textDecoration:l?"underline":"none",whiteSpace:"nowrap",lineHeight:"18px",cursor:l?"pointer":"default"},onClick:t=>{l&&M(e,t)},children:e.title},`${e.title}-${t}`)})});return(0,ev.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{minWidth:0,maxWidth:"100%",overflow:"hidden",boxSizing:"border-box"},children:[w?(0,ev.jsx)("div",{style:{display:"flex",flexDirection:"column"},children:j.map((e,t)=>(0,ev.jsx)("div",{style:{...(null==r?void 0:r.text)||{},color:"#7f56d9",textDecoration:"underline",cursor:"pointer",textAlign:"left",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},onClick:t=>M(e,t),children:e.title},`${e.title}-${t}`))}):(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column"},children:[j.map((e,t)=>(0,ev.jsx)("div",{style:{...(null==r?void 0:r.text)||{},color:"#475467",textDecoration:"none",cursor:"default",textAlign:"left",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.title},`${e.title}-${t}`)),S>0?(0,ev.jsx)(ex.Tooltip,{title:T,open:!p&&x,onOpenChange:e=>{p||b(e)},children:(0,ev.jsx)("div",{style:{...(null==r?void 0:r.text)||{},color:"#7f56d9",textDecoration:"underline",cursor:"default",alignSelf:"flex-start"},children:`+${S} ${eN.getText("pisell2.salesManagement.booking.common.more")}`})}):null]}),(0,ev.jsx)(lL.PisellModal,{open:p,title:null==s?void 0:s.forms,width:600,footer:null,destroyOnClose:!0,onCancel:()=>m(!1),children:v.loading||!f?(0,ev.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",padding:"48px 0"},children:(0,ev.jsx)(ex.Spin,{})}):C?(0,ev.jsx)(B_,{forms:[C],value:{[C.form_id]:C.form_record||[]},onChange:()=>{},addCallback:()=>{},client:c,action:a.action}):null})]})},eWS=(e,t)=>{var l,a,i;let n=ik(),s=null==n||null==(l=n.appHelper)?void 0:l.utils,r=null==t?void 0:t.onOpenDetail,o=null==s?void 0:s.translationOriginal,d=null==n||null==(i=n.engine)||null==(a=i.props)?void 0:a.locale,c=BK(),u=null==e?void 0:e.businessCode,p=(0,ef.useMemo)(()=>{let t=eVE(),l={online_store:eN.getText("pisell2.salesManagement.booking.platform.online_store"),wholesalebusiness:eN.getText("pisell2.salesManagement.booking.platform.wholesalebusiness"),"table-order":eN.getText("pisell2.salesManagement.booking.platform.table-order"),mobile_order:eN.getText("pisell2.salesManagement.booking.platform.mobile_order"),kiosk:eN.getText("pisell2.salesManagement.booking.platform.kiosk"),pos:eN.getText("pisell2.salesManagement.booking.platform.pos")},a=eVk(),i=eWm(),n={bookingBrief:eN.getText("pisell2.salesManagement.booking.column.bookingBrief"),serviceTime:eN.getText("pisell2.salesManagement.booking.column.serviceTime"),customer:eN.getText("pisell2.salesManagement.booking.column.customer"),contact:eN.getText("pisell2.salesManagement.booking.column.contact"),holder:eN.getText("pisell2.salesManagement.booking.column.holder"),services:eN.getText("pisell2.salesManagement.booking.column.services"),pax:eN.getText("pisell2.salesManagement.booking.column.pax"),resource:eN.getText("pisell2.salesManagement.booking.column.resource"),forms:eN.getText("pisell2.salesManagement.booking.column.forms"),orderInfo:eN.getText("pisell2.salesManagement.booking.column.orderInfo"),paymentMethod:eN.getText("pisell2.salesManagement.booking.column.paymentMethod"),bookingId:eN.getText("pisell2.salesManagement.booking.column.bookingId"),orderOrigin:eN.getText("pisell2.salesManagement.booking.column.orderOrigin"),updated:eN.getText("pisell2.salesManagement.booking.column.updated"),orderNote:eN.getText("pisell2.salesManagement.booking.common.orderNote"),internalNote:eN.getText("pisell2.salesManagement.booking.common.internalNote"),more:eN.getText("pisell2.salesManagement.booking.common.more"),createdBy:eN.getText("pisell2.salesManagement.booking.common.createdBy"),guest:eN.getText("pisell2.salesManagement.order.common.guest"),walkIn:eN.getText("pisell2.salesManagement.order.common.walkIn")},{relationTables:s}=e||{};return{BOOKING_STATUS_LABEL_MAP:t,BOOKING_PLATFORM_LABEL_MAP:l,PAYMENT_STATUS_LABEL_MAP:a,BUSINESS_LABEL_MAP:i,bookingLabels:n,uniqueTables:(Array.isArray(s)?s:[]).filter(e=>["appointment_booking","ticket","party_room","therapist","table-order","voucher_ticket","mobile_order"].includes(e.relation_type)).reduce((e,t)=>(e.some(e=>e.form_id===t.form_id)||e.push(t),e),[])}},[null==e?void 0:e.relationTables,d]),m=(0,ef.useCallback)(e=>{let{BOOKING_STATUS_LABEL_MAP:t,BOOKING_PLATFORM_LABEL_MAP:l,PAYMENT_STATUS_LABEL_MAP:a,BUSINESS_LABEL_MAP:i,bookingLabels:n,uniqueTables:r}=p;return[{title:n.bookingBrief,key:"booking_brief",width:188,render:(l,a)=>{var i,s,r;let o=eWx(null==a?void 0:a.start_date,null==a?void 0:a.start_time)||(null==a?void 0:a.start_at),d=null==a?void 0:a.appointment_status,c=t[d]||d||"-",u=eVz[d]||"",p=null==a||null==(i=a.order)?void 0:i.note,m=null==a?void 0:a.notes,g=BY(null==a||null==(s=a.order)?void 0:s.id);return(0,ev.jsxs)("div",{className:"pisell-sales-grid-booking-brief",children:[(0,ev.jsx)(VR,{dataSource:null==a||null==(r=a.order)?void 0:r.customer}),o?(0,ev.jsx)(lL.PisellDateTimeDisplay,{value:o,layout:"inline",textAlign:"left",timeFormat:{padHour:!0},dateFormat:{order:"DMY",showYear:!1,shortMonth:!0,showRelativeDay:!0,useCommaBeforeYear:!1},fields:{fieldOrder:["time","weekday","date"]}}):null,(0,ev.jsx)("div",{children:(0,ev.jsx)(eWh,{style:{backgroundColor:u,whiteSpace:"nowrap",border:"none",fontWeight:500},children:c})}),(0,ev.jsx)(eWw,{dataSource:{note:p,internalNotes:m,apis:g,bookingId:null==a?void 0:a.id,onChange:(t,l,a)=>{e.refresh()}},labels:{orderNote:n.orderNote,internalNote:n.internalNote,more:n.more},style:{maxWidth:"100%"}})]})}},{title:n.resource,dataIndex:"relation_form_name",key:"relation_form_name",align:"center",width:100,render:e=>e?(0,ev.jsx)("div",{style:eWy.text,children:e}):"-"},{title:n.serviceTime,key:"service_time",align:"center",width:165,render:(e,t)=>{let l=eWx(null==t?void 0:t.start_date,null==t?void 0:t.start_time)||(null==t?void 0:t.start_at),a=eWx(null==t?void 0:t.end_date,null==t?void 0:t.end_time)||(null==t?void 0:t.end_at);return l&&a?(0,ev.jsx)("div",{style:{textAlign:"center"},children:(0,ev.jsx)(lL.PisellTimeRangeDisplay,{startAt:l,endAt:a})}):null},uniformCompare:(e,t)=>{let{start_date:l="",start_time:a="",end_date:i="",end_time:n=""}=t;return`${l}${a}${i}${n}`}},{title:n.customer,key:"customer",align:"center",width:118,uniformCompare:(e,t)=>{let l=t.order,a=null==l?void 0:l.customer;if(!a)return"-";let i=null==a?void 0:a.guest_code;return i?`${i}`:1===a.user_id?"walk-in":a},render:(e,t)=>{let l=t.order,a=null==l?void 0:l.customer;if(null==a?void 0:a.guest_code)return(0,ev.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:(0,ev.jsx)("div",{style:{fontWeight:"bold"},children:n.guest})});let i=eWf([eWb((null==a?void 0:a.phone)||(null==t?void 0:t.phone),(null==a?void 0:a.country_calling_code)||(null==t?void 0:t.country_calling_code)),null==a?void 0:a.email]);return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[(0,ev.jsx)(VR,{dataSource:a,style:{fontSize:14}}),i.map((e,t)=>(0,ev.jsx)("div",{style:eWy.text,children:e},`${e}-${t}`))]})}},{title:n.contact,key:"contact",align:"center",width:150,uniformCompare:(e,t)=>{var l;return null==(l=eW_(t))?void 0:l.compareValue},render:(e,t)=>{let{contact:l,phone:a,email:i}=eW_(t);if(!l)return"-";let n=eWf([a,i]);return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[(0,ev.jsx)(VR,{dataSource:l,style:{fontSize:14}}),n.map((e,t)=>(0,ev.jsx)("div",{style:eWy.text,children:e},`${e}-${t}`))]})}},{title:n.holder,dataIndex:"holder_data",key:"holder_data",align:"center",width:110,uniformCompare:(e,t)=>e||"-",render:(e,t)=>{var l;let a;if(!e)return"-";let i=Array.isArray(e)?e[0]:e;if(!i)return"-";let n=(null==(l=i.data)?void 0:l.customer_phone)||i.customer_phone;n&&(a=eWb(n));let s=eWf([a]);return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:[(0,ev.jsx)(VR,{dataSource:{display_name:i.main_field||t.holder_name||""},style:{fontSize:14}}),s.map((e,t)=>(0,ev.jsx)("div",{style:{...eWy.text,whiteSpace:"nowrap"},children:e},`${e}-${t}`))]})}},{title:n.services,key:"services",align:"center",width:120,render:(e,t)=>{var l;let a=Array.isArray(l=(e=>{if("string"!=typeof e)return e;try{return JSON.parse(e)}catch{return e}})(null==t?void 0:t.order_detail))?l:null==l?[]:[l],i=a.slice(0,3),r=a.length-i.length,o=i.map(e=>{let t=s.translation(e.product_title),l=null==e?void 0:e.product_quantity;return t?l?`${t} x${l}`:String(t):null}).filter(e=>e);return(r>0&&o.push(`+${r} ${n.more}`),0===o.length)?null:(0,ev.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center"},children:o.map((e,t)=>(0,ev.jsx)("div",{style:eWy.text,children:e},`${e}-${t}`))})},uniformCompare:(e,t)=>(null==t?void 0:t.order_detail)||""},{title:n.pax,dataIndex:"number",key:"number",align:"center",width:110,render:(e,t)=>{let l=null==t?void 0:t.number;return(0,ev.jsx)("span",{style:{...eWy.text,textAlign:"center"},children:l??"-"})}},{title:n.forms,key:"appointment_form",width:132,align:"center",render:(e,t)=>{var l;return(0,ev.jsx)("div",{style:{width:"100%",maxWidth:132,margin:"0 auto",minWidth:0},children:(0,ev.jsx)(eWj,{value:null==t?void 0:t.appointment_form,uniqueTables:r,bookingLabels:n,textStyles:eWy,relationId:t.parent_id||t.id,relationType:t.item_type,customer:null==(l=t.order)?void 0:l.customer})})}},{title:n.paymentMethod,key:"payment_method",dataIndex:["order","payments"],width:180,align:"center",render:(e,t)=>{let l=(null==t?void 0:t.order)||{},a=Array.isArray(null==l?void 0:l.payments)?l.payments.filter(BX):[],i=null==l?void 0:l.currency_symbol;return 0===a.length?"-":(0,ev.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start"},children:a.map((e,t)=>{var l,a,n;let s=((null==e?void 0:e.voucher_id)?(null==o?void 0:o(null==e||null==(l=e.fund_record)?void 0:l.wallet_pass_name))||(null==e||null==(n=e.fund_record)||null==(a=n.wallet_pass_name)?void 0:a.default):"")||BJ(e,c),r=Number(null==e?void 0:e.amount),d=null==e?void 0:e.payment_time;return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[(0,ev.jsxs)("div",{style:{fontSize:14,lineHeight:"20px",color:"#101828",fontWeight:500,whiteSpace:"nowrap"},children:[(0,ev.jsx)("span",{children:s}),Number.isFinite(r)?(0,ev.jsxs)("span",{children:[": ",eWv(r,i)]}):null]}),d?(0,ev.jsx)(lL.PisellDateTimeDisplay,{value:d,layout:"inline",textAlign:"left",timeFormat:{padHour:!0},dateFormat:{showYear:!1,shortMonth:!0,showRelativeDay:!0,useCommaBeforeYear:!1},fields:{fieldOrder:["time","weekday","date"]},style:{...eWy.text,whiteSpace:"nowrap"}}):null]},(null==e?void 0:e.order_payment_id)||t)})})}},{title:n.orderInfo,key:"order_info",width:124,align:"center",render:(e,t)=>{let l=(null==t?void 0:t.order)||{},i=null==l?void 0:l.shop_full_order_number,n=null==l?void 0:l.total_amount,s=null==l?void 0:l.currency_symbol,r=null==l?void 0:l.payment_status,o=a[r]||"-",d=eVw[r]||"";return(0,ev.jsxs)("div",{className:"pisell-sales-grid-order-info",style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[(0,ev.jsx)("div",{style:{fontWeight:600,textDecoration:"underline",color:"var(--theme-color, #7f56d9)"},children:i||"-"}),null!=n?(0,ev.jsx)("div",{style:eWy.text,children:eWv(n,s)}):null,o?(0,ev.jsx)("div",{children:(0,ev.jsx)(eWh,{style:{backgroundColor:d,whiteSpace:"nowrap",border:"none",fontWeight:500},children:o})}):null]})}},{title:n.bookingId,dataIndex:"booking_id",key:"booking_id",align:"center",width:120,render:e=>(0,ev.jsx)("span",{style:{...eWy.text,textAlign:"center",fontSize:14,fontWeight:400},children:e})},{title:n.orderOrigin,key:"order_origin",width:160,align:"center",render:(e,t)=>{var a,s,r,o,d;let c=(null==t||null==(a=t.order)?void 0:a.business_code)||(null==t?void 0:t.business_code),u=i[c],p=(null==t||null==(s=t.order)?void 0:s.platform)||(null==t||null==(r=t.order)?void 0:r.order_sales_channel),m=l[p]||p,g=(null==t?void 0:t.device_name)||(null==t?void 0:t.device)||(null==t?void 0:t.terminal),h=(null==t?void 0:t.created_at)||(null==t||null==(o=t.order)?void 0:o.created_at),v=(null==t||null==(d=t.order)?void 0:d.create_account)||(null==t?void 0:t.create_account)||(null==t?void 0:t.operator_name),f=eWf([m,g]);return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[u?(0,ev.jsx)("div",{children:(0,ev.jsx)(eWh,{color:eWg[c],style:{color:"black",fontWeight:500},children:u})}):null,f.map((e,t)=>(0,ev.jsx)("div",{style:eWy.text,children:e},`${e}-${t}`)),v?(0,ev.jsxs)("div",{style:{display:"flex",alignItems:"center",...eWy.text},children:[(0,ev.jsxs)("span",{children:[n.createdBy,":"]}),(0,ev.jsx)(VR,{dataSource:v,style:{fontSize:12}})]}):null,(0,ev.jsx)(lL.PisellDateTimeDisplay,{value:h,layout:"inline",textAlign:"left",timeFormat:{padHour:!0},dateFormat:{order:"DMY",showYear:!1,shortMonth:!0,showRelativeDay:!0,useCommaBeforeYear:!1},fields:{fieldOrder:["time","weekday","date"]},style:{whiteSpace:"nowrap"}})]})}},{title:n.updated,key:"updated",width:132,align:"center",render:(e,t)=>{var a,i;let n=(null==t?void 0:t.updated_at)||(null==t||null==(a=t.order)?void 0:a.updated_at),s=(null==t||null==(i=t.order)?void 0:i.platform)||(null==t?void 0:t.order_platform),r=eWf([l[s]||s]);return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[(0,ev.jsx)(lL.PisellDateTimeDisplay,{value:n,layout:"inline",textAlign:"left",timeFormat:{padHour:!0},dateFormat:{order:"DMY",showYear:!1,shortMonth:!0,showRelativeDay:!0,useCommaBeforeYear:!1},fields:{fieldOrder:["time","weekday","date"]},style:{whiteSpace:"nowrap"}}),r.map((e,t)=>(0,ev.jsx)("div",{style:eWy.text,children:e},`${e}-${t}`))]})}}]},[p,o,c]);return(0,ef.useMemo)(()=>({key:"monitor",label:"Monitor",getChildComponentProps:e=>{let t,l,a;return{grid:{bordered:!0,collapseUniformColumns:!0,columns:m(e),defaultHiddenColumnKeys:["order_origin","updated"],scroll:{x:"max-content",autoCalc:!0,scrollToFirstRowOnChange:!0},rowSelection:!1,onRow:e=>({onClick:()=>{var t;if(e.id){if(r)return void r({orderId:null==(t=e.order)?void 0:t.id,record:e});null==s||s.action({type:"pisell1.handleOpenSaleDetail",data:{osProps:{orderId:e.order.id,osKey:"sales-management-item-detail",businessCode:u,syncDetailOnOrderChange:!0}}})}}})},toolBar:{search:{showConfirmButton:!1},sort:{list:[{type:"time",isCustom:!0,name:"after_execution_time",label:eN.getText("pisell2.salesManagement.booking.sort.afterExecutionTime"),getSortItems:()=>[{key:"after_execution_time:asc",label:eN.getText("pisell2.salesManagement.sort.oldestFirst")}]},{type:"time",isCustom:!0,name:"start_at",label:eN.getText("pisell2.salesManagement.booking.sort.startAt"),getSortItems:()=>[{key:"start_at:asc",label:eN.getText("pisell2.salesManagement.sort.oldestFirst")},{key:"start_at:desc",label:eN.getText("pisell2.salesManagement.sort.latestFirst")}]},{type:"time",isCustom:!0,name:"end_at",label:eN.getText("pisell2.salesManagement.booking.sort.endAt"),getSortItems:()=>[{key:"end_at:asc",label:eN.getText("pisell2.salesManagement.sort.oldestFirst")},{key:"end_at:desc",label:eN.getText("pisell2.salesManagement.sort.latestFirst")}]},{type:"time",isCustom:!0,name:"created_at",label:eN.getText("pisell2.salesManagement.booking.sort.createdAt"),getSortItems:()=>[{key:"created_at:asc",label:eN.getText("pisell2.salesManagement.sort.oldestFirst")},{key:"created_at:desc",label:eN.getText("pisell2.salesManagement.sort.newestFirst")}]},{type:"time",isCustom:!0,name:"updated_at",label:eN.getText("pisell2.salesManagement.booking.sort.updatedAt"),getSortItems:()=>[{key:"updated_at:asc",label:eN.getText("pisell2.salesManagement.sort.oldestFirst")},{key:"updated_at:desc",label:eN.getText("pisell2.salesManagement.sort.newestFirst")}],other:{style:{width:"100%"}}}]},filter:{hiddenQuickFilter:!0,defaultFilterValue:{quickFilter:[],otherFilter:(t=eVE(),l=eVj(),a=eVk(),[{name:"appointment_status",type:"single",key:"appointmentStatus",label:eN.getText("pisell2.salesManagement.booking.filter.bookingStatus.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.booking.filter.bookingStatus.placeholder"),options:Object.entries(t).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"number_between",type:"numberRange",key:"number_between",label:eN.getText("pisell2.salesManagement.booking.filter.paxRange.label"),other:{placeholder:eN.getText("pisell2.salesManagement.booking.filter.paxRange.placeholder"),minInputNumberProps:{min:0,precision:0},maxInputNumberProps:{min:0,precision:0}}},{name:"form_record_ids",type:"custom",key:"formRecordIds",label:eN.getText("pisell2.salesManagement.booking.filter.resource.label"),sort:!0,localFilter:!1,other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",component:eVI}},{name:"order_sales_channel",type:"single",key:"orderSalesChannel",label:eN.getText("pisell2.salesManagement.booking.filter.salesChannel.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.booking.filter.salesChannel.placeholder"),options:()=>eVs().then(e=>e.map(e=>({label:e.name,value:e.code})))}},{name:"total_amount_between",type:"numberRange",key:"total_amount_between",label:eN.getText("pisell2.salesManagement.booking.filter.orderAmount.label"),other:{placeholder:eN.getText("pisell2.salesManagement.booking.filter.orderAmount.placeholder")}},{name:"order_status",type:"single",key:"order_status",label:eN.getText("pisell2.salesManagement.booking.filter.orderStatus.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.booking.filter.orderStatus.placeholder"),options:Object.entries(l).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"order_payment_status",type:"single",key:"orderPaymentStatus",label:eN.getText("pisell2.salesManagement.booking.filter.paymentStatus.label"),other:{allowClear:!0,mode:"multiple",placeholder:eN.getText("pisell2.salesManagement.booking.filter.paymentStatus.placeholder"),options:Object.entries(a).map(e=>{let[t,l]=e;return{label:l,value:t}}),maxTagCount:"responsive"}},{name:"customer_id",type:"single",key:"customer_id",label:eN.getText("pisell2.salesManagement.booking.filter.customer.label"),other:{allowClear:!0,isSearchServer:!0,showSearch:!0,placeholder:eN.getText("pisell2.salesManagement.booking.filter.customer.placeholder"),options:e=>eVi(e).then(e=>e.map(e=>({label:e.display_name,value:e.id})))}},{name:"payment_method",type:"single",key:"payment_method",label:eN.getText("pisell2.salesManagement.booking.filter.paymentMethod.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.booking.filter.paymentMethod.placeholder"),options:()=>eVr().then(e=>Array.from(new Map(e.map(e=>[e.code,{label:e.name,value:e.code}])).values()))}},{name:"created_at_between",type:"rangePicker",key:"createdAtBetween",label:eN.getText("pisell2.salesManagement.booking.filter.orderDate.label"),other:{placeholder:eN.getText("pisell2.salesManagement.booking.filter.orderDate.placeholder"),showTime:!0}},{name:"updated_at_between",type:"rangePicker",key:"updatedAtBetween",label:eN.getText("pisell2.salesManagement.booking.filter.updatedDate.label"),other:{placeholder:eN.getText("pisell2.salesManagement.booking.filter.updatedDate.placeholder"),showTime:!0}}]),values:{}}},quickFilter:{hideFilterNamesOnFloorMap:["booking_time_start_between"],filterList:[{type:"rangePicker",name:"booking_time_start_between",key:"bookingTimeStartBetween",props:{placeholder:eN.getText("pisell2.salesManagement.booking.filter.bookingDate.label"),showTime:!0}}]}},batchActionBar:{overflowThreshold:2}}}}),[m,s,d,r,u])},eWM={en:{"pisell2.salesManagement.business.online_store":"Online Store","pisell2.salesManagement.business.ticket_order":"Ticket Order","pisell2.salesManagement.business.appointment_booking":"Appointment Booking","pisell2.salesManagement.sort.balanceDue":"Balance Due","pisell2.salesManagement.sort.oldestFirst":"Oldest First","pisell2.salesManagement.sort.newestFirst":"Newest First","pisell2.salesManagement.sort.latestFirst":"Newest First","pisell2.salesManagement.booking.column.bookingBrief":"Booking Brief","pisell2.salesManagement.booking.column.serviceTime":"Service Time","pisell2.salesManagement.booking.column.customer":"Customer","pisell2.salesManagement.booking.column.contact":"Contact","pisell2.salesManagement.booking.column.holder":"Holder","pisell2.salesManagement.booking.column.services":"Services","pisell2.salesManagement.booking.column.pax":"Pax","pisell2.salesManagement.booking.column.resource":"Resource","pisell2.salesManagement.booking.column.forms":"Forms","pisell2.salesManagement.booking.column.orderInfo":"Order Info","pisell2.salesManagement.booking.column.bookingId":"Booking ID","pisell2.salesManagement.booking.column.orderOrigin":"Order Origin","pisell2.salesManagement.booking.column.updated":"Updated","pisell2.salesManagement.booking.status.new":"New","pisell2.salesManagement.booking.status.confirmed":"Confirmed","pisell2.salesManagement.booking.status.arrived":"Arrived","pisell2.salesManagement.booking.status.started":"Started","pisell2.salesManagement.booking.status.cancelled":"Cancelled","pisell2.salesManagement.booking.status.no_show":"No show","pisell2.salesManagement.booking.status.completed":"Completed","pisell2.salesManagement.booking.platform.online_store":"Online Store","pisell2.salesManagement.booking.platform.wholesalebusiness":"Wholesale Business","pisell2.salesManagement.booking.platform.table-order":"Table Order","pisell2.salesManagement.booking.platform.mobile_order":"Mobile Order","pisell2.salesManagement.booking.platform.kiosk":"Kiosk","pisell2.salesManagement.booking.platform.pos":"POS","pisell2.salesManagement.booking.view-more":"View more","pisell2.salesManagement.booking.common.orderNote":"Order Note","pisell2.salesManagement.booking.common.internalNote":"Internal Note","pisell2.salesManagement.booking.common.more":"more","pisell2.salesManagement.booking.common.createdBy":"Created by","pisell2.salesManagement.booking.notes.title":"Notes","pisell2.salesManagement.booking.notes.orderNotes":"Order notes","pisell2.salesManagement.booking.notes.internalNotes":"Internal notes","pisell2.salesManagement.booking.notes.addOrderNotes":"Add Order note","pisell2.salesManagement.booking.notes.addInternalNotes":"Add Internal note","pisell2.salesManagement.booking.notes.internalVisibleOnlyTip":"Visible only to your team members","pisell2.salesManagement.booking.filter.bookingStatus.label":"Booking Status","pisell2.salesManagement.booking.filter.bookingStatus.placeholder":"Please select booking status","pisell2.salesManagement.booking.filter.bookingDate.label":"Booking Date & Time","pisell2.salesManagement.booking.filter.bookingDate.placeholder":"Please select booking date","pisell2.salesManagement.booking.filter.holder.label":"Holder","pisell2.salesManagement.booking.filter.holder.placeholder":"Please enter holder","pisell2.salesManagement.booking.filter.paxRange.label":"Pax Range","pisell2.salesManagement.booking.filter.paxRange.placeholder":"Please enter pax range","pisell2.salesManagement.booking.filter.resource.label":"Resource","pisell2.salesManagement.booking.filter.resource.placeholder":"Please select resource","pisell2.salesManagement.booking.filter.resource.none":"No Resource","pisell2.salesManagement.booking.filter.salesChannel.label":"Sales Channel","pisell2.salesManagement.booking.filter.salesChannel.placeholder":"Please select sales channel","pisell2.salesManagement.booking.filter.orderAmount.label":"Order Amount","pisell2.salesManagement.booking.filter.orderAmount.placeholder":"Please enter order amount","pisell2.salesManagement.booking.filter.orderStatus.label":"Order Status","pisell2.salesManagement.booking.filter.orderStatus.placeholder":"Please select order status","pisell2.salesManagement.booking.filter.paymentStatus.label":"Payment Status","pisell2.salesManagement.booking.filter.paymentStatus.placeholder":"Please select payment status","pisell2.salesManagement.booking.filter.customer.label":"Customer","pisell2.salesManagement.booking.filter.customer.placeholder":"Please select customer","pisell2.salesManagement.booking.filter.includeItems.label":"Include Items","pisell2.salesManagement.booking.filter.includeItems.placeholder":"Please select items","pisell2.salesManagement.booking.filter.paymentMethod.label":"Payment Method","pisell2.salesManagement.booking.filter.paymentMethod.placeholder":"Please select payment method","pisell2.salesManagement.booking.column.paymentMethod":"Payment Method","pisell2.salesManagement.booking.filter.orderDate.label":"Order Date","pisell2.salesManagement.booking.filter.orderDate.placeholder":"Please select order date","pisell2.salesManagement.booking.filter.updatedDate.label":"Updated Date","pisell2.salesManagement.booking.filter.updatedDate.placeholder":"Please select updated date","pisell2.salesManagement.booking.sort.afterExecutionTime":"After Execution Time","pisell2.salesManagement.booking.sort.startAt":"Start Time","pisell2.salesManagement.booking.sort.endAt":"End Time","pisell2.salesManagement.booking.sort.createdAt":"Created Time","pisell2.salesManagement.booking.sort.updatedAt":"Last Updated","pisell2.salesManagement.booking.sort.totalAmount":"Total Amount","pisell2.salesManagement.booking.sort.refundedAmount":"Refunded Amount","pisell2.salesManagement.booking.sort.customerName":"Customer Name","pisell2.salesManagement.order.column.saleBrief":"Sale Brief","pisell2.salesManagement.order.column.customer":"Customer","pisell2.salesManagement.order.column.contact":"Contact","pisell2.salesManagement.order.column.paymentInfo":"Payment Info","pisell2.salesManagement.order.column.paymentMethod":"Payment Method","pisell2.salesManagement.order.column.items":"Items","pisell2.salesManagement.order.column.paymentStatus":"Payment Status","pisell2.salesManagement.order.column.orderOrigin":"Order Origin","pisell2.salesManagement.order.column.shippingMethod":"Shipping Method","pisell2.salesManagement.order.column.fulfillmentMethod":"Fulfillment","pisell2.salesManagement.order.column.orderStatus":"Order Status","pisell2.salesManagement.order.column.fulfillmentStatus":"Fulfillment Status","pisell2.salesManagement.order.column.updated":"Updated","pisell2.salesManagement.order.column.orderId":"Sale ID","pisell2.salesManagement.order.common.orderNote":"Order Note","pisell2.salesManagement.order.common.internalNote":"Internal Note","pisell2.salesManagement.order.common.createdBy":"Created by","pisell2.salesManagement.order.common.guest":"Guest","pisell2.salesManagement.order.common.walkIn":"Walk-in","pisell2.salesManagement.order.paymentStatus.authorized":"Authorized","pisell2.salesManagement.order.paymentStatus.paid":"Paid","pisell2.salesManagement.order.paymentStatus.partially_paid":"Partially Paid","pisell2.salesManagement.order.paymentStatus.partially_refunded":"Partially Refunded","pisell2.salesManagement.order.paymentStatus.payment_pending":"Payment Pending","pisell2.salesManagement.order.paymentStatus.refunded":"Refunded","pisell2.salesManagement.order.paymentStatus.unpaid":"Unpaid","pisell2.salesManagement.order.paymentStatus.voided":"Voided","pisell2.salesManagement.order.paymentStatus.payment_processing":"Payment Processing","pisell2.salesManagement.order.platform.online_store":"Online Store","pisell2.salesManagement.order.platform.wholesalebusiness":"Wholesale Business","pisell2.salesManagement.order.platform.table-order":"Table Order","pisell2.salesManagement.order.platform.mobile_order":"Mobile Order","pisell2.salesManagement.order.platform.kiosk":"Kiosk","pisell2.salesManagement.order.platform.pos":"POS","pisell2.salesManagement.order.orderStatus.open":"Open","pisell2.salesManagement.order.orderStatus.completed":"Completed","pisell2.salesManagement.order.orderStatus.cancelled":"Cancelled","pisell2.salesManagement.order.fulfillmentStatus.fulfilled":"Fulfilled","pisell2.salesManagement.order.fulfillmentStatus.unfulfilled":"Unfulfilled","pisell2.salesManagement.order.fulfillmentStatus.fulfilling":"Fulfilling","pisell2.salesManagement.order.fulfillmentStatus.partial_fulfilled":"Partially Fulfilled","pisell2.salesManagement.order.deliveryType.nil":"No Delivery Required","pisell2.salesManagement.order.deliveryType.shipping":"Shipping","pisell2.salesManagement.order.deliveryType.local_delivery":"Local Delivery","pisell2.salesManagement.order.deliveryType.pickup":"Pickup","pisell2.salesManagement.order.deliveryType.shop_service":"Shop Service","pisell2.salesManagement.order.shopServiceType.dine-in":"Dine-in","pisell2.salesManagement.order.shopServiceType.takeaway":"Takeaway","pisell2.salesManagement.order.common.itemsCount":" items","pisell2.salesManagement.order.common.totalAmount":"Total","pisell2.salesManagement.order.common.paidAmount":"Paid","pisell2.salesManagement.order.common.dueAmount":"Due","pisell2.salesManagement.order.common.refundedAmount":"Refunded","pisell2.salesManagement.order.quickFilter.orderDate.placeholder":"Please select order date","pisell2.salesManagement.order.filter.orderStatus.label":"Order Status","pisell2.salesManagement.order.filter.orderStatus.placeholder":"Please select order status","pisell2.salesManagement.order.filter.paymentStatus.label":"Payment Status","pisell2.salesManagement.order.filter.paymentStatus.placeholder":"Please select payment status","pisell2.salesManagement.order.filter.fulfillmentStatus.label":"Fulfillment Status","pisell2.salesManagement.order.filter.fulfillmentStatus.placeholder":"Please select fulfillment status","pisell2.salesManagement.order.filter.customer.label":"Customer","pisell2.salesManagement.order.filter.customer.placeholder":"Please select customer","pisell2.salesManagement.order.filter.salesChannel.label":"Sales Channel","pisell2.salesManagement.order.filter.salesChannel.placeholder":"Please select sales channel","pisell2.salesManagement.order.filter.paymentMethod.label":"Payment Method","pisell2.salesManagement.order.filter.paymentMethod.placeholder":"Please select payment method","pisell2.salesManagement.order.filter.totalAmount.label":"Order Amount Range","pisell2.salesManagement.order.filter.totalAmount.placeholder":"Please enter","pisell2.salesManagement.order.filter.tags.label":"Tags","pisell2.salesManagement.order.filter.tags.placeholder":"Please select tags","pisell2.salesManagement.order.filter.deliveryType.label":"Delivery Type","pisell2.salesManagement.order.filter.deliveryType.placeholder":"Please select delivery type","pisell2.salesManagement.order.filter.fulfillmentMethod.label":"Fulfillment","pisell2.salesManagement.order.filter.fulfillmentMethod.placeholder":"Please select fulfillment","pisell2.salesManagement.order.filter.deliveryZone.label":"Delivery Zone","pisell2.salesManagement.order.filter.deliveryZone.placeholder":"Please select delivery zone","pisell2.salesManagement.order.filter.pickupLocation.label":"Pickup Location","pisell2.salesManagement.order.filter.pickupLocation.placeholder":"Please select pickup location","pisell2.salesManagement.order.filter.trackingNumber.label":"Tracking Number","pisell2.salesManagement.order.filter.trackingNumber.placeholder":"Please enter tracking number","pisell2.salesManagement.order.filter.logistics.label":"Logistics Company","pisell2.salesManagement.order.filter.logistics.placeholder":"Please select logistics company","pisell2.salesManagement.order.filter.zipCode.label":"Zip Code","pisell2.salesManagement.order.filter.zipCode.placeholder":"Please enter zip code","pisell2.salesManagement.order.sort.createdAt":"Created Time","pisell2.salesManagement.order.sort.updatedAt":"Updated Time","pisell2.salesManagement.order.sort.totalAmount":"Order Amount","pisell2.salesManagement.order.sort.customerName":"Customer Name"},"zh-CN":{"pisell2.salesManagement.business.online_store":"在线店铺","pisell2.salesManagement.business.ticket_order":"票务订单","pisell2.salesManagement.business.appointment_booking":"预约","pisell2.salesManagement.sort.balanceDue":"待收金额","pisell2.salesManagement.sort.oldestFirst":"最早优先","pisell2.salesManagement.sort.newestFirst":"最新优先","pisell2.salesManagement.sort.latestFirst":"最晚优先","pisell2.salesManagement.booking.column.bookingBrief":"预约摘要","pisell2.salesManagement.booking.column.serviceTime":"服务时间","pisell2.salesManagement.booking.column.customer":"客户","pisell2.salesManagement.booking.column.contact":"联系人","pisell2.salesManagement.booking.column.holder":"持有人","pisell2.salesManagement.booking.column.services":"服务项目","pisell2.salesManagement.booking.column.pax":"参与人数","pisell2.salesManagement.booking.column.resource":"资源","pisell2.salesManagement.booking.column.forms":"表单","pisell2.salesManagement.booking.column.orderInfo":"订单信息","pisell2.salesManagement.booking.column.bookingId":"预约编号","pisell2.salesManagement.booking.column.orderOrigin":"订单来源","pisell2.salesManagement.booking.column.updated":"更新","pisell2.salesManagement.booking.status.new":"新建","pisell2.salesManagement.booking.status.confirmed":"已确认","pisell2.salesManagement.booking.status.arrived":"已到达","pisell2.salesManagement.booking.status.started":"已开始","pisell2.salesManagement.booking.status.cancelled":"已取消","pisell2.salesManagement.booking.status.no_show":"未到场","pisell2.salesManagement.booking.status.completed":"已完成","pisell2.salesManagement.booking.platform.online_store":"在线店铺","pisell2.salesManagement.booking.platform.wholesalebusiness":"批发业务","pisell2.salesManagement.booking.platform.table-order":"扫码点餐","pisell2.salesManagement.booking.platform.mobile_order":"移动点餐","pisell2.salesManagement.booking.platform.kiosk":"Kiosk","pisell2.salesManagement.booking.platform.pos":"终端","pisell2.salesManagement.booking.common.orderNote":"订单备注","pisell2.salesManagement.booking.common.internalNote":"内部备注","pisell2.salesManagement.booking.view-more":"查看更多","pisell2.salesManagement.booking.common.more":"更多","pisell2.salesManagement.booking.common.createdBy":"创建人","pisell2.salesManagement.booking.notes.title":"备注","pisell2.salesManagement.booking.notes.orderNotes":"订单备注","pisell2.salesManagement.booking.notes.internalNotes":"内部备注","pisell2.salesManagement.booking.notes.addOrderNotes":"添加订单备注","pisell2.salesManagement.booking.notes.addInternalNotes":"添加内部备注","pisell2.salesManagement.booking.notes.internalVisibleOnlyTip":"仅团队成员可见","pisell2.salesManagement.booking.filter.bookingStatus.label":"预约状态","pisell2.salesManagement.booking.filter.bookingStatus.placeholder":"请选择预约状态","pisell2.salesManagement.booking.filter.bookingDate.label":"预约日期&时间","pisell2.salesManagement.booking.filter.bookingDate.placeholder":"请选择预约日期","pisell2.salesManagement.booking.filter.holder.label":"持有人","pisell2.salesManagement.booking.filter.holder.placeholder":"请输入持有人","pisell2.salesManagement.booking.filter.paxRange.label":"参与人数区间","pisell2.salesManagement.booking.filter.paxRange.placeholder":"请输入参与人数区间","pisell2.salesManagement.booking.filter.resource.label":"资源","pisell2.salesManagement.booking.filter.resource.placeholder":"请选择资源","pisell2.salesManagement.booking.filter.resource.none":"无资源","pisell2.salesManagement.booking.filter.salesChannel.label":"销售渠道","pisell2.salesManagement.booking.filter.salesChannel.placeholder":"请选择销售渠道","pisell2.salesManagement.booking.filter.orderAmount.label":"订单金额区间","pisell2.salesManagement.booking.filter.orderAmount.placeholder":"请输入订单金额区间","pisell2.salesManagement.booking.filter.orderStatus.label":"订单状态","pisell2.salesManagement.booking.filter.orderStatus.placeholder":"请选择订单状态","pisell2.salesManagement.booking.filter.paymentStatus.label":"支付状态","pisell2.salesManagement.booking.filter.paymentStatus.placeholder":"请选择支付状态","pisell2.salesManagement.booking.filter.customer.label":"客户","pisell2.salesManagement.booking.filter.customer.placeholder":"请选择客户","pisell2.salesManagement.booking.filter.includeItems.label":"商品包含","pisell2.salesManagement.booking.filter.includeItems.placeholder":"请选择商品","pisell2.salesManagement.booking.filter.paymentMethod.label":"支付方式","pisell2.salesManagement.booking.filter.paymentMethod.placeholder":"请选择支付方式","pisell2.salesManagement.booking.column.paymentMethod":"支付方式","pisell2.salesManagement.booking.filter.orderDate.label":"下单时间","pisell2.salesManagement.booking.filter.orderDate.placeholder":"请选择下单时间","pisell2.salesManagement.booking.filter.updatedDate.label":"更新时间","pisell2.salesManagement.booking.filter.updatedDate.placeholder":"请选择更新时间","pisell2.salesManagement.booking.sort.afterExecutionTime":"现场执行时间","pisell2.salesManagement.booking.sort.startAt":"开始时间","pisell2.salesManagement.booking.sort.endAt":"结束时间","pisell2.salesManagement.booking.sort.createdAt":"创建时间","pisell2.salesManagement.booking.sort.updatedAt":"更新时间","pisell2.salesManagement.booking.sort.totalAmount":"订单金额","pisell2.salesManagement.booking.sort.refundedAmount":"退款金额","pisell2.salesManagement.booking.sort.customerName":"客户名称","pisell2.salesManagement.order.column.saleBrief":"销售摘要","pisell2.salesManagement.order.column.customer":"客户","pisell2.salesManagement.order.column.contact":"联系人","pisell2.salesManagement.order.column.paymentInfo":"支付信息","pisell2.salesManagement.order.column.paymentMethod":"支付方式","pisell2.salesManagement.order.column.items":"商品数量","pisell2.salesManagement.order.column.paymentStatus":"支付状态","pisell2.salesManagement.order.column.orderOrigin":"订单来源","pisell2.salesManagement.order.column.shippingMethod":"配送方式","pisell2.salesManagement.order.column.fulfillmentMethod":"交割方式","pisell2.salesManagement.order.column.orderStatus":"订单状态","pisell2.salesManagement.order.column.fulfillmentStatus":"处理状态","pisell2.salesManagement.order.column.updated":"更新","pisell2.salesManagement.order.column.orderId":"销售编号","pisell2.salesManagement.order.common.orderNote":"订单备注","pisell2.salesManagement.order.common.internalNote":"内部备注","pisell2.salesManagement.order.common.createdBy":"创建人","pisell2.salesManagement.order.common.guest":"匿名客户","pisell2.salesManagement.order.common.walkIn":"Walk-in","pisell2.salesManagement.order.paymentStatus.authorized":"已授权","pisell2.salesManagement.order.paymentStatus.paid":"已付款","pisell2.salesManagement.order.paymentStatus.partially_paid":"部分付款","pisell2.salesManagement.order.paymentStatus.partially_refunded":"部分退款","pisell2.salesManagement.order.paymentStatus.payment_pending":"等待付款","pisell2.salesManagement.order.paymentStatus.refunded":"已退款","pisell2.salesManagement.order.paymentStatus.unpaid":"未付款","pisell2.salesManagement.order.paymentStatus.voided":"已作废","pisell2.salesManagement.order.paymentStatus.payment_processing":"待支付","pisell2.salesManagement.order.platform.online_store":"在线店铺","pisell2.salesManagement.order.platform.wholesalebusiness":"批发业务","pisell2.salesManagement.order.platform.table-order":"扫码点餐","pisell2.salesManagement.order.platform.mobile_order":"移动点餐","pisell2.salesManagement.order.platform.kiosk":"Kiosk","pisell2.salesManagement.order.platform.pos":"终端","pisell2.salesManagement.order.orderStatus.open":"未完成","pisell2.salesManagement.order.orderStatus.completed":"已完成","pisell2.salesManagement.order.orderStatus.cancelled":"已取消","pisell2.salesManagement.order.fulfillmentStatus.fulfilled":"已处理","pisell2.salesManagement.order.fulfillmentStatus.unfulfilled":"未处理","pisell2.salesManagement.order.fulfillmentStatus.fulfilling":"处理中","pisell2.salesManagement.order.fulfillmentStatus.partial_fulfilled":"部分处理","pisell2.salesManagement.order.deliveryType.nil":"无需配送","pisell2.salesManagement.order.deliveryType.shipping":"物流配送","pisell2.salesManagement.order.deliveryType.local_delivery":"本地配送","pisell2.salesManagement.order.deliveryType.pickup":"到店自提","pisell2.salesManagement.order.deliveryType.shop_service":"到店服务","pisell2.salesManagement.order.shopServiceType.dine-in":"堂食","pisell2.salesManagement.order.shopServiceType.takeaway":"外带","pisell2.salesManagement.order.common.itemsCount":" 件商品","pisell2.salesManagement.order.common.totalAmount":"总金额","pisell2.salesManagement.order.common.paidAmount":"已付金额","pisell2.salesManagement.order.common.dueAmount":"待付金额","pisell2.salesManagement.order.common.refundedAmount":"已退金额","pisell2.salesManagement.order.quickFilter.orderDate.placeholder":"请选择下单时间","pisell2.salesManagement.order.filter.orderStatus.label":"订单状态","pisell2.salesManagement.order.filter.orderStatus.placeholder":"请选择订单状态","pisell2.salesManagement.order.filter.paymentStatus.label":"支付状态","pisell2.salesManagement.order.filter.paymentStatus.placeholder":"请选择支付状态","pisell2.salesManagement.order.filter.fulfillmentStatus.label":"处理状态","pisell2.salesManagement.order.filter.fulfillmentStatus.placeholder":"请选择处理状态","pisell2.salesManagement.order.filter.customer.label":"客户","pisell2.salesManagement.order.filter.customer.placeholder":"请选择客户","pisell2.salesManagement.order.filter.salesChannel.label":"销售渠道","pisell2.salesManagement.order.filter.salesChannel.placeholder":"请选择销售渠道","pisell2.salesManagement.order.filter.paymentMethod.label":"支付方式","pisell2.salesManagement.order.filter.paymentMethod.placeholder":"请选择支付方式","pisell2.salesManagement.order.filter.totalAmount.label":"订单金额区间","pisell2.salesManagement.order.filter.totalAmount.placeholder":"请输入","pisell2.salesManagement.order.filter.tags.label":"标签","pisell2.salesManagement.order.filter.tags.placeholder":"请选择标签","pisell2.salesManagement.order.filter.deliveryType.label":"配送方式","pisell2.salesManagement.order.filter.deliveryType.placeholder":"请选择配送方式","pisell2.salesManagement.order.filter.fulfillmentMethod.label":"交割方式","pisell2.salesManagement.order.filter.fulfillmentMethod.placeholder":"请选择交割方式","pisell2.salesManagement.order.filter.deliveryZone.label":"配送区域","pisell2.salesManagement.order.filter.deliveryZone.placeholder":"请选择配送区域","pisell2.salesManagement.order.filter.pickupLocation.label":"自提点","pisell2.salesManagement.order.filter.pickupLocation.placeholder":"请选择自提点","pisell2.salesManagement.order.filter.trackingNumber.label":"物流单号","pisell2.salesManagement.order.filter.trackingNumber.placeholder":"请输入物流单号","pisell2.salesManagement.order.filter.logistics.label":"快递公司","pisell2.salesManagement.order.filter.logistics.placeholder":"请选择快递公司","pisell2.salesManagement.order.filter.zipCode.label":"邮编","pisell2.salesManagement.order.filter.zipCode.placeholder":"请输入邮编","pisell2.salesManagement.order.sort.createdAt":"创建时间","pisell2.salesManagement.order.sort.updatedAt":"更新时间","pisell2.salesManagement.order.sort.totalAmount":"订单金额","pisell2.salesManagement.order.sort.customerName":"客户名称"},"zh-HK":{"pisell2.salesManagement.business.online_store":"在線店鋪","pisell2.salesManagement.business.ticket_order":"票務訂單","pisell2.salesManagement.business.appointment_booking":"預約","pisell2.salesManagement.sort.balanceDue":"待收金額","pisell2.salesManagement.sort.oldestFirst":"最早優先","pisell2.salesManagement.sort.newestFirst":"最新優先","pisell2.salesManagement.sort.latestFirst":"最晚優先","pisell2.salesManagement.booking.column.bookingBrief":"預約摘要","pisell2.salesManagement.booking.column.serviceTime":"服務時間","pisell2.salesManagement.booking.column.customer":"客戶","pisell2.salesManagement.booking.column.contact":"聯絡人","pisell2.salesManagement.booking.column.holder":"持有人","pisell2.salesManagement.booking.column.services":"服務項目","pisell2.salesManagement.booking.column.pax":"參與人數","pisell2.salesManagement.booking.column.resource":"資源","pisell2.salesManagement.booking.column.forms":"表單","pisell2.salesManagement.booking.column.orderInfo":"訂單資訊","pisell2.salesManagement.booking.column.bookingId":"預約編號","pisell2.salesManagement.booking.column.orderOrigin":"訂單來源","pisell2.salesManagement.booking.column.updated":"更新","pisell2.salesManagement.booking.status.new":"新建","pisell2.salesManagement.booking.status.confirmed":"已確認","pisell2.salesManagement.booking.status.arrived":"已到達","pisell2.salesManagement.booking.status.started":"已開始","pisell2.salesManagement.booking.status.cancelled":"已取消","pisell2.salesManagement.booking.status.no_show":"未到場","pisell2.salesManagement.booking.status.completed":"已完成","pisell2.salesManagement.booking.platform.online_store":"在線店鋪","pisell2.salesManagement.booking.platform.wholesalebusiness":"批發業務","pisell2.salesManagement.booking.platform.table-order":"掃碼點餐","pisell2.salesManagement.booking.platform.mobile_order":"移動點餐","pisell2.salesManagement.booking.platform.kiosk":"Kiosk","pisell2.salesManagement.booking.platform.pos":"終端","pisell2.salesManagement.booking.common.orderNote":"訂單備註","pisell2.salesManagement.booking.common.internalNote":"內部備註","pisell2.salesManagement.booking.view-more":"查看更多","pisell2.salesManagement.booking.common.more":"更多","pisell2.salesManagement.booking.common.createdBy":"建立人","pisell2.salesManagement.booking.notes.title":"備註","pisell2.salesManagement.booking.notes.orderNotes":"訂單備註","pisell2.salesManagement.booking.notes.internalNotes":"內部備註","pisell2.salesManagement.booking.notes.addOrderNotes":"添加訂單備註","pisell2.salesManagement.booking.notes.addInternalNotes":"添加內部備註","pisell2.salesManagement.booking.notes.internalVisibleOnlyTip":"僅團隊成員可見","pisell2.salesManagement.booking.filter.bookingStatus.label":"預約狀態","pisell2.salesManagement.booking.filter.bookingStatus.placeholder":"請選擇預約狀態","pisell2.salesManagement.booking.filter.bookingDate.label":"預約日期&時間","pisell2.salesManagement.booking.filter.bookingDate.placeholder":"請選擇預約日期","pisell2.salesManagement.booking.filter.holder.label":"持有人","pisell2.salesManagement.booking.filter.holder.placeholder":"請輸入持有人","pisell2.salesManagement.booking.filter.paxRange.label":"參與人數區間","pisell2.salesManagement.booking.filter.paxRange.placeholder":"請輸入參與人數區間","pisell2.salesManagement.booking.filter.resource.label":"資源","pisell2.salesManagement.booking.filter.resource.placeholder":"請選擇資源","pisell2.salesManagement.booking.filter.resource.none":"無資源","pisell2.salesManagement.booking.filter.salesChannel.label":"銷售渠道","pisell2.salesManagement.booking.filter.salesChannel.placeholder":"請選擇銷售渠道","pisell2.salesManagement.booking.filter.orderAmount.label":"訂單金額區間","pisell2.salesManagement.booking.filter.orderAmount.placeholder":"請輸入訂單金額區間","pisell2.salesManagement.booking.filter.orderStatus.label":"訂單狀態","pisell2.salesManagement.booking.filter.orderStatus.placeholder":"請選擇訂單狀態","pisell2.salesManagement.booking.filter.paymentStatus.label":"支付狀態","pisell2.salesManagement.booking.filter.paymentStatus.placeholder":"請選擇支付狀態","pisell2.salesManagement.booking.filter.customer.label":"客戶","pisell2.salesManagement.booking.filter.customer.placeholder":"請選擇客戶","pisell2.salesManagement.booking.filter.includeItems.label":"商品包含","pisell2.salesManagement.booking.filter.includeItems.placeholder":"請選擇商品","pisell2.salesManagement.booking.filter.paymentMethod.label":"支付方式","pisell2.salesManagement.booking.filter.paymentMethod.placeholder":"請選擇支付方式","pisell2.salesManagement.booking.column.paymentMethod":"支付方式","pisell2.salesManagement.booking.filter.orderDate.label":"下單時間","pisell2.salesManagement.booking.filter.orderDate.placeholder":"請選擇下單時間","pisell2.salesManagement.booking.filter.updatedDate.label":"更新時間","pisell2.salesManagement.booking.filter.updatedDate.placeholder":"請選擇更新時間","pisell2.salesManagement.booking.sort.afterExecutionTime":"現場執行時間","pisell2.salesManagement.booking.sort.startAt":"開始時間","pisell2.salesManagement.booking.sort.endAt":"結束時間","pisell2.salesManagement.booking.sort.createdAt":"創建時間","pisell2.salesManagement.booking.sort.updatedAt":"更新時間","pisell2.salesManagement.booking.sort.totalAmount":"訂單金額","pisell2.salesManagement.booking.sort.refundedAmount":"退款金額","pisell2.salesManagement.booking.sort.customerName":"客戶名稱","pisell2.salesManagement.order.column.saleBrief":"銷售摘要","pisell2.salesManagement.order.column.customer":"客戶","pisell2.salesManagement.order.column.contact":"聯絡人","pisell2.salesManagement.order.column.paymentInfo":"支付資訊","pisell2.salesManagement.order.column.paymentMethod":"支付方式","pisell2.salesManagement.order.column.items":"商品數量","pisell2.salesManagement.order.column.paymentStatus":"支付狀態","pisell2.salesManagement.order.column.orderOrigin":"訂單來源","pisell2.salesManagement.order.column.shippingMethod":"配送方式","pisell2.salesManagement.order.column.fulfillmentMethod":"交割方式","pisell2.salesManagement.order.column.orderStatus":"訂單狀態","pisell2.salesManagement.order.column.fulfillmentStatus":"處理狀態","pisell2.salesManagement.order.column.updated":"更新","pisell2.salesManagement.order.column.orderId":"銷售編號","pisell2.salesManagement.order.common.orderNote":"訂單備註","pisell2.salesManagement.order.common.internalNote":"內部備註","pisell2.salesManagement.order.common.createdBy":"建立人","pisell2.salesManagement.order.common.guest":"匿名客戶","pisell2.salesManagement.order.common.walkIn":"Walk-in","pisell2.salesManagement.order.paymentStatus.authorized":"已授權","pisell2.salesManagement.order.paymentStatus.paid":"已付款","pisell2.salesManagement.order.paymentStatus.partially_paid":"部分付款","pisell2.salesManagement.order.paymentStatus.partially_refunded":"部分退款","pisell2.salesManagement.order.paymentStatus.payment_pending":"等待付款","pisell2.salesManagement.order.paymentStatus.refunded":"已退款","pisell2.salesManagement.order.paymentStatus.unpaid":"未付款","pisell2.salesManagement.order.paymentStatus.voided":"已作廢","pisell2.salesManagement.order.paymentStatus.payment_processing":"待支付","pisell2.salesManagement.order.platform.online_store":"在線店鋪","pisell2.salesManagement.order.platform.wholesalebusiness":"批發業務","pisell2.salesManagement.order.platform.table-order":"掃碼點餐","pisell2.salesManagement.order.platform.mobile_order":"移動點餐","pisell2.salesManagement.order.platform.kiosk":"Kiosk","pisell2.salesManagement.order.platform.pos":"終端","pisell2.salesManagement.order.orderStatus.open":"未完成","pisell2.salesManagement.order.orderStatus.completed":"已完成","pisell2.salesManagement.order.orderStatus.cancelled":"已取消","pisell2.salesManagement.order.fulfillmentStatus.fulfilled":"已處理","pisell2.salesManagement.order.fulfillmentStatus.unfulfilled":"未處理","pisell2.salesManagement.order.fulfillmentStatus.fulfilling":"處理中","pisell2.salesManagement.order.fulfillmentStatus.partial_fulfilled":"部分處理","pisell2.salesManagement.order.deliveryType.nil":"無需配送","pisell2.salesManagement.order.deliveryType.shipping":"物流配送","pisell2.salesManagement.order.deliveryType.local_delivery":"本地配送","pisell2.salesManagement.order.deliveryType.pickup":"到店自提","pisell2.salesManagement.order.deliveryType.shop_service":"到店服務","pisell2.salesManagement.order.shopServiceType.dine-in":"堂食","pisell2.salesManagement.order.shopServiceType.takeaway":"外帶","pisell2.salesManagement.order.common.itemsCount":" 件商品","pisell2.salesManagement.order.common.totalAmount":"總金額","pisell2.salesManagement.order.common.paidAmount":"已付金額","pisell2.salesManagement.order.common.dueAmount":"待付金額","pisell2.salesManagement.order.common.refundedAmount":"已退金額","pisell2.salesManagement.order.quickFilter.orderDate.placeholder":"請選擇下單時間","pisell2.salesManagement.order.filter.orderStatus.label":"訂單狀態","pisell2.salesManagement.order.filter.orderStatus.placeholder":"請選擇訂單狀態","pisell2.salesManagement.order.filter.paymentStatus.label":"支付狀態","pisell2.salesManagement.order.filter.paymentStatus.placeholder":"請選擇支付狀態","pisell2.salesManagement.order.filter.fulfillmentStatus.label":"處理狀態","pisell2.salesManagement.order.filter.fulfillmentStatus.placeholder":"請選擇處理狀態","pisell2.salesManagement.order.filter.customer.label":"客戶","pisell2.salesManagement.order.filter.customer.placeholder":"請選擇客戶","pisell2.salesManagement.order.filter.salesChannel.label":"銷售渠道","pisell2.salesManagement.order.filter.salesChannel.placeholder":"請選擇銷售渠道","pisell2.salesManagement.order.filter.paymentMethod.label":"支付方式","pisell2.salesManagement.order.filter.paymentMethod.placeholder":"請選擇支付方式","pisell2.salesManagement.order.filter.totalAmount.label":"訂單金額區間","pisell2.salesManagement.order.filter.totalAmount.placeholder":"請輸入","pisell2.salesManagement.order.filter.tags.label":"標籤","pisell2.salesManagement.order.filter.tags.placeholder":"請選擇標籤","pisell2.salesManagement.order.filter.deliveryType.label":"配送方式","pisell2.salesManagement.order.filter.deliveryType.placeholder":"請選擇配送方式","pisell2.salesManagement.order.filter.fulfillmentMethod.label":"交割方式","pisell2.salesManagement.order.filter.fulfillmentMethod.placeholder":"請選擇交割方式","pisell2.salesManagement.order.filter.deliveryZone.label":"配送區域","pisell2.salesManagement.order.filter.deliveryZone.placeholder":"請選擇配送區域","pisell2.salesManagement.order.filter.pickupLocation.label":"自提點","pisell2.salesManagement.order.filter.pickupLocation.placeholder":"請選擇自提點","pisell2.salesManagement.order.filter.trackingNumber.label":"物流單號","pisell2.salesManagement.order.filter.trackingNumber.placeholder":"請輸入物流單號","pisell2.salesManagement.order.filter.logistics.label":"快遞公司","pisell2.salesManagement.order.filter.logistics.placeholder":"請選擇快遞公司","pisell2.salesManagement.order.filter.zipCode.label":"郵編","pisell2.salesManagement.order.filter.zipCode.placeholder":"請輸入郵編","pisell2.salesManagement.order.sort.createdAt":"創建時間","pisell2.salesManagement.order.sort.updatedAt":"更新時間","pisell2.salesManagement.order.sort.totalAmount":"訂單金額","pisell2.salesManagement.order.sort.customerName":"客戶名稱"},ja:{"pisell2.salesManagement.business.online_store":"オンラインストア","pisell2.salesManagement.business.ticket_order":"チケット注文","pisell2.salesManagement.business.appointment_booking":"予約","pisell2.salesManagement.sort.balanceDue":"未払い残高","pisell2.salesManagement.sort.oldestFirst":"古い順","pisell2.salesManagement.sort.newestFirst":"新しい順","pisell2.salesManagement.sort.latestFirst":"最新順","pisell2.salesManagement.booking.column.bookingBrief":"予約概要","pisell2.salesManagement.booking.column.serviceTime":"サービス時間","pisell2.salesManagement.booking.column.customer":"顧客","pisell2.salesManagement.booking.column.contact":"連絡先","pisell2.salesManagement.booking.column.holder":"予約者","pisell2.salesManagement.booking.column.services":"サービス","pisell2.salesManagement.booking.column.pax":"人数","pisell2.salesManagement.booking.column.resource":"リソース","pisell2.salesManagement.booking.column.forms":"フォーム","pisell2.salesManagement.booking.column.orderInfo":"注文情報","pisell2.salesManagement.booking.column.bookingId":"予約ID","pisell2.salesManagement.booking.column.orderOrigin":"注文元","pisell2.salesManagement.booking.column.updated":"更新","pisell2.salesManagement.booking.status.new":"新規","pisell2.salesManagement.booking.status.confirmed":"確認済み","pisell2.salesManagement.booking.status.arrived":"到着済み","pisell2.salesManagement.booking.status.started":"開始済み","pisell2.salesManagement.booking.status.cancelled":"キャンセル済み","pisell2.salesManagement.booking.status.no_show":"無断キャンセル","pisell2.salesManagement.booking.status.completed":"完了","pisell2.salesManagement.booking.platform.online_store":"オンラインストア","pisell2.salesManagement.booking.platform.wholesalebusiness":"卸売ビジネス","pisell2.salesManagement.booking.platform.table-order":"テーブル注文","pisell2.salesManagement.booking.platform.mobile_order":"モバイル注文","pisell2.salesManagement.booking.platform.kiosk":"キオスク","pisell2.salesManagement.booking.platform.pos":"POS","pisell2.salesManagement.booking.view-more":"もっと見る","pisell2.salesManagement.booking.common.orderNote":"注文メモ","pisell2.salesManagement.booking.common.internalNote":"内部メモ","pisell2.salesManagement.booking.common.more":"もっと見る","pisell2.salesManagement.booking.common.createdBy":"作成者","pisell2.salesManagement.booking.notes.title":"メモ","pisell2.salesManagement.booking.notes.orderNotes":"注文メモ","pisell2.salesManagement.booking.notes.internalNotes":"内部メモ","pisell2.salesManagement.booking.notes.addOrderNotes":"注文メモを追加","pisell2.salesManagement.booking.notes.addInternalNotes":"内部メモを追加","pisell2.salesManagement.booking.notes.internalVisibleOnlyTip":"チームメンバーにのみ表示されます","pisell2.salesManagement.booking.filter.bookingStatus.label":"予約ステータス","pisell2.salesManagement.booking.filter.bookingStatus.placeholder":"予約ステータスを選択してください","pisell2.salesManagement.booking.filter.bookingDate.label":"予約日時","pisell2.salesManagement.booking.filter.bookingDate.placeholder":"予約日を選択してください","pisell2.salesManagement.booking.filter.holder.label":"予約者","pisell2.salesManagement.booking.filter.holder.placeholder":"予約者を入力してください","pisell2.salesManagement.booking.filter.paxRange.label":"人数範囲","pisell2.salesManagement.booking.filter.paxRange.placeholder":"人数範囲を入力してください","pisell2.salesManagement.booking.filter.resource.label":"リソース","pisell2.salesManagement.booking.filter.resource.placeholder":"リソースを選択してください","pisell2.salesManagement.booking.filter.resource.none":"リソースなし","pisell2.salesManagement.booking.filter.salesChannel.label":"販売チャネル","pisell2.salesManagement.booking.filter.salesChannel.placeholder":"販売チャネルを選択してください","pisell2.salesManagement.booking.filter.orderAmount.label":"注文金額","pisell2.salesManagement.booking.filter.orderAmount.placeholder":"注文金額を入力してください","pisell2.salesManagement.booking.filter.orderStatus.label":"注文ステータス","pisell2.salesManagement.booking.filter.orderStatus.placeholder":"注文ステータスを選択してください","pisell2.salesManagement.booking.filter.paymentStatus.label":"支払いステータス","pisell2.salesManagement.booking.filter.paymentStatus.placeholder":"支払いステータスを選択してください","pisell2.salesManagement.booking.filter.customer.label":"顧客","pisell2.salesManagement.booking.filter.customer.placeholder":"顧客を選択してください","pisell2.salesManagement.booking.filter.includeItems.label":"含まれる商品","pisell2.salesManagement.booking.filter.includeItems.placeholder":"商品を選択してください","pisell2.salesManagement.booking.filter.paymentMethod.label":"支払い方法","pisell2.salesManagement.booking.filter.paymentMethod.placeholder":"支払い方法を選択してください","pisell2.salesManagement.booking.column.paymentMethod":"支払い方法","pisell2.salesManagement.booking.filter.orderDate.label":"注文日","pisell2.salesManagement.booking.filter.orderDate.placeholder":"注文日を選択してください","pisell2.salesManagement.booking.filter.updatedDate.label":"更新日","pisell2.salesManagement.booking.filter.updatedDate.placeholder":"更新日を選択してください","pisell2.salesManagement.booking.sort.afterExecutionTime":"現場実行時間","pisell2.salesManagement.booking.sort.startAt":"開始時間","pisell2.salesManagement.booking.sort.endAt":"終了時間","pisell2.salesManagement.booking.sort.createdAt":"作成時間","pisell2.salesManagement.booking.sort.updatedAt":"最終更新","pisell2.salesManagement.booking.sort.totalAmount":"合計金額","pisell2.salesManagement.booking.sort.refundedAmount":"返金額","pisell2.salesManagement.booking.sort.customerName":"顧客名","pisell2.salesManagement.order.column.saleBrief":"販売概要","pisell2.salesManagement.order.column.customer":"顧客","pisell2.salesManagement.order.column.contact":"連絡先","pisell2.salesManagement.order.column.paymentInfo":"支払い情報","pisell2.salesManagement.order.column.paymentMethod":"支払い方法","pisell2.salesManagement.order.column.items":"商品","pisell2.salesManagement.order.column.paymentStatus":"支払いステータス","pisell2.salesManagement.order.column.orderOrigin":"注文元","pisell2.salesManagement.order.column.shippingMethod":"配送方法","pisell2.salesManagement.order.column.fulfillmentMethod":"受け渡し方法","pisell2.salesManagement.order.column.orderStatus":"注文ステータス","pisell2.salesManagement.order.column.fulfillmentStatus":"処理ステータス","pisell2.salesManagement.order.column.updated":"更新","pisell2.salesManagement.order.column.orderId":"セールスID","pisell2.salesManagement.order.common.orderNote":"注文メモ","pisell2.salesManagement.order.common.internalNote":"内部メモ","pisell2.salesManagement.order.common.createdBy":"作成者","pisell2.salesManagement.order.common.guest":"ゲスト","pisell2.salesManagement.order.common.walkIn":"Walk-in","pisell2.salesManagement.order.paymentStatus.authorized":"承認済み","pisell2.salesManagement.order.paymentStatus.paid":"支払済み","pisell2.salesManagement.order.paymentStatus.partially_paid":"一部支払い","pisell2.salesManagement.order.paymentStatus.partially_refunded":"一部返金済み","pisell2.salesManagement.order.paymentStatus.payment_pending":"支払い待ち","pisell2.salesManagement.order.paymentStatus.refunded":"返金済み","pisell2.salesManagement.order.paymentStatus.unpaid":"未払い","pisell2.salesManagement.order.paymentStatus.voided":"無効","pisell2.salesManagement.order.paymentStatus.payment_processing":"支払い処理中","pisell2.salesManagement.order.platform.online_store":"オンラインストア","pisell2.salesManagement.order.platform.wholesalebusiness":"卸売ビジネス","pisell2.salesManagement.order.platform.table-order":"テーブル注文","pisell2.salesManagement.order.platform.mobile_order":"モバイル注文","pisell2.salesManagement.order.platform.kiosk":"キオスク","pisell2.salesManagement.order.platform.pos":"POS","pisell2.salesManagement.order.orderStatus.open":"未完了","pisell2.salesManagement.order.orderStatus.completed":"完了","pisell2.salesManagement.order.orderStatus.cancelled":"キャンセル済み","pisell2.salesManagement.order.fulfillmentStatus.fulfilled":"処理済み","pisell2.salesManagement.order.fulfillmentStatus.unfulfilled":"未処理","pisell2.salesManagement.order.fulfillmentStatus.fulfilling":"処理中","pisell2.salesManagement.order.fulfillmentStatus.partial_fulfilled":"一部処理済み","pisell2.salesManagement.order.deliveryType.nil":"配送不要","pisell2.salesManagement.order.deliveryType.shipping":"配送","pisell2.salesManagement.order.deliveryType.local_delivery":"ローカル配送","pisell2.salesManagement.order.deliveryType.pickup":"店頭受取","pisell2.salesManagement.order.deliveryType.shop_service":"店舗サービス","pisell2.salesManagement.order.shopServiceType.dine-in":"店内飲食","pisell2.salesManagement.order.shopServiceType.takeaway":"テイクアウト","pisell2.salesManagement.order.common.itemsCount":" 件の商品","pisell2.salesManagement.order.common.totalAmount":"合計","pisell2.salesManagement.order.common.paidAmount":"支払済み","pisell2.salesManagement.order.common.dueAmount":"未払い","pisell2.salesManagement.order.common.refundedAmount":"返金済み","pisell2.salesManagement.order.quickFilter.orderDate.placeholder":"注文日を選択してください","pisell2.salesManagement.order.filter.orderStatus.label":"注文ステータス","pisell2.salesManagement.order.filter.orderStatus.placeholder":"注文ステータスを選択してください","pisell2.salesManagement.order.filter.paymentStatus.label":"支払いステータス","pisell2.salesManagement.order.filter.paymentStatus.placeholder":"支払いステータスを選択してください","pisell2.salesManagement.order.filter.fulfillmentStatus.label":"処理ステータス","pisell2.salesManagement.order.filter.fulfillmentStatus.placeholder":"処理ステータスを選択してください","pisell2.salesManagement.order.filter.customer.label":"顧客","pisell2.salesManagement.order.filter.customer.placeholder":"顧客を選択してください","pisell2.salesManagement.order.filter.salesChannel.label":"販売チャネル","pisell2.salesManagement.order.filter.salesChannel.placeholder":"販売チャネルを選択してください","pisell2.salesManagement.order.filter.paymentMethod.label":"支払い方法","pisell2.salesManagement.order.filter.paymentMethod.placeholder":"支払い方法を選択してください","pisell2.salesManagement.order.filter.totalAmount.label":"注文金額範囲","pisell2.salesManagement.order.filter.totalAmount.placeholder":"入力してください","pisell2.salesManagement.order.filter.tags.label":"タグ","pisell2.salesManagement.order.filter.tags.placeholder":"タグを選択してください","pisell2.salesManagement.order.filter.deliveryType.label":"配送タイプ","pisell2.salesManagement.order.filter.deliveryType.placeholder":"配送タイプを選択してください","pisell2.salesManagement.order.filter.fulfillmentMethod.label":"受け渡し方法","pisell2.salesManagement.order.filter.fulfillmentMethod.placeholder":"受け渡し方法を選択してください","pisell2.salesManagement.order.filter.deliveryZone.label":"配送ゾーン","pisell2.salesManagement.order.filter.deliveryZone.placeholder":"配送ゾーンを選択してください","pisell2.salesManagement.order.filter.pickupLocation.label":"受取場所","pisell2.salesManagement.order.filter.pickupLocation.placeholder":"受取場所を選択してください","pisell2.salesManagement.order.filter.trackingNumber.label":"追跡番号","pisell2.salesManagement.order.filter.trackingNumber.placeholder":"追跡番号を入力してください","pisell2.salesManagement.order.filter.logistics.label":"物流会社","pisell2.salesManagement.order.filter.logistics.placeholder":"物流会社を選択してください","pisell2.salesManagement.order.filter.zipCode.label":"郵便番号","pisell2.salesManagement.order.filter.zipCode.placeholder":"郵便番号を入力してください","pisell2.salesManagement.order.sort.createdAt":"作成時間","pisell2.salesManagement.order.sort.updatedAt":"更新時間","pisell2.salesManagement.order.sort.totalAmount":"注文金額","pisell2.salesManagement.order.sort.customerName":"顧客名"},pt:{"pisell2.salesManagement.business.online_store":"Loja Online","pisell2.salesManagement.business.ticket_order":"Pedido de Ingresso","pisell2.salesManagement.business.appointment_booking":"Reserva de Agendamento","pisell2.salesManagement.sort.balanceDue":"Saldo Devido","pisell2.salesManagement.sort.oldestFirst":"Mais Antigos Primeiro","pisell2.salesManagement.sort.newestFirst":"Mais Recentes Primeiro","pisell2.salesManagement.sort.latestFirst":"Mais Recentes Primeiro","pisell2.salesManagement.booking.column.bookingBrief":"Resumo da Reserva","pisell2.salesManagement.booking.column.serviceTime":"Hor\xe1rio do Servi\xe7o","pisell2.salesManagement.booking.column.customer":"Cliente","pisell2.salesManagement.booking.column.contact":"Contato","pisell2.salesManagement.booking.column.holder":"Titular","pisell2.salesManagement.booking.column.services":"Servi\xe7os","pisell2.salesManagement.booking.column.pax":"Pessoas","pisell2.salesManagement.booking.column.resource":"Recurso","pisell2.salesManagement.booking.column.forms":"Formul\xe1rios","pisell2.salesManagement.booking.column.orderInfo":"Informa\xe7\xf5es do Pedido","pisell2.salesManagement.booking.column.bookingId":"ID da Reserva","pisell2.salesManagement.booking.column.orderOrigin":"Origem do Pedido","pisell2.salesManagement.booking.column.updated":"Atualizado","pisell2.salesManagement.booking.status.new":"Novo","pisell2.salesManagement.booking.status.confirmed":"Confirmado","pisell2.salesManagement.booking.status.arrived":"Chegou","pisell2.salesManagement.booking.status.started":"Iniciado","pisell2.salesManagement.booking.status.cancelled":"Cancelado","pisell2.salesManagement.booking.status.no_show":"N\xe3o compareceu","pisell2.salesManagement.booking.status.completed":"Conclu\xeddo","pisell2.salesManagement.booking.platform.online_store":"Loja Online","pisell2.salesManagement.booking.platform.wholesalebusiness":"Neg\xf3cio Atacadista","pisell2.salesManagement.booking.platform.table-order":"Pedido na Mesa","pisell2.salesManagement.booking.platform.mobile_order":"Pedido M\xf3vel","pisell2.salesManagement.booking.platform.kiosk":"Quiosque","pisell2.salesManagement.booking.platform.pos":"POS","pisell2.salesManagement.booking.view-more":"Ver mais","pisell2.salesManagement.booking.common.orderNote":"Nota do Pedido","pisell2.salesManagement.booking.common.internalNote":"Nota Interna","pisell2.salesManagement.booking.common.more":"mais","pisell2.salesManagement.booking.common.createdBy":"Criado por","pisell2.salesManagement.booking.notes.title":"Notas","pisell2.salesManagement.booking.notes.orderNotes":"Notas do pedido","pisell2.salesManagement.booking.notes.internalNotes":"Notas internas","pisell2.salesManagement.booking.notes.addOrderNotes":"Adicionar nota do pedido","pisell2.salesManagement.booking.notes.addInternalNotes":"Adicionar nota interna","pisell2.salesManagement.booking.notes.internalVisibleOnlyTip":"Vis\xedvel apenas para membros da sua equipe","pisell2.salesManagement.booking.filter.bookingStatus.label":"Status da Reserva","pisell2.salesManagement.booking.filter.bookingStatus.placeholder":"Selecione o status da reserva","pisell2.salesManagement.booking.filter.bookingDate.label":"Data e Hora da Reserva","pisell2.salesManagement.booking.filter.bookingDate.placeholder":"Selecione a data da reserva","pisell2.salesManagement.booking.filter.holder.label":"Titular","pisell2.salesManagement.booking.filter.holder.placeholder":"Insira o titular","pisell2.salesManagement.booking.filter.paxRange.label":"Faixa de Pessoas","pisell2.salesManagement.booking.filter.paxRange.placeholder":"Insira a faixa de pessoas","pisell2.salesManagement.booking.filter.resource.label":"Recurso","pisell2.salesManagement.booking.filter.resource.placeholder":"Selecione o recurso","pisell2.salesManagement.booking.filter.resource.none":"Sem Recurso","pisell2.salesManagement.booking.filter.salesChannel.label":"Canal de Vendas","pisell2.salesManagement.booking.filter.salesChannel.placeholder":"Selecione o canal de vendas","pisell2.salesManagement.booking.filter.orderAmount.label":"Valor do Pedido","pisell2.salesManagement.booking.filter.orderAmount.placeholder":"Insira o valor do pedido","pisell2.salesManagement.booking.filter.orderStatus.label":"Status do Pedido","pisell2.salesManagement.booking.filter.orderStatus.placeholder":"Selecione o status do pedido","pisell2.salesManagement.booking.filter.paymentStatus.label":"Status do Pagamento","pisell2.salesManagement.booking.filter.paymentStatus.placeholder":"Selecione o status do pagamento","pisell2.salesManagement.booking.filter.customer.label":"Cliente","pisell2.salesManagement.booking.filter.customer.placeholder":"Selecione o cliente","pisell2.salesManagement.booking.filter.includeItems.label":"Itens Inclu\xeddos","pisell2.salesManagement.booking.filter.includeItems.placeholder":"Selecione os itens","pisell2.salesManagement.booking.filter.paymentMethod.label":"M\xe9todo de Pagamento","pisell2.salesManagement.booking.filter.paymentMethod.placeholder":"Selecione o m\xe9todo de pagamento","pisell2.salesManagement.booking.column.paymentMethod":"M\xe9todo de Pagamento","pisell2.salesManagement.booking.filter.orderDate.label":"Data do Pedido","pisell2.salesManagement.booking.filter.orderDate.placeholder":"Selecione a data do pedido","pisell2.salesManagement.booking.filter.updatedDate.label":"Data de Atualiza\xe7\xe3o","pisell2.salesManagement.booking.filter.updatedDate.placeholder":"Selecione a data de atualiza\xe7\xe3o","pisell2.salesManagement.booking.sort.afterExecutionTime":"Ap\xf3s o Hor\xe1rio de Execu\xe7\xe3o","pisell2.salesManagement.booking.sort.startAt":"Hora de In\xedcio","pisell2.salesManagement.booking.sort.endAt":"Hora de T\xe9rmino","pisell2.salesManagement.booking.sort.createdAt":"Hora de Cria\xe7\xe3o","pisell2.salesManagement.booking.sort.updatedAt":"\xdaltima Atualiza\xe7\xe3o","pisell2.salesManagement.booking.sort.totalAmount":"Valor Total","pisell2.salesManagement.booking.sort.refundedAmount":"Valor Reembolsado","pisell2.salesManagement.booking.sort.customerName":"Nome do Cliente","pisell2.salesManagement.order.column.saleBrief":"Resumo da Venda","pisell2.salesManagement.order.column.customer":"Cliente","pisell2.salesManagement.order.column.contact":"Contato","pisell2.salesManagement.order.column.paymentInfo":"Informa\xe7\xf5es de Pagamento","pisell2.salesManagement.order.column.paymentMethod":"M\xe9todo de Pagamento","pisell2.salesManagement.order.column.items":"Itens","pisell2.salesManagement.order.column.paymentStatus":"Status do Pagamento","pisell2.salesManagement.order.column.orderOrigin":"Origem do Pedido","pisell2.salesManagement.order.column.shippingMethod":"M\xe9todo de Envio","pisell2.salesManagement.order.column.fulfillmentMethod":"M\xe9todo de Atendimento","pisell2.salesManagement.order.column.orderStatus":"Status do Pedido","pisell2.salesManagement.order.column.fulfillmentStatus":"Status de Atendimento","pisell2.salesManagement.order.column.updated":"Atualizado","pisell2.salesManagement.order.column.orderId":"ID de Venda","pisell2.salesManagement.order.common.orderNote":"Nota do Pedido","pisell2.salesManagement.order.common.internalNote":"Nota Interna","pisell2.salesManagement.order.common.createdBy":"Criado por","pisell2.salesManagement.order.common.guest":"Convidado","pisell2.salesManagement.order.common.walkIn":"Walk-in","pisell2.salesManagement.order.paymentStatus.authorized":"Autorizado","pisell2.salesManagement.order.paymentStatus.paid":"Pago","pisell2.salesManagement.order.paymentStatus.partially_paid":"Parcialmente Pago","pisell2.salesManagement.order.paymentStatus.partially_refunded":"Parcialmente Reembolsado","pisell2.salesManagement.order.paymentStatus.payment_pending":"Pagamento Pendente","pisell2.salesManagement.order.paymentStatus.refunded":"Reembolsado","pisell2.salesManagement.order.paymentStatus.unpaid":"N\xe3o Pago","pisell2.salesManagement.order.paymentStatus.voided":"Anulado","pisell2.salesManagement.order.paymentStatus.payment_processing":"Processando Pagamento","pisell2.salesManagement.order.platform.online_store":"Loja Online","pisell2.salesManagement.order.platform.wholesalebusiness":"Neg\xf3cio Atacadista","pisell2.salesManagement.order.platform.table-order":"Pedido na Mesa","pisell2.salesManagement.order.platform.mobile_order":"Pedido M\xf3vel","pisell2.salesManagement.order.platform.kiosk":"Quiosque","pisell2.salesManagement.order.platform.pos":"POS","pisell2.salesManagement.order.orderStatus.open":"Aberto","pisell2.salesManagement.order.orderStatus.completed":"Conclu\xeddo","pisell2.salesManagement.order.orderStatus.cancelled":"Cancelado","pisell2.salesManagement.order.fulfillmentStatus.fulfilled":"Atendido","pisell2.salesManagement.order.fulfillmentStatus.unfulfilled":"N\xe3o Atendido","pisell2.salesManagement.order.fulfillmentStatus.fulfilling":"Atendendo","pisell2.salesManagement.order.fulfillmentStatus.partial_fulfilled":"Parcialmente Atendido","pisell2.salesManagement.order.deliveryType.nil":"Sem Entrega Necess\xe1ria","pisell2.salesManagement.order.deliveryType.shipping":"Envio","pisell2.salesManagement.order.deliveryType.local_delivery":"Entrega Local","pisell2.salesManagement.order.deliveryType.pickup":"Retirada","pisell2.salesManagement.order.deliveryType.shop_service":"Servi\xe7o na Loja","pisell2.salesManagement.order.shopServiceType.dine-in":"Refei\xe7\xe3o no Local","pisell2.salesManagement.order.shopServiceType.takeaway":"Para Viagem","pisell2.salesManagement.order.common.itemsCount":" itens","pisell2.salesManagement.order.common.totalAmount":"Total","pisell2.salesManagement.order.common.paidAmount":"Pago","pisell2.salesManagement.order.common.dueAmount":"Devido","pisell2.salesManagement.order.common.refundedAmount":"Reembolsado","pisell2.salesManagement.order.quickFilter.orderDate.placeholder":"Selecione a data do pedido","pisell2.salesManagement.order.filter.orderStatus.label":"Status do Pedido","pisell2.salesManagement.order.filter.orderStatus.placeholder":"Selecione o status do pedido","pisell2.salesManagement.order.filter.paymentStatus.label":"Status do Pagamento","pisell2.salesManagement.order.filter.paymentStatus.placeholder":"Selecione o status do pagamento","pisell2.salesManagement.order.filter.fulfillmentStatus.label":"Status de Atendimento","pisell2.salesManagement.order.filter.fulfillmentStatus.placeholder":"Selecione o status de atendimento","pisell2.salesManagement.order.filter.customer.label":"Cliente","pisell2.salesManagement.order.filter.customer.placeholder":"Selecione o cliente","pisell2.salesManagement.order.filter.salesChannel.label":"Canal de Vendas","pisell2.salesManagement.order.filter.salesChannel.placeholder":"Selecione o canal de vendas","pisell2.salesManagement.order.filter.paymentMethod.label":"M\xe9todo de Pagamento","pisell2.salesManagement.order.filter.paymentMethod.placeholder":"Selecione o m\xe9todo de pagamento","pisell2.salesManagement.order.filter.totalAmount.label":"Faixa de Valor do Pedido","pisell2.salesManagement.order.filter.totalAmount.placeholder":"Insira","pisell2.salesManagement.order.filter.tags.label":"Tags","pisell2.salesManagement.order.filter.tags.placeholder":"Selecione as tags","pisell2.salesManagement.order.filter.deliveryType.label":"Tipo de Entrega","pisell2.salesManagement.order.filter.deliveryType.placeholder":"Selecione o tipo de entrega","pisell2.salesManagement.order.filter.fulfillmentMethod.label":"M\xe9todo de Atendimento","pisell2.salesManagement.order.filter.fulfillmentMethod.placeholder":"Selecione o m\xe9todo de atendimento","pisell2.salesManagement.order.filter.deliveryZone.label":"Zona de Entrega","pisell2.salesManagement.order.filter.deliveryZone.placeholder":"Selecione a zona de entrega","pisell2.salesManagement.order.filter.pickupLocation.label":"Local de Retirada","pisell2.salesManagement.order.filter.pickupLocation.placeholder":"Selecione o local de retirada","pisell2.salesManagement.order.filter.trackingNumber.label":"N\xfamero de Rastreamento","pisell2.salesManagement.order.filter.trackingNumber.placeholder":"Insira o n\xfamero de rastreamento","pisell2.salesManagement.order.filter.logistics.label":"Empresa de Log\xedstica","pisell2.salesManagement.order.filter.logistics.placeholder":"Selecione a empresa de log\xedstica","pisell2.salesManagement.order.filter.zipCode.label":"CEP","pisell2.salesManagement.order.filter.zipCode.placeholder":"Insira o CEP","pisell2.salesManagement.order.sort.createdAt":"Hora de Cria\xe7\xe3o","pisell2.salesManagement.order.sort.updatedAt":"Hora de Atualiza\xe7\xe3o","pisell2.salesManagement.order.sort.totalAmount":"Valor do Pedido","pisell2.salesManagement.order.sort.customerName":"Nome do Cliente"},ja:{"pisell2.salesManagement.business.online_store":"オンラインストア","pisell2.salesManagement.business.ticket_order":"チケット注文","pisell2.salesManagement.business.appointment_booking":"予約","pisell2.salesManagement.sort.balanceDue":"未払い残高","pisell2.salesManagement.sort.oldestFirst":"古い順","pisell2.salesManagement.sort.newestFirst":"新しい順","pisell2.salesManagement.sort.latestFirst":"最新順","pisell2.salesManagement.booking.column.bookingBrief":"予約概要","pisell2.salesManagement.booking.column.serviceTime":"サービス時間","pisell2.salesManagement.booking.column.customer":"顧客","pisell2.salesManagement.booking.column.contact":"連絡先","pisell2.salesManagement.booking.column.holder":"予約者","pisell2.salesManagement.booking.column.services":"サービス","pisell2.salesManagement.booking.column.pax":"人数","pisell2.salesManagement.booking.column.resource":"リソース","pisell2.salesManagement.booking.column.forms":"フォーム","pisell2.salesManagement.booking.column.orderInfo":"注文情報","pisell2.salesManagement.booking.column.bookingId":"予約ID","pisell2.salesManagement.booking.column.orderOrigin":"注文元","pisell2.salesManagement.booking.column.updated":"更新","pisell2.salesManagement.booking.status.new":"新規","pisell2.salesManagement.booking.status.confirmed":"確認済み","pisell2.salesManagement.booking.status.arrived":"到着済み","pisell2.salesManagement.booking.status.started":"開始済み","pisell2.salesManagement.booking.status.cancelled":"キャンセル済み","pisell2.salesManagement.booking.status.no_show":"無断キャンセル","pisell2.salesManagement.booking.status.completed":"完了","pisell2.salesManagement.booking.platform.online_store":"オンラインストア","pisell2.salesManagement.booking.platform.wholesalebusiness":"卸売ビジネス","pisell2.salesManagement.booking.platform.table-order":"テーブル注文","pisell2.salesManagement.booking.platform.mobile_order":"モバイル注文","pisell2.salesManagement.booking.platform.kiosk":"キオスク","pisell2.salesManagement.booking.platform.pos":"POS","pisell2.salesManagement.booking.view-more":"もっと見る","pisell2.salesManagement.booking.common.orderNote":"注文メモ","pisell2.salesManagement.booking.common.internalNote":"内部メモ","pisell2.salesManagement.booking.common.more":"もっと見る","pisell2.salesManagement.booking.common.createdBy":"作成者","pisell2.salesManagement.booking.notes.title":"メモ","pisell2.salesManagement.booking.notes.orderNotes":"注文メモ","pisell2.salesManagement.booking.notes.internalNotes":"内部メモ","pisell2.salesManagement.booking.notes.addOrderNotes":"注文メモを追加","pisell2.salesManagement.booking.notes.addInternalNotes":"内部メモを追加","pisell2.salesManagement.booking.notes.internalVisibleOnlyTip":"チームメンバーにのみ表示されます","pisell2.salesManagement.booking.filter.bookingStatus.label":"予約ステータス","pisell2.salesManagement.booking.filter.bookingStatus.placeholder":"予約ステータスを選択してください","pisell2.salesManagement.booking.filter.bookingDate.label":"予約日時","pisell2.salesManagement.booking.filter.bookingDate.placeholder":"予約日を選択してください","pisell2.salesManagement.booking.filter.holder.label":"予約者","pisell2.salesManagement.booking.filter.holder.placeholder":"予約者を入力してください","pisell2.salesManagement.booking.filter.paxRange.label":"人数範囲","pisell2.salesManagement.booking.filter.paxRange.placeholder":"人数範囲を入力してください","pisell2.salesManagement.booking.filter.resource.label":"リソース","pisell2.salesManagement.booking.filter.resource.placeholder":"リソースを選択してください","pisell2.salesManagement.booking.filter.resource.none":"リソースなし","pisell2.salesManagement.booking.filter.salesChannel.label":"販売チャネル","pisell2.salesManagement.booking.filter.salesChannel.placeholder":"販売チャネルを選択してください","pisell2.salesManagement.booking.filter.orderAmount.label":"注文金額","pisell2.salesManagement.booking.filter.orderAmount.placeholder":"注文金額を入力してください","pisell2.salesManagement.booking.filter.orderStatus.label":"注文ステータス","pisell2.salesManagement.booking.filter.orderStatus.placeholder":"注文ステータスを選択してください","pisell2.salesManagement.booking.filter.paymentStatus.label":"支払いステータス","pisell2.salesManagement.booking.filter.paymentStatus.placeholder":"支払いステータスを選択してください","pisell2.salesManagement.booking.filter.customer.label":"顧客","pisell2.salesManagement.booking.filter.customer.placeholder":"顧客を選択してください","pisell2.salesManagement.booking.filter.includeItems.label":"含まれる商品","pisell2.salesManagement.booking.filter.includeItems.placeholder":"商品を選択してください","pisell2.salesManagement.booking.filter.paymentMethod.label":"支払い方法","pisell2.salesManagement.booking.filter.paymentMethod.placeholder":"支払い方法を選択してください","pisell2.salesManagement.booking.filter.orderDate.label":"注文日","pisell2.salesManagement.booking.filter.orderDate.placeholder":"注文日を選択してください","pisell2.salesManagement.booking.filter.updatedDate.label":"更新日","pisell2.salesManagement.booking.filter.updatedDate.placeholder":"更新日を選択してください","pisell2.salesManagement.booking.sort.afterExecutionTime":"現場実行時間","pisell2.salesManagement.booking.sort.startAt":"開始時間","pisell2.salesManagement.booking.sort.endAt":"終了時間","pisell2.salesManagement.booking.sort.createdAt":"作成時間","pisell2.salesManagement.booking.sort.updatedAt":"最終更新","pisell2.salesManagement.booking.sort.totalAmount":"合計金額","pisell2.salesManagement.booking.sort.refundedAmount":"返金額","pisell2.salesManagement.booking.sort.customerName":"顧客名","pisell2.salesManagement.order.column.saleBrief":"販売概要","pisell2.salesManagement.order.column.customer":"顧客","pisell2.salesManagement.order.column.contact":"連絡先","pisell2.salesManagement.order.column.paymentInfo":"支払い情報","pisell2.salesManagement.order.column.items":"商品","pisell2.salesManagement.order.column.paymentStatus":"支払いステータス","pisell2.salesManagement.order.column.orderOrigin":"注文元","pisell2.salesManagement.order.column.shippingMethod":"配送方法","pisell2.salesManagement.order.column.orderStatus":"注文ステータス","pisell2.salesManagement.order.column.fulfillmentStatus":"処理ステータス","pisell2.salesManagement.order.column.updated":"更新","pisell2.salesManagement.order.column.orderId":"セールスID","pisell2.salesManagement.order.common.orderNote":"注文メモ","pisell2.salesManagement.order.common.internalNote":"内部メモ","pisell2.salesManagement.order.common.createdBy":"作成者","pisell2.salesManagement.order.common.guest":"ゲスト","pisell2.salesManagement.order.common.walkIn":"Walk-in"},pt:{"pisell2.salesManagement.business.online_store":"Loja Online","pisell2.salesManagement.business.ticket_order":"Pedido de Ingresso","pisell2.salesManagement.business.appointment_booking":"Reserva de Agendamento","pisell2.salesManagement.sort.balanceDue":"Saldo Devido","pisell2.salesManagement.sort.oldestFirst":"Mais Antigos Primeiro","pisell2.salesManagement.sort.newestFirst":"Mais Recentes Primeiro","pisell2.salesManagement.sort.latestFirst":"Mais Recentes Primeiro","pisell2.salesManagement.booking.column.bookingBrief":"Resumo da Reserva","pisell2.salesManagement.booking.column.serviceTime":"Hor\xe1rio do Servi\xe7o","pisell2.salesManagement.booking.column.customer":"Cliente","pisell2.salesManagement.booking.column.contact":"Contato","pisell2.salesManagement.booking.column.holder":"Titular","pisell2.salesManagement.booking.column.services":"Servi\xe7os","pisell2.salesManagement.booking.column.pax":"Pessoas","pisell2.salesManagement.booking.column.resource":"Recurso","pisell2.salesManagement.booking.column.forms":"Formul\xe1rios","pisell2.salesManagement.booking.column.orderInfo":"Informa\xe7\xf5es do Pedido","pisell2.salesManagement.booking.column.bookingId":"ID da Reserva","pisell2.salesManagement.booking.column.orderOrigin":"Origem do Pedido","pisell2.salesManagement.booking.column.updated":"Atualizado","pisell2.salesManagement.booking.status.new":"Novo","pisell2.salesManagement.booking.status.confirmed":"Confirmado","pisell2.salesManagement.booking.status.arrived":"Chegou","pisell2.salesManagement.booking.status.started":"Iniciado","pisell2.salesManagement.booking.status.cancelled":"Cancelado","pisell2.salesManagement.booking.status.no_show":"N\xe3o compareceu","pisell2.salesManagement.booking.status.completed":"Conclu\xeddo","pisell2.salesManagement.booking.platform.online_store":"Loja Online","pisell2.salesManagement.booking.platform.wholesalebusiness":"Neg\xf3cio Atacadista","pisell2.salesManagement.booking.platform.table-order":"Pedido na Mesa","pisell2.salesManagement.booking.platform.mobile_order":"Pedido M\xf3vel","pisell2.salesManagement.booking.platform.kiosk":"Quiosque","pisell2.salesManagement.booking.platform.pos":"POS","pisell2.salesManagement.booking.view-more":"Ver mais","pisell2.salesManagement.booking.common.orderNote":"Nota do Pedido","pisell2.salesManagement.booking.common.internalNote":"Nota Interna","pisell2.salesManagement.booking.common.more":"mais","pisell2.salesManagement.booking.common.createdBy":"Criado por","pisell2.salesManagement.booking.notes.title":"Notas","pisell2.salesManagement.booking.notes.orderNotes":"Notas do pedido","pisell2.salesManagement.booking.notes.internalNotes":"Notas internas","pisell2.salesManagement.booking.notes.addOrderNotes":"Adicionar nota do pedido","pisell2.salesManagement.booking.notes.addInternalNotes":"Adicionar nota interna","pisell2.salesManagement.booking.notes.internalVisibleOnlyTip":"Vis\xedvel apenas para membros da sua equipe","pisell2.salesManagement.booking.filter.bookingStatus.label":"Status da Reserva","pisell2.salesManagement.booking.filter.bookingStatus.placeholder":"Selecione o status da reserva","pisell2.salesManagement.booking.filter.bookingDate.label":"Data e Hora da Reserva","pisell2.salesManagement.booking.filter.bookingDate.placeholder":"Selecione a data da reserva","pisell2.salesManagement.booking.filter.holder.label":"Titular","pisell2.salesManagement.booking.filter.holder.placeholder":"Insira o titular","pisell2.salesManagement.booking.filter.paxRange.label":"Faixa de Pessoas","pisell2.salesManagement.booking.filter.paxRange.placeholder":"Insira a faixa de pessoas","pisell2.salesManagement.booking.filter.resource.label":"Recurso","pisell2.salesManagement.booking.filter.resource.placeholder":"Selecione o recurso","pisell2.salesManagement.booking.filter.resource.none":"Sem Recurso","pisell2.salesManagement.booking.filter.salesChannel.label":"Canal de Vendas","pisell2.salesManagement.booking.filter.salesChannel.placeholder":"Selecione o canal de vendas","pisell2.salesManagement.booking.filter.orderAmount.label":"Valor do Pedido","pisell2.salesManagement.booking.filter.orderAmount.placeholder":"Insira o valor do pedido","pisell2.salesManagement.booking.filter.orderStatus.label":"Status do Pedido","pisell2.salesManagement.booking.filter.orderStatus.placeholder":"Selecione o status do pedido","pisell2.salesManagement.booking.filter.paymentStatus.label":"Status do Pagamento","pisell2.salesManagement.booking.filter.paymentStatus.placeholder":"Selecione o status do pagamento","pisell2.salesManagement.booking.filter.customer.label":"Cliente","pisell2.salesManagement.booking.filter.customer.placeholder":"Selecione o cliente","pisell2.salesManagement.booking.filter.includeItems.label":"Itens Inclu\xeddos","pisell2.salesManagement.booking.filter.includeItems.placeholder":"Selecione os itens","pisell2.salesManagement.booking.filter.paymentMethod.label":"M\xe9todo de Pagamento","pisell2.salesManagement.booking.filter.paymentMethod.placeholder":"Selecione o m\xe9todo de pagamento","pisell2.salesManagement.booking.filter.orderDate.label":"Data do Pedido","pisell2.salesManagement.booking.filter.orderDate.placeholder":"Selecione a data do pedido","pisell2.salesManagement.booking.filter.updatedDate.label":"Data de Atualiza\xe7\xe3o","pisell2.salesManagement.booking.filter.updatedDate.placeholder":"Selecione a data de atualiza\xe7\xe3o","pisell2.salesManagement.booking.sort.afterExecutionTime":"Ap\xf3s o Hor\xe1rio de Execu\xe7\xe3o","pisell2.salesManagement.booking.sort.startAt":"Hora de In\xedcio","pisell2.salesManagement.booking.sort.endAt":"Hora de T\xe9rmino","pisell2.salesManagement.booking.sort.createdAt":"Hora de Cria\xe7\xe3o","pisell2.salesManagement.booking.sort.updatedAt":"\xdaltima Atualiza\xe7\xe3o","pisell2.salesManagement.booking.sort.totalAmount":"Valor Total","pisell2.salesManagement.booking.sort.refundedAmount":"Valor Reembolsado","pisell2.salesManagement.booking.sort.customerName":"Nome do Cliente","pisell2.salesManagement.order.column.saleBrief":"Resumo da Venda","pisell2.salesManagement.order.column.customer":"Cliente","pisell2.salesManagement.order.column.contact":"Contato","pisell2.salesManagement.order.column.paymentInfo":"Informa\xe7\xf5es de Pagamento","pisell2.salesManagement.order.column.items":"Itens","pisell2.salesManagement.order.column.paymentStatus":"Status do Pagamento","pisell2.salesManagement.order.column.orderOrigin":"Origem do Pedido","pisell2.salesManagement.order.column.shippingMethod":"M\xe9todo de Envio","pisell2.salesManagement.order.column.orderStatus":"Status do Pedido","pisell2.salesManagement.order.column.fulfillmentStatus":"Status de Atendimento","pisell2.salesManagement.order.column.updated":"Atualizado","pisell2.salesManagement.order.column.orderId":"ID de Venda","pisell2.salesManagement.order.common.orderNote":"Nota do Pedido","pisell2.salesManagement.order.common.internalNote":"Nota Interna","pisell2.salesManagement.order.common.createdBy":"Criado por","pisell2.salesManagement.order.common.guest":"Convidado","pisell2.salesManagement.order.common.walkIn":"Walk-in"}},eWN="pisell-reservation.venue-wall-page.v1",eWC="pisell-reservation.table-page.v1",eWT={start:"02:00",end:"02:00"},eWP={en:{...eVJ.en,...eWM.en,...eUF},"zh-CN":{...eVJ["zh-CN"],...eWM["zh-CN"],...eUB},"zh-HK":{...eVJ["zh-HK"],...eWM["zh-HK"],...eUH},ja:{...eVJ.ja??{},...eWM.ja??{},"pisell-reservation.page-title":"予約","pisell-reservation.page-title-venue":"会場オペレーション","pisell-reservation.new":"+ 新規","pisell-reservation.new-modal-title":"新規","pisell-reservation.new-modal-placeholder":"利用できるルートがありません","pisell-reservation.cancel":"キャンセル","pisell-reservation.edit-map":"フロア図を編集","pisell-reservation.edit-map-done":"編集を完了","pisell-reservation.floor-map-appearance-dark":"暗い背景","pisell-reservation.floor-map-appearance-light":"明るい背景","pisell-reservation.follow-current":"現在","pisell-reservation.view-grid":"表","pisell-reservation.view-floor":"フロア図","pisell-reservation.view-calendar":"カレンダー","pisell-reservation.view-resource-wall":"ウォール","pisell-reservation.resource-wall-resources":"ウォール表示リソース","pisell-reservation.payment-status-bucket-unpaid":"未払い","pisell-reservation.payment-status-bucket-paid":"支払済み","pisell-reservation.booking-status-bucket-on-site":"来店中","pisell-reservation.booking-status-bucket-no-show":"不来店","pisell-reservation.booking-status-bucket-completed":"完了","pisell-reservation.calendar-granularity-resource":"リソース","pisell-reservation.calendar-granularity-day":"日","pisell-reservation.calendar-granularity-week":"週","pisell-reservation.calendar-granularity-month":"月","pisell-reservation.calendar-write-not-available":"この操作はまだ利用できません。フロア図または表で操作してください。","pisell-reservation.follow-live-time":"現在時刻","pisell-reservation.follow-custom-time":"カスタム時刻","pisell-reservation.follow-live-hint":"現在時刻に追従しています","pisell-reservation.follow-custom-hint":"カスタム時刻を使用しています","pisell-reservation.switch-to-custom-time":"カスタム時刻に切り替え","pisell-reservation.switch-to-live-time":"現在時刻に切り替え","pisell-reservation.non-current-hint":"現在時刻ではありません","pisell-reservation.at-current-time":"現在時刻を表示中です","pisell-reservation.at-current-time-short":"現在","pisell-reservation.go-current":"現在へ","pisell-reservation.schedule-data-loading":"予約データを読み込み中…","pisell-reservation.hud-open-table-aria":"フロアマップ上のバインド済みリソース一覧を開く","pisell-reservation.hud-table-drawer-title":"マップ上のリソース","pisell-reservation.hud-drawer-resource-canvas-placeholder":"キャンバス(エリア)で絞り込み","pisell-reservation.hud-sheet-close-aria":"リソース一覧を閉じる","pisell-reservation.hud-expand-aria":"リソース一覧を展開","pisell-reservation.hud-collapse-aria":"リソース一覧を閉じる","pisell-reservation.grid.code":"卓番","pisell-reservation.grid.area":"エリア","pisell-reservation.grid.status":"状態","pisell-reservation.grid.guest":"ゲスト","pisell-reservation.grid.time":"時間","pisell-reservation.grid.party":"人数","pisell-reservation.canvas.main":"メインエリア","pisell-reservation.canvas.secondary":"サブエリア","pisell-reservation.canvas.vip":"VIP エリア","pisell-reservation.maintenance":"メンテナンス中","pisell-reservation.next":"次","pisell-reservation.party":"名","pisell-reservation.more":"その他","pisell-reservation.late":"遅刻","pisell-reservation.floor-hud.total":"合計","pisell-reservation.floor-hud.interactive-title":"本日売上","pisell-reservation.floor-map.data-source-label":"リソース","pisell-reservation.floor-map.category-background":"装飾","pisell-reservation.floor-map.palette-image-bg":"画像(背景)","pisell-reservation.floor-plan.save-failed":"フロア図の保存に失敗しました","pisell-reservation.card-placeholder.hint-select-row":"データソースは選択済みです。サイドバーで行を選択してください。","pisell-reservation.card-placeholder.hint-bind-datasource":"行が未連携です。サイドバーでデータソースとレコードを選択してください。","pisell-reservation.card-placeholder.hint-new-slot":"新しい卓のプレースホルダーです。サイドバーでレコードを紐付けられます。","pisell-reservation.card-placeholder.hint-row-not-found":"レコードが見つかりません。連携とデータ一覧を確認してください。","pisell-reservation.resource-grid.id":"ID","pisell-reservation.resource-grid.name":"名称","pisell-reservation.resource-grid.form-code":"フォームコード","pisell-reservation.resource-grid.capacity":"収容人数","pisell-reservation.resource-grid.schedule":"スケジュール","pisell-reservation.resource-grid.form-id":"フォーム ID","pisell-reservation.resource-grid.card-status":"カード状態","pisell-reservation.room-kind-bound":"リソース(紐付け済み)","pisell-reservation.room-kind-bound-round":"丸テーブル(紐付け)","pisell-reservation.room-status-occupied":"使用中","pisell-reservation.room-status-reserved":"予約済み","pisell-reservation.room-status-empty":"空席","pisell-reservation.room-status-locked":"ロック","pisell-reservation.room-empty-body":"予約なし","pisell-reservation.room-status-unbound":"未連携","pisell-reservation.room-paid":"支払済み","pisell-reservation.room-unpaid":"未払い","pisell-reservation.room-payment-needed":"会計","pisell-reservation.room-items-total":"商品 {n} 点","pisell-reservation.room-items-summary":"{items} 点 \xb7 合計 {qty} 個","pisell-reservation.room-modal-bookings":"予約 {n} 件","pisell-reservation.room-cap-prefix":"定員","pisell-reservation.room-time-end":"終了","pisell-reservation.room-time-start":"開始","pisell-reservation.room-in-minutes":"あと {d}","pisell-reservation.room-view-all":"予約 {n} 件をすべて表示","pisell-reservation.room-occupancy-sum":"人数 {current}/{capacity}","pisell-reservation.room-next-prefix":"次枠","pisell-reservation.room-guest-unknown":"ゲスト","pisell-reservation.room-collapse":"折りたたむ","pisell-reservation.booking-detail.modal-title":"詳細","pisell-reservation.booking-detail.booking-id":"予約番号","pisell-reservation.booking-detail.status":"状態","pisell-reservation.booking-detail.contact":"ゲスト","pisell-reservation.booking-detail.phone":"電話","pisell-reservation.booking-detail.time":"時間","pisell-reservation.booking-detail.staff":"スタッフ","pisell-reservation.booking-detail.staff-unassigned":"未割当","pisell-reservation.booking-detail.table":"卓","pisell-reservation.booking-detail.payment":"支払い","pisell-reservation.booking-detail.total":"合計","pisell-reservation.booking-detail.tab-info":"情報","pisell-reservation.booking-detail.tab-notes":"メモ","pisell-reservation.booking-detail.tab-form":"フォーム","pisell-reservation.booking-detail.empty-notes":"メモなし","pisell-reservation.booking-detail.empty-items":"明細なし","pisell-reservation.booking-detail.empty-tab-bookings":"売上がありません","pisell-reservation.booking-detail.empty-form":"追加項目なし","pisell-reservation.booking-detail.header-close":"閉じる","pisell-reservation.booking-detail.header-new-order":"新規注文","pisell-reservation.booking-detail.tabs-aria":"予約詳細タブ","pisell-reservation.booking-detail.tab-current-occupied":"現在利用中","pisell-reservation.booking-detail.tab-ended":"終了済み","pisell-reservation.booking-detail.tab-unpaid":"未払い","pisell-reservation.booking-detail.booking-label":"予約","pisell-reservation.booking-detail.strip-items-total":"{count} 点 注文合計:{total}","pisell-reservation.booking-detail.strip-due-label":"お支払い:","pisell-reservation.booking-detail.see-all":"すべて表示","pisell-reservation.booking-detail.header-mode-aria":"詳細ヘッダー表示","pisell-reservation.booking-detail.header-mode-order-strip":"情報バー","pisell-reservation.booking-detail.header-mode-room-card":"ルームカード","pisell-reservation.booking-detail.action-grid-aria":"操作","pisell-reservation.booking-detail.action-edit":"編集","pisell-reservation.booking-detail.action-cart":"会計","pisell-reservation.booking-detail.action-paid":"支払済み","pisell-reservation.booking-detail.action-print":"領収書印刷","pisell-reservation.booking-detail.action-form":"リソース変更","pisell-reservation.booking-detail.action-list":"注文詳細","pisell-reservation.booking-detail.action-close":"キャンセル","pisell-reservation.booking-detail.action-start":"開始","pisell-reservation.booking-detail.action-complete":"完了","pisell-reservation.booking-detail.resource-already-bound":"この注文はすでにこのリソースに紐付いています。別のリソースを選択してください。","pisell-reservation.booking-detail.resource-type-mismatch":"リソース種別が一致しません。別のリソースを選択してください。","pisell-reservation.select-resource.title":"リソースを選択","pisell-reservation.booking-detail.confirm-close-title":"取り消しますか?","pisell-reservation.booking-detail.confirm-close-ok":"確定","pisell-reservation.booking-detail.confirm-close-cancel":"やめる","pisell-reservation.booking-detail.confirm-close-content":"この操作は元に戻せません。","pisell-reservation.booking-detail.confirm-start-title":"今すぐ開始しますか?","pisell-reservation.booking-detail.confirm-start-ok":"開始","pisell-reservation.booking-detail.confirm-start-cancel":"キャンセル","pisell-reservation.booking-detail.confirm-start-content":"続行する前に確認してください。","pisell-reservation.booking-detail.confirm-complete-title":"完了にしますか?","pisell-reservation.booking-detail.confirm-complete-ok":"完了","pisell-reservation.booking-detail.confirm-complete-cancel":"キャンセル","pisell-reservation.booking-detail.confirm-complete-content":"この予約を終了する前に確認してください。","pisell-reservation.booking-detail.to-pay":"お支払い","pisell-reservation.booking-detail.order-open":"未会計","pisell-reservation.booking-detail.order-already-paid":"注文は既に支払済みです","pisell-reservation.booking-detail.meta-host-status":"カード上の状態","pisell-reservation.booking-detail.meta-line-amount":"注文金額","pisell-reservation.booking-detail.meta-timeout":"超過","pisell-reservation.booking-detail.meta-progress":"進行状況","pisell-reservation.booking-detail.meta-arrival":"開始まで","pisell-reservation.booking-detail.status-enum.started":"開始済み","pisell-reservation.booking-detail.status-enum.confirmed":"確定","pisell-reservation.booking-detail.status-enum.active":"進行中","pisell-reservation.booking-detail.status-enum.checked_in":"チェックイン済","pisell-reservation.booking-detail.status-enum.checkin":"チェックイン","pisell-reservation.booking-detail.status-enum.in_progress":"進行中","pisell-reservation.booking-detail.status-enum.pending":"保留","pisell-reservation.booking-detail.status-enum.pending_payment":"未払い","pisell-reservation.booking-detail.status-enum.draft":"下書き","pisell-reservation.booking-detail.status-enum.waiting":"待機","pisell-reservation.booking-detail.status-enum.hold":"保留","pisell-reservation.booking-detail.status-enum.cancelled":"キャンセル","pisell-reservation.booking-detail.status-enum.canceled":"キャンセル","pisell-reservation.booking-detail.status-enum.void":"無効","pisell-reservation.booking-detail.status-enum.refunded":"返金済"},pt:{...eVJ.pt??{},...eWM.pt??{},"pisell-reservation.page-title":"Reserva","pisell-reservation.page-title-venue":"Controlo do espa\xe7o","pisell-reservation.new":"+ Novo","pisell-reservation.new-modal-title":"Novo","pisell-reservation.new-modal-placeholder":"Sem rotas dispon\xedveis","pisell-reservation.cancel":"Cancelar","pisell-reservation.edit-map":"Editar planta","pisell-reservation.edit-map-done":"Concluir edi\xe7\xe3o","pisell-reservation.floor-map-appearance-dark":"Fundo escuro","pisell-reservation.floor-map-appearance-light":"Fundo claro","pisell-reservation.follow-current":"Actual","pisell-reservation.view-grid":"Tabela","pisell-reservation.view-floor":"Planta","pisell-reservation.view-calendar":"Calend\xe1rio","pisell-reservation.view-resource-wall":"Painel","pisell-reservation.resource-wall-resources":"Recursos no painel","pisell-reservation.payment-status-bucket-unpaid":"N\xe3o pago","pisell-reservation.payment-status-bucket-paid":"Pago","pisell-reservation.booking-status-bucket-on-site":"No local","pisell-reservation.booking-status-bucket-no-show":"N\xe3o compareceu","pisell-reservation.booking-status-bucket-completed":"Conclu\xeddo","pisell-reservation.calendar-granularity-resource":"Recursos","pisell-reservation.calendar-granularity-day":"Dia","pisell-reservation.calendar-granularity-week":"Semana","pisell-reservation.calendar-granularity-month":"M\xeas","pisell-reservation.calendar-write-not-available":"Esta a\xe7\xe3o ainda n\xe3o est\xe1 dispon\xedvel. Utilize a planta ou a tabela.","pisell-reservation.follow-live-time":"Hora actual","pisell-reservation.follow-custom-time":"Hora personalizada","pisell-reservation.follow-live-hint":"A seguir a hora actual","pisell-reservation.follow-custom-hint":"A usar hora personalizada","pisell-reservation.switch-to-custom-time":"Mudar para hora personalizada","pisell-reservation.switch-to-live-time":"Mudar para hora actual","pisell-reservation.non-current-hint":"N\xe3o est\xe1 na hora actual","pisell-reservation.at-current-time":"Est\xe1 na hora actual","pisell-reservation.at-current-time-short":"Agora","pisell-reservation.go-current":"Ir para actual","pisell-reservation.schedule-data-loading":"A carregar reservas…","pisell-reservation.hud-open-table-aria":"Abrir tabela de recursos ligados na planta","pisell-reservation.hud-table-drawer-title":"Recursos no mapa","pisell-reservation.hud-drawer-resource-canvas-placeholder":"Filtrar por \xe1rea (canvas)","pisell-reservation.hud-sheet-close-aria":"Fechar lista de recursos","pisell-reservation.hud-expand-aria":"Expandir lista de recursos","pisell-reservation.hud-collapse-aria":"Fechar lista de recursos","pisell-reservation.grid.code":"Mesa","pisell-reservation.grid.area":"Zona","pisell-reservation.grid.status":"Estado","pisell-reservation.grid.guest":"Cliente","pisell-reservation.grid.time":"Hora","pisell-reservation.grid.party":"Pessoas","pisell-reservation.canvas.main":"Zona principal","pisell-reservation.canvas.secondary":"Zona secund\xe1ria","pisell-reservation.canvas.vip":"Zona VIP","pisell-reservation.maintenance":"Em manuten\xe7\xe3o","pisell-reservation.next":"SEGUINTE","pisell-reservation.party":"pessoas","pisell-reservation.more":"mais","pisell-reservation.late":"atraso","pisell-reservation.floor-hud.total":"Total","pisell-reservation.floor-hud.interactive-title":"Vendas de hoje","pisell-reservation.floor-map.data-source-label":"Recurso","pisell-reservation.floor-map.category-background":"Decora\xe7\xf5es","pisell-reservation.floor-map.palette-image-bg":"Imagem (fundo)","pisell-reservation.floor-plan.save-failed":"Falha ao guardar a planta","pisell-reservation.card-placeholder.hint-select-row":"Fonte de dados seleccionada. Escolha uma linha na barra lateral.","pisell-reservation.card-placeholder.hint-bind-datasource":"Sem linha ligada: seleccione fonte e registo na barra lateral.","pisell-reservation.card-placeholder.hint-new-slot":"Marcador de nova mesa. Pode ligar um registo na barra lateral.","pisell-reservation.card-placeholder.hint-row-not-found":"Registo n\xe3o encontrado: verifique a liga\xe7\xe3o ou a lista.","pisell-reservation.resource-grid.id":"ID","pisell-reservation.resource-grid.name":"Nome","pisell-reservation.resource-grid.form-code":"C\xf3digo do formul\xe1rio","pisell-reservation.resource-grid.capacity":"Capacidade","pisell-reservation.resource-grid.schedule":"Agenda","pisell-reservation.resource-grid.form-id":"ID do formul\xe1rio","pisell-reservation.resource-grid.card-status":"Estado do cart\xe3o","pisell-reservation.room-kind-bound":"Recurso ligado","pisell-reservation.room-kind-bound-round":"Mesa redonda (ligada)","pisell-reservation.room-status-occupied":"Ocupada","pisell-reservation.room-status-reserved":"Reservada","pisell-reservation.room-status-empty":"Livre","pisell-reservation.room-status-locked":"Bloqueada","pisell-reservation.room-empty-body":"Sem reservas","pisell-reservation.room-status-unbound":"Sem liga\xe7\xe3o","pisell-reservation.room-paid":"Pago","pisell-reservation.room-unpaid":"N\xe3o pago","pisell-reservation.room-payment-needed":"Cobrar","pisell-reservation.room-items-total":"Total {n} itens","pisell-reservation.room-items-summary":"{items} itens \xb7 {qty} un.","pisell-reservation.room-modal-bookings":"{n} reservas","pisell-reservation.room-cap-prefix":"Cap.","pisell-reservation.room-time-end":"Fim","pisell-reservation.room-time-start":"In\xedcio","pisell-reservation.room-in-minutes":"em {d}","pisell-reservation.room-view-all":"Ver todas as {n} reservas","pisell-reservation.room-occupancy-sum":"Pessoas {current}/{capacity}","pisell-reservation.room-next-prefix":"Seguinte","pisell-reservation.room-guest-unknown":"Cliente","pisell-reservation.room-collapse":"Recolher","pisell-reservation.booking-detail.modal-title":"Detalhes","pisell-reservation.booking-detail.booking-id":"ID da reserva","pisell-reservation.booking-detail.status":"Estado","pisell-reservation.booking-detail.contact":"Cliente","pisell-reservation.booking-detail.phone":"Telefone","pisell-reservation.booking-detail.time":"Hora","pisell-reservation.booking-detail.staff":"Staff","pisell-reservation.booking-detail.staff-unassigned":"N\xe3o atribu\xeddo","pisell-reservation.booking-detail.table":"Mesa","pisell-reservation.booking-detail.payment":"Pagamento","pisell-reservation.booking-detail.total":"Total","pisell-reservation.booking-detail.tab-info":"Info","pisell-reservation.booking-detail.tab-notes":"Notas","pisell-reservation.booking-detail.tab-form":"Formul\xe1rio","pisell-reservation.booking-detail.empty-notes":"Sem notas","pisell-reservation.booking-detail.empty-items":"Sem linhas","pisell-reservation.booking-detail.empty-tab-bookings":"Sem vendas","pisell-reservation.booking-detail.empty-form":"Sem campos extra","pisell-reservation.booking-detail.header-close":"Fechar","pisell-reservation.booking-detail.header-new-order":"Novo pedido","pisell-reservation.booking-detail.tabs-aria":"Abas do detalhe da reserva","pisell-reservation.booking-detail.tab-current-occupied":"Em uso agora","pisell-reservation.booking-detail.tab-ended":"Encerrados","pisell-reservation.booking-detail.tab-unpaid":"N\xe3o pagos","pisell-reservation.booking-detail.booking-label":"Reserva","pisell-reservation.booking-detail.strip-items-total":"{count} itens Total do pedido : {total}","pisell-reservation.booking-detail.strip-due-label":"A pagar:","pisell-reservation.booking-detail.see-all":"Ver tudo","pisell-reservation.booking-detail.header-mode-aria":"Vista do cabe\xe7alho","pisell-reservation.booking-detail.header-mode-order-strip":"Resumo","pisell-reservation.booking-detail.header-mode-room-card":"Cart\xe3o da mesa","pisell-reservation.booking-detail.action-grid-aria":"A\xe7\xf5es da reserva","pisell-reservation.booking-detail.action-edit":"Editar","pisell-reservation.booking-detail.action-cart":"Checkout","pisell-reservation.booking-detail.action-paid":"Pago","pisell-reservation.booking-detail.action-print":"Imprimir recibos","pisell-reservation.booking-detail.action-form":"Alterar recurso","pisell-reservation.booking-detail.action-list":"Detalhe do pedido","pisell-reservation.booking-detail.action-close":"Cancelar","pisell-reservation.booking-detail.action-start":"Iniciar","pisell-reservation.booking-detail.action-complete":"Concluir","pisell-reservation.booking-detail.resource-already-bound":"Este pedido j\xe1 est\xe1 associado a este recurso. Selecione outro recurso.","pisell-reservation.booking-detail.resource-type-mismatch":"O tipo de recurso n\xe3o corresponde. Selecione outro recurso.","pisell-reservation.select-resource.title":"Seleccionar recurso","pisell-reservation.booking-detail.confirm-close-title":"Deseja cancelar?","pisell-reservation.booking-detail.confirm-close-ok":"Confirmar","pisell-reservation.booking-detail.confirm-close-cancel":"Desistir","pisell-reservation.booking-detail.confirm-close-content":"Esta a\xe7\xe3o n\xe3o pode ser desfeita.","pisell-reservation.booking-detail.confirm-start-title":"Come\xe7ar agora?","pisell-reservation.booking-detail.confirm-start-ok":"Iniciar","pisell-reservation.booking-detail.confirm-start-cancel":"Cancelar","pisell-reservation.booking-detail.confirm-start-content":"Confirme antes de continuar.","pisell-reservation.booking-detail.confirm-complete-title":"Concluir?","pisell-reservation.booking-detail.confirm-complete-ok":"Concluir","pisell-reservation.booking-detail.confirm-complete-cancel":"Cancelar","pisell-reservation.booking-detail.confirm-complete-content":"Confirme antes de encerrar esta reserva.","pisell-reservation.booking-detail.to-pay":"A pagar","pisell-reservation.booking-detail.order-open":"Aberto","pisell-reservation.booking-detail.order-already-paid":"Pedido j\xe1 pago.","pisell-reservation.booking-detail.meta-host-status":"Estado no cart\xe3o","pisell-reservation.booking-detail.meta-line-amount":"Valor do pedido","pisell-reservation.booking-detail.meta-timeout":"Excesso de tempo","pisell-reservation.booking-detail.meta-progress":"Progresso","pisell-reservation.booking-detail.meta-arrival":"At\xe9 o in\xedcio","pisell-reservation.booking-detail.status-enum.started":"Iniciado","pisell-reservation.booking-detail.status-enum.confirmed":"Confirmado","pisell-reservation.booking-detail.status-enum.active":"Ativo","pisell-reservation.booking-detail.status-enum.checked_in":"Check-in","pisell-reservation.booking-detail.status-enum.checkin":"Check-in","pisell-reservation.booking-detail.status-enum.in_progress":"Em curso","pisell-reservation.booking-detail.status-enum.pending":"Pendente","pisell-reservation.booking-detail.status-enum.pending_payment":"Pagamento pendente","pisell-reservation.booking-detail.status-enum.draft":"Rascunho","pisell-reservation.booking-detail.status-enum.waiting":"Em espera","pisell-reservation.booking-detail.status-enum.hold":"Em espera","pisell-reservation.booking-detail.status-enum.cancelled":"Cancelado","pisell-reservation.booking-detail.status-enum.canceled":"Cancelado","pisell-reservation.booking-detail.status-enum.void":"Anulado","pisell-reservation.booking-detail.status-enum.refunded":"Reembolsado"}},eWA="pisell-reservation.hud-table-drawer-title",eWD="pisell-reservation.resource-wall-resources",eWI="pisell-reservation.resource-wall-filter",eWE=["resource_wall_resource_ids"],eWz="pisell-reservation.at-current-time",eWL="pisell-reservation.go-current",eWO=new Set(["booking_ticket","sales2"]);function eWR(e){let t=null==e?void 0:e.type;return"start_time"!==t&&"end_time"!==t?null:function(e){let t=e.trim();if(!t)return null;let l=t.split(":").map(e=>e.trim()),a=Number(l[0]),i=Number(l[1]??"0"),n=Number(l[2]??"0");return!Number.isFinite(a)||!Number.isFinite(i)||!Number.isFinite(n)||a<0||a>23||i<0||i>59||n<0||n>59?null:`${String(a).padStart(2,"0")}:${String(i).padStart(2,"0")}`}(String((null==e?void 0:e.time)??""))}let eW$=[];function eWF(e){return eWR(e)??eWT.start}function eWB(e,t){let[l,a]=t.split(":"),i=Number(l),n=Number(a??"0");return e.hour(i).minute(n).second(0).millisecond(0)}function eWH(e){return"end_time"===String((null==e?void 0:e.type)??"")}function eWq(e,t){let l,a,i,n,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eWT,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:em()(),o=em()(e).startOf("day");if(o.isSame(r.startOf("day"),"day")){let e=(0,lL.pickReferenceDateContainingNow)(s,r);return(0,lL.getRangeBounds)(s,e)}return l=eWF(t),a=o.startOf("day"),n=(i=eWB(eWH(t)?a.subtract(1,"day"):a,l)).add(1,"day"),[i,n]}function eWV(e){return[em()(e[0]).format("YYYY-MM-DD HH:mm:ss"),em()(e[1]).subtract(1,"second").format("YYYY-MM-DD HH:mm:ss")]}function eWY(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eWT,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:em()();return eWV(eWq(e,t,l,a))}function eWU(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:em()(),t=arguments.length>1?arguments[1]:void 0,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eWT,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:em()();return{filter:{values:{order_payment_status:eVO,booking_time_start_between:eWY(e.startOf("day"),t,l,a)}}}}function eWW(e,t){var l,a;let i=(null==t?void 0:t.listPageSize)??50,n=(null==t?void 0:t.getInitialSearchParams)??(()=>eWU(em()())),s=null==t?void 0:t.extraRequestParams,r=(null==t?void 0:t.subscribeRealtimePush)??!0,[o,d]=(0,ef.useState)({pageNumber:1,pageSize:i}),[c,u]=(0,ef.useState)(()=>n()),p=(0,ef.useRef)((0,eH.LP)()),m=(0,ef.useRef)(null),g=(0,ef.useRef)(null),h=(0,ef.useRef)(null),v=(0,ef.useRef)(!0),[f,y]=(0,ef.useState)(0);(0,ef.useEffect)(()=>(v.current=!0,()=>{v.current=!1,null!=h.current&&(cancelAnimationFrame(h.current),h.current=null),g.current=null}),[]);let x=(0,ef.useMemo)(()=>{let{keyword:e,filter:t,sort:l}=c;return{keyword:e,sort:l,...(null==t?void 0:t.values)||{},...null!=s?s:{},skip:o.pageNumber,num:o.pageSize}},[c,o.pageNumber,o.pageSize,s]),b=rP(i0(async e=>r?eVV(e,{osServer:!0,subscriberId:p.current,callback:e=>{let t=(null==e?void 0:e.data)??e;null!=t&&Array.isArray(t.list)&&(g.current=t,null==h.current&&(h.current=requestAnimationFrame(()=>{var e;h.current=null;let t=g.current;g.current=null,null!=t&&v.current&&(null==(e=m.current)||e.call(m,eVq(t)),y(e=>e+1))})))}}):eVV(e,{osServer:!0})),{manual:!0});m.current=b.mutate,(0,ef.useEffect)(()=>{e&&b.run(x)},[e,x]),(0,ef.useEffect)(()=>{if(!e||!r)return;let t=p.current;return()=>{eVU(t)}},[e,r]);let _=(0,ef.useCallback)((e,t)=>{e<1||t<1||d({pageNumber:e,pageSize:t})},[]),k=(0,ef.useCallback)(e=>{u(e||{}),d(e=>({...e,pageNumber:1}))},[]),w=(0,ef.useCallback)(()=>{u(n()),d(e=>({...e,pageNumber:1}))},[n]),j=(0,ef.useCallback)(e=>{u(t=>e({...t})),d(e=>({...e,pageNumber:1}))},[]),S=(0,ef.useCallback)(()=>{b.run(x)},[b,x]),M=(0,ef.useCallback)(()=>b.runAsync(x),[b,x]),N=null==(l=b.data)?void 0:l.list,C=(0,ef.useMemo)(()=>Array.isArray(N)&&0!==N.length?N:eW$,[N]),T=(null==(a=b.data)?void 0:a.count)??0;return{data:C,loading:b.loading,total:T,pagination:o,onPageChange:_,searchParams:c,onSearch:k,onReset:w,refresh:S,refreshAsync:M,patchSearchParams:j,pushDataVersion:f}}function eWG(e){let t=String(e.status??e.booking_status??e.order_status??"").trim().toLowerCase();return!!t&&("empty"===t||"reserved"!==t&&"occupied"!==t&&"locked"!==t)}function eWQ(e,t){if(!e)return;let l=e.relation_id;"number"==typeof l&&l>0?t.add(String(Math.trunc(l))):"string"==typeof l&&""!==l&&"0"!==l&&t.add(l);let a=e.children;if(Array.isArray(a))for(let e of a)eWQ(e,t)}function eWK(e){let t=new Set,l=e.event_resources;if(Array.isArray(l))for(let e of l)eWQ(e,t);let a=e.resources;if(Array.isArray(a))for(let e of a)eWQ(e,t);return[...t]}function eWJ(e){let t=e.metadata;if((null==t?void 0:t.multiple_resource_flag)!==1)return!1;let l=e.product_uid;if(null!=l&&""!==String(l))return!1;let a=e.resources;return!Array.isArray(a)||0===a.length}function eWZ(e){let t=e.relation_form_name;if(t)return t;let l=Array.isArray(e.event_resources)?e.event_resources[0]:void 0,a=Array.isArray(e.resources)?e.resources[0]:void 0,i=l??a,n=null==i?void 0:i.metadata,s=(null==n?void 0:n.resource_name)??(null==n?void 0:n.form_name);if("string"==typeof s&&s)return s;let r=e.booking_id;return null!=r&&""!==r?String(r):String(e.id??"")}function eWX(e){var t;let l=eYq(e);return(null==l||null==(t=l.name)?void 0:t.trim())||""}function eW0(e){let t=e.start_at;if(t&&em()(t).isValid())return em()(t).format("YYYY-MM-DD");let l=e.start_date;if("string"==typeof l&&/^\d{4}-\d{2}-\d{2}/.test(l))return l.slice(0,10)}function eW2(e){let t=e.start_at||(e.start_date&&e.start_time?`${e.start_date} ${e.start_time}`:null);if(!t)return"";let l=em()(t);return l.isValid()?l.format("HH:mm"):""}function eW1(e){if("reserved"!==String(e.status))return;let t=String(e.reserved_status??"");return"late"===t?"late":"not_arrived"===t?"not_arrived":void 0}function eW4(e){if("occupied"===String(e.status))return!0===e.isTimeout||void 0}function eW3(e){let t=eW1(e),l=eW4(e),a={};return null!=t&&(a.hostReservedStatus=t),!0===l&&(a.hostIsTimeout=!0),a}function eW8(e,t,l){let a;return{id:e,code:l??eWZ(t),cardStatus:"occupied"===(a=String(t.status??""))?"occupied":"reserved"===a?"booked":"locked"===a?"maintenance":"available",...eW3(t),guestName:eWX(t)||void 0,time:eW2(t)||void 0,floorMapSourceBookings:[t],floorMapReferenceDay:eW0(t),partySize:(()=>{let e=t.number;if("number"==typeof e&&Number.isFinite(e))return e;if(null!=e&&""!==e){let t=Number(e);return Number.isFinite(t)?t:void 0}})()}}function eW6(e,t){let l=t.find(e=>e.relation_form_name),a=(null==l?void 0:l.relation_form_name)?String(l.relation_form_name):eWZ(t[0]),i=[...t].sort((e,t)=>em()(e.start_at||`${String(e.start_date??"")} ${String(e.start_time??"")}`.trim()).valueOf()-em()(t.start_at||`${String(t.start_date??"")} ${String(t.start_time??"")}`.trim()).valueOf());if(1===i.length)return eW8(e,i[0],a);let n=i.some(e=>"locked"===String(e.status)),s=i.some(e=>"occupied"===String(e.status)),r=n?"maintenance":s?"occupied":"booked",o={};if("occupied"===r){let e=i.find(e=>"occupied"===String(e.status));e&&eW4(e)&&(o.hostIsTimeout=!0)}if("booked"===r){let e=i.find(e=>"reserved"===String(e.status)),t=e?eW1(e):void 0;null!=t&&(o.hostReservedStatus=t)}return{id:e,code:a||e,cardStatus:r,..."maintenance"===r?{hostReservedStatus:void 0,hostIsTimeout:void 0}:o,floorMapSourceBookings:i,floorMapReferenceDay:eW0(i[0]),slots:i.map(e=>({name:eWX(e)||"",time:eW2(e)||"-"}))}}function eW5(e){if(!Array.isArray(e)||0===e.length)return[];let t=e.filter(e=>!!e&&"object"==typeof e&&!(eWG(e)||eWJ(e))),l=new Map,a=[];for(let e of t){let t=eWK(e);if(t.length>0)for(let a of t){let t=l.get(a)??[];t.push(e),l.set(a,t)}else a.push(e)}let i=[];for(let[e,t]of l)i.push(eW6(e,t));for(let e of a){let t=null!=e.id?String(e.id):`booking_${i.length}`;i.push(eW8(t,e))}return i}function eW7(e){if(null==e||"object"!=typeof e)return null;let t=function(e){let t=e.id;if("number"==typeof t&&Number.isFinite(t)){let e=Math.trunc(t);return e>0?String(e):null}if("string"==typeof t){let e=t.trim();if(!e||"0"===e)return null;let l=Number(e);if(Number.isFinite(l)&&l>0)return String(Math.trunc(l));if(/^\d+$/.test(e))return e}return null}(e);return null==t?null:{id:t,code:function(e){if(null==e||"string"!=typeof e)return"";let t=e.split(" ## ")[0];return(null==t?void 0:t.trim())??""}(e.main_field)||t,main_field:"string"==typeof e.main_field?e.main_field:void 0,form_id:e.form_id,cardStatus:"available",area:"string"==typeof e.form_code&&e.form_code.trim()?e.form_code:void 0,capacityLabel:null!=e.capacity&&""!==String(e.capacity).trim()?String(e.capacity):void 0}}function eW9(e,t){if(0===e.length)return[];let l=new Map;for(let e of t)l.set(e.id,e);return e.map(e=>{let t=l.get(e.id);return t?{...e,cardStatus:t.cardStatus,guestName:t.guestName,guestPhone:t.guestPhone,time:t.time,timeEnd:t.timeEnd,partySize:t.partySize,startsInMinutes:t.startsInMinutes,priceDisplay:t.priceDisplay,isPaid:t.isPaid,delayMinutes:t.delayMinutes,lateMinutes:t.lateMinutes,elapsedLabel:t.elapsedLabel,progress:t.progress,progressTone:t.progressTone,topAccentOrange:t.topAccentOrange,nextGuest:t.nextGuest,nextTime:t.nextTime,slots:t.slots,moreCount:t.moreCount,barSlots:t.barSlots,barRemainingLabel:t.barRemainingLabel,floorMapSourceBookings:t.floorMapSourceBookings,floorMapReferenceDay:t.floorMapReferenceDay,hostReservedStatus:t.hostReservedStatus,hostIsTimeout:t.hostIsTimeout}:e})}function eGe(e){if(null==e||""===e)return;let t="number"==typeof e?e:Number(e);return Number.isFinite(t)&&t>=0?t:void 0}let eGt=[],eGl=[];function eGa(e,t){let l=String(e??"").trim();return!l||l===t}function eGi(e,t){return e.diff(t,"minute",!0)/60}function eGn(e,t){let l=Math.floor(t),a=Math.min(59,Math.max(0,Math.round((t-l)*60)));return em()(`${e} ${String(l).padStart(2,"0")}:${String(a).padStart(2,"0")}`,"YYYY-MM-DD HH:mm")}function eGs(e,t){let l=String(e.booking_id??e.booking_uid??e.id??"").trim();if(l)for(let e of t){let t=e.floorMapSourceBookings;if(Array.isArray(t)&&t.some(e=>{let t=String(e.id??"").trim(),a=String(e.booking_id??"").trim(),i=String(e.booking_uid??"").trim();return t===l||a===l||i===l}))return e}}function eGr(e){let t=e&&"object"==typeof e?{...e}:{},l=t.filter,a="object"!=typeof l||null===l||Array.isArray(l)?{}:{...l},i=a.values,n="object"!=typeof i||null===i||Array.isArray(i)?{}:{...i};return Array.isArray(n.order_payment_status)&&0!==n.order_payment_status.length||(n.order_payment_status=void 0),{...t,filter:{...a,values:n}}}function eGo(e,t,l){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:eWT,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:em()(),n="object"==typeof e.filter&&e.filter?e.filter:{},s="object"==typeof n.values&&n.values?n.values:{},r=eWY(t,l,a,i);return!function(e,t){if(!Array.isArray(e)||!Array.isArray(t)||2!==e.length||2!==t.length)return!1;try{for(let l=0;l<2;l++){let a=em()(e[l]).valueOf(),i=em()(t[l]).valueOf();if(!Number.isFinite(a)||!Number.isFinite(i)||a!==i)return!1}return!0}catch{return!1}}(s.booking_time_start_between,r)?{...e,filter:{...n,values:{...s,booking_time_start_between:r}}}:e}function eGd(e){let t="object"==typeof e.filter&&e.filter?e.filter:{},l="object"==typeof t.values&&t.values?t.values:{};if(!("compact_fields"in l)&&!("enable_remote_memory_cache"in l))return e;let a={...l};return delete a.compact_fields,delete a.enable_remote_memory_cache,{...e,filter:{...t,values:a}}}function eGc(e){if("u"<typeof window||!e)return"floorMap";try{let t=localStorage.getItem(e);if("grid"===t||"floorMap"===t||"calendar"===t||"resourceWall"===t)return t}catch{}return"floorMap"}function eGu(e){return`pisell-reservation.floor-map.appearance:${e||"default"}`}function eGp(e){if("u"<typeof window)return"light";try{let t=localStorage.getItem(eGu(e));if("dark"===t||"light"===t)return t}catch{}return"light"}function eGm(e){return"light"===e.mode?(0,ev.jsxs)("svg",{"data-icon":"sun",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,ev.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,ev.jsx)("path",{d:"M12 2.5V5"}),(0,ev.jsx)("path",{d:"M12 19V21.5"}),(0,ev.jsx)("path",{d:"M21.5 12H19"}),(0,ev.jsx)("path",{d:"M5 12H2.5"}),(0,ev.jsx)("path",{d:"M18.72 5.28L16.95 7.05"}),(0,ev.jsx)("path",{d:"M7.05 16.95L5.28 18.72"}),(0,ev.jsx)("path",{d:"M18.72 18.72L16.95 16.95"}),(0,ev.jsx)("path",{d:"M7.05 7.05L5.28 5.28"})]}):(0,ev.jsx)("svg",{"data-icon":"moon",viewBox:"0 0 24 24",width:"1em",height:"1em",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:(0,ev.jsx)("path",{d:"M18 15.5a7 7 0 0 1-9.5-9.5 8.5 8.5 0 1 0 9.5 9.5Z"})})}function eGg(e){let t="light"===e.mode?eN.getText("pisell-reservation.floor-map-appearance-dark"):eN.getText("pisell-reservation.floor-map-appearance-light");return(0,ev.jsx)("button",{type:"button",className:"pisell-floor-map-layout-view-controls-tool-btn pisell-floor-map-layout-view-controls-dock-collapsed-extras-btn",title:t,"aria-label":t,onClick:e.onToggle,children:(0,ev.jsx)(eGm,{mode:e.mode})})}function eGh(e){let{bodyView:t}=(0,lL.useRecordBoardContext)();return(0,ef.useEffect)(()=>{var l;e.bodyViewRef.current=t,null==(l=e.onBodyViewChange)||l.call(e,t)},[t,e.bodyViewRef,e.onBodyViewChange]),null}function eGv(e){let{bodyView:t}=(0,lL.useRecordBoardContext)(),l=(0,ef.useRef)(null);return(0,ef.useEffect)(()=>{let a=l.current;e.isInternalListData&&("floorMap"===t||"calendar"===t||"resourceWall"===t)&&null!==a&&"floorMap"!==a&&"calendar"!==a&&"resourceWall"!==a&&e.patchSearchParams(t=>eGd(eGo(t,e.schedule.date,e.operatingDayBoundary,e.timelineRange,em()()))),e.isInternalListData&&("calendar"===a||"resourceWall"===a)&&"floorMap"===t&&e.patchSearchParams(t=>eGd(eGo(t,e.schedule.date,e.operatingDayBoundary,e.timelineRange,em()()))),e.isInternalListData&&"calendar"===a&&("grid"===t||"resourceWall"===t)&&e.patchSearchParams(t=>eGd(eGo(t,e.schedule.date,e.operatingDayBoundary,e.timelineRange,em()()))),l.current=t},[t,e.schedule.date.valueOf(),e.isInternalListData,e.patchSearchParams,e.schedule.date,e.operatingDayBoundary,e.timelineRange]),null}function eGf(){let{bodyViewSwitchable:e}=(0,lL.useRecordBoardContext)(),t=(0,lL.useRecordBoardShellBodyMeta)(),l=(null==t?void 0:t.hasGridContent)??!0,a=null==t?void 0:t.hasFloorMapSlot,i=null==t?void 0:t.hasCalendarSlot,n=null==t?void 0:t.hasResourceWallSlot,s=null==t?void 0:t.effectiveFloorMapProps,r=!!(a&&null!=s),o=!!i,d=!!n;return{allowBodyViewToggle:+!!l+ +!!r+ +!!o+ +!!d>=2&&!1!==e,bodyViewSegmentedOptions:(0,ef.useMemo)(()=>{let e=[];return r&&e.push({label:eN.getText("pisell-reservation.view-floor"),value:"floorMap"}),o&&e.push({label:eN.getText("pisell-reservation.view-calendar"),value:"calendar"}),d&&e.push({label:eN.getText("pisell-reservation.view-resource-wall"),value:"resourceWall"}),l&&e.push({label:eN.getText("pisell-reservation.view-grid"),value:"grid"}),e},[r,o,d,l])}}function eGy(){let{bodyView:e,setBodyView:t}=(0,lL.useRecordBoardContext)(),{allowBodyViewToggle:l,bodyViewSegmentedOptions:a}=eGf();return l&&("grid"===e||"resourceWall"===e)?(0,ev.jsx)(ex.Select,{className:"pisell-reservation-mobile-toolbar-body-view-select",popupClassName:"pisell-reservation-body-view-select-dropdown",popupMatchSelectWidth:!1,size:"small",value:e,onChange:e=>t(e),options:a.map(e=>({label:e.label,value:e.value}))}):null}function eGx(e){var t,l,a,i,n,s,r;let{bodyView:o,setBodyView:d}=(0,lL.useRecordBoardContext)(),{allowBodyViewToggle:c,bodyViewSegmentedOptions:u}=eGf();if("grid"===o||"resourceWall"===o)return e.extraTabs?(0,ev.jsx)(ev.Fragment,{children:e.extraTabs}):null;let p=e.phoneLayout?"middle":"large",m=c?e.phoneLayout?(0,ev.jsx)(ex.Select,{className:"pisell-reservation-body-view-select",popupClassName:"pisell-reservation-body-view-select-dropdown",popupMatchSelectWidth:!1,size:"middle",value:o,onChange:e=>d(e),options:u.map(e=>({label:e.label,value:e.value}))}):(0,ev.jsx)(ex.Segmented,{className:"pisell-reservation-body-view-segmented",size:p,value:o,onChange:e=>d(e),options:u}):null,g=(0,ev.jsxs)("div",{className:"pisell-reservation-schedule-start-merge",children:[e.scheduleStartSlot,m]}),h=(0,ev.jsx)("div",{className:"pisell-reservation-follow-time-slot",children:e.phoneLayout?e.followWallClock?(0,ev.jsxs)("span",{className:"pisell-reservation-follow-current-chip pisell-reservation-follow-current-chip--on","aria-live":"polite","aria-label":eN.getText(eWz),children:[(0,ev.jsx)("span",{className:"pisell-reservation-follow-current-chip-dot"}),(0,ev.jsx)("span",{className:"pisell-reservation-follow-current-chip-label",children:eN.getText("pisell-reservation.at-current-time-short")})]}):(0,ev.jsx)("button",{type:"button",className:"pisell-reservation-follow-current-chip pisell-reservation-follow-current-chip--off",onClick:e.onFollowWallClockToggle,"aria-pressed":!1,"aria-label":eN.getText(eWL),children:(0,ev.jsx)("span",{className:"pisell-reservation-follow-current-chip-label",children:eN.getText(eWL)})}):e.followWallClock?(0,ev.jsx)("span",{className:"pisell-reservation-follow-time-hint pisell-reservation-follow-time-hint--at-current","aria-live":"polite",children:eN.getText(eWz)}):(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{className:"pisell-reservation-follow-time-hint pisell-reservation-follow-time-hint--off-current","aria-live":"polite",children:eN.getText("pisell-reservation.non-current-hint")}),(0,ev.jsx)("button",{type:"button",className:"pisell-reservation-follow-current-btn pisell-reservation-follow-current-btn--go-current",onClick:e.onFollowWallClockToggle,"aria-pressed":!1,children:(0,ev.jsx)("span",{className:"pisell-reservation-follow-current-btn-label",children:eN.getText(eWL)})})]})}),v="calendar"===o?"resource"===e.calendarGranularity?"month":e.calendarGranularity??"day":"day";return(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)(lL.PisellReservationScheduleBand,{value:e.schedule,onChange:e.onScheduleChange,scheduleRowClassName:e.phoneLayout&&!c?"pisell-reservation-schedule-band-schedule-row--phone-single-line":void 0,hideTimeNavigator:"calendar"===o,scheduleProps:{...e.scheduleProps,navigationLocked:!!(null==(t=e.scheduleProps)?void 0:t.navigationLocked),..."calendar"===o?{navigationUnit:v}:{}},timeNavigatorProps:{range:eWT,businessHours:eWT,...e.timeNavigatorProps,showNowButton:(null==(l=e.timeNavigatorProps)?void 0:l.showNowButton)??!1,snapToStep:!1,cursorMode:e.phoneLayout?"axis-moves":"cursor-moves",onUserInteraction:()=>{var t,l;e.onTimeNavigatorUserInteraction(),null==(l=e.timeNavigatorProps)||null==(t=l.onUserInteraction)||t.call(l)},userInteractionLocked:!!(null==(a=e.timeNavigatorProps)?void 0:a.userInteractionLocked),loadDensity:e.loadDensity,horizontalAxisCellSizePx:e.phoneLayout?(null==(i=e.timeNavigatorProps)?void 0:i.horizontalAxisCellSizePx)??40:null==(n=e.timeNavigatorProps)?void 0:n.horizontalAxisCellSizePx,horizontalTrackHeightPx:e.phoneLayout?(null==(s=e.timeNavigatorProps)?void 0:s.horizontalTrackHeightPx)??36:null==(r=e.timeNavigatorProps)?void 0:r.horizontalTrackHeightPx},scheduleStartSlot:g,scheduleAfterDateSlot:h,scheduleEndSlot:e.scheduleEndSlot}),e.extraTabs]})}function eGb(e){let{bodyView:t}=(0,lL.useRecordBoardContext)();return"floorMap"===t||"calendar"===t?null:(0,ev.jsx)(ev.Fragment,{children:e.extra??null})}function eG_(e){let{bodyView:t}=(0,lL.useRecordBoardContext)(),l=(0,lL.useRecordBoardShellBodyMeta)(),a="calendar"===t&&!!(null==l?void 0:l.hasCalendarSlot)&&null!=e.calendarGranularity&&null!=e.onCalendarGranularityChange,i=e.phoneLayout?"middle":"large",n=[{label:eN.getText("pisell-reservation.calendar-granularity-resource"),value:"resource"},{label:eN.getText("pisell-reservation.calendar-granularity-day"),value:"day"},{label:eN.getText("pisell-reservation.calendar-granularity-week"),value:"week"},{label:eN.getText("pisell-reservation.calendar-granularity-month"),value:"month"}];return(0,ev.jsxs)("div",{className:"pisell-reservation-schedule-end-slots",children:[a?e.phoneLayout?(0,ev.jsx)(ex.Select,{className:"pisell-reservation-body-view-select pisell-reservation-calendar-granularity-select",popupClassName:"pisell-reservation-body-view-select-dropdown pisell-reservation-calendar-granularity-select-dropdown",popupMatchSelectWidth:!1,size:"middle",value:e.calendarGranularity,onChange:t=>{var l;return null==(l=e.onCalendarGranularityChange)?void 0:l.call(e,t)},options:n.map(e=>({label:e.label,value:e.value}))}):(0,ev.jsx)(ex.Segmented,{className:"pisell-reservation-body-view-segmented pisell-reservation-calendar-granularity-segmented",size:i,value:e.calendarGranularity,onChange:t=>{var l;return null==(l=e.onCalendarGranularityChange)?void 0:l.call(e,t)},options:n}):null,(0,ev.jsx)("button",{type:"button",className:e.phoneLayout?"pisell-reservation-new-btn pisell-reservation-new-btn--phone":"pisell-reservation-new-btn",onClick:()=>{var t;return null==(t=e.onNewReservation)?void 0:t.call(e)},children:eN.getText("pisell-reservation.new")})]})}function eGk(e){return(0,ev.jsx)(eGg,{mode:e.appearanceMode,onToggle:e.onToggleAppearanceMode})}function eGw(e){let{bodyView:t}=(0,lL.useRecordBoardContext)();if((0,ef.useEffect)(()=>{"floorMap"!==t&&e.mapEditInternal&&e.setMapEditInternal(!1)},[t,e.mapEditInternal,e.setMapEditInternal]),"floorMap"!==t||e.isFloorModeControlled)return null;let l=eN.getText(e.mapEditInternal?"pisell-reservation.edit-map-done":"pisell-reservation.edit-map"),a=()=>{if(e.mapEditInternal){var t,l;null==(l=e.floorMapLayoutRef.current)||null==(t=l.saveLayout)||t.call(l)}e.setMapEditInternal(e=>!e)};return e.phoneLayout?(0,ev.jsx)("button",{type:"button",className:e.mapEditInternal?"pisell-floor-map-layout-view-controls-tool-btn pisell-floor-map-layout-view-controls-tool-btn--active":"pisell-floor-map-layout-view-controls-tool-btn",title:l,"aria-label":l,"aria-pressed":e.mapEditInternal,onClick:a,children:e.mapEditInternal?(0,ev.jsx)(uj,{}):(0,ev.jsx)(hC,{})}):(0,ev.jsx)("div",{className:"pisell-reservation-floor-map-dock-actions",children:(0,ev.jsx)(ex.Button,{type:"primary",size:"middle",className:"pisell-reservation-topbar-edit-btn",onClick:a,children:l})})}function eGj(){return(0,ev.jsx)("span",{className:"pisell-reservation-page-title",children:eN.getText("pisell-reservation.page-title")})}function eGS(){return(0,ev.jsx)("span",{className:"pisell-reservation-page-title",children:eN.getText("pisell-reservation.page-title-venue")})}function eGM(e){return null==e?null:String(e).trim()||null}function eGN(e,t){if(!t)return[null,null,null];if(t.getCategoryPath){let l=t.getCategoryPath(e);return[eGM(null==l?void 0:l[0]),eGM(null==l?void 0:l[1]),eGM(null==l?void 0:l[2])]}if(t.nestedPathField){let l=(0,lL.parseNestedPathSegments)(e[t.nestedPathField],3);return[eGM(l[0]),eGM(l[1]),eGM(l[2])]}let l=[null,null,null],a=t.levels??[];for(let t=0;t<3;t++){var i;let n=null==(i=a[t])?void 0:i.field;n&&(l[t]=eGM(e[n]))}return l}function eGC(e){let t="string"==typeof e.title?e.title:"string"==typeof e.name?e.name:"",l=String(e.id??"").trim();return`${t} ${l}`.toLowerCase()}let eGT="pisell-pro-resource-picker",eGP="pisell-floor-map-layout.resource-picker";function eGA(e){let t=e.title??e.name??e.label??e.id??"",l=e.subtitle??e.desc??e.description,a=null==l?"":String(l).trim();return{title:String(t).trim(),subtitles:a?[a]:[]}}let eGD=new Set(["-1","-2","0"]);function eGI(e){var t,l;let{open:a,onClose:i,onConfirm:n,records:s,mode:r="multiple",value:o,title:d,disabledIds:c,categoryConfig:u,getSearchText:p,getCardMeta:m,renderCard:g,renderFilterBar:h,selectorValueType:v="primitive",selectorShowStepper:f="auto",getOptionRuleConfig:y,zIndex:x=1100,width:b=880,className:_,platform:k="pc"}=e,w="object"===v,j=m??eGA,S=p??eGC,M=(0,ef.useMemo)(()=>new Set((c??[]).map(e=>String(e))),[c]),[N,C]=(0,ef.useState)(""),[T,P]=(0,ef.useState)(["0"]),[A,D]=(0,ef.useState)([]),[I,E]=(0,ef.useState)([]),z=(0,ef.useRef)(!1),{engine:L}=ik(),O=(null==L||null==(t=L.props)?void 0:t.locale)??"zh-CN";(0,ef.useEffect)(()=>{a&&eN.init(lL.floorMapLayoutLocales,O)},[a,O]),(0,ef.useEffect)(()=>{if(!a){C(""),P(["0"]),z.current=!1;return}if(!z.current){if(w)E([]);else D(o?o.map(e=>String(e??"").trim()).filter(Boolean):[]);z.current=!0}},[a,o,w]);let R=(0,ef.useMemo)(()=>(function(e,t){if(!t||0===e.length)return[];let l=[],a=(e,t,l)=>{let a=e.find(e=>e.id===t);return a||(a={id:t,name:l,children:[]},e.push(a)),a};for(let i of e){let e=eGN(i,t),n=l;for(let t=0;t<3;t++){let l=e[t];if(!l)break;let i=a(n,l,l);i.children||(i.children=[]),n=i.children}}let i=e=>(e.forEach(e=>{e.children&&0===e.children.length?delete e.children:e.children&&i(e.children)}),e.sort((e,t)=>String(e.name).localeCompare(String(t.name),"zh-CN")),e);return i(l)})(s,u),[s,u]),$=(0,ef.useMemo)(()=>(function(e){let t=[null,null,null];if(!e)return t;for(let l=0;l<3;l++){let a=e[l];null!=a&&""!==a&&(t[l]=String(a))}return t})(T).map(e=>null!=e&&eGD.has(e)?null:e),[T]),F=(0,ef.useMemo)(()=>({keyword:N,onKeywordChange:C,tabbarDataSource:R,tabbarValue:T,onTabbarValueChange:P}),[N,R,T]),B=(0,ef.useMemo)(()=>{let e=N.trim().toLowerCase();return s.filter(t=>!!function(e,t,l){if(!l)return!0;let a=eGN(e,l);for(let e=0;e<3;e++){let l=t[e];if(null!=l&&a[e]!==l)return!1}return!0}(t,$,u)&&(!e||S(t).includes(e)))},[s,$,u,N,S]),H=(0,ef.useMemo)(()=>B.map(e=>{let t=String(e.id??"").trim(),l=j(e);return{id:t,title:l.title,label:l.title,value:t,disabled:M.has(t),...y?{ruleConfig:y(e)}:{},__record:e,__meta:l}}),[B,M,j,y]),q=(0,ef.useMemo)(()=>H.map(e=>String(e.id??"")).filter(e=>e&&!M.has(e)),[H,M]),V=(0,ef.useMemo)(()=>w?I.filter(e=>e.quantity>0).length:A.length,[w,I,A]),Y=(0,ef.useMemo)(()=>0!==q.length&&(w?q.every(e=>I.some(t=>t.value===e&&t.quantity>0)):q.every(e=>A.includes(e))),[w,q,I,A]),U=(0,ef.useMemo)(()=>w?I.some(e=>q.includes(e.value)&&e.quantity>0):A.some(e=>q.includes(e)),[w,I,A,q]),W=(0,ef.useCallback)(()=>{w?E(e=>{let t=new Map(e.map(e=>[e.value,e]));for(let e of q){let l=t.get(e);t.set(e,{value:e,quantity:(null==l?void 0:l.quantity)&&l.quantity>0?l.quantity:1})}return[...t.values()].filter(e=>e.quantity>0)}):D(e=>{let t=new Set(e);for(let e of q)t.add(e);return[...t]})},[w,q]),G=(0,ef.useCallback)(()=>{"single"===r?w?E([]):D([]):w?E(e=>e.filter(e=>!q.includes(e.value))):D(e=>e.filter(e=>!q.includes(e)))},[r,w,q]),Q=(0,ef.useCallback)(e=>{if(null==e||""===e)return[];if(!Array.isArray(e)){if("object"==typeof e&&null!==e&&"value"in e){let t=String(e.value??"").trim();return t?[{value:t,quantity:Math.max(0,Math.floor(Number(e.quantity??0)))}]:[]}let t=String(e).trim();return t?[{value:t,quantity:1}]:[]}return e.map(e=>{if("object"==typeof e&&null!==e&&"value"in e)return{value:String(e.value??"").trim(),quantity:Math.max(0,Math.floor(Number(e.quantity??0)))};let t=String(e??"").trim();return t?{value:t,quantity:1}:null}).filter(e=>!!(null==e?void 0:e.value))},[]),K=(0,ef.useCallback)(e=>{if(w)return void E(Q(e).filter(e=>e.quantity>0));if("single"===r)return void(null==e||""===e?D([]):"object"==typeof e&&null!==e&&"value"in e?D([String(e.value)]):D([String(e)]));if(!Array.isArray(e))return;let t=new Set(q),l=e.map(e=>"object"==typeof e&&null!==e&&"value"in e?String(e.value):String(e)).filter(e=>t.has(e));D(e=>[...new Set([...e.filter(e=>!t.has(e)),...l])])},[w,r,q,Q]),J=(0,ef.useMemo)(()=>{if(w)return I;if("single"===r)return A[0]??"";let e=new Set(q);return A.filter(t=>e.has(t))},[w,r,I,A,q]),Z=(0,ef.useCallback)(()=>{w?n(I.filter(e=>e.quantity>0)):n(A.filter(Boolean)),i()},[w,I,A,n,i]),X=(0,ef.useCallback)(e=>{var t;let{dataSource:l,indicator:a,numberSelector:i,actions:n}=e,s=l.__record,r=l.__meta,o=String(l.id??""),d=w?!!l.selected:A.includes(o),c=M.has(o),u=s&&g?g(s,{selected:d,disabled:c}):null,p=null==r?void 0:r.image,m=null==p?null:"string"==typeof p?(0,ev.jsx)("img",{className:`${eGT}-card-image-img`,src:p,alt:(null==r?void 0:r.title)??"",draggable:!1}):p;return(0,ev.jsxs)("button",{type:"button",disabled:c,onClick:()=>{if(c)return;let e=l._key??o;n.update(e,{quantity:+!d})},className:t_()(`${eGT}-card`,{[`${eGT}-card--selected`]:d,[`${eGT}-card--disabled`]:c,[`${eGT}-card--with-stepper`]:!!i}),children:[(0,ev.jsx)("span",{className:`${eGT}-card-body`,children:u||(0,ev.jsxs)(ev.Fragment,{children:[m?(0,ev.jsx)("span",{className:`${eGT}-card-image`,children:m}):null,(0,ev.jsxs)("span",{className:`${eGT}-card-text`,children:[(0,ev.jsx)("span",{className:`${eGT}-card-title`,children:(null==r?void 0:r.title)??l.title}),null==r||null==(t=r.subtitles)?void 0:t.map((e,t)=>(0,ev.jsx)("span",{className:`${eGT}-card-sub`,children:e},`${o}-sub-${t}`)),(null==r?void 0:r.badges)&&r.badges.length>0?(0,ev.jsx)("span",{className:`${eGT}-card-badges`,children:r.badges.map((e,t)=>(0,ev.jsxs)("span",{className:`${eGT}-card-badge`,children:[e.icon?(0,ev.jsx)("span",{className:`${eGT}-card-badge-icon`,children:e.icon}):null,e.text]},`${o}-badge-${t}`))}):null]})]})}),(0,ev.jsx)("span",{className:`${eGT}-card-actions`,onClick:e=>e.stopPropagation(),children:i??a})]})},[w,A,M,g]),ee=(0,ef.useMemo)(()=>{let e=eN.getText(`${eGP}.confirm`);return V>0?`${e} (${V})`:e},[V]);return(0,ev.jsx)(iB,{renderType:"modal",props:{platform:k,open:a,title:d,onCancel:i,destroyOnClose:!0,width:b,zIndex:x,wrapClassName:t_()(`${eGT}-modal`,_),headerDivider:!1,footerDivider:!1,style:{maxHeight:"95%"},footer:(0,ev.jsxs)("div",{className:`${eGT}-footer`,children:[(0,ev.jsx)(ex.Button,{onClick:i,children:eN.getText(`${eGP}.cancel`)}),(0,ev.jsx)(ex.Button,{type:"primary",onClick:Z,disabled:0===V,children:ee})]})},children:(0,ev.jsxs)("div",{className:eGT,children:[(0,ev.jsx)("div",{className:`${eGT}-filter-bar`,children:h?h(F):(0,ev.jsx)(VJ,{triggerType:"input",value:N,onChange:C,onSearch:C,placeholder:eN.getText(`${eGP}.search-ph`),showHistory:!1,showConfirmButton:!1})}),(0,ev.jsxs)("div",{className:`${eGT}-toolbar`,children:["multiple"===r?(0,ev.jsxs)("div",{className:`${eGT}-toolbar-left`,children:[(0,ev.jsx)(ex.Checkbox,{indeterminate:U&&!Y,checked:Y,disabled:0===q.length,onChange:e=>{e.target.checked?W():G()},children:eN.getText(`${eGP}.select-all`)}),(0,ev.jsx)("button",{type:"button",className:`${eGT}-link`,onClick:G,disabled:0===V,children:eN.getText(`${eGP}.deselect-all`)})]}):(0,ev.jsx)("span",{className:`${eGT}-hint`,children:eN.getText(`${eGP}.single-hint`)}),(0,ev.jsx)("span",{className:`${eGT}-count`,children:(l=s.length,eN.getText(`${eGP}.selected-count`).replace("{count}",String(V)).replace("{total}",String(l)))})]}),(0,ev.jsx)("div",{className:`${eGT}-list`,children:0===H.length?(0,ev.jsx)("div",{className:`${eGT}-empty`,children:eN.getText(`${eGP}.empty`)}):(0,ev.jsx)(zb,{dataSource:H,mode:r,valueType:v,variant:"card",itemLayout:"horizontal",showStepper:f,value:J,onChange:K,renderItem:X,layout:{type:"antdGrid",responsive:{minWidth:160,maxColumns:4,gap:4,defaultColumns:2}},headerProps:{visible:!1}})})]})})}eN.init(lL.floorMapLayoutLocales,"zh-CN");let eGE="floorMapImage",eGz="image",eGL="icon",eGO="pisell-floor-map-layout.toolbar";function eGR(e){var t;let{open:l,categoryLabel:a,entries:i,onClose:n,onConfirm:s,renderEntryPreview:r,platform:o}=e,{engine:d}=ik(),c=(null==d||null==(t=d.props)?void 0:t.locale)??"zh-CN";(0,ef.useEffect)(()=>{l&&eN.init(lL.floorMapLayoutLocales,c)},[l,c]);let u=(0,ef.useMemo)(()=>i.map(e=>({id:e.key,title:e.label,__category:e.kind.value===eGE?eGz:eGL,__entry:e})),[i]),p=(0,ef.useMemo)(()=>{let e=i.some(e=>e.kind.value===eGE),t=i.some(e=>e.kind.value!==eGE),l=[];return e&&l.push({id:eGz,name:eN.getText(`${eGO}.view-all-modal-category-image`)}),t&&l.push({id:eGL,name:eN.getText(`${eGO}.view-all-modal-category-icon`)}),l},[i,c]);return(0,ev.jsx)(eGI,{open:l,title:a,onClose:n,platform:o,onConfirm:e=>{let t={};for(let l of e){let e=l.value.trim();e&&(t[e]=Math.max(0,Math.floor(l.quantity)))}s(function(e,t){let l=[];for(let a of e){let e=Math.max(0,Math.floor(t[a.key]??0));for(let t=0;t<e;t+=1)l.push({elementKind:a.kind.value,...a.builtinShapeKey?{builtinShapeKey:a.builtinShapeKey}:{}})}return l}(i,t))},records:u,mode:"multiple",value:[],selectorValueType:"object",selectorShowStepper:!0,getOptionRuleConfig:()=>({max:99}),getSearchText:e=>String(e.title??"").toLowerCase(),categoryConfig:{levels:[{field:"__category"}]},renderFilterBar:e=>(0,ev.jsx)(lL.PisellTabbarTemplate1,{className:"pisell-pro-resource-picker-tabbar",style:{position:"sticky",top:0,zIndex:10,padding:6,background:"rgb(250, 250, 250)"},dataSource:p,value:Array.isArray(e.tabbarValue)&&e.tabbarValue.length?e.tabbarValue:["0"],onChange:e.onTabbarValueChange,onSearch:e.onKeywordChange,maxLevel:1}),getCardMeta:e=>{let t=e.__entry;return{title:String(e.title??""),subtitles:[],image:t?r(t):void 0}}})}function eG$(e,t){let l="booked"===e.cardStatus,a=eYh(t,l).trim()||eYh(t,!0).trim();if(a)return a;let i=function(e,t){let l=e.floorMapSourceBookings;if(!Array.isArray(l)||0===l.length)return;let a=String(t.booking_id??"").trim();if(a&&!a.startsWith("syn_")){let e=l.find(e=>{let t=String(e.booking_id??e.id??"").trim();return""!==t&&t===a});if(e)return e}return l.find(e=>{let t=e.is_next??e.isNext;return!0===t||"true"===t||1===t||"1"===t})}(e,t);if(i){let e=eYq(i),t=eYm(e,l).trim()||eYm(e,!0).trim();if(t)return t}return eYg(t,!0).join(eV5).trim()}function eGF(e,t){let l,a,i,n,s,r="available",o=e.hostBookingStatus;if("reserved"===o){let{start:l}=eYe(e);if(Number.isFinite(l)){let e=eYt(l),n=eYt(l)+6e4;t>=n?(r="late",i=Math.max(0,Math.ceil((t-n)/6e4))):(r="boardingSoon",a=Math.max(0,Math.ceil((e-t)/6e4)))}else r="boardingSoon"}else if("occupied"===o){let{start:a,end:i}=eYe(e);if(Number.isFinite(a)&&(n=eYt(a)),Number.isFinite(i)){let e=eYt(i)+6e4;s=e,l=Math.max(0,Math.ceil((i-t)/6e4));let a=Math.ceil((e-t)/6e4);r=t>=e?"expired":a<=10&&a>0?"endingSoon":"inUse"}else r="inUse"}return{status:r,remainingMin:l,startsInMin:a,lateMin:i,sessionStartMs:n,sessionEndMs:s}}function eGB(e){let t,l,{cardStatus:a}=e,i="available"===a||"maintenance"===a,n=Date.now(),s=String(e.code||e.main_field||e.id||"").trim(),r=eYU(e,s),o=r.bookings??[],d="",c="",u={status:"available",remainingMin:void 0,startsInMin:void 0,lateMin:void 0,sessionStartMs:void 0,sessionEndMs:void 0};if(o.length>0){let a=function(e,t){if(0===e.length)return{mode:"empty",current:null,next:null};let l=[...e].sort((e,t)=>eYe(e).start-eYe(t).start),a=l.findIndex(e=>eYd(e,t));if(a>=0){let e=l[a],t=a+1<l.length?l[a+1]:null;return{mode:t?"both":"currentOnly",current:e,next:t}}let i=l.findIndex(e=>{let{start:l}=eYe(e);return Number.isFinite(l)&&t<l});if(i>=0){let e=l[i],{start:a}=eYe(e);if(i>0){let{end:n}=eYe(l[i-1]);if(Number.isFinite(n)&&t>=n&&Number.isFinite(a)&&t<a)return{mode:"nextOnly",current:null,next:e}}let n=i+1<l.length?l[i+1]:null;return{mode:n?"both":"single",current:e,next:n}}return{mode:"empty",current:null,next:null}}(o,n);if("nextOnly"===a.mode&&a.next){let s=a.next;d=eYn(s).trim(),c=eG$(e,s).trim(),u=i?{status:"available",remainingMin:void 0,startsInMin:void 0,lateMin:void 0,sessionStartMs:void 0,sessionEndMs:void 0}:eGF(s,n),t=void 0,l=!0}else if("empty"===a.mode)t=void 0,d="",c="Available to Book",u={status:"available",remainingMin:void 0,startsInMin:void 0,lateMin:void 0,sessionStartMs:void 0,sessionEndMs:void 0};else if(a.current){let s=a.current,r=eYc(s,n);d=eYn(s).trim(),c=eG$(e,s).trim(),u=i?{status:"available",remainingMin:void 0,startsInMin:void 0,lateMin:void 0,sessionStartMs:void 0,sessionEndMs:void 0}:eGF(s,n),a.next&&!r&&(t=[function(e,t,l){let a=eG$(e,t).trim(),i=eYn(t).trim(),{start:n}=eYe(t),s=0;return Number.isFinite(n)&&(s=Math.max(0,Math.ceil((n-l)/6e4))),{time:i||"—",booking:a||"—",startInMin:s}}(e,a.next,n)]),r&&(l=!0)}}else{let l=eYv(r),a=l?eYn(l).trim():"",s=String(e.time??"").trim(),o=String(e.timeEnd??"").trim(),p=s&&o?`${s.replace(/ .*/,"")} - ${o.replace(/ .*/,"")}`:s||"";d=a||p,!i&&l&&(u=eGF(l,n)),c=i?"Available to Book":function(e){let t=String(e.code||e.main_field||e.id||"").trim(),l=eYU(e,t),a=eYv(l),i="booked"===e.cardStatus,n=a?eYh(a,i).trim():"";if(n)return n;for(let e of l.bookings){let t=eYh(e,i).trim();if(t)return t}return""}(e),t=void 0}if(!d&&0===o.length){let t=String(e.time??"").trim(),l=String(e.timeEnd??"").trim();d=t&&l?`${t.replace(/ .*/,"")} - ${l.replace(/ .*/,"")}`:t||""}return{resourceId:String(e.id),resource:e.code||e.main_field||String(e.id),area:e.area,status:u.status,currentTime:d,currentBooking:c,remainingMin:u.remainingMin,startsInMin:u.startsInMin,lateMin:u.lateMin,sessionStartMs:u.sessionStartMs,sessionEndMs:u.sessionEndMs,nextList:t,...l?{wallUseNextLabelHideNextRow:!0}:{}}}function eGH(){return{date:em()().startOf("day"),at:em()()}}let eGq="YYYY-MM-DD HH:mm";function eGV(e){let t=Math.min(100,Math.max(0,e.percent)),l=e.isTimeout?"#f5c542":"var(--rc-pay-paid)";return(0,ev.jsx)("div",{className:"pisell-res-floor-room-card__disc-edge-progress","aria-hidden":!0,children:(0,ev.jsxs)("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",children:[(0,ev.jsx)("ellipse",{cx:50,cy:50,rx:49.125,ry:49.125,pathLength:100,fill:"none",stroke:"rgba(0, 0, 0, 0.22)",strokeWidth:1.75}),(0,ev.jsx)("ellipse",{cx:50,cy:50,rx:49.125,ry:49.125,pathLength:100,fill:"none",stroke:l,strokeWidth:1.75,strokeLinecap:"round",strokeDasharray:`${t} 100`,transform:"rotate(-90 50 50)",style:{transition:"stroke-dasharray 0.6s ease"}})]})})}function eGY(e){let t=Math.min(100,Math.max(0,e.percent)),l=e.isTimeout?"#f5c542":"var(--rc-pay-paid)";return(0,ev.jsx)("div",{className:"pisell-res-floor-room-card__rect-edge-progress","aria-hidden":!0,children:(0,ev.jsxs)("svg",{viewBox:"0 0 100 100",preserveAspectRatio:"none",children:[(0,ev.jsx)("rect",{x:.95,y:.95,width:98.1,height:98.1,rx:6,ry:6,pathLength:100,fill:"none",stroke:"rgba(0, 0, 0, 0.22)",strokeWidth:1.9,strokeLinejoin:"round"}),(0,ev.jsx)("rect",{x:.95,y:.95,width:98.1,height:98.1,rx:6,ry:6,pathLength:100,fill:"none",stroke:l,strokeWidth:1.9,strokeLinecap:"round",strokeLinejoin:"round",strokeDasharray:`${t} 100`,transform:"rotate(-90 50 50)",style:{transition:"stroke-dasharray 0.6s ease"}})]})})}function eGU(e){var t,l;let{data:a,theme:i="default",shellShape:n="rect",elementLayoutHeightPx:s,hideHeaderCapacity:r=!1,density:o="auto",viewportScale:d=1,discUnifiedLayoutEnabled:c=!0,tooltipTimeDensityEnabled:u=!0}=e,p=(0,ef.useRef)(null),m=((null==(t=a.bookings)?void 0:t.length)??0)>1,g=function(e){let{rootRef:t,density:l,viewportScale:a}=e,[i,n]=(0,ef.useState)("comfortable"),s=(0,ef.useRef)(null),r=(0,ef.useCallback)(()=>{let e,l=t.current;if(!l)return;let i=l.offsetWidth,r=l.offsetHeight,o=function(e,t){let l=!Number.isFinite(e)||e<=0?"micro":e>=180?"comfortable":e>=124?"compact":e>=86?"mini":"micro";return null==t?l:eYQ(l)===eYQ(t)?t:eYQ(l)>eYQ(t)?"comfortable"===l&&e<186||"compact"===l&&e<130||"mini"===l&&e<92?t:l:"compact"===l&&"comfortable"===t&&e>174||"mini"===l&&"compact"===t&&e>118||"micro"===l&&"mini"===t&&e>80?t:l}((e=Number.isFinite(a)&&a>0?a:1,Math.min(Number.isFinite(i)&&i>0?i:0,Number.isFinite(r)&&r>0?r:0)*e),s.current);s.current=o,n(e=>e===o?e:o)},[t,a]);return((0,ef.useLayoutEffect)(()=>{"auto"===l&&r()},[l,r,a]),(0,ef.useEffect)(()=>{if("auto"!==l)return;let e=t.current;if(!e||"u"<typeof ResizeObserver)return;let a=new ResizeObserver(()=>r());return a.observe(e),()=>a.disconnect()},[l,r,t]),"auto"!==l)?l:i}({rootRef:p,density:o,viewportScale:d}),h=(0,ef.useMemo)(()=>m?"comfortable":"auto"===o?g:o,[m,o,g]),v=(0,ef.useMemo)(()=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"rect";return"micro"===e||"mini"===e&&"circle"===t?"micro":"comfortable"})(h,n),[h,n]),f="circle"===n?{"data-shape":"circle"}:{},y="circle"===n?function(e){let t=eYy(e);if("payed"!==t&&"payment_required"!==t&&"timeout"!==t)return null;let l=eYv(e);return l?{percent:eYs(l),isTimeout:"timeout"===t}:null}(a):null,x=eYy(a),b="rect"===n&&eYK(h,n)&&((null==(l=a.bookings)?void 0:l.length)??0)===1?function(e){let t=eYy(e);if("payed"!==t&&"payment_required"!==t&&"timeout"!==t)return null;let l=eYv(e);return l?{percent:eYs(l),isTimeout:"timeout"===t}:null}(a):null,_=Number.isFinite(d)&&d>0?d:1,k=m?1:Math.min(_,1),[,w]=(0,ef.useReducer)(e=>e+1,0);return(0,ef.useEffect)(()=>{let e=window.setInterval(()=>{w()},6e4);return()=>window.clearInterval(e)},[]),(0,ev.jsx)("div",{ref:p,className:"pisell-res-floor-room-card","data-theme":"default"===i?void 0:i,"data-density":v,"data-disc-layout":c?"unified":"legacy","data-tooltip-time":u&&eYK(h,n)?"on":"off","data-reserved-halo":"not_arrived"===x||"late"===x||"multi_reserved"===x?"on":"off","data-rect-edge-progress":b?"on":"off",style:{"--floor-card-vs":String(k)},...f,children:(0,ev.jsx)(eYJ.Provider,{value:h,children:(0,ev.jsxs)("div",{className:"pisell-res-floor-room-card__viewport-compensate",children:[(0,ev.jsx)(eU_,{data:a,shellShape:n,elementLayoutHeightPx:s,hideHeaderCapacity:r,discUnifiedLayoutEnabled:c,tooltipTimeDensityEnabled:u}),y?(0,ev.jsx)(eGV,{percent:y.percent,isTimeout:y.isTimeout}):null,b?(0,ev.jsx)(eGY,{percent:b.percent,isTimeout:b.isTimeout}):null]})})})}let eGW="pisell-reservation.room-kind-bound";function eGG(e,t){return(0,lL.findFloorMapRowByDataBinding)(e,t)}function eGQ(e){let{title:t,hint:l,shape:a}=e;return(0,ev.jsxs)("div",{className:t_()("pisell-reservation-card-placeholder","circle"===a&&"pisell-reservation-card-placeholder--circle"),children:[(0,ev.jsx)("div",{className:"pisell-reservation-card-placeholder-title",children:t}),l?(0,ev.jsx)("div",{className:"pisell-reservation-card-placeholder-hint",children:l}):null]})}function eGK(e){var t,l;let a,i,n,s,r,o,d,c;return[String(e.id??""),String(e.booking_id??e.booking_uid??""),String(e.start_time??""),String(e.end_time??""),String(e.appointment_status??""),String(e.order_payment_status??""),String(e.status??""),String((null==(t=e.order)?void 0:t.order_payment_status)??""),String((null==(a=e.order)?void 0:a.payment_status)??(null==a?void 0:a.order_payment_status)??e.payment_status??e.order_payment_status??""),(n=null==(i=e.order)?void 0:i.summary,r=Array.isArray(s=e.products)?s.filter(e=>e&&"object"==typeof e).length:-1,[String((null==n?void 0:n.total_amount)??""),String((null==n?void 0:n.expect_amount)??""),String((null==n?void 0:n.product_quantity)??""),String(r)].join(":")),(d=(l=e).order,c=eWK(l).sort().join(","),[!(null==(o=eYH(l))?void 0:o.length)?"":o.map(e=>{let t=null!=e.phone&&""!==String(e.phone).trim()?String(e.phone).trim():"";return`${e.source}:${String(e.name??"").trim()}:${t}`}).join(">"),String(l.number??""),String(l.notes??""),String(l.start_at??""),String(l.end_at??""),String((null==d?void 0:d.schedule_date)??""),function(e){let t=e.order;if(!t)return"";let l=t.customer_id;if(null!=l&&""!==String(l).trim())return String(l);let a=t.customer,i=null==a?void 0:a.id;return null!=i&&""!==String(i).trim()?String(i):""}(l),String(l.duration??""),String(l.sub_type??""),c,String(l.is_next??l.isNext??""),String(l.lateTime??""),String(l.timeoutTime??""),String(l.remainingReserveTime??""),String(l.progressPercent??"")].join("|"))].join("|")}function eGJ(e){return[String(e.id??""),String(e.code??""),String(e.main_field??""),String(e.bookingCount??""),String(e.completeBookingCount??"")].join("|")}let eGZ={stopPropagation:()=>{},preventDefault:()=>{},nativeEvent:{stopImmediatePropagation:()=>{}}},eGX={en:{"pisell-reservation.booking-change.fallback-court":"Court","pisell-reservation.booking-change.fallback-customer":"Customer","pisell-reservation.booking-change.title":"Booking information","pisell-reservation.booking-change.description":"Update customer, court, date and time for this booking.","pisell-reservation.booking-change.customer":"Customer","pisell-reservation.booking-change.no-phone":"No phone","pisell-reservation.booking-change.no-email":"No email","pisell-reservation.booking-change.change":"Change","pisell-reservation.booking-change.court":"Court","pisell-reservation.booking-change.new-date":"New date","pisell-reservation.booking-change.new-start-time":"New start time","pisell-reservation.booking-change.new-end-time":"New end time","pisell-reservation.booking-change.loading-resources":"Loading available resources...","pisell-reservation.booking-change.previous-booking-info":"Previous booking info","pisell-reservation.booking-change.original":"Original","pisell-reservation.booking-change.updated":"Updated","pisell-reservation.booking-change.drop-target":"Drop target","pisell-reservation.booking-change.conflict":"The selected date, court, or time range is unavailable. Please choose an available option.","pisell-reservation.booking-change.cancel":"Cancel","pisell-reservation.booking-change.confirm":"Confirm","pisell-reservation.booking-change.loading":"Loading...","pisell-reservation.booking-change.submitting":"Submitting...","pisell-reservation.booking-change.submit-failed":"Submit failed. Please try again.","pisell-reservation.booking-change.unavailable-time":"Unavailable {time}","pisell-reservation.booking-change.browser-only":"bookingChangeModal can only open in a browser environment.","pisell-reservation.booking-change.replaced":"A new booking change modal replaced the current one."},"zh-CN":{"pisell-reservation.booking-change.fallback-court":"场地","pisell-reservation.booking-change.fallback-customer":"客户","pisell-reservation.booking-change.title":"预约信息","pisell-reservation.booking-change.description":"更新该预约的客户、场地、日期和时间。","pisell-reservation.booking-change.customer":"客户","pisell-reservation.booking-change.no-phone":"暂无电话","pisell-reservation.booking-change.no-email":"暂无邮箱","pisell-reservation.booking-change.change":"更换","pisell-reservation.booking-change.court":"场地","pisell-reservation.booking-change.new-date":"新日期","pisell-reservation.booking-change.new-start-time":"新开始时间","pisell-reservation.booking-change.new-end-time":"新结束时间","pisell-reservation.booking-change.loading-resources":"正在加载可用资源...","pisell-reservation.booking-change.previous-booking-info":"原预约信息","pisell-reservation.booking-change.original":"原始","pisell-reservation.booking-change.updated":"更新后","pisell-reservation.booking-change.drop-target":"拖拽目标","pisell-reservation.booking-change.conflict":"当前选择的日期、场地或时间段不可用,请重新选择可用时段。","pisell-reservation.booking-change.cancel":"取消","pisell-reservation.booking-change.confirm":"确认","pisell-reservation.booking-change.loading":"加载中...","pisell-reservation.booking-change.submitting":"提交中...","pisell-reservation.booking-change.submit-failed":"提交失败,请稍后重试。","pisell-reservation.booking-change.unavailable-time":"不可用 {time}","pisell-reservation.booking-change.browser-only":"bookingChangeModal 仅可在浏览器环境中打开。","pisell-reservation.booking-change.replaced":"新的 bookingChangeModal 已替换当前弹窗。"},"zh-HK":{"pisell-reservation.booking-change.fallback-court":"場地","pisell-reservation.booking-change.fallback-customer":"客戶","pisell-reservation.booking-change.title":"預約資訊","pisell-reservation.booking-change.description":"更新此預約的客戶、場地、日期與時間。","pisell-reservation.booking-change.customer":"客戶","pisell-reservation.booking-change.no-phone":"暫無電話","pisell-reservation.booking-change.no-email":"暫無郵箱","pisell-reservation.booking-change.change":"更換","pisell-reservation.booking-change.court":"場地","pisell-reservation.booking-change.new-date":"新日期","pisell-reservation.booking-change.new-start-time":"新開始時間","pisell-reservation.booking-change.new-end-time":"新結束時間","pisell-reservation.booking-change.loading-resources":"正在載入可用資源...","pisell-reservation.booking-change.previous-booking-info":"原預約資訊","pisell-reservation.booking-change.original":"原始","pisell-reservation.booking-change.updated":"更新後","pisell-reservation.booking-change.drop-target":"拖拽目標","pisell-reservation.booking-change.conflict":"目前選擇的日期、場地或時段不可用,請重新選擇可用時段。","pisell-reservation.booking-change.cancel":"取消","pisell-reservation.booking-change.confirm":"確認","pisell-reservation.booking-change.loading":"載入中...","pisell-reservation.booking-change.submitting":"提交中...","pisell-reservation.booking-change.submit-failed":"提交失敗,請稍後重試。","pisell-reservation.booking-change.unavailable-time":"不可用 {time}","pisell-reservation.booking-change.browser-only":"bookingChangeModal 僅可在瀏覽器環境中開啟。","pisell-reservation.booking-change.replaced":"新的 bookingChangeModal 已取代目前彈窗。"},ja:{"pisell-reservation.booking-change.fallback-court":"コート","pisell-reservation.booking-change.fallback-customer":"顧客","pisell-reservation.booking-change.title":"予約情報","pisell-reservation.booking-change.description":"この予約の顧客、コート、日付、時間を更新します。","pisell-reservation.booking-change.customer":"顧客","pisell-reservation.booking-change.no-phone":"電話なし","pisell-reservation.booking-change.no-email":"メールなし","pisell-reservation.booking-change.change":"変更","pisell-reservation.booking-change.court":"コート","pisell-reservation.booking-change.new-date":"新しい日付","pisell-reservation.booking-change.new-start-time":"新しい開始時間","pisell-reservation.booking-change.new-end-time":"新しい終了時間","pisell-reservation.booking-change.loading-resources":"利用可能なリソースを読み込み中...","pisell-reservation.booking-change.previous-booking-info":"変更前の予約情報","pisell-reservation.booking-change.original":"元の内容","pisell-reservation.booking-change.updated":"更新後","pisell-reservation.booking-change.drop-target":"ドロップ先","pisell-reservation.booking-change.conflict":"選択した日付、コート、または時間帯は利用できません。別の候補を選択してください。","pisell-reservation.booking-change.cancel":"キャンセル","pisell-reservation.booking-change.confirm":"確認","pisell-reservation.booking-change.loading":"読み込み中...","pisell-reservation.booking-change.submitting":"送信中...","pisell-reservation.booking-change.submit-failed":"送信に失敗しました。しばらくしてからもう一度お試しください。","pisell-reservation.booking-change.unavailable-time":"利用不可 {time}","pisell-reservation.booking-change.browser-only":"bookingChangeModal はブラウザ環境でのみ開けます。","pisell-reservation.booking-change.replaced":"新しい bookingChangeModal が現在のモーダルを置き換えました。"},pt:{"pisell-reservation.booking-change.fallback-court":"Quadra","pisell-reservation.booking-change.fallback-customer":"Cliente","pisell-reservation.booking-change.title":"Informacoes da reserva","pisell-reservation.booking-change.description":"Atualize o cliente, a quadra, a data e o horario desta reserva.","pisell-reservation.booking-change.customer":"Cliente","pisell-reservation.booking-change.no-phone":"Sem telefone","pisell-reservation.booking-change.no-email":"Sem e-mail","pisell-reservation.booking-change.change":"Alterar","pisell-reservation.booking-change.court":"Quadra","pisell-reservation.booking-change.new-date":"Nova data","pisell-reservation.booking-change.new-start-time":"Novo horario de inicio","pisell-reservation.booking-change.new-end-time":"Novo horario de termino","pisell-reservation.booking-change.loading-resources":"Carregando recursos disponiveis...","pisell-reservation.booking-change.previous-booking-info":"Informacoes anteriores da reserva","pisell-reservation.booking-change.original":"Original","pisell-reservation.booking-change.updated":"Atualizado","pisell-reservation.booking-change.drop-target":"Destino do arraste","pisell-reservation.booking-change.conflict":"A data, a quadra ou o intervalo selecionado nao esta disponivel. Escolha outra opcao.","pisell-reservation.booking-change.cancel":"Cancelar","pisell-reservation.booking-change.confirm":"Confirmar","pisell-reservation.booking-change.loading":"Carregando...","pisell-reservation.booking-change.submitting":"Enviando...","pisell-reservation.booking-change.submit-failed":"Falha no envio. Tente novamente mais tarde.","pisell-reservation.booking-change.unavailable-time":"Indisponivel {time}","pisell-reservation.booking-change.browser-only":"bookingChangeModal so pode ser aberto em um navegador.","pisell-reservation.booking-change.replaced":"Um novo bookingChangeModal substituiu o modal atual."}};function eG0(e){if(!(!e||"object"!=typeof e||Array.isArray(e)))return e}function eG2(e){return Array.isArray(e)?e.map(e=>eG0(e)).filter(Boolean):[]}function eG1(e){if(null!=e&&""!==e)return String(e)}function eG4(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,l=Number(e);return Number.isFinite(l)?l:t}function eG3(e){var t;return eG0(null==(t=eG0(e))?void 0:t.metadata)||{}}function eG8(e){let t=Math.round(60*e),l=Math.floor(t/60);return`${String(l).padStart(2,"0")}:${String(t%60).padStart(2,"0")}`}function eG6(e,t){if(!Number.isFinite(e)||0===t.length)return e;let l=t[0],a=Math.abs(e-l);for(let i of t){let t=Math.abs(e-i);t<a-1e-9&&(a=t,l=i)}return l}function eG5(e,t){let l,a,i,n=new Date(`${e}T00:00:00`);if(Number.isNaN(n.getTime()))return{date:e,time:eG8(t)};let s=Math.round(60*t);return n.setMinutes(n.getMinutes()+s),{date:(l=n.getFullYear(),a=`${n.getMonth()+1}`.padStart(2,"0"),i=`${n.getDate()}`.padStart(2,"0"),`${l}-${a}-${i}`),time:`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}`}}function eG7(e){let t=eG0(e);if(t&&Array.isArray(t.resource_ids))return{status:eG4(t.status,0),resource_ids:t.resource_ids.map(e=>Number(e)).filter(e=>Number.isFinite(e))}}function eG9(e){return eG0(e.raw)||{}}function eQe(e){return{form_id:e.form_id,relation_type:e.relation_type,relation_id:e.relation_id,capacity:eG4(e.capacity,0),like_status:e.like_status,metadata:eG3(e),children:eG2(e.children).map(eQe)}}let eQt=null;function eQl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en";eN.init(eGX,e||"en")}function eQa(e){return eN.getText(e)}function eQi(e,t){return Object.keys(t).reduce((e,l)=>e.replace(RegExp(`\\{${l}\\}`,"g"),String(t[l])),eQa(e))}function eQn(){if(!eQt)return;let{container:e}=eQt;eQt=null,iM().unmountComponentAtNode(e),document.body.contains(e)&&document.body.removeChild(e)}eQl();let eQs=e=>{var t,l,a,i;let{options:n,onResolve:s,onReject:r}=e,o=ik();eQl((null==o||null==(l=o.engine)||null==(t=l.props)?void 0:t.locale)||"en");let{item:d,courts:c=[],visibleCourts:u,bookings:p=[],selectedCustomer:m=null,title:g=eQa("pisell-reservation.booking-change.title"),description:h=eQa("pisell-reservation.booking-change.description"),confirmText:v=eQa("pisell-reservation.booking-change.confirm"),cancelText:f=eQa("pisell-reservation.booking-change.cancel"),closeOnBackdrop:y=!0,zIndex:x=1072,theme:b="dark"}=n,_=(0,ef.useRef)(null),k=(0,ef.useRef)(!1),w=(0,ef.useRef)(null),[j,S]=(0,ef.useState)(!1),[M,N]=(0,ef.useState)(!1),[C,T]=(0,ef.useState)(""),[P,A]=(0,ef.useState)({targetCourtId:n.targetCourtId,targetDate:n.targetDate,targetHour:n.targetHour}),D=null==o||null==(i=o.appHelper)||null==(a=i.utils)?void 0:a.request,[I,E]=(0,ef.useState)([]),z=(0,ef.useMemo)(()=>{let e;return"string"==typeof(e=eG9(d).order_id)||"number"==typeof e?e:null},[d]),L=(0,ef.useMemo)(()=>{let e;return(e=eG2(eG9(d).resources)).length>0?e.map(eQe):eG2(d.resources).map(eQe)},[d]);(0,ef.useEffect)(()=>{D&&z_.Em.setRequest(D)},[D]);let{data:O}=rP(async()=>{let e=await z_.Em.getRequest().get(`/shop/order/appointment/${z}`,{});return eG0(null==e?void 0:e.data)},{ready:!!(D&&z),refreshDeps:[D,z]}),R=(0,ef.useMemo)(()=>{var e,t;if(!O)return[];let l=eG2(null==(e=eG0(O.bookings))?void 0:e.list),a=String(null==(t=d.raw)?void 0:t.id),i=l.find(e=>String(e.id)===a);return i?eG2(i.event_resources):[]},[O,d]),$=(0,ef.useMemo)(()=>{let e=new Map(L.map(e=>[String(e.form_id),e.metadata.form_name||""]));for(let t of R){let l=String((eG0(t.metadata)||{}).form_name||"");l&&e.set(String(t.form_id),l)}return e},[R,L]);(0,ef.useEffect)(()=>{0!==R.length&&E(R.map(e=>String(e.relation_id)===d.courtId?P.targetCourtId:String(e.relation_id)))},[R]);let F=(0,ef.useMemo)(()=>{let e=(u&&u.length>0?u:c)||[];return e.length>0?e:Array.from(new Set([d.courtId,n.targetCourtId].filter(Boolean))).map(e=>({id:e,name:e}))},[c,d.courtId,n.targetCourtId,u]),{data:B=[],loading:H}=rP(async()=>{let e=await z_.Em.getRequest().get("/shop/schedule/resource/list",{date:P.targetDate});return(function(e){if(Array.isArray(e))return eG2(e);let t=eG0(e);return Array.isArray(null==t?void 0:t.list)?eG2(t.list):Array.isArray(null==t?void 0:t.data)?eG2(t.data):[]})(null==e?void 0:e.data).map(e=>(function(e,t){let l=eG1(e.id),a=eG1(e.main_field);if(!l||!a)return null;let i=eG7(e.combined_resource);return{id:l,name:a,form_id:e.form_id,relation_id:e.id,resource_id:e.id,relation_type:"form",capacity:eG4(e.capacity,0),like_status:"common",metadata:{form_name:t,resource_name:a,...i?{combined_resource:i}:{}},raw:e}})(e,$.get(String(e.form_id))||"")).filter(Boolean)},{ready:!!D,refreshDeps:[D,P.targetDate]}),q=(0,ef.useMemo)(()=>(function(e){let t=new Map;for(let l of e)for(let e of l)(null==e?void 0:e.id)&&t.set(e.id,{...t.get(e.id),...e,metadata:{...eG3(t.get(e.id)),...eG3(e)}});return Array.from(t.values())})([F,B]),[F,B]),V=(0,ef.useMemo)(()=>new Map(q.map(e=>[e.id,{id:e.id,name:e.name,form_id:e.form_id,relation_id:e.relation_id,relation_type:e.relation_type,resource_id:e.resource_id,capacity:eG4(e.capacity,0),like_status:e.like_status,metadata:eG3(e),raw:eG0(e.raw)}])),[q]),Y=(0,ef.useMemo)(()=>(function(e){var t;let{orderDetail:l,selectedCustomer:a,fallbackCustomerText:i}=e;if(a)return a;let n=(null==l?void 0:l.customer_with_extra)||(null==l?void 0:l.customer),s=null==l?void 0:l.contacts_info;return{name:(null==n?void 0:n.display_name)||(null==n?void 0:n.nickname)||i,phone:(null==s||null==(t=s.phone)?void 0:t.phone)||(null==n?void 0:n.phone)||"",email:(null==s?void 0:s.email)||(null==n?void 0:n.email)||"",memberId:(null==n?void 0:n.member_id)||""}})({orderDetail:O,selectedCustomer:m,fallbackCustomerText:eQa("pisell-reservation.booking-change.fallback-customer")}),[m,O]),U=(0,ef.useMemo)(()=>n.hourSlots&&n.hourSlots.length>0?n.hourSlots:Array.from({length:24},(e,t)=>t),[n.hourSlots]),W=n.formatHourLabel||eG8,G=n.isBusinessHour||(()=>!0),Q=(0,ef.useMemo)(()=>{let e=U.filter(e=>G(e));return e.length>0?e:U},[U,G]),K=(0,ef.useMemo)(()=>(function(e){if(e.length<2)return 1;let t=[...e].sort((e,t)=>e-t),l=1/0;for(let e=1;e<t.length;e+=1){let a=t[e]-t[e-1];a>0&&a<l&&(l=a)}return Number.isFinite(l)?l:1})(U),[U]),J=n.firstTimelineHour??Math.min(...U)??0,Z=n.endTimelineExclusive??Math.max(...U)+K,X=(0,ef.useRef)(null);(0,ef.useLayoutEffect)(()=>{if(0===Q.length)return;let e=`${d.id}|${n.targetDate}|${n.targetCourtId}|${n.targetHour}|${Q.join(",")}`;if(X.current===e)return;let t=d.endHour-d.startHour;if(!Number.isFinite(t)||t<0){X.current=e;return}let l=function(e,t,l){if(!Number.isFinite(t)||t<0||0===l.length)return e;let a=eG6(e+t,l),i=eG6(a-t,l),n=eG6(i+t,l);return eG6(n-t,l)}(n.targetHour,t,Q);X.current=e,Math.abs(l-n.targetHour)>.001&&A(e=>({...e,targetHour:l}))},[Q,d.endHour,d.id,d.startHour,n.targetCourtId,n.targetDate,n.targetHour]);let ee=d.endHour-d.startHour,et=P.targetHour,el=et+ee,ea=Q.find(e=>.001>Math.abs(e-et))??eG6(et,Q),ei=Q.find(e=>.001>Math.abs(e-el))??eG6(el,Q),en=d.date,es=W(d.startHour),er=W(d.endHour),eo=R.some((e,t)=>void 0!==I[t]&&I[t]!==String(e.relation_id)),ed=R.length>0?eo:d.courtId!==P.targetCourtId,ec=en!==P.targetDate||d.startHour!==et||ed,eu=d.date!==n.targetDate||d.startHour!==n.targetHour||d.courtId!==n.targetCourtId,ep=n.hasConflict||(()=>!1),em=ep(p,P.targetCourtId,P.targetDate,et,el,d.id),eg=(e,t)=>{k.current||(k.current=!0,S(!1),w.current=window.setTimeout(()=>{"resolve"===e?s(t):r(t)},180))},eh=e=>{M||eg("reject",{type:e})};(0,ef.useEffect)(()=>{let e=window.requestAnimationFrame(()=>{S(!0)}),t=document.body.style.overflow;document.body.style.overflow="hidden";let l=e=>{"Escape"===e.key&&eh("escape")};return window.addEventListener("keydown",l),()=>{window.cancelAnimationFrame(e),window.removeEventListener("keydown",l),document.body.style.overflow=t,w.current&&window.clearTimeout(w.current)}},[]);let ey=async()=>{if(em||M)return;T("");let e={item:d,original:{targetCourtId:n.targetCourtId,targetDate:n.targetDate,targetHour:n.targetHour},draft:P,customer:Y,duration:ee,nextEndHour:el,changed:ec,submitPayload:function(e){let{item:t,draft:l,duration:a,nextEndHour:i,currentEventResources:n,resourceCourtIds:s,resourceCourtMap:r,orderDetail:o}=e,d=eG9(t),c=eG3(d),u=eG5(l.targetDate,l.targetHour),p=eG5(l.targetDate,i),m={...c},g=n.map((e,t)=>{let l=s[t],a=String(e.relation_id);if(l&&l!==a){let t=r.get(l);if(t){var i;let l,a,n;return i=eQe(e),l={...i.metadata,...t.metadata,form_name:t.metadata.form_name,resource_name:t.metadata.resource_name},(a=eG7(t.metadata.combined_resource))?l.combined_resource=a:delete l.combined_resource,n=function(e,t){let l=eG7(e.metadata.combined_resource);if(!l||0===l.resource_ids.length)return;let a=l.resource_ids.map(e=>t.get(String(e))).filter(e=>!!e).map(e=>({form_id:e.form_id,relation_type:e.relation_type,relation_id:e.relation_id,capacity:e.capacity,like_status:e.like_status,metadata:{...e.metadata,form_name:e.metadata.form_name,resource_name:e.metadata.resource_name}}));return a.length>0?a:void 0}(t,r),{form_id:t.form_id,relation_type:t.relation_type,relation_id:t.relation_id,capacity:t.capacity,like_status:t.like_status,metadata:l,...n?{children:n}:{}}}}return function e(t){let l=eG2(t.children).map(e);return{form_id:t.form_id,relation_type:t.relation_type||"form",relation_id:t.relation_id,capacity:eG4(t.capacity,0),like_status:t.like_status||"common",metadata:eG0(t.metadata)||{},...l.length>0?{children:l}:{}}}(e)});return{id:d.id,relation_id:d.relation_id,like_status:d.like_status,relation_type:d.relation_type,is_all:eG4(d.is_all,0),schedule_id:function(e,t){var l;let a=e.schedule_id;if(null!=a&&""!==a)return a;let i=e.id;if(null==i||""===i)return;let n=((null==t||null==(l=t.bookings)?void 0:l.list)||[]).find(e=>String(null==e?void 0:e.id)===String(i));return null==n?void 0:n.schedule_id}(d,o),sub_type:d.sub_type,select_date:l.targetDate,number:d.number,metadata:m,resources:g,start_date:u.date,start_time:u.time,end_date:p.date,end_time:p.time,duration:Math.max(0,Math.round(60*a))}}({item:d,draft:P,duration:ee,nextEndHour:el,currentEventResources:R,resourceCourtIds:I,resourceCourtMap:V,orderDetail:O})};if(!n.onSubmit)return void eg("resolve",e);N(!0);try{let t=await n.onSubmit({...e,options:n});eg("resolve",{...e,submitResult:t})}catch(e){T((null==e?void 0:e.message)||n.submitErrorMessage||eQa("pisell-reservation.booking-change.submit-failed"))}finally{N(!1)}};return(0,ev.jsx)("div",{className:["pisell-booking-change-modal",j?"is-visible":"","light"===b?"is-light":"is-dark"].filter(Boolean).join(" "),style:{zIndex:x},onMouseDown:e=>{e.target===e.currentTarget&&y&&eh("backdrop")},children:(0,ev.jsxs)("div",{ref:_,className:"pisell-booking-change-modal__panel",onMouseDown:e=>e.stopPropagation(),children:[(0,ev.jsx)("div",{className:"pisell-booking-change-modal__title",children:g}),(0,ev.jsx)("div",{className:"pisell-booking-change-modal__description",children:h}),(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__body",children:[(0,ev.jsx)("div",{className:"pisell-booking-change-modal__card",children:(0,ev.jsx)("div",{className:"pisell-booking-change-modal__customer",children:(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__customer-info",children:[(0,ev.jsx)("div",{className:"pisell-booking-change-modal__section-label",children:eQa("pisell-reservation.booking-change.customer")}),(0,ev.jsx)("div",{className:"pisell-booking-change-modal__customer-name",children:Y.name}),(0,ev.jsx)("div",{className:"pisell-booking-change-modal__customer-meta",children:Y.phone||eQa("pisell-reservation.booking-change.no-phone")}),(0,ev.jsx)("div",{className:"pisell-booking-change-modal__customer-meta",children:Y.email||eQa("pisell-reservation.booking-change.no-email")}),Y.memberId&&(0,ev.jsx)("div",{className:"pisell-booking-change-modal__customer-meta",children:Y.memberId})]})})}),(0,ev.jsx)("div",{className:"pisell-booking-change-modal__grid",children:(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__field",style:{gridColumn:"1 / -1"},children:[(0,ev.jsx)("label",{className:"pisell-booking-change-modal__field-label",children:eQa("pisell-reservation.booking-change.new-date")}),(0,ev.jsx)("input",{type:"date",value:P.targetDate,onChange:e=>A(t=>({...t,targetDate:e.target.value})),className:"pisell-booking-change-modal__control"})]})}),(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__grid",children:[(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__field",children:[(0,ev.jsx)("label",{className:"pisell-booking-change-modal__field-label",children:eQa("pisell-reservation.booking-change.new-start-time")}),(0,ev.jsx)("select",{value:ea,onChange:e=>A(t=>({...t,targetHour:Number(e.target.value)})),className:"pisell-booking-change-modal__control",children:Q.map(e=>{let t=e+ee>Z||ep(p,P.targetCourtId,P.targetDate,e,e+ee,d.id);return(0,ev.jsx)("option",{value:e,disabled:t,children:t?eQi("pisell-reservation.booking-change.unavailable-time",{time:W(e)}):W(e)},e)})})]}),(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__field",children:[(0,ev.jsx)("label",{className:"pisell-booking-change-modal__field-label",children:eQa("pisell-reservation.booking-change.new-end-time")}),(0,ev.jsx)("select",{value:ei,onChange:e=>{let t=Number(e.target.value);A(e=>({...e,targetHour:t-ee}))},className:"pisell-booking-change-modal__control",children:Q.map(e=>{let t=e-ee,l=t<J||ep(p,P.targetCourtId,P.targetDate,t,e,d.id);return(0,ev.jsx)("option",{value:e,disabled:l,children:l?eQi("pisell-reservation.booking-change.unavailable-time",{time:W(e)}):W(e)},`end-${e}`)})})]})]}),R.length>0&&(0,ev.jsx)("div",{className:"pisell-booking-change-modal__grid",children:R.map((e,t)=>{let l=eG0(e.metadata)||{},a=String(l.form_name||e.form_id),i=String(e.relation_id),n=String(l.resource_name||i),s=B.filter(t=>String(t.form_id)===String(e.form_id)),r=s.some(e=>e.id===i);return(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__field",children:[(0,ev.jsx)("label",{className:"pisell-booking-change-modal__field-label",children:a}),(0,ev.jsxs)("select",{value:I[t]??i,onChange:e=>{let l=e.target.value;E(e=>{let a=[...e];return a[t]=l,a})},disabled:H,className:"pisell-booking-change-modal__control",children:[!r&&(0,ev.jsx)("option",{value:i,children:n}),s.map(e=>(0,ev.jsx)("option",{value:e.id,children:e.name},e.id))]})]},t)})}),ec&&(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__card",children:[(0,ev.jsx)("div",{className:"pisell-booking-change-modal__section-label",children:eQa("pisell-reservation.booking-change.previous-booking-info")}),(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__compare-grid",children:[(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__compare-card",children:[(0,ev.jsx)("div",{className:"pisell-booking-change-modal__compare-title",children:eQa("pisell-reservation.booking-change.original")}),(0,ev.jsx)("div",{className:"pisell-booking-change-modal__compare-value",children:en}),(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__compare-value",children:[es," - ",er]}),R.length>0&&(0,ev.jsx)("div",{className:"pisell-booking-change-modal__resource-list",children:R.map((e,t)=>(0,ev.jsx)("div",{className:"pisell-booking-change-modal__resource-item",children:(0,ev.jsx)("div",{className:"pisell-booking-change-modal__resource-name",children:String((eG0(e.metadata)||{}).resource_name||e.relation_id)})},t))})]}),(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__compare-card is-highlighted",children:[(0,ev.jsx)("div",{className:"pisell-booking-change-modal__compare-title",children:eu?eQa("pisell-reservation.booking-change.drop-target"):eQa("pisell-reservation.booking-change.updated")}),(0,ev.jsx)("div",{className:"pisell-booking-change-modal__compare-value",children:P.targetDate}),(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__compare-value",children:[W(et)," - ",W(el)]}),R.length>0&&(0,ev.jsx)("div",{className:"pisell-booking-change-modal__resource-list",children:R.map((e,t)=>{let l=I[t],a=String(e.relation_id),i=String((eG0(e.metadata)||{}).resource_name||a);if(l&&l!==a){let e=V.get(l);e&&(i=String(e.metadata.resource_name||e.name))}return(0,ev.jsx)("div",{className:"pisell-booking-change-modal__resource-item",children:(0,ev.jsx)("div",{className:"pisell-booking-change-modal__resource-name",children:i})},t)})})]})]})]})]}),em&&(0,ev.jsx)("div",{className:"pisell-booking-change-modal__error",children:eQa("pisell-reservation.booking-change.conflict")}),!em&&C&&(0,ev.jsx)("div",{className:"pisell-booking-change-modal__error",children:C}),(0,ev.jsxs)("div",{className:"pisell-booking-change-modal__footer",children:[(0,ev.jsx)("button",{type:"button",onClick:()=>eh("cancel"),disabled:M,className:"pisell-booking-change-modal__ghost-button",children:f}),(0,ev.jsx)("button",{type:"button",disabled:em||M||H,onClick:ey,className:"pisell-booking-change-modal__primary-button",children:M?eQa("pisell-reservation.booking-change.submitting"):v})]})]})})},eQr=function(e){if("u"<typeof window||"u"<typeof document)return Promise.reject({type:"programmatic-close",message:eQa("pisell-reservation.booking-change.browser-only")});eQt&&function(e){if(!eQt)return;let{reject:t}=eQt;eQn(),t(e)}({type:"replaced",message:eQa("pisell-reservation.booking-change.replaced")});let t=document.createElement("div");return document.body.appendChild(t),new Promise((l,a)=>{eQt={container:t,reject:a},iM().render((0,ev.jsx)(eQs,{options:e,onResolve:e=>{eQn(),l(e)},onReject:e=>{eQn(),a(e)}}),t)})};function eQo(e){return{id:e.id,courtId:e.courtId,date:e.date,startHour:e.startHour,endHour:e.endHour,name:e.name,kind:e.kind,phone:e.phone,raw:e.raw}}async function eQd(e){let{calendarItem:t,draft:l,calendarResources:a,calendarBookings:i,effectiveTimelineRange:n,anchorDate:s,slotStepMinutes:r,onSuccessRefresh:o}=e;if("booking"!==t.kind)return!1;let d=eQo(t),c=a.map(e=>({id:String(e.id),name:e.name,form_id:String(e.form_id??e.id),relation_id:String(e.id),resource_id:String(e.id),relation_type:"form"})),u=i.map(eQo),p=(0,lL.buildCalendarTimelineSlotStartsFromRange)(n,s,r),m=r/60,g=p[0]??0,h=p.length?p[p.length-1]+m:24;try{return await eQr({item:d,targetCourtId:l.targetCourtId,targetDate:l.targetDate,targetHour:l.targetHour,courts:c,visibleCourts:c,bookings:u,hourSlots:p,firstTimelineHour:g,endTimelineExclusive:h,theme:"dark",title:"确认调整预约",description:"拖拽后请确认场地、日期与时段,提交后生效。",confirmText:"确认改约",cancelText:"取消",getBookingDetailData:(e,t)=>{var l;return{customer:{name:e.name||"—",phone:"string"==typeof e.phone?e.phone:"",email:""},headerSummary:{customerName:e.name||"",resourceLabel:(null==(l=t.find(t=>t.id===e.courtId))?void 0:l.name)||e.courtId}}},isBusinessHour:e=>!!p.length&&p.some(t=>1e-6>Math.abs(t-e)),hasConflict:(e,t,l,a,i,n)=>e.some(e=>e.id!==n&&e.courtId===t&&e.date===l&&!(i<=e.startHour||a>=e.endHour)),onSubmit:async e=>{let t=function(e){let t=e.raw;if(!t)return null;for(let e of[t.order_id,t.booking_uid,t.booking_id,t.id])if(null!=e&&""!==String(e).trim())return"number"==typeof e?e:String(e);return null}(e.item);if(null==t)throw Error("无法解析订单编号,请从预约详情改约");await z_.Em.getRequest().put(`/shop/v1.1/order/appointment/child-booking/${t}`,e.submitPayload),await o(),ex.message.success("改约已保存")}}),!0}catch{return!1}}let eQc={en:{"pisell-reservation.block-time.title":"Create blocked time","pisell-reservation.block-time.close-aria":"Close blocked time modal","pisell-reservation.block-time.field-title":"Title","pisell-reservation.block-time.field-note":"Note","pisell-reservation.block-time.field-resource":"Court","pisell-reservation.block-time.field-time-range":"Time range","pisell-reservation.block-time.placeholder-title":"Enter blocked time title","pisell-reservation.block-time.placeholder-note":"Optional","pisell-reservation.block-time.no-resource":"Please select a court","pisell-reservation.block-time.default-title":"Blocked time","pisell-reservation.block-time.cancel":"Cancel","pisell-reservation.block-time.confirm":"Save","pisell-reservation.block-time.submitting":"Saving...","pisell-reservation.block-time.warn-select-time":"Please select a valid blocked time range.","pisell-reservation.block-time.warn-end-after-start":"End time must be later than start time.","pisell-reservation.block-time.warn-select-resource":"Please select a valid court.","pisell-reservation.block-time.submit-failed":"Save failed. Please try again later.","pisell-reservation.block-time.browser-only":"blockTimeModal can only open in a browser environment.","pisell-reservation.block-time.replaced":"A new blockTimeModal replaced the current modal."},"zh-CN":{"pisell-reservation.block-time.title":"新建屏蔽时间","pisell-reservation.block-time.close-aria":"关闭屏蔽时间弹窗","pisell-reservation.block-time.field-title":"标题","pisell-reservation.block-time.field-note":"备注","pisell-reservation.block-time.field-resource":"场地","pisell-reservation.block-time.field-time-range":"时间范围","pisell-reservation.block-time.placeholder-title":"请输入屏蔽时间标题","pisell-reservation.block-time.placeholder-note":"选填","pisell-reservation.block-time.no-resource":"请选择场地","pisell-reservation.block-time.default-title":"屏蔽时间","pisell-reservation.block-time.cancel":"取消","pisell-reservation.block-time.confirm":"保存","pisell-reservation.block-time.submitting":"保存中...","pisell-reservation.block-time.warn-select-time":"请选择有效的屏蔽时间范围。","pisell-reservation.block-time.warn-end-after-start":"结束时间必须晚于开始时间。","pisell-reservation.block-time.warn-select-resource":"请选择有效的场地。","pisell-reservation.block-time.submit-failed":"保存失败,请稍后重试。","pisell-reservation.block-time.browser-only":"blockTimeModal 仅可在浏览器环境中打开。","pisell-reservation.block-time.replaced":"新的 blockTimeModal 已替换当前弹窗。"},"zh-HK":{"pisell-reservation.block-time.title":"新增屏蔽時間","pisell-reservation.block-time.close-aria":"關閉屏蔽時間彈窗","pisell-reservation.block-time.field-title":"標題","pisell-reservation.block-time.field-note":"備註","pisell-reservation.block-time.field-resource":"場地","pisell-reservation.block-time.field-time-range":"時間範圍","pisell-reservation.block-time.placeholder-title":"請輸入屏蔽時間標題","pisell-reservation.block-time.placeholder-note":"選填","pisell-reservation.block-time.no-resource":"請選擇場地","pisell-reservation.block-time.default-title":"屏蔽時間","pisell-reservation.block-time.cancel":"取消","pisell-reservation.block-time.confirm":"保存","pisell-reservation.block-time.submitting":"保存中...","pisell-reservation.block-time.warn-select-time":"請選擇有效的屏蔽時間範圍。","pisell-reservation.block-time.warn-end-after-start":"結束時間必須晚於開始時間。","pisell-reservation.block-time.warn-select-resource":"請選擇有效的場地。","pisell-reservation.block-time.submit-failed":"保存失敗,請稍後重試。","pisell-reservation.block-time.browser-only":"blockTimeModal 僅可在瀏覽器環境中開啟。","pisell-reservation.block-time.replaced":"新的 blockTimeModal 已取代目前彈窗。"}},{RangePicker:eQu}=ex.DatePicker,eQp=null;function eQm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en";eN.init(eQc,e||"en")}function eQg(e){return eN.getText(e)}function eQh(){if(!eQp)return;let{container:e}=eQp;eQp=null,iM().unmountComponentAtNode(e),document.body.contains(e)&&document.body.removeChild(e)}eQm();let eQv=e=>{var t,l;let{options:a,onResolve:i,onReject:n}=e,s=ik();eQm((null==s||null==(l=s.engine)||null==(t=l.props)?void 0:t.locale)||"en");let{resources:r,initialName:o,initialNote:d="",initialResourceId:c,initialTimeRange:u=null,blockedSalesChannels:p=["online_store"],minuteStep:m=60,title:g=eQg("pisell-reservation.block-time.title"),confirmText:h=eQg("pisell-reservation.block-time.confirm"),cancelText:v=eQg("pisell-reservation.block-time.cancel"),closeOnBackdrop:f=!0,zIndex:y=1072,theme:x="dark"}=a,b=(0,ef.useRef)(!1),_=(0,ef.useRef)(null),[k,w]=(0,ef.useState)(!1),[j,S]=(0,ef.useState)(!1),[M,N]=(0,ef.useState)(""),[C,T]=(0,ef.useState)({name:o||eQg("pisell-reservation.block-time.default-title"),note:d,resourceId:null==c?"":String(c),timeRange:u}),P=(0,ef.useMemo)(()=>{let e=Math.round(Number(m));return!Number.isFinite(e)||e<1||e>=60?60:Math.max(1,e)},[m]),A=(0,ef.useMemo)(()=>Array.isArray(r)?r:[],[r]),D=(e,t)=>{b.current||(b.current=!0,w(!1),_.current=window.setTimeout(()=>{"resolve"===e?i(t):n(t)},180))},I=e=>{j||D("reject",{type:e})};(0,ef.useEffect)(()=>{let e=window.requestAnimationFrame(()=>{w(!0)}),t=document.body.style.overflow;document.body.style.overflow="hidden";let l=e=>{"Escape"===e.key&&I("escape")};return window.addEventListener("keydown",l),()=>{window.cancelAnimationFrame(e),window.removeEventListener("keydown",l),document.body.style.overflow=t,_.current&&window.clearTimeout(_.current)}},[]);let E=async()=>{if(j)return;N("");let e=function(e,t){var l,a;if(!(null==(l=e.timeRange)?void 0:l[0])||!(null==(a=e.timeRange)?void 0:a[1]))return ex.message.warning(eQg("pisell-reservation.block-time.warn-select-time")),null;let[i,n]=e.timeRange;if(!n.isAfter(i))return ex.message.warning(eQg("pisell-reservation.block-time.warn-end-after-start")),null;let s=Number(e.resourceId);return!Number.isFinite(s)||s<=0?(ex.message.warning(eQg("pisell-reservation.block-time.warn-select-resource")),null):{name:e.name.trim()||eQg("pisell-reservation.block-time.default-title"),note:e.note.trim(),resource_ids:[s],blocked_sales_channels:t,start_time:i.format("YYYY-MM-DD HH:mm"),end_time:n.format("YYYY-MM-DD HH:mm")}}(C,p);if(!e)return;let t={draft:C,submitPayload:e};if(!a.onSubmit)return void D("resolve",t);S(!0);try{let l=await a.onSubmit({draft:C,submitPayload:e,options:a});if(!1===l)return;D("resolve",{...t,submitResult:l})}catch(t){let e=a.submitErrorMessage||eQg("pisell-reservation.block-time.submit-failed");N((null==t?void 0:t.message)||e)}finally{S(!1)}};return(0,ev.jsx)("div",{className:["pisell-block-time-modal",k?"is-visible":"","light"===x?"is-light":"is-dark"].filter(Boolean).join(" "),style:{zIndex:y},onMouseDown:e=>{e.target===e.currentTarget&&f&&I("backdrop")},children:(0,ev.jsxs)("div",{className:"pisell-block-time-modal__panel",onMouseDown:e=>e.stopPropagation(),children:[(0,ev.jsxs)("div",{className:"pisell-block-time-modal__header",children:[(0,ev.jsx)("div",{className:"pisell-block-time-modal__title",children:g}),(0,ev.jsx)("button",{type:"button","aria-label":eQg("pisell-reservation.block-time.close-aria"),onClick:()=>I("cancel"),className:"pisell-block-time-modal__close",children:(0,ev.jsx)("span",{className:"pisell-block-time-modal__close-icon",children:(0,ev.jsx)(u6,{})})})]}),(0,ev.jsxs)("div",{className:"pisell-block-time-modal__body",children:[(0,ev.jsxs)("div",{className:"pisell-block-time-modal__field",children:[(0,ev.jsx)("label",{className:"pisell-block-time-modal__label",children:eQg("pisell-reservation.block-time.field-title")}),(0,ev.jsx)("input",{value:C.name,onChange:e=>T(t=>({...t,name:e.target.value})),placeholder:eQg("pisell-reservation.block-time.placeholder-title"),className:"pisell-block-time-modal__control"})]}),(0,ev.jsxs)("div",{className:"pisell-block-time-modal__field",children:[(0,ev.jsx)("label",{className:"pisell-block-time-modal__label",children:eQg("pisell-reservation.block-time.field-note")}),(0,ev.jsx)("input",{value:C.note,onChange:e=>T(t=>({...t,note:e.target.value})),placeholder:eQg("pisell-reservation.block-time.placeholder-note"),className:"pisell-block-time-modal__control"})]}),(0,ev.jsxs)("div",{className:"pisell-block-time-modal__field",children:[(0,ev.jsx)("label",{className:"pisell-block-time-modal__label",children:eQg("pisell-reservation.block-time.field-resource")}),(0,ev.jsxs)("select",{value:C.resourceId,onChange:e=>T(t=>({...t,resourceId:e.target.value})),className:"pisell-block-time-modal__control",children:[(0,ev.jsx)("option",{value:"",children:eQg("pisell-reservation.block-time.no-resource")}),A.map(e=>(0,ev.jsx)("option",{value:String(e.id),children:e.name},String(e.id)))]})]}),(0,ev.jsxs)("div",{className:"pisell-block-time-modal__field",children:[(0,ev.jsx)("label",{className:"pisell-block-time-modal__label",children:eQg("pisell-reservation.block-time.field-time-range")}),(0,ev.jsx)(eQu,{...{className:"pisell-block-time-modal__range",style:{width:"100%"},showTime:{format:"HH:mm",minuteStep:P},format:"YYYY-MM-DD HH:mm",value:C.timeRange??void 0,onChange:e=>T(t=>({...t,timeRange:e??null}))}})]})]}),M&&(0,ev.jsx)("div",{className:"pisell-block-time-modal__error",children:M}),(0,ev.jsxs)("div",{className:"pisell-block-time-modal__footer",children:[(0,ev.jsx)("button",{type:"button",disabled:j,onClick:()=>I("cancel"),className:"pisell-block-time-modal__ghost-button",children:v}),(0,ev.jsx)("button",{type:"button",disabled:j,onClick:()=>void E(),className:"pisell-block-time-modal__primary-button",children:j?eQg("pisell-reservation.block-time.submitting"):h})]})]})})},eQf=function(e){if("u"<typeof window||"u"<typeof document)return Promise.reject({type:"programmatic-close",message:eQg("pisell-reservation.block-time.browser-only")});eQp&&function(e){if(!eQp)return;let{reject:t}=eQp;eQh(),t(e)}({type:"replaced",message:eQg("pisell-reservation.block-time.replaced")});let t=document.createElement("div");return document.body.appendChild(t),new Promise((l,a)=>{eQp={container:t,reject:a},iM().render((0,ev.jsx)(eQv,{options:e,onResolve:e=>{eQh(),l(e)},onReject:e=>{eQh(),a(e)}}),t)})};function eQy(e){let{raw:t,tableRow:l}=e,[,a]=(0,ef.useReducer)(e=>e+1,0);(0,ef.useEffect)(()=>{let e=window.setInterval(()=>a(),6e4);return()=>window.clearInterval(e)},[]);let i=(0,ef.useMemo)(()=>eYG(t,l),[t,l]),n=(0,ef.useMemo)(()=>eYW(t),[t]);return(0,ev.jsx)("div",{className:"pisell-res-floor-room-card",style:{width:"100%",height:"100%",overflow:"hidden",boxSizing:"border-box",minHeight:0,minWidth:0,display:"flex",flexDirection:"column"},children:(0,ev.jsx)("div",{style:{flex:1,minWidth:0,minHeight:0,width:"100%",display:"flex",flexDirection:"column"},children:(0,ev.jsx)(eU_,{data:i,shellShape:"rect",hideHeader:!0,hideHeaderCapacity:!0,headerMainFieldOverride:n})})})}function eQx(e){let{args:t,tables:l,calendarDragSuppressDetailRef:a}=e,i=t.booking.item,n=()=>{let e=a.current;null!=e.timer&&(clearTimeout(e.timer),e.timer=null),e.bookingId=i.id,e.timer=setTimeout(()=>{e.bookingId=null,e.timer=null},650)},s=e=>{let l=a.current;if(l.bookingId===i.id){l.bookingId=null,null!=l.timer&&(clearTimeout(l.timer),l.timer=null),e.preventDefault(),e.stopPropagation();return}e.stopPropagation(),t.onOpenDetail(i)};if("block"===i.kind)return(0,ev.jsx)("button",{type:"button",className:"absolute inset-0 rounded-2xl px-2 py-2 text-left",onClick:e=>{e.stopPropagation(),t.onOpenDetail(i)},children:(0,ev.jsx)("div",{className:"truncate text-sm font-medium",children:i.name})});let r=i.raw;if(!r)return(0,ev.jsx)("button",{type:"button",draggable:!0,onDragStart:e=>{e.stopPropagation(),t.onDragStart(i)},onDragEnd:e=>{e.stopPropagation(),n()},onClick:s,className:"absolute inset-0 rounded-2xl px-2 py-2 text-left",children:(0,ev.jsx)("div",{className:"truncate text-sm",children:i.name})});let o=eGs(r,l);return(0,ev.jsx)("div",{className:"absolute inset-0 min-h-0 cursor-grab overflow-hidden rounded-2xl active:cursor-grabbing",draggable:!0,onDragStart:e=>{e.stopPropagation(),t.onDragStart(i)},onDragEnd:e=>{e.stopPropagation(),n()},onClick:s,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),e.stopPropagation(),t.onOpenDetail(i))},role:"button",tabIndex:0,children:(0,ev.jsx)(eQy,{raw:r,tableRow:o??null,overlayWidthPx:t.overlayWidthPx})})}function eQb(e){let{value:t,onChange:l,options:a=[]}=e;return(0,ev.jsx)(ex.Select,{mode:"multiple",allowClear:!0,showSearch:!0,optionFilterProp:"label",placeholder:eN.getText(eWD),value:t??[],onChange:e=>null==l?void 0:l(e),options:a,style:{minWidth:260,maxWidth:420}})}let eQ_="pisell-reservation-mobile-table-col--booking-brief",eQk="pisell-reservation-mobile-table-col--order-info",eQw={customer:"pisell-reservation-mobile-table-col--customer",contact:"pisell-reservation-mobile-table-col--contact",holder_data:"pisell-reservation-mobile-table-col--holder-data"},eQj={booking_brief:124,relation_form_name:88,service_time:128,order_info:100,customer:96,contact:100,holder_data:88,services:88,number:72,appointment_form:92,booking_id:72,order_origin:96,updated:88,actions:72};function eQS(e,t){return e.map(e=>{if("rangePicker"!==String(e.type))return e;let l="object"==typeof e.props&&null!==e.props?{...e.props}:{},a="object"==typeof e.other&&null!==e.other?{...e.other}:{},i="object"==typeof a.formItemProps&&null!==a.formItemProps?a.formItemProps:{},n="string"==typeof l.placeholder?l.placeholder:"string"==typeof a.placeholder?a.placeholder:void 0;delete l.placeholder,delete a.placeholder,delete l.showTime,delete a.showTime;let s="object"==typeof i.style&&null!==i.style?i.style:{};return{...e,type:"custom",other:{...a,component:lL.PisellMobileDateRangePicker,formItemProps:{...i,...(null==t?void 0:t.rangeFormItemClassName)?{className:t_()(t.rangeFormItemClassName,"string"==typeof i.className?i.className:void 0)}:{},...(null==t?void 0:t.compactFormItem)?{style:{marginBottom:0,...s}}:{}}},props:{...l,format:"DD/MM/YYYY",...n?{placeholder:n}:{},...(null==t?void 0:t.rangePickerVariant)?{variant:t.rangePickerVariant}:{},style:{width:"100%",minWidth:0,maxWidth:"100%",..."object"==typeof l.style&&null!==l.style?l.style:{}}}}})}function eQM(e){let t=e.baseToolBar??{},l="string"==typeof t.className?t.className:void 0,a="object"==typeof t.search&&null!==t.search?t.search:{},i="string"==typeof a.containerClassName?a.containerClassName:void 0,n=t_()(i,"pisell-reservation-mobile-search-modal");return{...t,toolbarDensity:"compact-narrow",filter:"object"==typeof t.filter&&null!==t.filter?{...t.filter,phoneLayout:!0}:{phoneLayout:!0},quickFilter:!!e.quickFilterFilterList&&e.quickFilterFilterList.length>0&&{filterList:e.quickFilterFilterList},search:e.searchGetContainer?{...a,containerClassName:n,getContainer:e.searchGetContainer,modalWidth:"min(calc(100% - 24px), 360px)",modalStyle:{..."object"==typeof a.modalStyle&&null!==a.modalStyle&&!Array.isArray(a.modalStyle)?a.modalStyle:{},marginLeft:"auto",marginRight:"auto"}}:{...a,containerClassName:n},className:t_()(l,"pisell-record-board-toolbar--narrow-stack","pisell-reservation-mobile-table-toolbar")}}function eQN(e){let t=e??{},l=Array.isArray(t.columns)?t.columns:[],a=(0,lL.adaptColumnsForPhoneLayout)(l.map(e=>{var t,l,a;let i;return"order_info"!==String((a="service_time"!==String((l=!(i=eQw[String((t="booking_brief"!==String(e.key??e.dataIndex??"")?e:{...e,ellipsis:!1,className:t_()("string"==typeof e.className?e.className:void 0,eQ_),onCell:()=>({className:eQ_})}).key??t.dataIndex??"")])?t:{...t,ellipsis:!1,className:t_()("string"==typeof t.className?t.className:void 0,i),onCell:()=>({className:i})}).key??l.dataIndex??"")?l:{...l,className:t_()("string"==typeof l.className?l.className:void 0,"pisell-reservation-mobile-table-col--service-time")}).key??a.dataIndex??"")?a:{...a,ellipsis:!1,className:t_()("string"==typeof a.className?a.className:void 0,eQk),onCell:()=>({className:eQk})}}),{widthCapsByKey:eQj,defaultWidthRatio:.78}),{x:i,...n}="object"==typeof t.scroll&&null!==t.scroll?t.scroll:{};return{...t,columns:a,infiniteScroll:!1!==t.infiniteScroll,virtual:t.virtual,size:"small",className:t_()("string"==typeof t.className?t.className:void 0,"pisell-reservation-mobile-table-grid"),scroll:{...n,autoCalc:!0}}}let eQC=(0,ef.forwardRef)(function(e,t){let{router:l,app:a}=e,i=(0,ef.useMemo)(()=>l&&"object"==typeof l?Object.entries(l).reduce((e,t)=>{let[l,a]=t;if(!a||"object"!=typeof a)return e;let i=a.page_type,n=a.proCodeId;if("proCode"!==i||"string"!=typeof n||!eWO.has(n))return e;let s="string"==typeof a.page_name&&a.page_name.trim()?a.page_name.trim():l,r="string"==typeof a.router&&a.router.trim()?a.router.trim():l;return!r||r.toLowerCase().includes("food")||/\/:[^/]+/.test(r)||e.push({pageName:s,router:r}),e},[]):[],[l]),[n,s]=(0,ef.useState)(!1),r=i0(e=>{var t,l;e&&(s(!1),null==a||null==(l=a.history)||null==(t=l.push)||t.call(l,e))}),o=i0(()=>{1===i.length?r(i[0].router):s(!0)});(0,ef.useImperativeHandle)(t,()=>({requestOpen:o}),[o]);let d=i0(()=>{s(!1)});return(0,ev.jsx)(lL.PisellModal,{platform:"pc",open:n,title:eN.getText("pisell-reservation.new-modal-title"),onCancel:d,maskClosable:!0,footer:null,width:520,wrapClassName:"pisell-reservation-new-modal-wrap",destroyOnClose:!0,children:(0,ev.jsx)("div",{className:"pisell-reservation-new-modal-placeholder",children:i.length>0?(0,ev.jsx)("div",{className:"pisell-reservation-new-modal-route-list",children:i.map(e=>(0,ev.jsxs)("button",{type:"button",className:"pisell-reservation-new-modal-route-item",onClick:()=>r(e.router),children:[(0,ev.jsx)("span",{className:"pisell-reservation-new-modal-route-name",children:e.pageName}),(0,ev.jsx)(lL.Icon,{type:"icon-right-arrow",className:"pisell-reservation-new-modal-route-arrow"})]},`${e.router}-${e.pageName}`))}):(0,ev.jsx)("p",{className:"pisell-reservation-new-modal-empty",children:eN.getText("pisell-reservation.new-modal-placeholder")})})})});function eQT(e){try{return JSON.parse(JSON.stringify(e??{}))}catch{return{...e??{}}}}function eQP(e){let t=e.start_at;if("string"==typeof t&&t){let e=em()(t);if(e.isValid())return e.valueOf()}let l=eWx(e.start_date,e.start_time);if(l){let e=em()(l);if(e.isValid())return e.valueOf()}return 0}function eQA(e){let t=e.created_at;if("string"==typeof t&&t){let e=em()(t);if(e.isValid())return e.valueOf()}return 0}function eQD(e){if(!Array.isArray(e)||e.length<2)return null;let t=em()(e[0]),l=em()(e[1]);if(!t.isValid()||!l.isValid())return null;let a=t.valueOf(),i=l.valueOf();return a<=i?[a,i]:[i,a]}function eQI(e,t){if(!Array.isArray(t)||0===t.length)return!0;let l=new Set(t.map(e=>String(e)));return Array.isArray(e)?e.some(e=>l.has(String(e))):null!=e&&""!==e&&l.has(String(e))}function eQE(e,t){if(null==t||"object"!=typeof t||Array.isArray(t))return!0;let l=null!=t.min&&""!==t.min?Number(t.min):NaN,a=null!=t.max&&""!==t.max?Number(t.max):NaN,i=Number.isFinite(l),n=Number.isFinite(a);return!i&&!n||!!Number.isFinite(e)&&(!i||!(e<l))&&(!n||!(e>a))}function eQz(e){if(null==e||""===e)return null;if("number"==typeof e&&Number.isFinite(e))return e;let t=Number(String(e).replace(/,/g,"").trim());return Number.isFinite(t)?t:null}let eQL="pisell-reservation.floor-hud.interactive-title";function eQO(e,t){let l=0,a=0,i=0,n=0,s=0,r=0,o=t??{};for(let t of e){if(!function(e){let t=e.elementKind;return!!t&&t!==lL.FLOOR_MAP_IMAGE_ELEMENT_KIND&&t!==lL.FLOOR_MAP_STAGE_ELEMENT_KIND}(t))continue;l+=1;let e=eGG(t,o);if(!e){r+=1;continue}switch(e.cardStatus){case"available":default:a+=1;break;case"booked":i+=1;break;case"occupied":case"barBusy":n+=1;break;case"maintenance":s+=1}}return{total:l,idle:a,booked:i,occupied:n,maintenance:s,unbound:r}}function eQR(e){let t=[{label:eN.getText("pisell-reservation.floor-hud.total"),value:e.total},{label:eN.getText("pisell-reservation.room-status-empty"),value:e.idle},{label:eN.getText("pisell-reservation.room-status-reserved"),value:e.booked}];return e.occupied>0&&t.push({label:eN.getText("pisell-reservation.room-status-occupied"),value:e.occupied}),e.maintenance>0&&t.push({label:eN.getText("pisell-reservation.room-status-locked"),value:e.maintenance}),e.unbound>0&&t.push({label:eN.getText("pisell-reservation.room-status-unbound"),value:e.unbound}),t}function eQ$(e){return(0,ev.jsx)(ev.Fragment,{children:e.rows.map((e,t)=>(0,ev.jsxs)(ey().Fragment,{children:[t>0?(0,ev.jsx)("span",{className:"pisell-reservation-floor-map-hud-sep","aria-hidden":!0,children:"\xb7"}):null,(0,ev.jsxs)("span",{className:"pisell-reservation-floor-map-hud-inline-item",children:[(0,ev.jsx)("span",{className:"pisell-reservation-floor-map-hud-label",children:e.label}),(0,ev.jsx)("span",{className:"pisell-reservation-floor-map-hud-value",children:e.value})]})]},e.label))})}function eQF(e){let{items:t,dataSources:l,actionMode:a,onAction:i,embedded:n,className:s}=e,r=(0,ef.useMemo)(()=>eQO(t,l),[t,l]),o=(0,ef.useMemo)(()=>eQR(r),[r]);if(0===r.total){if("collapse"===a){let e=eN.getText("pisell-reservation.hud-collapse-aria"),t=eN.getText("pisell-reservation.hud-table-drawer-title");return(0,ev.jsx)("div",{className:t_()("pisell-reservation-floor-map-hud","pisell-reservation-floor-map-hud--interactive-title-bar",n&&"pisell-reservation-floor-map-hud--embedded","pisell-reservation-floor-map-hud-title-bar--minimal",s),role:"region","aria-label":t,children:(0,ev.jsxs)("div",{className:"pisell-reservation-floor-map-hud-title-bar-layout",children:[(0,ev.jsx)("span",{className:"pisell-reservation-floor-map-hud-heading",children:eN.getText(eQL)}),(0,ev.jsx)("div",{className:"pisell-reservation-floor-map-hud-title-bar-stats"}),(0,ev.jsx)("button",{type:"button",className:"pisell-reservation-floor-map-hud-chevron-btn","aria-expanded":!0,"aria-label":e,onClick:e=>{e.stopPropagation(),i()},children:(0,ev.jsx)(g0,{rotate:90})})]})})}return null}let d="expand"===a?eN.getText("pisell-reservation.hud-expand-aria"):eN.getText("pisell-reservation.hud-collapse-aria"),c=eN.getText("pisell-reservation.hud-table-drawer-title");return(0,ev.jsx)("div",{className:t_()("pisell-reservation-floor-map-hud","pisell-reservation-floor-map-hud--interactive-title-bar",n&&"pisell-reservation-floor-map-hud--embedded",s),role:"region","aria-label":c,children:(0,ev.jsxs)("div",{className:"pisell-reservation-floor-map-hud-title-bar-layout",children:[(0,ev.jsx)("span",{className:"pisell-reservation-floor-map-hud-heading",children:eN.getText(eQL)}),(0,ev.jsx)("div",{className:"pisell-reservation-floor-map-hud-title-bar-stats",children:(0,ev.jsx)(eQ$,{rows:o})}),(0,ev.jsx)("button",{type:"button",className:"pisell-reservation-floor-map-hud-chevron-btn","aria-expanded":"collapse"===a,"aria-label":d,onClick:e=>{e.stopPropagation(),i()},children:"expand"===a?(0,ev.jsx)(g0,{rotate:90}):(0,ev.jsx)(g0,{rotate:-90})})]})})}function eQB(e){let t=(0,ef.useMemo)(()=>eQO(e.items,e.dataSources),[e.items,e.dataSources]);if(e.interactive&&e.onRequestOpenTable){let l=!!e.tableDrawerOpen;return 0!==t.total||l?(0,ev.jsx)(eQF,{items:e.items,dataSources:e.dataSources,actionMode:l?"collapse":"expand",onAction:()=>{var t;return l?null==(t=e.onRequestCloseTable)?void 0:t.call(e):e.onRequestOpenTable()}}):null}if(0===t.total)return null;let l=eQR(t);return e.phoneLayout?(0,ev.jsx)("div",{className:t_()("pisell-reservation-floor-map-hud","pisell-reservation-floor-map-hud--phone-inline"),role:"status",children:(0,ev.jsx)("div",{className:"pisell-reservation-floor-map-hud-inline-stats",children:(0,ev.jsx)(eQ$,{rows:l})})}):(0,ev.jsx)("div",{className:"pisell-reservation-floor-map-hud",role:"status",children:(0,ev.jsx)("ul",{className:"pisell-reservation-floor-map-hud-list",children:l.map(e=>(0,ev.jsxs)("li",{className:"pisell-reservation-floor-map-hud-row",children:[(0,ev.jsx)("span",{className:"pisell-reservation-floor-map-hud-label",children:e.label}),(0,ev.jsx)("span",{className:"pisell-reservation-floor-map-hud-value",children:e.value})]},e.label))})})}function eQH(e){let{items:t,setItems:l}=e;return(0,ef.useEffect)(()=>{l(t)},[t,l]),null}function eQq(e){if("number"==typeof e&&Number.isFinite(e)){let t=Math.trunc(e);return t>0?String(t):null}if("string"==typeof e){let t=e.trim();if(!t||"0"===t)return null;let l=Number(t);if(Number.isFinite(l)&&l>0)return String(Math.trunc(l));if(/^\d+$/.test(t))return t}return null}function eQV(e){if(null==e||"string"!=typeof e)return"";let t=e.split(" ## ")[0];return(null==t?void 0:t.trim())??""}function eQY(e){let t=e.parent_id??e.parentId;if(null==t||""===t)return null;if("number"==typeof t&&Number.isFinite(t)){let e=Math.trunc(t);return e>0?String(e):null}return eQq(t)}function eQU(e,t){return e.keys.some(e=>t.has(e))}function eQW(e){let{value:t,onChange:l,buckets:a}=e,i=(0,ef.useMemo)(()=>new Set(Array.isArray(t)?t.map(String):[]),[t]),n=(0,ef.useCallback)(e=>{null==l||l(function(e,t){let l=new Set(t.map(String));if(eQU(e,l))for(let t of e.keys)l.delete(t);else for(let t of e.keys)l.add(t);return Array.from(l)}(e,Array.isArray(t)?t:[]))},[t,l]);return(0,ev.jsx)("div",{className:"reservation-bucket-button-group",children:a.map(e=>{let t=eQU(e,i);return(0,ev.jsxs)("button",{type:"button",title:e.label,className:t_()("reservation-bucket-button-group__item",{"reservation-bucket-button-group__item--checked":t}),onClick:()=>n(e),"aria-pressed":t,children:[(0,ev.jsx)("span",{className:"reservation-bucket-button-group__dot","aria-hidden":"true"}),(0,ev.jsx)("span",{className:"reservation-bucket-button-group__label",children:e.label})]},e.id)})})}function eQG(e){let t=(0,ef.useMemo)(()=>[{id:"on_site",label:eN.getText("pisell-reservation.booking-status-bucket-on-site"),keys:["arrived","started"]},{id:"no_show",label:eN.getText("pisell-reservation.booking-status-bucket-no-show"),keys:["no_show"]},{id:"completed",label:eN.getText("pisell-reservation.booking-status-bucket-completed"),keys:["completed"]}],[]);return(0,ev.jsx)(eQW,{value:e.value,onChange:e.onChange,buckets:t})}function eQQ(e){let t=(0,ef.useMemo)(()=>[{id:"unpaid",label:eN.getText("pisell-reservation.payment-status-bucket-unpaid"),keys:["unpaid","partially_paid","payment_processing"]},{id:"paid",label:eN.getText("pisell-reservation.payment-status-bucket-paid"),keys:["paid","partially_refunded","refunded"]}],[]);return(0,ev.jsx)(eQW,{value:e.value,onChange:e.onChange,buckets:t})}let eQK={style:{marginBottom:0}};function eQJ(){return(0,ev.jsxs)("div",{className:"reservation-hud-drawer-quick-filter-stack",children:[(0,ev.jsx)(ex.Form.Item,{name:"appointment_status",noStyle:!0,...eQK,children:(0,ev.jsx)(eQG,{})}),(0,ev.jsx)(ex.Form.Item,{name:"order_payment_status",noStyle:!0,...eQK,children:(0,ev.jsx)(eQQ,{})})]})}function eQZ(e){let t=e=>{if(!e)return!1;if(e.occupiedCardColor||e.availableCardColor)return!0;let t=e.statusToneOverrides;return null!=t&&Object.keys(t).length>0};return t(e.light)||t(e.dark)}function eQX(e){let t=new Set,l=[];for(let a of e){let e=String(a).trim();!e||t.has(e)||(t.add(e),l.push(e))}return l}function eQ0(e,t){let l={filterValuePatches:{}};if(!e)return l;try{let a=JSON.parse(e);if(Array.isArray(a))return{resourceIds:a.map(String),resourceWallResourceIdsInFile:!0,filterValuePatches:{}};if(!a||"object"!=typeof a)return l;let i=Object.prototype.hasOwnProperty.call(a,"resource_wall_resource_ids"),n=a.resource_wall_resource_ids,s=i?Array.isArray(n)?n.map(String):[]:void 0,r={},o=a.filter_values;if(o&&"object"==typeof o)for(let e of t)"resource_wall_resource_ids"!==e&&Object.prototype.hasOwnProperty.call(o,e)&&(r[e]=o[e]);let d=a.venueWallStatusToneOverrides,c=a.venueWallAppearanceTheme,u=c&&"object"==typeof c?c:void 0;!u&&d&&"object"==typeof d&&Object.keys(d).length>0&&(u={light:{statusToneOverrides:d},dark:{statusToneOverrides:d}});let p=a.venueWallAppearanceMode,m=function(e){if(null==e||"object"!=typeof e)return;let t=(e,t,l,a)=>{let i="number"==typeof e?e:Number(e);return Number.isFinite(i)?Math.max(t,Math.min(l,Math.round(i))):a},l="number"==typeof e.heroMaxWidthRatio?e.heroMaxWidthRatio:Number(e.heroMaxWidthRatio),a=Number.isFinite(l)?Math.max(.4,Math.min(.8,l)):lL.DEFAULT_RESOURCE_WALL_LAYOUT_PERSIST.heroMaxWidthRatio;return{layoutKey:"string"==typeof e.layoutKey&&e.layoutKey.length>0?e.layoutKey:lL.DEFAULT_RESOURCE_WALL_LAYOUT_PERSIST.layoutKey,customCols:t(e.customCols,1,6,lL.DEFAULT_RESOURCE_WALL_LAYOUT_PERSIST.customCols),customRows:t(e.customRows,1,6,lL.DEFAULT_RESOURCE_WALL_LAYOUT_PERSIST.customRows),pageDurationSec:t(e.pageDurationSec,3,60,lL.DEFAULT_RESOURCE_WALL_LAYOUT_PERSIST.pageDurationSec),boardingSoonBeforeMin:t(e.boardingSoonBeforeMin,1,60,lL.DEFAULT_RESOURCE_WALL_LAYOUT_PERSIST.boardingSoonBeforeMin),heroMaxWidthRatio:a}}(a.venueWallResourceLayout);return{resourceIds:s,resourceWallResourceIdsInFile:i,filterValuePatches:r,venueWallAppearanceTheme:u,venueWallAppearanceMode:"light"===p||"dark"===p?p:void 0,venueWallResourceLayout:m}}catch{return l}}let eQ2="transform 0.2s ease-out",eQ1=e=>{let{onClose:t,closeOffsetPx:l=80,drawerRef:a}=e,i=(0,ef.useRef)(null),n=(0,ef.useRef)(!1),s=(0,ef.useRef)(0),[r,o]=(0,ef.useState)(!1),d=(0,ef.useCallback)((e,t)=>{let l=null==a?void 0:a.current;if(!l)return;let i=e<0?0:e;l.style.transition=t?eQ2:"none",l.style.transform=0===i?"":`translateY(${i}px)`},[a]),c=(0,ef.useCallback)(()=>{let e=null==a?void 0:a.current;e&&(e.style.transition="",e.style.transform="")},[a]),u=(0,ef.useCallback)(e=>{0===e.button&&(i.current=e.clientY,n.current=!1,s.current=0,o(!0),e.currentTarget.setPointerCapture(e.pointerId))},[]),p=(0,ef.useCallback)(e=>{let t=i.current;if(null==t)return;let l=e.clientY-t;s.current=l,Math.abs(l)>4&&(n.current=!0),l>0?d(l,!1):d(0,!1)},[d]),m=(0,ef.useCallback)(e=>{let r=i.current;i.current=null,o(!1);try{e.currentTarget.releasePointerCapture(e.pointerId)}catch{}if(null==r)return void c();let u=s.current;if(!n.current){c(),t();return}if(u>=l){let e=null==a?void 0:a.current;e?(e.style.transition=eQ2,e.style.transform="translateY(100%)",window.setTimeout(()=>{t()},200)):t();return}d(0,!0);let p=null==a?void 0:a.current;if(p){let e=()=>{p.style.transition="",p.removeEventListener("transitionend",e)};p.addEventListener("transitionend",e)}},[d,l,a,t,c]),g=(0,ef.useCallback)(e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),t())},[t]);return(0,ev.jsx)("div",{className:"pisell-reservation-hud-drawer-handle"+(r?" pisell-reservation-hud-drawer-handle--dragging":""),role:"button",tabIndex:0,"aria-label":"Close drawer",onPointerDown:u,onPointerMove:p,onPointerUp:m,onPointerCancel:m,onKeyDown:g,children:(0,ev.jsx)("span",{className:"pisell-reservation-hud-drawer-handle-bar","aria-hidden":"true"})})};function eQ4(e){let{floorMapHudTableDrawer:t,showVenueHudDock:l,hudDrawerOpen:a,hudDrawerRef:i,hudMapItems:n,dataSources:s,handleOpenHudTableDrawer:r,closeHudTableDrawer:o,rowKey:d,hudDrawerPagedRows:c,hudDrawerLoading:u,hudDrawerFilteredTotal:p,hudDrawerBookingPagination:m,hudDrawerOnPageChange:g,hudDrawerLocalSearchParams:h,hudDrawerOnSearch:v,hudDrawerOnReset:f,hudDrawerGrid:y,hudDrawerToolBar:x,batchActionBar:b,hudDrawerResourceRootBuckets:_,handleHudDrawerFormRecordIdsChange:k}=e;return((0,ef.useLayoutEffect)(()=>{if("u"<typeof window)return;if(!a){let e=i.current;e&&(e.style.height="",e.style.maxHeight="");return}let e=i.current;if(!e)return;let t=function(e){let t=getComputedStyle(e).transform;if(!t||"none"===t)return 1;try{let e=new DOMMatrixReadOnly(t),l=Math.abs(e.a),a=Math.abs(e.d);if(!Number.isFinite(l)||!Number.isFinite(a)||Math.abs(l-a)>.03)return 1;return l>1e-6?l:1}catch{return 1}}(document.body);return t>0&&Math.abs(t-1)>.001?(e.style.height=`calc(98vh / ${t})`,e.style.maxHeight=`calc(98vh / ${t})`):(e.style.height="",e.style.maxHeight=""),()=>{let e=i.current;e&&(e.style.height="",e.style.maxHeight="")}},[a,i]),l)?(0,ev.jsxs)(ev.Fragment,{children:[a?null:(0,ev.jsx)("div",{className:"pisell-reservation-hud-title",role:"button",tabIndex:0,"aria-label":eN.getText(eWA),onClick:r,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),r())},children:(0,ev.jsx)(eQF,{items:n,dataSources:s,actionMode:"expand",onAction:r,embedded:!0,className:"pisell-reservation-hud-title-inner"})}),a?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("div",{className:"pisell-reservation-hud-drawer-mask",onClick:o,"aria-hidden":"true"}),(0,ev.jsxs)("div",{className:"pisell-reservation-hud-drawer",role:"dialog","aria-modal":"false","aria-label":eN.getText(eWA),ref:i,children:[(0,ev.jsx)(eQ1,{onClose:o,drawerRef:i}),(0,ev.jsx)("div",{className:"pisell-reservation-hud-drawer-record-board",children:(0,ev.jsxs)("div",{className:"pisell-reservation-hud-drawer-split",children:[(0,ev.jsx)("div",{className:"pisell-reservation-hud-drawer-split-main",children:(0,ev.jsx)(lL.PisellRecordBoard,{layoutVariant:"phone",columnVisibilityStorageKey:"pisell-reservation.hud-booking-drawer.columns.v2",rowKey:d,data:c,loading:u,total:p,pagination:m,onPageChange:g,searchParams:h,onSearch:v,onReset:f,grid:y,toolBar:x,batchActionBar:b,defaultBodyView:"grid",bodyViewSwitchable:!1,lockedBodyView:"grid",children:(0,ev.jsx)(lL.PisellRecordBoard.ShellFrame,{belowToolbar:void 0,children:(0,ev.jsx)(lL.PisellRecordBoard.GridLayout,{})})})}),null]})})]})]}):null]}):null}let eQ3={get:async()=>({data:{}}),post:async()=>({data:{}}),put:async()=>({data:{}}),remove:async()=>({data:{}}),custom:async()=>({data:{}})},eQ8=e=>{var t,l,a,i,n,s,r,o,d,c,u,p,m,g,h,v,f;let y,x,b,_,k,w,j,S,M,N,{gridDataSourceKey:C="tables",dataSources:T,scheduleValue:P,onScheduleChange:A,reservationBiz:D,associatedMenuListIds:I,toolBar:E,floorMap:z,scheduleStartSlot:L,scheduleEndSlot:O,onNewReservation:R,timeNavigatorProps:$,scheduleProps:F,fab:B,defaultBodyView:H,data:q,total:V,pagination:Y,onPageChange:U,onSearch:W,onReset:G,searchParams:Q,loading:K,rowKey:J="id",__id:Z,className:X,style:ee,floorPlanId:et,floorPlanCanvasWidth:el,floorPlanCanvasHeight:ea,floorPlanCode:ei,floorPlanName:en,floorPlanSort:es,floorPlanStatus:er,onFloorPlanPersisted:eo,putFloorPlan:ed,onFloorMapBookingClick:ec,bodyViewSwitchable:eu=!0,lockedBodyView:ep,bodyViewStorageKey:eg,floorMapHudTableDrawer:eh=!1,variant:eb,forceFollowWallClock:e_,resourceSelectMode:ek,...ew}=e,ej="phone"===eb,eS=null==q||Array.isArray(q)&&0===q.length&&void 0===V&&void 0===U,eM=null===et?null:void 0===et?1:et,eC=ik(),eT=null==eC||null==(l=eC.appHelper)||null==(t=l.utils)?void 0:t.request;z_.Em.setRequest(eT??eQ3);let eP=iw(),eA=(0,ef.useRef)(eP);eA.current=eP;let eD="function"==typeof(null==eP?void 0:eP.getModule),eI=(null==eC||null==(i=eC.engine)||null==(a=i.props)?void 0:a.locale)||"zh-CN",eE=null==eC||null==(r=eC.appHelper)||null==(s=r.utils)||null==(n=s.getApp)?void 0:n.call(s),ez=null==eE||null==(d=eE.router)||null==(o=d.getRoutes)?void 0:o.call(d),eL=null==eE||null==(u=eE.history)||null==(c=u.useParams)?void 0:c.call(u),eO=D??(null==eL?void 0:eL.business_code),eR=(0,ef.useMemo)(()=>{let e=null!=eO&&""!==eO?String(eO).trim():"";return e?{business_code:e}:{}},[eO]),{reservationRuleProduct:e$,reservationAssociatedMenuListIds:eF}=eCq(eC,eO),eB=I??eF,eq=eO||ei||"pisell_reservation",eV=(0,ef.useMemo)(()=>{let e=String(eI).toLowerCase();return e.startsWith("zh-cn")?"zh-cn":e.startsWith("zh-tw")||e.startsWith("zh-hk")?"zh-tw":"en"},[eI]),eY=(0,ef.useMemo)(()=>{try{var e,t,l,a,i,n,s,r;let o=null==eC||null==(s=eC.appHelper)||null==(n=s.utils)||null==(i=n.getApp)||null==(a=i.call(n))||null==(l=a.data)||null==(t=l.store)||null==(e=t.getStore)?void 0:e.call(t),d=null==o||null==(r=o.getDataByModel)?void 0:r.call(o,"core","core");return function(e){let t;if(null==e||"object"!=typeof e)return;null!=e.core&&"object"==typeof e.core&&(t=e.core.operating_day_boundary),null==t&&(t=e.operating_day_boundary);var l=t;if(null==l)return;if(!Array.isArray(l))return l;let a=e=>l.find(t=>null!=t&&"object"==typeof t&&String(t.type)===e);return a("start_time")??a("end_time")??l[0]}(d)}catch(e){return}},[eC]),eU=(0,ef.useMemo)(()=>{let e;return(e=eWR(eY))?{start:e,end:e}:{start:eWT.start,end:eWT.end}},[eY]),eW=(0,ef.useMemo)(()=>(null==$?void 0:$.range)??eU,[null==$?void 0:$.range,eU]);(0,ef.useEffect)(()=>{var e,t;let l=null==eC||null==(t=eC.appHelper)||null==(e=t.utils)?void 0:e.request;l&&z_.Em.setRequest(l)},[null==eC||null==(m=eC.appHelper)||null==(p=m.utils)?void 0:p.request]),eN.init(eWP,eI);let eG=(0,ef.useCallback)(()=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eWT;return eWU(em()().startOf("day"),e,t)})(eY,eW),[eY,eW]),eQ=(y=rP(i0(async()=>eCE({num:999})),{manual:!0}),(0,ef.useEffect)(()=>{eS&&y.run()},[eS,y.run]),x=(0,ef.useCallback)((e,t)=>{},[]),b=(0,ef.useCallback)(e=>{y.refresh()},[y]),_=(0,ef.useCallback)(()=>{y.refresh()},[y]),k=(0,ef.useCallback)(e=>{y.refresh()},[y]),w=(0,ef.useMemo)(()=>({}),[]),j=null==(h=y.data)?void 0:h.list,S=(0,ef.useMemo)(()=>Array.isArray(j)&&0!==j.length?j:eW$,[j]),M=(null==(v=y.data)?void 0:v.count)??0,N=(0,ef.useMemo)(()=>({pageNumber:1,pageSize:999}),[]),{data:S,loading:y.loading,total:M,pagination:N,onPageChange:x,searchParams:w,onSearch:b,onReset:_,refresh:y.refresh,refreshAsync:y.refreshAsync,patchSearchParams:k}),[eK,eJ]=(0,ef.useState)(()=>eGc(eg)),eZ=ep??eK,eX=eWW(eS&&"grid"===eZ,{listPageSize:20,getInitialSearchParams:eG,extraRequestParams:eR,subscribeRealtimePush:!0}),e0=(0,ef.useMemo)(()=>!!e_||"resourceWall"===ep||"resourceWall"===eK,[e_,ep,eK]),{baseFloorConfig:e2,floorPlanRemoteId:e1,setRemoteFloorPlanView:e4}=function(e){let{resolvedFloorPlanId:t,effectiveFloorPlanCode:l,gridDataSourceKey:a,floorMapConfigFromProp:i,engineLocale:n}=e,[s,r]=(0,ef.useState)(null),[o,d]=(0,ef.useState)(null),c=(0,ef.useRef)((0,eH.LP)("floor-plan-code"));(0,ef.useEffect)(()=>{if(null==t){r(null),d(null);return}r(null),d(null)},[t,l,a]);let u=(0,ef.useCallback)(e=>{var t,l;"number"==typeof e.id&&Number.isFinite(e.id)&&d(Math.trunc(e.id));let i=(0,lL.parseLayoutFieldToViewConfigPatch)(e.layout);i?r(i):Array.isArray(e.layout)&&e.layout.length>0&&r({sceneElements:(t=e.layout,l={canvasId:"main",dataSourceKey:a},(0,lL.shopLayoutToSceneElements)(t,{canvasId:l.canvasId,dataSourceKey:l.dataSourceKey,rectElementKind:eU4,circleElementKind:eU3}))})},[a]);return(0,lL.useShopFloorPlanSubscription)({enabled:null!=t,code:l,subscriberId:c.current,ensureByCode:eWo,unsubscribeQuery:eWr,onDetail:u,onLoadError:eWp}),{baseFloorConfig:(0,ef.useMemo)(()=>{var e,t,l;let a,n,r={canvases:[{id:eU7,name:eU0,order:0,enabled:!0},{id:eWt,name:eU2,order:1,enabled:!0},{id:"vip",name:eU1,order:2,enabled:!0}],canvasUi:{canCreate:!0,canEdit:!0},elementKindCategories:eU9(),elementKinds:eWe(),sceneElements:[]},o=i?{...r,...i,canvases:i.canvases??r.canvases,canvasUi:{...r.canvasUi,...i.canvasUi},elementKinds:eUZ(r.elementKinds??[],i.elementKinds),elementKindCategories:eUX(r.elementKindCategories??[],i.elementKindCategories),sceneElements:i.sceneElements??r.sceneElements,edges:i.edges??r.edges,datasourceComponents:i.datasourceComponents??r.datasourceComponents}:r;return null!=s&&(o=(0,lL.mergeFloorPlanViewRemote)(o,s)),a=null==(t=(e=o={...o,elementKinds:eUZ(r.elementKinds??[],o.elementKinds),elementKindCategories:eUX(r.elementKindCategories??[],o.elementKindCategories)}).elementKindCategories)?void 0:t.map(e=>"background"===e.id?{...e,label:eN.getText(eUY)}:"dining"===e.id?{...e,label:eN.getText(eUU)}:e),n=null==(l=e.elementKinds)?void 0:l.map(e=>e.value===lL.FLOOR_MAP_IMAGE_ELEMENT_KIND?{...e,label:eN.getText(eUq)}:e.value===lL.FLOOR_MAP_BUILTIN_SHAPE_ELEMENT_KIND?{...e,label:eN.getText(eUW)}:e.value===eU4?{...e,label:eN.getText(eUG)}:e.value===eU3?{...e,label:eN.getText(eUQ)}:e),{...e,elementKindCategories:a??e.elementKindCategories,elementKinds:n??e.elementKinds}},[i,s,n]),floorPlanRemoteId:o,setRemoteFloorPlanView:r}}({resolvedFloorPlanId:eM,effectiveFloorPlanCode:eq,gridDataSourceKey:C,floorMapConfigFromProp:null==z?void 0:z.floorMapConfig,engineLocale:eI}),e3=(0,ef.useMemo)(()=>{let e=null==z?void 0:z.floorMapConfig;if(!e)return e2;let t=e.sceneElements,l=Array.isArray(t)&&t.length>0;return{...e2,...e,sceneElements:l?t:e2.sceneElements??t}},[null==z?void 0:z.floorMapConfig,e2]),e8=(0,ef.useMemo)(()=>(function(e,t){if(!Array.isArray(e)||0===e.length)return eGt;let l=new Set,a=[];for(let i of e){let e=null==i?void 0:i.dataBinding;if(!e||!eGa(e.dataSourceKey,t))continue;let n=function(e){let t=e.trim();if(!t||"0"===t)return null;let l=Number(t);return Number.isFinite(l)&&l>0?Math.trunc(l):/^\d+$/.test(t)?Math.trunc(Number(t)):null}(String(e.recordId??""));null==n||l.has(n)||(l.add(n),a.push(n))}return a})(e3.sceneElements,C),[e3.sceneElements,C]),e6=(0,ef.useMemo)(()=>{if(!eS)return[];let e=eX.searchParams,t=null==e?void 0:e.filter;if(!t||"object"!=typeof t||null===t)return[];let l=t.values;if(!l||"object"!=typeof l)return[];let a=l[lL.DEFAULT_RESOURCE_WALL_FILTER_FIELD_KEY];return Array.isArray(a)?a.map(String).filter(Boolean):[]},[eS,eX.searchParams]),[e5,e7]=(0,ef.useState)(!1),e9=(0,ef.useCallback)(()=>{e7(!0)},[]),te=eS&&!eQ.loading&&"grid"!==eZ&&("calendar"!==eZ||e5),tt=(0,ef.useMemo)(()=>"resourceWall"===eK&&e6.length>0?{...eR,form_record_ids:(e=>{let t=[];for(let l of e){let e=String(l).trim();if(!e)continue;let a=Number(e);Number.isFinite(a)&&a>0&&/^\d+$/.test(e)?t.push(Math.trunc(a)):t.push(e)}return t})(e6),enable_remote_memory_cache:!0}:{...eR,form_record_ids:e8,enable_remote_memory_cache:!0},[eR,eK,e6,e8]),tl=eWW(te,{listPageSize:9999,extraRequestParams:tt,getInitialSearchParams:(0,ef.useCallback)(()=>eWU(em()(),eY,eW),[eY,eW])}),ta=rP(B$),ti=eWS((0,ef.useMemo)(()=>({relationTables:ta.data}),[ta.data])),tn=(0,ef.useMemo)(()=>({refresh:()=>{eQ.refresh(),eX.refresh(),tl.refresh()},refreshAsync:async()=>{await Promise.all([eQ.refreshAsync(),eX.refreshAsync(),tl.refreshAsync()])},currentPerspective:"monitor"}),[eQ.refresh,eQ.refreshAsync,eX.refresh,eX.refreshAsync,tl.refresh,tl.refreshAsync]),ts=(0,ef.useMemo)(()=>{let e=ti.getChildComponentProps;return e?e(tn):{}},[ti,tn]),tr=(0,ef.useMemo)(()=>eVL(Z),[Z]),{internalSchedule:to,setInternalSchedule:td,schedule:tc,debouncedSchedule:tu,flushCommittedSchedule:tp,queueCommittedSchedule:tm}=function(e){let{scheduleValueProp:t}=e,[l,a]=(0,ef.useState)(eGH),i=t??l,n=(0,ef.useRef)(i);n.current=i;let[s,r]=(0,ef.useState)(()=>t??eGH()),o=(0,ef.useRef)(null),d=(0,ef.useCallback)(e=>{null!=o.current&&(window.clearTimeout(o.current),o.current=null),r(e)},[]),c=(0,ef.useCallback)(e=>{null!=o.current&&window.clearTimeout(o.current),o.current=window.setTimeout(()=>{o.current=null,r(e)},300)},[]);(0,ef.useEffect)(()=>()=>{null!=o.current&&window.clearTimeout(o.current)},[]);let u=null!=i.at&&em()(i.at).isValid()?em()(i.at).valueOf():null,p=em()(i.date).startOf("day").valueOf();return(0,ef.useEffect)(()=>{void 0!==t&&c(n.current)},[u,p,t,c]),{internalSchedule:l,setInternalSchedule:a,schedule:i,debouncedSchedule:s,scheduleRef:n,flushCommittedSchedule:d,queueCommittedSchedule:c}}({scheduleValueProp:P}),tg=(0,ef.useMemo)(()=>{var e;let t,l=em()(tc.date).startOf("day").isSame(em()().startOf("day"),"day");return{...$??{},range:eW,snapToStep:!1,cursorMode:ej?"axis-moves":"cursor-moves",referenceDate:(null==$?void 0:$.referenceDate)??(l?void 0:(e=tc.date,t=em()(e).startOf("day"),"end_time"===String((null==eY?void 0:eY.type)??"")?t.subtract(1,"day"):t))}},[$,eW,tc.date,eY,ej]),{followWallClock:th,setFollowWallClock:tv,onFollowWallClockToggle:tf,onTimeNavigatorUserInteraction:ty}=function(e,t,l,a){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],[n,s]=(0,ef.useState)(!0),r=(0,ef.useRef)(a),o=(0,ef.useRef)(e);o.current=e;let d=void 0!==e,c=i||n;(0,ef.useEffect)(()=>{i&&s(!0)},[i]),(0,ef.useEffect)(()=>{r.current=a}),(0,ef.useEffect)(()=>{if(!c)return;let e=null,a=!1,i=()=>{var e;let a=em()().startOf("minute"),i={date:a.startOf("day"),at:a};void 0===o.current&&t(i),null==(e=r.current)||e.call(r,i),l(i)},n=()=>{if(!a){let t;e=window.setTimeout(()=>{a||(i(),n())},Math.max(0,(t=em()()).startOf("minute").add(1,"minute").diff(t)))}};return i(),n(),()=>{a=!0,null!=e&&window.clearTimeout(e)}},[c,l,d]);let u=(0,ef.useCallback)(e=>{i||s(e)},[i]);return{followWallClock:c,setFollowWallClock:u,onFollowWallClockToggle:(0,ef.useCallback)(()=>{i||s(e=>!e)},[i]),onTimeNavigatorUserInteraction:(0,ef.useCallback)(()=>{i||s(!1)},[i])}}(P,td,tp,A,e0),{salesResourceBookings:tx,salesTimelineHighlights:tb}=function(e){let{isInternalListData:t,pisellosRef:l,hasPisellosGetModule:a,debouncedSchedule:i,followWallClock:n,resourceBoardLoading:s,floorDayBookingLoading:r,floorDayBookingData:o,floorDayBookingDataVersion:d,scheduleDate:c,timeNavigatorPropsProp:u,timelineRange:p,operatingDayBoundary:m}=e,[g,h]=(0,ef.useState)(null),v=(0,ef.useRef)(0),f=(0,ef.useRef)(!1),y=(0,ef.useRef)(""),x=(null==i?void 0:i.at)!=null&&em()(i.at).isValid()?em()(i.at).valueOf():null,b=(0,ef.useMemo)(()=>{if(!Array.isArray(o)||0===o.length)return"__empty__";let e=5381,t=t=>{for(let l=0;l<t.length;l++)e=(e<<5)+e^t.charCodeAt(l);e=(e<<5)+e+31|0};for(let e=0;e<o.length;e++){let l=o[e];if(!l){t("null");continue}t(String(l.booking_id??l.id??l.bookingId??"")),t(String(l.status??"")),t(String(l.start_time??l.start_date??"")),t(String(l.end_time??l.end_date??""));let a=l.order;t(String((null==a?void 0:a.payment_status)??l.order_payment_status??""))}return`${o.length}:${e}`},[o]),_=(0,ef.useRef)(o);_.current=o,(0,ef.useEffect)(()=>{let e,o=l.current;if(!t||!(null==o?void 0:o.getModule))return void h(e=>null==e?e:null);if(!(null==i?void 0:i.at)||!em()(i.at).isValid()||s||r)return;let c=_.current;if(!Array.isArray(c))return;let u=`${x??"na"}|${b}|v${d}|${+!!a}|fw${+!!n}`;if(u!==y.current&&(y.current=u,f.current=!1),f.current)return;try{e=o.getModule("sales")}catch{h(e=>null==e?e:null);return}let p=null==e?void 0:e.getResourceBookingList;if("function"!=typeof p)return void h(e=>null==e?e:null);let m=++v.current,g="YYYY-MM-DD HH:mm",k=em()(i.at).format(g),w=n?k:em()().format(g),j=e=>{v.current!==m||(h(function(e){if(null==e)return[];if(Array.isArray(e))return e;if("object"==typeof e){if(Array.isArray(e.list))return e.list;if(Array.isArray(e.data))return e.data;if(Array.isArray(e.records))return e.records}return[]}(e)),f.current=!1)},S=()=>{v.current===m&&h(e=>null==e?e:null)};try{let t=p.call(e,k,c,w);null!=t&&"function"==typeof t.then?t.then(j).catch(e=>{f.current=!0,S()}):j(t)}catch(e){f.current=!0,S()}},[t,a,s,r,b,d,x,n,l]);let[k,w]=(0,ef.useState)(null),j=(0,ef.useRef)(0),S=(0,ef.useRef)(!1),M=em()(c).startOf("day").valueOf();return(0,ef.useEffect)(()=>{t||w(null)},[t]),(0,ef.useEffect)(()=>{let e;if(!t)return;let a=l.current;if(!(null==a?void 0:a.getModule)||s||r)return;let i=_.current;if(!Array.isArray(i))return;try{e=a.getModule("sales")}catch{return}let n=null==e?void 0:e.getTimelineHighlights;if("function"!=typeof n){w(null),S.current||(S.current=!0,console.warn("[PisellReservation] sales.getTimelineHighlights 未注册或非函数;时间轴密度退回本地计算"));return}let o=++j.current,{startStr:d,endStr:u}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:eWT,l=arguments.length>2?arguments[2]:void 0,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:em()(),[i,n]=eWq(e,l,t,a);return{startStr:i.format(eGq),endStr:n.format(eGq)}}(c,p,m,em()()),g=e=>{j.current!==o||w(function(e){let t;if(Array.isArray(e))t=e;else if(null==e||"object"!=typeof e)return null;else if(Symbol.iterator in e)try{t=Array.from(e)}catch{return null}else{let l=Object.keys(e).filter(e=>/^\d+$/.test(e)).sort((e,t)=>Number(e)-Number(t));if(0===l.length)return null;t=l.map(t=>e[t])}let l=t.map(e=>{let t="number"==typeof e?e:Number(e);return Number.isFinite(t)?Math.max(0,Math.round(t)):0});return l.length>0?l:null}(e))};try{let t=n.call(e,i,d,u);null!=t&&"function"==typeof t.then?t.then(g).catch(e=>{}):g(t)}catch(e){}},[t,a,s,r,b,M,x,p.start,p.end,l,m]),{salesResourceBookings:g,salesTimelineHighlights:k}}({isInternalListData:eS,pisellosRef:eA,hasPisellosGetModule:eD,debouncedSchedule:tu,followWallClock:th,resourceBoardLoading:eQ.loading,floorDayBookingLoading:tl.loading,floorDayBookingData:tl.data,floorDayBookingDataVersion:tl.pushDataVersion,scheduleDate:tc.date,timeNavigatorPropsProp:$,timelineRange:eW,operatingDayBoundary:eY}),tk=(0,ef.useMemo)(()=>(function(e){let{dataSourcesProp:t,gridDataSourceKey:l,isInternalListData:a,resourceList:i,floorDayBookingList:n,schedule:s,dataProp:r,salesResourceBookings:o}=e,d=null==t?void 0:t[l];if(Array.isArray(d)&&d.length>0)return d;if(a)return null!=o&&function(e){if(!Array.isArray(e)||0===e.length)return!1;let t=e[0];return!!t&&"object"==typeof t&&!!Array.isArray(t.bookings)&&(null==t.schedule_event_id||null!=t.form_record_id||null!=t.resource_id||"string"==typeof t.main_field)&&(null!=t.form_record_id||null!=t.resource_id||"string"==typeof t.main_field||null!=t.id&&null==t.schedule_event_id)}(o)?function(e){let t=[];for(let l of e){let e;if(!l||"object"!=typeof l)continue;let a=function(e){let t=e.form_record_id??e.resource_id??e.id;if(null==t)return null;let l=e.form_id,a=e.capacity;return{id:"number"==typeof t||"string"==typeof t?t:String(t),form_id:"number"==typeof l?l:null!=l&&""!==l?Number(l):void 0,main_field:"string"==typeof e.main_field?e.main_field:void 0,form_code:"string"==typeof e.form_code?e.form_code:void 0,capacity:"number"==typeof a?a:null!=a&&""!==String(a).trim()?Number(a):void 0}}(l);if(!a)continue;let i=eW7(a);if(!i)continue;let n=Array.isArray(l.bookings)?l.bookings:[],s=eGe(l.bookingCount),r=eGe(l.compeleteBookingCount)??eGe(l.completeBookingCount),o=function(e,t){if(!Array.isArray(t))return null;let l=t.filter(e=>!!e&&"object"==typeof e&&!(eWG(e)||eWJ(e)));return 0===l.length?null:eW6(e,l)}(i.id,n);e=o?function(e,t){if(!t.length)return e;let l=t[0],a={...e,...eW3(l)},i=l.order;return"paid"===(null==i?void 0:i.payment_status)&&(a.isPaid=!0),"late"!==a.hostReservedStatus&&"late"===String(l.reserved_status)&&"reserved"!==String(l.status)&&(a.hostReservedStatus="late",null==a.lateMinutes&&(a.lateMinutes=1)),a}(eW9([i],[o])[0],n):function(e,t){let l=String(t.status??"");return"locked"===l?{...e,cardStatus:"maintenance"}:"empty"===l?{...e,cardStatus:"available",hostReservedStatus:void 0,hostIsTimeout:void 0}:"occupied"===l?{...e,cardStatus:"occupied",hostIsTimeout:!0===t.isTimeout||void 0,hostReservedStatus:void 0}:"reserved"===l?{...e,cardStatus:"booked",hostIsTimeout:void 0,...eW3(t)}:e}(i,l),null!=s&&(e.bookingCount=s),null!=r&&(e.completeBookingCount=r),t.push(e)}return t}(o):eW9(function(e){if(!Array.isArray(e)||0===e.length)return[];let t=[];for(let l of e){let e=eW7(l);e&&t.push(e)}return t}(i),eW5(null!=o?o:n));return eW5(r??[])})({dataSourcesProp:T,gridDataSourceKey:C,isInternalListData:eS,resourceList:eQ.data,floorDayBookingList:tl.data,schedule:tc,dataProp:q,salesResourceBookings:tx}),[T,C,eS,eQ.data,tl.data,tx,q]),tw=(0,ef.useMemo)(()=>{let e=function(e,t){if(!Array.isArray(e)||0===e.length)return eGl;let l=new Set,a=[];for(let i of e){let e=null==i?void 0:i.dataBinding;if(!e||!eGa(e.dataSourceKey,t))continue;let n=String(e.recordId??"").trim();n&&"0"!==n&&(l.has(n)||(l.add(n),a.push(n)))}return a}(e3.sceneElements,C);if(e.length>0)return e;let t=[...new Set(tk.map(e=>String(e.id)).filter(e=>""!==e&&"undefined"!==e&&"null"!==e))];if(t.length>0)return t;let l=new Set,a=tl.data;if(Array.isArray(a)){for(let e of a)if(e&&"object"==typeof e)for(let t of eWK(e))t&&l.add(t)}return[...l]},[e3.sceneElements,C,tk,tl.data]),tj=(0,ef.useMemo)(()=>new Set(tw),[tw]),tS=(0,ef.useMemo)(()=>(function(e){let{orderedResourceIds:t,tables:l}=e,a=new Map(l.map(e=>[String(e.id),e]));return t.map(e=>{let t=a.get(e);return{id:e,name:(null==t?void 0:t.code)||(null==t?void 0:t.main_field)||e,groupType:null==t?void 0:t.area,form_id:e}})})({orderedResourceIds:tw,tables:tk}),[tw,tk]),tM=(0,ef.useMemo)(()=>(function(e){let{bookings:t,canvasResourceIdSet:l}=e;if(!Array.isArray(t))return[];let a=l.size>0,i=[],n=0;for(let e of t){if(!e||"object"!=typeof e||function(e){let t=e.metadata;if((null==t?void 0:t.multiple_resource_flag)!==1)return!1;let l=e.product_uid;if(null!=l&&""!==String(l))return!1;let a=e.resources;return!Array.isArray(a)||0===a.length}(e))continue;let t=eWK(e).filter(e=>a?l.has(e):!!e);if(0===t.length)continue;let s=function(e){let t=e.start_at||(e.start_date&&e.start_time?`${e.start_date} ${e.start_time}`:"");if(!t)return null;let l=em()(t);return l.isValid()?l:null}(e);if(!s)continue;let r=function(e,t){let l=function(e){let t=e.end_at||(e.end_date&&e.end_time?`${e.end_date} ${e.end_time}`:"");if(!t)return null;let l=em()(t);return l.isValid()?l:null}(e);if(l)return l;let a=String(e.status??e.booking_status??e.order_status??"").trim().toLowerCase();return"occupied"===a||"locked"===a?t.endOf("day"):t.add(2,"hour")}(e,s);if(!r.isAfter(s))continue;let o=eWX(e)||String(e.relation_form_name??e.booking_id??"Booking"),d=e.phone??e.mobile??e.customer_phone,c="string"==typeof d?d:void 0,u=function(e){let t=String(e.status??e.booking_status??e.order_status??"").trim().toLowerCase();return"locked"===t?"block":"occupied"===t?"checked_in":"reserved"===t?"late"===String(e.reserved_status??"")?"late":"new":void 0}(e),p=String(e.booking_id??e.id??`bk_${n++}`),m="locked"===String(e.status??e.booking_status??e.order_status??"").trim().toLowerCase()?"block":"booking",g=s.startOf("day"),h=eGi(s,g),v=r.startOf("day"),f=0===r.hour()&&0===r.minute()&&0===r.second(),y=f?v.subtract(1,"day"):v,x=f?24:eGi(r,y),b=g.format("YYYY-MM-DD"),_=y.format("YYYY-MM-DD");for(let l of t)i.push({id:`${p}_${l}`,courtId:l,date:b,startHour:h,endDate:_===b?void 0:_,endHour:x,name:o,kind:m,phone:c,statusTag:u,raw:e})}let s=new Set,r=[];for(let e of i)s.has(e.id)||(s.add(e.id),r.push(e));return r})({bookings:tl.data,canvasResourceIdSet:tj}),[tl.data,tj]),tN=(0,ef.useMemo)(()=>tk.map(eGB),[tk]),tC=(0,ef.useMemo)(()=>`${em()(tu.date).startOf("day").valueOf()}_${em()(tu.at).valueOf()}`,[tu.date,tu.at]),tT=(0,ef.useRef)(eGc(eg)),tP=(0,ef.useRef)(null),tA=(0,ef.useRef)(null),tD=(0,ef.useRef)(Q);(0,ef.useEffect)(()=>{tD.current=Q},[Q]);let tI=(0,ef.useRef)(W),tE=(0,ef.useRef)(A);(0,ef.useEffect)(()=>{tI.current=W,tE.current=A}),(0,ef.useEffect)(()=>{if(eS&&"calendar"!==tT.current){let e=tu.date;tl.patchSearchParams(t=>eGo(t,e,eY,eW,em()()))}if(("floorMap"===tT.current||"calendar"===tT.current||"resourceWall"===tT.current)&&!eS){var e;null==(e=tI.current)||e.call(tI,{...tD.current??{},reservationDate:tu.date.toISOString(),reservationAt:tu.at.toISOString()})}},[tu,eS,tl.patchSearchParams,eY,eW]);let tz=(0,ef.useCallback)(e=>{e0||tv(!1),void 0===P&&td(e),null==A||A(e),tm(e)},[P,A,tv,tm,e0]),tL=(0,ef.useMemo)(()=>({...T,[C]:tk}),[C,tk,T]),tO=(null==z?void 0:z.mode)!==void 0,[tR,t$]=(0,ef.useState)(!1),tF=(null==z?void 0:z.mode)??(tR?"edit":"read"),{showVenueHudDock:tB,handleOpenHudTableDrawer:tH,closeHudTableDrawer:tq,hudDrawerRef:tV,hudDrawerOpen:tY,hudMapItems:tU,hudDrawerResourceRootBuckets:tW,hudDrawerPagedRows:tG,hudDrawerFilteredTotal:tQ,hudDrawerLoading:tK,hudDrawerBookingPagination:tJ,hudDrawerOnSearch:tZ,hudDrawerOnReset:tX,hudDrawerOnPageChange:t0,hudDrawerToolBar:t2,hudDrawerLocalSearchParams:t1,handleHudDrawerFormRecordIdsChange:t4,reservationFloorMapViewportOverlay:t3,renderItemByKind:t8}=function(e){let{floorMapHudTableDrawer:t,dataSources:l,gridDataSourceKey:a,isInternalListData:i,floorDayBookingData:n,searchParamsProp:s,dataProp:r,loadingProp:o,bookingChildProps:d,resourceBoardData:c,phoneLayout:u,hideViewportHudStats:p=!1}=e,m=(0,ef.useRef)([]),[g,h]=(0,ef.useState)([]),[v,f]=(0,ef.useState)(!1),y=(0,ef.useRef)(null),[x,b]=(0,ef.useState)(null),[_,k]=(0,ef.useState)({}),w=(0,ef.useRef)({}),[j,S]=(0,ef.useState)({pageNumber:1,pageSize:20}),M=(0,ef.useMemo)(()=>t&&(v||eQO(g,l).total>0),[t,v,g,l]),N=(0,ef.useCallback)(()=>{let e=new Set((function(e,t,l){let a=t??{},i=a[l]??[],n=new Set;for(let t of e){if(!function(e){let t=e.elementKind;return!!t&&t!==lL.FLOOR_MAP_IMAGE_ELEMENT_KIND&&t!==lL.FLOOR_MAP_STAGE_ELEMENT_KIND}(t))continue;let e=eGG(t,a);(null==e?void 0:e.id)!=null&&n.add(String(e.id))}return i.filter(e=>n.has(String(e.id)))})(m.current,l,a).map(e=>String(e.id)).filter(Boolean)),t=eQT(i?n.searchParams:s??{});!function(e){let t=e.filter;if("object"!=typeof t||null===t||Array.isArray(t))return;let l=t.values;if("object"!=typeof l||null===l||Array.isArray(l))return;let a={...l};delete a.booking_time_start_between,e.filter={...t,values:a}}(t),function(e){let t=e.filter;if("object"!=typeof t||null===t||Array.isArray(t))return;let l=t.values;if("object"!=typeof l||null===l||Array.isArray(l))return;let a={...l};a.appointment_status=[],a.order_payment_status=[],a.form_record_ids=[],e.filter={...t,values:a}}(t),w.current=t,k(t),b(e),S({pageNumber:1,pageSize:20}),f(!0)},[l,a,i,n.searchParams,s]),C=(0,ef.useCallback)(()=>{f(!1),b(null),k({}),S({pageNumber:1,pageSize:20})},[]);(0,ef.useEffect)(()=>{if(!t||!v)return;let e=e=>{"Escape"===e.key&&C()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[t,v,C]);let T=(0,ef.useMemo)(()=>(function(e){if(!Array.isArray(e)||0===e.length)return[];let t=e.filter(e=>null!=e&&"object"==typeof e&&!Array.isArray(e)),l=function(e){let t=new Set;for(let l of e){let e=eQq(l.id);e&&t.add(e)}let l=new Map;for(let a of e){let e=eQq(a.id);if(!e)continue;let i=eQY(a);i&&t.has(i)&&(l.has(i)||l.set(i,[]),l.get(i).push(e))}let a=[],i=new Set;for(let l of e){let e=eQq(l.id);if(!e||i.has(e))continue;let n=eQY(l);n&&t.has(n)||(a.push(l),i.add(e))}a.sort((e,t)=>("number"==typeof e.sort&&Number.isFinite(e.sort)?e.sort:0)-("number"==typeof t.sort&&Number.isFinite(t.sort)?t.sort:0));let n=[];for(let e of a){let t=eQq(e.id);if(!t)continue;let a=eQV(e.main_field),i="string"==typeof e.form_code&&""!==e.form_code.trim()?String(e.form_code).trim():"",s=(a||i||t).trim(),r=function(e){let t=[],a=[e];for(;a.length;){let e=a.pop();t.push(e);let i=l.get(e);if(null==i?void 0:i.length)for(let e of i)a.push(e)}return t}(t);n.push({id:`resourceRoot:${t}`,label:s,keys:r})}return n}(t);if(l.length<=20)return l;let a=new Map;for(let e of t){if(!eQq(e.id))continue;let t=function(e){let t=e.form_id??e.formId;if("number"==typeof t&&Number.isFinite(t)){let e=Math.trunc(t);return e>0?String(e):null}if("string"==typeof t){let e=t.trim();if(!e||"0"===e)return null;let l=Number(e);if(Number.isFinite(l)&&l>0)return String(Math.trunc(l));if(/^\d+$/.test(e))return e}return null}(e)??"__nof__";a.has(t)||a.set(t,[]),a.get(t).push(e)}let i=[...a.entries()].map(e=>{let[t,l]=e,a=1/0;for(let e of l){let t="number"==typeof e.sort&&Number.isFinite(e.sort)?e.sort:1/0;t<a&&(a=t)}Number.isFinite(a)||(a=0);let i=function(e){let t=new Set;for(let l of e){let e="string"==typeof l.form_code?l.form_code.trim():"";e&&t.add(e)}if(t.size>=1)return[...t].sort((e,t)=>e.localeCompare(t))[0]??"Resource";let l="";for(let t of e){let e=eQV(t.main_field);e&&(!l||e.length<l.length)&&(l=e)}return l||"Other"}(l),n=new Set;for(let e of l){let t=eQq(e.id);t&&n.add(t)}return{sortKey:a,bucket:{id:`resourceForm:${t}`,label:i,keys:[...n]}}});return i.sort((e,t)=>e.sortKey-t.sortKey),i.map(e=>e.bucket)})(c.data),[c.data]),P=(0,ef.useMemo)(()=>{var e,l;let a,s,o,d,c;return t&&v&&x&&0!==x.size?(e=i?n.data:r??[],l=Array.isArray(e)&&0!==x.size?e.filter(e=>eWK(e).some(e=>x.has(e))):[],a=l,"string"==typeof(s=_.keyword)&&s.trim()&&(a=a.filter(e=>(function(e,t){let l=t.trim().toLowerCase();if(!l)return!0;let a=[],i=e=>{if(null==e)return;let t=String(e).toLowerCase().trim();t&&a.push(t)};i(e.id),i(e.booking_id);let n=e.order;if(n){i(n.shop_full_order_number),i(n.note);let e=n.customer;e&&(i(e.name),i(e.first_name),i(e.last_name),i(e.company_name));let t=n.contacts_info;t&&(i(t.first_name),i(t.last_name),i(t.phone),i(t.email))}return i(e.notes),a.some(e=>e.includes(l))})(e,s))),Object.keys(d=(o=_.filter)&&"object"==typeof o&&null!==o&&"object"==typeof o.values&&null!==o.values&&!Array.isArray(o.values)?o.values:{}).length>0&&(a=a.filter(e=>(function(e,t){var l;let a=t.order_payment_status;if(Array.isArray(a)&&a.length>0){let t,l,i="partially_paid"===(l=String((null==(t=e.order)?void 0:t.payment_status)??e.payment_status??"").trim().toLowerCase())?"unpaid":l,n=new Set(a.map(e=>String(e).toLowerCase()));if(""===i||!n.has(i))return!1}let i=t.appointment_status;if(Array.isArray(i)&&i.length>0&&!eQI(e.appointment_status,i))return!1;let n=t.order_status;if(Array.isArray(n)&&n.length>0){let t=e.order;if(!eQI((null==t?void 0:t.order_status)??(null==t?void 0:t.status),n))return!1}let s=t.order_sales_channel;if(Array.isArray(s)&&s.length>0){let t=e.order;if(!eQI(null==t?void 0:t.order_sales_channel,s))return!1}let r=t.payment_method;if(Array.isArray(r)&&r.length>0){let t=e.order;if(!eQI((null==t?void 0:t.payment_method)??(null==t?void 0:t.pay_method)??(null==t?void 0:t.payment_methods),r))return!1}let o=t.customer_id;if(Array.isArray(o)&&o.length>0){let t=e.order,a=(null==t?void 0:t.customer_id)??(null==t||null==(l=t.customer)?void 0:l.id);if(null==a||!o.map(String).includes(String(a)))return!1}let d=t.form_record_ids;if(Array.isArray(d)&&d.length>0){let t=new Set(d.map(e=>String(e)));if(!eWK(e).some(e=>t.has(e)))return!1}let c=t.number_between;if(null!=c&&"object"==typeof c){let t="number"==typeof e.number&&Number.isFinite(e.number)?e.number:Number(e.number);if(!eQE(Number.isFinite(t)?t:NaN,c))return!1}let u=e.order,p=null==u?void 0:u.summary,m=t.total_amount_between;if(null!=m&&"object"==typeof m){let t=eQz(null==p?void 0:p.total_amount)??eQz(null==u?void 0:u.total_amount)??eQz(e.amount??e.total);if(null==t||!eQE(t,m))return!1}let g=eQD(t.created_at_between);if(g){let t=eQA(e);if(0===t)return!1;let[l,a]=g;if(t<l||t>a)return!1}let h=e.updated_at,v=eQD(t.updated_at_between);if(v){let e="string"==typeof h&&h?em()(h).valueOf():0;if(!e)return!1;let[t,l]=v;if(e<t||e>l)return!1}let f=eQD(t.booking_time_start_between);if(f){let[t,l]=f,a=eQP(e);if(0===a||a<t||a>l)return!1}return!0})(e,d))),"string"==typeof(c=_.sort)&&c&&(a=function(e,t){if(!t||!String(t).includes(":"))return e;let[l,a]=String(t).split(":"),i="desc"===a,n=[...e],s=e=>{switch(l){case"start_at":case"after_execution_time":return eQP(e);case"end_at":var t=e;let a=t.end_at;if("string"==typeof a&&a){let e=em()(a);if(e.isValid())return e.valueOf()}let i=eWx(t.end_date,t.end_time);if(i){let e=em()(i);if(e.isValid())return e.valueOf()}return 0;case"created_at":return eQA(e);default:return 0}};return n.sort((e,t)=>{let l=s(e),a=s(t);return l===a?0:i?a-l:l-a}),n}(a,c)),a):[]},[t,v,x,i,n.data,r,_]),A=P.length,D=Math.max(1,Math.ceil(A/j.pageSize)||1);(0,ef.useEffect)(()=>{j.pageNumber<=D||S(e=>({...e,pageNumber:D}))},[D,j.pageNumber]);let I=(0,ef.useMemo)(()=>{let{pageNumber:e,pageSize:t}=j,l=Math.max(1,t),a=Math.min(P.length,e*l);return P.slice(0,a)},[P,j]),E=(0,ef.useMemo)(()=>{var e;let t,l,a,i,n=d.toolBar;return l="string"==typeof(t=eQM({baseToolBar:(e={baseToolBar:null==n||"object"!=typeof n||Array.isArray(n)?{}:n,searchGetContainer:()=>y.current??document.body,quickFilterComponent:eQJ}).baseToolBar,searchGetContainer:e.searchGetContainer,quickFilterFilterList:[{type:"custom",key:"hudQuickFiltersRow",other:{component:e.quickFilterComponent,compositeFilterFieldNames:["appointment_status","order_payment_status"],formItemProps:{style:{marginBottom:0}}}}]})).className?t.className:void 0,i=(a="object"==typeof t.search&&null!==t.search?t.search:void 0)&&"object"==typeof a.modalStyle&&null!==a.modalStyle&&!Array.isArray(a.modalStyle)?a.modalStyle:{},{...t,mergeCompactNarrowTrailingWithQuickFilterRow:!0,search:e.searchGetContainer&&a?{...a,modalWidth:"100%",modalStyle:{...i,marginLeft:0,marginRight:0,width:"100%",maxWidth:"100%"}}:t.search,className:t_()(l,"pisell-reservation-hud-table-toolbar")}},[d.toolBar]),z=i?n.loading:o??!1,L=(0,ef.useMemo)(()=>({pageNumber:j.pageNumber,pageSize:j.pageSize}),[j.pageNumber,j.pageSize]),O=(0,ef.useCallback)(e=>{S(e=>({...e,pageNumber:1})),k(t=>(function(e,t){let l={...e,...t},a="object"==typeof e.filter&&null!==e.filter?e.filter:{};if("object"==typeof t.filter&&null!==t.filter&&!Array.isArray(t.filter)){let e=t.filter,i="object"!=typeof a.values||null===a.values||Array.isArray(a.values)?{}:a.values,n="object"!=typeof e.values||null===e.values||Array.isArray(e.values)?void 0:e.values;l.filter={...a,...e,values:null!=n?{...i,...n}:i}}return eGr(l)})(t,e))},[]),R=(0,ef.useCallback)(e=>{O({filter:{values:{form_record_ids:e}}})},[O]),$=(0,ef.useCallback)(()=>{S(e=>({...e,pageNumber:1})),k(eQT(w.current))},[]),F=(0,ef.useCallback)((e,t)=>{S({pageNumber:e,pageSize:t})},[]),B=(0,ef.useMemo)(()=>{let e;return e=(e,t,a)=>(function(e,t,l){var a;let i=eGG(e,t),n=e.elementKind===eU3||"circle"===e.shape?"circle":"rect";if(!i){let l=function(e,t){let l,a=e._sceneElement,i=eN.getText(eGW),n=(null==a?void 0:a.name)!=null?String(a.name).trim():"";switch((0,lL.getFloorMapBindingPlaceholderReason)(e,t)){case"missing_data_source_key":l=eN.getText("pisell-reservation.card-placeholder.hint-bind-datasource");break;case"missing_record_id":l=eN.getText("pisell-reservation.card-placeholder.hint-select-row");break;case"new_unsaved_slot":l=eN.getText("pisell-reservation.card-placeholder.hint-new-slot");break;default:l=eN.getText("pisell-reservation.card-placeholder.hint-row-not-found")}return{title:n||i,hint:l,shape:e.elementKind===eU3||"circle"===e.shape?"circle":"rect"}}(e,t);return(0,ev.jsx)(eGQ,{title:l.title,hint:l.hint,shape:l.shape})}let s=eYb(i,(null==(a=e._sceneElement)?void 0:a.name)!=null?String(e._sceneElement.name).trim():void 0),r=(0,lL.resolveSceneElementDisplayTitle)({sceneElement:e._sceneElement,recordTitle:s,fallback:i.code||eN.getText(eGW)}),o=eYU(i,r),d=null!=i.bookingCount&&i.bookingCount>0?{...o,bookingCount:i.bookingCount,completeBookingCount:i.completeBookingCount??0}:o,c=null!=e.height&&Number.isFinite(e.height)&&e.height>0?e.height:e.width;return(0,ev.jsx)(eGU,{data:d,shellShape:n,hideHeaderCapacity:!0,elementLayoutHeightPx:null!=c&&Number.isFinite(c)&&c>0&&"circle"===n?c:void 0,viewportScale:null==l?void 0:l.viewportScale})})(e,l,a),{[lL.FLOOR_MAP_IMAGE_ELEMENT_KIND]:(e,t,l)=>(0,lL.renderFloorMapFallbackPlaceholder)(e),[lL.FLOOR_MAP_BUILTIN_SHAPE_ELEMENT_KIND]:(e,t,l)=>(0,lL.renderFloorMapFallbackPlaceholder)(e),[eU4]:e,[eU3]:e,reservationTable:e,reservationPartyBench:e,reservationBarSeat:e}},[l]),H=(0,ef.useCallback)(e=>{let l=e.items;return(m.current=l,t)?(0,ev.jsx)(eQH,{items:l,setItems:h}):p?null:(0,ev.jsx)(eQB,{items:l,dataSources:e.dataSources,interactive:!1,phoneLayout:u})},[t,u,p]);return{hudItemsRef:m,hudMapItems:g,setHudMapItems:h,hudDrawerRef:y,hudDrawerOpen:v,showVenueHudDock:M,handleOpenHudTableDrawer:N,closeHudTableDrawer:C,hudDrawerResourceRootBuckets:T,hudDrawerPagedRows:I,hudDrawerFilteredTotal:A,hudDrawerLoading:z,hudDrawerBookingPagination:L,hudDrawerOnSearch:O,hudDrawerOnReset:$,hudDrawerOnPageChange:F,hudDrawerToolBar:E,hudDrawerLocalSearchParams:_,handleHudDrawerFormRecordIdsChange:R,reservationFloorMapViewportOverlay:H,renderItemByKind:B}}({floorMapHudTableDrawer:eh,dataSources:tL,gridDataSourceKey:C,isInternalListData:eS,floorDayBookingData:tl,searchParamsProp:Q,dataProp:q,loadingProp:K,bookingChildProps:ts,resourceBoardData:eQ,phoneLayout:ej,hideViewportHudStats:ej&&"edit"===tF}),[t6,t5]=(0,ef.useState)(()=>eGp(eq));(0,ef.useEffect)(()=>{t5(eGp(eq))},[eq]);let t7=(0,ef.useCallback)(()=>{t5(e=>{let t="light"===e?"dark":"light";if("u">typeof window)try{localStorage.setItem(eGu(eq),t)}catch{}return t})},[eq]),{bookingDetailOpen:t9,bookingDetailRaw:le,bookingDetailRow:lt,bookingDetailSceneName:ll,bookingDetailSingleMode:la,closeBookingDetailModal:li,closeBookingDetailNow:ln,floorMapItemClickBefore:ls,openBookingDetailFromRaw:lr,readModeSelectedFloorItemId:lo}=function(e){let{engineCtx:t,onFloorMapBookingClick:l,dataSources:a,mergedTableRows:i,reservationBiz:n,resourceSelectMode:s,associatedMenuListIds:r,reservationRuleProduct:o}=e,[d,c]=(0,ef.useState)(!1),[u,p]=(0,ef.useState)(null),[m,g]=(0,ef.useState)(null),[h,v]=(0,ef.useState)(null),[f,y]=(0,ef.useState)(void 0),[x,b]=(0,ef.useState)(!1),_=(0,ef.useRef)(m);_.current=m;let k=(0,ef.useRef)(""),w=(0,ef.useRef)("");(0,ef.useEffect)(()=>{if(!d){k.current="",p(null);return}let e=_.current;if(!e)return;let t=w.current;if(!t)return;let l=i.find(e=>String(e.id??"").trim()===t);if(!l)return;let a=function(e,t){let l=String(e.booking_id??e.booking_uid??e.id??"").trim();if(!l)return;let a=t.floorMapSourceBookings;if(Array.isArray(a))for(let e of a){if(!e||"object"!=typeof e)continue;let t=String(e.id??"").trim(),a=String(e.booking_id??"").trim(),i=String(e.booking_uid??"").trim();if(t===l||a===l||i===l)return e}}(e,l),n=`${eGJ(l)}#${a?eGK(a):"gone"}`;n!==k.current&&(k.current=n,l.id,l.code,String(l.main_field??""),l.bookingCount,l.completeBookingCount,Array.isArray(l.floorMapSourceBookings)&&l.floorMapSourceBookings.length,v(l),a&&g(a))},[d,i]);let j=(0,ef.useCallback)(()=>{c(!1),g(null),v(null),y(void 0),b(!1),w.current=""},[]),S=(0,ef.useCallback)(e=>{var t,l;null==e||e.stopPropagation(),null==e||null==(l=e.nativeEvent)||null==(t=l.stopImmediatePropagation)||t.call(l),window.setTimeout(()=>{j()},50)},[j]),M=(0,ef.useCallback)(e=>{var i,s,r,o,d,u,m,h,f;let x,_,{rec:j,rowResolved:S,event:M,sceneElementName:N,floorMapItemId:C,singleBookingMode:T}=e;if(!0===(null==l?void 0:l({event:M??eGZ,raw:j,row:S,dataSources:a,mode:"read"})))return;let P=null==t||null==(i=t.appHelper)?void 0:i.utils,A=Number((null==P||null==(s=P.getData)?void 0:s.call(P,"shop_id"))??(null==P||null==(m=P.store)||null==(u=m.getState)||null==(d=u.call(m))||null==(o=d.global)||null==(r=o.globalConfig)?void 0:r.id)),D=Number.isFinite(A)&&2155===A,I=(x=j.id,_=j.booking_id,null!=x&&""!==String(x).trim()||null!=_&&""!==String(_).trim());if(D&&"dine_in"!==n&&I)return void(!function(){if("u"<typeof window)return!1;try{return"1"===window.localStorage.getItem("pisell_floor_map_use_legacy_checkout_drawer")}catch{return!1}}()?null==P||null==(f=P.action)||f.call(P,{type:"pisell1.handleOpenSaleDetail",data:{osProps:{orderId:null==j?void 0:j.order_id,syncDetailOnOrderChange:!0}},callback:()=>{}}):null==P||null==(h=P.action)||h.call(P,{type:"pisell1.handleOpenHostCheckoutDrawer",data:{item:j}}));let E=null==N?void 0:N.trim();y(E&&""!==E?E:void 0),w.current=String(S.id??"").trim(),k.current=`${eGJ(S)}#${I?eGK(j):"gone"}`,g(j),v(S),null!=C&&""!==String(C).trim()?p(String(C)):p(null),b(!!T),c(!0)},[a,t,l,n]);return{bookingDetailOpen:d,bookingDetailRaw:m,bookingDetailRow:h,bookingDetailSceneName:f,bookingDetailSingleMode:x,readModeSelectedFloorItemId:u,closeBookingDetailModal:S,closeBookingDetailNow:j,floorMapItemClickBefore:(0,ef.useCallback)(e=>{var a,i,d,c,u,p,m,g,h;if("edit"===e.mode)return;let v=e.item.elementKind??(null==(a=e.item._sceneElement)?void 0:a.elementKind);if(v===lL.FLOOR_MAP_IMAGE_ELEMENT_KIND||v===lL.FLOOR_MAP_BUILTIN_SHAPE_ELEMENT_KIND||v===lL.FLOOR_MAP_STAGE_ELEMENT_KIND)return;let f=eGG(e.item,e.dataSources),y=null==f?void 0:f.floorMapSourceBookings,x=function(e,t){var l;if(!(null==t?void 0:t.length))return;let a=e.target;if(!a)return t[0];let i=a.closest("[data-pisell-floor-checkout-booking]"),n=null==i||null==(l=i.getAttribute("data-pisell-floor-checkout-booking"))?void 0:l.trim();if(n){let e=t.find(e=>{let t=e.id,l=e.booking_id;return String(t??"")===n||String(l??"")===n});if(e&&"object"==typeof e)return e}let s=t[0];return s&&"object"==typeof s?s:void 0}(e.event,y);if(null==s?void 0:s.enabled){let t=f??{id:String((null==(m=e.item._sceneElement)||null==(p=m.dataBinding)?void 0:p.recordId)??e.item.id??"unknown"),code:(null==(g=e.item._sceneElement)?void 0:g.name)!=null?String(e.item._sceneElement.name):"—",cardStatus:"available"};s.onSelectResource({item:e.item,row:t,orderId:function(e,t){for(let l of[e,...Array.isArray(t)?t:[]]){if(!l||"object"!=typeof l)continue;let e=eCM(l);if(null!=e)return e}}(x,t.floorMapSourceBookings),bookingRaw:x,resource:{id:t.id,relation_id:t.id,form_id:t.form_id,code:t.code,main_field:t.main_field,raw:t}});return}let b=(()=>{if(!x||"object"!=typeof x)return!1;let e=x.id,t=x.booking_id;return null!=e&&""!==String(e).trim()||null!=t&&""!==String(t).trim()})(),_=f??{id:String((null==(d=e.item._sceneElement)||null==(i=d.dataBinding)?void 0:i.recordId)??"unknown"),code:(null==(c=e.item._sceneElement)?void 0:c.name)!=null?String(e.item._sceneElement.name):"—",cardStatus:"available"},k=(null==(u=e.item._sceneElement)?void 0:u.name)!=null?String(e.item._sceneElement.name).trim():void 0,w="number"==typeof(null==f?void 0:f.bookingCount)&&Number.isFinite(f.bookingCount)?f.bookingCount:0;if(!b&&0===w){if(!0===(null==l?void 0:l({event:e.event,raw:{},row:_,dataSources:e.dataSources,mode:"read"})))return;eCU({appHelperUtils:null==t||null==(h=t.appHelper)?void 0:h.utils,reservationBiz:n,associatedMenuListIds:r,reservationRuleProduct:o,row:_});return}M({rec:b?x:{},rowResolved:_,event:e.event,sceneElementName:k,floorMapItemId:String(e.item.id)})},[M,s,l,t,n,r,o]),openBookingDetailFromRaw:(0,ef.useCallback)(e=>{let t=e.raw,l=t.id,a=t.booking_id;if((null==l||""===String(l).trim())&&(null==a||""===String(a).trim()))return;let i=e.row??{id:String(l??a??"unknown"),code:String(t.relation_form_name??a??"—"),cardStatus:"booked"};M({rec:t,rowResolved:i,sceneElementName:e.sceneElementName,singleBookingMode:e.singleBookingMode})},[M])}}({engineCtx:eC,onFloorMapBookingClick:ec,dataSources:tL,mergedTableRows:tk,reservationBiz:eO,resourceSelectMode:ek,associatedMenuListIds:eB,reservationRuleProduct:e$}),ld=(0,ef.useCallback)(async()=>{ln(),await tn.refreshAsync()},[ln,tn]),{reservationCalendarSlotProps:lc,calendarGranularity:lu,setCalendarGranularity:lp}=function(e){let{isInternalListData:t,floorDayBookingData:l,operatingDayBoundary:a,tables:i,openBookingDetailFromRaw:n,schedule:s,handleScheduleChange:r,calendarResources:o,calendarBookings:d,effectiveTimelineRange:c,runtimeContext:u,onCalendarViewportFirstPatch:p}=e,m=(0,ef.useRef)({bookingId:null,timer:null}),[g,h]=(0,ef.useState)("week"),v=(0,ef.useRef)(new Set),f=(0,ef.useRef)(null),y=(0,ef.useRef)(!1),x=(0,ef.useCallback)(e=>{let t=em()(e).startOf("day"),l=em()(s.at);r({date:t,at:t.hour(l.hour()).minute(l.minute()).second(0).millisecond(0)})},[r,s.at]),b=(0,ef.useRef)(!1),_=(0,ef.useCallback)(e=>{t&&(b.current||(b.current=!0,null==p||p()),l.patchSearchParams(t=>{var l,i,n,s;let r,o,d,c=(l=t,i=e.rangeStart,n=e.rangeEnd,s=a,o="object"==typeof(r="object"==typeof l.filter&&l.filter?l.filter:{}).values&&r.values?r.values:{},d=eWV(function(e,t,l){let a=eWF(l),i=em()(e).startOf("day"),n=em()(t).startOf("day");if(n.isBefore(i)){let e=i;i=n,n=e}return eWH(l)?[eWB(i.subtract(1,"day"),a),eWB(n,a)]:[eWB(i,a),eWB(n.add(1,"day"),a)]}(new Date(i.getTime()-2592e6),n,s)),{...l,filter:{...r,values:{...o,booking_time_start_between:d}}}),u=c.filter&&"object"==typeof c.filter?c.filter:{},p=u.values&&"object"==typeof u.values?{...u.values}:{};return"week"===e.view||"month"===e.view||"resource"===e.view?(p.enable_remote_memory_cache=!0,p.compact_fields=!0):(delete p.enable_remote_memory_cache,delete p.compact_fields),{...c,filter:{...u,values:p}}}))},[t,l.patchSearchParams,a,p]),k=(0,ef.useCallback)(e=>{let t=e.raw;return!!t&&"object"==typeof t&&(n({raw:t,row:eGs(t,i),singleBookingMode:!0}),!0)},[n,i]),w=(0,ef.useMemo)(()=>({beforePersist:()=>(ex.message.warning(eN.getText("pisell-reservation.calendar-write-not-available")),!1)}),[]),j=(0,ef.useCallback)(e=>(0,ev.jsx)(eQx,{args:e,tables:i,calendarDragSuppressDetailRef:m}),[i]),S=i0(async e=>{let{mergedRange:t,slotStepMinutes:l}=e;try{return await eQf({resources:o,initialResourceId:t.courtId,initialTimeRange:[eGn(t.date,t.startHour),eGn(t.date,t.endHour)],minuteStep:l,blockedSalesChannels:["online_store"],onSubmit:async e=>{let{submitPayload:t}=e;await z_.Em.getRequest().post("/shop/schedule/blocked-time",t),ex.message.success("保存成功"),await u.refreshAsync()}}),!0}catch{return!1}}),M=i0(async e=>eQd({calendarItem:e.item,draft:e.draft,calendarResources:o,calendarBookings:d,effectiveTimelineRange:c,anchorDate:s.date.toDate(),slotStepMinutes:30,onSuccessRefresh:async()=>{await u.refreshAsync()}})),N=(0,ef.useMemo)(()=>`${g}_${em()(s.date).startOf("day").valueOf()}_${em()(s.at).valueOf()}`,[g,s.date,s.at]);(0,ef.useEffect)(()=>{let e=y.current,t=l.loading;if(!e&&t)f.current=N;else if(e&&t&&f.current!==N)f.current=N;else if(e&&!t){let e=f.current??N;v.current.add(e),f.current=null}y.current=t},[l.loading,N]),(0,ef.useMemo)(()=>"week"!==g&&"month"!==g&&"resource"!==g&&!!l.loading&&!v.current.has(N),[l.loading,N,g]);let C=i0(e=>{let t=e=>{var t;return(null==(t=o.find(t=>String(t.id)===String(e)))?void 0:t.name)??e};if("day"===e.mode)return void e.groups.map(e=>({resourceId:e.courtId,resourceName:t(e.courtId),date:e.date,startHour:e.startHour,endHour:e.endHour}));let{courtId:l,dates:a,startHour:i,endHour:n}=e;t(l),a.length>1?(a[0],a[a.length-1]):a[0]});return{reservationCalendarSlotProps:(0,ef.useMemo)(()=>({persistGuard:w,resources:o,bookings:d,loading:!1,onViewportChange:_,onBookingClick:k,timelineRange:c,calendarView:g,onCalendarViewChange:h,anchorDate:s.date.toDate(),onAnchorDateChange:x,slotStepMinutes:30,renderBooking:j,blockedTimeSalesChannels:["online_store"],onBlockedTimePanelRequest:S,onBookingMoveRequest:M,onCreateBookingFromSelection:C,tickFillMode:"snap"}),[w,o,d,_,k,g,s.date,x,c,j,S,M,C]),calendarGranularity:g,setCalendarGranularity:h}}({isInternalListData:eS,floorDayBookingData:tl,operatingDayBoundary:eY,tables:tk,openBookingDetailFromRaw:lr,schedule:tc,handleScheduleChange:tz,calendarResources:tS,calendarBookings:tM,effectiveTimelineRange:eW,runtimeContext:tn,onCalendarViewportFirstPatch:e9}),lm=function(e){let{floorMapProp:t,baseFloorConfig:l,dataSources:a,renderItemByKind:i,gridDataSourceKey:n,effectiveMapMode:s,resolvedFloorPlanId:r,floorPlanRemoteId:o,effectiveFloorPlanCode:d,floorPlanCanvasWidth:c,floorPlanCanvasHeight:u,floorPlanName:p,floorPlanSort:m,floorPlanStatus:g,onFloorPlanPersisted:h,putFloorPlan:v,isFloorModeControlled:f,mapEditInternal:y,setMapEditInternal:x,floorMapLayoutRef:b,reservationFloorMapViewportOverlay:_,setRemoteFloorPlanView:k,floorMapItemClickBefore:w,engineLocale:j,floorMapHudTableDrawer:S=!1,readModeSelectedItemId:M,editTopBarPhoneLayout:N,appearanceMode:C,onToggleAppearanceMode:T}=e;return(0,ef.useMemo)(()=>{var e;let j={[n]:eN.getText("pisell-reservation.floor-map.data-source-label")},P={[n]:[{key:"code",label:eN.getText("pisell-reservation.grid.code"),type:"string"},{key:"guestName",label:eN.getText("pisell-reservation.grid.guest"),type:"string"},{key:"time",label:eN.getText("pisell-reservation.grid.time"),type:"string"},{key:"partySize",label:eN.getText("pisell-reservation.grid.party"),type:"number"},{key:"cardStatus",label:eN.getText("pisell-reservation.resource-grid.card-status"),type:"string"},{key:"area",label:eN.getText("pisell-reservation.grid.area"),type:"string"}]},{getMergedItemWrapperStyle:A,...D}=t??{},I=D.onSave,E=o??r,z=null!=E&&Number.isFinite(E)&&Math.floor(E)===E&&E>0,L=(0,lL.wrapFloorMapOnSaveWithRemotePersist)({canPersist:z,persistTargetId:E??0,persist:(e,t)=>eWc(e,t,{canvasWidth:c,canvasHeight:u,code:d,name:p,sort:m,status:g,putFloorPlan:null!=v?(e,t)=>v(e,t):void 0}),setRemoteFloorPlanView:k,onFloorPlanPersisted:h,prevOnSave:I,onPersistError:eWu}),O=(null==t?void 0:t.dataSources)??a,R=d?`reservation-code:${d}`:null!=r?`reservation:${r}`:"reservation:default",$="light"===C?"#e8e8e8":void 0;return{mapLayer:{showGrid:!0,snapStep:1,...null==$?{}:{backgroundColor:$},...D.mapLayer},cellSize:D.cellSize??10,itemUnit:D.itemUnit??"pixel",dataSourceLabels:j,dataSourceFormColumns:P,...D,floorMapConfig:D.floorMapConfig??l,dataSources:O,renderItemByKind:(null==t?void 0:t.renderItemByKind)??i,appearanceMode:C,mode:s,toolbarShowSave:D.toolbarShowSave??!1,showDataSourceRecordFormBlock:D.showDataSourceRecordFormBlock??!1,zoom:{defaultScale:1,min:.4,max:2.2,step:.1,...D.zoom,autoFitOnMount:(null==(e=D.zoom)?void 0:e.autoFitOnMount)!==!1},controls:{showZoom:!0,showReset:!0,showFitBounds:!0,showGridToggle:!0,...D.controls},pan:{enabled:!0,boundary:"none",...D.pan},onItemClick:(e,l,a)=>{var i;null==w||w({item:e,index:l,event:a,mode:s,dataSources:O}),null==t||null==(i=t.onItemClick)||i.call(t,e,l,a)},getMergedItemWrapperStyle:A,onSave:L,onExitEdit:D.onExitEdit??(f?void 0:()=>{x(!1)}),floorMapViewportOverlay:D.floorMapViewportOverlay??_,viewportOverlayPlacement:S?"bottom-start":D.viewportOverlayPlacement,viewportOverlayClassName:D.viewportOverlayClassName,canvasTabsBarTrailing:D.canvasTabsBarTrailing,viewportPersist:D.viewportPersist,viewportPersistNamespace:D.viewportPersistNamespace??R,viewportDockToolButtons:D.viewportDockToolButtons??(0,ev.jsx)(eGk,{appearanceMode:C,onToggleAppearanceMode:T}),viewportDockTrailing:!1===D.viewportDockTrailing?(0,ev.jsx)(ey().Fragment,{}):D.viewportDockTrailing??(0,ev.jsx)(eGw,{isFloorModeControlled:f,mapEditInternal:y,setMapEditInternal:x,floorMapLayoutRef:b,phoneLayout:N}),readModeSelectedItemId:M??D.readModeSelectedItemId,editTopBarPhoneLayout:D.editTopBarPhoneLayout??N,enableEdges:!1,renderResourcePickerModal:D.renderResourcePickerModal??(e=>(0,ev.jsx)(eGI,{...e,platform:N?"h5":"pc",categoryConfig:(0,lL.getFloorMapCardPickerCategoryConfig)(),getSearchText:lL.floorMapResourcePickerRecordSearchText,getCardMeta:lL.getFloorMapResourcePickerCardMeta,renderFilterBar:e=>(0,ev.jsx)(lL.PisellTabbarTemplate1,{className:"pisell-pro-resource-picker-tabbar",style:{position:"sticky",top:0,zIndex:10,padding:6,background:"rgb(250, 250, 250)"},dataSource:e.tabbarDataSource,value:e.tabbarValue,onChange:e.onTabbarValueChange,onSearch:e.onKeywordChange,maxLevel:3})})),renderPaletteViewAllModal:D.renderPaletteViewAllModal??(e=>(0,ev.jsx)(eGR,{...e,platform:N?"h5":"pc"}))}},[l,a,t,S,_,i,n,C,s,r,o,d,c,u,p,m,g,h,v,f,y,b,T,k,w,j,M,N])}({floorMapProp:z,baseFloorConfig:e2,dataSources:tL,renderItemByKind:t8,gridDataSourceKey:C,effectiveMapMode:tF,resolvedFloorPlanId:eM,floorPlanRemoteId:e1,effectiveFloorPlanCode:eq,floorPlanCanvasWidth:el,floorPlanCanvasHeight:ea,floorPlanName:en,floorPlanSort:es,floorPlanStatus:er,onFloorPlanPersisted:eo,putFloorPlan:ed,isFloorModeControlled:tO,mapEditInternal:tR,setMapEditInternal:t$,floorMapLayoutRef:tP,reservationFloorMapViewportOverlay:t3,setRemoteFloorPlanView:e4,floorMapItemClickBefore:ls,engineLocale:eI,floorMapHudTableDrawer:eh,readModeSelectedItemId:lo,editTopBarPhoneLayout:ej,appearanceMode:t6,onToggleAppearanceMode:t7}),lg=eS?eX.data:q??[],lh=function(e){let[t,l]=(0,ef.useState)(!1),a=(0,ef.useRef)(null);return(0,ef.useEffect)(()=>(null!=a.current&&(window.clearTimeout(a.current),a.current=null),e?a.current=window.setTimeout(()=>{a.current=null,l(!0)},200):l(!1),()=>{null!=a.current&&(window.clearTimeout(a.current),a.current=null)}),[e]),t}(!eS&&(K??!1)),lv=eS?eX.total:V??0,lf=eS?eX.pagination:Y??{pageNumber:1,pageSize:20},ly=eS?eX.onPageChange:U,lx=eS?eX.searchParams:Q??{},lb=eV_({enabled:ej,isInternalListData:eS,rowKey:J,data:lg,pagination:lf,searchParams:lx}),l_=ej?lb:lg,lk=(0,ef.useCallback)(e=>{eX.onSearch(eGr(e))},[eX.onSearch]),lw=eS?lk:W,lj=eS?eX.onReset:G,{venueWallAppearanceTheme:lS,setVenueWallAppearanceTheme:lM,venueWallAppearanceMode:lN,setVenueWallAppearanceMode:lC,venueWallResourceLayout:lT,setVenueWallResourceLayout:lP}=function(e){let{bodyViewStorageKey:t,isInternalListData:l,searchParams:a,onSearch:i,venueWallCards:n,floorDayBookingLoading:s}=e,r=(0,ef.useRef)(!1),[o]=(0,ef.useState)(()=>(function(e){let t=`${eWI}:${e??"default"}`,l=null;try{"u">typeof localStorage&&(l=localStorage.getItem(t))}catch{l=null}let a=eQ0(l,eWE);return{venueWallAppearanceTheme:null!=a.venueWallAppearanceTheme&&eQZ(a.venueWallAppearanceTheme)?a.venueWallAppearanceTheme:{},venueWallAppearanceMode:"light"===a.venueWallAppearanceMode||"dark"===a.venueWallAppearanceMode?a.venueWallAppearanceMode:"light",venueWallResourceLayout:a.venueWallResourceLayout??lL.DEFAULT_RESOURCE_WALL_LAYOUT_PERSIST}})(t)),[d,c]=(0,ef.useState)(o.venueWallAppearanceTheme),[u,p]=(0,ef.useState)(o.venueWallAppearanceMode),[m,g]=(0,ef.useState)(o.venueWallResourceLayout),h=`${eWI}:${t??"default"}`;return(0,ef.useEffect)(()=>{if(!l||r.current)return;let e=null==a?void 0:a.filter,t=e&&"object"==typeof e&&null!==e&&"object"==typeof e.values&&null!==e.values?e.values:{},n={filterValuePatches:{}};try{let e=localStorage.getItem(h);n=eQ0(e,eWE)}catch{}(null==n?void 0:n.venueWallAppearanceTheme)!=null&&eQZ(n.venueWallAppearanceTheme)&&c(n.venueWallAppearanceTheme),("light"===n.venueWallAppearanceMode||"dark"===n.venueWallAppearanceMode)&&p(n.venueWallAppearanceMode),null!=n.venueWallResourceLayout&&g(n.venueWallResourceLayout);let s=t.resource_wall_resource_ids;if(Array.isArray(s)&&s.length>0){let e=Object.keys(n.filterValuePatches).length>0;i&&e&&i({...a,filter:{..."object"==typeof a.filter&&null!==a.filter?a.filter:{},values:{..."object"==typeof t?t:{},...n.filterValuePatches,resource_wall_resource_ids:s.map(String)}}}),r.current=!0;return}let o=!0===n.resourceWallResourceIdsInFile,d=n.resourceIds??[],u=o?eQX(d):[],m=Object.keys(n.filterValuePatches).length>0;r.current=!0,!i||(o||0!==u.length||m)&&i({...a,filter:{..."object"==typeof a.filter&&null!==a.filter?a.filter:{},values:{..."object"==typeof t?t:{},...n.filterValuePatches,resource_wall_resource_ids:u}}})},[l,h,i,a]),(0,ef.useEffect)(()=>{if(!l||!r.current||s||0===n.length)return;let e=null==a?void 0:a.filter;if(!e||"object"!=typeof e||null===e)return;let t=e.values;if(!t||"object"!=typeof t||Array.isArray(t))return;let o=t.resource_wall_resource_ids;if(!Array.isArray(o))return;let d=o.map(e=>String(e)),c=new Set(n.map(e=>String(e.resourceId))),u=d.filter(e=>c.has(e));u.length!==d.length&&(null==i||i({...a,filter:{...e,values:{...t,resource_wall_resource_ids:u}}}))},[l,n,s,a,i]),(0,ef.useEffect)(()=>{if(!l)return;let e=null==a?void 0:a.filter;if(!e||"object"!=typeof e||null===e||"object"!=typeof e.values||null===e.values)return;let t=e.values,i=t.resource_wall_resource_ids;if(!Array.isArray(i))return;let n=eQX(i.map(String)),s={};for(let e of eWE)"resource_wall_resource_ids"!==e&&Object.prototype.hasOwnProperty.call(t,e)&&(s[e]=t[e]);let r={v:1,resource_wall_resource_ids:n};Object.keys(s).length>0&&(r.filter_values=s),eQZ(d)&&(r.venueWallAppearanceTheme=d),r.venueWallAppearanceMode=u,r.venueWallResourceLayout=m;try{localStorage.setItem(h,JSON.stringify(r))}catch{}},[l,a,h,d,u,m]),{venueWallAppearanceTheme:d,setVenueWallAppearanceTheme:c,venueWallAppearanceMode:u,setVenueWallAppearanceMode:p,venueWallResourceLayout:m,setVenueWallResourceLayout:g}}({bodyViewStorageKey:eg,isInternalListData:eS,searchParams:lx,onSearch:lw,venueWallCards:tN,floorDayBookingLoading:tl.loading});f={isInternalListData:eS,resourceList:eQ.data,resourceListLoading:eQ.loading,salesResourceBookings:tx,debouncedScheduleKey:tC,debouncedSchedule:tu,gridBookingData:eX,floorDayBookingData:tl,tables:tk,dataProp:q??void 0,dataSourcesProp:T,gridDataSourceKey:C,floorConfigForBindings:e3,floorBoundFormRecordIds:e8,shellBodyView:eK,calendarGranularity:lu,schedule:tc,effectiveTimelineRange:eW,calendarOrderedResourceIds:tw,calendarResources:tS,calendarBookings:tM,venueWallCards:tN,searchParams:lx,floorBookingExtraParams:tt},(0,ef.useEffect)(()=>{},[f.isInternalListData,f.salesResourceBookings]),(0,ef.useEffect)(()=>{},[f.debouncedScheduleKey,f.debouncedSchedule.date,f.debouncedSchedule.at,f.isInternalListData,f.gridBookingData.data,f.gridBookingData.loading,f.floorDayBookingData.data,f.floorDayBookingData.loading,f.tables,f.dataProp,f.dataSourcesProp,f.gridDataSourceKey,f.floorConfigForBindings.sceneElements,f.floorBoundFormRecordIds]),(0,ef.useEffect)(()=>{},[f.shellBodyView,f.calendarGranularity,f.schedule.date,f.schedule.at,f.effectiveTimelineRange,f.floorDayBookingData.loading,f.floorDayBookingData.data,f.calendarOrderedResourceIds,f.calendarResources,f.calendarBookings]),(0,ef.useEffect)(()=>{},[f.shellBodyView,f.venueWallCards,f.floorDayBookingData.loading,f.searchParams,f.floorBookingExtraParams]);let{toolBarMerged:lA}=function(e){let{toolBarProp:t,bookingToolBar:l,isInternalListData:a,tables:i,schedule:n,handleScheduleChange:s,scheduleStartSlotProp:r,scheduleEndSlotProp:o,schedulePropsProp:d,mergedTimeNavigatorProps:c,followWallClock:u,onFollowWallClockToggle:p,onTimeNavigatorUserInteraction:m,calendarGranularity:g,setCalendarGranularity:h,onNewReservation:v,salesTimelineHighlights:f,floorDayBookingData:y,data:x,effectiveTimelineRange:b,bodyView:_,phoneLayout:k}=e,w=(0,ef.useMemo)(()=>(0,ev.jsx)(eG_,{onNewReservation:v,calendarGranularity:g,onCalendarGranularityChange:h,phoneLayout:k}),[v,g,h,k]),j=(0,ef.useMemo)(()=>{let e=o??w;return(0,ev.jsx)("div",{onClick:e=>{let t=e.target;(null==t?void 0:t.closest(".pisell-reservation-schedule-end-slots"))&&e.stopPropagation()},children:e})},[o,w]),S=(0,ef.useMemo)(()=>i.map(e=>{let t=String(e.id),l=null!=e.code&&""!==String(e.code).trim()?String(e.code):"",a=null!=e.name&&""!==String(e.name).trim()?String(e.name):"";return{value:t,label:l||a||t}}),[i]),M=(0,ef.useMemo)(()=>{let e=null==l?void 0:l.quickFilter;if(!1===e||null==e||!a)return e;let t=e.filterList,i=Array.isArray(t)?[...t]:[];return i.some(e=>String(e.key??e.name??"")===lL.DEFAULT_RESOURCE_WALL_FILTER_FIELD_KEY)?e:{..."object"==typeof e&&null!==e?e:{},filterList:[...i,{type:"custom",key:lL.DEFAULT_RESOURCE_WALL_FILTER_FIELD_KEY,name:lL.DEFAULT_RESOURCE_WALL_FILTER_FIELD_KEY,label:eN.getText(eWD),other:{component:eQb,options:S}}]}},[l,a,S]),N=(0,ef.useCallback)(async e=>{let{referenceDate:t,stepMinutes:l}=e,i=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:eWT;return(0,lL.getHorizontalAxisSlotCount)(l,e.startOf("day"),t)}(t,l,b);if(null!=f&&f.length>0){let e;return e=Math.max(1,i),f.length===e?[...f]:f.length>e?f.slice(0,e):[...f,...Array(e-f.length).fill(0)]}return function(e,t,l){let a=t.startOf("day"),i=Math.max(1,Math.round(1440/Math.max(1,l))),n=Array(i).fill(0);for(let t of e){let e=t.bookingTimeStart??t.start_at??(t.start_date&&t.start_time?`${t.start_date} ${t.start_time}`:void 0);if(!e||"string"!=typeof e)continue;let s=em()(e);if(!s.isValid()||!s.isSame(a,"day"))continue;let r=Math.min(i-1,Math.floor((60*s.hour()+s.minute())/l));n[r]+=1}return n.some(e=>e>0)?n:n.map((e,t)=>Math.max(0,Math.round(2+2*Math.sin(t/Math.max(1,i-1)*Math.PI*2)+Math.sin(t/Math.max(1,i-1)*Math.PI*6))))}(a?y:x,t,l)},[a,y,x,f,b.start,b.end]);return{toolBarMerged:(0,ef.useMemo)(()=>{let e,a,{tabs:i,topLeft:o,topRight:h,bottomLeft:v,quickFilter:f,...y}=t??{},x=void 0!==f?f:M,b={...l??{},...y},w=k?"grid"===_||"resourceWall"===_?eQM({baseToolBar:b,quickFilterFilterList:x&&"object"==typeof x&&Array.isArray(x.filterList)?x.filterList:void 0}):(a="string"==typeof(e=b??{}).className?e.className:void 0,{...e,className:t_()(a,"pisell-record-board-toolbar--narrow-stack")}):b,S=k&&x&&"object"==typeof x&&Array.isArray(x.filterList)?{...x,size:"small",filterList:eQS(x.filterList,{rangeFormItemClassName:"pisell-reservation-mobile-toolbar-range-filter-item",compactFormItem:!0})}:x,C=w.filter,T=k&&C&&"object"==typeof C?function(e){let t=e.defaultFilterValue;if("object"!=typeof t||null===t)return e;let l=t.otherFilter;return Array.isArray(l)?{...e,defaultFilterValue:{...t,otherFilter:eQS(l,{rangePickerVariant:"filter"})}}:e}(C):C,P=w.search,A="object"==typeof P&&null!==P?P:{},D="function"==typeof A.inputRender?A.inputRender:void 0,I=!1!==P&&{searchDebounce:300,...A,enableScanner:A.enableScanner??!0,inputRender:D??(e=>(0,ev.jsx)(qN,{ctx:e,showSearchButton:!1!==A.showConfirmButton}))};return{...w,search:I,...T?{filter:T}:{},...k?{}:{collapseActions:"gear"},quickFilter:S,hideBodyViewToggle:k&&("grid"===_||"resourceWall"===_),tabs:k&&("grid"===_||"resourceWall"===_)?null:(0,ev.jsx)(eGx,{extraTabs:i,schedule:n,onScheduleChange:s,scheduleProps:d,timeNavigatorProps:c,scheduleStartSlot:r??(k?null:(0,ev.jsx)(eGj,{})),scheduleEndSlot:j,followWallClock:u,onFollowWallClockToggle:p,onTimeNavigatorUserInteraction:m,loadDensity:N,calendarGranularity:g,phoneLayout:k}),topLeft:(0,ev.jsxs)(ev.Fragment,{children:[k?(0,ev.jsx)(eGy,{}):null,o]}),topRight:(0,ev.jsx)(eGb,{extra:h}),bottomLeft:v??null}},[l,M,t,n,s,r,j,u,p,m,c,d,N,g,k,_])}}({toolBarProp:E,bookingToolBar:ts.toolBar,isInternalListData:eS,tables:tk,schedule:tc,handleScheduleChange:tz,scheduleStartSlotProp:L,scheduleEndSlotProp:O,schedulePropsProp:F,mergedTimeNavigatorProps:tg,followWallClock:th,onFollowWallClockToggle:tf,onTimeNavigatorUserInteraction:ty,calendarGranularity:lu,setCalendarGranularity:lp,onNewReservation:()=>{var e;return null==(e=tA.current)?void 0:e.requestOpen()},salesTimelineHighlights:tb,floorDayBookingData:tl.data,data:lg,effectiveTimelineRange:eW,phoneLayout:ej,bodyView:eK}),lD=(0,ef.useMemo)(()=>ts.grid,[ts.grid]),lI=(0,ef.useMemo)(()=>{if(null==lD||"object"!=typeof lD)return lD;if(ej)return eQN(lD);let e=!1!==lD.infiniteScroll;return{...lD,infiniteScroll:e}},[ej,lD]),lE=(0,ef.useMemo)(()=>null==lD||"object"!=typeof lD?lD:eQN(lD),[lD]),lz=(0,ef.useMemo)(()=>{let e=null!=lE&&"object"==typeof lE&&"scroll"in lE&&null!=lE.scroll&&"object"==typeof lE.scroll?{...lE.scroll}:{};return null==lE||"object"!=typeof lE?{size:"small",infiniteScroll:!0,scroll:{...e,autoCalc:!0}}:{...lE,size:"small",infiniteScroll:!0,scroll:{...e,autoCalc:!0}}},[lE]),lO=(null==lI||null==(g=lI.scroll)?void 0:g.autoCalc)??!0,lR=(0,ef.useMemo)(()=>({cards:tN,loading:tl.loading,filterFieldKey:lL.DEFAULT_RESOURCE_WALL_FILTER_FIELD_KEY,appearanceTheme:lS,onAppearanceThemeChange:lM,appearanceMode:lN,onAppearanceModeChange:lC,resourceWallLayout:lT,onResourceWallLayoutChange:lP}),[tN,tl.loading,lS,lN,lT]);return(0,ev.jsx)(ej8,{dateAdapter:eSy,adapterLocale:eV,children:(0,ev.jsxs)("div",{className:t_()("pisell-reservation-page",ej&&"pisell-reservation-page--phone",X),style:ee,children:[(0,ev.jsxs)(lL.PisellRecordBoard,{...ew,columnVisibilityStorageKey:tr,layoutVariant:ej?"phone":"default",fillHeight:lO,rowKey:J,data:l_,dataSources:tL,loading:lh,total:lv,pagination:lf,onPageChange:ly,searchParams:lx,onSearch:lw,onReset:lj,grid:lI,toolBar:lA,search:ts.search,batchActionBar:ts.batchActionBar,floorMap:lm,calendar:lc,resourceWall:lR,defaultBodyView:"floorMap",bodyViewStorageKey:eg,bodyViewSwitchable:eu,lockedBodyView:ep,floorMapLayoutRef:tP,children:[(0,ev.jsx)(eGh,{bodyViewRef:tT,onBodyViewChange:eJ}),(0,ev.jsx)(eGv,{schedule:tc,isInternalListData:eS,patchSearchParams:tl.patchSearchParams,operatingDayBoundary:eY,timelineRange:eW}),(0,ev.jsxs)(lL.PisellRecordBoard.ShellFrame,{children:[(0,ev.jsx)(lL.PisellRecordBoard.GridLayout,{}),(0,ev.jsx)(lL.PisellRecordBoard.FloorMap,{}),(0,ev.jsx)(lL.PisellRecordBoard.Calendar,{...lc}),(0,ev.jsx)(lL.PisellRecordBoard.ResourceWall,{})]})]}),(0,ev.jsx)(eQC,{ref:tA,router:ez,app:eE}),(0,ev.jsx)(eU$,{open:t9,onClose:li,onActionSuccess:ld,raw:le,tableRow:lt,sceneElementName:ll,reservationBiz:eO,associatedMenuListIds:eB,reservationRuleProduct:e$,floorDayBookingList:tl.data,currentTime:tu.at,followWallClock:th,singleBookingMode:la}),B?(0,ev.jsx)("div",{className:"pisell-reservation-fab",children:B}):null,(0,ev.jsx)(eQ4,{floorMapHudTableDrawer:eh,showVenueHudDock:tB,hudDrawerOpen:tY,hudDrawerRef:tV,hudMapItems:tU,dataSources:tL,handleOpenHudTableDrawer:tH,closeHudTableDrawer:tq,rowKey:J,hudDrawerPagedRows:tG,hudDrawerLoading:tK,hudDrawerFilteredTotal:tQ,hudDrawerBookingPagination:tJ,hudDrawerOnPageChange:t0,hudDrawerLocalSearchParams:t1,hudDrawerOnSearch:tZ,hudDrawerOnReset:tX,hudDrawerGrid:lz,hudDrawerToolBar:t2,batchActionBar:ts.batchActionBar,hudDrawerResourceRootBuckets:tW,handleHudDrawerFormRecordIdsChange:t4})]})})},eQ6=e=>{let t=eVb(e.variant);return(0,ev.jsx)(eQ8,{...e,bodyViewStorageKey:e.bodyViewStorageKey??"pisell-reservation.body-view.v2",variant:t})},eQ5=eQ6,eQ7=eQ6,eQ9=e=>{let t=eVb(e.variant),{scheduleStartSlot:l,scheduleProps:a,timeNavigatorProps:i,...n}=e,s=(0,ef.useMemo)(()=>({...a,navigationLocked:!0,navigationLockedDisplay:"labelOnly"}),[a]);return(0,ev.jsx)(eQ8,{...n,variant:t,scheduleStartSlot:l??(0,ev.jsx)(eGS,{}),scheduleProps:s,timeNavigatorProps:i,bodyViewSwitchable:!1,lockedBodyView:"floorMap",bodyViewStorageKey:void 0,floorMapHudTableDrawer:!0})},eKe=e=>{let{bodyViewStorageKey:t,floorMapHudTableDrawer:l,...a}=e;return(0,ev.jsx)(eQ8,{...a,bodyViewStorageKey:t??eWN,bodyViewSwitchable:!1,lockedBodyView:"resourceWall",floorMapHudTableDrawer:l??!1})},eKt=e=>{let t=eVb(e.variant),{bodyViewStorageKey:l,floorMapHudTableDrawer:a,...i}=e;return(0,ev.jsx)(eQ8,{...i,variant:t,bodyViewStorageKey:l??eWC,bodyViewSwitchable:!1,lockedBodyView:"grid",floorMapHudTableDrawer:a??!1})},eKl={padding:0,height:"100%"};function eKa(){return(0,ev.jsx)("div",{className:"pisell-select-floor-map-resource-dialog-skeleton",children:(0,ev.jsxs)("div",{className:"pisell-select-floor-map-resource-dialog-skeleton__toolbar",children:[(0,ev.jsx)(ex.Skeleton.Button,{active:!0,block:!0}),(0,ev.jsx)(ex.Skeleton.Button,{active:!0,block:!0}),(0,ev.jsx)(ex.Skeleton.Button,{active:!0,block:!0})]})})}let eKi=function(e){var t,l;let{open:a,onClose:i,onClick:n,reservationBiz:s,businessCode:r,associatedMenuListIds:o,scheduleValue:d,floorPlanId:c,floorPlanCode:u,floorPlanCanvasWidth:p,floorPlanCanvasHeight:m,dataSources:g,floorMap:h,title:v}=e,f=ik(),y=(null==f||null==(l=f.engine)||null==(t=l.props)?void 0:t.locale)||"zh-CN",[x,b]=(0,ef.useState)(!1);eN.init(eWP,y),(0,ef.useEffect)(()=>{if(!a)return void b(!1);let e=window.setTimeout(()=>{b(!0)},200);return()=>{window.clearTimeout(e)}},[a]);let _=(0,ef.useCallback)(e=>{null==n||n(e)},[n]),k=(0,ef.useMemo)(()=>({enabled:!0,onSelectResource:_}),[_]),w=(0,ef.useMemo)(()=>(function(e){if(null==e)return;let t="string"==typeof e?e:e.at,l=em()(t);if(!l.isValid())return;let a="string"==typeof e?void 0:e.date,i=em()(a);return{date:null!=a&&i.isValid()?i.startOf("day"):l.startOf("day"),at:l}})(d),[d]);return(0,ev.jsx)(iB,{renderType:"modal",props:{height:"99%",platform:"pc",open:a,onCancel:i,title:v??eN.getText("pisell-reservation.select-resource.title"),footer:null,destroyOnClose:!0,width:"99%",className:"pisell-select-floor-map-resource-dialog-modal",bodyStyle:eKl,wrapClassName:"pisell-select-floor-map-resource-dialog"},children:(0,ev.jsx)("div",{className:"pisell-select-floor-map-resource-dialog-content",children:x?(0,ev.jsx)(eQ8,{reservationBiz:s??r,associatedMenuListIds:o,scheduleValue:w,floorPlanId:c,floorPlanCode:u,floorPlanCanvasWidth:p,floorPlanCanvasHeight:m,dataSources:g,floorMap:h,bodyViewSwitchable:!1,lockedBodyView:"floorMap",resourceSelectMode:k}):(0,ev.jsx)(eKa,{})})})},eKn={en:{"pisell-topology.edit-map":"Edit topology","pisell-topology.edit-map-done":"Done","pisell-topology.auto-arrange":"Auto arrange","pisell-topology.scope.show-all":"Show all","pisell-topology.scope.focus":"This device only","pisell-topology.floor-plan.save-failed":"Failed to save topology floor plan","pisell-topology.device-status.online":"online","pisell-topology.device-status.offline":"offline","pisell-topology.device-status.warning":"warning","pisell-topology.device-status.unknown":"unknown","pisell-topology.device-status.removed":"removed","pisell-topology.legend.title":"Connections","pisell-topology.legend.ethernet":"Ethernet","pisell-topology.legend.usb":"USB","pisell-topology.legend.bluetooth":"Bluetooth","pisell-topology.legend.wifi":"Wi-Fi","pisell-topology.canvas.devices":"Devices","pisell-topology.category.devices":"Devices","pisell-topology.category.area":"Area"},"zh-CN":{"pisell-topology.edit-map":"编辑拓扑","pisell-topology.edit-map-done":"完成编辑","pisell-topology.auto-arrange":"自动排列","pisell-topology.scope.show-all":"显示全部","pisell-topology.scope.focus":"只看本机","pisell-topology.floor-plan.save-failed":"拓扑平面图保存失败","pisell-topology.device-status.online":"在线","pisell-topology.device-status.offline":"离线","pisell-topology.device-status.warning":"告警","pisell-topology.device-status.unknown":"未知","pisell-topology.device-status.removed":"已下线","pisell-topology.legend.title":"连接方式","pisell-topology.legend.ethernet":"以太网","pisell-topology.legend.usb":"USB","pisell-topology.legend.bluetooth":"蓝牙","pisell-topology.legend.wifi":"Wi-Fi","pisell-topology.canvas.devices":"设备","pisell-topology.category.devices":"设备","pisell-topology.category.area":"分区"},"zh-HK":{"pisell-topology.edit-map":"編輯拓撲","pisell-topology.edit-map-done":"完成編輯","pisell-topology.auto-arrange":"自動排列","pisell-topology.scope.show-all":"顯示全部","pisell-topology.scope.focus":"只看本機","pisell-topology.floor-plan.save-failed":"拓撲平面圖儲存失敗","pisell-topology.device-status.online":"在線","pisell-topology.device-status.offline":"離線","pisell-topology.device-status.warning":"告警","pisell-topology.device-status.unknown":"未知","pisell-topology.device-status.removed":"已下線","pisell-topology.legend.title":"連接方式","pisell-topology.legend.ethernet":"乙太網","pisell-topology.legend.usb":"USB","pisell-topology.legend.bluetooth":"藍牙","pisell-topology.legend.wifi":"Wi-Fi","pisell-topology.canvas.devices":"設備","pisell-topology.category.devices":"設備","pisell-topology.category.area":"分區"}};function eKs(e){return(0,lL.getFloorMapDisplayLocale)(e)}function eKr(e,t){var l,a,i,n,s,r;return(null==(l=eKn[eN.formatLocale(t)])?void 0:l[e])??(null==(a=eKn["zh-CN"])?void 0:a[e])??(null==(i=eKn.zh)?void 0:i[e])??(null==(n=eKn["zh-HK"])?void 0:n[e])??(null==(s=eKn.tc)?void 0:s[e])??(null==(r=eKn.en)?void 0:r[e])}function eKo(e){return eKr("pisell-topology.canvas.devices",e)??"设备"}let eKd="#98A2B3",eKc="#475467",eKu="#FFFFFF",eKp="#F2F4F7",eKm="#12B76A",eKg="#F79009",eKh="#1570EF",eKv="#6938EF",eKf={viewBox:"0 0 80 56",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0};function eKy(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"26",y:"6",width:"28",height:"38",rx:"3",fill:eKu,stroke:eKc,strokeWidth:"1.5"}),(0,ev.jsx)("rect",{x:"29",y:"9",width:"22",height:"28",rx:"1.5",fill:"#EAECF0"}),(0,ev.jsx)("circle",{cx:"40",cy:"41",r:"1.4",fill:eKc}),(0,ev.jsx)("rect",{x:"20",y:"46",width:"40",height:"5",rx:"1.5",fill:eKp,stroke:eKc,strokeWidth:"1.2"}),(0,ev.jsx)("path",{d:"M30 12h16M30 16h12M30 20h14",stroke:"#CFD4DC",strokeWidth:"1.2",strokeLinecap:"round"})]})}function eKx(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("path",{d:"M22 14h36c0-3.5-2-5-5-5H27c-3 0-5 1.5-5 5z",fill:eKu,stroke:eKc,strokeWidth:"1.4"}),(0,ev.jsx)("path",{d:"M24 12c2-3 6-3 10-2s10 2 14 1",fill:"none",stroke:eKd,strokeWidth:"1.2",strokeLinecap:"round"}),(0,ev.jsx)("rect",{x:"18",y:"14",width:"44",height:"32",rx:"3",fill:eKu,stroke:eKc,strokeWidth:"1.5"}),(0,ev.jsx)("rect",{x:"22",y:"20",width:"36",height:"4",rx:"1",fill:eKp,stroke:eKd,strokeWidth:"1"}),(0,ev.jsx)("rect",{x:"24",y:"30",width:"32",height:"10",rx:"1.5",fill:eKp,stroke:eKd,strokeWidth:"1"}),(0,ev.jsx)("circle",{cx:"52",cy:"35",r:"1.3",fill:eKm}),(0,ev.jsx)("circle",{cx:"48",cy:"35",r:"1.3",fill:eKg})]})}function eKb(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"3",y:"18",width:"74",height:"22",rx:"3",fill:eKu,stroke:eKc,strokeWidth:"1.5"}),(0,ev.jsx)("text",{x:"11",y:"33",fontFamily:"ui-sans-serif, -apple-system, Helvetica, Arial",fontWeight:"700",fontSize:"9",fill:eKc,children:"SW"}),Array.from({length:12}).map((e,t)=>(0,ev.jsx)("rect",{x:26+4*t,y:"23",width:"2.4",height:"12",rx:"0.5",fill:t%3==0?eKm:t%3==1?eKg:"#D0D5DD"},t)),(0,ev.jsx)("path",{d:"M65 24l3 4-3 4M68 24l3 4-3 4",fill:"none",stroke:eKc,strokeWidth:"1.2",strokeLinecap:"round"}),(0,ev.jsx)("rect",{x:"3",y:"40",width:"74",height:"3",rx:"1",fill:"#EAECF0"})]})}function eK_(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"22",y:"8",width:"36",height:"36",rx:"4",fill:eKu,stroke:eKc,strokeWidth:"1.5"}),(0,ev.jsx)("circle",{cx:"40",cy:"26",r:"1.6",fill:eKc}),(0,ev.jsx)("path",{d:"M34 28a8 8 0 0 1 12 0M31 32a12 12 0 0 1 18 0",fill:"none",stroke:eKc,strokeWidth:"1.4",strokeLinecap:"round"}),(0,ev.jsx)("circle",{cx:"26",cy:"40",r:"1",fill:eKd}),(0,ev.jsx)("circle",{cx:"54",cy:"40",r:"1",fill:eKm})]})}function eKk(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"14",y:"10",width:"52",height:"36",rx:"3",fill:eKp,stroke:eKc,strokeWidth:"1.5"}),(0,ev.jsx)("path",{d:"M34 22c0-3 2.5-5 6-5s6 2 6 5c0 2.5-2 3.5-3.5 4.5-1.5 1-2.5 1.7-2.5 3.5",fill:"none",stroke:eKc,strokeWidth:"1.6",strokeLinecap:"round"}),(0,ev.jsx)("circle",{cx:"40",cy:"36",r:"1.3",fill:eKc})]})}function eKw(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("path",{d:"M20 16l-3-7M40 16l0-9M60 16l3-7",stroke:eKc,strokeWidth:"1.4",strokeLinecap:"round"}),(0,ev.jsx)("circle",{cx:"17",cy:"9",r:"1.4",fill:eKc}),(0,ev.jsx)("circle",{cx:"40",cy:"7",r:"1.4",fill:eKc}),(0,ev.jsx)("circle",{cx:"63",cy:"9",r:"1.4",fill:eKc}),(0,ev.jsx)("rect",{x:"8",y:"18",width:"64",height:"22",rx:"3",fill:eKu,stroke:eKc,strokeWidth:"1.5"}),Array.from({length:6}).map((e,t)=>(0,ev.jsx)("circle",{cx:18+9*t,cy:"29",r:"1.6",fill:0===t?eKm:5===t?eKg:eKh,opacity:1===t?.4:1},t)),(0,ev.jsx)("rect",{x:"8",y:"38",width:"64",height:"3",rx:"1",fill:"#EAECF0"})]})}let eKj={topologyRouter:eKw,topologySwitch:eKb,topologyAp:eK_,topologyCashier:function(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"14",y:"10",width:"52",height:"32",rx:"3",fill:eKu,stroke:eKc,strokeWidth:"1.5"}),(0,ev.jsx)("rect",{x:"18",y:"14",width:"32",height:"14",rx:"1.5",fill:"#FFF6ED",stroke:eKg,strokeWidth:"1.2"}),(0,ev.jsx)("rect",{x:"18",y:"32",width:"44",height:"8",rx:"1",fill:eKp,stroke:eKd,strokeWidth:"1"}),(0,ev.jsx)("circle",{cx:"56",cy:"20",r:"2",fill:eKg})]})},topologyGate:function(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"14",y:"10",width:"14",height:"36",rx:"2",fill:eKu,stroke:eKm,strokeWidth:"1.5"}),(0,ev.jsx)("rect",{x:"52",y:"10",width:"14",height:"36",rx:"2",fill:eKu,stroke:eKm,strokeWidth:"1.5"}),(0,ev.jsx)("path",{d:"M28 28h24",stroke:eKm,strokeWidth:"2",strokeLinecap:"round"})]})},topologyKiosk:function(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"22",y:"4",width:"36",height:"40",rx:"3",fill:eKu,stroke:eKv,strokeWidth:"1.5"}),(0,ev.jsx)("rect",{x:"26",y:"8",width:"28",height:"22",rx:"1.5",fill:"#F4F3FF",stroke:eKv,strokeWidth:"1.2"}),(0,ev.jsx)("rect",{x:"28",y:"34",width:"24",height:"4",rx:"1",fill:"#F4F3FF"}),(0,ev.jsx)("rect",{x:"14",y:"44",width:"52",height:"6",rx:"1.5",fill:eKp,stroke:eKc,strokeWidth:"1.2"})]})},topologyIntegratedPos:eKy,topologyPrinter:eKx,topologyAmusement:eKk,"topologyDevice:pos":eKy,"topologyDevice:receipt_printer":eKx,"topologyDevice:label_printer":function(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"14",y:"14",width:"44",height:"28",rx:"3",fill:eKu,stroke:eKc,strokeWidth:"1.5"}),(0,ev.jsx)("rect",{x:"20",y:"20",width:"32",height:"6",rx:"1",fill:eKp,stroke:eKd,strokeWidth:"1"}),(0,ev.jsx)("circle",{cx:"50",cy:"36",r:"1.4",fill:eKm}),(0,ev.jsx)("rect",{x:"58",y:"22",width:"14",height:"20",rx:"1.5",fill:eKu,stroke:eKc,strokeWidth:"1.4"}),(0,ev.jsx)("path",{d:"M62 26h6M62 30h6M62 34h6M62 38h6",stroke:eKd,strokeWidth:"0.9",strokeLinecap:"round"})]})},"topologyDevice:switch":eKb,"topologyDevice:info_display":function(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"6",y:"4",width:"68",height:"40",rx:"3",fill:eKu,stroke:eKc,strokeWidth:"1.5"}),(0,ev.jsx)("rect",{x:"10",y:"8",width:"60",height:"32",rx:"1.5",fill:"#EAECF0"}),(0,ev.jsx)("path",{d:"M14 36l8-12 6 7 8-15 12 18 8-9",stroke:eKh,strokeWidth:"1.4",fill:"none",strokeLinejoin:"round"}),(0,ev.jsx)("rect",{x:"34",y:"44",width:"12",height:"4",fill:eKp,stroke:eKc,strokeWidth:"1.2"}),(0,ev.jsx)("rect",{x:"22",y:"48",width:"36",height:"3",rx:"1",fill:eKp,stroke:eKc,strokeWidth:"1.2"})]})},"topologyDevice:terminal":function(){return(0,ev.jsxs)("svg",{...eKf,children:[(0,ev.jsx)("rect",{x:"26",y:"4",width:"28",height:"48",rx:"3",fill:eKu,stroke:eKc,strokeWidth:"1.5"}),(0,ev.jsx)("rect",{x:"29",y:"8",width:"22",height:"18",rx:"1.5",fill:"#EAECF0"}),Array.from({length:12}).map((e,t)=>{let l=t%3,a=Math.floor(t/3);return(0,ev.jsx)("rect",{x:30+7*l,y:29+5*a,width:"5",height:"3.4",rx:"0.6",fill:eKp,stroke:eKd,strokeWidth:"0.7"},t)})]})},"topologyDevice:chenlei":eKk,"topologyDevice:test1":eK_,"topologyDevice:unknown":eKw},eKS="pisell-topology-device-card";function eKM(e,t){return eKr(`pisell-topology.device-status.${e}`,t)??e}function eKN(e){var t,l,a,i,n,s;let{item:r,device:o}=e,d=r.elementKind??"",c=eKj[d]??eKw,u=eKs(ik()),p=(null==(l=r._sceneElement)||null==(t=l.dataBinding)?void 0:t.recordId)!=null?String(r._sceneElement.dataBinding.recordId):void 0,m=null!=p&&null==o,g=(null==(a=r.name)?void 0:a.trim())||(null==o||null==(i=o.name)?void 0:i.trim())||(null==o||null==(n=o.model)?void 0:n.trim())||(m?p:d),h=m?"unknown":(null==o?void 0:o.status)??"online",v=null==o||null==(s=o.ip)?void 0:s.trim(),f=m?eKM("removed",u):eKM(h,u);return(0,ev.jsxs)("div",{className:t_()(eKS,{[`${eKS}--ghost`]:m}),children:[(0,ev.jsxs)("div",{className:`${eKS}__main`,children:[(0,ev.jsx)("span",{className:t_()(`${eKS}__status`,m?`${eKS}__status--removed`:`${eKS}__status--${h}`),children:f}),(0,ev.jsx)("div",{className:`${eKS}__icon`,children:(0,ev.jsx)(c,{})})]}),(0,ev.jsxs)("div",{className:`${eKS}__footer`,children:[(0,ev.jsx)("div",{className:`${eKS}__name`,title:g,children:g}),v?(0,ev.jsx)("div",{className:`${eKS}__ip`,title:v,children:v}):null]})]})}function eKC(e){let{mapEditInternal:t,setMapEditInternal:l,floorMapLayoutRef:a,forceEditMode:i,phoneLayout:n,onAutoArrange:s,autoArrangePending:r}=e,o=eKs(ik()),d=i||t,c=eKr(d?"pisell-topology.edit-map-done":"pisell-topology.edit-map",o)??"",u=eKr("pisell-topology.auto-arrange",o)??"",p=d&&"function"==typeof s,m=()=>{if(d){var e,t;null==(t=a.current)||null==(e=t.saveLayout)||e.call(t),i||l(!1);return}l(!0)};return n?(0,ev.jsxs)(ev.Fragment,{children:[p?(0,ev.jsx)("button",{type:"button",className:"pisell-floor-map-layout-view-controls-tool-btn",title:u,"aria-label":u,disabled:r,onClick:s,children:(0,ev.jsx)(PV,{})}):null,(0,ev.jsx)("button",{type:"button",className:d?"pisell-floor-map-layout-view-controls-tool-btn pisell-floor-map-layout-view-controls-tool-btn--active":"pisell-floor-map-layout-view-controls-tool-btn",title:c,"aria-label":c,"aria-pressed":d,onClick:m,children:d?(0,ev.jsx)(uj,{}):(0,ev.jsx)(hC,{})})]}):(0,ev.jsxs)("div",{className:"pisell-topology-floor-map-dock-actions",children:[p?(0,ev.jsx)(ex.Button,{size:"middle",icon:(0,ev.jsx)(PV,{}),className:"pisell-topology-floor-map-edit-btn",loading:r,onClick:s,children:u}):null,(0,ev.jsx)(ex.Button,{type:"primary",size:"middle",className:"pisell-topology-floor-map-edit-btn",onClick:m,children:c})]})}function eKT(e){let{scope:t,onChange:l,phoneLayout:a}=e,i=eKs(ik()),n="focused"===t,s=n?eKr("pisell-topology.scope.show-all",i)??"":eKr("pisell-topology.scope.focus",i)??"",r=()=>{l(n?"all":"focused")};return a?(0,ev.jsx)("button",{type:"button",className:"pisell-floor-map-layout-view-controls-tool-btn",title:s,"aria-label":s,"aria-pressed":!n,onClick:r,children:n?(0,ev.jsx)(oT,{}):(0,ev.jsx)(rQ,{})}):(0,ev.jsx)(ex.Button,{size:"middle",icon:n?(0,ev.jsx)(oT,{}):(0,ev.jsx)(rQ,{}),className:"pisell-topology-scope-toggle-btn",onClick:r,children:s})}let eKP="pisell-topology-connection-legend",eKA=[{i18nKey:"pisell-topology.legend.ethernet",color:"#94a3b8",dashed:!1},{i18nKey:"pisell-topology.legend.usb",color:"#8b5cf6",dashed:!1},{i18nKey:"pisell-topology.legend.bluetooth",color:"#3b82f6",dashed:!0},{i18nKey:"pisell-topology.legend.wifi",color:"#06b6d4",dashed:!0}];function eKD(){let e=eKs(ik());return(0,ev.jsxs)("div",{className:eKP,children:[(0,ev.jsx)("div",{className:`${eKP}__title`,children:eKr("pisell-topology.legend.title",e)}),(0,ev.jsx)("ul",{className:`${eKP}__list`,children:eKA.map(t=>(0,ev.jsxs)("li",{className:`${eKP}__row`,children:[(0,ev.jsx)("svg",{className:`${eKP}__line`,width:28,height:10,viewBox:"0 0 28 10","aria-hidden":!0,children:(0,ev.jsx)("line",{x1:1,y1:5,x2:27,y2:5,stroke:t.color,strokeWidth:2,strokeLinecap:"round",strokeDasharray:t.dashed?"4 3":void 0})}),(0,ev.jsx)("span",{className:`${eKP}__label`,children:eKr(t.i18nKey,e)})]},t.i18nKey))})]})}let eKI="devices",eKE="topologyDevice:",eKz="devices",eKL=["pos","receipt_printer","label_printer","switch","info_display","terminal","chenlei","test1"],eKO={pos:"POS",receipt_printer:"小票打印机",label_printer:"标签打印机",switch:"交换机",info_display:"显示屏",terminal:"终端",chenlei:"chenlei",test1:"test1"};function eKR(e){return`${eKE}${e}`}let eK$=[...eKL.map(eKR),`${eKE}unknown`];function eKF(e,t){if("string"==typeof e)return e.trim()||t;if(!e||"object"!=typeof e)return t;for(let t of[e["zh-CN"],e["zh-HK"],e.en,e.original])if("string"==typeof t&&t.trim())return t.trim();return t}function eKB(e){var t;return eKF(e.name,void 0)??eKF(null==(t=e.model)?void 0:t.name,void 0)??e.number??`#${e.id}`}function eKH(e,t){let l=new Map;for(let t of e)l.set(String(t.id),new Set);for(let e of t){let t=String(e.source_device_id),a=String(e.target_device_id);t!==a&&l.has(t)&&l.has(a)&&(l.get(t).add(a),l.get(a).add(t))}return l}function eKq(e,t){let l=new Set,a=[];for(let i of e){let e=String(i.id);if(l.has(e))continue;let n=[e],s=[];for(;n.length;){let e=n.shift();if(!l.has(e))for(let a of(l.add(e),s.push(e),t.get(e)??[]))l.has(a)||n.push(a)}a.push(s)}return a}let eKV=["smart","dumb","integrated"];function eKY(e){return"dumb"===e.type_kind?"dumb":"integrated"===e.type_kind?"integrated":"smart"}function eKU(e,t,l,a){let i=t.get(e);if(!i||0===i.size)return a;let n=0,s=0;for(let e of i){let t=l.get(e);null!=t&&(n+=t,s+=1)}return 0===s?a:n/s}function eKW(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:56,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1400,a=0,i=0,n=0,s=0,r=0,o=[];for(let d of e)a>0&&a+d.width>l&&(i+=n+t,a=0,n=0),o.push({cluster:d,offsetX:a,offsetY:i}),a+=d.width+t,n=Math.max(n,d.height),s=Math.max(s,a-t),r=Math.max(r,i+d.height);return{placements:o,totalRight:s,totalBottom:r}}function eKG(e,t,l,a){return{instanceId:`topology-device-${e.id}`,canvasId:"main",x:Math.round(t),y:Math.round(l),width:132,height:72,elementKind:eKZ(e,a),name:eKB(e),dataBinding:{dataSourceKey:eKI,recordId:String(e.id)}}}function eKQ(e,t){let l=new Map;if(0===e.length)return{positions:l,width:0,height:0};let a=new Map(e.map(e=>[String(e.id),e])),i=eKH(e,t),n=eKq(e,i),s=n.filter(e=>e.length>1),r=n.filter(e=>1===e.length).map(e=>e[0]),{placements:o,totalBottom:d}=eKW(s.map(e=>(function(e,t,l){if(1===e.length)return{positions:new Map([[e[0],{x:0,y:0}]]),width:132,height:72,size:1};let a={smart:[],dumb:[],integrated:[]};for(let t of e){let e=l.get(t);e&&a[eKY(e)].push(t)}let i=eKV.map(e=>a[e]);i[0].length>0&&(i[0]=function(e,t){if(e.length<=1)return[...e];let l=[...e].sort((l,a)=>{var i,n;let s=(null==(i=t.get(l))?void 0:i.size)??0,r=(null==(n=t.get(a))?void 0:n.size)??0;return r!==s?r-s:e.indexOf(l)-e.indexOf(a)}),a=[];return l.forEach((e,t)=>{t%2==0?a.push(e):a.unshift(e)}),a}(i[0],t));for(let e=1;e<i.length;e++)!function(e,t,l){if(e.length<=1||0===t.length)return;let a=new Map(t.map((e,t)=>[e,t]));e.sort((t,i)=>eKU(t,l,a,e.length)-eKU(i,l,a,e.length))}(i[e],i[e-1],t);let n=i.filter(e=>e.length>0),s=Math.max(...n.map(e=>132*e.length+(e.length-1)*56),132),r=72*n.length+(n.length-1)*56,o=new Map,d=0;for(let e of i){if(0===e.length)continue;let t=(s-(132*e.length+(e.length-1)*56))/2;e.forEach((e,l)=>{o.set(e,{x:t+188*l,y:d})}),d+=128}return{positions:o,width:s,height:r,size:e.length}})(e,i,a)).sort((e,t)=>t.size-e.size)),c=0,u=0;for(let e of o)for(let[t,a]of e.cluster.positions){let i=e.offsetX+a.x,n=e.offsetY+a.y;l.set(t,{x:i,y:n}),c=Math.max(c,i+132),u=Math.max(u,n+72)}if(r.length>0){let e=function(e,t){let l={smart:[],dumb:[],integrated:[]};for(let a of e){let e=t.get(a);e&&l[eKY(e)].push(a)}return l}(r,a),t=d>0?d+56:0;for(let a of eKV){let i=e[a];if(0===i.length)continue;let n=function(e,t,l){if(0===e.length)return{width:0,height:0};let a=Math.max(1,Math.min(e.length,Math.ceil(Math.sqrt(1.5*e.length)))),i=Math.ceil(e.length/a);return e.forEach((e,i)=>{let n=Math.floor(i/a);l.set(e,{x:0+i%a*188,y:t+128*n})}),{width:132*a+(a-1)*56,height:72*i+(i-1)*56}}(i,t,l);c=Math.max(c,n.width),u=Math.max(u,t+n.height),t+=n.height+56}}return{positions:l,width:c,height:u}}function eKK(e){return`topology-device-${e}`}let eKJ="topology-device-";function eKZ(e,t){let l=(e.type_code??"").trim();return(l&&t.get(l))??`${eKE}unknown`}let eKX={ethernet:{},lan:{},wired:{},usb:{color:"#8b5cf6"},bluetooth:{color:"#3b82f6",dashed:!0},bt:{color:"#3b82f6",dashed:!0},wifi:{color:"#06b6d4",dashed:!0},"wi-fi":{color:"#06b6d4",dashed:!0},wireless:{color:"#06b6d4",dashed:!0}};function eK0(e,t){let l=new Map(t.map(e=>[String(e.id),e])),a=e=>{let t=l.get(e);return t?eKV.indexOf(eKY(t)):0};return e.filter(e=>{let t=String(e.source_device_id),a=String(e.target_device_id);return l.has(t)&&l.has(a)&&t!==a}).map(e=>{var t,l,i;let n,s,r=String(e.source_device_id),o=String(e.target_device_id),d=a(r),c=a(o);d<c?(n="bottom",s="top"):d>c?(n="top",s="bottom"):(n="bottom",s="top");let u=(i=null==(t=e.config)?void 0:t.connection_type)?eKX[i.trim().toLowerCase()]??{}:{};return{id:`topology-connection-${e.id}`,sourceId:eKK(r),targetId:eKK(o),sourceAnchor:n,targetAnchor:s,status:function(e){switch(e){case"connected":case"online":return"online";case"disconnected":case"offline":return"offline";case"warning":return"warning";default:return"unknown"}}(e.status),...u.color?{color:u.color}:{},...u.dashed?{dashed:!0}:{},extensions:{connectionType:(null==(l=e.config)?void 0:l.connection_type)??null}}})}function eK2(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en";return[{id:"main",name:eKo(e),order:0,enabled:!0,mapLayer:{showGrid:!1,backgroundColor:"#ffffff"}}]}function eK1(e){let{rawDevices:t,rawConnections:l,savedSceneElements:a,savedEdges:i}=e,n=e.displayLocale??"en",{categories:s,kinds:r,typeCodeToKind:o}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en",t=new Map,l=eKL.map(e=>{let l=eKR(e);return t.set(e,l),{value:l,label:eKO[e]??e,categoryId:eKz,dataBindingPolicy:"optional",allowedDataSourceKeys:[eKI],showInPalette:!1}});return l.push({value:`${eKE}unknown`,label:"Unknown",categoryId:eKz,dataBindingPolicy:"optional",allowedDataSourceKeys:[eKI],showInPalette:!1}),l.push({value:lL.FLOOR_MAP_SELECTION_ZONE_ELEMENT_KIND,label:eKr("pisell-topology.category.area",e)??"分区",categoryId:eKz,dataBindingPolicy:"none",showInPalette:!1}),{categories:[{id:eKz,label:eKr("pisell-topology.category.devices",e)??"设备",order:0}],kinds:l,typeCodeToKind:t}}(n),d={[eKI]:t.map(e=>{var t;return{id:String(e.id),name:eKB(e),model:eKF(null==(t=e.model)?void 0:t.name,void 0)??e.model_code??void 0,sn:e.number??void 0,status:function(e){switch(e.status){case"online":return"online";case"offline":return"offline";case"warning":return"warning";default:return"unknown"}}(e),ip:function(e){let t=e.data;if(t&&"object"==typeof t){let e=t.network;if(e&&"object"==typeof e&&!Array.isArray(e)){let t=e.local_ip;if("string"==typeof t&&t.trim())return t.trim()}}}(e)}})};if(!a||0===a.length){let{sceneElements:e}=function(e,t,l){if(0===e.length)return{sceneElements:[]};let a=(function(e){let t=new Map,l=[];for(let n of e){let e=function(e){var t;let l=(null==(t=e.workarea)?void 0:t.id)??e.workarea_id;if(null==l)return null;let a=String(l).trim();return a&&"0"!==a?a:null}(n);if(null==e){l.push(n);continue}let s=t.get(e);if(!s){var a,i;s={workareaId:e,name:eKF(null==(a=n.workarea)?void 0:a.name,void 0)??`Workarea ${e}`,sort:"number"==typeof(null==(i=n.workarea)?void 0:i.sort)?n.workarea.sort:0,devices:[]},t.set(e,s)}s.devices.push(n)}let n=[...t.values()].sort((e,t)=>e.sort-t.sort||e.name.localeCompare(t.name));return l.length>0&&n.push({workareaId:null,name:"",sort:Number.MAX_SAFE_INTEGER,devices:l}),n})(e).map(e=>{let l=null!=e.workareaId,a=new Set(e.devices.map(e=>String(e.id))),i=t.filter(e=>a.has(String(e.source_device_id))&&a.has(String(e.target_device_id))),n=eKQ(e.devices,i),s=32*!!l,r=20*!!l;return{group:e,hasZone:l,block:n,innerPad:s,titleTop:r,outerW:n.width+2*s,outerH:n.height+2*s+r}}),i=eKW(a.map(e=>({positions:e.block.positions,width:e.outerW,height:e.outerH,size:e.group.devices.length})),32),n=[];return i.placements.forEach((e,t)=>{let{offsetX:i,offsetY:s}=e,r=a[t],o=40+i,d=40+s;r.hasZone&&n.push({instanceId:`topology-workarea-${r.group.workareaId}`,canvasId:"main",x:Math.round(o),y:Math.round(d),width:Math.round(r.outerW),height:Math.round(r.outerH),elementKind:lL.FLOOR_MAP_SELECTION_ZONE_ELEMENT_KIND,name:r.group.name,zIndex:-50});let c=o+r.innerPad,u=d+r.innerPad+r.titleTop;for(let e of r.group.devices){let t=r.block.positions.get(String(e.id))??{x:0,y:0};n.push(eKG(e,c+t.x,u+t.y,l))}}),{sceneElements:n}}(t,l,o),a=eK0(l,t);return{config:{canvases:eK2(n),canvasUi:{canCreate:!1,canEdit:!1},elementKindCategories:s,elementKinds:r,sceneElements:e,edges:a},dataSources:d,addedDeviceIds:t.map(e=>String(e.id)),ghostInstanceIds:[],ghostDeviceIds:[],keptDeviceIds:[]}}let c=new Map,u=[];for(let e of a){var p;let t=null==(p=e.dataBinding)?void 0:p.recordId,l="string"==typeof t&&t.trim()?t:function(e){if(!e.startsWith(eKJ))return null;let t=e.slice(eKJ.length);return t.length>0?t:null}(e.instanceId);l?c.set(l,e):u.push(e)}let m=new Map(t.map(e=>[String(e.id),e])),g=[],h=[],v=[];for(let e of t){let t=String(e.id),l=c.get(t);l?(g.push({...l,elementKind:eKZ(e,o),name:eKB(e),dataBinding:{dataSourceKey:eKI,recordId:t}}),v.push(t)):h.push(e)}let f=[],y=[],x=[];for(let[e,t]of c)m.has(e)||(f.push(t),y.push(t.instanceId),x.push(e));let b=function(e,t,l,a,i){if(0===e.length)return[];let n=40,s=[...l,...a];for(let e of s){let t=(e.y??0)+(e.height??72);t>n&&(n=t)}s.length>0&&(n+=112);let{sceneElements:r}=function(e,t,l){if(0===e.length)return{sceneElements:[]};let{positions:a}=eKQ(e,t);return{sceneElements:e.map(e=>{let t=a.get(String(e.id))??{x:0,y:0};return eKG(e,40+t.x,40+t.y,l)})}}(e,t,i),o=n-40;return 0===o?r:r.map(e=>({...e,y:(e.y??0)+o}))}(h,l,[...g,...u],f,o),_=[...u,...g,...b,...f],k=new Map((i??[]).map(e=>[e.id,e])),w=eK0(l,t).map(e=>{let t=k.get(e.id);return(null==t?void 0:t.routing)?{...e,routing:t.routing}:e});return{config:{canvases:eK2(n),canvasUi:{canCreate:!1,canEdit:!1},elementKindCategories:s,elementKinds:r,sceneElements:_,edges:w},dataSources:d,addedDeviceIds:h.map(e=>String(e.id)),ghostInstanceIds:y,ghostDeviceIds:x,keptDeviceIds:v}}let eK4={isPisell2:!0},eK3={with:["type","model","workarea"],structure:["standalone","composite"]};async function eK8(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eK3,t=e.structure??eK3.structure??[],l={with:e.with??["type","model","workarea"],"structure[]":t,...null!=e.workarea_id?{workarea_id:e.workarea_id}:{},...e.type_kind?{type_kind:e.type_kind}:{},...null!=e.profile_id?{profile_id:e.profile_id}:{}},a={method:"GET",url:"/tenant/device",params:l},i=await z_.Em.getRequest().get(a.url,l,eK4);return{request:a,response:i}}let eK6={with:[],type:"dumb"};async function eK5(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:eK6,t={with:e.with??[],type:e.type??"dumb",...null!=e.source_device_id?{source_device_id:e.source_device_id}:{},...null!=e.target_device_id?{target_device_id:e.target_device_id}:{}},l={method:"GET",url:"/tenant/device/connection",params:t},a=await z_.Em.getRequest().get(l.url,t,eK4);return{request:l,response:a}}var eK7=JSON.parse('{"name":{"en":"Topology","ja":"トポロジ","pt":"Topologia","zh-CN":"设备拓扑","zh-HK":"設備拓撲"},"layout":{},"canvas_width":1920,"canvas_height":1080,"sort":0,"status":1}');let eK9="topologyRouter",eJe="topologySwitch",eJt="topologyAp",eJl=(0,lL.createShopFloorPlanClient)({http:{get:(e,t,l)=>z_.Em.getRequest().get(e,t??{},l??{}),post:(e,t,l)=>z_.Em.getRequest().post(e,t??{},l??{}),put:(e,t,l)=>z_.Em.getRequest().put(e,t??{},l??{})},useShopApi:!0,getSaveFailedMessage:()=>eKr("pisell-topology.floor-plan.save-failed",eKs(void 0))||"Failed to save topology floor plan"});eJl.getShopFloorPlanByCode.bind(eJl);let eJa=eJl.putShopFloorPlan.bind(eJl),eJi=eJl.unsubscribeShopFloorPlanCodeQuery.bind(eJl);function eJn(e){let t,l=null==e?void 0:e.trim();if(!l)throw Error("floor plan code is required");return{code:l,name:{...eK7.name},layout:(0,lL.viewConfigToLayoutPayload)({canvases:[{id:"main",name:"Actual Topology",order:0,enabled:!0,mapLayer:{showGrid:!1,backgroundColor:"#ffffff"}}],canvasUi:{canCreate:!0,canEdit:!0},elementKindCategories:[{id:"layout",label:"Layout",order:-1},{id:"network",label:"Network",order:0},{id:"pos",label:"POS",order:1},{id:"gate",label:"Gate",order:2},{id:"amusement",label:"Amusement",order:3}],elementKinds:(t={dataBindingPolicy:"optional",allowedDataSourceKeys:[eKI],showInPalette:!0},[{value:lL.FLOOR_MAP_SELECTION_ZONE_ELEMENT_KIND,label:"Area",categoryId:"layout",dataBindingPolicy:"none",showInPalette:!0},{value:eK9,label:"Router",categoryId:"network",...t},{value:eJe,label:"Switch",categoryId:"network",...t},{value:eJt,label:"AP",categoryId:"network",...t},{value:"topologyCashier",label:"Cashier",categoryId:"pos",...t},{value:"topologyGate",label:"Gate",categoryId:"gate",...t},{value:"topologyKiosk",label:"Kiosk",categoryId:"pos",...t},{value:"topologyIntegratedPos",label:"Integrated POS",categoryId:"pos",...t},{value:"topologyPrinter",label:"打印机",categoryId:"pos",...t},{value:"topologyAmusement",label:"Amusement",categoryId:"amusement",...t}]),sceneElements:[{instanceId:"gw-1",canvasId:"main",x:360,y:40,width:120,height:88,elementKind:eK9,name:"Gateway",dataBinding:{dataSourceKey:"devices",recordId:"gw-1"}},{instanceId:"sw-core",canvasId:"main",x:340,y:180,width:140,height:88,elementKind:eJe,name:"MainRack_CoreSW",dataBinding:{dataSourceKey:"devices",recordId:"sw-core"}},{instanceId:"sw-sub",canvasId:"main",x:160,y:320,width:120,height:88,elementKind:eJe,name:"SubRack_Switch",dataBinding:{dataSourceKey:"devices",recordId:"sw-sub"}},{instanceId:"ap-group",canvasId:"main",x:520,y:320,width:100,height:88,elementKind:eJt,name:"AP Group",dataBinding:{dataSourceKey:"devices",recordId:"ap-group"}}],edges:[{id:"e-gw-sw",sourceId:"gw-1",targetId:"sw-core",sourceAnchor:"bottom",targetAnchor:"top",sourceLabel:"WAN",targetLabel:"Gi48",status:"online"},{id:"e-sw-sub",sourceId:"sw-core",targetId:"sw-sub",sourceAnchor:"left",targetAnchor:"top",sourceLabel:"Gi1",targetLabel:"Te51",status:"online"},{id:"e-sw-ap",sourceId:"sw-core",targetId:"ap-group",sourceAnchor:"right",targetAnchor:"top",sourceLabel:"Gi2",targetLabel:"Po1",status:"online"}]}),canvas_width:eK7.canvas_width,canvas_height:eK7.canvas_height,...void 0!==eK7.sort?{sort:eK7.sort}:{},...void 0!==eK7.status?{status:eK7.status}:{}}}async function eJs(e,t){let{buildDefaultPostBody:l,...a}=t??{};return eJl.ensureShopFloorPlanByCode(e,{...a,buildDefaultPostBody:l??eJn})}async function eJr(e,t,l){let a=(0,lL.buildFloorPlanPutBody)(t,l);return(l.putFloorPlan??eJa)(e,a)}function eJo(e){(0,lL.PisellToast)({content:e instanceof Error?e.message:String(e)})}function eJd(e){(0,lL.PisellToast)({content:e instanceof Error?e.message:String(e)})}let eJc=`${eKE}unknown`;function eJu(e){let t=null==e?void 0:e.trim();if(!t)throw Error("floor plan code is required");return{code:t,name:{"zh-CN":"拓扑"},layout:{canvases:[{id:"main",name:"Devices",order:0,enabled:!0}],canvasUi:{canCreate:!1,canEdit:!1},sceneElements:[],edges:[]},canvas_width:1920,canvas_height:1080}}let eJp="pisell-topology",eJm={get:async()=>({data:[]}),post:async()=>({data:{}}),put:async()=>({data:{}}),remove:async()=>({data:{}}),custom:async()=>({data:{}})};function eJg(e){var t;let{className:l,style:a,devices:i,overviewHud:n,mode:s="read",floorPlanCode:r,floorPlanCanvasWidth:o,floorPlanCanvasHeight:d,floorPlanName:c,floorPlanSort:u,floorPlanStatus:p,putFloorPlan:m,onFloorPlanPersisted:g}=e,h=(null==r?void 0:r.trim())||"pisell_topology",v=ik(),f=eKs(v),{request:y,isWebPos:x}=(null==v||null==(t=v.appHelper)?void 0:t.utils)||{},b=eVR(x),_=(0,ef.useMemo)(()=>{try{var e,t,l;let a=null==v||null==(l=v.appHelper)||null==(t=l.utils)||null==(e=t.getApp)?void 0:e.call(t),i=null==a?void 0:a.storage;if(!(null==i?void 0:i.getStorage))return null;let n=i.getStorage("iotDevice");if(!n)return null;let s="string"==typeof n?JSON.parse(n):n,r=null==s?void 0:s.id;return null!=r&&""!==r?String(r):null}catch{return null}},[v]),k=eFF();(0,ef.useEffect)(()=>{eN.init({en:eKn.en??{},"zh-CN":eKn["zh-CN"]??eKn.zh??{},"zh-HK":eKn["zh-HK"]??eKn.tc??{}},f),eN.init(eFB,f),(0,lL.initFloorMapLayoutLocales)(f)},[f]),z_.Em.setRequest(y??eJm),(0,ef.useEffect)(()=>{y&&z_.Em.setRequest(y)},[y]);let[w,j]=(0,ef.useState)([]),[S,M]=(0,ef.useState)([]),[N,C]=(0,ef.useState)(()=>!!(i&&i.length>0));(0,ef.useEffect)(()=>{if(i&&i.length>0){M([]),C(!0);return}C(!1);let e=!1;return Promise.all([eK8(),eK5()]).then(t=>{let[l,a]=t;if(e)return;let i=function(e){if(Array.isArray(e))return e;if(e&&"object"==typeof e){let t=e.data;if(Array.isArray(t))return t}return[]}(l.response),n=function(e){if(Array.isArray(e))return e;if(e&&"object"==typeof e){let t=e.data;if(Array.isArray(t))return t}return[]}(a.response);j(i),M(n)}).catch(t=>{e||(console.error("[PisellTopology] 拉取设备 / 连接失败:",t),j([]),M([]))}).finally(()=>{e||C(!0)}),()=>{e=!0}},[i]);let T=(0,ef.useMemo)(()=>i&&0!==i.length?i.map((e,t)=>({id:e.id??`prop-${t}`,type_code:"unknown",name:e.name??null,model:e.model?{name:{original:e.model}}:null,number:e.sn??null,status:e.status??null})):[],[i]),P=T.length>0?T:w,A=function(e){let{rawDevices:t,translation:l}=e,[a,i]=(0,ef.useState)(!1),[n,s]=(0,ef.useState)(),r=(0,ef.useMemo)(()=>new Map(t.map(e=>[String(e.id),e])),[t]);return{open:a,record:n,openByItem:(0,ef.useCallback)(e=>{var t,a,n;let o=null==(a=e._sceneElement)||null==(t=a.dataBinding)?void 0:t.recordId;if(null==o||!Number.isFinite(Number(o)))return;let d=r.get(String(o));s((n=String(o),eBT({id:Number(n),type_kind:(null==d?void 0:d.type_kind)??"smart",type_code:(null==d?void 0:d.type_code)??"unknown",model_code:(null==d?void 0:d.model_code)??"",name:(null==d?void 0:d.name)??{original:`#${n}`},number:(null==d?void 0:d.number)??void 0,status:null==d?void 0:d.status,link:null==d?void 0:d.link,data:(null==d?void 0:d.data)??null,type:null==d?void 0:d.type,model:null==d?void 0:d.model},l))),i(!0)},[r,l]),close:(0,ef.useCallback)(()=>i(!1),[])}}({rawDevices:P,translation:k}),[D,I]=(0,ef.useState)(!1),[E,z]=(0,ef.useState)("focused"),L="edit"===s||D?"edit":"read",O="edit"===s,R=!i||0===i.length,{floorPlanRemoteId:$,savedSceneElements:F,savedEdges:B,isLoaded:H,applyLocalSave:q,setRemoteFloorPlanView:V}=function(e){let{floorPlanCode:t,enabled:l=!0,subscribeFloorPlanPush:a=!1}=e,[i,n]=(0,ef.useState)(null),[s,r]=(0,ef.useState)(void 0),[o,d]=(0,ef.useState)(void 0),c=(0,ef.useRef)((0,eH.LP)("topology-floor-plan-code")),u=(0,ef.useCallback)((e,t)=>eJs(e,{...t,buildDefaultPostBody:eJu}),[]),p=(0,ef.useCallback)(e=>{"number"==typeof e.id&&Number.isFinite(e.id)&&n(Math.trunc(e.id));let t=(0,lL.parseLayoutFieldToViewConfigPatch)(e.layout);if(t){r(t.sceneElements??[]),d(t.edges??[]);return}if(Array.isArray(e.layout)){r(e.layout.length>0?(0,lL.shopLayoutToSceneElements)(e.layout,{canvasId:"main",dataSourceKey:eKI,rectElementKind:eJc,circleElementKind:eJc}):[]),d([]);return}r([]),d([])},[]);return(0,ef.useEffect)(()=>{l||(n(null),r(void 0),d(void 0))},[l,t]),(0,ef.useEffect)(()=>{if(!l||!t||a)return;let e=!1;return u(t).then(t=>{!e&&t&&p(t)}).catch(t=>{e||eJd(t)}),()=>{e=!0}},[l,t,a,u,p]),(0,lL.useShopFloorPlanSubscription)({enabled:l&&!!t&&a,code:t,subscriberId:c.current,ensureByCode:u,unsubscribeQuery:eJi,onDetail:p,onLoadError:eJd}),{floorPlanRemoteId:i,savedSceneElements:s,savedEdges:o,isLoaded:void 0!==s,applyLocalSave:(0,ef.useCallback)(e=>{r(e.sceneElements),d(e.edges)},[]),setRemoteFloorPlanView:(0,ef.useCallback)(e=>{if(null==e){r(void 0),d(void 0);return}null!=e.sceneElements&&r(e.sceneElements),null!=e.edges&&d(e.edges)},[])}}({floorPlanCode:h,enabled:R,subscribeFloorPlanPush:b}),Y=N&&(!R||H),U=(0,ef.useMemo)(()=>Y?eK1({rawDevices:P,rawConnections:S,savedSceneElements:R?F:void 0,savedEdges:R?B:void 0,displayLocale:f}):null,[Y,P,S,R,F,B,f]),W=(0,ef.useMemo)(()=>{if(null==_)return null;let e=function(e,t,l){if(!e.some(e=>String(e.id)===l))return null;let a=eKH(e,t);for(let t of eKq(e,a))if(t.includes(l))return new Set(t);return new Set([l])}(P,S,_);return e?{rawDevices:P.filter(t=>e.has(String(t.id))),rawConnections:S.filter(t=>e.has(String(t.source_device_id))&&e.has(String(t.target_device_id)))}:null},[_,P,S]),G=null!=W&&"read"===L,Q=G&&"focused"===E?"focused":"all",K=(0,ef.useMemo)(()=>"focused"===Q&&W?eK1({rawDevices:W.rawDevices,rawConnections:W.rawConnections,savedSceneElements:void 0,savedEdges:void 0,displayLocale:f}):null,[Q,W,f]),J="focused"===Q?K:U,Z=(0,ef.useMemo)(()=>{let e="edit"===L,t=null==J?void 0:J.config;return t?{...t,canvasUi:{canCreate:e,canEdit:e}}:{canvases:[{id:"main",name:eKo(f),order:0,enabled:!0,mapLayer:{showGrid:!1,backgroundColor:"#ffffff"}}],canvasUi:{canCreate:e,canEdit:e},elementKinds:[],sceneElements:[],edges:[]}},[J,L,f]),X=(null==J?void 0:J.dataSources)??{devices:[]},ee=(0,ef.useRef)(null);(0,ef.useEffect)(()=>{var e;if(!R||!Y||!U||!H||null==$||0===P.length||((null==(e=U.config.sceneElements)?void 0:e.length)??0)===0||0===U.addedDeviceIds.length||"edit"===L)return;let t=Symbol("topology-autosave");ee.current=t;let l=U.config.sceneElements??[],a=U.config.edges??[];eJr($,U.config,{canvasWidth:o,canvasHeight:d,code:h,name:c,sort:u,status:p,putFloorPlan:null!=m?(e,t)=>m(e,t):void 0}).then(()=>{ee.current===t&&(q({sceneElements:l,edges:a}),null==g||g())}).catch(e=>{console.warn("[PisellTopology] auto-save floor-plan failed:",e)})},[R,Y,H,$,U,P.length,L,h,o,d,c,u,p,m,g,q]);let et=(0,ef.useMemo)(()=>new Map((X[eKI]??[]).map(e=>[e.id,e])),[X]),el=(0,ef.useMemo)(()=>(function(e,t){let l={};for(let a of(l[lL.FLOOR_MAP_SELECTION_ZONE_ELEMENT_KIND]=e=>{var t;return(0,ev.jsx)(lL.FloorMapSelectionZoneElement,{name:e.name??(null==(t=e._sceneElement)?void 0:t.name)})},e))l[a]=e=>{var l;let a=null==(l=e._sceneElement)?void 0:l.dataBinding,i=(null==a?void 0:a.recordId)!=null?t.get(String(a.recordId)):void 0;return(0,ev.jsx)(eKN,{item:e,device:i})};return l})(eK$,et),[et]),ea=(0,ef.useRef)(null),ei=(0,ef.useRef)(Q);(0,ef.useEffect)(()=>{if(ei.current===Q)return;ei.current=Q;let e=setTimeout(()=>{var e,t;null==(t=ea.current)||null==(e=t.fitBounds)||e.call(t)},60);return()=>clearTimeout(e)},[Q]);let en=(0,ef.useMemo)(()=>{let t=R&&null!=$&&Number.isFinite($)&&$>0;return(0,lL.wrapFloorMapOnSaveWithRemotePersist)({canPersist:t,persistTargetId:$??0,persist:(e,t)=>eJr(e,t,{canvasWidth:o,canvasHeight:d,code:h,name:c,sort:u,status:p,putFloorPlan:null!=m?(e,t)=>m(e,t):void 0}),setRemoteFloorPlanView:V,onFloorPlanPersisted:g,prevOnSave:e.onSave,onPersistError:eJo})},[R,$,o,d,h,c,u,p,m,V,g,e.onSave]),es=(0,ef.useCallback)(()=>{var e,t;if(0===P.length)return;let{config:l}=eK1({rawDevices:P,rawConnections:S,displayLocale:f}),a={...Z,...l,canvasUi:Z.canvasUi};null==(t=ea.current)||null==(e=t.applySceneSnapshot)||e.call(t,a)},[P,S,Z,f]);return(0,ev.jsxs)("div",{className:`${eJp}-root`,children:[(0,ev.jsx)("div",{className:`${eJp}-legend-anchor`,children:(0,ev.jsx)(eKD,{})}),(0,ev.jsx)(lL.PisellFloorMapLayout,{ref:ea,className:t_()(eJp,l),style:{width:"100%",height:"100%",minHeight:0,flex:1,...a},items:[],renderItem:()=>null,floorMapConfig:Z,dataSources:X,loading:!Y,mode:L,itemUnit:"pixel",enableEdges:!0,enableHover:!1,onItemClick:e=>{"read"===L&&A.openByItem(e)},toolbarShowSave:"edit"===L,onSave:en,renderItemByKind:el,floorMapViewportOverlay:!1!==n&&(!0===n||void 0===n?void 0:n),viewportOverlayPlacement:"top-start",controls:{showZoom:!0,showFitBounds:!0,showReset:!0,showGridToggle:!1,horizontalAlign:"end"},onExitEdit:O?void 0:()=>I(!1),viewportDockTrailing:(0,ev.jsxs)("div",{className:`${eJp}-dock-trailing`,children:[G?(0,ev.jsx)(eKT,{scope:Q,onChange:z}):null,(0,ev.jsx)(eKC,{mapEditInternal:D,setMapEditInternal:I,floorMapLayoutRef:ea,forceEditMode:O,onAutoArrange:R?es:void 0})]}),pan:{enabled:!0},zoom:{autoFitOnMount:!0,min:.25,max:2}}),A.record?(0,ev.jsx)(eBQ,{open:A.open,record:A.record,readonly:!0,getText:eN.getText,translation:k,onClose:A.close},A.record.id):null]})}let eJh=eJg,eJv=new class{initPeripheralsListener(e){var t,l;this.isInitialized||(this.isInitialized=!0,null==e||null==(l=e.utils)||null==(t=l.mountFunction)||t.call(l,"global","peripheralsResult",e=>{try{let t=JSON.parse(e||"{}"),l=this.listeners[0];l&&l.callback(t)}catch(e){console.error(e)}}))}addListener(e,t,l){let a=this.listeners.findIndex(e=>e.key===t);-1!==a&&this.listeners.splice(a,1),this.listeners.unshift({key:t,callback:l}),this.initPeripheralsListener(e)}removeListener(e){let t=this.listeners.findIndex(t=>t.key===e);-1!==t&&this.listeners.splice(t,1)}getActiveListener(){var e;return(null==(e=this.listeners[0])?void 0:e.key)||null}setActiveListener(e){let t=this.listeners.findIndex(t=>t.key===e);if(-1===t||0===t)return;let[l]=this.listeners.splice(t,1);this.listeners.unshift(l)}destroy(){this.listeners=[]}constructor(){(0,eD._)(this,"isInitialized",!1),(0,eD._)(this,"listeners",[]),this.listeners=[]}},eJf=()=>{var e,t;return null==(t=ik().appHelper)||null==(e=t.utils)?void 0:e.getApp},eJy=e=>{let[t,l]=(0,ef.useState)(null),a=()=>{l({visible:!1})};return{modalProps:t||{},visible:null==t?void 0:t.visible,open:t=>{l({key:e,...t||{},visible:!0,onCancel:()=>{var e;a(),null==t||null==(e=t.onCancel)||e.call(t)},onOk:e=>{var l;a(),null==t||null==(l=t.onOk)||l.call(t,e)}})},close:a}},eJx=()=>{var e,t;let l=ik(),a=(null==l||null==(t=l.appHelper)||null==(e=t.utils)?void 0:e.request)||{};return{get:(e,t,l)=>null==a?void 0:a.get(e,t,l),post:(e,t,l)=>null==a?void 0:a.post(e,t,l),put:(e,t,l)=>null==a?void 0:a.put(e,t,l),remove:(e,t,l)=>null==a?void 0:a.remove(e,t,l)}},eJb=()=>{var e,t;ik();let l=new URLSearchParams((null==(t=window)||null==(e=t.location)?void 0:e.search)||{}).get("goal_shop_id");return{goalShopId:l?Number(l):void 0,isNormalShop:!!l}},eJ_=()=>{var e,t,l,a,i,n,s,r,o,d,c,u,p;let m=ik(),g=(null==m||null==(e=m.appHelper)?void 0:e.utils)||{};return(null==g||null==(s=g.getStore)||null==(n=s.call(g))||null==(i=n.getState)||null==(a=i.call(n))||null==(l=a.global)||null==(t=l.shop)?void 0:t.id)||(null==g||null==(r=g.getData)?void 0:r.call(g,"shop_id"))||(null==(p=g.store)||null==(u=p.getState)||null==(c=u.call(p))||null==(d=c.global)||null==(o=d.globalConfig)?void 0:o.id)||void 0},eJk=()=>{let e=ij();return"h5"===e||"pc"===e},eJw={en:{"pisell2.text.ecocup.cup-id":"Cup ID","pisell2.text.ecocup.button.return":"Return","pisell2.text.ecocup.button.others":"others","pisell2.text.ecocup.button.missing":"Missing","pisell2.text.ecocup.button.broken":"Broken","pisell2.text.ecocup.button.clear-all":"Clear All","pisell2.text.ecocup.button.mark-as-return":"Return","pisell2.text.ecocup.button.mark-as-missing":"Mark as Missing","pisell2.text.ecocup.button.mark-as-broken":"Mark as Broken","pisell2.text.ecocup.button.cancel":"Cancel","pisell2.text.ecocup.button.confirm":"Confirm","pisell2.text.ecocup.button.remove":"Remove","pisell2.text.ecocup.button.dismiss":"Dismiss","pisell2.text.ecocup.button.transfer":"Transfer to my store","pisell2.text.ecocup.toast.success-return":"Returned success","pisell2.text.ecocup.toast.success-missing":"Mark as missing success","pisell2.text.ecocup.toast.success-broken":"Mark as broken success","pisell2.text.ecocup.toast.success-transfer":"Transferred success","pisell2.text.ecocup.toast.fail-no-match-customer":"No matching customer found","pisell2.text.cup-project.title":"ECO Cup Project","pisell2.text.cup-project.search-bar.placeholder":"mobile number or cup code","pisell2.text.cup-project.footer.button.new-customer":"New Customer","pisell2.text.cup-project.footer.button.customer-list":"Customer list","pisell2.text.cup-project.footer.button.cup-list":"Cup list","pisell2.text.cup-project.footer.button.setting":"Setting","pisell2.text.cup-project.footer.button.register-cups":"Register Cups to Inventory","pisell2.text.cup-project.search-bar.result.header.name":"Name","pisell2.text.cup-project.search-bar.result.header.registrationTime":"Registration Time","pisell2.text.cup-project.search-bar.result.header.phone":"Phone Number","pisell2.text.cup-project.search-bar.result.header.email":"Email address","pisell2.text.cup-project.search-bar.result.header.membership":"Membership","pisell2.text.ecocup.title":"Eco-Cup","pisell2.text.ecocup.status.placeholder":"Select Status","pisell2.text.ecocup.status.shop.placeholder":"Select Shop","pisell2.text.ecocup.scan-or-search":"mobile number or cup code","pisell2.text.ecocup.available-to-rent":"Stock Available to Rent Now","pisell2.text.ecocup.rent":"Rent","pisell2.text.ecocup.broken":"Broken","pisell2.text.ecocup.cup-rent":"Cup Rent (During Selected Period)","pisell2.text.ecocup.cup-returned":"Cup Returned (During Selected Period)","pisell2.text.ecocup.eco.cup-rent":"Cup Rent (all shops during selected period)","pisell2.text.ecocup.eco.cup-returned":"Cup Returned (all shops during selected period)","pisell2.text.ecocup.table.cup-code":"Cup Code","pisell2.text.ecocup.table.customer":"Customer","pisell2.text.ecocup.table.status":"Status","pisell2.text.ecocup.table.shop-of-rent":"Shop of Rent","pisell2.text.ecocup.table.time-of-rent":"Time of Rent","pisell2.text.ecocup.table.shop-of-return":"Shop of Return","pisell2.text.ecocup.table.time-of-return":"Time of Return","pisell2.text.ecocup.table.operated-at":"Operated at","pisell2.text.ecocup.table.actions":"actions","pisell2.text.ecocup.status.rent":"Rent","pisell2.text.ecocup.status.in-stock":"In stock","pisell2.text.ecocup.status.all":"All","pisell2.text.ecocup.status.shop-changed":"Shop changed","pisell2.text.ecocup.status.overtime":"Overtime","pisell2.text.ecocup.status.expire-soon":"Expire soon","pisell2.text.ecocup.status.borrowing":"borrowing","pisell2.text.ecocup.status.returned":"Returned","pisell2.text.ecocup.action.return":"Return","pisell2.text.ecocup.action.more":"more","pisell2.text.ecocup.action.more.missing":"Missing","pisell2.text.ecocup.action.more.broken":"Broken","pisell2.text.ecocup.table.time-of-rent.relative":e=>`${e} ${1===e?"day":"days"} ago`,"pisell2.text.ecocup.table.time-of-return.today":"Today","pisell2.text.ecocup.share.title":"Share","pisell2.text.ecocup.export.title":"Export","pisell2.text.ecocup.customer.list.title":"Customer List","pisell2.text.ecocup.customer.list.customer":"Cutomer","pisell2.text.ecocup.customer.list.registed":"Registed","pisell2.text.ecocup.customer.list.email":"Email","pisell2.text.ecocup.customer.list.mobile":"Mobile","pisell2.text.ecocup.customer.list.cup.borrowed":"Cup borrowed","pisell2.text.ecocup.customer.list.cup.returned":"Cup returned","pisell2.text.ecocup.customer.list.customer.profile":"Customer Profile","pisell2.text.ecocup.customer.list.search.placeholder":"mobile number","pisell2.text.ecocup.add-customer-modal.title":"Add Customer","pisell2.text.ecocup.add-customer-modal.first-name":"First Name","pisell2.text.ecocup.add-customer-modal.first-name-placeholder":"First Name","pisell2.text.ecocup.add-customer-modal.first-name-required":"First Name is required","pisell2.text.ecocup.add-customer-modal.last-name":"Last Name","pisell2.text.ecocup.add-customer-modal.last-name-placeholder":"Last Name","pisell2.text.ecocup.add-customer-modal.last-name-required":"Last Name is required","pisell2.text.ecocup.add-customer-modal.phone":"Phone","pisell2.text.ecocup.add-customer-modal.phone-placeholder":"Phone","pisell2.text.ecocup.add-customer-modal.phone-error":"Please enter a valid phone number","pisell2.text.ecocup.add-customer-modal.phone-required":"Phone is required","pisell2.text.ecocup.add-customer-modal.email":"Email","pisell2.text.ecocup.add-customer-modal.email-placeholder":"Email","pisell2.text.ecocup.add-customer-modal.email-required":"Email is required","pisell2.text.ecocup.add-customer-modal.membership":"Customer Group","pisell2.text.ecocup.add-customer-modal.success":"Customer added successfully","pisell2.text.ecocup.cup-action-modal.title-return":"Cup Return","pisell2.text.ecocup.cup-action-modal.title-missing":"Cup Missing","pisell2.text.ecocup.cup-action-modal.title-broken":"Cup Broken","pisell2.text.ecocup.cup-action-modal.cup-id":"Cup ID","pisell2.text.ecocup.cup-action-modal.cup-tip":"Rent at","pisell2.text.ecocup.cup-info-card.title.rentInfo":"Rent at","pisell2.text.ecocup.cup-info-card.title.markInfo":"Marked by","pisell2.text.ecocup.cup-info-card.title.belongInfo":"Belongs to","pisell2.text.ecocup.cup-info-card.title.otherBelongInfo":"This cup belongs to","pisell2.text.ecocup.cup-info-card.title.multiple-shop":"multiple shop detected","pisell2.text.ecocup.cup-info-card.title.multiple-time":"multiple time detected","pisell2.text.ecocup.cup-info-card.title.multiple-customer":"Multiple customers","pisell2.text.ecocup.customer-first-modal.title":"Rent/Return Cup(s)","pisell2.text.ecocup.customer-first-modal.search-tip":"Please scan/input the correct ECO Cup code.","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder":"mobile number or cup code","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder-cup":"cup code","pisell2.text.ecocup.customer-first-modal.over-max":"Please Remove {{num}} cup(s)","pisell2.text.ecocup.customer-first-modal.no-customer":"Please Log in customer","pisell2.text.ecocup.search-bar.search-tip":"Please scan/input the correct ECO Cup code.","pisell2.text.ecocup.cup-status-modal.title-other_rent":e=>`Cup Return ${e>1?`(${e} cups)`:""}`,"pisell2.text.ecocup.cup-status-modal.title-other_in_stock":"Cup not in your inventory","pisell2.text.ecocup.cup-status-modal.title-missing":"Cup Marked as Missing","pisell2.text.ecocup.cup-status-modal.title-broken":"Cup Marked as Broken","pisell2.text.ecocup.cup-status-modal.title-not_found":"Cup not in your inventory","pisell2.text.ecocup.cup-status-modal.tip":"Please add to inventory first before renting","pisell2.text.ecocup.cup-status-modal.tip-in-stock":"Please report to Eco-cup admin for further actions","pisell2.text.ecocup.setting.expire-time":"Expire Time","pisell2.text.ecocup.setting.expire-time-placeholder":"Expire Time","pisell2.text.ecocup.setting.expire-time-required":"Expire Time is required","pisell2.text.ecocup.setting.expire-time-max":"Expire Time must be less than 365 days","pisell2.text.ecocup.setting.expire-time-min":"Expire Time must be greater than 0","pisell2.text.ecocup.setting.max-rent-count-max":"Max Rent Count must be less than 9999","pisell2.text.ecocup.setting.max-rent-count-min":"Max Rent Count must be greater than 0","pisell2.text.ecocup.setting.days":"Days","pisell2.text.ecocup.setting.regular":"Regular","pisell2.text.ecocup.setting.regular-placeholder":"Regular","pisell2.text.ecocup.setting.regular-required":"Regular is required","pisell2.text.ecocup.setting.business":"Business","pisell2.text.ecocup.setting.business-placeholder":"Business","pisell2.text.ecocup.setting.business-required":"Business is required","pisell2.text.ecocup.setting.admin":"Admin","pisell2.text.ecocup.setting.admin-placeholder":"Admin","pisell2.text.ecocup.setting.admin-required":"Admin is required","pisell2.text.ecocup.setting.success":"Settings saved successfully","pisell2.text.ecocup.export.fail":"Export failed","pisell2.text.ecocup.export.success":"Export success","pisell2.text.ecocup.cup-status-modal.search-bar.title":"Scan multiple cups and return together","pisell2.text.ecocup.toast.success-copy-link":"Link copied to clipboard"},"zh-CN":{"pisell2.text.ecocup.cup-id":"Cup ID","pisell2.text.ecocup.button.return":"Return","pisell2.text.ecocup.button.others":"others","pisell2.text.ecocup.button.missing":"Missing","pisell2.text.ecocup.button.broken":"Broken","pisell2.text.ecocup.button.clear-all":"Clear All","pisell2.text.ecocup.button.mark-as-return":"Return","pisell2.text.ecocup.button.mark-as-missing":"Mark as Missing","pisell2.text.ecocup.button.mark-as-broken":"Mark as Broken","pisell2.text.ecocup.button.cancel":"Cancel","pisell2.text.ecocup.button.confirm":"Confirm","pisell2.text.ecocup.button.remove":"Remove","pisell2.text.ecocup.button.dismiss":"Dismiss","pisell2.text.ecocup.button.transfer":"Transfer to my store","pisell2.text.ecocup.toast.success-return":"Returned success","pisell2.text.ecocup.toast.success-missing":"Mark as missing success","pisell2.text.ecocup.toast.success-broken":"Mark as broken success","pisell2.text.ecocup.toast.success-transfer":"Transferred success","pisell2.text.ecocup.toast.fail-no-match-customer":"No matching customer found","pisell2.text.cup-project.title":"ECO Cup Project","pisell2.text.cup-project.search-bar.placeholder":"mobile number or cup code","pisell2.text.cup-project.footer.button.new-customer":"New Customer","pisell2.text.cup-project.footer.button.customer-list":"Customer list","pisell2.text.cup-project.footer.button.cup-list":"Cup list","pisell2.text.cup-project.footer.button.setting":"Setting","pisell2.text.cup-project.footer.button.register-cups":"Register Cups to Inventory","pisell2.text.cup-project.search-bar.result.header.name":"Name","pisell2.text.cup-project.search-bar.result.header.registrationTime":"Registration Time","pisell2.text.cup-project.search-bar.result.header.phone":"Phone Number","pisell2.text.cup-project.search-bar.result.header.email":"Email address","pisell2.text.cup-project.search-bar.result.header.membership":"Membership","pisell2.text.ecocup.title":"Eco-Cup","pisell2.text.ecocup.status.placeholder":"Select Status","pisell2.text.ecocup.status.shop.placeholder":"Select Shop","pisell2.text.ecocup.scan-or-search":"mobile number or cup code","pisell2.text.ecocup.available-to-rent":"Available to rent now","pisell2.text.ecocup.rent":"Rent","pisell2.text.ecocup.broken":"Broken","pisell2.text.ecocup.cup-rent":"Cup Rent (During Selected Period)","pisell2.text.ecocup.cup-returned":"Cup Returned (During Selected Period)","pisell2.text.ecocup.eco.cup-rent":"Cup Rent (all shops during selected period)","pisell2.text.ecocup.eco.cup-returned":"Cup Returned (all shops during selected period)","pisell2.text.ecocup.table.cup-code":"Cup Code","pisell2.text.ecocup.table.customer":"Customer","pisell2.text.ecocup.table.status":"Status","pisell2.text.ecocup.table.shop-of-rent":"Shop of Rent","pisell2.text.ecocup.table.time-of-rent":"Time of Rent","pisell2.text.ecocup.table.shop-of-return":"Shop of Return","pisell2.text.ecocup.table.time-of-return":"Time of Return","pisell2.text.ecocup.table.operated-at":"Operated at","pisell2.text.ecocup.table.actions":"actions","pisell2.text.ecocup.status.rent":"Rent","pisell2.text.ecocup.status.in-stock":"In stock","pisell2.text.ecocup.status.all":"All","pisell2.text.ecocup.status.shop-changed":"Shop changed","pisell2.text.ecocup.status.overtime":"Overtime","pisell2.text.ecocup.status.expire-soon":"Expire soon","pisell2.text.ecocup.status.borrowing":"borrowing","pisell2.text.ecocup.status.returned":"Returned","pisell2.text.ecocup.action.return":"Return","pisell2.text.ecocup.action.more":"more","pisell2.text.ecocup.action.more.missing":"Missing","pisell2.text.ecocup.action.more.broken":"Broken","pisell2.text.ecocup.table.time-of-rent.relative":e=>`${e} ${e>1?"days":"day"} ago`,"pisell2.text.ecocup.table.time-of-return.today":"Today","pisell2.text.ecocup.share.title":"Share","pisell2.text.ecocup.export.title":"Export","pisell2.text.ecocup.customer.list.title":"Customer List","pisell2.text.ecocup.customer.list.customer":"Cutomer","pisell2.text.ecocup.customer.list.registed":"Registed","pisell2.text.ecocup.customer.list.email":"Email","pisell2.text.ecocup.customer.list.mobile":"Mobile","pisell2.text.ecocup.customer.list.cup.borrowed":"Cup borrowed","pisell2.text.ecocup.customer.list.cup.returned":"Cup returned","pisell2.text.ecocup.customer.list.customer.profile":"Customer Profile","pisell2.text.ecocup.customer.list.search.placeholder":"mobile number","pisell2.text.ecocup.add-customer-modal.title":"Add Customer","pisell2.text.ecocup.add-customer-modal.first-name":"First Name","pisell2.text.ecocup.add-customer-modal.first-name-placeholder":"First Name","pisell2.text.ecocup.add-customer-modal.first-name-required":"First Name is required","pisell2.text.ecocup.add-customer-modal.last-name":"Last Name","pisell2.text.ecocup.add-customer-modal.last-name-placeholder":"Last Name","pisell2.text.ecocup.add-customer-modal.last-name-required":"Last Name is required","pisell2.text.ecocup.add-customer-modal.phone":"Phone","pisell2.text.ecocup.add-customer-modal.phone-placeholder":"Phone","pisell2.text.ecocup.add-customer-modal.phone-required":"Phone is required","pisell2.text.ecocup.add-customer-modal.phone-error":"Please enter a valid phone number","pisell2.text.ecocup.add-customer-modal.email":"Email","pisell2.text.ecocup.add-customer-modal.email-placeholder":"Email","pisell2.text.ecocup.add-customer-modal.email-required":"Email is required","pisell2.text.ecocup.add-customer-modal.membership":"Customer Group","pisell2.text.ecocup.add-customer-modal.success":"Customer added successfully","pisell2.text.ecocup.cup-action-modal.title-return":"Cup Return","pisell2.text.ecocup.cup-action-modal.title-missing":"Cup Missing","pisell2.text.ecocup.cup-action-modal.title-broken":"Cup Broken","pisell2.text.ecocup.cup-action-modal.cup-id":"Cup ID","pisell2.text.ecocup.cup-action-modal.cup-tip":"Rent at","pisell2.text.ecocup.cup-info-card.title.rentInfo":"Rent at","pisell2.text.ecocup.cup-info-card.title.markInfo":"Marked by","pisell2.text.ecocup.cup-info-card.title.belongInfo":"Belongs to","pisell2.text.ecocup.cup-info-card.title.otherBelongInfo":"This cup belongs to","pisell2.text.ecocup.cup-info-card.title.multiple-shop":"multiple shop detected","pisell2.text.ecocup.cup-info-card.title.multiple-time":"multiple time detected","pisell2.text.ecocup.cup-info-card.title.multiple-customer":"Multiple customers","pisell2.text.ecocup.customer-first-modal.title":"Rent/Return Cup(s)","pisell2.text.ecocup.customer-first-modal.search-tip":"Please scan/input the correct ECO Cup code.","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder":"mobile number or cup code","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder-cup":"cup code","pisell2.text.ecocup.customer-first-modal.over-max":"Please Remove {{num}} cup(s)","pisell2.text.ecocup.customer-first-modal.no-customer":"Please Log in customer","pisell2.text.ecocup.search-bar.search-tip":"Please scan/input the correct ECO Cup code.","pisell2.text.ecocup.cup-status-modal.title-other_rent":e=>`Cup Return ${e>1?`(${e} cups)`:""}`,"pisell2.text.ecocup.cup-status-modal.title-other_in_stock":"Cup not in your inventory","pisell2.text.ecocup.cup-status-modal.title-missing":"Cup Marked as Missing","pisell2.text.ecocup.cup-status-modal.title-broken":"Cup Marked as Broken","pisell2.text.ecocup.cup-status-modal.title-not_found":"Cup not in your inventory","pisell2.text.ecocup.cup-status-modal.tip":"Please add to inventory first before renting","pisell2.text.ecocup.cup-status-modal.tip-in-stock":"Please report to Eco-cup admin for further actions","pisell2.text.ecocup.setting.expire-time":"Expire Time","pisell2.text.ecocup.setting.expire-time-placeholder":"Expire Time","pisell2.text.ecocup.setting.expire-time-required":"Expire Time is required","pisell2.text.ecocup.setting.expire-time-max":"Expire Time must be less than 365 days","pisell2.text.ecocup.setting.expire-time-min":"Expire Time must be greater than 0","pisell2.text.ecocup.setting.max-rent-count-max":"Max Rent Count must be less than 9999","pisell2.text.ecocup.setting.max-rent-count-min":"Max Rent Count must be greater than 0","pisell2.text.ecocup.setting.days":"Days","pisell2.text.ecocup.setting.regular":"Regular","pisell2.text.ecocup.setting.regular-placeholder":"Regular","pisell2.text.ecocup.setting.regular-required":"Regular is required","pisell2.text.ecocup.setting.business":"Business","pisell2.text.ecocup.setting.business-placeholder":"Business","pisell2.text.ecocup.setting.business-required":"Business is required","pisell2.text.ecocup.setting.admin":"Admin","pisell2.text.ecocup.setting.admin-placeholder":"Admin","pisell2.text.ecocup.setting.admin-required":"Admin is required","pisell2.text.ecocup.setting.success":"Settings saved successfully","pisell2.text.ecocup.export.fail":"Export failed","pisell2.text.ecocup.export.success":"Export success","pisell2.text.ecocup.cup-status-modal.search-bar.title":"Scan multiple cups and return together","pisell2.text.ecocup.toast.success-copy-link":"Link copied to clipboard"},"zh-HK":{"pisell2.text.ecocup.cup-id":"Cup ID","pisell2.text.ecocup.button.return":"Return","pisell2.text.ecocup.button.others":"others","pisell2.text.ecocup.button.missing":"Missing","pisell2.text.ecocup.button.broken":"Broken","pisell2.text.ecocup.button.clear-all":"Clear All","pisell2.text.ecocup.button.mark-as-return":"Return","pisell2.text.ecocup.button.mark-as-missing":"Mark as Missing","pisell2.text.ecocup.button.mark-as-broken":"Mark as Broken","pisell2.text.ecocup.button.cancel":"Cancel","pisell2.text.ecocup.button.confirm":"Confirm","pisell2.text.ecocup.button.remove":"Remove","pisell2.text.ecocup.button.dismiss":"Dismiss","pisell2.text.ecocup.button.transfer":"Transfer to my store","pisell2.text.ecocup.toast.success-return":"Returned success","pisell2.text.ecocup.toast.success-missing":"Mark as missing success","pisell2.text.ecocup.toast.success-broken":"Mark as broken success","pisell2.text.ecocup.toast.success-transfer":"Transferred success","pisell2.text.ecocup.toast.fail-no-match-customer":"No matching customer found","pisell2.text.cup-project.title":"ECO Cup Project","pisell2.text.cup-project.search-bar.placeholder":"mobile number or cup code","pisell2.text.cup-project.footer.button.new-customer":"New Customer","pisell2.text.cup-project.footer.button.customer-list":"Customer list","pisell2.text.cup-project.footer.button.cup-list":"Cup list","pisell2.text.cup-project.footer.button.setting":"Setting","pisell2.text.cup-project.footer.button.register-cups":"Register Cups to Inventory","pisell2.text.cup-project.search-bar.result.header.name":"Name","pisell2.text.cup-project.search-bar.result.header.registrationTime":"Registration Time","pisell2.text.cup-project.search-bar.result.header.phone":"Phone Number","pisell2.text.cup-project.search-bar.result.header.email":"Email address","pisell2.text.cup-project.search-bar.result.header.membership":"Membership","pisell2.text.ecocup.title":"Eco-Cup","pisell2.text.ecocup.status.placeholder":"Select Status","pisell2.text.ecocup.status.shop.placeholder":"Select Shop","pisell2.text.ecocup.scan-or-search":"mobile number or cup code","pisell2.text.ecocup.available-to-rent":"Available to rent now","pisell2.text.ecocup.rent":"Rent","pisell2.text.ecocup.broken":"Broken","pisell2.text.ecocup.cup-rent":"Cup Rent (During Selected Period)","pisell2.text.ecocup.cup-returned":"Cup Returned (During Selected Period)","pisell2.text.ecocup.eco.cup-rent":"Cup Rent (all shops during selected period)","pisell2.text.ecocup.eco.cup-returned":"Cup Returned (all shops during selected period)","pisell2.text.ecocup.table.cup-code":"Cup Code","pisell2.text.ecocup.table.customer":"Customer","pisell2.text.ecocup.table.status":"Status","pisell2.text.ecocup.table.shop-of-rent":"Shop of Rent","pisell2.text.ecocup.table.time-of-rent":"Time of Rent","pisell2.text.ecocup.table.shop-of-return":"Shop of Return","pisell2.text.ecocup.table.time-of-return":"Time of Return","pisell2.text.ecocup.table.operated-at":"Operated at","pisell2.text.ecocup.table.actions":"actions","pisell2.text.ecocup.status.rent":"Rent","pisell2.text.ecocup.status.in-stock":"In stock","pisell2.text.ecocup.status.all":"All","pisell2.text.ecocup.status.shop-changed":"Shop changed","pisell2.text.ecocup.status.overtime":"Overtime","pisell2.text.ecocup.status.expire-soon":"Expire soon","pisell2.text.ecocup.status.borrowing":"borrowing","pisell2.text.ecocup.status.returned":"Returned","pisell2.text.ecocup.action.return":"Return","pisell2.text.ecocup.action.more":"more","pisell2.text.ecocup.action.more.missing":"Missing","pisell2.text.ecocup.action.more.broken":"Broken","pisell2.text.ecocup.table.time-of-rent.relative":e=>`${e} ${1===e?"day":"days"} ago`,"pisell2.text.ecocup.table.time-of-return.today":"Today","pisell2.text.ecocup.share.title":"Share","pisell2.text.ecocup.export.title":"Export","pisell2.text.ecocup.customer.list.title":"Customer List","pisell2.text.ecocup.customer.list.customer":"Cutomer","pisell2.text.ecocup.customer.list.registed":"Registed","pisell2.text.ecocup.customer.list.email":"Email","pisell2.text.ecocup.customer.list.mobile":"Mobile","pisell2.text.ecocup.customer.list.cup.borrowed":"Cup borrowed","pisell2.text.ecocup.customer.list.cup.returned":"Cup returned","pisell2.text.ecocup.customer.list.customer.profile":"Customer Profile","pisell2.text.ecocup.customer.list.search.placeholder":"mobile number","pisell2.text.ecocup.add-customer-modal.title":"Add Customer","pisell2.text.ecocup.add-customer-modal.first-name":"First Name","pisell2.text.ecocup.add-customer-modal.first-name-placeholder":"First Name","pisell2.text.ecocup.add-customer-modal.first-name-required":"First Name is required","pisell2.text.ecocup.add-customer-modal.last-name":"Last Name","pisell2.text.ecocup.add-customer-modal.last-name-placeholder":"Last Name","pisell2.text.ecocup.add-customer-modal.last-name-required":"Last Name is required","pisell2.text.ecocup.add-customer-modal.phone":"Phone","pisell2.text.ecocup.add-customer-modal.phone-placeholder":"Phone","pisell2.text.ecocup.add-customer-modal.phone-required":"Phone is required","pisell2.text.ecocup.add-customer-modal.phone-error":"Please enter a valid phone number","pisell2.text.ecocup.add-customer-modal.email":"Email","pisell2.text.ecocup.add-customer-modal.email-placeholder":"Email","pisell2.text.ecocup.add-customer-modal.email-required":"Email is required","pisell2.text.ecocup.add-customer-modal.membership":"Customer Group","pisell2.text.ecocup.add-customer-modal.success":"Customer added successfully","pisell2.text.ecocup.cup-action-modal.title-return":"Cup Return","pisell2.text.ecocup.cup-action-modal.title-missing":"Cup Missing","pisell2.text.ecocup.cup-action-modal.title-broken":"Cup Broken","pisell2.text.ecocup.cup-action-modal.cup-id":"Cup ID","pisell2.text.ecocup.cup-action-modal.cup-tip":"Rent at","pisell2.text.ecocup.cup-info-card.title.rentInfo":"Rent at","pisell2.text.ecocup.cup-info-card.title.markInfo":"Marked by","pisell2.text.ecocup.cup-info-card.title.belongInfo":"Belongs to","pisell2.text.ecocup.cup-info-card.title.otherBelongInfo":"This cup belongs to","pisell2.text.ecocup.cup-info-card.title.multiple-shop":"multiple shop detected","pisell2.text.ecocup.cup-info-card.title.multiple-time":"multiple time detected","pisell2.text.ecocup.cup-info-card.title.multiple-customer":"Multiple customers","pisell2.text.ecocup.customer-first-modal.title":"Rent/Return Cup(s)","pisell2.text.ecocup.customer-first-modal.search-tip":"Please scan/input the correct ECO Cup code.","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder":"mobile number or cup code","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder-cup":"cup code","pisell2.text.ecocup.customer-first-modal.over-max":"Please Remove {{num}} cup(s)","pisell2.text.ecocup.customer-first-modal.no-customer":"Please Log in customer","pisell2.text.ecocup.search-bar.search-tip":"Please scan/input the correct ECO Cup code.","pisell2.text.ecocup.cup-status-modal.title-other_rent":e=>`Cup Return ${e>1?`(${e} cups)`:""}`,"pisell2.text.ecocup.cup-status-modal.title-other_in_stock":"Cup not in your inventory","pisell2.text.ecocup.cup-status-modal.title-missing":"Cup Marked as Missing","pisell2.text.ecocup.cup-status-modal.title-broken":"Cup Marked as Broken","pisell2.text.ecocup.cup-status-modal.title-not_found":"Cup not in your inventory","pisell2.text.ecocup.cup-status-modal.tip":"Please add to inventory first before renting","pisell2.text.ecocup.cup-status-modal.tip-in-stock":"Please report to Eco-cup admin for further actions","pisell2.text.ecocup.setting.expire-time":"Expire Time","pisell2.text.ecocup.setting.expire-time-placeholder":"Expire Time","pisell2.text.ecocup.setting.expire-time-required":"Expire Time is required","pisell2.text.ecocup.setting.expire-time-max":"Expire Time must be less than 365 days","pisell2.text.ecocup.setting.expire-time-min":"Expire Time must be greater than 0","pisell2.text.ecocup.setting.max-rent-count-max":"Max Rent Count must be less than 9999","pisell2.text.ecocup.setting.max-rent-count-min":"Max Rent Count must be greater than 0","pisell2.text.ecocup.setting.days":"Days","pisell2.text.ecocup.setting.regular":"Regular","pisell2.text.ecocup.setting.regular-placeholder":"Regular","pisell2.text.ecocup.setting.regular-required":"Regular is required","pisell2.text.ecocup.setting.business":"Business","pisell2.text.ecocup.setting.business-placeholder":"Business","pisell2.text.ecocup.setting.business-required":"Business is required","pisell2.text.ecocup.setting.admin":"Admin","pisell2.text.ecocup.setting.admin-placeholder":"Admin","pisell2.text.ecocup.setting.admin-required":"Admin is required","pisell2.text.ecocup.setting.success":"Settings saved successfully","pisell2.text.ecocup.export.fail":"Export failed","pisell2.text.ecocup.export.success":"Export success","pisell2.text.ecocup.cup-status-modal.search-bar.title":"Scan multiple cups and return together","pisell2.text.ecocup.toast.success-copy-link":"Link copied to clipboard"},ja:{"pisell2.text.ecocup.cup-id":"カップID","pisell2.text.ecocup.button.return":"返却","pisell2.text.ecocup.button.others":"その他","pisell2.text.ecocup.button.missing":"紛失","pisell2.text.ecocup.button.broken":"破損","pisell2.text.ecocup.button.clear-all":"すべてクリア","pisell2.text.ecocup.button.mark-as-return":"返却済みとしてマーク","pisell2.text.ecocup.button.mark-as-missing":"紛失としてマーク","pisell2.text.ecocup.button.mark-as-broken":"破損としてマーク","pisell2.text.ecocup.button.cancel":"キャンセル","pisell2.text.ecocup.button.confirm":"確認","pisell2.text.ecocup.button.remove":"削除","pisell2.text.ecocup.button.dismiss":"閉じる","pisell2.text.ecocup.button.transfer":"自分の店舗に転送","pisell2.text.ecocup.toast.success-return":"返却成功","pisell2.text.ecocup.toast.success-missing":"紛失としてマーク成功","pisell2.text.ecocup.toast.success-broken":"破損としてマーク成功","pisell2.text.ecocup.toast.success-transfer":"転送成功","pisell2.text.ecocup.toast.fail-no-match-customer":"一致する顧客が見つかりませんでした","pisell2.text.cup-project.title":"ECOカッププロジェクト","pisell2.text.cup-project.search-bar.placeholder":"携帯電話番号またはカップコード","pisell2.text.cup-project.footer.button.new-customer":"新規顧客","pisell2.text.cup-project.footer.button.customer-list":"顧客リスト","pisell2.text.cup-project.footer.button.cup-list":"カップリスト","pisell2.text.cup-project.footer.button.register-cups":"在庫にカップを登録","pisell2.text.cup-project.search-bar.result.header.name":"名前","pisell2.text.cup-project.search-bar.result.header.registrationTime":"登録時間","pisell2.text.cup-project.search-bar.result.header.phone":"電話番号","pisell2.text.cup-project.search-bar.result.header.email":"メールアドレス","pisell2.text.cup-project.search-bar.result.header.membership":"会員","pisell2.text.ecocup.title":"エコカップ","pisell2.text.ecocup.status.placeholder":"ステータスを選択","pisell2.text.ecocup.status.shop.placeholder":"店舗を選択","pisell2.text.ecocup.scan-or-search":"携帯電話番号またはカップコード","pisell2.text.ecocup.available-to-rent":"現在レンタル可能","pisell2.text.ecocup.rent":"レンタル","pisell2.text.ecocup.broken":"破損","pisell2.text.ecocup.cup-rent":"カップレンタル","pisell2.text.ecocup.cup-returned":"カップ返却","pisell2.text.ecocup.eco.cup-rent":"全店舗によるカップレンタル","pisell2.text.ecocup.eco.cup-returned":"全店舗によるカップ返却","pisell2.text.ecocup.table.cup-code":"カップコード","pisell2.text.ecocup.table.customer":"顧客","pisell2.text.ecocup.table.status":"ステータス","pisell2.text.ecocup.table.shop-of-rent":"レンタル店舗","pisell2.text.ecocup.table.time-of-rent":"レンタル時間","pisell2.text.ecocup.table.shop-of-return":"返却店舗","pisell2.text.ecocup.table.time-of-return":"返却時間","pisell2.text.ecocup.table.operated-at":"操作時間","pisell2.text.ecocup.table.actions":"操作","pisell2.text.ecocup.status.rent":"レンタル","pisell2.text.ecocup.status.in-stock":"在庫あり","pisell2.text.ecocup.status.all":"すべて","pisell2.text.ecocup.status.shop-changed":"店舗変更","pisell2.text.ecocup.status.overtime":"時間超過","pisell2.text.ecocup.status.expire-soon":"まもなく期限切れ","pisell2.text.ecocup.status.borrowing":"借用中","pisell2.text.ecocup.status.returned":"返却済み","pisell2.text.ecocup.action.return":"返却","pisell2.text.ecocup.action.more":"その他","pisell2.text.ecocup.action.more.missing":"紛失","pisell2.text.ecocup.action.more.broken":"破損","pisell2.text.ecocup.table.time-of-rent.relative":e=>`${e}日前`,"pisell2.text.ecocup.table.time-of-return.today":"今日","pisell2.text.ecocup.customer.list.title":"顧客リスト","pisell2.text.ecocup.customer.list.customer":"顧客","pisell2.text.ecocup.customer.list.registed":"登録済み","pisell2.text.ecocup.customer.list.email":"メール","pisell2.text.ecocup.customer.list.mobile":"携帯電話","pisell2.text.ecocup.customer.list.cup.borrowed":"借用カップ","pisell2.text.ecocup.customer.list.cup.returned":"返却カップ","pisell2.text.ecocup.customer.list.customer.profile":"顧客プロフィール","pisell2.text.ecocup.customer.list.search.placeholder":"携帯電話番号","pisell2.text.ecocup.add-customer-modal.title":"顧客を追加","pisell2.text.ecocup.add-customer-modal.first-name":"名","pisell2.text.ecocup.add-customer-modal.first-name-placeholder":"名","pisell2.text.ecocup.add-customer-modal.first-name-required":"名は必須です","pisell2.text.ecocup.add-customer-modal.last-name":"姓","pisell2.text.ecocup.add-customer-modal.last-name-placeholder":"姓","pisell2.text.ecocup.add-customer-modal.last-name-required":"姓は必須です","pisell2.text.ecocup.add-customer-modal.phone":"電話","pisell2.text.ecocup.add-customer-modal.phone-placeholder":"電話","pisell2.text.ecocup.add-customer-modal.phone-error":"有効な電話番号を入力してください","pisell2.text.ecocup.add-customer-modal.phone-required":"電話は必須です","pisell2.text.ecocup.add-customer-modal.email":"メール","pisell2.text.ecocup.add-customer-modal.email-placeholder":"メール","pisell2.text.ecocup.add-customer-modal.email-required":"メールは必須です","pisell2.text.ecocup.add-customer-modal.membership":"顧客グループ","pisell2.text.ecocup.add-customer-modal.success":"顧客の追加に成功しました","pisell2.text.ecocup.cup-action-modal.title-return":"カップ返却","pisell2.text.ecocup.cup-action-modal.title-missing":"カップ紛失","pisell2.text.ecocup.cup-action-modal.title-broken":"カップ破損","pisell2.text.ecocup.cup-action-modal.cup-id":"カップID","pisell2.text.ecocup.cup-action-modal.cup-tip":"レンタル時間","pisell2.text.ecocup.cup-info-card.title.rentInfo":"レンタル時間","pisell2.text.ecocup.cup-info-card.title.markInfo":"マーク者","pisell2.text.ecocup.cup-info-card.title.belongInfo":"所属","pisell2.text.ecocup.customer-first-modal.title":"カップをレンタル/返却","pisell2.text.ecocup.customer-first-modal.search-tip":"正しいECOカップコードをスキャン/入力してください。","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder":"携帯電話番号またはカップコード","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder-cup":"カップコード","pisell2.text.ecocup.customer-first-modal.over-max":"{{num}}個のカップを削除してください","pisell2.text.ecocup.customer-first-modal.no-customer":"顧客にログインしてください","pisell2.text.ecocup.search-bar.search-tip":"正しいECOカップコードをスキャン/入力してください。","pisell2.text.ecocup.cup-status-modal.title-other_rent":"警告:このカップは他の人が借用しています","pisell2.text.ecocup.cup-status-modal.title-other_in_stock":"このカップは別の店舗に登録されています","pisell2.text.ecocup.cup-status-modal.title-missing":"カップが紛失としてマークされました","pisell2.text.ecocup.cup-status-modal.title-broken":"カップが破損としてマークされました","pisell2.text.ecocup.cup-status-modal.title-not_found":"カップが在庫にありません","pisell2.text.ecocup.cup-status-modal.tip":"レンタルする前にまず在庫に追加してください"},pt:{"pisell2.text.ecocup.cup-id":"ID do Copo","pisell2.text.ecocup.button.return":"Devolver","pisell2.text.ecocup.button.others":"outros","pisell2.text.ecocup.button.missing":"Perdido","pisell2.text.ecocup.button.broken":"Quebrado","pisell2.text.ecocup.button.clear-all":"Limpar Tudo","pisell2.text.ecocup.button.mark-as-return":"Marcar como Devolvido","pisell2.text.ecocup.button.mark-as-missing":"Marcar como Perdido","pisell2.text.ecocup.button.mark-as-broken":"Marcar como Quebrado","pisell2.text.ecocup.button.cancel":"Cancelar","pisell2.text.ecocup.button.confirm":"Confirmar","pisell2.text.ecocup.button.remove":"Remover","pisell2.text.ecocup.button.dismiss":"Dispensar","pisell2.text.ecocup.button.transfer":"Transferir para minha loja","pisell2.text.ecocup.toast.success-return":"Devolu\xe7\xe3o bem-sucedida","pisell2.text.ecocup.toast.success-missing":"Marcado como perdido com sucesso","pisell2.text.ecocup.toast.success-broken":"Marcado como quebrado com sucesso","pisell2.text.ecocup.toast.success-transfer":"Transfer\xeancia bem-sucedida","pisell2.text.ecocup.toast.fail-no-match-customer":"Nenhum cliente correspondente encontrado","pisell2.text.cup-project.title":"Projeto ECO Cup","pisell2.text.cup-project.search-bar.placeholder":"n\xfamero de celular ou c\xf3digo do copo","pisell2.text.cup-project.footer.button.new-customer":"Novo Cliente","pisell2.text.cup-project.footer.button.customer-list":"Lista de clientes","pisell2.text.cup-project.footer.button.cup-list":"Lista de copos","pisell2.text.cup-project.footer.button.register-cups":"Registrar Copos no Invent\xe1rio","pisell2.text.cup-project.search-bar.result.header.name":"Nome","pisell2.text.cup-project.search-bar.result.header.registrationTime":"Hora de Registro","pisell2.text.cup-project.search-bar.result.header.phone":"N\xfamero de Telefone","pisell2.text.cup-project.search-bar.result.header.email":"Endere\xe7o de E-mail","pisell2.text.cup-project.search-bar.result.header.membership":"Associa\xe7\xe3o","pisell2.text.ecocup.title":"Eco-Cup","pisell2.text.ecocup.status.placeholder":"Selecionar Status","pisell2.text.ecocup.status.shop.placeholder":"Selecionar Loja","pisell2.text.ecocup.scan-or-search":"n\xfamero de celular ou c\xf3digo do copo","pisell2.text.ecocup.available-to-rent":"Dispon\xedvel para alugar agora","pisell2.text.ecocup.rent":"Alugar","pisell2.text.ecocup.broken":"Quebrado","pisell2.text.ecocup.cup-rent":"Aluguel de Copo","pisell2.text.ecocup.cup-returned":"Copo Devolvido","pisell2.text.ecocup.eco.cup-rent":"Aluguel de Copo por todas as lojas","pisell2.text.ecocup.eco.cup-returned":"Copo Devolvido por todas as lojas","pisell2.text.ecocup.table.cup-code":"C\xf3digo do Copo","pisell2.text.ecocup.table.customer":"Cliente","pisell2.text.ecocup.table.status":"Status","pisell2.text.ecocup.table.shop-of-rent":"Loja de Aluguel","pisell2.text.ecocup.table.time-of-rent":"Hora de Aluguel","pisell2.text.ecocup.table.shop-of-return":"Loja de Devolu\xe7\xe3o","pisell2.text.ecocup.table.time-of-return":"Hora de Devolu\xe7\xe3o","pisell2.text.ecocup.table.operated-at":"Operado em","pisell2.text.ecocup.table.actions":"a\xe7\xf5es","pisell2.text.ecocup.status.rent":"Alugar","pisell2.text.ecocup.status.in-stock":"Em estoque","pisell2.text.ecocup.status.all":"Todos","pisell2.text.ecocup.status.shop-changed":"Loja alterada","pisell2.text.ecocup.status.overtime":"Tempo esgotado","pisell2.text.ecocup.status.expire-soon":"Expira em breve","pisell2.text.ecocup.status.borrowing":"emprestando","pisell2.text.ecocup.status.returned":"Devolvido","pisell2.text.ecocup.action.return":"Devolver","pisell2.text.ecocup.action.more":"mais","pisell2.text.ecocup.action.more.missing":"Perdido","pisell2.text.ecocup.action.more.broken":"Quebrado","pisell2.text.ecocup.table.time-of-rent.relative":e=>`${e} ${1===e?"dia":"dias"} atr\xe1s`,"pisell2.text.ecocup.table.time-of-return.today":"Hoje","pisell2.text.ecocup.customer.list.title":"Lista de Clientes","pisell2.text.ecocup.customer.list.customer":"Cliente","pisell2.text.ecocup.customer.list.registed":"Registrado","pisell2.text.ecocup.customer.list.email":"E-mail","pisell2.text.ecocup.customer.list.mobile":"Celular","pisell2.text.ecocup.customer.list.cup.borrowed":"Copo emprestado","pisell2.text.ecocup.customer.list.cup.returned":"Copo devolvido","pisell2.text.ecocup.customer.list.customer.profile":"Perfil do Cliente","pisell2.text.ecocup.customer.list.search.placeholder":"n\xfamero de celular","pisell2.text.ecocup.add-customer-modal.title":"Adicionar Cliente","pisell2.text.ecocup.add-customer-modal.first-name":"Primeiro Nome","pisell2.text.ecocup.add-customer-modal.first-name-placeholder":"Primeiro Nome","pisell2.text.ecocup.add-customer-modal.first-name-required":"Primeiro Nome \xe9 obrigat\xf3rio","pisell2.text.ecocup.add-customer-modal.last-name":"Sobrenome","pisell2.text.ecocup.add-customer-modal.last-name-placeholder":"Sobrenome","pisell2.text.ecocup.add-customer-modal.last-name-required":"Sobrenome \xe9 obrigat\xf3rio","pisell2.text.ecocup.add-customer-modal.phone":"Telefone","pisell2.text.ecocup.add-customer-modal.phone-placeholder":"Telefone","pisell2.text.ecocup.add-customer-modal.phone-error":"Por favor, insira um n\xfamero de telefone v\xe1lido","pisell2.text.ecocup.add-customer-modal.phone-required":"Telefone \xe9 obrigat\xf3rio","pisell2.text.ecocup.add-customer-modal.email":"E-mail","pisell2.text.ecocup.add-customer-modal.email-placeholder":"E-mail","pisell2.text.ecocup.add-customer-modal.email-required":"E-mail \xe9 obrigat\xf3rio","pisell2.text.ecocup.add-customer-modal.membership":"Grupo de Clientes","pisell2.text.ecocup.add-customer-modal.success":"Cliente adicionado com sucesso","pisell2.text.ecocup.cup-action-modal.title-return":"Devolu\xe7\xe3o do Copo","pisell2.text.ecocup.cup-action-modal.title-missing":"Copo Perdido","pisell2.text.ecocup.cup-action-modal.title-broken":"Copo Quebrado","pisell2.text.ecocup.cup-action-modal.cup-id":"ID do Copo","pisell2.text.ecocup.cup-action-modal.cup-tip":"Alugado em","pisell2.text.ecocup.cup-info-card.title.rentInfo":"Alugado em","pisell2.text.ecocup.cup-info-card.title.markInfo":"Marcado por","pisell2.text.ecocup.cup-info-card.title.belongInfo":"Pertence a","pisell2.text.ecocup.customer-first-modal.title":"Alugar/Devolver Copo(s)","pisell2.text.ecocup.customer-first-modal.search-tip":"Por favor, escaneie/insira o c\xf3digo correto do ECO Cup.","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder":"n\xfamero de celular ou c\xf3digo do copo","pisell2.text.ecocup.customer-first-modal.search-bar.placeholder-cup":"c\xf3digo do copo","pisell2.text.ecocup.customer-first-modal.over-max":"Por favor, remova {{num}} copo(s)","pisell2.text.ecocup.customer-first-modal.no-customer":"Por favor, fa\xe7a login do cliente","pisell2.text.ecocup.search-bar.search-tip":"Por favor, escaneie/insira o c\xf3digo correto do ECO Cup.","pisell2.text.ecocup.cup-status-modal.title-other_rent":"Aviso: Este Copo foi emprestado por Outros","pisell2.text.ecocup.cup-status-modal.title-other_in_stock":"Este Copo est\xe1 registrado em outra loja","pisell2.text.ecocup.cup-status-modal.title-missing":"Copo Marcado como Perdido","pisell2.text.ecocup.cup-status-modal.title-broken":"Copo Marcado como Quebrado","pisell2.text.ecocup.cup-status-modal.title-not_found":"Copo n\xe3o est\xe1 em seu invent\xe1rio","pisell2.text.ecocup.cup-status-modal.tip":"Por favor, adicione ao invent\xe1rio primeiro antes de alugar"}},eJj=[{key:"add-new-customer",icon:"pisell2-plus-circle",type:"primary",size:"large",languageKey:"pisell2.text.cup-project.footer.button.new-customer"},{key:"customer-list",icon:"pisell2-file-check-02",type:"primary",size:"large",languageKey:"pisell2.text.cup-project.footer.button.customer-list"},{key:"cup-list",icon:"pisell2-file-check-02",type:"primary",size:"large",languageKey:"pisell2.text.cup-project.footer.button.cup-list"},{key:"setting",icon:"pisell2-settings-02",type:"primary",size:"large",languageKey:"pisell2.text.cup-project.footer.button.setting"}],eJS=[{key:"name",label:"pisell2.text.cup-project.search-bar.result.header.name"},{key:"registrationTime",label:"pisell2.text.cup-project.search-bar.result.header.registrationTime"},{key:"phone",label:"pisell2.text.cup-project.search-bar.result.header.phone"},{key:"email",label:"pisell2.text.cup-project.search-bar.result.header.email"},{key:"membership",label:"pisell2.text.cup-project.search-bar.result.header.membership"}],eJM=e=>{let{type:t,data:l,isMultipleShop:a,isMultipleTime:i}=e;return(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-info-card",children:[(0,ev.jsx)("div",{children:eN.getText(`pisell2.text.ecocup.cup-info-card.title.${t}`)}),a?eN.getText("pisell2.text.ecocup.cup-info-card.title.multiple-shop"):(0,ev.jsx)("div",{children:(null==l?void 0:l.shop)||"-"}),i?eN.getText("pisell2.text.ecocup.cup-info-card.title.multiple-time"):(0,ev.jsx)("div",{children:(null==l?void 0:l.time)?em()(null==l?void 0:l.time).format("HH:mm DD/MM/YYYY"):"-"})]})},eJN=e=>{var t;let{id:l,nickname:a,display_name:i,phone:n,country_calling_code:s,cover:r,isMultiple:o}=e;if(!l&&!a&&!i&&!n&&!o)return null;let d=n?`${s} ${n}`:"-",c=i||a||"";return(0,ev.jsxs)("div",{className:"pisell2-ecocup-customer-card",children:[(0,ev.jsx)("div",{className:"pisell2-ecocup-customer-card-avatar",children:o?(0,ev.jsx)("div",{className:"pisell2-ecocup-customer-card-avatar-text"}):r?(0,ev.jsx)("img",{src:iK(r,360),alt:"avatar"}):(0,ev.jsx)("div",{className:"pisell2-ecocup-customer-card-avatar-text",children:(null==c||null==(t=c.charAt(0))?void 0:t.toUpperCase())||""})}),(0,ev.jsxs)("div",{className:"pisell2-ecocup-customer-card-info",children:[(0,ev.jsx)("div",{className:"pisell2-ecocup-customer-card-info-name",children:o?eN.getText("pisell2.text.ecocup.cup-info-card.title.multiple-customer"):c||""}),(0,ev.jsx)("div",{className:"pisell2-ecocup-customer-card-info-phone",children:o?"-":d||""}),o?(0,ev.jsx)("div",{children:"-"}):null]})]})},eJC=e=>{var t,l,a;let{visible:i,onCancel:n,onOk:s,data:r}=e,{scanStatus:o,cupData:d}=r||{},c=(()=>{let{put:e}=eJx(),[t,l]=(0,ef.useState)(!1),{goalShopId:a}=eJb();return{run:i0(async(t,i)=>{try{l(!0);let n=await e(`/shop/wallet/eco/cup/action/${t}`,{action:i,goal_shop_id:a});if((null==n?void 0:n.code)==200)return!0;return!1}catch(e){return console.error(e),!1}finally{l(!1)}}),loading:t}})(),[u,p]=(0,ef.useState)([]),m=(()=>{let{post:e}=eJx(),[t,l]=(0,ef.useState)(!1);return{run:i0(async t=>{try{l(!0);let a=await e("/shop/wallet/eco/cups-return",{eco_cup_ids:t});if((null==a?void 0:a.code)==200)return!0;return!1}catch(e){return console.error(e),!1}finally{l(!1)}}),loading:t}})();(0,ef.useEffect)(()=>{d?p(Array.isArray(d)?d:[d]):p([])},[d]);let g=(0,ef.useMemo)(()=>"other_rent"===o,[o]),h=!g,v=(0,ef.useMemo)(()=>{var e,t,l;if(0===u.length)return{hasMultipleCustomers:!1,hasMultipleShops:!1,hasMultipleTimes:!1,uniqueCustomer:null,uniqueShop:null,uniqueTime:null};let a=new Set(u.map(e=>null==e?void 0:e.customer_id).filter(e=>e)),i=new Set(u.map(e=>null==e?void 0:e.current_shop_id).filter(e=>e)),n=new Set(u.map(e=>null==e?void 0:e.operated_at).filter(e=>e));return{hasMultipleCustomers:a.size>1,hasMultipleShops:i.size>1,hasMultipleTimes:n.size>1,uniqueCustomer:null==(e=u[0])?void 0:e.customer,uniqueShop:null==(t=u[0])?void 0:t.current_shop,uniqueTime:null==(l=u[0])?void 0:l.operated_at}},[u]),f=(0,ef.useMemo)(()=>h?{backgroundColor:"#FEE4E2",color:"#F04438"}:{backgroundColor:"#F6F2FF",color:"#7F56DA"},[h]),y=(0,ef.useMemo)(()=>"other_in_stock"===o?"otherBelongInfo":"in_stock"===o?"belongInfo":g||"rent"===o?"rentInfo":"missing"===o||"broken"===o?"markInfo":"",[o]),x=async()=>{let e;if(null==c?void 0:c.loading)return;let t=g?"return":"";if(!t){null==s||s();return}if(g){let t=u.map(e=>(null==e?void 0:e.eco_cup_id)||(null==e?void 0:e.id));e=await m.run(t)}else e=await c.run((null==d?void 0:d.eco_cup_id)||(null==d?void 0:d.id),t);e&&((0,lL.PisellToast)({content:eN.getText(`pisell2.text.ecocup.toast.success-${t}`)}),null==s||s())},b=e=>{var t;u.find(t=>{var l;return(null==t?void 0:t.id)===(null==e||null==(l=e.data)?void 0:l.id)})||(null==e||null==(t=e.data)?void 0:t.status)==="rent"&&p([...u,null==e?void 0:e.data])},_=(0,ef.useMemo)(()=>(null==u?void 0:u.length)>1&&g,[u.length,g]);return(0,ev.jsx)(lL.PisellModal,{headerDivider:!1,open:i,onCancel:()=>{null!=c&&c.loading||null==n||n()},onOk:x,title:g?eN.getText(`pisell2.text.ecocup.cup-status-modal.title-${o}`)(u.length):eN.getText(`pisell2.text.ecocup.cup-status-modal.title-${o}`),cancelText:g?eN.getText("pisell2.text.ecocup.button.cancel"):eN.getText("pisell2.text.ecocup.button.dismiss"),okText:h?eN.getText("pisell2.text.ecocup.button.confirm"):eN.getText("pisell2.text.ecocup.button.return"),okButtonProps:{loading:null==c?void 0:c.loading},cancelVisible:!h,width:580,children:(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-status-modal-content",style:{gap:g?"20px":"32px"},children:[g?(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-status-modal-content-search",children:[(0,ev.jsx)("span",{className:"tip-text",children:eN.getText("pisell2.text.ecocup.cup-status-modal.search-bar.title")}),(0,ev.jsx)("div",{className:"pisell2-ecocup-customer-first-modal-search-bar",children:(0,ev.jsx)(eJT,{scanListenerKey:"eco-cup-status-modal-scan-listener",searchType:"cup",placeholder:eN.getText("pisell2.text.ecocup.customer-first-modal.search-bar.placeholder"),onSearchResult:b,onCupStatusValidate:b})})]}):null,(0,ev.jsx)("div",{className:"pisell2-ecocup-cup-status-modal-content-cup-lists",children:u.map((e,t)=>(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-status-modal-content-cup",style:{...f,justifyContent:_?"space-between":"center"},children:[(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-status-modal-content-cup-info",children:[(0,ev.jsx)(lL.Icon,{type:"RestOutlined",size:24}),(0,ev.jsx)("span",{style:{color:h?"#F04438":"#667085"},children:eN.getText("pisell2.text.ecocup.cup-id")}),(0,ev.jsx)("span",{children:(null==e?void 0:e.eco_cup_code)||(null==e?void 0:e.code)||""})]}),_&&(0,ev.jsx)(lL.Button,{type:"primary",icon:(0,ev.jsx)(lL.Icon,{type:"pisell2-trash-01",size:24,color:"#7F56DA"}),onClick:()=>{var t;return t=null==e?void 0:e.id,void p(u.filter(e=>(null==e?void 0:e.id)!==t))},className:"info-remove",children:eN.getText("pisell2.text.ecocup.button.remove")})]},(null==e?void 0:e.id)||t))}),(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-status-modal-content-info",children:[(0,ev.jsx)("div",{style:{flex:1},children:((null==v?void 0:v.uniqueShop)||(null==v?void 0:v.hasMultipleShops))&&y?(0,ev.jsx)(eJM,{type:y,data:{shop:null==v||null==(t=v.uniqueShop)?void 0:t.name,time:null==v?void 0:v.uniqueTime,isMultipleTime:null==v?void 0:v.hasMultipleTimes,isMultipleShop:null==v?void 0:v.hasMultipleShops}}):null}),(0,ev.jsx)("div",{style:{flex:1},children:(null==u||null==(l=u[0])?void 0:l.status)==="rent"?(null==v?void 0:v.uniqueCustomer)||(null==v?void 0:v.hasMultipleCustomers)?(0,ev.jsx)(eJN,{...(null==v?void 0:v.uniqueCustomer)||{},isMultiple:null==v?void 0:v.hasMultipleCustomers}):null:(0,ev.jsx)("div",{className:"pisell2-ecocup-cup-status-modal-content-info-tip",children:(null==u||null==(a=u[0])?void 0:a.status)==="in_stock"?eN.getText("pisell2.text.ecocup.cup-status-modal.tip-in-stock"):eN.getText("pisell2.text.ecocup.cup-status-modal.tip")})})]})]})})},eJT=e=>{let t,{scanListenerKey:l,size:a="large",placeholder:i,onSearch:n,searchType:s,onSearchResult:r,customerId:o,onCupStatusValidate:d}=e,[c,u]=(0,ef.useState)(""),[p,m]=(0,ef.useState)(null),g=(0,ef.useRef)(null),{addListener:h,removeListener:v,setActiveListener:f}=(()=>{var e;let{interaction:t}=(null==(e=ik().appHelper)?void 0:e.utils)||{};return{addListener:(e,l)=>{eJv.addListener(t,e,l)},removeListener:e=>{eJv.removeListener(e)},setActiveListener:e=>{eJv.setActiveListener(e)}}})(),y=(()=>{let e=(()=>{let{get:e}=eJx(),{goalShopId:t}=eJb();return{run:l=>{if(l)return e("/shop/wallet/eco/customer",{search:l,with:["tags"],goal_shop_id:t})}}})(),t=(()=>{let{get:e}=eJx(),{goalShopId:t}=eJb();return{run:l=>{if(l)return e("/shop/wallet/eco",{type:"eco",code:l,with:["customer:id,display_name,cover,phone,country_calling_code,nickname","rentShop:id,name","returnShop:id,name","currentShop:id,name"],num:1,goal_shop_id:t})}}})(),[l,a]=(0,ef.useState)(!1);return{loading:l,run:async l=>{let{searchType:i,searchText:n=""}=l,s=/^EC[a-zA-Z0-9]{8}$/.test(n);if("cup"===i&&!s)return{status:"failed",message:eN.getText("pisell2.text.ecocup.search-bar.search-tip")};let r=i||(s?"cup":"customer"),o="cup"===r?t.run:e.run;try{var d,c;a(!0);let e=await o(n);if(null==e||null==(d=e.data)?void 0:d.list)return{status:"success",type:r,data:(null==e||null==(c=e.data)?void 0:c.list)||[]};return{status:"failed",type:r,message:(null==e?void 0:e.message)||""}}catch(e){return{status:"failed",type:r,message:(null==e?void 0:e.message)||""}}finally{a(!1)}}}})(),{getCupScanStatus:x}=(t=eJ_(),{getCupScanStatus:(e,l)=>e?(null==e?void 0:e.status)=="in_stock"&&(null==e?void 0:e.current_shop_id)!=t?"other_in_stock":(null==e?void 0:e.status)=="rent"&&(null==e?void 0:e.customer_id)!=l?"other_rent":(null==e?void 0:e.status)=="missing"?"missing":(null==e?void 0:e.status)=="broken"?"broken":void 0:"not_found"}),b=eJy("ecocup-cup-status-modal");eJ_();let _=i0((e,t)=>{m(null),u(""),null==r||r({type:e,data:t})}),k=i0(e=>{if(n)return void n(e||"");if(!e){u(""),m(null);return}y.run({searchType:s,searchText:e}).then(t=>{if((null==t?void 0:t.status)==="success"){var l,a,i;if((null==t?void 0:t.type)==="cup"){let l=(null==t||null==(a=t.data)?void 0:a[0])||null,i=x(l,o);if(d&&i&&"other_rent"===i){null==d||d({data:l||{code:e}}),u("");return}if(i)return void b.open({data:{scanStatus:i,cupData:l||{code:e}}})}let n=(null==t||null==(l=t.data)?void 0:l.length)||0;if(1===n){u(""),m(null),_(null==t?void 0:t.type,null==t||null==(i=t.data)?void 0:i[0]);return}if(0===n&&(null==t?void 0:t.type)==="customer"){(0,lL.PisellToast)({content:eN.getText("pisell2.text.ecocup.toast.fail-no-match-customer")}),m(null);return}m(null==t?void 0:t.data)}else(null==t?void 0:t.message)&&(0,lL.PisellToast)({content:null==t?void 0:t.message}),m(null)})});return(0,ef.useEffect)(()=>(h(l,e=>{u(""),m(null),k((null==e?void 0:e.value)||"")}),()=>{v(l)}),[l,k]),(0,ef.useEffect)(()=>{let e=e=>{let t=e.target;g.current&&t&&!g.current.contains(t)&&(null==p?void 0:p.length)>1&&m(null)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[p]),(0,ev.jsxs)("div",{ref:g,className:"ecocup-cup-search-bar",children:[(0,ev.jsx)("div",{style:{flex:1},onClick:()=>{f(l)},children:(0,ev.jsx)(qM,{value:c,onChange:u,loading:y.loading,style:{flex:1,height:"large"===a?"60px":"48px",padding:0},placeholder:i||eN.getText("pisell2.text.cup-project.search-bar.placeholder"),searchButtonProps:{placement:"inside",style:"large"===a?{height:48,padding:8,minWidth:160}:{height:32,padding:8,minWidth:120}},cameraButtonProps:{icon:["pisell2-camera-01","pisell2-qr-code-02"]},onSearch:()=>k(c)})}),(null==p?void 0:p.length)>1?(0,ev.jsxs)("div",{className:"ecocup-cup-search-bar-result",children:[(0,ev.jsx)("div",{className:"ecocup-cup-search-bar-result-header",children:null==eJS?void 0:eJS.map(e=>(0,ev.jsx)("div",{children:eN.getText(e.label)},e.key))}),(0,ev.jsx)("div",{className:"ecocup-cup-search-bar-result-content",children:null==p?void 0:p.map(e=>{var t,l;let{nickname:a,display_name:i,create_time:n,country_calling_code:s,phone:r,email:o,tags:d}=e;return(0,ev.jsxs)("div",{className:"ecocup-cup-search-bar-result-content-item",onClick:()=>_("customer",e),children:[(0,ev.jsx)("div",{children:i||a||"-"}),(0,ev.jsx)("div",{children:n?em()(n).format("DD/MM/YYYY"):"-"}),(0,ev.jsx)("div",{children:r?`(${s}) ${r}`:"-"}),(0,ev.jsx)("div",{children:o||"-"}),(0,ev.jsx)("div",{children:(0,ev.jsx)("span",{className:"ecocup-cup-search-bar-result-content-item-membership",children:(null==d||null==(t=d.find)?void 0:t.call(d,e=>(null==e?void 0:e.name)=="admin"))?"Admin":(null==d||null==(l=d.find)?void 0:l.call(d,e=>(null==e?void 0:e.name)=="business"))?"Business":"Regular"})})]},e.id)})})]}):null,b.visible&&(0,ev.jsx)(eJC,{...b.modalProps})]})},eJP=e=>{let{visible:t,onCancel:l,onOk:a,variant:i}=e,n=i||"desktop",s="phone"===n,[r]=ex.Form.useForm(),{post:o}=eJx(),[d,c]=(0,ef.useState)(!1),{goalShopId:u}=eJb(),p=()=>{d||(null==l||l(),r.resetFields())},m=async()=>{if(!d)try{let e=await r.validateFields();if(!await g(e))return;null==a||a(e),r.resetFields()}catch(e){console.error(e)}},g=async e=>{let{first_name:t,last_name:l,phone:a,email:i,membership:n}=e;try{c(!0);let e=await o("/shop/wallet/eco/customer",{goal_shop_id:u,customer:{first_name:t,last_name:l,phone:null==a?void 0:a.phone,country_calling_code:null==a?void 0:a.countryCallingCode,email:i,register_channel:"shop"},tags:[n]});if((null==e?void 0:e.code)==200)return(0,lL.PisellToast)({content:eN.getText("pisell2.text.ecocup.add-customer-modal.success")}),!0;return!1}catch(e){return console.error(e),!1}finally{c(!1)}},h=()=>(0,ev.jsxs)("div",{className:"pisell2-ecocup-add-customer-modal-footer",children:[(0,ev.jsx)(lL.Button,{size:"large",onClick:p,disabled:d,children:eN.getText("pisell2.text.ecocup.button.cancel")}),(0,ev.jsx)(lL.Button,{size:"large",type:"primary",onClick:m,loading:d,children:eN.getText("pisell2.text.ecocup.button.confirm")})]}),v=eN.getText("pisell2.text.ecocup.add-customer-modal.title"),f=t_()("pisell2-ecocup-add-customer-modal",`pisell2-ecocup-add-customer-modal--${n}`);return(0,ev.jsx)(iB,{renderType:s?"drawer":"modal",showHandlerBar:s,onHandlerBarClick:p,props:s?{open:t,placement:"bottom",width:"100%",height:"auto",style:{maxHeight:"95dvh"},title:v,onClose:p,destroyOnClose:!0,footer:h(),rootClassName:f,className:f,bodyStyle:{padding:"0 24px"}}:{open:t,title:v,onCancel:p,width:680,centered:!0,destroyOnClose:!0,footer:h(),className:f,wrapClassName:f,bodyStyle:{padding:"0 24px",maxHeight:"min(640px, calc(100dvh - 220px))",overflowY:"auto"}},children:(0,ev.jsx)("div",{className:"pisell2-ecocup-add-customer-modal-content",children:(0,ev.jsxs)(ex.Form,{form:r,size:"large",children:[(0,ev.jsxs)("div",{className:"pisell2-ecocup-add-customer-modal-content-name-wrap",children:[(0,ev.jsx)(lL.FormItemInput,{renderMode:"edit",innerRef:null,label:eN.getText("pisell2.text.ecocup.add-customer-modal.first-name"),placeholder:eN.getText("pisell2.text.ecocup.add-customer-modal.first-name-placeholder"),name:"first_name",requiredobj:{required:!0,message:eN.getText("pisell2.text.ecocup.add-customer-modal.first-name-required")}}),(0,ev.jsx)(lL.FormItemInput,{renderMode:"edit",innerRef:null,label:eN.getText("pisell2.text.ecocup.add-customer-modal.last-name"),placeholder:eN.getText("pisell2.text.ecocup.add-customer-modal.last-name-placeholder"),name:"last_name",requiredobj:{required:!0,message:eN.getText("pisell2.text.ecocup.add-customer-modal.last-name-required")}})]}),(0,ev.jsx)(lL.FormItemInput.Mobile,{renderMode:"edit",name:"phone",label:eN.getText("pisell2.text.ecocup.add-customer-modal.phone"),placeholder:eN.getText("pisell2.text.ecocup.add-customer-modal.phone-placeholder"),typeobj:{type:"phone",enabled:!0,message:eN.getText("pisell2.text.ecocup.add-customer-modal.phone-error")},requiredobj:{required:!0,message:eN.getText("pisell2.text.ecocup.add-customer-modal.phone-required")},returnFormat:"object"}),(0,ev.jsx)(lL.FormItemInput,{renderMode:"edit",innerRef:null,name:"email",label:eN.getText("pisell2.text.ecocup.add-customer-modal.email"),placeholder:eN.getText("pisell2.text.ecocup.add-customer-modal.email-placeholder"),requiredobj:{required:!0,message:eN.getText("pisell2.text.ecocup.add-customer-modal.email-required")}}),(0,ev.jsx)(lL.FormItemSelect,{renderMode:"edit",name:"membership",label:eN.getText("pisell2.text.ecocup.add-customer-modal.membership"),defaultValue:"regular",labelField:"label",valueField:"value",options:[{label:"Regular",value:"regular"},{label:"Business",value:"business"},{label:"Admin",value:"admin"}]})]})})})};eJP.displayName="AddCustomerModal";let eJA=iW(eJP),eJD=e=>{var t;let{visible:l,onCancel:a,onOk:i,data:n}=e,{type:s,cupData:r}=n||{},o=(()=>{let{put:e}=eJx(),[t,l]=(0,ef.useState)(!1),{goalShopId:a}=eJb();return{run:i0(async(t,i)=>{try{l(!0);let n=await e(`/shop/wallet/eco/cup/action/${t}`,{action:i,goal_shop_id:a});if((null==n?void 0:n.code)==200)return!0;return!1}catch(e){return console.error(e),!1}finally{l(!1)}}),loading:t}})(),d=(0,ef.useMemo)(()=>(null==n?void 0:n.type)==="missing"||(null==n?void 0:n.type)==="broken"?{backgroundColor:"#FEE4E2",color:"#F04438"}:{backgroundColor:"#F6F2FF",color:"#7F56DA"},[null==n?void 0:n.type]);return(0,ev.jsx)(lL.PisellModal,{open:l,headerDivider:!1,title:eN.getText(`pisell2.text.ecocup.cup-action-modal.title-${null==n?void 0:n.type}`),onCancel:()=>{null!=o&&o.loading||null==a||a()},onOk:()=>{null!=o&&o.loading||o.run((null==r?void 0:r.eco_cup_id)||(null==r?void 0:r.id),s).then(e=>{e&&((0,lL.PisellToast)({content:eN.getText(`pisell2.text.ecocup.toast.success-${s}`)}),null==i||i(r))})},okText:eN.getText(`pisell2.text.ecocup.button.mark-as-${null==n?void 0:n.type}`),cancelText:eN.getText("pisell2.text.ecocup.button.cancel"),okButtonProps:{loading:null==o?void 0:o.loading},width:580,destroyOnClose:!0,wrapClassName:"pisell2-ecocup-cup-action-modal",children:(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-modal-content",children:[(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-modal-content-cup",style:{...d},children:[(0,ev.jsx)(lL.Icon,{type:"RestOutlined",size:24}),(0,ev.jsx)("span",{style:{color:(null==n?void 0:n.type)==="return"?"#667085":"#F04438"},children:eN.getText("pisell2.text.ecocup.cup-action-modal.cup-id")}),(0,ev.jsx)("span",{children:(null==r?void 0:r.eco_cup_code)||(null==r?void 0:r.code)||""})]}),(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-modal-info",children:[(0,ev.jsx)("div",{className:"pisell2-ecocup-cup-action-modal-info-left",children:(0,ev.jsx)(eJM,{type:"rentInfo",data:{shop:null==r||null==(t=r.rent_shop)?void 0:t.name,time:null==r?void 0:r.rent_time}})}),(0,ev.jsx)("div",{className:"pisell2-ecocup-cup-action-modal-info-right",children:(0,ev.jsx)(eJN,{...null==n?void 0:n.customerData})})]})]})})},eJI=e=>{let{locales:t,onClick:l,buttonText:a,showFields:i=["missing","broken"]}=e,n=(0,ef.useMemo)(()=>[{key:"missing",label:t.getText("pisell2.text.ecocup.action.more.missing"),hidden:!i.includes("missing")},{key:"broken",label:t.getText("pisell2.text.ecocup.action.more.broken"),hidden:!i.includes("broken")}],[t,i]);return(0,ev.jsx)(lL.Dropdown,{trigger:["click","hover"],menu:{items:n.filter(e=>!e.hidden),onClick:e=>{e.key,l&&l(e.key)}},children:(0,ev.jsx)(lL.Button,{children:a||t.getText("pisell2.text.ecocup.action.more")})})},eJE=e=>{let{maxNum:t,currentNum:l,cups:a,customerData:i,onClearAll:n,onRemove:s,onAction:r}=e,o=eJy("ecocup-cup-action-modal"),d=(0,ef.useMemo)(()=>l>t,[l,t]),c=(e,t)=>{o.open({data:{type:e,cupData:t,customerData:i},onOk:()=>{r(e,t)}})};return(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-list",children:[d&&(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-list-over-max",children:[(0,ev.jsx)("span",{children:eN.getText("pisell2.text.ecocup.customer-first-modal.over-max").replace("{{num}}",(l-t).toString())}),(0,ev.jsx)("span",{onClick:n,children:eN.getText("pisell2.text.ecocup.button.clear-all")})]}),(0,ev.jsx)("div",{className:"pisell2-ecocup-cup-action-list-cup-list",children:a.map(e=>{var t;let l=(null==e?void 0:e.status)==="in_stock";return(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-list-cup",style:l?{backgroundColor:"#F6F2FF",border:"1px solid #F6F2FF"}:{border:"1px solid #D0D5DD"},children:[(0,ev.jsx)(lL.Icon,{type:"RestOutlined",size:24,color:"#7F56DA"}),(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-list-cup-info",children:[(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-list-cup-info-top",children:[(0,ev.jsx)("span",{children:eN.getText("pisell2.text.ecocup.cup-id")}),(0,ev.jsx)("span",{children:(null==e?void 0:e.eco_cup_code)||(null==e?void 0:e.code)||"-"})]}),!l&&(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-list-cup-info-bottom",children:[(0,ev.jsx)("span",{children:(null==e||null==(t=e.rent_shop)?void 0:t.name)||"-"}),(0,ev.jsx)("span",{children:(null==e?void 0:e.rent_time)?em()(null==e?void 0:e.rent_time).format("DD/MM/YYYY"):"-"})]})]}),l?(0,ev.jsx)(lL.Button,{type:"primary",icon:(0,ev.jsx)(lL.Icon,{type:"pisell2-trash-01",size:24,color:"#7F56DA"}),onClick:()=>s(e),className:"pisell2-ecocup-cup-action-list-cup-info-remove",children:eN.getText("pisell2.text.ecocup.button.remove")}):(0,ev.jsxs)("div",{className:"pisell2-ecocup-cup-action-list-cup-info-actions",children:[(0,ev.jsx)(lL.Button,{type:"primary",onClick:()=>c("return",e),children:"Return"}),(0,ev.jsx)(eJI,{locales:eN,onClick:t=>c(t,e),buttonText:eN.getText("pisell2.text.ecocup.button.others")})]})]},e.code)})}),(null==o?void 0:o.visible)&&(0,ev.jsx)(eJD,{...null==o?void 0:o.modalProps})]})},eJz=e=>{let{key:t,title:l,visible:a,onCancel:i,onOk:n,data:s}=e,[r,o]=(0,ef.useState)(),[d,c]=(0,ef.useState)([]),[u,p]=(0,ef.useState)([]),[m,g]=(0,ef.useState)(0),h=(()=>{let{get:e}=eJx(),[t,l]=(0,ef.useState)(!1),{goalShopId:a}=eJb();return{run:i0(async t=>{try{l(!0);let i=await e(`/shop/wallet/eco/customer/${t}`,{with_rent_cups_flag:1,goal_shop_id:a,with:["tags"]});if((null==i?void 0:i.code)==200)return null==i?void 0:i.data;return null}catch(e){return console.error(e),null}finally{l(!1)}}),loading:t}})(),v=(()=>{let{post:e}=eJx(),[t,l]=(0,ef.useState)(!1),{goalShopId:a}=eJb();return{run:i0(async(t,i)=>{try{l(!0);let n=await e("/shop/wallet/eco/cups-rent",{customer_id:t,eco_cup_ids:i,goal_shop_id:a});if((null==n?void 0:n.code)==200)return!0;return!1}catch(e){return console.error(e),!1}finally{l(!1)}}),loading:t}})(),f=(0,ef.useMemo)(()=>((null==d?void 0:d.length)||0)+((null==u?void 0:u.length)||0),[d,u]),y=(0,ef.useMemo)(()=>f>m,[f,m]),x=(0,ef.useMemo)(()=>(null==h?void 0:h.loading)||(null==v?void 0:v.loading),[null==h?void 0:h.loading,null==v?void 0:v.loading]);(0,ef.useEffect)(()=>{o((null==s?void 0:s.customerData)||void 0)},[null==s?void 0:s.customerData]);let b=i0(e=>{e&&h.run(e).then(e=>{e?(g((null==e?void 0:e.max_rent_count)||0),c((null==e?void 0:e.rent_cups)||[])):(g(0),c([]))})});(0,ef.useEffect)(()=>{if((null==s?void 0:s.firstType)==="cup")(null==s?void 0:s.cupData)&&p([null==s?void 0:s.cupData]);else{var e;b(null==s||null==(e=s.customerData)?void 0:e.id)}},[null==s?void 0:s.firstType,null==s?void 0:s.customerData,null==s?void 0:s.cupData,b]);let _=async()=>{if(x||!(null==r?void 0:r.id))return;let e=u.map(e=>null==e?void 0:e.id);await v.run(null==r?void 0:r.id,e)&&(p([]),b(null==r?void 0:r.id))},k=e=>{var t,l;if((null==e?void 0:e.type)==="cup"){if(u.find(t=>{var l;return(null==t?void 0:t.id)===(null==e||null==(l=e.data)?void 0:l.id)})||(null==e||null==(t=e.data)?void 0:t.status)!=="in_stock")return;p([...u,null==e?void 0:e.data])}else o(null==e?void 0:e.data),b(null==e||null==(l=e.data)?void 0:l.id)},w=()=>(0,ev.jsxs)("div",{children:[(0,ev.jsx)("div",{className:"pisell2-ecocup-customer-first-modal-title",children:"Current Customer"}),(null==r?void 0:r.id)?(0,ev.jsx)(eJN,{...r||{}}):(0,ev.jsxs)("div",{className:"pisell2-ecocup-customer-first-modal-no-customer",children:[(0,ev.jsx)("div",{className:"pisell2-ecocup-customer-first-modal-no-customer-icon"}),(0,ev.jsx)("span",{className:"pisell2-ecocup-customer-first-modal-no-customer-text",children:eN.getText("pisell2.text.ecocup.customer-first-modal.no-customer")})]})]}),j=()=>(0,ev.jsxs)("div",{className:"pisell2-ecocup-customer-first-modal-search-bar",children:[(0,ev.jsx)(eJT,{scanListenerKey:`${t}-eco-cup-customer-first-modal-scan-listener`,searchType:(null==r?void 0:r.id)?"cup":void 0,placeholder:(null==r?void 0:r.id)?eN.getText("pisell2.text.ecocup.customer-first-modal.search-bar.placeholder-cup"):eN.getText("pisell2.text.ecocup.customer-first-modal.search-bar.placeholder"),onSearchResult:k,customerId:null==r?void 0:r.id}),(0,ev.jsxs)("div",{className:"pisell2-ecocup-customer-first-modal-search-bar-limit",children:[(0,ev.jsx)("span",{children:"Max"}),(0,ev.jsxs)("div",{children:[(0,ev.jsx)("span",{style:{color:y?"#CF1322":"#000000"},children:f}),"/",m]})]})]});return(0,ev.jsx)(lL.PisellModal,{open:a,title:l||eN.getText("pisell2.text.ecocup.customer-first-modal.title"),headerDivider:!1,onCancel:()=>{x||null==i||i()},onOk:_,okText:eN.getText("pisell2.text.ecocup.button.confirm"),cancelText:eN.getText("pisell2.text.ecocup.button.dismiss"),okButtonProps:{disabled:0===u.length||y||x||!(null==r?void 0:r.id),loading:x},width:580,children:(0,ev.jsxs)("div",{className:"pisell2-ecocup-customer-first-modal",children:[(null==s?void 0:s.firstType)==="customer"?(0,ev.jsxs)(ev.Fragment,{children:[w(),j()]}):(0,ev.jsxs)(ev.Fragment,{children:[j(),w()]}),(0,ev.jsx)(eJE,{maxNum:m,currentNum:f,cups:[...d,...u],customerData:r,onClearAll:()=>p([]),onRemove:e=>{p(u.filter(t=>(null==t?void 0:t.id)!==(null==e?void 0:e.id)))},onAction:(e,t)=>{let l=(null==t?void 0:t.eco_cup_id)?"eco_cup_id":"id";c(d.filter(e=>(null==e?void 0:e[l])!==(null==t?void 0:t[l])))}})]})})},eJL=[{name:"regular",labelKey:"pisell2.text.ecocup.setting.regular",placeholderKey:"pisell2.text.ecocup.setting.regular-placeholder",requiredMessageKey:"pisell2.text.ecocup.setting.regular-required"},{name:"business",labelKey:"pisell2.text.ecocup.setting.business",placeholderKey:"pisell2.text.ecocup.setting.business-placeholder",requiredMessageKey:"pisell2.text.ecocup.setting.business-required"},{name:"admin",labelKey:"pisell2.text.ecocup.setting.admin",placeholderKey:"pisell2.text.ecocup.setting.admin-placeholder",requiredMessageKey:"pisell2.text.ecocup.setting.admin-required"}],eJO=e=>{let{visible:t,onCancel:l,variant:a}=e,i=a||"desktop",n="phone"===i,[s]=ex.Form.useForm(),{post:r,get:o}=eJx(),[d,c]=(0,ef.useState)(!1),u=()=>{d||(null==l||l(),s.resetFields())},p=async()=>{if(!d)try{let e=await s.validateFields();if(!await g(e))return;u()}catch(e){console.error(e)}},m=async()=>{let e=await o("/shop/metadata/many",{keys:["eco_cup_customer_rent_config","eco_cup_rent_expire_config"]});if((null==e?void 0:e.code)==200){let{data:t}=e,l=(null==t?void 0:t.eco_cup_rent_expire_config)||{},a=(null==t?void 0:t.eco_cup_customer_rent_config)||[],i={expire:(null==l?void 0:l.expire)||30};a.forEach(e=>{(null==e?void 0:e.name)&&(i[e.name]=Number(null==e?void 0:e.max_rent_count)||void 0)}),s.setFieldsValue(i)}};(0,ef.useEffect)(()=>{m()},[]);let g=async e=>{let{expire:t,...l}=e,a=eJL.map(e=>({name:e.name,max_rent_count:l[e.name]}));try{c(!0);let e=await r("/shop/metadata/many",{eco_cup_customer_rent_config:a,eco_cup_rent_expire_config:{expire:t,unit:"day"}});if((null==e?void 0:e.code)==200)return(0,lL.PisellToast)({content:eN.getText("pisell2.text.ecocup.setting.success")}),!0;return!1}catch(e){return console.error("提交设置失败:",e),!1}finally{c(!1)}},h=()=>(0,ev.jsxs)("div",{className:"pisell2-ecocup-setting-modal-footer",children:[(0,ev.jsx)(lL.Button,{size:"large",onClick:u,disabled:d,children:eN.getText("pisell2.text.ecocup.button.cancel")}),(0,ev.jsx)(lL.Button,{size:"large",type:"primary",onClick:p,loading:d,children:eN.getText("pisell2.text.ecocup.button.confirm")})]}),v=eN.getText("pisell2.text.cup-project.footer.button.setting"),f=t_()("pisell2-ecocup-setting-modal",`pisell2-ecocup-setting-modal--${i}`);return(0,ev.jsx)(iB,{renderType:n?"drawer":"modal",showHandlerBar:n,onHandlerBarClick:u,props:n?{open:t,placement:"bottom",width:"100%",height:"auto",style:{maxHeight:"95dvh"},title:v,onClose:u,destroyOnClose:!0,footer:h(),rootClassName:f,className:f,bodyStyle:{padding:"0 24px"}}:{open:t,title:v,onCancel:u,width:680,centered:!0,destroyOnClose:!0,footer:h(),className:f,wrapClassName:f,bodyStyle:{padding:"0 24px",maxHeight:"min(560px, calc(100dvh - 220px))",overflowY:"auto"}},children:(0,ev.jsx)("div",{className:"pisell2-ecocup-setting-modal-content",children:(0,ev.jsxs)(ex.Form,{form:s,size:"large",children:[eJL.map(e=>(0,ev.jsx)(lL.FormItemInputNumber,{renderMode:"edit",name:e.name,label:eN.getText(e.labelKey),placeholder:eN.getText(e.placeholderKey),maxobj:{enabled:!0,max:9999,message:eN.getText("pisell2.text.ecocup.setting.max-rent-count-max")},minobj:{enabled:!0,min:0,message:eN.getText("pisell2.text.ecocup.setting.max-rent-count-min")},requiredobj:{required:!0,message:eN.getText(e.requiredMessageKey)}},e.name)),(0,ev.jsx)(lL.FormItemInputNumber,{renderMode:"edit",name:"expire",label:eN.getText("pisell2.text.ecocup.setting.expire-time"),placeholder:eN.getText("pisell2.text.ecocup.setting.expire-time-placeholder"),maxobj:{enabled:!0,max:365,message:eN.getText("pisell2.text.ecocup.setting.expire-time-max")},minobj:{enabled:!0,min:0,message:eN.getText("pisell2.text.ecocup.setting.expire-time-min")},suffix:eN.getText("pisell2.text.ecocup.setting.days"),requiredobj:{required:!0,message:eN.getText("pisell2.text.ecocup.setting.expire-time-required")}})]})})})};eJO.displayName="SettingModal";let eJR=iW(eJO);function eJ$(e){let{className:t,style:l,variant:a}=e,i=LG()||"en";eN.init(eJw,i);let n=eJf(),s=eJy("ecocup-add-customer-modal"),r=eJy("ecocup-setting-modal"),o=eJy("ecocup-customer-and-cup-modal"),{goalShopId:d}=eJb();return(0,ev.jsxs)("div",{className:t_()("ecocup-cup-project",`ecocup-cup-project--${a||"desktop"}`,t),style:l,children:[(0,ev.jsx)("div",{className:"ecocup-cup-project-title",children:eN.getText("pisell2.text.cup-project.title")}),(0,ev.jsx)("div",{className:"ecocup-cup-project-search-bar",children:(0,ev.jsx)(eJT,{scanListenerKey:"eco-cup-project-scan-listener",onSearchResult:e=>{(null==e?void 0:e.type)==="customer"?o.open({data:{firstType:null==e?void 0:e.type,customerData:null==e?void 0:e.data}}):(null==e?void 0:e.type)==="cup"&&o.open({data:{firstType:null==e?void 0:e.type,cupData:null==e?void 0:e.data}})}})}),(0,ev.jsx)("div",{className:"ecocup-cup-project-actions",children:eJj.map(e=>(0,ev.jsx)(lL.Button,{type:e.type,size:"large",icon:(0,ev.jsx)(lL.Icon,{type:e.icon,size:32}),onClick:()=>(e=>{var t,l,a,i;switch(e){case"add-new-customer":s.open();break;case"customer-list":let o;o=null==n?void 0:n(),d?null==o||null==(t=o.history)||t.push(`/ecocup/customer-list?goal_shop_id=${d}`):null==o||null==(l=o.history)||l.push("/ecocup/customer-list");break;case"cup-list":let c;c=null==n?void 0:n(),d?null==c||null==(a=c.history)||a.push(`/ecocup/cup-list?goal_shop_id=${d}`):null==c||null==(i=c.history)||i.push("/ecocup/cup-list");break;case"setting":r.open()}})(e.key),className:"ecocup-cup-project-actions-button",children:eN.getText(e.languageKey)},e.key))}),s.visible&&(0,ev.jsx)(eJA,{...s.modalProps}),o.visible&&(0,ev.jsx)(eJz,{...o.modalProps}),r.visible&&(0,ev.jsx)(eJR,{...r.modalProps})]})}eJ$.displayName="EcoCupProject";let eJF=iW(eJ$),eJB=e=>e?{isShopApi:!0}:{},eJH={in_stock:"pisell2.text.ecocup.status.in-stock",rent:"pisell2.text.ecocup.status.rent",return:"pisell2.text.ecocup.status.returned",missing:"pisell2.text.ecocup.action.more.missing",broken:"pisell2.text.ecocup.action.more.broken",shop_changed:"pisell2.text.ecocup.status.shop-changed"},eJq={in_stock:{backgroundColor:"transparent",color:"#A3A3A3",border:"#A3A3A3"},rent:{backgroundColor:"#ECFDF3",color:"#067647",border:"#ABEFC6"},returned:{backgroundColor:"#000000",color:"#000000"},return:{backgroundColor:"transparent",color:"#A3A3A3",border:"#A3A3A3"},shop_changed:{backgroundColor:"transparent",color:"#A3A3A3",border:"#A3A3A3"},overtime:{backgroundColor:"#FEF3F2",color:"#F04438",border:"#F04438"},expire_soon:{backgroundColor:"#FFFAEB",color:"#F79009",border:"#FEDF89"},borrowing:{backgroundColor:"#000000",color:"#000000",border:"#FEDF89"},missing:{backgroundColor:"#FEF3F2",color:"#F04438",border:"#F04438"},broken:{backgroundColor:"#FEF3F2",color:"#F04438",border:"#F04438"}},eJV=[{label:"pisell2.text.ecocup.status.all",value:0},{label:"pisell2.text.ecocup.status.in-stock",value:"in_stock"},{label:"pisell2.text.ecocup.status.rent",value:"rent"},{label:"pisell2.text.ecocup.action.more.missing",value:"missing"},{label:"pisell2.text.ecocup.action.more.broken",value:"broken"},{label:"pisell2.text.ecocup.status.shop-changed",value:"shop_changed"}],eJY={show:!0,list:[{columnKey:"rent_time",key:"rent_time",type:"date",localFilter:!1},{columnKey:"return_time",key:"return_time",type:"date",localFilter:!1}]},eJU={show:!0,storageMode:"localStorage"},eJW=[{languageKey:"pisell2.text.ecocup.share.title",key:"share",size:"large",icon:"pisell2-share-06",type:"default"},{languageKey:"pisell2.text.ecocup.export.title",key:"export",size:"large",icon:"pisell2-download-01",type:"default"}],eJG="ecocup-cup-list",eJQ="ecocup-cup-list",eJK="ecocup-page-header",eJJ=e=>{var t;let{title:l,rightContent:a,isReturn:i=!0}=e,n=ik(),{history:s}=(null==n||null==(t=n.appHelper)?void 0:t.utils)||{},r=eJf();return(0,ev.jsxs)("div",{className:eJK,onClick:()=>{var e,t;i&&((null==r?void 0:r.history)?null==(e=r.history)||e.goBack():null==s||null==(t=s.goBack)||t.call(s))},children:[(0,ev.jsxs)("div",{className:`${eJK}-left-container`,children:[i?(0,ev.jsx)(_G,{style:{fontSize:18}}):null,(0,ev.jsx)(lL.PageHeader,{title:l,showTitle:!0})]}),(0,ev.jsx)("div",{className:`${eJK}-right-container`,onClick:e=>e.stopPropagation(),children:a||""})]})},eJZ="ecocup-cup-list",eJX="YYYY-MM-DD HH:mm:ss",eJ0=e=>{var t,l,a;let i,n,s,r,[o,d]=(0,ef.useState)([em()().startOf("day"),em()().endOf("day")]),c=eJy("ecocup-list-action-modal"),{isNormalShop:u}=eJb();eJ_();let p=eJk(),m=LG()||"en",{isEcoShare:g}={source:i=new URLSearchParams((null==(l=window)||null==(t=l.location)?void 0:t.search)||{}).get("source"),isEcoShare:!!i&&"ecoShare"===i};eN.init(eJw,m);let[h,v]=(0,ef.useState)({skip:1,num:10}),f=(0,ef.useRef)(h),{loading:y,data:x,run:b}=(e=>{let{isEcoShare:t}=e,[l,a]=(0,ef.useState)(!1),[i,n]=(0,ef.useState)({}),{get:s}=eJx(),{isNormalShop:r}=eJb(),o=eJk(),d=eJB(t);return{loading:l,data:i,run:(0,ef.useCallback)(async e=>{try{let t=r||(null==e?void 0:e.partner_shop_id);a(!0);let l={type:t?"partner":"eco",with:["customer:id,display_name","rentShop:id,name","returnShop:id,name","currentShop:id,name"],...e};t&&(l.with=["customer:id,display_name","rentShop:id,name","returnShop:id,name"]),o&&(l={num:null==e?void 0:e.num,skip:null==e?void 0:e.skip});let i=await s(o?"/h5/wallet/eco":"/shop/wallet/eco",l,d);n((null==i?void 0:i.data)||{}),a(!1)}catch(e){a(!1)}},[])}})({isEcoShare:g}),{data:_,getStatics:k}=(e=>{let{isEcoShare:t}=e,[l,a]=(0,ef.useState)({}),{get:i}=eJx(),{isNormalShop:n}=eJb(),s=eJB(t);return{data:l,getStatics:(0,ef.useCallback)(async e=>{try{let t={type:n||(null==e?void 0:e.partner_shop_id)?"partner":"eco",...e},l=await i("/shop/wallet/eco/statistics",t,s);a((null==l?void 0:l.data)||{})}catch(e){}},[])}})({isEcoShare:g}),{data:w,getEcoShopLists:j}=(e=>{let{isEcoShare:t}=e,[l,a]=(0,ef.useState)([]),{get:i}=eJx(),n=eJB(t);return{data:l,getEcoShopLists:(0,ef.useCallback)(async e=>{try{let e=await i("/shop/wallet/eco/shops",{skip:1,num:100},n);a((null==e?void 0:e.data)||[])}catch(e){}},[])}})({isEcoShare:g}),{postExportApi:S}=(()=>{let{post:e}=eJx(),t=eJ_(),l=ik();return{postExportApi:(0,ef.useCallback)(async a=>{try{var i,n;let{downloadFile:s}=(null==l||null==(i=l.appHelper)?void 0:i.utils)||{},{isPartner:r,listParams:o}=a,d={type:r?"partner":"eco",business_shop_id:r?null==o?void 0:o.partner_shop_id:t,operated_at_start:null==o?void 0:o.operated_at_start,operated_at_end:null==o?void 0:o.operated_at_end},c=await e("/shop/wallet/eco/export-url",d);if(null==c||null==(n=c.data)?void 0:n.export_url){let e=new Date().toISOString().replace(/[-:T.]/g,"").slice(0,14),t=`shop-eco-cups-${e}.csv`;s&&s(c.data.export_url,t),(0,lL.PisellToast)({content:eN.getText("pisell2.text.ecocup.export.success")});return}(0,lL.PisellToast)({content:eN.getText("pisell2.text.ecocup.export.fail")})}catch(e){}},[])}})(),{postShareApi:M}=(()=>{var e;let{post:t}=eJx(),l=eJf(),a=ik(),i=(0,ef.useMemo)(()=>{var e,t,a,i,n,s;return null==l||null==(s=l())||null==(n=s.data)||null==(i=n.store)||null==(a=i.getStore)||null==(t=a.call(i))||null==(e=t.getDataByModel)?void 0:e.call(t,"tenantCore","core")},[l]);return{postShareApi:(0,ef.useCallback)(async()=>{try{var e,n,s,r,o,d,c,u,p,m;let g=null==(r=l())||null==(s=r.data)||null==(n=s.storage)||null==(e=n.getStorage)?void 0:e.call(n,"token"),{copyToClipboard:h}=(null==a||null==(d=a.appHelper)||null==(o=d.utils)?void 0:o.businessUtils)||{};if(!g)return;let v=await t("/tenant/core/stash-token",{ttl:604800,data:{login_token:g}},{isPisell2:!0});if((null==v||null==(c=v.data)?void 0:c.token)&&(null==i||null==(u=i.tenant)?void 0:u.default_domain)){let e=`https://${null==i||null==(p=i.tenant)?void 0:p.default_domain}/admin/ecocup/cup-list`,t=`${e}?source=ecoShare&key=${null==v||null==(m=v.data)?void 0:m.token}`;h&&h(t),(0,lL.PisellToast)({content:eN.getText("pisell2.text.ecocup.toast.success-copy-link")})}}catch(e){}},[null==i||null==(e=i.tenant)?void 0:e.default_domain])}})(),N=(0,ef.useMemo)(()=>!!(u||(null==h?void 0:h.partner_shop_id)),[u,null==h?void 0:h.partner_shop_id]);(0,ef.useEffect)(()=>{f.current=h},[h]);let C=(0,ef.useCallback)(e=>{b({...(null==f?void 0:f.current)||{},...e})},[h]);(0,ef.useEffect)(()=>{var e,t;p||k({started_at:null==o||null==(e=o[0])?void 0:e.format(eJX),ended_at:null==o||null==(t=o[1])?void 0:t.format(eJX),partner_shop_id:null==h?void 0:h.partner_shop_id})},[o,p,null==h?void 0:h.partner_shop_id]),(0,ef.useEffect)(()=>{u||p||j({})},[u,p]),(0,ef.useEffect)(()=>{C()},[C]);let T=(e=>{let{onClickAction:t,locales:l,isEcoShare:a}=e,i=eJk(),n=e=>{if(!e)return"";let t=em()().diff(em()(e),"day");return 0===t?l.getText("pisell2.text.ecocup.table.time-of-return.today"):l.getText("pisell2.text.ecocup.table.time-of-rent.relative")(t)};return[{title:l.getText("pisell2.text.ecocup.table.cup-code"),dataIndex:"eco_cup_code",key:"eco_cup_code",align:"center",width:170,render:(e,t)=>e||(null==t?void 0:t.code)||""},{title:l.getText("pisell2.text.ecocup.table.customer"),dataIndex:"customer",key:"customer",align:"center",hidden:i,with:220,render:(e,t)=>{var l;return(null==t||null==(l=t.customer)?void 0:l.display_name)||""}},{title:l.getText("pisell2.text.ecocup.table.status"),dataIndex:"status",key:"status",align:"center",width:120,render:e=>{let t=eJH[e],a=eJq[e];return(0,ev.jsx)("div",{className:`${eJG}-table-status`,style:{backgroundColor:null==a?void 0:a.backgroundColor,color:null==a?void 0:a.color,border:`1px solid ${null==a?void 0:a.border}`},children:l.getText(t)})}},{title:l.getText("pisell2.text.ecocup.table.shop-of-rent"),dataIndex:"rent_shop",key:"rent_shop",align:"center",hidden:i,width:200,render:(e,t)=>{var l;return(null==t||null==(l=t.rent_shop)?void 0:l.name)||""}},{title:l.getText("pisell2.text.ecocup.table.time-of-rent"),dataIndex:"rent_time",key:"rent_time",align:"center",hidden:i,width:160,render:e=>e?(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(0,ev.jsx)("span",{children:em()(e).format("DD/MM/YYYY")}),(0,ev.jsx)("span",{children:n(e)})]}):""},{title:l.getText("pisell2.text.ecocup.table.shop-of-return"),dataIndex:"return_shop",key:"return_shop",align:"center",hidden:i,width:200,render:(e,t)=>{var l;return(null==t||null==(l=t.return_shop)?void 0:l.name)||""}},{title:l.getText("pisell2.text.ecocup.table.time-of-return"),dataIndex:"return_time",key:"return_time",align:"center",hidden:i,width:160,render:e=>e?em()(e).format("DD/MM/YYYY"):""},{title:l.getText("pisell2.text.ecocup.rent"),dataIndex:"rent_shop",key:"rent_shop",align:"center",hidden:!i,width:160,render:(e,t)=>{var l,a;return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(null==t||null==(l=t.rent_shop)?void 0:l.name)?(0,ev.jsx)("span",{children:null==t||null==(a=t.rent_shop)?void 0:a.name}):null,(null==t?void 0:t.rent_time)?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{children:em()(null==t?void 0:t.rent_time).format("DD/MM/YYYY")}),(0,ev.jsx)("span",{children:n(null==t?void 0:t.rent_time)})]}):null]})}},{title:l.getText("pisell2.text.ecocup.action.return"),dataIndex:"return_shop",key:"return_shop",align:"center",hidden:!i,width:160,render:(e,t)=>{var l,a;return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[(null==t||null==(l=t.return_shop)?void 0:l.name)?(0,ev.jsx)("span",{children:null==t||null==(a=t.return_shop)?void 0:a.name}):null,(null==t?void 0:t.return_time)?(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("span",{children:em()(null==t?void 0:t.return_time).format("DD/MM/YYYY")}),(0,ev.jsx)("span",{children:n(null==t?void 0:t.return_time)})]}):null]})}},{title:l.getText("pisell2.text.ecocup.table.actions"),dataIndex:"actions",key:"actions",hidden:i||a,width:180,render:(e,a)=>{let i=(null==a?void 0:a.status)||"";return(null==a?void 0:a.shop_id)===(null==a?void 0:a.current_shop_id)||(null==a?void 0:a.eco_cup_id)?(0,ev.jsxs)("div",{className:`${eJG}-table-actions`,children:["rent"===i?(0,ev.jsx)(lL.Button,{type:"primary",onClick:()=>t("return",a),children:l.getText("pisell2.text.ecocup.action.return")}):null,["in_stock","rent"].includes(i)?(0,ev.jsx)(eJI,{locales:l,onClick:e=>t(e,a)}):null]}):null}}]})({onClickAction:(0,ef.useCallback)((e,t)=>{c.open({data:{type:e,cupData:t,customerData:(null==t?void 0:t.customer)||{}},onCancel:c.close,onOk:e=>{c.close(),C()}})},[c]),locales:eN,isEcoShare:g}),P=(n=(0,ef.useMemo)(()=>[{key:"cup-rent",title:N?eN.getText("pisell2.text.ecocup.cup-rent"):eN.getText("pisell2.text.ecocup.eco.cup-rent"),value:(null==_?void 0:_.rent_count)||0,type:"primary"},{key:"cup-returned",title:N?eN.getText("pisell2.text.ecocup.cup-returned"):eN.getText("pisell2.text.ecocup.eco.cup-returned"),value:(null==_?void 0:_.return_count)||0,type:"primary"},{key:"available-to-rent",title:eN.getText("pisell2.text.ecocup.available-to-rent"),value:(null==_?void 0:_.in_stock_count)||0}],[_,N]),(0,ef.useMemo)(()=>()=>(0,ev.jsx)(lL.Row,{gutter:8,className:`${eJQ}-summary`,children:n.map(e=>(0,ev.jsx)(lL.Col,{span:8,children:(0,ev.jsx)(lL.Card,{className:`${eJQ}-summary-card ${(null==e?void 0:e.type)==="primary"?`${eJQ}-summary-primary`:""}`,children:(0,ev.jsx)(lL.Statistic,{title:e.title,value:e.value,className:`${eJQ}-summary-card-statistic`})})},e.key))}),[n])),{run:A}=ns((e,t)=>{var l,a,i;let n=null==t||null==(l=t.order_by)?void 0:l.split(":"),s={...(null==t?void 0:t.filters)||{},order_by:null==n?void 0:n[0],sort:null==n?void 0:n[1],skip:(null==t||null==(a=t.pagination)?void 0:a.page)||1,num:(null==t||null==(i=t.pagination)?void 0:i.size)||10,partner_shop_id:(null==t?void 0:t.partner_shop_id)||void 0,status:(null==t?void 0:t.status)||void 0};v(e=>({...e,...s}))},{wait:200}),D=(e,t)=>{"search"===t?v(t=>({...t,search:e,skip:1})):(d(e),v(t=>{var l,a;return{...t,skip:1,operated_at_start:null==e||null==(l=e[0])?void 0:l.format(eJX),operated_at_end:null==e||null==(a=e[1])?void 0:a.format(eJX)}}))},I=(0,ef.useMemo)(()=>({pageSize:10,total:(null==x?void 0:x.count)||0,size:"large",current:(null==h?void 0:h.skip)||1,localPagination:!1}),[null==x?void 0:x.count,null==h?void 0:h.skip]),E=i0(e=>{"export"===e?S({isPartner:N,listParams:h}):"share"===e&&M()}),z=(0,ef.useMemo)(()=>u||g?null:(0,ev.jsx)("div",{className:`${eJZ}-header-right-content`,children:eJW.map(e=>(0,ev.jsx)(lL.Button,{type:e.type,size:"large",icon:(0,ev.jsx)(lL.Icon,{type:e.icon,size:22}),onClick:()=>E(e.key),className:`${eJZ}-header-right-content-button`,children:eN.getText(e.languageKey)},e.key))}),[u,E,g]);return(0,ev.jsxs)("div",{className:`${eJZ}-container`,children:[(0,ev.jsx)(lL.Page,{style:{height:"100%"},children:(0,ev.jsx)(lL.Table,{dataSource:(null==x?void 0:x.list)||[],columns:T,title:p?null:(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)(eJJ,{title:eN.getText("pisell2.text.ecocup.title"),rightContent:z,isReturn:!g}),(0,ev.jsxs)("div",{className:`${eJZ}-header`,children:[(0,ev.jsx)(lL.DatePicker.RangePicker,{inputReadOnly:!0,bordered:!1,allowClear:!1,size:"large",suffixIcon:(0,ev.jsx)(cU,{}),value:o,onChange:D,format:"DD/MM/YYYY",className:`${eJZ}-date-picker`}),(0,ev.jsx)(eJT,{scanListenerKey:"eco-cup-list-scan-listener",size:"small",placeholder:eN.getText("pisell2.text.ecocup.scan-or-search"),onSearch:e=>D(e,"search")})]})]}),align:"center",pagination:I,columnSetting:p?null:eJU,sort:p?null:eJY,filter:p?null:(a=null==h?void 0:h.skip,s=N?eJV:eJV.filter(e=>"shop_changed"!==e.value),r=[{name:eN.getText("pisell2.text.ecocup.status.all"),id:0}].concat(w||[]),{show:!0,quickFilterMaxLength:3,currentPagination:a||1,list:[{key:"status",type:"select",columnKey:"",isCustom:!0,name:"status",sort:!0,localFilter:!1,other:{size:"large",allowClear:!0,showSearch:!1,placeholder:eN.getText("pisell2.text.ecocup.status.placeholder"),defaultValue:0,options:s.map(e=>({label:eN.getText(e.label),value:e.value})),style:{width:240}}},{key:"partner_shop_id",type:"select",columnKey:"",isCustom:!0,name:"partner_shop_id",sort:!0,localFilter:!1,isHidden:u,other:{size:"large",allowClear:!0,showSearch:!1,placeholder:eN.getText("pisell2.text.ecocup.status.shop.placeholder"),defaultValue:0,options:r.map(e=>({label:(null==e?void 0:e.name)||"",value:e.id})),style:{width:240}}}]}),summary:p?null:P,className:`${eJZ}-table`,rowClassName:`${eJZ}-table-row`,loading:y,onValuesChange:A,rowKey:"id",virtual:!1,tableLayout:"",scroll:{scrollToFirstRowOnChange:!0,autoCalc:!0}})}),c.visible&&(0,ev.jsx)(eJD,{...c.modalProps})]})},eJ2={show:!0,list:[{columnKey:"display_name",key:"display_name",type:"string",localFilter:!1},{columnKey:"create_time",key:"create_time",type:"date",localFilter:!1}]},eJ1={show:!0,storageMode:"localStorage"};function eJ4(e){let t=LG()||"en",[l,a]=(0,ef.useState)({skip:1,num:20});eN.init(eJw,t);let i=eJy("ecocup-customer-list-modal"),{loading:n,data:s,run:r}=(()=>{let[e,t]=(0,ef.useState)(!1),[l,a]=(0,ef.useState)({}),{get:i}=eJx(),{goalShopId:n}=eJb();return{loading:e,data:l,run:(0,ef.useCallback)(async e=>{try{t(!0);let l={with_cup_count_flag:1,goal_shop_id:n,...e},s=await i("/shop/wallet/eco/customer",l);a((null==s?void 0:s.data)||{}),t(!1)}catch(e){t(!1)}},[])}})(),o=(0,ef.useCallback)(e=>{r({...l,...e})},[l]);(0,ef.useEffect)(()=>{o()},[o]);let d=[{title:eN.getText("pisell2.text.ecocup.customer.list.customer"),dataIndex:"display_name",key:"display_name",align:"center",width:240},{title:eN.getText("pisell2.text.ecocup.customer.list.registed"),dataIndex:"create_time",key:"create_time",align:"center",width:200,render:e=>e?em()(e).format("h:mma D MMM YYYY"):""},{title:eN.getText("pisell2.text.ecocup.customer.list.mobile"),dataIndex:"phone",key:"phone",align:"center",width:250},{title:eN.getText("pisell2.text.ecocup.customer.list.email"),dataIndex:"email",key:"email",align:"center",width:250},{title:eN.getText("pisell2.text.ecocup.customer.list.cup.borrowed"),dataIndex:"total_rent_count",key:"total_rent_count",align:"center",width:160},{title:eN.getText("pisell2.text.ecocup.customer.list.cup.returned"),dataIndex:"total_return_count",key:"total_return_count",align:"center",width:160}],{run:c}=ns((e,t)=>{var l,i,n;let s=null==t||null==(l=t.order_by)?void 0:l.split(":"),r={...(null==t?void 0:t.filters)||{},order_by:null==s?void 0:s[0],sort:null==s?void 0:s[1],skip:(null==t||null==(i=t.pagination)?void 0:i.page)||1,num:(null==t||null==(n=t.pagination)?void 0:n.size)||20};a(e=>({...e,...r}))},{wait:200});return(0,ev.jsxs)("div",{className:"ecocup-customer-list-container",children:[(0,ev.jsx)(lL.Table,{dataSource:(null==s?void 0:s.list)||[],columns:d,align:"center",title:(0,ev.jsx)(eJJ,{title:eN.getText("pisell2.text.ecocup.customer.list.title")}),pagination:{pageSize:20,total:(null==s?void 0:s.count)||0,size:"large"},columnSetting:eJ1,sort:eJ2,filter:{show:!0,quickFilterMaxLength:3,list:[{key:"search",type:"search",columnKey:"",sort:!0,localFilter:!1,isCustom:!0,name:"search",other:{size:"large",allowClear:!0,placeholder:eN.getText("pisell2.text.ecocup.customer.list.search.placeholder"),trigger:["onChange","onPressEnter"],style:{width:240}}}]},loading:n,onValuesChange:c,rowKey:"id",virtual:!1,tableLayout:"",scroll:{scrollToFirstRowOnChange:!0,autoCalc:!0},onRow:e=>({style:{cursor:"pointer"},onClick:()=>{i.open({title:eN.getText("pisell2.text.ecocup.customer.list.customer.profile"),data:{customerData:e,firstType:"customer"}})}})}),i.visible&&(0,ev.jsx)(eJz,{...i.modalProps})]})}let eJ3=e=>({nil:e.getText("pisell2.orderList.deliveryType.nil"),shipping:e.getText("pisell2.orderList.deliveryType.shipping"),local_delivery:e.getText("pisell2.orderList.deliveryType.local_delivery"),pickup:e.getText("pisell2.orderList.deliveryType.pickup"),shop_service:e.getText("pisell2.orderList.deliveryType.shop_service")}),eJ8=e=>({open:e.getText("pisell2.orderList.orderStatus.open"),completed:e.getText("pisell2.orderList.orderStatus.completed"),cancelled:e.getText("pisell2.orderList.orderStatus.cancelled")}),eJ6={open:{borderColor:"#1570EF",textColor:"#175CD3"},completed:{borderColor:"#079455",textColor:"#067647"},cancelled:{borderColor:"#D92D20",textColor:"#B42318"}},eJ5=e=>({fulfilled:e.getText("pisell2.orderList.shippingStatus.falseulfilled"),unfulfilled:e.getText("pisell2.orderList.shippingStatus.unfulfilled"),fulfilling:e.getText("pisell2.orderList.shippingStatus.fulfilling"),partial_fulfilled:e.getText("pisell2.orderList.shippingStatus.partial_fulfilled")}),eJ7={fulfilling:{borderColor:"#DC6803",textColor:"#B54708"},unfulfilled:{borderColor:"#DC6803",textColor:"#B54708"},partial_fulfilled:{borderColor:"#088AB2",textColor:"#0E7090"},fulfilled:{borderColor:"#475467",textColor:"#344054"}},eJ9=e=>({authorized:e.getText("pisell2.orderList.paymentStatus.authorized"),paid:e.getText("pisell2.orderList.paymentStatus.paid"),partially_refunded:e.getText("pisell2.orderList.paymentStatus.partially_refunded"),payment_pending:e.getText("pisell2.orderList.paymentStatus.payment_pending"),refunded:e.getText("pisell2.orderList.paymentStatus.refunded"),unpaid:e.getText("pisell2.orderList.paymentStatus.unpaid"),voided:e.getText("pisell2.orderList.paymentStatus.voided"),payment_processing:e.getText("pisell2.orderList.paymentStatus.payment_processing")}),eZe={unpaid:"#B2DDFF",payment_processing:"#FEDF89",payment_pending:"#FEDF89",authorized:"#ABEFC6",paid:"#ABEFC6",refunded:"#FECDCA",partially_refunded:"#FCCEEE",voided:"#D0D5DD"},eZt=(e,t)=>t[e]||"",{useContainerContext:eZl}=lL.PisellDataSourceContainer,eZa=e=>{let{locales:t,setValueType:l,clearSelectedData:a}=e,{serverActions:{list:i}}=eZl(),n=ex.Form.useFormInstance();return(0,ev.jsx)(ex.Button,{icon:(0,ev.jsx)(MG,{}),onClick:()=>{n.resetFields(),i.onReset(),l(void 0),a()},children:t.getText("pisell2.orderList.common.reset")})},{useContainerContext:eZi}=lL.PisellDataSourceContainer,eZn=e=>{let{locales:t,valueType:l,setValueType:a}=e,i=ex.Form.useFormInstance(),{serverActions:n}=eZi(),{list:s}=n;return(0,ev.jsxs)("div",{style:{display:"flex",gap:"8px"},children:[(0,ev.jsx)(ex.Button,{type:"primary",ghost:1!==l,onClick:()=>{let e=em()(),t={orderDate:[e.startOf("day"),e.endOf("day")],payment_status:void 0};i.setFieldsValue(t),s.onSearch(t),a(1)},children:t.getText("pisell2.orderList.filterButton.todayOrders")}),(0,ev.jsx)(ex.Button,{type:"primary",ghost:2!==l,onClick:()=>{let e=em()(),t={orderDate:[e.startOf("day"),e.endOf("day")],payment_status:["payment_processing","unpaid"]};i.setFieldsValue(t),s.onSearch(t),a(2)},children:t.getText("pisell2.orderList.filterButton.todayPending")}),(0,ev.jsx)(ex.Button,{type:"primary",ghost:3!==l,onClick:()=>{let e=em()(),t={orderDate:[e.startOf("day"),e.endOf("day")],payment_status:["refunded","partially_refunded"]};i.setFieldsValue(t),s.onSearch(t),a(3)},children:t.getText("pisell2.orderList.filterButton.todayRefunds")}),(0,ev.jsx)(ex.Button,{type:"primary",ghost:4!==l,onClick:()=>{let e=em()(),t={orderDate:[e.subtract(6,"day").startOf("day"),e.endOf("day")],payment_status:void 0};i.setFieldsValue(t),s.onSearch(t),a(4)},children:t.getText("pisell2.orderList.filterButton.last7Days")})]})},{ColumnsSetting:eZs}=lL.PisellDataSourceContainer,eZr=e=>{let{locales:t,__id:l}=e,a=(0,ef.useMemo)(()=>{let e,l,a,i;return{otherFilter:(e=eJ8(t),l=eJ9(t),a=eJ5(t),i=eJ3(t),[{name:"status",type:"select",key:"status",label:t.getText("pisell2.orderList.filter.orderStatus.label"),other:{allowClear:!0,mode:"multiple",placeholder:t.getText("pisell2.orderList.filter.orderStatus.placeholder"),options:Object.entries(e).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"payment_status",type:"select",key:"payment_status",label:t.getText("pisell2.orderList.filter.paymentStatus.label"),other:{allowClear:!0,mode:"multiple",placeholder:t.getText("pisell2.orderList.filter.paymentStatus.placeholder"),options:Object.entries(l).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"shipping_status",type:"select",key:"shipping_status",label:t.getText("pisell2.orderList.filter.shippingStatus.label"),other:{allowClear:!0,mode:"multiple",placeholder:t.getText("pisell2.orderList.filter.shippingStatus.placeholder"),options:Object.entries(a).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"customer_id",type:"select",key:"customer_id",label:t.getText("pisell2.orderList.filter.customer.label"),other:{allowClear:!0,isSearchServer:!0,showSearch:!0,placeholder:t.getText("pisell2.orderList.filter.customer.placeholder"),options:e=>eVi(e).then(e=>e.map(e=>({label:e.display_name,value:e.id})))}},{name:"order_sales_channel",type:"select",key:"order_sales_channel",label:t.getText("pisell2.orderList.filter.salesChannel.label"),other:{allowClear:!0,mode:"multiple",placeholder:t.getText("pisell2.orderList.filter.salesChannel.placeholder"),options:()=>eVs().then(e=>e.map(e=>({label:e.name,value:e.code})))}},{name:"payment_methods",type:"select",key:"payment_methods",label:t.getText("pisell2.orderList.filter.paymentMethod.label"),other:{allowClear:!0,mode:"multiple",placeholder:t.getText("pisell2.orderList.filter.paymentMethod.placeholder"),options:()=>eVr().then(e=>Array.from(new Map(e.map(e=>[e.code,{label:e.name,value:e.code}])).values()))}},{name:"total_amount",type:"numberRange",key:"total_amount",label:t.getText("pisell2.orderList.filter.totalAmount.label"),other:{placeholder:t.getText("pisell2.orderList.filter.totalAmount.placeholder")}},{name:"tag_ids",type:"select",key:"tag_ids",label:t.getText("pisell2.orderList.filter.tags.label"),other:{allowClear:!0,mode:"multiple",isSearchServer:!0,showSearch:!0,placeholder:t.getText("pisell2.orderList.filter.tags.placeholder"),options:e=>eVn(e).then(e=>e.map(e=>({label:e.name,value:e.id})))}},{name:"shipping_type",type:"select",key:"shipping_type",label:t.getText("pisell2.orderList.filter.shippingType.label"),other:{allowClear:!0,mode:"multiple",placeholder:t.getText("pisell2.orderList.filter.shippingType.placeholder"),options:Object.entries(i).filter(e=>{let[t]=e;return!["nil","shop_service"].includes(t)}).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"delivery_zone_name",type:"text",key:"delivery_zone_name",label:t.getText("pisell2.orderList.filter.deliveryZone.label"),other:{placeholder:t.getText("pisell2.orderList.filter.deliveryZone.placeholder")}},{name:"location_id",type:"select",key:"location_id",label:t.getText("pisell2.orderList.filter.pickupLocation.label"),other:{allowClear:!0,placeholder:t.getText("pisell2.orderList.filter.pickupLocation.placeholder"),options:()=>eVd().then(e=>e.map(e=>({label:e.name,value:e.id})))}},{name:"shipping_order_number",type:"text",key:"shipping_order_number",label:t.getText("pisell2.orderList.filter.trackingNumber.label"),other:{placeholder:t.getText("pisell2.orderList.filter.trackingNumber.placeholder")}},{name:"logistics_company_id",type:"select",key:"logistics_company_id",label:t.getText("pisell2.orderList.filter.logistics.label"),other:{allowClear:!0,mode:"multiple",placeholder:t.getText("pisell2.orderList.filter.logistics.placeholder"),options:()=>eVo().then(e=>e.map(e=>({label:e.name,value:e.id})))}},{name:"zip",type:"text",key:"zip",label:t.getText("pisell2.orderList.filter.zipCode.label"),other:{placeholder:t.getText("pisell2.orderList.filter.zipCode.placeholder")}}])}},[t]),i=(0,ef.useMemo)(()=>[{type:"string",isCustom:!1,name:"shop_full_order_number",label:t.getText("pisell2.orderList.sort.orderNumber")},{type:"time",isCustom:!1,name:"created_at",label:t.getText("pisell2.orderList.sort.createdAt")},{type:"time",isCustom:!1,name:"updated_at",label:t.getText("pisell2.orderList.sort.updatedAt")},{type:"string",isCustom:!1,name:"customer_name",label:t.getText("pisell2.orderList.sort.customerName")},{type:"date",isCustom:!1,name:"payment_status",label:t.getText("pisell2.orderList.sort.paymentStatus")},{type:"date",isCustom:!1,name:"shipping_status",label:t.getText("pisell2.orderList.sort.shippingStatus")},{type:"number",isCustom:!1,name:"total_amount",label:t.getText("pisell2.orderList.sort.totalAmount")},{type:"time",isCustom:!1,name:"delivery_start_at",label:t.getText("pisell2.orderList.sort.deliveryStartAt")}],[t]);return(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)(eZs,{__id:l}),(0,ev.jsx)(lL.PisellSort,{hasForm:!1,list:i}),(0,ev.jsx)(lL.PisellFilter,{placement:"bottomLeft",hasForm:!1,value:a})]})},eZo=e=>{let{locales:t}=e,l=(0,ef.useMemo)(()=>[{name:"orderDate",type:"rangePicker",key:"orderDate",label:t.getText("pisell2.orderList.quickFilter.orderDate.label"),other:{placeholder:t.getText("pisell2.orderList.quickFilter.orderDate.placeholder")}},{name:"keyword",type:"search",key:"keyword",other:{allowClear:!0,placeholder:t.getText("pisell2.orderList.quickFilter.keyword.placeholder"),trigger:["onChange"],style:{width:"400px"}}}],[t]);return(0,ev.jsx)(lL.PisellQuickFilter,{hasForm:!1,filterList:l})},{useContainerContext:eZd}=lL.PisellDataSourceContainer,eZc=e=>{let{locales:t,clearSelectedData:l,__id:a}=e,{serverActions:i,refManager:n,...s}=eZd(),[r,o]=(0,ef.useState)(void 0);return(0,ev.jsx)(ex.Form,{size:"large",layout:"vertical",initialValues:{orderDate:[em()().startOf("day"),em()().endOf("day")]},...s,children:(0,ev.jsx)(lL.PisellToolBar,{topLeft:(0,ev.jsx)(eZo,{locales:t}),topRight:(0,ev.jsx)(eZa,{locales:t,setValueType:o,clearSelectedData:l}),bottomLeft:(0,ev.jsx)(eZn,{valueType:r,setValueType:o,locales:t}),bottomRight:(0,ev.jsx)(eZr,{locales:t,__id:a})})})},{useContainerContext:eZu}=lL.PisellDataSourceContainer,eZp=e=>{let{selectedKeys:t,selectedRows:l,onClearSelection:a,locales:i}=e,n=ik(),[s,r]=(0,ef.useState)({}),{serverActions:{list:o}}=eZu(),d=(0,ef.useCallback)(e=>{o.refresh(),a()},[a]),c=(0,ef.useCallback)((e,t)=>{},[]),u=(0,ef.useCallback)(async(e,t)=>{let l=!0;lL.PisellModal.confirm({title:i.getText("pisell2.orderList.batchAction.ship.title")(e.length),cancelText:i.getText("pisell2.orderList.batchAction.button.cancel"),okText:i.getText("pisell2.orderList.batchAction.button.ok"),content:(0,ev.jsxs)("div",{children:[(0,ev.jsx)("p",{children:i.getText("pisell2.orderList.batchAction.ship.content")}),(0,ev.jsx)(ex.Checkbox,{defaultChecked:!0,onChange:e=>{l=e.target.checked},children:i.getText("page.order.fa.check")})]}),onOk:async()=>{try{r(e=>({...e,ship:!0})),await eVu({ids:e,is_notice:+!!l}),d()}catch(e){c()}finally{r(e=>({...e,ship:!1}))}}})},[d,c]),p=(0,ef.useCallback)(async(e,t)=>{lL.PisellModal.confirm({title:i.getText("page.order.table.list.button.send.invoice.tip"),cancelText:i.getText("pisell2.orderList.batchAction.button.cancel"),okText:i.getText("pisell2.orderList.batchAction.button.ok"),onOk:async()=>{try{r(e=>({...e,invoice:!0})),await eVp({order_ids:e}),d()}catch(e){c()}finally{r(e=>({...e,invoice:!1}))}}})},[d,c]),m=(0,ef.useCallback)((e,t)=>{var l,a;let i=null==(a=JSON.parse(window.app.data.storage.getStorage("core")))||null==(l=a.mypisell_data)?void 0:l.shop_id;i&&eVg({host:"",shop_id:i,ids:e})},[n]),g=(0,ef.useCallback)((e,t)=>{var l,a;let i=null==(a=JSON.parse(window.app.data.storage.getStorage("core")))||null==(l=a.mypisell_data)?void 0:l.shop_id;i&&eVh({host:"",shop_id:i,ids:e})},[n]),h=(0,ef.useCallback)(async(e,t)=>{let l=[];lL.PisellModal.confirm({title:i.getText("pisell2.orderList.batchAction.addTags.title")(e.length),width:520,cancelText:i.getText("pisell2.orderList.batchAction.button.cancel"),okText:i.getText("pisell2.orderList.batchAction.button.ok"),content:(0,ev.jsxs)("div",{style:{paddingTop:16},children:[(0,ev.jsx)("div",{style:{marginBottom:8,color:"#666"},children:i.getText("pisell2.orderList.column.tags")}),(0,ev.jsx)(lL.PisellQuickFilter,{hasForm:!1,filterList:[{name:"tag_ids",type:"select",key:"tag_ids",label:i.getText("pisell2.orderList.filter.tags.label"),other:{allowClear:!0,mode:"multiple",isSearchServer:!0,showSearch:!0,onChange:(e,t)=>{l=t.map(e=>e.label)},style:{width:"470px"},placeholder:i.getText("pisell2.orderList.filter.tags.placeholder"),options:e=>eVn(e).then(e=>e.map(e=>({label:e.name,value:e.id})))}}]})]}),onOk:async()=>{try{r(e=>({...e,addTags:!0})),await eVv({name:l,ids:e}),d()}catch(e){c()}finally{r(e=>({...e,addTags:!1}))}}})},[d,c]),v=(0,ef.useCallback)(async(e,t)=>{let l=[];lL.PisellModal.confirm({title:i.getText("pisell2.orderList.batchAction.removeTags.title")(e.length),width:520,cancelText:i.getText("pisell2.orderList.batchAction.button.cancel"),okText:i.getText("pisell2.orderList.batchAction.button.ok"),content:(0,ev.jsxs)("div",{style:{paddingTop:16},children:[(0,ev.jsx)("div",{style:{marginBottom:8,color:"#666"},children:i.getText("pisell2.orderList.column.tags")}),(0,ev.jsx)(lL.PisellQuickFilter,{hasForm:!1,filterList:[{name:"tag_ids",type:"select",key:"tag_ids",label:i.getText("pisell2.orderList.filter.tags.label"),other:{allowClear:!0,mode:"multiple",isSearchServer:!0,showSearch:!0,onChange:(e,t)=>{l=t.map(e=>e.label)},style:{width:"470px"},placeholder:i.getText("pisell2.orderList.filter.tags.placeholder"),options:e=>eVn(e).then(e=>e.map(e=>({label:e.name,value:e.id})))}}]})]}),onOk:async()=>{try{r(e=>({...e,removeTags:!0})),await eVf({name:l,ids:e}),d()}catch(e){c()}finally{r(e=>({...e,removeTags:!1}))}}})},[d,c]),f=(0,ef.useCallback)(async(e,t)=>{let l=null==t?void 0:t.filter(e=>"open"===e.status).length,a=null==t?void 0:t.filter(e=>"completed"===e.status).length,n=null==t?void 0:t.filter(e=>"cancelled"===e.status).length;lL.PisellModal.confirm({title:i.getText("page.order.cancel.title")(i.getText("pisell2.orderList.orderStatus.open")),cancelText:i.getText("pisell2.orderList.batchAction.button.cancel"),okText:i.getText("pisell2.orderList.batchAction.button.ok"),content:i.getText("page.order.lists.cancel.content")(l,a,n,i.getText("pisell2.orderList.orderStatus.completed"),!0,"void"),onOk:async()=>{try{r(e=>({...e,markAsOpen:!0})),await eVy({order_ids:e,status:"open"}),d()}catch(e){c()}finally{r(e=>({...e,markAsOpen:!1}))}}})},[d,c]),y=(0,ef.useCallback)(async(e,t)=>{let l=null==t?void 0:t.filter(e=>"open"===e.status).length,a=null==t?void 0:t.filter(e=>"completed"===e.status).length,n=null==t?void 0:t.filter(e=>"cancelled"===e.status).length;lL.PisellModal.confirm({title:i.getText("page.order.cancel.title")(i.getText("pisell2.orderList.orderStatus.completed")),cancelText:i.getText("pisell2.orderList.batchAction.button.cancel"),okText:i.getText("pisell2.orderList.batchAction.button.ok"),content:i.getText("page.order.lists.cancel.content")(l,a,n,i.getText("pisell2.orderList.orderStatus.open"),!0,""),onOk:async()=>{try{r(e=>({...e,markAsCompleted:!0})),await eVy({order_ids:e,status:"completed"}),d()}catch(e){c()}finally{r(e=>({...e,markAsCompleted:!1}))}}})},[d,c]),x=(0,ef.useCallback)(async(e,t)=>{let l=null==t?void 0:t.filter(e=>"open"===e.status).length,a=null==t?void 0:t.filter(e=>"completed"===e.status).length,n=null==t?void 0:t.filter(e=>"cancelled"===e.status).length,o=async t=>{try{r(e=>({...e,markAsCancelled:!0})),await eVy({order_ids:e,status:"cancelled",...1===t&&{is_void:t}}),d(),u.destroy()}catch(e){c()}finally{r(e=>({...e,markAsCancelled:!1}))}},u=lL.PisellModal.confirm({title:i.getText("page.order.cancel.title")(i.getText("pisell2.orderList.orderStatus.cancelled")),content:i.getText("page.order.lists.cancel.content")(l,a,n,i.getText("pisell2.orderList.orderStatus.cancelled"),!0,""),cancelText:i.getText("pisell2.orderList.batchAction.button.cancel"),footer:()=>(0,ev.jsxs)("div",{style:{display:"flex",gap:10,justifyContent:"flex-end",width:"100%"},children:[(0,ev.jsx)(ex.Button,{onClick:()=>u.destroy(),children:i.getText("pisell2.orderList.batchAction.button.cancel")},"cancel"),(0,ev.jsx)(ex.Button,{onClick:()=>o(0),loading:s.markAsCancelled,children:i.getText("pisell2.orderList.batchAction.button.onlyCancel")},"only-cancel"),(0,ev.jsx)(ex.Button,{type:"primary",onClick:()=>o(1),loading:s.markAsCancelled,children:i.getText("pisell2.orderList.batchAction.button.cancelAndVoid")},"cancel-void")]})})},[d,c,s.markAsCancelled]),b=(0,ef.useMemo)(()=>[{key:"ship",label:i.getText("page.order.table.shipping_status.mark.fulfilled"),icon:"pisell2-check-circle-broken",loading:s.ship,onClick:u},{key:"invoice",label:i.getText("page.order.table.list.button.send.invoice"),icon:"pisell2-sticker-square",loading:s.invoice,onClick:p},{key:"print-pack",label:i.getText("page.order.table.list.printpack"),icon:"pisell2-cube-01",onClick:m},{key:"print-picking",label:i.getText("page.order.table.list.printpink"),icon:"pisell2-package",onClick:g},{key:"add-tags",label:i.getText("page.order.text.addtags.button"),icon:"pisell2-tag-01",loading:s.addTags,onClick:h},{key:"remove-tags",label:i.getText("page.order.table.list.deletetag"),icon:"pisell2-tag-01",loading:s.removeTags,onClick:v},{key:"mark-as-open",label:i.getText("page.order.open"),icon:"pisell2-clipboard",loading:s.markAsOpen,onClick:f},{key:"mark-as-completed",label:i.getText("page.order.completeds"),icon:"pisell2-clipboard-check",loading:s.markAsCompleted,onClick:y},{key:"mark-as-cancelled",label:i.getText("page.order.cancelleds"),icon:"pisell2-slash-circle-01",loading:s.markAsCancelled,onClick:x}],[s.ship,s.invoice,s.addTags,s.removeTags,s.markAsOpen,s.markAsCompleted,s.markAsCancelled,s.markAsVoid,u,p,m,g,h,v,f,y,x,i]);return 0===t.length?null:(0,ev.jsx)(lL.PisellBatchActionBar,{selectedKeys:t,selectedRows:l,position:"float",offset:24,overflowThreshold:2,defaultActions:{showDefaultActions:!1},actions:b})},eZm=e=>{var t,l,a,i,n,s,r;let{biz:o,style:d,className:c,__id:u}=e,p=ik();eN.init(eVJ,(null==p||null==(l=p.engine)||null==(t=l.props)?void 0:t.locale)||"en");let m=(0,ef.useMemo)(()=>[{title:eN.getText("pisell2.orderList.column.orderNumber"),dataIndex:"shop_full_order_number",key:"shop_full_order_number",width:100,render:(e,t)=>{let{note:l}=t||{};return(0,ev.jsxs)("div",{className:"order-id-cell",children:[(0,ev.jsx)("span",{className:"order-id-link",children:e}),l&&(0,ev.jsx)(ex.Tooltip,{title:(0,ev.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:l}),children:(0,ev.jsx)("span",{className:"order-id-link-badge cursor-pointer",children:eN.getText("pisell2.orderList.common.note")})})]})}},{title:eN.getText("pisell2.orderList.column.customerInfo"),dataIndex:"customer",key:"customer",width:200,render:(e,t)=>{let{email:l,phone:a}=e||{},i=(null==e?void 0:e.customer_name)||(null==t?void 0:t.customer_name);return(null==e?void 0:e.guest_code)?(0,ev.jsx)("div",{className:"compound-cell",children:(0,ev.jsx)("div",{className:"title",children:eN.getText("pisell2.orderList.common.guest")})}):(0,ev.jsxs)("div",{className:"compound-cell",children:[(0,ev.jsx)("div",{className:"title",children:i||"-"}),(0,ev.jsx)("div",{className:"subtitle",children:a||"-"}),(0,ev.jsx)("div",{className:"subtitle",children:l||"-"})]})}},{title:eN.getText("pisell2.orderList.column.contactInfo"),dataIndex:"contacts_info",key:"contacts_info",width:200,render:(e,t)=>{let{first_name:l,last_name:a,display_name:i,phone:n,email:s}=(null==e?void 0:e.value)||{},{country_calling_code:r,country_code:o,phone:d}=n||{},c=i||`${l||""} ${a||""}`;return(0,ev.jsxs)("div",{className:"compound-cell",children:[(0,ev.jsx)("div",{className:"title",children:`${c||"-"}`}),(0,ev.jsx)("div",{className:"subtitle",children:d||"-"}),(0,ev.jsx)("div",{className:"subtitle",children:s||"-"})]})}},{title:eN.getText("pisell2.orderList.column.tags"),dataIndex:"tag",key:"tag",width:200,render:e=>Array.isArray(e)?(0,ev.jsx)("div",{className:"tags-container",children:e.map((e,t)=>(0,ev.jsx)(lL.PisellTags,{children:e.name},t))}):"-"},{title:eN.getText("pisell2.orderList.column.deliveryMethod"),dataIndex:"delivery_type",key:"delivery_type",width:160,render:(e,t)=>{let{shop_service_type:l}=t.metadata||{},a={"dine-in":eN.getText("pisell2.orderList.shopServiceType.dine-in"),takeaway:eN.getText("pisell2.orderList.shopServiceType.takeaway")},i=eJ3(eN),n=null;return"shop_service"===e&&(n=eZt(null==l?void 0:l.server_type,a)),(n=eZt(e,i))?(0,ev.jsx)(lL.PisellTags,{style:{whiteSpace:"nowrap"},children:n}):"-"}},{title:eN.getText("pisell2.orderList.column.paymentInfo"),dataIndex:"payment_status",key:"payment_status",width:140,render:(e,t)=>{var l;let a=eJ9(eN),i="partially_paid"===e?"unpaid":e,n=Number(t.total_amount||0),s=Number(t.paid_amount||0),r=Number(t.total_refund_amount||(null==t||null==(l=t.summary)?void 0:l.total_refund_amount)||0),o=Number(n-s).toFixed(2),d="";["payment_pending","payment_processing","unpaid"].includes(i)?d=`${eN.getText("pisell2.orderList.common.totalAmount")}: $${n.toFixed(2)}
|
|
111
111
|
${eN.getText("pisell2.orderList.common.unpaidAmount")}: $${o}`:"paid"===i?d=`${eN.getText("pisell2.orderList.common.totalAmount")}: $${n.toFixed(2)}
|
|
112
112
|
${eN.getText("pisell2.orderList.common.paidAmount")}: $${s.toFixed(2)}`:["partially_refunded","refunded"].includes(e)&&(d=`${eN.getText("pisell2.orderList.common.totalAmount")}: $${n.toFixed(2)}
|
|
113
113
|
${eN.getText("pisell2.orderList.common.paidAmount")}: $${s.toFixed(2)}
|
|
114
|
-
${eN.getText("pisell2.orderList.common.refundedAmount")}: $${r.toFixed(2)}`);let c=eZe[i]||"";return["voided","authorized"].includes(e)?(0,ev.jsx)(lL.PisellTags,{className:"cursor-pointer",style:{backgroundColor:c,whiteSpace:"nowrap"},children:eZt(i,a)||"-"}):(0,ev.jsx)(ex.Tooltip,{title:(0,ev.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:d}),children:(0,ev.jsx)(lL.PisellTags,{className:"cursor-pointer",style:{backgroundColor:c,whiteSpace:"nowrap"},children:eZt(i,a)})})}},{title:eN.getText("pisell2.orderList.column.orderChannel"),dataIndex:"order_sales_channel",key:"order_sales_channel",width:160,render:e=>eZt(e,{online_store:eN.getText("pisell2.orderList.platform.online_store"),wholesalebusiness:eN.getText("pisell2.orderList.platform.wholesalebusiness"),"table-order":eN.getText("pisell2.orderList.platform.table-order"),mobile_order:eN.getText("pisell2.orderList.platform.mobile_order"),kiosk:eN.getText("pisell2.orderList.platform.kiosk"),pos:eN.getText("pisell2.orderList.platform.pos")})||"-"},{title:eN.getText("pisell2.orderList.column.productQuantity"),dataIndex:"product_quantity",key:"product_quantity",width:180,isShow:!1,render:e=>`${Number(e||0)}${eN.getText("pisell2.orderList.common.itemsCount")}`},{title:eN.getText("pisell2.orderList.column.orderStatus"),dataIndex:"status",key:"status",width:140,isShow:!1,render:e=>{let t=eJ8(eN),l=eJ6[e],a={};return l&&(a={borderColor:l.borderColor,color:l.textColor,whiteSpace:"nowrap"}),(0,ev.jsx)(lL.PisellTags,{className:"cursor-pointer",style:a,children:eZt(e,t)||"-"})}},{title:eN.getText("pisell2.orderList.column.processStatus"),dataIndex:"shipping_status",key:"shipping_status",width:140,isShow:!1,render:e=>{let t=eJ5(eN),l=eJ7[e],a={};return l&&(a={borderColor:l.borderColor,color:l.textColor,whiteSpace:"nowrap"}),(0,ev.jsx)(lL.PisellTags,{className:"cursor-pointer",style:a,children:eZt(e,t)||"-"})}},{title:eN.getText("pisell2.orderList.column.createInfo"),dataIndex:"create_account",key:"create_account",isShow:!1,width:180,render:(e,t)=>{let{created_at:l,create_account_id:a}=t||{},{first_name:i,last_name:n}=e||{},s=`${i||""} ${n||""}`;return Number(a)>0&&(s=eN.getText("pisell2.orderList.filter.customer.label")),(0,ev.jsxs)("div",{className:"compound-cell",children:[(0,ev.jsx)("div",{className:"title",children:`${s||"-"}`}),(0,ev.jsx)("div",{className:"subtitle",children:l||"-"})]})}},{title:eN.getText("pisell2.orderList.column.moreInfo"),dataIndex:"last_edit_account",key:"last_edit_account",isShow:!1,width:180,render:e=>{if(e){let{account:t,created_at:l}=e||{},{display_name:a}=t||{};return(0,ev.jsxs)("div",{className:"compound-cell",children:[(0,ev.jsx)("div",{className:"title",children:`${a||"-"}`}),(0,ev.jsx)("div",{className:"subtitle",children:l||"-"})]})}return"-"}}],[eN]),g=(null==p||null==(a=p.appHelper)?void 0:a.utils)||{};z_.Em.setRequest(null==g?void 0:g.request);let h=null==(s=window)||null==(n=s.app)||null==(i=n.history)?void 0:i.useParams,[v,f]=(0,ef.useState)([]),[y,x]=(0,ef.useState)([]),b=null==h?void 0:h(),_=null==g||null==(r=g.getApp)?void 0:r.call(g),k=(0,ef.useMemo)(()=>({list:{business_code:o||(null==b?void 0:b.biz)}}),[e.biz,null==b?void 0:b.biz]),w=(0,ef.useMemo)(()=>({columns:m,bordered:!0,rowKey:"id",scroll:{x:"max-content"},size:"small",onRow:e=>({onClick:()=>{var t,l,a;let i=encodeURIComponent((null==_||null==(a=_.history)||null==(l=a.instance)||null==(t=l.location)?void 0:t.pathname)||"");_.history.push(`/order-detail?id=${e.id}&goback=${i}`)}}),rowSelection:{selectedRowKeys:v,onChange:(e,t)=>{f(e),x(t)}}}),[m,v]),j=(0,ef.useMemo)(()=>({locales:eN,selectedKeys:v,selectedRows:y,onClearSelection:()=>{f([]),x([])}}),[eN,v,y]),S=(0,ef.useCallback)(()=>{f([]),x([])},[]);return(0,ev.jsx)(lL.Page,{style:{height:"100%"},children:(0,ev.jsx)(lL.PisellDataSourceContainer,{dataSource:{key:"orderList"},actions:{list:eVa},pagination:!0,extraParams:k,children:(0,ev.jsxs)(lL.PisellGridPro,{style:{height:"100vh",...d},className:c,children:[(0,ev.jsx)(lL.PisellGridPro.Header,{title:eN.getText("pisell2.orderList.title")}),(0,ev.jsx)(eZc,{clearSelectedData:S,__id:u,locales:eN}),(0,ev.jsx)(lL.PisellGridView,{children:(0,ev.jsx)(lL.PisellDataSourceContainer.Table,{...w,__id:u})}),(0,ev.jsx)(eZp,{...j}),(0,ev.jsx)(lL.PisellGridPro.Footer,{children:(0,ev.jsx)(lL.PisellDataSourceContainer.Pagination,{})})]})})},k.list.business_code)},eZg=e=>{var t;let{detail:l,...a}=e;if(!l)return;let{discount_list:i}=l;return{rowKey:(e=>{var t,l,a,i,n,s;let r={...e},o=`${r.product_id}`,d=o;if(r.product_variant_id&&(d+=`_${r.product_variant_id}`),null==r||null==(l=r.product_sku)||null==(t=l.option)?void 0:t.length)for(let e of null==r||null==(i=r.product_sku)?void 0:i.option){let t=`_${e.option_group_id}_${e.product_option_item_id||e.option_group_item_id}`;d+=`${t}_${e.quantity||e.num}`}if(null==r||null==(a=r.product_bundle)?void 0:a.length)for(let e of r.product_bundle){let t=`_${e.bundle_group_id}_${e.bundle_product_id}`;if(d+=`${t}_${e.quantity||e.num}`,null==e?void 0:e.option)for(let t of e.option){let e=`_${t.option_group_id}_${t.product_option_item_id}`;o+=e,d+=`${e}_${t.quantity||t.num}`}}return(null==r?void 0:r.session)&&(d+=`_${null==r||null==(n=r.session)?void 0:n.key}`),(null==r?void 0:r.schedule)&&(d+=`_${null==r||null==(s=r.schedule)?void 0:s.key}`),d})(e),product_id:l.product_id,option:((null==l||null==(t=l.product_sku)?void 0:t.option)||[]).map(e=>({...e,price:e.price||e.add_price})),bundle:(l.product_bundle||[]).map(t=>{let l=(null==t?void 0:t.bundle_sum_type)==="markdown"?`-${Number(t.bundle_sum_price)}`:Number(t.bundle_sum_price),a=(i||[]).filter(e=>{var l,a;return(null==e||null==(l=e.metadata)?void 0:l.custom_product_bundle_map_id)===(null==(a=t.metadata)?void 0:a.custom_product_bundle_map_id)});return{...t,booking_id:e.id,title:t.bundle_title,discount_list:a,group_id:t.bundle_group_id,id:t.bundle_id,product_id:t.bundle_product_id,_bundle_product_id:t.bundle_product_id,bundle_variant_id:t.bundle_variant_id,quantity:t.num,option:t.option.map(e=>({...e,name:e.name.auto,quantity:t.num,product_option_item_id:e.option_group_item_id})),price:t.bundle_selling_price??l,original_total:t.bundle_selling_price??l,original_price:t.bundle_selling_price??l,product_price:t.bundle_selling_price??l}}),product_variant_id:l.product_variant_id||0,quantity:Number(l.product_quantity)}};function eZh(e,t){if(!e)return;let l=t.editModeInitialState||{};e.setState({bookingConfigParams:t.bookingConfigParams,...l})}let eZv=async(e,t)=>{var l,a,i,n,s,r;let o=await eCz({shop_id:null==e||null==(i=e.appHelper)||null==(a=i.utils)||null==(l=a.getData)?void 0:l.call(a,"shop_id"),data:{scope:"board",section_code:["reservation","fulfillment","menu"],target:`${t}+pos`}},{prefix:!1,headers:{"Tenant-Id":null==e||null==(r=e.appHelper)||null==(s=r.utils)||null==(n=s.getData)?void 0:n.call(s,"tenant_id")}});return(null==o?void 0:o.data)||{}};function eZf(e){var t,l,a,i,n,s,r,o,d,c,u;let{open:p,order_id:m,onClose:g,callback:h,rulesHooks:v,createModeConfig:f,variant:y}=e,{preloaded:x,preloadedEditData:b,onEditDataReady:_}=e,k=ik();if(!x&&!m&&!f){let e=(null==(d=k.engine)?void 0:d.props)||{};m=e.order_id,p=e.open,h=e.callback,v=e.rulesHooks}let[w,j]=(0,ef.useState)(""),{productExtensionType:S}=euo,M=(0,lL.useToast)(),N=(0,ef.useRef)(null),[C,T]=(0,ef.useState)(x&&b?b:null),[P,A]=(0,ef.useState)(0),D=(0,ef.useCallback)(e=>{T(e),A(e=>e+1)},[]),I=(0,ef.useRef)(b),E=(0,ef.useRef)(null);if(x&&b&&b!==I.current){let e=I.current,t=!!(null==(c=b.editModeInitialState)?void 0:c.isEditTicketMode),l=!!(null==e||null==(u=e.editModeInitialState)?void 0:u.isEditTicketMode),a=null!=e&&l!==t,i=!N.current||!C||a||!t;I.current=b,i?(E.current=null,T(b),A(e=>e+1)):E.current=b}(0,ef.useEffect)(()=>{let e=E.current;e&&N.current&&(E.current=null,e.editModeInitialState,eZh(N.current,e))},[b]);let z=EU();eN.init(eue,(null==(n=k.appHelper.utils)||null==(i=n.getApp)||null==(a=i.call(n))||null==(l=a.locales)||null==(t=l.getLocale)?void 0:t.call(l))||(null==(r=k.appHelper.utils)||null==(s=r.storage)?void 0:s.get("umi_locale"))||"en");let{interaction:L,getSymbolic:O}=(null==(o=k.appHelper)?void 0:o.utils)||{};(0,ef.useEffect)(()=>{if(!p){var e,t,l,a,i;if(x){if("u">typeof window)try{let e=null==(i=window)||null==(a=i.shopApi)||null==(l=a.bookingTicket)?void 0:l.clearAllCart;"function"==typeof e&&e()}catch(e){}}else D(null);null==L||null==(t=L.utils)||null==(e=t.postMessageToApp)||e.call(t,{module:"cds",key:"cartUpdate",data:{currency_symbol:null==O?void 0:O(),total:"0",products:[],fees:[]}})}},[p,D,x]),(0,ef.useLayoutEffect)(()=>{z_.Em.setRequest(k.appHelper.utils.request)},[]),(0,ef.useEffect)(()=>{if(!p)return;let t=!0;if(x&&!m&&b)return void j(e.title||eN.getText("pisell2.ticket-booking.new-booking"));if(!m&&f){let t={...euo.modalState,...f.initialModalState};j(e.title||eN.getText("pisell2.ticket-booking.new-booking")),D({bookingConfigParams:f.bookingConfigParams,productDisplayConfig:f.productDisplayConfig||"sku-list-a2",businessCode:f.businessCode??"",editModeInitialState:{bookingId:0,bookingDetail:null,isParallelResourcesBooking:!0,modalState:t,open:!0,isBookingTicket2:!0,isEditTicketMode:!1,dialogCallback:e=>{var t,l;null==h||h(e),null==L||null==(l=L.utils)||null==(t=l.postMessageToApp)||t.call(l,{module:"cds",key:"cartUpdate",data:{currency_symbol:null==O?void 0:O(),total:"0",products:[],fees:[]}})},...Array.isArray(f.associated_menu_list_ids)&&f.associated_menu_list_ids.length>0?{associated_menu_list_ids:f.associated_menu_list_ids}:{},...f.order_type?{order_type:f.order_type}:{}}});return}return x||D(null),async function(){var l,a,i,n,s,r,o,d,c,u,p,g,v;if(m){null==M||null==(l=M.loading)||l.call(M);try{let l,g=await $Z(m);try{null==z||null==(c=z.addLog)||c.call(z,{metadata:{bookingOrigin:JSON.stringify(g)},title:`TicketBookingDialog-getBookingDetail ${m}`})}catch(e){}if(!g.business_code){null==M||null==(u=M.close)||u.call(M),ex.Modal.error({title:eN.getText("pisell2.ticket-booking.business-not-supported.title"),content:eN.getText("pisell2.ticket-booking.business-not-supported.content"),onOk:()=>{null==h||h({type:"no-support-business"})}});return}if(!t)return;j(e.title||(null==g||null==(a=g.bookings)?void 0:a.booking_id)||(null==g?void 0:g.shop_full_order_number));let y={appointment_booking:{productDisplayConfig:"sku-list-a2",bookingConfigParams:{item_type:"appointment_booking",sub_type:"ticket",osKey:"edit"},order_type:"appointment_booking"},virtual:{productDisplayConfig:"sku-list-a5",bookingConfigParams:{item_type:"appointment_booking",sub_type:"food",source_type:"pos",osKey:"edit"},order_type:"virtual"},"table-order":{productDisplayConfig:"sku-list-a5",bookingConfigParams:{item_type:"appointment_booking",sub_type:"food",source_type:"pos",osKey:"edit"},order_type:"table-order"}},b=[],w=await eZv(k,g.business_code);null==w||null==(i=w["menu.associated_menus"])||i.forEach(e=>{b.push(Number(e.value))});let S=null==(n=y[null==g?void 0:g.type])?void 0:n.bookingConfigParams,C=null==(s=y[null==g?void 0:g.type])?void 0:s.productDisplayConfig,T=g.business_code||"",P=null==(r=y[null==g?void 0:g.type])?void 0:r.order_type;f&&(f.bookingConfigParams&&"object"==typeof f.bookingConfigParams&&(S=f.bookingConfigParams),f.productDisplayConfig&&(C=f.productDisplayConfig),null!=f.businessCode&&""!==String(f.businessCode).trim()&&(T=String(f.businessCode).trim()));let A=((e,t)=>{var l,a,i,n;let{customer_id:s,holder:r,customer_name:o,email:d,phone:c,country_calling_code:u,bookings:p,customer:m,note:g,payment_status:h,is_other_entrance_edited:v,shop_discount:f,contacts_info:y,relation_details:x=[]}=e;p||(p={list:[]});let b=((null==m?void 0:m.display_name)||"").trim()||((null==m?void 0:m.nickname)||"").trim()||o||"",_={name:b,nickname:b,id:s||(null==m?void 0:m.id)||(null==m?void 0:m.customer_id)||1,email:null==m?void 0:m.email,phone:(null==m?void 0:m.phone)||"",country_calling_code:(null==m?void 0:m.country_calling_code)||"",cover:(null==m?void 0:m.cover)||"",waiver_form:(null==m?void 0:m.waiver_form)||[],contacts_info:{value:y}},k=null==p||null==(a=p.list)||null==(l=a[0])?void 0:l.start_date,w=em()(k?k+" "+(null==p||null==(n=p.list)||null==(i=n[0])?void 0:i.start_time):new Date),j=p.list.map(e=>{var t,l,a,i,n,s,r,o;let d,{detail:c,product:u,...p}=e,m=c||mockProduct,g=em()(p.start_date+" "+p.start_time),h=em()(p.end_date+" "+p.end_time),v=em()(h).add(1,"minute"),f={};return(null==e||null==(l=e.metadata)?void 0:l.groupId)&&(f.duration=v.diff(g,"days")),{_id:(Math.random()+"").replace(/\D/g,"").substring(0,11),...m,duration:(null==m?void 0:m.duration)||(null==u?void 0:u.duration),"schedule.ids":(null==m?void 0:m["schedule.ids"])||(null==u?void 0:u["schedule.ids"]),booking_id:p.id,id:m.product_id,title:m.product_title,quantity:Number(m.product_quantity),cover:m.product_cover,price:Number(m.source_product_price),relation_form_name:p.relation_form_name,product_resource:null==u?void 0:u.product_resource,capacity:null==u?void 0:u.capacity,_extend:{...p,quantity:Number(m.product_quantity),startDate:g,start_date:g,endDate:h,end_date:h,holder_id:(null==p||null==(i=p.holder)||null==(a=i.form_record)?void 0:a[0])||[],price:Number(m.source_product_price),product_name:m.product_title,discount_reason:m.product_discount_reason,order_detail_id:m.order_detail_id,total:Number(m.selling_price),origin_total:Number(m.original_price),payment_price:Number(m.payment_price),main_product_selling_price:null==(t=m.metadata)?void 0:t.main_product_selling_price,other:eZg(e),bundle_edit:0,discount_per:m.discount_per,discount_type:m.discount_type,discountway:m.discountway,capacity:null==(n=p.metadata)?void 0:n.capacity,resource:(e=>{if(!e.relation_type)try{var t;if((null==e?void 0:e.event_resources)&&(null==e||null==(t=e.event_resources)?void 0:t.length))return e.event_resources.reduce((e,t)=>(e[t.form_id]?e[t.form_id].push(t):e[t.form_id]=[t],e),{})}catch(e){}return e.relation_id})(p),...f,...(d=0,(null==(r=e.holder)||null==(s=r.form_record)?void 0:s.length)&&(d=e.holder.form_record[0]),!d&&(d=null==(o=e.metadata)?void 0:o.holder_id),{...e.metadata||{},holder_id:d})}}});j=[...j||[],...(x||[]).map(e=>{var t;return{...e,_id:(Math.random()+"").replace(/\D/g,"").substring(0,11),id:e.product_id,title:e.product_title,quantity:e.product_quantity,cover:e.product_cover,price:Number(e.source_product_price),booking_id:e.order_id,isEditBooking:!0,_extend:{main_product_selling_price:null==(t=e.metadata)?void 0:t.main_product_selling_price,discount_reason:e.product_discount_reason,order_detail_id:e.order_detail_id,discount_per:e.discount_per,discount_type:e.discount_type,discountway:e.discountway,product_name:e.product_title,total:Number(e.selling_price),origin_total:Number(e.original_price),payment_price:Number(e.payment_price),price:Number(e.source_product_price),quantity:e.product_quantity,bundle_edit:0,other:eZg(e),startDate:em()(),endDate:em()(),note:e.note},payment_price:Number(e.payment_price)}})];let S=(e=>{let{shop_discount:t,bookings:l,payment_status:a}=e,i=Array.isArray(null==l?void 0:l.list)?l.list:[],n=null==l?void 0:l.appointment_status;return!!i.some(e=>!e.detail)||!("cancelled"!==n&&["unfulfilled","paid","partially_paid","unpaid","payment_processing"].includes(a))})(e);return{...t,client:{...t.client,value:_,edit:!1,showModal:!1},contacts_info:{...(null==t?void 0:t.contacts_info)||{},edit:!1,value:y,client_id:null==_?void 0:_.id},date:{...t.date,value:w,edit:!1,showModal:!1},addons:{...t.addons,load:!1},pet:{...t.pet,showModal:!1,edit:!1},service:{...t.service,value:j,resources:[],addModal:!1,editModal:!1,edit:!1},notes:{...t.notes,orderNote:g,edit:!1},disabledEdit:S,channelDisabledEdit:!1,appointment_status:null==p?void 0:p.appointment_status}})(g,euo.modalState);try{null==z||null==(p=z.addLog)||p.call(z,{metadata:{modalState:JSON.stringify(A)},title:`TicketBookingDialog-getBookingDetail_formatBookingDetail ${m}`})}catch(e){}A.service.value=(A.service.value||[]).map(e=>({...e,edit:!0})),A.service.edit=!0;let{paidAmount:I,paidAmountWithoutSurcharge:E}=(v=g,{paidAmount:(l=((null==v?void 0:v.payments)||[]).filter(e=>(null==e?void 0:e.status)==="paid")).reduce((e,t)=>e+Number(t.amount),0),paidAmountWithoutSurcharge:l.reduce((e,t)=>e+Number(t.amount)-Number(t.service_fee||0),0)}),R={bookingConfigParams:S,productDisplayConfig:C,businessCode:T,editModeInitialState:{bookingId:"",bookingDetail:g,isParallelResourcesBooking:!0,modalState:A,paymentPaid:{value:{paidAmount:I,paidAmountWithoutSurcharge:E}},open:!0,isBookingTicket2:!0,isEditTicketMode:!0,dialogCallback:e=>{var t,l;null==h||h(e),null==L||null==(l=L.utils)||null==(t=l.postMessageToApp)||t.call(l,{module:"cds",key:"cartUpdate",data:{currency_symbol:null==O?void 0:O(),total:"0",products:[],fees:[]}})},...f&&Array.isArray(f.associated_menu_list_ids)&&f.associated_menu_list_ids.length>0?{associated_menu_list_ids:f.associated_menu_list_ids}:(null==b?void 0:b.length)?{associated_menu_list_ids:b}:{},...(null==f?void 0:f.order_type)||P?{order_type:(null==f?void 0:f.order_type)||P}:{}}};if(null==M||null==(o=M.close)||o.call(M),!(null==A||null==(d=A.service)?void 0:d.value)||A.service.value.length<=0)return void ex.Modal.error({title:eN.getText("pisell2.ticket-booking.no-service.title"),content:eN.getText("pisell2.ticket-booking.no-service.content"),onOk:()=>{null==h||h({type:"no-support-business"})}});x&&N.current?eZh(N.current,R):D(R),null==_||_(R)}catch(e){console.error("[TicketBookingDialog] getBookingDetail failed",e),null==z||null==(g=z.addLog)||g.call(z,{metadata:{error:null==e?void 0:e.message},title:`TicketBookingDialog-getBookingDetail failed ${m}`}),ex.Modal.error({title:eN.getText("pisell2.ticket-booking.business-not-supported.title"),content:eN.getText("pisell2.ticket-booking.business-not-supported.content"),onOk:()=>{null==h||h({type:"no-support-business"})}})}}}(),()=>{t=!1}},[p,m,f,x,b,D]);let R="phone"===y,$=(0,ef.useCallback)(()=>{var e,t;null==L||null==(t=L.utils)||null==(e=t.postMessageToApp)||e.call(t,{module:"cds",key:"cartUpdate",data:{currency_symbol:null==O?void 0:O(),total:"0",products:[],fees:[]}}),null==h||h({type:"close"}),null==g||g()},[h,g]),F=(0,ef.useMemo)(()=>R?null:(0,ev.jsxs)("div",{className:"ticket-booking-dialog-body-top-slot",children:[(0,ev.jsx)("div",{className:"ticket-booking-dialog-body-top-content",children:(0,ev.jsx)("div",{className:"ticket-booking-dialog-body-top-title",title:String(w||""),children:w})}),(0,ev.jsx)("button",{type:"button",className:"ticket-booking-dialog-body-top-close","aria-label":"Close",onClick:$,children:(0,ev.jsx)(lL.Iconfont,{type:"pisell2-x-close"})})]}),[$,R,w]);return(0,ev.jsx)(iB,{renderType:R?"drawer":"modal",showHandlerBar:R,onHandlerBarClick:$,props:R?{open:p,onClose:$,placement:"bottom",title:void 0,width:"100%",height:"95%",className:"ticket-booking-dialog-drawer-phone",rootClassName:"ticket-booking-dialog-drawer-phone-root",destroyOnClose:!1,forceRender:!!x,maskClosable:!1,footer:null,closable:!1,bodyStyle:{padding:0,height:"100%"}}:{open:p,onCancel:$,title:null,width:"99%",className:"ticket-booking-dialog-modal",destroyOnClose:!1,forceRender:!!x,header:!1,maskClosable:!1,footer:null,closeIcon:null,wrapClassName:"ticket-booking-dialog-wrapper",size:"large",bodyStyle:{padding:0,height:"100%"}},children:C?(0,ev.jsx)(eud,{isActive:p,rulesHooks:v,bookingConfigParams:C.bookingConfigParams,productExtensionType:S,isShowMenuBar:!1,isShowTimeBar:!1,isShowFloatButtons:!1,isEditTicketMode:!!m,editModeInitialState:C.editModeInitialState,productDisplayConfig:C.productDisplayConfig,businessCode:C.businessCode,bodyTopSlot:F,storeRef:N},P):(0,ev.jsx)(ex.Skeleton,{round:!0,active:!0,loading:!0})})}eZf.displayName="TicketBookingDialog";let eZy=iW(eZf);function eZx(e){let t=Array.isArray(e)?e[0]:e;return(null==t?void 0:t.value)&&"object"==typeof t.value?t.value:t&&"object"==typeof t?t:{}}function eZb(e,t){let l=t||(null==e?void 0:e.last_edit_account)||(null==e?void 0:e.create_account)||(null==e?void 0:e.customer);if(l&&"object"==typeof l){let e=String((null==l?void 0:l.display_name)||(null==l?void 0:l.customer_name)||[null==l?void 0:l.first_name,null==l?void 0:l.last_name].filter(Boolean).join(" ")).trim();if(e)return{...l,display_name:e}}return(null==e?void 0:e.customer_name)||(null==e?void 0:e.phone)||(null==e?void 0:e.email)?{display_name:(null==e?void 0:e.customer_name)||"",phone:(null==e?void 0:e.phone)||"",country_calling_code:(null==e?void 0:e.country_calling_code)||"",email:(null==e?void 0:e.email)||""}:null}function eZ_(e){var t,l,a,i;let n=Number(null==e||null==(t=e.summary)?void 0:t.total_amount),s=Number(null==e?void 0:e.total_amount),r=Number.isFinite(n)?n:Number.isFinite(s)?s:0,o=(null==e||null==(l=e.summary)?void 0:l.customer_paid_amount)?Number(null==e||null==(a=e.summary)?void 0:a.customer_paid_amount):null,d=Number((null==e?void 0:e.total_refund_amount)||(null==e||null==(i=e.summary)?void 0:i.total_refund_amount)||0),c=Array.isArray(null==e?void 0:e.payments)?e.payments:[],u=c.reduce((e,t)=>{if(!["paid","captured","success","completed"].includes(String((null==t?void 0:t.status)||"").toLowerCase()))return e;let l=Number((null==t?void 0:t.amount)??(null==t?void 0:t.origin_amount)??0);return!Number.isFinite(l)||l<=0?e:e+l},0),p=c.reduce((e,t)=>{if(!["refunded","partially_refunded","refund"].includes(String((null==t?void 0:t.status)||"").toLowerCase()))return e;let l=Number((null==t?void 0:t.amount)??(null==t?void 0:t.origin_amount)??0);return!Number.isFinite(l)||l<=0?e:e+l},0),m=Number.isFinite(o)?o:u,g=Number.isFinite(d)?d:p,h=Math.max(r-m,0);return{totalAmount:r,paidAmount:m,refundedAmount:g,dueAmount:h}}let eZk=e=>{var t,l,a,i,n,s,r,o;let d=ik(),c=null==d||null==(t=d.appHelper)?void 0:t.utils,u=null==c?void 0:c.translationOriginal,p=null==d||null==(i=d.appHelper)||null==(a=i.utils)||null==(l=a.getApp)?void 0:l.call(a),m=null==d||null==(s=d.appHelper)||null==(n=s.utils)?void 0:n.NativePage,g=null==e?void 0:e.onOpenDetail,h=null==d||null==(o=d.engine)||null==(r=o.props)?void 0:r.locale,v=BK(),f=null==e?void 0:e.businessCode,y=(0,ef.useMemo)(()=>{let e=eVk(),t={online_store:eN.getText("pisell2.salesManagement.order.platform.online_store"),wholesalebusiness:eN.getText("pisell2.salesManagement.order.platform.wholesalebusiness"),"table-order":eN.getText("pisell2.salesManagement.order.platform.table-order"),mobile_order:eN.getText("pisell2.salesManagement.order.platform.mobile_order"),kiosk:eN.getText("pisell2.salesManagement.order.platform.kiosk"),pos:eN.getText("pisell2.salesManagement.order.platform.pos")},l=eVj(),a=eVM(),i=eVC(),n={"dine-in":eN.getText("pisell2.salesManagement.order.shopServiceType.dine-in"),takeaway:eN.getText("pisell2.salesManagement.order.shopServiceType.takeaway")},s=eWm();return{PAYMENT_STATUS_LABEL_MAP:e,PLATFORM_LABEL_MAP:t,ORDER_STATUS_LABEL_MAP:l,SHIPPING_STATUS_LABEL_MAP:a,DELIVERY_TYPE_LABEL_MAP:i,SHOP_SERVICE_TYPE_LABEL_MAP:n,BUSINESS_LABEL_MAP:s,orderLabels:{saleBrief:eN.getText("pisell2.salesManagement.order.column.saleBrief"),customer:eN.getText("pisell2.salesManagement.order.column.customer"),contact:eN.getText("pisell2.salesManagement.order.column.contact"),paymentInfo:eN.getText("pisell2.salesManagement.order.column.paymentInfo"),paymentMethod:eN.getText("pisell2.salesManagement.order.column.paymentMethod"),items:eN.getText("pisell2.salesManagement.order.column.items"),paymentStatus:eN.getText("pisell2.salesManagement.order.column.paymentStatus"),orderOrigin:eN.getText("pisell2.salesManagement.order.column.orderOrigin"),shippingMethod:eN.getText("pisell2.salesManagement.order.column.shippingMethod"),fulfillmentMethod:eN.getText("pisell2.salesManagement.order.column.fulfillmentMethod"),orderStatus:eN.getText("pisell2.salesManagement.order.column.orderStatus"),fulfillmentStatus:eN.getText("pisell2.salesManagement.order.column.fulfillmentStatus"),updated:eN.getText("pisell2.salesManagement.order.column.updated"),orderId:eN.getText("pisell2.salesManagement.order.column.orderId"),orderNote:eN.getText("pisell2.salesManagement.order.common.orderNote"),internalNote:eN.getText("pisell2.salesManagement.order.common.internalNote"),createdBy:eN.getText("pisell2.salesManagement.order.common.createdBy"),guest:eN.getText("pisell2.salesManagement.order.common.guest"),walkIn:eN.getText("pisell2.salesManagement.order.common.walkIn")},amountLabels:{total:eN.getText("pisell2.salesManagement.order.common.totalAmount"),paid:eN.getText("pisell2.salesManagement.order.common.paidAmount"),due:eN.getText("pisell2.salesManagement.order.common.dueAmount"),refunded:eN.getText("pisell2.salesManagement.order.common.refundedAmount"),items:eN.getText("pisell2.salesManagement.order.common.itemsCount")}}},[h]),x=(0,ef.useCallback)(e=>{let{PAYMENT_STATUS_LABEL_MAP:t,PLATFORM_LABEL_MAP:l,ORDER_STATUS_LABEL_MAP:a,SHIPPING_STATUS_LABEL_MAP:i,DELIVERY_TYPE_LABEL_MAP:n,SHOP_SERVICE_TYPE_LABEL_MAP:s,BUSINESS_LABEL_MAP:r,orderLabels:o,amountLabels:d}=y;return[{title:o.saleBrief,key:"sale_brief",width:225,render:(l,a)=>{let i=null==a?void 0:a.shop_full_order_number,n=null==a?void 0:a.currency_symbol,{totalAmount:s}=eZ_(a),r=null==a?void 0:a.payment_status,c=null==a?void 0:a.note,u=null==a?void 0:a.internal_note,p=BY((null==a?void 0:a.id)||(null==a?void 0:a.order_id)||(null==a?void 0:a.orderId)),m=(null==a?void 0:a.tag)||(null==a?void 0:a.tags)||[],g=t[r]||r||"-",h=eVw[r]||"";return(0,ev.jsxs)("div",{className:"pisell-sales-grid-sale-brief",style:{display:"flex",flexDirection:"column"},children:[(0,ev.jsx)("div",{style:{fontWeight:"bold",textDecoration:"underline",color:"var(--theme-color, #7f56d9)"},children:i}),Array.isArray(m)&&m.length>0?(0,ev.jsx)("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:m.map(e=>(0,ev.jsx)(eWh,{style:{margin:0,maxWidth:160,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontWeight:500},children:null==e?void 0:e.name},`${null==e?void 0:e.id}`))}):null,(0,ev.jsxs)("div",{style:{fontWeight:"bold"},children:[(0,ev.jsxs)("span",{style:{marginRight:6},children:[d.total,":"]}),(0,ev.jsx)("span",{children:eWv(s,n)})]}),(0,ev.jsx)("div",{children:(0,ev.jsx)(eWh,{style:{backgroundColor:h,whiteSpace:"nowrap",border:"none",fontWeight:500},children:g})}),(0,ev.jsx)(eWw,{dataSource:{note:c,internalNotes:u,apis:p,onChange:(t,l,a)=>{e.refresh()}},labels:{orderNote:o.orderNote,internalNote:o.internalNote},style:{maxWidth:"100%"}})]})}},{title:o.customer,key:"customer",align:"center",width:150,uniformCompare:(e,t)=>{let l=null==t?void 0:t.customer;if(!l)return"-";let a=null==l?void 0:l.guest_code;return a?`${a}`:1===l.user_id?"walk-in":l},render:(e,t)=>{let l=null==t?void 0:t.customer;if(!l)return"-";if(null==l?void 0:l.guest_code)return(0,ev.jsx)("div",{className:"pisell-sales-grid-person-cell",children:(0,ev.jsx)("div",{style:{fontWeight:"bold"},children:o.guest})});let a=eWf([eWb((null==l?void 0:l.phone)||(null==t?void 0:t.phone),(null==l?void 0:l.country_calling_code)||(null==t?void 0:t.country_calling_code)),null==l?void 0:l.email]);return(0,ev.jsxs)("div",{className:"pisell-sales-grid-person-cell",children:[(0,ev.jsx)(VR,{dataSource:l,style:{fontSize:14}}),a.map((e,t)=>(0,ev.jsx)("div",{style:eWy.text,children:e},`${e}-${t}`))]})}},{title:o.contact,dataIndex:"contacts_info",key:"contacts_info",align:"center",width:150,uniformCompare:(e,t)=>e||"-",render:(e,t)=>{var l,a;let i,n,s,r,o,d,c,u=(i=eZx(e),n=eZx(null==t?void 0:t.contacts_info),s=eZx(null==t?void 0:t.contactsInfo),o=String((null==(r=Object.keys(i).length?i:Object.keys(n).length?n:s)?void 0:r.first_name)||"").trim(),d=String((null==r?void 0:r.last_name)||"").trim(),c=String((null==r?void 0:r.display_name)||`${o} ${d}`).trim(),{displayName:c,phone:"string"==typeof(null==r?void 0:r.phone)?r.phone:(null==r||null==(l=r.phone)?void 0:l.phone)||(null==r||null==(a=r.phone)?void 0:a.value)||(null==r?void 0:r.mobile)||(null==r?void 0:r.phone_number)||"",email:(null==r?void 0:r.email)||""});if(!(null==u?void 0:u.displayName)&&!(null==u?void 0:u.phone)&&!(null==u?void 0:u.email))return"-";let p=eWf([eWb(null==u?void 0:u.phone),null==u?void 0:u.email]);return(0,ev.jsxs)("div",{className:"pisell-sales-grid-person-cell",children:[(0,ev.jsx)(VR,{dataSource:{display_name:null==u?void 0:u.displayName},style:{fontSize:14}}),p.map((e,t)=>(0,ev.jsx)("div",{style:eWy.text,children:e},`${e}-${t}`))]})}},{title:o.paymentInfo,key:"payment_info",width:124,align:"center",render:(e,t)=>{let l=null==t?void 0:t.payment_status,a=null==t?void 0:t.currency_symbol,{totalAmount:i,paidAmount:n,refundedAmount:s,dueAmount:r}=eZ_(t),o={due:{fontWeight:"bold",color:"#D92D20"},refunded:{color:"#CA8504",fontWeight:"bold"}},c=[];return["payment_processing","unpaid","partially_paid"].includes(l)?(c.push({label:d.due,value:eWv(r,a),bold:!0,kind:"due"}),"partially_paid"===l&&c.push({label:d.paid,value:eWv(n,a),bold:!0,kind:"paid"}),c.push({label:d.total,value:eWv(i,a),kind:"total"})):"paid"===l?(c.push({label:d.paid,value:eWv(n,a),bold:!0,kind:"paid"}),c.push({label:d.total,value:eWv(i,a),kind:"total"})):["partially_refunded","refunded"].includes(l)?(c.push({label:d.refunded,value:eWv(s,a),bold:!0,kind:"refunded"}),c.push({label:d.paid,value:eWv(n,a),kind:"paid"}),c.push({label:d.total,value:eWv(i,a),kind:"total"})):(["voided","authorized"].includes(l),c.push({label:d.total,value:eWv(i,a),bold:!0,kind:"total"})),(0,ev.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:"flex-start"},children:c.map(e=>(0,ev.jsx)("div",{style:eWy.text,children:(0,ev.jsxs)("span",{style:{whiteSpace:"nowrap",...e.kind&&o[e.kind]?o[e.kind]:{}},children:[e.label,": ",e.value]})},e.label))})}},{title:o.items,key:"product_quantity",align:"center",width:120,render:(e,t)=>{let l=function(e){var t;let l=Number(null==e?void 0:e.product_quantity);if(Number.isFinite(l)&&l>=0)return l;let a=Number(null==e||null==(t=e.summary)?void 0:t.product_quantity);if(Number.isFinite(a)&&a>=0)return a;let i=Array.isArray(null==e?void 0:e.products)?e.products:[];return 0===i.length?0:i.reduce((e,t)=>{let l=Number((null==t?void 0:t.product_quantity)??(null==t?void 0:t.quantity)??0);return!Number.isFinite(l)||l<=0?e:e+l},0)}(t);return(0,ev.jsxs)("span",{style:{...eWy.text,textAlign:"center"},children:[l,d.items]})}},{title:o.paymentMethod,key:"payment_method",dataIndex:"payments",width:180,align:"center",render:(e,t)=>{let l=Array.isArray((null==t?void 0:t.payments)||(null==t?void 0:t.payment))?t.payments||t.payment:[],a=null==t?void 0:t.currency_symbol;return 0===l.length?"-":(0,ev.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start"},children:l.map((e,t)=>{var l,i,n;let s=((null==e?void 0:e.voucher_id)?(null==u?void 0:u(null==e||null==(l=e.fund_record)?void 0:l.wallet_pass_name))||(null==e||null==(n=e.fund_record)||null==(i=n.wallet_pass_name)?void 0:i.default):"")||BJ(e,v),r=Number(null==e?void 0:e.amount),o=null==e?void 0:e.payment_time;return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[(0,ev.jsxs)("div",{style:{fontSize:14,lineHeight:"20px",color:"#101828",fontWeight:500,whiteSpace:"nowrap"},children:[(0,ev.jsx)("span",{children:s}),Number.isFinite(r)?(0,ev.jsxs)("span",{children:[": ",eWv(r,a)]}):null]}),o?(0,ev.jsx)(lL.PisellDateTimeDisplay,{value:o,layout:"inline",textAlign:"left",timeFormat:{padHour:!0},dateFormat:{showYear:!1,shortMonth:!0,showRelativeDay:!0,useCommaBeforeYear:!1},fields:{fieldOrder:["time","weekday","date"]},style:{...eWy.text,whiteSpace:"nowrap"}}):null]},(null==e?void 0:e.order_payment_id)||t)})})}},{title:o.orderOrigin,key:"order_origin",width:138,align:"center",render:(e,t)=>{let a=l[null==t?void 0:t.order_sales_channel]||l[null==t?void 0:t.order_platform]||(null==t?void 0:t.order_sales_channel)||(null==t?void 0:t.order_platform),i=(null==t?void 0:t.device_name)||(null==t?void 0:t.device)||(null==t?void 0:t.terminal),n=(null==t?void 0:t.created_at)||(null==t?void 0:t.order_time),s=eZb(t,null==t?void 0:t.create_account),d=eWf([a,i]);if(0===d.length)return null;let c=r[t.business_code];return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[c?(0,ev.jsx)("div",{children:(0,ev.jsx)(eWh,{color:eWg[t.business_code],style:{color:"black",fontWeight:500},children:c})}):null,d.map((e,t)=>(0,ev.jsx)("div",{style:eWy.text,children:e},`${e}-${t}`)),(0,ev.jsxs)("div",{style:{display:"flex",alignItems:"center",whiteSpace:"nowrap"},children:[(0,ev.jsxs)("span",{children:[o.createdBy,":"]}),s?(0,ev.jsx)(VR,{dataSource:s,style:{fontSize:14}}):(0,ev.jsx)("span",{style:{...eWy.text,marginLeft:4},children:"-"})]}),(0,ev.jsx)(lL.PisellDateTimeDisplay,{value:n,layout:"inline",textAlign:"left",timeFormat:{padHour:!0},dateFormat:{showYear:!1,shortMonth:!0,showRelativeDay:!0,useCommaBeforeYear:!1},fields:{fieldOrder:["time","weekday","date"]},style:{whiteSpace:"nowrap"}})]})}},{title:o.paymentStatus,dataIndex:"payment_status",key:"payment_status",align:"center",width:160,render:e=>{let l="partially_paid"===e?"unpaid":e,a=t[l]||e||"-",i=eVw[l]||"";return(0,ev.jsx)("div",{style:{textAlign:"center"},children:(0,ev.jsx)(lL.PisellTags,{style:{backgroundColor:i,whiteSpace:"nowrap"},children:a})})}},{title:o.fulfillmentMethod,key:"delivery_type",align:"center",width:160,render:(e,t)=>{let l=function(e,t){var l,a,i,n,s;let r=(null==e?void 0:e.delivery_type)||(null==e?void 0:e.shipping_type)||((null==e?void 0:e.type)==="delivery"||(null==e?void 0:e.business_code)==="delivery"?"local_delivery":void 0),o=(null==e||null==(a=e.metadata)||null==(l=a.shop_service_type)?void 0:l.server_type)||(null==e||null==(i=e.shop_service_type)?void 0:i.server_type)||(null==e?void 0:e.shop_service_type);if("shop_service"===r||null==r&&o){let e=null==(s=t.shopServiceTypeLabelMap)?void 0:s[o];return e?{label:e,color:null==eVP?void 0:eVP[o]}:null}let d=null==(n=t.deliveryTypeLabelMap)?void 0:n[r];return d&&"nil"!==r?{label:d,color:null==eVT?void 0:eVT[r]}:null}(t,{shopServiceTypeLabelMap:s,deliveryTypeLabelMap:n});return l?(0,ev.jsx)("div",{style:{textAlign:"center"},children:(0,ev.jsx)(eWh,{style:{whiteSpace:"nowrap",fontWeight:500},color:l.color,children:l.label})}):"-"},uniformCompare:(e,t)=>{var l,a;let i=(null==t?void 0:t.delivery_type)||"",n=(null==t||null==(a=t.metadata)||null==(l=a.shop_service_type)?void 0:l.server_type)||"";return`${i}|${n}`}},{title:o.orderStatus,dataIndex:"status",key:"status",align:"center",width:150,render:e=>{let t=eVS[e],l=a[e]||e||"-";return(0,ev.jsx)("div",{style:{textAlign:"center"},children:(0,ev.jsx)(lL.PisellTags,{style:{whiteSpace:"nowrap",borderColor:null==t?void 0:t.borderColor,color:null==t?void 0:t.textColor},children:l})})}},{title:o.fulfillmentStatus,dataIndex:"shipping_status",key:"shipping_status",align:"center",width:160,render:e=>{let t=eVN[e],l=i[e]||e||"-";return(0,ev.jsx)("div",{style:{textAlign:"center"},children:(0,ev.jsx)(lL.PisellTags,{style:{whiteSpace:"nowrap",borderColor:null==t?void 0:t.borderColor,color:null==t?void 0:t.textColor},children:l})})}},{title:o.updated,key:"last_edit_account",width:132,align:"center",render:(e,t)=>{let a=eZb(t,null==t?void 0:t.last_edit_account),i=null==t?void 0:t.updated_at,n=eWf([l[null==t?void 0:t.order_platform]||(null==t?void 0:t.order_platform)]);return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[a?(0,ev.jsx)(VR,{dataSource:a,style:{fontSize:14}}):(0,ev.jsx)("div",{style:{...eWy.text},children:"-"}),(0,ev.jsx)(lL.PisellDateTimeDisplay,{value:i,layout:"inline",textAlign:"left",timeFormat:{padHour:!0},dateFormat:{showYear:!1,shortMonth:!0,showRelativeDay:!0,useCommaBeforeYear:!1},fields:{fieldOrder:["time","weekday","date"]},style:{whiteSpace:"nowrap"}}),n.map((e,t)=>(0,ev.jsx)("div",{style:eWy.text,children:e},`${e}-${t}`))]})}},{title:o.orderId,dataIndex:"order_id",key:"order_id",align:"center",width:100,render:(e,t)=>{let l=null==t?void 0:t.shop_order_number;return(0,ev.jsx)("span",{style:{...eWy.text,textAlign:"center"},children:l})}}]},[y,u,v]);return(0,ef.useMemo)(()=>({key:"handle",label:"Handle",getChildComponentProps:e=>{let t,l,a,i;return{grid:{bordered:!0,collapseUniformColumns:!0,columns:x(e),defaultHiddenColumnKeys:["order_origin","payment_status","delivery_type","status","shipping_status","last_edit_account","id"],scroll:{x:"max-content",autoCalc:!0,scrollToFirstRowOnChange:!0},rowSelection:{fixed:!0,columnWidth:48},onRow:e=>({onClick:()=>{let t=(null==e?void 0:e.order_id)??(null==e?void 0:e.orderId)??(null==e?void 0:e.id);g?g({orderId:t,record:e}):null==c||c.action({type:"pisell1.handleOpenSaleDetail",data:{osProps:{orderId:t,osKey:"sales-management-item-detail",businessCode:f,syncDetailOnOrderChange:!0}}})}})},toolBar:{search:{showConfirmButton:!1},sort:{list:[{type:"time",isCustom:!0,name:"created_at",label:eN.getText("pisell2.salesManagement.order.sort.createdAt"),getSortItems:()=>[{key:"created_at:asc",label:eN.getText("pisell2.salesManagement.sort.oldestFirst")},{key:"created_at:desc",label:eN.getText("pisell2.salesManagement.sort.newestFirst")}]},{type:"time",isCustom:!0,name:"updated_at",label:eN.getText("pisell2.salesManagement.order.sort.updatedAt"),getSortItems:()=>[{key:"updated_at:asc",label:eN.getText("pisell2.salesManagement.sort.oldestFirst")},{key:"updated_at:desc",label:eN.getText("pisell2.salesManagement.sort.newestFirst")}]},{type:"number",isCustom:!1,name:"total_amount",label:eN.getText("pisell2.salesManagement.order.sort.totalAmount")},{type:"number",isCustom:!1,name:"amount_gap",label:eN.getText("pisell2.salesManagement.sort.balanceDue")},{type:"string",isCustom:!1,name:"customer_name",label:eN.getText("pisell2.salesManagement.order.sort.customerName")}]},quickFilter:{filterList:[{type:"rangePicker",name:"orderDate",key:"orderDate",props:{placeholder:eN.getText("pisell2.salesManagement.order.quickFilter.orderDate.placeholder")}}]},filter:{hiddenQuickFilter:!0,defaultFilterValue:{quickFilter:[],otherFilter:(t=eVj(),l=eVk(),a=eVM(),i=eVC(),[{name:"status",type:"single",key:"status",label:eN.getText("pisell2.salesManagement.order.filter.orderStatus.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.order.filter.orderStatus.placeholder"),options:Object.entries(t).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"payment_status",type:"single",key:"payment_status",label:eN.getText("pisell2.salesManagement.order.filter.paymentStatus.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.order.filter.paymentStatus.placeholder"),options:Object.entries(l).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"shipping_status",type:"single",key:"shipping_status",label:eN.getText("pisell2.salesManagement.order.filter.fulfillmentStatus.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.order.filter.fulfillmentStatus.placeholder"),options:Object.entries(a).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"customer_id",type:"single",key:"customer_id",label:eN.getText("pisell2.salesManagement.order.filter.customer.label"),other:{allowClear:!0,isSearchServer:!0,showSearch:!0,placeholder:eN.getText("pisell2.salesManagement.order.filter.customer.placeholder"),options:e=>eVi(e).then(e=>e.map(e=>({label:e.display_name,value:e.id})))}},{name:"order_sales_channel",type:"single",key:"order_sales_channel",label:eN.getText("pisell2.salesManagement.order.filter.salesChannel.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.order.filter.salesChannel.placeholder"),options:()=>eVs().then(e=>e.map(e=>({label:e.name,value:e.code})))}},{name:"payment_methods",type:"single",key:"payment_methods",label:eN.getText("pisell2.salesManagement.order.filter.paymentMethod.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",virtual:!1,placeholder:eN.getText("pisell2.salesManagement.order.filter.paymentMethod.placeholder"),options:()=>eVr().then(e=>Array.from(new Map(e.map(e=>[e.code,{label:e.name,value:e.code}])).values()))}},{name:"total_amount",type:"numberRange",key:"total_amount",label:eN.getText("pisell2.salesManagement.order.filter.totalAmount.label"),other:{placeholder:eN.getText("pisell2.salesManagement.order.filter.totalAmount.placeholder"),minInputNumberProps:{min:0},maxInputNumberProps:{min:0}}},{name:"tag_ids",type:"single",key:"tag_ids",label:eN.getText("pisell2.salesManagement.order.filter.tags.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",isSearchServer:!0,showSearch:!0,placeholder:eN.getText("pisell2.salesManagement.order.filter.tags.placeholder"),options:e=>eVn(e).then(e=>e.map(e=>({label:e.name,value:e.id})))}},{name:"delivery_type",type:"single",key:"delivery_type",label:eN.getText("pisell2.salesManagement.order.filter.fulfillmentMethod.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.order.filter.fulfillmentMethod.placeholder"),options:Object.entries(i).filter(e=>{let[t]=e;return!["nil","shop_service"].includes(t)}).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"delivery_zone_name",type:"text",key:"delivery_zone_name",label:eN.getText("pisell2.salesManagement.order.filter.deliveryZone.label"),other:{placeholder:eN.getText("pisell2.salesManagement.order.filter.deliveryZone.placeholder")}},{name:"location_id",type:"single",key:"location_id",label:eN.getText("pisell2.salesManagement.order.filter.pickupLocation.label"),other:{allowClear:!0,placeholder:eN.getText("pisell2.salesManagement.order.filter.pickupLocation.placeholder"),options:()=>eVd().then(e=>e.map(e=>({label:e.name,value:e.id})))}},{name:"shipping_order_number",type:"text",key:"shipping_order_number",label:eN.getText("pisell2.salesManagement.order.filter.trackingNumber.label"),other:{placeholder:eN.getText("pisell2.salesManagement.order.filter.trackingNumber.placeholder")}},{name:"logistics_company_id",type:"single",key:"logistics_company_id",label:eN.getText("pisell2.salesManagement.order.filter.logistics.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.order.filter.logistics.placeholder"),options:()=>eVo().then(e=>e.map(e=>({label:e.name,value:e.id})))}},{name:"zip",type:"text",key:"zip",label:eN.getText("pisell2.salesManagement.order.filter.zipCode.label"),other:{placeholder:eN.getText("pisell2.salesManagement.order.filter.zipCode.placeholder")}}]),values:{}}}},batchActionBar:{overflowThreshold:2,defaultActions:{showSelectAll:!1,showClear:!1,showInvert:!1,showDelete:!1}}}}}),[x,p,h,m,g,f])};function eZw(e){return"monitor"===e?{filter:{values:{order_payment_status:eVO,booking_time_start_between:[em()().startOf("day"),em()().endOf("day")]}}}:{filter:{values:{payment_status:eVO,orderDate:[em()(),em()()]}},sort:"created_at:desc"}}let eZj=e=>{var t,l,a,i,n,s,r,o,d,c,u,p,m,g,h,v,f,y,x;let b,_,k,{perspective:w,__id:j,keyword:S,mode:M,hideToolbarSearch:N,onOpenDetail:C}=e,T=ik(),P=(null==T||null==(t=T.appHelper)?void 0:t.utils)||{},{action:A}=P,D=null==P||null==(l=P.getApp)?void 0:l.call(P);z_.Em.setRequest(null==P?void 0:P.request),eV$=eVR(null==P?void 0:P.isWebPos);let I=rP(B$),E=!!(null==T||null==(i=T.engine)||null==(a=i.props)?void 0:a.isActive);eN.init(eWM,(null==T||null==(s=T.engine)||null==(n=s.props)?void 0:n.locale)||"en"),(0,ef.useEffect)(()=>{"monitor"===w&&setTimeout(()=>{null==A||A({type:"pisell1.registerBookingPlugin"})},300)},[w,A]);let z=null==D||null==(o=D.history)||null==(r=o.useParams)?void 0:r.call(o),L=(0,ef.useMemo)(()=>{if(!("u"<typeof window))return new URLSearchParams(window.location.search||"").get("business_code")||void 0},[]),O=(0,ef.useMemo)(()=>{let t=e.businessCode??e.biz??(null==z?void 0:z.business_code)??(null==z?void 0:z.biz)??L;return(null!=t?String(t).trim():"")||void 0},[e.businessCode,e.biz,null==z?void 0:z.business_code,null==z?void 0:z.biz,L]),R=(0,ef.useMemo)(()=>({list:{business_code:O,...void 0!==M?{mode:M}:{}}}),[O,M]),$=(_=eZk({onOpenDetail:b=(x={relationTables:Array.isArray(I.data)?I.data:[],onOpenDetail:C,businessCode:O}).onOpenDetail,businessCode:null==x?void 0:x.businessCode}),k=eWS(x,{onOpenDetail:b}),(0,ef.useMemo)(()=>[_,k],[_,k])),F=(0,ef.useMemo)(()=>N?($||[]).map(e=>{let t=null==e?void 0:e.getChildComponentProps;if("function"!=typeof t){var l;return{...e,childComponentProps:{...(null==e?void 0:e.childComponentProps)||{},toolBar:{...(null==e||null==(l=e.childComponentProps)?void 0:l.toolBar)||{},search:!1}}}}return{...e,getChildComponentProps:e=>{let l=t(e)||{};return{...l,toolBar:{...l.toolBar||{},search:!1}}}}}):$,[$,N]),B=function(e){var t,l,a,i,n;let{perspective:s,extParams:r,externalKeyword:o}=e,d=ik(),{action:c}=(null==d||null==(t=d.appHelper)?void 0:t.utils)||{},[u,p]=(0,ef.useState)({pageNumber:1,pageSize:20}),[m,g]=(0,ef.useState)(()=>eZw(s)),[h,v]=(0,ef.useState)([]),[f,y]=(0,ef.useState)([]),x=(0,ef.useRef)((0,eH.LP)()),b=(0,ef.useRef)((0,eH.LP)()),_=(0,ef.useRef)(null),k=(0,ef.useRef)(null),w=(0,ef.useMemo)(()=>{let{keyword:e,filter:t,sort:l}=m;return{keyword:void 0!==o?o:e,sort:l,...(null==t?void 0:t.values)||{},skip:u.pageNumber,num:u.pageSize}},[m,u.pageNumber,u.pageSize,o]),j=i0(e=>(null==e?void 0:e.data)??e),S=i0(async e=>eVH(e,{osServer:!0,subscriberId:x.current,callback:e=>{var t;let l=j(e);null!=l&&Array.isArray(l.list)&&0!==l.list.length&&(null==(t=_.current)||t.call(_,l))}})),M=i0(async e=>eVV(e,{osServer:!0,subscriberId:b.current,callback:e=>{var t;let l=j(e);null!=l&&Array.isArray(l.list)&&0!==l.list.length&&(null==(t=k.current)||t.call(k,eVq(l)))}})),N=rP(S,{manual:!0}),C=rP(M,{manual:!0});_.current=N.mutate,k.current=C.mutate;let T=(0,ef.useMemo)(()=>({...w,...(null==r?void 0:r.list)||{}}),[w,null==r?void 0:r.list]);(0,ef.useEffect)(()=>{"monitor"===s?C.run(T):N.run(T)},[s,T]),(0,ef.useEffect)(()=>{g(eZw(s)),p(e=>({...e,pageNumber:1})),v([]),y([])},[s]);let P=(0,ef.useCallback)((e,t)=>{e<1||t<1||p({pageNumber:e,pageSize:t})},[]),A=(0,ef.useCallback)(e=>{g(e||{}),p(e=>({...e,pageNumber:1}))},[]);(0,ef.useEffect)(()=>{void 0!==o&&p(e=>1===e.pageNumber?e:{...e,pageNumber:1})},[o]);let D=(0,ef.useCallback)(()=>{g(eZw(s)),p(e=>({...e,pageNumber:1}))},[s]),I=(0,ef.useCallback)((e,t)=>{v(e),y(t)},[]),E=(0,ef.useCallback)(e=>{"monitor"===s?C.run(T):N.run(T),e&&e.length>0&&c({type:"webpos.updateLocalOrdersApi",data:{order_ids:e}})},[s,T,C,N]),z=(0,ef.useCallback)(()=>"monitor"===s?C.runAsync(T):N.runAsync(T),[s,T,C,N]);(0,ef.useEffect)(()=>{"monitor"===s?eVY(x.current):eVU(b.current)},[s]),(0,ef.useEffect)(()=>()=>{eVY(x.current),eVU(b.current)},[]);let L="monitor"===s?(null==(l=C.data)?void 0:l.list)??[]:(null==(a=N.data)?void 0:a.list)??[],O="monitor"===s?C.loading:N.loading;return{data:L,loading:O,total:"monitor"===s?(null==(i=C.data)?void 0:i.count)??0:(null==(n=N.data)?void 0:n.count)??0,pagination:u,onPageChange:P,searchParams:m,onSearch:A,onReset:D,selectedKeys:h,selectedRows:f,onSelectionChange:I,rowKey:(0,ef.useMemo)(()=>e=>"handle"===s?(null==e?void 0:e.order_id)||(null==e?void 0:e.id):(null==e?void 0:e.id)??"",[s]),onRefresh:E,refreshAsync:z}}({perspective:w,extParams:R,externalKeyword:S}),H=(null==T||null==(c=T.engine)||null==(d=c.props)?void 0:d.locale)==="zh-CN"||(null==T||null==(p=T.engine)||null==(u=p.props)?void 0:u.locale)==="zh-HK"?"zh-cn":(null==T||null==(g=T.engine)||null==(m=g.props)?void 0:m.locale)==="en"||(null==T||null==(v=T.engine)||null==(h=v.props)?void 0:h.locale)==="en-US"?"en":"zh-cn",q=(null==T||null==(y=T.engine)||null==(f=y.props)?void 0:f.locale)||("u">typeof localStorage?localStorage.getItem("umi_locale"):null)||"en-US";return(0,ev.jsx)(lL.PisellConfigProvider,{locale:"zh"===q?"zh-CN":q,children:(0,ev.jsx)(ej8,{dateAdapter:eSy,adapterLocale:H,children:(0,ev.jsx)("div",{style:Object.assign({},{height:0},null==e?void 0:e.style),children:(0,ev.jsx)(eV4,{perspectives:F,currentPerspective:w,extParams:R,__id:j,data:B.data,loading:B.loading,total:B.total,pagination:B.pagination,onPageChange:B.onPageChange,searchParams:B.searchParams,onSearch:B.onSearch,onReset:B.onReset,selectedKeys:B.selectedKeys,selectedRows:B.selectedRows,onSelectionChange:B.onSelectionChange,rowKey:B.rowKey,onRefresh:B.onRefresh,refreshAsync:B.refreshAsync,enableScanner:E})})})})};function eZS(e,t){if(null==e||"number"==typeof e&&Number.isNaN(e))return t.missingValuePlaceholder??"—";let l=t.currencySymbol??"";return lE(e,l,{precision:t.amountPrecision??2,showCurrencySymbol:!!l,useThousandsSeparator:t.useThousandsSeparator??!1,hideDecimalForWholeNumbers:t.hideDecimalForWholeNumbers??!0})}let eZM="pisell-collapse",eZN=ey().memo(e=>{let{headMeta:t,headAmount:l,expanded:a,defaultExpanded:i=!1,onExpandChange:n,children:s,bodyRows:r,className:o,style:d}=e,[c,u]=(0,ef.useState)(i),p=void 0!==a,m=p?a:c,g=(0,ef.useCallback)(()=>{let e=!m;p||u(e),null==n||n(e)},[m,p,n]),h=t.segments??[];h.length||null==t.time&&null==t.date&&null==t.customer&&null==t.channel||((null!=t.time||null!=t.date)&&h.push((0,ev.jsx)("span",{className:`${eZM}-head-segment`,children:[t.time,t.date].filter(Boolean).join(" ")},"time")),null!=t.customer&&h.push((0,ev.jsx)("span",{className:`${eZM}-head-segment`,children:t.customer},"customer")),null!=t.channel&&h.push((0,ev.jsx)("span",{className:`${eZM}-head-segment`,children:t.channel},"channel")));let v=((null==r?void 0:r.length)??0)>0||null!=s;return(0,ev.jsx)("div",{className:t_()(eZM,o),style:d,"data-node-id":"14256:5103",children:(0,ev.jsxs)("div",{className:`${eZM}-item`,children:[(0,ev.jsxs)("div",{className:`${eZM}-head`,onClick:v?g:void 0,role:v?"button":void 0,tabIndex:v?0:void 0,onKeyDown:e=>{v&&("Enter"===e.key||" "===e.key)&&(e.preventDefault(),g())},children:[(0,ev.jsx)("div",{className:`${eZM}-head-left`,children:h.map((e,t)=>(0,ev.jsx)("span",{className:`${eZM}-head-segment`,children:e},t))}),(0,ev.jsxs)("div",{className:`${eZM}-head-right`,children:[(0,ev.jsx)("span",{className:`${eZM}-head-amount`,children:l}),v&&(0,ev.jsx)("span",{className:t_()(`${eZM}-head-chevron`,m&&`${eZM}-head-chevron-expanded`),"aria-label":m?"collapse":"expand",children:(0,ev.jsx)(AG,{style:{fontSize:12}})})]})]}),v&&m&&(0,ev.jsxs)("div",{className:`${eZM}-body`,children:[null==r?void 0:r.map((e,t)=>(0,ev.jsxs)("div",{className:`${eZM}-body-row`,children:[(0,ev.jsx)("div",{className:`${eZM}-body-left`,children:(0,ev.jsx)("ul",{children:(0,ev.jsx)("li",{children:e.label})})}),null!=e.amount&&(0,ev.jsx)("span",{className:`${eZM}-body-amount`,children:e.amount}),null!=e.action&&(0,ev.jsx)("button",{type:"button",className:`${eZM}-body-action`,onClick:t=>{var l,a;t.stopPropagation(),null==(a=e.action)||null==(l=a.onClick)||l.call(a)},children:e.action.label})]},t)),s]})]})})});eZN.displayName="Collapse";let eZC="pisell-financial-summary",eZT={row:8,rowLeft:8,meta:4,rowRight:6},eZP={1:{labelTextStyle:{fontSize:16,fontWeight:700,color:"#1B1B1B",lineHeight:"24px"},valueTextStyle:{fontSize:16,fontWeight:700,color:"#DC6803",lineHeight:"24px"},expandIconStyle:{size:16,width:16,height:16}},2:{labelTextStyle:{fontSize:16,fontWeight:700,color:"#1B1B1B",lineHeight:"24px"},valueTextStyle:{fontSize:16,fontWeight:700,color:"#DC6803",lineHeight:"24px"},expandIconStyle:{size:16,width:16,height:16},divider:{show:!0,color:"#D0D5DD",style:"solid"},showDotSeparator:!1},3:{labelTextStyle:{fontSize:16,fontWeight:500,color:"#000000",lineHeight:"24px"},valueTextStyle:{fontSize:16,fontWeight:500,color:"#000000",lineHeight:"24px"},metaTextStyle:{fontSize:16,fontWeight:400,color:"#667085",lineHeight:"24px"},infoIconStyle:{size:16,width:16,height:16}}},eZA=ey().memo(e=>{var t,l;let{data:a,showTotal:i=!0,showPaid:n=!0,showRefund:s=!0,showItemsCount:r=!0,showInfoIcon:o=!0,hideZeroAmountRows:d=!1,titleBalanceDue:c,titleTotal:u,titlePaid:p,titleRefund:m,currencySymbol:g="",amountPrecision:h=2,useThousandsSeparator:v=!1,hideDecimalForWholeNumbers:f=!0,missingValuePlaceholder:y="—",defaultExpandedLevel:x=0,className:b,style:_}=e,k=(0,ef.useMemo)(()=>({precision:h??2,showCurrencySymbol:!!g,useThousandsSeparator:v??!1,hideDecimalForWholeNumbers:f??!0}),[h,g,v,f]),w=(0,ef.useCallback)(e=>lE(e,g??"",k),[g,k]),j=(0,ef.useCallback)((e,t)=>void 0!==t?t:eN.getText(e),[c,u,p,m]),S=(0,ef.useMemo)(()=>(a.paid??[]).reduce((e,t)=>e+t.amount,0),[a.paid]),M=(0,ef.useMemo)(()=>(a.refund??[]).reduce((e,t)=>e+t.amount,0),[a.refund]),N=!1!==n&&((null==(t=a.paid)?void 0:t.length)??0)>0||!1!==s&&((null==(l=a.refund)?void 0:l.length)??0)>0,C=(0,ef.useMemo)(()=>{var e,t,l;let x=function(e,t){var l,a,i,n,s;let r=[],o=(e,l)=>void 0!==l?l:t.getText(e),d=[];if(!1!==t.showTotal&&e.total){let l=(n=e.total,(null==n||null==(s=n.children)?void 0:s.length)?n.children.map(e=>(function e(t,l,a){if(l.hideZeroAmountRows&&0===t.value)return null;let i=null==t.value||Number.isNaN(Number(t.value))?l.missingValuePlaceholder??"—":eZS(Number(t.value),l),n=(t.children??[]).map(t=>e(t,l,a+1)).filter(e=>null!=e);return{key:t.key??`line-${a}-${t.label}`,label:t.label,value:i,children:n.length>0?n:void 0,itemsCount:l.showItemsCount?t.itemsCount:void 0,infoTooltip:l.showInfoIcon?t.infoTooltip:void 0}})(e,t,2)).filter(e=>null!=e):[]),a=null==e.total.value||Number.isNaN(Number(e.total.value))?(null==(i=e.total.children)?void 0:i.length)?function e(t){let l=0;for(let i of t){var a;"number"!=typeof i.value||Number.isNaN(i.value)||(l+=i.value),(null==(a=i.children)?void 0:a.length)&&(l+=e(i.children))}return l}(e.total.children):void 0:Number(e.total.value),r=void 0===a||Number.isNaN(a)?void 0:eZS(a,t);d.push({key:"total",label:o("pisell2.financialSummary.total",t.titleTotal),value:r,children:l.length>0?l:void 0})}if(!t.skipPaidAndRefund&&!1!==t.showPaid&&(null==(l=e.paid)?void 0:l.length)){let l=e.paid.map(e=>{let l,a;return a=(l=[e.methodName??"",e.time??""].filter(Boolean)).length>0?l.join(" \xb7 "):void 0,{key:e.key??`paid-${e.amount}-${e.methodName}`,label:a??"—",value:eZS(e.amount,t),extra:e.detail}});d.push({key:"paid",label:o("pisell2.financialSummary.paid",t.titlePaid),children:l})}if(!t.skipPaidAndRefund&&!1!==t.showRefund&&(null==(a=e.refund)?void 0:a.length)){let l=e.refund.map(e=>({key:e.key??`refund-${e.amount}-${e.label}`,label:e.label??"—",value:eZS(e.amount,t),extra:e.detail}));d.push({key:"refund",label:o("pisell2.financialSummary.refund",t.titleRefund),children:l})}let c=d.length>0?{key:"summary-sections",label:"",value:void 0,children:d}:{key:"summary-sections",label:"",value:void 0,children:[]};return r.push({key:"balance-due",label:o("pisell2.financialSummary.balanceDue",t.titleBalanceDue),value:eZS(e.balanceDue,t),children:d.length>0?[c]:void 0}),r}(a,{currencySymbol:g,amountPrecision:h,useThousandsSeparator:v,hideDecimalForWholeNumbers:f,showItemsCount:r,showInfoIcon:o,hideZeroAmountRows:d,missingValuePlaceholder:y,getText:e=>eN.getText(e),titleBalanceDue:c,titleTotal:u,titlePaid:p,titleRefund:m,showTotal:i,showPaid:!N&&n,showRefund:!N&&s,skipPaidAndRefund:N});if(!N)return x;let b=x.slice()[0],_=null==b||null==(e=b.children)?void 0:e[0];if(!(null==_?void 0:_.children))return x;let k=_.children.slice();return!1!==n&&((null==(t=a.paid)?void 0:t.length)??0)>0&&k.push({key:"paid",label:j("pisell2.financialSummary.paid",p),value:w(S),expandedContent:(0,ev.jsx)("div",{className:`${eZC}-collapse-list`,style:{marginTop:8},children:(a.paid??[]).map((e,t)=>(0,ev.jsx)(eZD,{item:e,formatAmount:w},e.key??t))})}),!1!==s&&((null==(l=a.refund)?void 0:l.length)??0)>0&&k.push({key:"refund",label:j("pisell2.financialSummary.refund",m),value:w(M),expandedContent:(0,ev.jsx)("div",{className:`${eZC}-collapse-list`,style:{marginTop:8},children:(a.refund??[]).map((e,t)=>(0,ev.jsx)(eZI,{item:e,formatAmount:w},e.key??t))})}),[{...b,children:[{..._,children:k}]}]},[a,g,h,v,f,r,o,d,y,c,u,p,m,i,n,s,j,w,S,M,N]);return(0,ev.jsx)("div",{className:t_()(eZC,b),style:_,children:(0,ev.jsx)(lL.PisellHierarchicalSummaryList,{items:C,indent:16,rowGap:8,padding:20,gaps:eZT,levelConfig:eZP,defaultExpandedLevel:x})})});function eZD(e){let{item:t,formatAmount:l}=e,{headMeta:a,headAmount:i,bodyRows:n}=(0,ef.useMemo)(()=>{var e;let a;return a=((null==(e=t.bodyRows)?void 0:e.length)??0)>0?(t.bodyRows??[]).map(e=>({label:e.label,amount:e.amount??l(t.amount),action:e.action})):[{label:t.methodName??"—",amount:l(t.amount),action:{label:"Void",onClick:void 0}}],{headMeta:{time:t.time,date:t.date,customer:t.customer,channel:t.channel},headAmount:l(t.amount),bodyRows:a}},[t,l]);return(0,ev.jsx)(eZN,{headMeta:a,headAmount:i,defaultExpanded:!0,bodyRows:n})}function eZI(e){var t;let{item:l,formatAmount:a}=e,i=((null==(t=l.bodyRows)?void 0:t.length)??0)>0?l.bodyRows??[]:[{label:l.label??"—",amount:a(l.amount),action:{label:"Void",onClick:void 0}}];return(0,ev.jsx)(eZN,{headMeta:{time:l.time,date:l.date,customer:l.customer,channel:l.channel},headAmount:a(l.amount),defaultExpanded:!0,bodyRows:i})}eZA.displayName="PisellFinancialSummary";let eZE={en:{"pisell2.financialSummary.balanceDue":"Balance due","pisell2.financialSummary.total":"Total","pisell2.financialSummary.paid":"Paid","pisell2.financialSummary.refund":"Refund","pisell2.financialSummary.itemsCount":"N items"},"zh-CN":{"pisell2.financialSummary.balanceDue":"应付余额","pisell2.financialSummary.total":"合计","pisell2.financialSummary.paid":"已支付","pisell2.financialSummary.refund":"已退款","pisell2.financialSummary.itemsCount":"N 条"},"zh-HK":{"pisell2.financialSummary.balanceDue":"應付餘額","pisell2.financialSummary.total":"合計","pisell2.financialSummary.paid":"已支付","pisell2.financialSummary.refund":"已退款","pisell2.financialSummary.itemsCount":"N 條"}},eZz={en:{"pi-payment-result.success.title":"Payment successful","pi-payment-result.success.description":"Your payment has been completed.","pi-payment-result.failed.title":"Payment failed","pi-payment-result.failed.description":"The payment was not completed. Please check your payment app result and confirm the order status with the merchant.","pi-payment-result.failed.notFound.title":"Payment record not found","pi-payment-result.failed.notFound.description":"We could not find the payment record yet. Please check your payment app result and confirm the order status with the merchant.","pi-payment-result.failed.timeout.title":"Payment result query timed out","pi-payment-result.failed.timeout.description":"The payment result query timed out. Please check your payment app result and confirm the order status with the merchant to avoid duplicate payment.","pi-payment-result.failed.invalidParams.title":"Unable to query payment result","pi-payment-result.failed.invalidParams.description":"We could not query the payment result. Please check your payment app result and confirm the order status with the merchant.","pi-payment-result.querying.title":"Payment is being confirmed","pi-payment-result.querying.description":"Payment result is being confirmed."},"zh-CN":{"pi-payment-result.success.title":"支付成功","pi-payment-result.success.description":"您的支付已完成。","pi-payment-result.failed.title":"支付失败","pi-payment-result.failed.description":"本次支付未完成,请检查支付 App 结果,并与商家核对订单状态。","pi-payment-result.failed.notFound.title":"暂未查询到支付记录","pi-payment-result.failed.notFound.description":"暂未查询到支付记录,请检查您的支付 App 结果,并与商家核对订单状态。","pi-payment-result.failed.timeout.title":"支付结果查询超时","pi-payment-result.failed.timeout.description":"支付结果查询超时,请检查您的支付 App 结果,并与商家核对订单状态,避免重复支付。","pi-payment-result.failed.invalidParams.title":"无法查询支付结果","pi-payment-result.failed.invalidParams.description":"无法查询支付结果,请检查您的支付 App 结果,并与商家核对订单状态。","pi-payment-result.querying.title":"支付结果查询中","pi-payment-result.querying.description":"正在确认支付结果"},"zh-HK":{"pi-payment-result.success.title":"支付成功","pi-payment-result.success.description":"您的支付已完成。","pi-payment-result.failed.title":"支付失敗","pi-payment-result.failed.description":"本次支付未完成,請檢查支付 App 結果,並與商家核對訂單狀態。","pi-payment-result.failed.notFound.title":"暫未查詢到支付記錄","pi-payment-result.failed.notFound.description":"暫未查詢到支付記錄,請檢查您的支付 App 結果,並與商家核對訂單狀態。","pi-payment-result.failed.timeout.title":"支付結果查詢超時","pi-payment-result.failed.timeout.description":"支付結果查詢超時,請檢查您的支付 App 結果,並與商家核對訂單狀態,避免重複支付。","pi-payment-result.failed.invalidParams.title":"無法查詢支付結果","pi-payment-result.failed.invalidParams.description":"無法查詢支付結果,請檢查您的支付 App 結果,並與商家核對訂單狀態。","pi-payment-result.querying.title":"支付結果查詢中","pi-payment-result.querying.description":"正在確認支付結果"},ja:{"pi-payment-result.success.title":"支払いが完了しました","pi-payment-result.success.description":"お支払いが完了しました。","pi-payment-result.failed.title":"支払いに失敗しました","pi-payment-result.failed.description":"支払いは完了していません。支払いアプリの結果を確認し、店舗スタッフに注文状況をご確認ください。","pi-payment-result.failed.notFound.title":"支払い記録がまだ見つかりません","pi-payment-result.failed.notFound.description":"支払い記録がまだ見つかりません。支払いアプリの結果を確認し、店舗スタッフに注文状況をご確認ください。","pi-payment-result.failed.timeout.title":"支払い結果の確認がタイムアウトしました","pi-payment-result.failed.timeout.description":"支払い結果の確認がタイムアウトしました。重複支払いを避けるため、支払いアプリの結果を確認し、店舗スタッフに注文状況をご確認ください。","pi-payment-result.failed.invalidParams.title":"支払い結果を確認できません","pi-payment-result.failed.invalidParams.description":"支払い結果を確認できません。支払いアプリの結果を確認し、店舗スタッフに注文状況をご確認ください。","pi-payment-result.querying.title":"支払い結果を確認しています","pi-payment-result.querying.description":"支払い結果を確認しています。"},pt:{"pi-payment-result.success.title":"Pagamento realizado","pi-payment-result.success.description":"Seu pagamento foi concluido.","pi-payment-result.failed.title":"Falha no pagamento","pi-payment-result.failed.description":"O pagamento nao foi concluido. Verifique o resultado no app de pagamento e confirme o status do pedido com o comerciante.","pi-payment-result.failed.notFound.title":"Registro de pagamento nao encontrado","pi-payment-result.failed.notFound.description":"Ainda nao encontramos o registro de pagamento. Verifique o resultado no app de pagamento e confirme o status do pedido com o comerciante.","pi-payment-result.failed.timeout.title":"Consulta do resultado expirou","pi-payment-result.failed.timeout.description":"A consulta do resultado do pagamento expirou. Verifique o resultado no app de pagamento e confirme o status do pedido com o comerciante para evitar pagamento duplicado.","pi-payment-result.failed.invalidParams.title":"Nao foi possivel consultar o resultado","pi-payment-result.failed.invalidParams.description":"Nao foi possivel consultar o resultado do pagamento. Verifique o resultado no app de pagamento e confirme o status do pedido com o comerciante.","pi-payment-result.querying.title":"Confirmando pagamento","pi-payment-result.querying.description":"Confirmando o resultado do pagamento."}},eZL="pisell-pi-payment-result",eZO="4004",eZR="PaymentResultRequestTimeout",eZ$=["refused","cancelled","error"],eZF=()=>{if("u"<typeof window)return{};let e=new URLSearchParams(window.location.search||"");return{resultCode:e.get("resultCode"),paymentNumber:e.get("payment_number"),shopId:e.get("shop_id")}},eZB=(e,t,l)=>"failed"===e&&l&&"failed"!==l?`pi-payment-result.failed.${l}.${t}`:`pi-payment-result.${e}.${t}`,eZH=e=>{let{status:t}=e,l=Z_();return(0,ev.jsx)("div",{"aria-label":eN.getText(`pi-payment-result.${t}.title`),className:`${eZL}__icon ${eZL}__icon--${t}`,role:"img",style:{backgroundImage:`url(${l}/${"success"===t?"success.png":"failed"===t?"error.png":"loading.png"})`}})},eZq=(0,ef.memo)(e=>{var t,l;let{className:a,style:i}=e,n=ik();eN.init(eZz,(null==n||null==(l=n.engine)||null==(t=l.props)?void 0:t.locale)||"en");let s=(0,ef.useMemo)(eZF,[]),[r,o]=(0,ef.useState)(()=>{var e;let t,l;return"failed"==(l="authorised"===(t=null==(e=s.resultCode||(()=>{if("u">typeof window)return new URLSearchParams(window.location.search||"").get("resultCode")})())?void 0:e.trim().toLowerCase())?"success":t&&eZ$.includes(t)?"failed":"querying")?{status:l,failReason:"failed"}:{status:l}}),d=a?`${eZL} ${a}`:eZL,c=eZB(r.status,"title",r.failReason),u=eZB(r.status,"description",r.failReason);return(0,ef.useEffect)(()=>{if("querying"!==r.status)return;if(!s.paymentNumber||!s.shopId)return void o({status:"failed",failReason:"invalidParams"});let e=!1,t=null,l=null,a=null,i=()=>{t&&(clearTimeout(t),t=null),l&&(clearTimeout(l),l=null),a&&(clearTimeout(a),a=null)},n=t=>{e||(e=!0,i(),o(t))},d=async()=>{var l;if(!e)try{let i,r=await Promise.race([(i={shop_id:s.shopId,number:s.paymentNumber},z_.Em.getRequest().get("/h5/pay/transaction/result",i,{fullResult:!0})),new Promise((e,t)=>{a=setTimeout(()=>{t(Error(eZR))},1e4)})]);if(a&&(clearTimeout(a),a=null),e)return;if(`${(null==r?void 0:r.code)||""}`===eZO)return void n({status:"failed",failReason:"notFound"});let o=null==r||null==(l=r.data)?void 0:l.status;if("succeed"===o)return void n({status:"success"});if("failed"===o)return void n({status:"failed",failReason:"failed"});if("pending"===o||"processing"===o){t=setTimeout(d,2e3);return}n({status:"failed",failReason:"failed"})}catch(t){if(a&&(clearTimeout(a),a=null),e)return;if(t instanceof Error&&t.message===eZR)return void n({status:"failed",failReason:"timeout"});if(("object"==typeof t&&null!==t&&"code"in t?`${t.code||""}`:"")===eZO)return void n({status:"failed",failReason:"notFound"});n({status:"failed",failReason:"failed"})}};return l=setTimeout(()=>{n({status:"failed",failReason:"timeout"})},6e4),d(),()=>{e=!0,i()}},[r.status,s.paymentNumber,s.shopId]),(0,ev.jsx)("div",{className:d,style:i,children:(0,ev.jsxs)("div",{className:`${eZL}__card`,children:[(0,ev.jsx)(eZH,{status:r.status}),(0,ev.jsx)("h1",{className:`${eZL}__title`,children:eN.getText(c)}),(0,ev.jsx)("p",{className:`${eZL}__description`,children:eN.getText(u)})]})})}),eZV={en:{"pisell-cash-counting.countCash":"Count cash","pisell-cash-counting.subtitle":"Enter the quantity for each denomination. The total will be calculated automatically.","pisell-cash-counting.currency":"Currency","pisell-cash-counting.bills":"Bills","pisell-cash-counting.coins":"Coins","pisell-cash-counting.billsSubtotal":"Bills subtotal","pisell-cash-counting.coinsSubtotal":"Coins subtotal","pisell-cash-counting.subtotal":"Subtotal","pisell-cash-counting.total":"Total","pisell-cash-counting.clearAll":"Clear all","pisell-cash-counting.cancel":"Cancel","pisell-cash-counting.confirm":"Confirm","pisell-cash-counting.placeholder":"Please enter","pisell-cash-counting.empty":"No denomination config for this currency.","pisell-cash-counting.no-country-config":"No denomination data is configured for this region. Please contact your system administrator.","pisell-cash-counting.manual-vs-count-message-title":"Tip","pisell-cash-counting.manual-vs-count-message":"The actual amount was edited manually and no longer matches the cash count details.","pisell-cash-counting.use-count-total":"Use counted total","pisell-cash-counting.keep-manual-amount":"Keep manual amount","pisell2.customise-item.save":"Save","pisell2.booking.info.text.clear":"Clear"},"zh-CN":{"pisell-cash-counting.countCash":"数钱","pisell-cash-counting.subtitle":"请输入每个面额的数量,系统将自动计算现金总额。","pisell-cash-counting.currency":"币种","pisell-cash-counting.bills":"纸币","pisell-cash-counting.coins":"硬币","pisell-cash-counting.billsSubtotal":"纸币小计","pisell-cash-counting.coinsSubtotal":"硬币小计","pisell-cash-counting.subtotal":"小计","pisell-cash-counting.total":"合计","pisell-cash-counting.clearAll":"清空","pisell-cash-counting.cancel":"取消","pisell-cash-counting.confirm":"确认","pisell-cash-counting.placeholder":"请输入","pisell-cash-counting.empty":"当前币种暂无面额配置。","pisell-cash-counting.no-country-config":"该国家未配置数据,请联系系统人员","pisell-cash-counting.manual-vs-count-message-title":"提示","pisell-cash-counting.manual-vs-count-message":"实际金额已被手动修改,当前金额与数钱明细不一致。","pisell-cash-counting.use-count-total":"使用数钱金额","pisell-cash-counting.keep-manual-amount":"保留手动金额","pisell2.customise-item.save":"保存","pisell2.booking.info.text.clear":"清空"},"zh-HK":{"pisell-cash-counting.countCash":"數錢","pisell-cash-counting.subtitle":"請輸入每個面額的數量,系統會自動計算現金總額。","pisell-cash-counting.currency":"幣種","pisell-cash-counting.bills":"紙幣","pisell-cash-counting.coins":"硬幣","pisell-cash-counting.billsSubtotal":"紙幣小計","pisell-cash-counting.coinsSubtotal":"硬幣小計","pisell-cash-counting.subtotal":"小計","pisell-cash-counting.total":"合計","pisell-cash-counting.clearAll":"清空","pisell-cash-counting.cancel":"取消","pisell-cash-counting.confirm":"確認","pisell-cash-counting.placeholder":"請輸入","pisell-cash-counting.empty":"目前幣種暫無面額配置。","pisell-cash-counting.no-country-config":"該國家未配置數據,請聯繫系統人員","pisell-cash-counting.manual-vs-count-message-title":"提示","pisell-cash-counting.manual-vs-count-message":"實際金額已被手動修改,當前金額與數錢明細不一致。","pisell-cash-counting.use-count-total":"使用數錢金額","pisell-cash-counting.keep-manual-amount":"保留手動金額","pisell2.customise-item.save":"保存","pisell2.booking.info.text.clear":"清空"},ja:{"pisell-cash-counting.countCash":"現金を数える","pisell-cash-counting.subtitle":"各金種の数量を入力すると、合計金額が自動計算されます。","pisell-cash-counting.currency":"通貨","pisell-cash-counting.bills":"紙幣","pisell-cash-counting.coins":"硬貨","pisell-cash-counting.billsSubtotal":"紙幣小計","pisell-cash-counting.coinsSubtotal":"硬貨小計","pisell-cash-counting.subtotal":"小計","pisell-cash-counting.total":"合計","pisell-cash-counting.clearAll":"クリア","pisell-cash-counting.cancel":"キャンセル","pisell-cash-counting.confirm":"確認","pisell-cash-counting.placeholder":"入力してください","pisell-cash-counting.empty":"この通貨の金種設定がありません。","pisell-cash-counting.no-country-config":"この国・地域の金種データが設定されていません。システム管理者にお問い合わせください。","pisell-cash-counting.manual-vs-count-message-title":"ヒント","pisell-cash-counting.manual-vs-count-message":"実際の金額が手入力で変更され、現在の金額が現金集計の内訳と一致しません。","pisell-cash-counting.use-count-total":"集計金額を使う","pisell-cash-counting.keep-manual-amount":"手入力の金額を残す","pisell2.customise-item.save":"保存","pisell2.booking.info.text.clear":"清空"},pt:{"pisell-cash-counting.countCash":"Contar dinheiro","pisell-cash-counting.subtitle":"Insira a quantidade de cada denomina\xe7\xe3o. O total ser\xe1 calculado automaticamente.","pisell-cash-counting.currency":"Moeda","pisell-cash-counting.bills":"Notas","pisell-cash-counting.coins":"Moedas","pisell-cash-counting.billsSubtotal":"Subtotal de notas","pisell-cash-counting.coinsSubtotal":"Subtotal de moedas","pisell-cash-counting.subtotal":"Subtotal","pisell-cash-counting.total":"Total","pisell-cash-counting.clearAll":"Limpar","pisell-cash-counting.cancel":"Cancelar","pisell-cash-counting.confirm":"Confirmar","pisell-cash-counting.placeholder":"Insira","pisell-cash-counting.empty":"Nenhuma configura\xe7\xe3o de denomina\xe7\xe3o para esta moeda.","pisell-cash-counting.no-country-config":"N\xe3o h\xe1 dados de denomina\xe7\xe3o configurados para esta regi\xe3o. Contacte o administrador do sistema.","pisell-cash-counting.manual-vs-count-message-title":"Dica","pisell-cash-counting.manual-vs-count-message":"O valor real foi editado manualmente e j\xe1 n\xe3o coincide com os detalhes da contagem de numer\xe1rio.","pisell-cash-counting.use-count-total":"Usar total contado","pisell-cash-counting.keep-manual-amount":"Manter valor manual","pisell2.customise-item.save":"Salvar","pisell2.booking.info.text.clear":"Limpar"}},eZY=e=>`${e.currency_code}-${e.denomination_type}-${e.denomination_value}`,eZU=(e,t)=>{let l=Number(String(e??0).replace(/,/g,""));if(!Number.isFinite(l))return 0;let a=Math.pow(10,t);return Math.round(l*a)/a};function eZW(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:768,[t,l]=(0,ef.useState)("u">typeof window&&window.innerWidth<e);return(0,ef.useEffect)(()=>{if("u"<typeof window)return;let t=()=>{l(window.innerWidth<e)};return window.addEventListener("resize",t),t(),()=>{window.removeEventListener("resize",t)}},[e]),t}let eZG="pisell-private-cash-counting-modal",eZQ=(e,t,l)=>{let a=new Intl.NumberFormat(void 0,{minimumFractionDigits:l,maximumFractionDigits:l});return`${t}${a.format(e)}`},eZK=(0,ef.forwardRef)((e,t)=>{var l;let{currencyCode:a,currencyDenominations:i,decimalPlaces:n,symbol:s,modalWidth:r,onCancel:o,onConfirm:d}=e,{isTerminal:c}=(null==(l=ik().appHelper)?void 0:l.utils)||{},[u,p]=(0,ef.useState)(!1),[m,g]=(0,ef.useState)({}),h=eZW(1200),v=eZW(450);(0,ef.useImperativeHandle)(t,()=>({open:e=>{let{initialQuantities:t}=e;g(t),p(!0)},close:()=>p(!1)}));let f=(0,ef.useMemo)(()=>i.reduce((e,t)=>(e[t.denomination_type].push(t),e),{bill:[],coin:[]}),[i]),y=(0,ef.useMemo)(()=>i.map(e=>{let t=m[eZY(e)]??0;return{denomination:e,quantity:t,amount:eZU(e.denomination_value*t,n)}}),[i,m,n,eZY,eZU]),x=(0,ef.useMemo)(()=>y.filter(e=>"bill"===e.denomination.denomination_type).reduce((e,t)=>e+t.amount,0),[y]),b=(0,ef.useMemo)(()=>y.filter(e=>"coin"===e.denomination.denomination_type).reduce((e,t)=>e+t.amount,0),[y]),_=(0,ef.useMemo)(()=>x+b,[x,b]),k=()=>{p(!1),"function"==typeof o&&o()},w=()=>{let e={};i.forEach(t=>e[eZY(t)]=0),g(e)},j=()=>{"function"==typeof d&&d({amount:_,currencyCode:a,decimalPlaces:n,billSubtotal:x,coinSubtotal:b,details:y,quantities:m}),p(!1)},S=(e,t,l)=>{let a=f[e];return a.length?(0,ev.jsxs)("div",{className:`${eZG}__section`,children:[(0,ev.jsxs)("div",{className:`${eZG}__section-header`,children:[(0,ev.jsxs)("div",{className:`${eZG}__section-title`,children:[(0,ev.jsx)("span",{className:`${eZG}__dot ${eZG}__dot--${e}`}),(0,ev.jsx)("span",{children:t})]}),(0,ev.jsxs)("div",{className:`${eZG}__section-subtotal`,children:[(0,ev.jsx)("span",{children:eN.getText("pisell-cash-counting.subtotal")}),(0,ev.jsx)("strong",{children:eZQ(l,s,n)})]})]}),(0,ev.jsx)("div",{className:`${eZG}__denomination-list`,children:a.map(t=>{let l=eZY(t),a=m[l]??0,i=eZU(t.denomination_value*a,n);return(0,ev.jsxs)("div",{className:`${eZG}__denomination-row`,children:[(0,ev.jsxs)("div",{className:`${eZG}__denomination-left`,children:[(0,ev.jsx)("div",{className:`${eZG}__denomination-label ${eZG}__denomination-label--${e}`,children:t.denomination_label}),(0,ev.jsx)("div",{className:`${eZG}__stepper-wrap`,children:(0,ev.jsx)(IQ,{className:`${eZG}__stepper`,min:0,max:9999,value:a,plusOnlyAtZero:!1,shape:"square",onChange:e=>g(t=>({...t,[l]:e}))})})]}),(0,ev.jsx)("div",{className:`${eZG}__row-amount`,children:eZQ(i,s,n)})]},l)})})]}):null},M=(0,ef.useCallback)(()=>(0,ev.jsxs)("div",{className:`${eZG}__modal-header`,children:[(0,ev.jsx)(lL.Iconfont,{type:"pisell2-cash",className:`${eZG}__modal-header-icon`}),(0,ev.jsx)("div",{className:`${eZG}__modal-header-title`,children:eN.getText("pisell-cash-counting.countCash")}),(0,ev.jsx)(lL.Tag,{color:"blue",style:{border:"none"},children:a})]}),[a]),N=(0,ef.useCallback)(()=>(0,ev.jsxs)("div",{className:`${eZG}__footer`,children:[(0,ev.jsxs)("div",{className:`${eZG}__summary`,children:[(0,ev.jsxs)("div",{className:`${eZG}__summary-row`,children:[(0,ev.jsx)("span",{children:eN.getText("pisell-cash-counting.billsSubtotal")}),(0,ev.jsx)("strong",{children:eZQ(x,s,n)})]}),(0,ev.jsxs)("div",{className:`${eZG}__summary-row`,children:[(0,ev.jsx)("span",{children:eN.getText("pisell-cash-counting.coinsSubtotal")}),(0,ev.jsx)("strong",{children:eZQ(b,s,n)})]}),(0,ev.jsxs)("div",{className:`${eZG}__total-row`,children:[(0,ev.jsx)("span",{children:eN.getText("pisell-cash-counting.total")}),(0,ev.jsx)("strong",{children:eZQ(_,s,n)})]})]}),(0,ev.jsxs)("div",{className:`${eZG}__actions`,children:[(0,ev.jsx)(lL.Button,{type:"text",size:"large",onClick:w,children:eN.getText("pisell-cash-counting.clearAll")}),(0,ev.jsx)(lL.Button,{size:"large",onClick:k,children:eN.getText("pisell-cash-counting.cancel")}),(0,ev.jsx)(lL.Button,{type:"primary",size:"large",disabled:!i.length,onClick:j,children:eN.getText("pisell-cash-counting.confirm")})]})]}),[b,x,_,i,w,k,j]);return(0,ev.jsx)(lL.PisellModal,{destroyOnClose:!0,maskClosable:!1,footer:N(),open:u,title:M(),className:`${eZG}__modal-wrap`,bodyStyle:{padding:0},width:r||((null==c?void 0:c())?"80%":"880px"),onCancel:k,children:(0,ev.jsxs)("div",{className:`${eZG}__modal`,children:[(0,ev.jsxs)("div",{className:`${eZG}__modal-intro`,children:[(0,ev.jsx)(rD,{style:{fontSize:18,color:"#F2A63A"}}),eN.getText("pisell-cash-counting.subtitle")]}),(0,ev.jsx)("div",{className:`${eZG}__scroll ${h||v?`${eZG}__scroll-column`:""} ${v?`${eZG}__scroll-mobile`:""}`,children:0===i.length?(0,ev.jsx)("div",{className:`${eZG}__empty`,children:eN.getText("pisell-cash-counting.empty")}):(0,ev.jsxs)(ev.Fragment,{children:[S("bill",eN.getText("pisell-cash-counting.bills"),x),S("coin",eN.getText("pisell-cash-counting.coins"),b)]})})]})})}),eZJ="pisell-private-cash-counting",eZZ=e=>{var t,l;let a=ik();eN.init(eZV,(null==a||null==(l=a.engine)||null==(t=l.props)?void 0:t.locale)||"en");let{disabled:i=!1,countDisabled:n=!1,placeholder:s,layout:r="vertical",countCashButtonText:o,showCurrencySymbol:d=!0,useThousandsSeparator:c=!1,inputNumberProps:u,buttonProps:p,className:m,style:g,modalWidth:h}=e,{modalRef:v,triggerRef:f,keyboardOpen:y,setKeyboardOpen:x,currencyDenominations:b,decimalPlaces:_,symbol:k,currencyCode:w,currentValue:j,handleAmountChange:S,handleKeyboardClose:M,openCountModal:N,handleCountCancel:C,handleCountConfirm:T,manualCountMismatchOpen:P,confirmUseCountedTotal:A,confirmKeepManualAmount:D}=function(e){var t,l,a,i;let{value:n,defaultValue:s="",currencyCode:r,currencySymbol:o,amountPrecision:d,denominations:c=[],disabled:u=!1,countDisabled:p=!1,onChange:m,onCountConfirm:g,onCountCancel:h}=e,{store:v}=(null==(t=ik().appHelper)?void 0:t.utils)||{},f=(0,ef.useRef)(null),y=(0,ef.useRef)(null),[x,b]=(0,ef.useState)(!1),[_,k]=(0,ef.useState)(s),[w,j]=(0,ef.useState)({}),S=(0,ef.useRef)(null),M=(0,ef.useRef)(null),[N,C]=(0,ef.useState)(!1),T=(0,ef.useMemo)(()=>{var e,t;let l=(null==v||null==(t=v.getState)||null==(e=t.call(v))?void 0:e.global)||{};return{symbol:(null==l?void 0:l.symbol)||"$",currency_code:(null==l?void 0:l.currency_code)||"AUD"}},[null==v||null==(a=v.getState)||null==(l=a.call(v))?void 0:l.global]),P=(0,ef.useMemo)(()=>r||(null==T?void 0:T.currency_code),[r,null==T?void 0:T.currency_code]),A=(0,ef.useMemo)(()=>c.filter(e=>e.currency_code===P&&!1!==e.is_enabled&&!1!==e.effective_status&&"inactive"!==e.effective_status).sort((e,t)=>e.sort_order-t.sort_order),[P,c]),D=(0,ef.useMemo)(()=>{var e;return"number"==typeof d?d:(null==(e=A[0])?void 0:e.decimal_places)??2},[d,null==(i=A[0])?void 0:i.decimal_places]),I=(0,ef.useMemo)(()=>o||(null==T?void 0:T.symbol),[o,null==T?void 0:T.symbol]),E=(0,ef.useMemo)(()=>String(n??_),[n,_]),z=(0,ef.useCallback)((e,t)=>{void 0===n&&k(e),"function"==typeof m&&m(e,{source:t})},[D,m,n]),L=(0,ef.useCallback)(e=>{M.current=e,z(String(e),"manual")},[z]),O=(0,ef.useCallback)(()=>{var e;b(!1),(null==(e=S.current)?void 0:e.amount)&&Number(S.current.amount)!==Number(M.current)&&C(!0)},[C]),R=(0,ef.useCallback)(()=>{var e;z((null==(e=S.current)?void 0:e.amount)??"","count"),C(!1)},[z]),$=(0,ef.useCallback)(()=>{S.current=null,j({}),z(M.current??"","manual"),C(!1)},[z]),F=(0,ef.useCallback)(()=>{var e;if(u||p)return;if(0===A.length)return void ex.message.warning(eN.getText("pisell-cash-counting.no-country-config"));let t={...A.reduce((e,t)=>(e[eZY(t)]=0,e),{}),...w};b(!1),null==(e=f.current)||e.open({initialQuantities:t})},[w,p,A,u]);return{modalRef:f,triggerRef:y,keyboardOpen:x,setKeyboardOpen:b,currencyDenominations:A,decimalPlaces:D,symbol:I,currencyCode:P,currentValue:E,handleAmountChange:L,handleKeyboardClose:O,openCountModal:F,handleCountCancel:(0,ef.useCallback)(()=>{null==h||h()},[h]),handleCountConfirm:(0,ef.useCallback)(e=>{S.current=e,j(e.quantities),z(e.amount,"count"),"function"==typeof g&&g(e)},[g,z]),manualCountMismatchOpen:N,confirmUseCountedTotal:R,confirmKeepManualAmount:$}}(e);return(0,ev.jsxs)("div",{className:t_()(eZJ,m),style:g,children:[(0,ev.jsxs)("div",{className:t_()(`${eZJ}__field`,{[`${eZJ}__field--horizontal`]:"horizontal"===r}),ref:f,children:[(0,ev.jsx)(ex.InputNumber,{...u,controls:!1,disabled:i,precision:_,value:j,placeholder:s??eN.getText("pisell-cash-counting.placeholder"),className:t_()(`${eZJ}__input`,null==u?void 0:u.className),readOnly:!0,addonBefore:k,size:"large",style:{width:"100%"},onClick:()=>{i||x(!0)},onChange:S}),(0,ev.jsx)(ex.Button,{...p,type:"primary",disabled:i||n||(null==p?void 0:p.disabled),className:t_()(`${eZJ}__button`,null==p?void 0:p.className),onClick:e=>{var t;null==p||null==(t=p.onClick)||t.call(p,e),N()},children:o??eN.getText("pisell-cash-counting.countCash")})]}),(0,ev.jsx)(IU,{mode:"decimal",containerProps:{renderType:"modal",open:y,onCancel:M},value:j,originalValue:j,maxLength:10,precision:2,onChange:S,onEnter:M}),(0,ev.jsx)(lL.PisellModal.Information,{open:P,closable:!1,maskClosable:!1,title:eN.getText("pisell-cash-counting.manual-vs-count-message-title"),describe:eN.getText("pisell-cash-counting.manual-vs-count-message"),okText:eN.getText("pisell-cash-counting.keep-manual-amount"),cancelText:eN.getText("pisell-cash-counting.use-count-total"),onOk:D,onCancel:A}),(0,ev.jsx)(eZK,{ref:v,modalWidth:h,currencyCode:w,currencyDenominations:b,decimalPlaces:_,symbol:k,onCancel:C,onConfirm:T})]})},eZX=(0,ef.forwardRef)((e,t)=>{let{triggerType:l="input",searchMode:a="confirm",showConfirmButton:i=!0,enableScanner:n=!1,autoFocusOnOpen:s=!1,...r}=e;return(0,ev.jsx)(VJ,{ref:t,triggerType:l,searchMode:a,showConfirmButton:i,enableScanner:n,autoFocusOnOpen:s,...r})});eZX.displayName="GlobalSearchFind";let eZ0="__all__",eZ2=(e,t,l)=>Math.min(l,Math.max(t,e));function eZ1(e){let{initialRatio:t=.34,minRatio:l=.24,maxRatio:a=.6}=e||{},[i,n]=(0,ef.useState)(()=>eZ2(t,l,a)),[s,r]=(0,ef.useState)(!1),o=(0,ef.useRef)(null),d=(0,ef.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let t=o.current;if(!t)return;r(!0);let i=document.body.style.userSelect,s=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";let d=e=>{let i=t.getBoundingClientRect();i.width<=0||n(eZ2((i.right-e.clientX)/i.width,l,a))},c=()=>{r(!1),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",c),document.body.style.userSelect=i,document.body.style.cursor=s};document.addEventListener("mousemove",d),document.addEventListener("mouseup",c)},[l,a]);return{ratio:i,rightWidth:`${(100*i).toFixed(2)}%`,containerRef:o,onResizerMouseDown:d,resizing:s}}let eZ4={loading:!1,list:[],total:0};function eZ3(e){let{keyword:t,activeTab:l,providers:a,allModePageSize:i,singleModePageSize:n,mode:s,onRealtimePatchItems:r}=e,[o,d]=(0,ef.useState)(()=>{let e;return e={},a.forEach(t=>{e[t.key]={...eZ4}}),e}),c=(0,ef.useRef)(new Map),u=(0,ef.useRef)(new Map),p=(0,ef.useRef)({keyword:t,activeTab:l,providers:a,allModePageSize:i,singleModePageSize:n,mode:s,onRealtimePatchItems:r});p.current={keyword:t,activeTab:l,providers:a,allModePageSize:i,singleModePageSize:n,mode:s,onRealtimePatchItems:r};let m=(0,ef.useCallback)((e,t)=>{d(l=>({...l,[e]:{...l[e]??eZ4,...t}}))},[]),g=(0,ef.useCallback)((e,t)=>{d(l=>{let a=l[e]??eZ4;return a.total===t?l:{...l,[e]:{...a,total:t}}})},[]),h=(0,ef.useCallback)((e,t)=>{Array.isArray(t)&&0!==t.length&&d(l=>{let a=l[e]??eZ4,i=new Map;if(t.forEach(e=>{let t=eZ8(e);t&&i.set(t,e)}),0===i.size)return l;let n=!1,s=(a.list??[]).map(e=>{let t=eZ8(e);if(!t)return e;let l=i.get(t);return l?(n=!0,{...e,...l}):e});return n?{...l,[e]:{...a,list:s}}:l})},[]),v=(0,ef.useCallback)((e,t,l,a,i)=>{var n,s;null==(n=c.current.get(e.key))||n.abort(),null==(s=u.current.get(e.key))||s(),u.current.delete(e.key);let r=new AbortController;c.current.set(e.key,r);let o=`global-search-${String(e.key)}-${i}`;m(e.key,{loading:!0,error:void 0}),e.search({keyword:l,pageSize:t,signal:r.signal,mode:a,scope:i,onRealtimePatch:t=>{var l,a;h(e.key,t),null==(l=(a=p.current).onRealtimePatchItems)||l.call(a,e.key,t)},realtimeSubscriberId:o,onRealtimeCleanup:t=>{u.current.set(e.key,t)}}).then(t=>{r.signal.aborted||m(e.key,{loading:!1,list:t.list??[],total:t.total??0,resolvedKeyword:l,error:void 0})}).catch(t=>{r.signal.aborted||t instanceof Error&&"AbortError"===t.name||m(e.key,{loading:!1,error:t instanceof Error?t:Error(String(t))})})},[h,m]),f=(0,ef.useCallback)(()=>{let{keyword:e,activeTab:t,providers:l,allModePageSize:a,singleModePageSize:i,mode:n}=p.current;if(t===eZ0)l.forEach(t=>v(t,a,e,n,"all"));else{let a=l.find(e=>e.key===t);a&&v(a,i,e,n,"single")}},[v]);return(0,ef.useEffect)(()=>{f()},[t,l,a,s,f]),(0,ef.useEffect)(()=>{d(e=>{let t={...e};return a.forEach(e=>{t[e.key]||(t[e.key]={...eZ4})}),t})},[a]),(0,ef.useEffect)(()=>{let e=c.current,t=u.current;return()=>{e.forEach(e=>e.abort()),e.clear(),t.forEach(e=>e()),t.clear()}},[]),{stateMap:o,refresh:f,reportProviderTotal:g}}function eZ8(e){if(!e||"object"!=typeof e)return null;let t=e.order_id??e.id??e.key;return null==t||""===t?null:String(t)}let eZ6={en:{"pisell-global-search.title":"Global Search","pisell-global-search.description":"All-in-One Search","pisell-global-search.placeholder":"Search reservations, orders, resources…","pisell-global-search.search":"Search","pisell-global-search.tab.all":"All","pisell-global-search.empty":"No results","pisell-global-search.empty.idle":"Type to search across modules","pisell-global-search.view-all":"View all","pisell-global-search.loading":"Loading…","pisell-global-search.error":"Failed to load. Click to retry","pisell-global-search.mode.label":"Mode","pisell-global-search.mode.admin":"Admin","pisell-global-search.mode.business":"Business","pisell-global-search.scope.label":"Scope","pisell-global-search.detail.idle":"Select a row to view details","pisell-global-search.detail.title":"Details","pisell-global-search.providers-missing.title":"Providers not configured","pisell-global-search.providers-missing.description":"Pass business search providers in pro-code, for example:","pisell-global-search.order-result-unavailable.title":"Order results are temporarily unavailable","pisell-global-search.order-result-unavailable.description":"Order results require the admin lowcode engine context. View this inside an admin page, or check whether the engine context is injected."},"zh-CN":{"pisell-global-search.title":"全局搜索","pisell-global-search.description":"一站式搜索","pisell-global-search.placeholder":"搜索预约、订单、资源…","pisell-global-search.search":"搜索","pisell-global-search.tab.all":"全部","pisell-global-search.empty":"暂无结果","pisell-global-search.empty.idle":"输入关键词跨模块搜索","pisell-global-search.view-all":"查看全部","pisell-global-search.loading":"加载中…","pisell-global-search.error":"加载失败,点击重试","pisell-global-search.mode.label":"模式","pisell-global-search.mode.admin":"管理模式","pisell-global-search.mode.business":"业务模式","pisell-global-search.scope.label":"搜索范围","pisell-global-search.detail.idle":"选择左侧记录查看详情","pisell-global-search.detail.title":"详情","pisell-global-search.providers-missing.title":"未注入 providers","pisell-global-search.providers-missing.description":"请在 pro-code 中传入业务搜索 providers,例如:","pisell-global-search.order-result-unavailable.title":"订单结果暂不可用","pisell-global-search.order-result-unavailable.description":"订单结果依赖 admin lowcode 引擎上下文。请在 admin 页面内查看,或检查 engine context 是否注入。"},"zh-HK":{"pisell-global-search.title":"全局搜尋","pisell-global-search.description":"一站式搜尋","pisell-global-search.placeholder":"搜尋預約、訂單、資源…","pisell-global-search.search":"搜尋","pisell-global-search.tab.all":"全部","pisell-global-search.empty":"暫無結果","pisell-global-search.empty.idle":"輸入關鍵字跨模組搜尋","pisell-global-search.view-all":"查看全部","pisell-global-search.loading":"載入中…","pisell-global-search.error":"載入失敗,點擊重試","pisell-global-search.mode.label":"模式","pisell-global-search.mode.admin":"管理模式","pisell-global-search.mode.business":"業務模式","pisell-global-search.scope.label":"搜尋範圍","pisell-global-search.detail.idle":"選擇左側記錄查看詳情","pisell-global-search.detail.title":"詳情","pisell-global-search.providers-missing.title":"未注入 providers","pisell-global-search.providers-missing.description":"請在 pro-code 中傳入業務搜尋 providers,例如:","pisell-global-search.order-result-unavailable.title":"訂單結果暫不可用","pisell-global-search.order-result-unavailable.description":"訂單結果依賴 admin lowcode 引擎上下文。請在 admin 頁面內查看,或檢查 engine context 是否注入。"},ja:{"pisell-global-search.title":"グローバル検索","pisell-global-search.description":"オールインワン検索","pisell-global-search.placeholder":"予約、注文、リソースを検索…","pisell-global-search.search":"検索","pisell-global-search.tab.all":"すべて","pisell-global-search.empty":"結果がありません","pisell-global-search.empty.idle":"キーワードを入力して横断検索","pisell-global-search.view-all":"すべて表示","pisell-global-search.loading":"読み込み中…","pisell-global-search.error":"読み込みに失敗しました。クリックして再試行","pisell-global-search.mode.label":"モード","pisell-global-search.mode.admin":"管理モード","pisell-global-search.mode.business":"業務モード","pisell-global-search.scope.label":"検索範囲","pisell-global-search.detail.idle":"行を選択して詳細を表示","pisell-global-search.detail.title":"詳細","pisell-global-search.providers-missing.title":"providers が設定されていません","pisell-global-search.providers-missing.description":"pro-code で業務検索 providers を渡してください。例:","pisell-global-search.order-result-unavailable.title":"注文結果は一時的に利用できません","pisell-global-search.order-result-unavailable.description":"注文結果には admin lowcode エンジンコンテキストが必要です。admin ページ内で表示するか、engine context が注入されているか確認してください。"},pt:{"pisell-global-search.title":"Pesquisa Global","pisell-global-search.description":"Pesquisa Tudo-em-Um","pisell-global-search.placeholder":"Pesquise reservas, vendas, recursos…","pisell-global-search.search":"Pesquisar","pisell-global-search.tab.all":"Tudo","pisell-global-search.empty":"Nenhum resultado","pisell-global-search.empty.idle":"Digite uma palavra-chave para pesquisar","pisell-global-search.view-all":"Ver tudo","pisell-global-search.loading":"Carregando…","pisell-global-search.error":"Falha ao carregar. Clique para tentar novamente","pisell-global-search.mode.label":"Modo","pisell-global-search.mode.admin":"Modo de administra\xe7\xe3o","pisell-global-search.mode.business":"Modo de neg\xf3cios","pisell-global-search.scope.label":"Escopo","pisell-global-search.detail.idle":"Selecione uma linha para ver os detalhes","pisell-global-search.detail.title":"Detalhes","pisell-global-search.providers-missing.title":"Providers n\xe3o configurados","pisell-global-search.providers-missing.description":"Passe os providers de pesquisa de neg\xf3cios no pro-code, por exemplo:","pisell-global-search.order-result-unavailable.title":"Resultados de pedidos temporariamente indispon\xedveis","pisell-global-search.order-result-unavailable.description":"Os resultados de pedidos exigem o contexto do mecanismo lowcode admin. Veja dentro de uma p\xe1gina admin ou verifique se o engine context foi injetado."}};function eZ5(e){let t=String(e||"en").toLowerCase().replace("_","-");return"zh"===t||"zh-cn"===t||"zh-hans"===t?"zh-CN":"zh-hk"===t||"zh-tw"===t||"zh-hant"===t?"zh-HK":"ja"===t||t.startsWith("ja-")?"ja":"pt"===t||t.startsWith("pt-")?"pt":"en"}function eZ7(e){var t,l;let a=eN.getText(e);return a&&a!==e?a:(null==(l=eZ6[eZ5(null==(t=eN.getLocale)?void 0:t.call(eN))])?void 0:l[e])||eZ6.en[e]||e}function eZ9(e,t){return e&&(e[eZ5(t)]||e.en||e["zh-CN"]||e["zh-HK"])||""}let eXe=e=>{let{providers:t,stateMap:l,keyword:a,mode:i,searchMode:n,locale:s,onJumpTab:r,onClose:o,navigate:d,onAutoOpenUniqueOrderDetail:c,onOpenDetail:u,onRealtimePatchItems:p,detailRefreshVersions:m,onReportTotal:g}=e,h={searchMode:n,close:o,navigate:d,onAutoOpenUniqueOrderDetail:c,onOpenDetail:u,onRealtimePatchItems:p,detailRefreshVersions:m,onReportTotal:g};return t.every(e=>{var t;if(e.renderResults)return!1;let a=l[e.key];return!(null==a?void 0:a.loading)&&((null==a||null==(t=a.list)?void 0:t.length)??0)===0&&!(null==a?void 0:a.error)})?(0,ev.jsx)("div",{className:"pisell-global-search__empty",children:a?eN.getText("pisell-global-search.empty"):eN.getText("pisell-global-search.empty.idle")}):(0,ev.jsx)("div",{className:"pisell-global-search__groups",children:t.map(e=>{let t=l[e.key];if(!t)return null;let{loading:n,list:o,total:d,error:c}=t;return e.renderResults||n||0!==o.length||c?(0,ev.jsxs)("section",{className:"pisell-global-search__group",children:["business"!==i&&(0,ev.jsxs)("header",{className:"pisell-global-search__group-header",children:[(0,ev.jsxs)("span",{className:"pisell-global-search__group-title",children:[e.icon,eZ9(e.label,s),d>0&&(0,ev.jsxs)("span",{children:["(",d,")"]})]}),d>o.length&&(0,ev.jsx)("button",{type:"button",className:"pisell-global-search__view-all",onClick:()=>r(e.key),children:eN.getText("pisell-global-search.view-all")})]}),(0,ev.jsx)("div",{className:`pisell-global-search__group-body${e.renderResults?" pisell-global-search__group-body--bare":""}`,children:e.renderResults?e.renderResults({state:t,keyword:a,mode:i,layout:"grouped"},{keyword:a,...h}):n&&0===o.length?(0,ev.jsx)("div",{className:"pisell-global-search__group-loading",children:(0,ev.jsx)(ex.Spin,{size:"small"})}):c?(0,ev.jsx)("div",{className:"pisell-global-search__group-error",children:eN.getText("pisell-global-search.error")}):(0,ev.jsx)("ul",{className:"pisell-global-search__group-list",children:o.map((t,l)=>(0,ev.jsx)("li",{className:"pisell-global-search__group-item",children:e.renderItem(t,{keyword:a,...h})},function(e,t){if(e&&"object"==typeof e){if("string"==typeof e.id||"number"==typeof e.id)return e.id;if("string"==typeof e.key||"number"==typeof e.key)return e.key}return t}(t,l)))})})]},e.key):null})})},eXt=e=>{let{provider:t,state:l,keyword:a,mode:i,searchMode:n,onClose:s,navigate:r,onAutoOpenUniqueOrderDetail:o,onOpenDetail:d,onRealtimePatchItems:c,detailRefreshVersions:u,onReportTotal:p}=e,{loading:m,list:g,error:h}=l,v={keyword:a,searchMode:n,close:s,navigate:r,onAutoOpenUniqueOrderDetail:o,onOpenDetail:d,onRealtimePatchItems:c,detailRefreshVersions:u,onReportTotal:p};return t.renderResults?(0,ev.jsx)("div",{className:"pisell-global-search__single-custom",children:t.renderResults({state:l,keyword:a,mode:i,layout:"single"},v)}):m&&0===g.length?(0,ev.jsx)("div",{className:"pisell-global-search__single-loading",children:(0,ev.jsx)(ex.Spin,{})}):h?(0,ev.jsx)("div",{className:"pisell-global-search__single-error",children:eN.getText("pisell-global-search.error")}):0===g.length?(0,ev.jsx)("div",{className:"pisell-global-search__empty",children:a?eN.getText("pisell-global-search.empty"):eN.getText("pisell-global-search.empty.idle")}):(0,ev.jsx)("ul",{className:"pisell-global-search__single-list",children:g.map((e,l)=>(0,ev.jsx)("li",{className:"pisell-global-search__single-item",children:t.renderItem(e,v)},function(e,t){if(e&&"object"==typeof e){if("string"==typeof e.id||"number"==typeof e.id)return e.id;if("string"==typeof e.key||"number"==typeof e.key)return e.key}return t}(e,l)))})},eXl=e=>{let{options:t,value:l,onChange:a,scopeLabel:i,extra:n,className:s,style:r}=e;return t&&0!==t.length?(0,ev.jsxs)("div",{className:`pisell-global-search-scope-bar ${s??""}`.trim(),style:r,children:[(0,ev.jsx)("span",{className:"pisell-global-search-scope-bar__label",children:i??eN.getText("pisell-global-search.scope.label")}),(0,ev.jsx)(ex.Radio.Group,{className:"pisell-global-search-scope-bar__radio",value:l,onChange:e=>a(e.target.value),options:t}),n&&(0,ev.jsx)("div",{className:"pisell-global-search-scope-bar__extra",children:n})]}):n?(0,ev.jsxs)("div",{className:`pisell-global-search-scope-bar pisell-global-search-scope-bar--no-radio ${s??""}`.trim(),style:r,children:[(0,ev.jsx)("span",{className:"pisell-global-search-scope-bar__spacer"}),(0,ev.jsx)("div",{className:"pisell-global-search-scope-bar__extra",children:n})]}):null},eXa=(0,ef.forwardRef)((e,t)=>{var l,a,i,n,s;let{providers:r,permissionContext:o,activeTab:d,onActiveTabChange:c,allModePageSize:u=5,singleModePageSize:p=20,allTabLabel:m,navigate:g,defaultMode:h="business",mode:v,onModeChange:f,showModeSwitch:y=!0,modeOptions:x,submitMode:b="submit",lookupProps:_,variant:k,className:w,style:j}=e,S=ik(),M=eZ5(null==(l=eN.getLocale)?void 0:l.call(eN));eN.init(eZ6,M),(null==S||null==(i=S.appHelper)||null==(a=i.utils)?void 0:a.request)&&(z_.Em.setRequest(S.appHelper.utils.request),eV$=eVR(S.appHelper.utils.isWebPos));let N=(0,ef.useMemo)(()=>[...(Array.isArray(r)?r:[]).filter(e=>e&&e.enabledWhen?e.enabledWhen(o??{}):!!e)].sort((e,t)=>(e.order??Number.MAX_SAFE_INTEGER)-(t.order??Number.MAX_SAFE_INTEGER)),[r,o]),[C,T]=(0,ef.useState)(""),[P,A]=(0,ef.useState)(""),D="phone"===k||"smallTablet"===k||"tablet"===k,[I,E]=(0,ef.useState)(null),z=(0,ef.useCallback)(e=>{let{providerKey:t,id:l}=e;null!=l&&""!==l&&E({providerKey:t,id:l})},[]),L=D?void 0:z;(0,ef.useEffect)(()=>{E(null)},[C]);let{rightWidth:O,containerRef:R,onResizerMouseDown:$,resizing:F}=eZ1({initialRatio:.38}),B=N.length>=1,[H,q]=(0,ef.useState)(B?eZ0:(null==(n=N[0])?void 0:n.key)??eZ0),V=B||H!==eZ0?H:(null==(s=N[0])?void 0:s.key)??eZ0,Y=d??V,U=(0,ef.useCallback)(e=>{void 0===d&&q(e),null==c||c(e)},[d,c]),[W,G]=(0,ef.useState)(h),Q=v??W,K=(0,ef.useCallback)(e=>{void 0===v&&G(e),null==f||f(e)},[v,f]),{stateMap:J,refresh:Z,reportProviderTotal:X}=eZ3({keyword:C,activeTab:Y,providers:N,allModePageSize:u,singleModePageSize:p,mode:Q}),ee=(0,ef.useRef)(null);(0,ef.useImperativeHandle)(t,()=>({open:()=>{var e;return null==(e=ee.current)?void 0:e.open()},close:()=>{var e;return null==(e=ee.current)?void 0:e.close()},setKeyword:e=>{var t;null==(t=ee.current)||t.setKeyword(e),A(e),T(e)},getKeyword:()=>C,setActiveTab:U,setMode:K,getMode:()=>Q,refresh:Z}),[C,U,K,Q,Z]);let et=(0,ef.useMemo)(()=>{let e=N.map(e=>({value:e.key,label:(0,ev.jsxs)("span",{className:"pisell-global-search-scope-bar__option",children:[e.icon,eZ9(e.label,M)]})}));return B&&e.unshift({value:eZ0,label:(0,ev.jsx)("span",{className:"pisell-global-search-scope-bar__option",children:m?eZ9(m,M):eZ7("pisell-global-search.tab.all")})}),e},[N,B,m,M]),el=(0,ef.useMemo)(()=>{let e=(null==x?void 0:x.admin)?eZ9(x.admin,M):eZ7("pisell-global-search.mode.admin");return[{label:(null==x?void 0:x.business)?eZ9(x.business,M):eZ7("pisell-global-search.mode.business"),value:"business"},{label:e,value:"admin"}]},[x,M]),ea=y?(0,ev.jsx)(ex.Segmented,{className:"pisell-global-search__mode-segmented",options:el,value:Q,onChange:e=>K(e)}):null,ei=(0,ef.useCallback)((e,t)=>{let l=t??(()=>{var e;return null==(e=ee.current)?void 0:e.close()}),a=Y===eZ0,i=I?"order"===I.providerKey?(0,ev.jsx)(eV6,{renderType:"current",tmpl:"A",variant:"tablet",osProps:{osKey:"global-search-order-detail",orderId:Number(I.id),autoBootstrap:!0,destroyOnUnmount:!0}}):null:(0,ev.jsx)("div",{className:"pisell-global-search__detail-idle",children:eZ7("pisell-global-search.detail.idle")}),n=!D&&!!e&&"admin"===Q;return 0===N.length?(0,ev.jsx)("div",{className:`pisell-global-search ${w??""}`.trim(),style:j,children:(0,ev.jsxs)("div",{className:"pisell-global-search__empty",children:[(0,ev.jsx)("div",{style:{marginBottom:8,fontWeight:600},children:eZ7("pisell-global-search.providers-missing.title")}),(0,ev.jsxs)("div",{style:{fontSize:12,lineHeight:1.6},children:[eZ7("pisell-global-search.providers-missing.description"),(0,ev.jsx)("br",{}),(0,ev.jsx)("code",{style:{background:"#f3f4f6",padding:"0 4px"},children:"<PisellGlobalSearch providers={allProviders} />"})]})]})}):(0,ev.jsxs)("div",{className:`pisell-global-search pisell-global-search--${k||"desktop"} ${w??""}`.trim(),style:j,children:[(et.length>=1||ea)&&(0,ev.jsx)("div",{className:"pisell-global-search__scope-wrap",children:(0,ev.jsx)(eXl,{options:et,value:Y,onChange:e=>U(e),extra:ea})}),(0,ev.jsxs)("div",{className:`pisell-global-search__content${F?" pisell-global-search__content--resizing":""}`,ref:R,children:[(0,ev.jsx)("div",{className:"pisell-global-search__body",children:a?(0,ev.jsx)(eXe,{providers:N,stateMap:J,keyword:e,mode:Q,locale:M,onJumpTab:U,onClose:l,navigate:g,onOpenDetail:L,onReportTotal:X}):(()=>{let t=N.find(e=>e.key===Y);if(!t)return null;let a=J[t.key]??{loading:!1,list:[],total:0};return(0,ev.jsx)(eXt,{provider:t,state:a,keyword:e,mode:Q,onClose:l,navigate:g,onOpenDetail:L,onReportTotal:X})})()}),n&&(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("div",{className:"pisell-global-search__resizer",onMouseDown:$,role:"separator","aria-orientation":"vertical"}),(0,ev.jsx)("aside",{className:"pisell-global-search__detail",style:{flex:`0 0 ${O}`,width:O},children:i})]})]})]})},[Y,w,j,et,N,J,M,U,g,X,ea,Q,k,D,I,L,O,R,$,F]),en=(0,ef.useMemo)(()=>({triggerType:"input",displayType:"modal",placeholder:eZ7("pisell-global-search.placeholder"),confirmButtonText:eZ7("pisell-global-search.search"),modalWidth:1080,showHistory:!0,historyKey:"pisell_global_search_history",..._}),[_]),es="instant"===b?"realtime":"confirm",er=(0,ef.useCallback)(e=>{A(e),"instant"===b&&T(e)},[b]),eo=(0,ef.useCallback)(e=>{A(e),T(e)},[]);return(0,ev.jsx)(eZX,{ref:ee,size:"phone"===k?"small":void 0,...en,searchMode:es,value:P,onChange:er,onSearch:eo,resultRender:ei})});eXa.displayName="PisellGlobalSearch";let eXi=iW(eXa),eXn=e=>{let{refreshVersion:t=0,...l}=e,a=(0,ef.useRef)(null),i=(0,ef.useRef)(!1);return(0,ef.useEffect)(()=>{var e,t,n;if(!i.current){i.current=!0;return}let s=null==l||null==(e=l.osProps)?void 0:e.preloadedSalesDetail;s&&"object"==typeof s?null==(t=a.current)||t.refresh({preloadedSalesDetail:s}):null==(n=a.current)||n.refresh({forceRemote:!1})},[t]),(0,ev.jsx)(eV6,{ref:a,...l})},eXs=["bookings","products","payments","vouchers","surcharges","discount_list","relation_forms","contacts_info","holder","summary","customer","refunds"];function eXr(e){let{filters:t,sort:l,page:a=1,perPage:i=20}=e;return{page:a,per_page:i,...t&&Object.keys(t).length?{filters:t}:{},...l&&l.length?{sort:l}:{}}}function eXo(e,t,l){let a=Array.isArray(null==e?void 0:e.list)?e.list:[],i=Number((null==e?void 0:e.count)??a.length)||0,n=Number((null==e?void 0:e.skip)??t)||t,s=Number((null==e?void 0:e.size)??l)||l;return{items:a,total:i,page:n,perPage:s,hasMore:n*s<i}}async function eXd(e){let{page:t=1,perPage:l=20,signal:a,subscriberId:i,callback:n,resetVisibleOrderIds:s}=e,r={search_mode:e.searchMode,with:eXs,...eXr(e),keyword:e.keyword},o=await z_.Em.getRequest().post("/shop/es/search/sales",r,{fullResult:!0,isShopApi:!0,osServer:!0,signal:a,subscriberId:i,callback:n,resetVisibleOrderIds:s});return eXo(null==o?void 0:o.data,t,l)}async function eXc(e){var t;let{page:l=1,perPage:a=20,signal:i,subscriberId:n,callback:s,resetVisibleOrderIds:r}=e,o={search_mode:e.searchMode,with:eXs,keyword:e.keyword,modules:[{module:"sales",data:eXr(e)}]},d=await z_.Em.getRequest().post("/shop/es/search",o,{fullResult:!0,isShopApi:!0,osServer:!0,signal:i,subscriberId:n,callback:s,resetVisibleOrderIds:r}),c=null==d||null==(t=d.data)?void 0:t.results;return eXo(Array.isArray(c)?c.find(e=>(null==e?void 0:e.module)==="sales"):void 0,l,a)}async function eXu(e){await eVF("/shop/es/search/sales/unsubscribe",e,{fullResult:!0})}async function eXp(e){await eVF("/shop/es/search/unsubscribe",e,{fullResult:!0})}let eXm=e=>{let t=(null==e?void 0:e.order_id)??(null==e?void 0:e.id);if(null==t)return;let l=Number(t);return Number.isFinite(l)?l:void 0};function eXg(e){let t=(null==e?void 0:e.data)??e;if(Array.isArray(null==t?void 0:t.list))return t.list;let l=(Array.isArray(null==t?void 0:t.results)?t.results:[]).find(e=>(null==e?void 0:e.module)==="sales");return Array.isArray(null==l?void 0:l.list)?l.list:[]}function eXh(e){return e instanceof HTMLElement||e instanceof SVGElement}function eXv(e){var t,l=e&&"object"===(0,tk.A)(e)&&eXh(e.nativeElement)?e.nativeElement:eXh(e)?e:null;return l||(e instanceof ey().Component?null==(t=iM().findDOMNode)?void 0:t.call(iM(),e):null)}var eXf=ef.createContext(null),eXy=function(){if("u">typeof Map)return Map;function e(e,t){var l=-1;return e.some(function(e,a){return e[0]===t&&(l=a,!0)}),l}function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var l=e(this.__entries__,t),a=this.__entries__[l];return a&&a[1]},t.prototype.set=function(t,l){var a=e(this.__entries__,t);~a?this.__entries__[a][1]=l:this.__entries__.push([t,l])},t.prototype.delete=function(t){var l=this.__entries__,a=e(l,t);~a&&l.splice(a,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var l=0,a=this.__entries__;l<a.length;l++){var i=a[l];e.call(t,i[1],i[0])}},t}(),eXx="u">typeof window&&"u">typeof document&&window.document===document,eXb=void 0!==i.g&&i.g.Math===Math?i.g:"u">typeof self&&self.Math===Math?self:"u">typeof window&&window.Math===Math?window:Function("return this")(),eX_="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(eXb):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)},eXk=["top","right","bottom","left","width","height","size","weight"],eXw="u">typeof MutationObserver,eXj=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e){var t=!1,l=!1,a=0;function i(){t&&(t=!1,e()),l&&s()}function n(){eX_(i)}function s(){var e=Date.now();if(t){if(e-a<2)return;l=!0}else t=!0,l=!1,setTimeout(n,20);a=e}return s}(this.refresh.bind(this))}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,l=t.indexOf(e);~l&&t.splice(l,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},e.prototype.connect_=function(){eXx&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),eXw?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){eXx&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,l=void 0===t?"":t;eXk.some(function(e){return!!~l.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),eXS=function(e,t){for(var l=0,a=Object.keys(t);l<a.length;l++){var i=a[l];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},eXM=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||eXb},eXN=eXA(0,0,0,0);function eXC(e){return parseFloat(e)||0}function eXT(e){for(var t=[],l=1;l<arguments.length;l++)t[l-1]=arguments[l];return t.reduce(function(t,l){return t+eXC(e["border-"+l+"-width"])},0)}var eXP="u">typeof SVGGraphicsElement?function(e){return e instanceof eXM(e).SVGGraphicsElement}:function(e){return e instanceof eXM(e).SVGElement&&"function"==typeof e.getBBox};function eXA(e,t,l,a){return{x:e,y:t,width:l,height:a}}var eXD=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=eXA(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=function(e){if(!eXx)return eXN;if(eXP(e)){var t;return eXA(0,0,(t=e.getBBox()).width,t.height)}return function(e){var t,l=e.clientWidth,a=e.clientHeight;if(!l&&!a)return eXN;var i=eXM(e).getComputedStyle(e),n=function(e){for(var t={},l=0,a=["top","right","bottom","left"];l<a.length;l++){var i=a[l],n=e["padding-"+i];t[i]=eXC(n)}return t}(i),s=n.left+n.right,r=n.top+n.bottom,o=eXC(i.width),d=eXC(i.height);if("border-box"===i.boxSizing&&(Math.round(o+s)!==l&&(o-=eXT(i,"left","right")+s),Math.round(d+r)!==a&&(d-=eXT(i,"top","bottom")+r)),(t=e)!==eXM(t).document.documentElement){var c=Math.round(o+s)-l,u=Math.round(d+r)-a;1!==Math.abs(c)&&(o-=c),1!==Math.abs(u)&&(d-=u)}return eXA(n.left,n.top,o,d)}(e)}(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),eXI=function(e,t){var l,a,i,n,s,r=(l=t.x,a=t.y,i=t.width,n=t.height,eXS(s=Object.create(("u">typeof DOMRectReadOnly?DOMRectReadOnly:Object).prototype),{x:l,y:a,width:i,height:n,top:a,right:l+i,bottom:n+a,left:l}),s);eXS(this,{target:e,contentRect:r})},eXE=function(){function e(e,t,l){if(this.activeObservations_=[],this.observations_=new eXy,"function"!=typeof e)throw TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=l}return e.prototype.observe=function(e){if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");if(!("u"<typeof Element)&&Element instanceof Object){if(!(e instanceof eXM(e).Element))throw TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new eXD(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");if(!("u"<typeof Element)&&Element instanceof Object){if(!(e instanceof eXM(e).Element))throw TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new eXI(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),eXz="u">typeof WeakMap?new WeakMap:new eXy,eXL=function e(t){if(!(this instanceof e))throw TypeError("Cannot call a class as a function.");if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");var l=new eXE(t,eXj.getInstance(),this);eXz.set(this,l)};["observe","unobserve","disconnect"].forEach(function(e){eXL.prototype[e]=function(){var t;return(t=eXz.get(this))[e].apply(t,arguments)}});var eXO=void 0!==eXb.ResizeObserver?eXb.ResizeObserver:eXL,eXR=new Map,eX$=new eXO(function(e){e.forEach(function(e){var t,l=e.target;null==(t=eXR.get(l))||t.forEach(function(e){return e(l)})})});function eXF(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var eXB=i(8544);function eXH(e,t){for(var l=0;l<t.length;l++){var a=t[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,(0,eXB.A)(a.key),a)}}function eXq(e,t,l){return t&&eXH(e.prototype,t),l&&eXH(e,l),Object.defineProperty(e,"prototype",{writable:!1}),e}function eXV(e,t){return(eXV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function eXY(e){return(eXY=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eXU(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eXU=function(){return!!e})()}var eXW=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),e&&eXV(a,e);var t,l=(t=eXU(),function(){var e,l=eXY(a);e=t?Reflect.construct(l,arguments,eXY(this).constructor):l.apply(this,arguments);if(e&&("object"==(0,tk.A)(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===this)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return this});function a(){return eXF(this,a),l.apply(this,arguments)}return eXq(a,[{key:"render",value:function(){return this.props.children}}]),a}(ef.Component),eXG=ef.forwardRef(function(e,t){var l=e.children,a=e.disabled,i=ef.useRef(null),n=ef.useRef(null),s=ef.useContext(eXf),r="function"==typeof l,o=r?l(i):l,d=ef.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),c=!r&&ef.isValidElement(o)&&tD(o),u=tA(c&&o&&tI(o)?o.props.propertyIsEnumerable("ref")?o.props.ref:o.ref:null,i),p=function(){var e;return eXv(i.current)||(i.current&&"object"===(0,tk.A)(i.current)?eXv(null==(e=i.current)?void 0:e.nativeElement):null)||eXv(n.current)};ef.useImperativeHandle(t,function(){return p()});var m=ef.useRef(e);m.current=e;var g=ef.useCallback(function(e){var t=m.current,l=t.onResize,a=t.data,i=e.getBoundingClientRect(),n=i.width,r=i.height,o=e.offsetWidth,c=e.offsetHeight,u=Math.floor(n),p=Math.floor(r);if(d.current.width!==u||d.current.height!==p||d.current.offsetWidth!==o||d.current.offsetHeight!==c){var g={width:u,height:p,offsetWidth:o,offsetHeight:c};d.current=g;var h=o===Math.round(n)?n:o,v=c===Math.round(r)?r:c,f=tf(tf({},g),{},{offsetWidth:h,offsetHeight:v});null==s||s(f,e,a),l&&Promise.resolve().then(function(){l(f,e)})}},[]);return ef.useEffect(function(){var e=p();return e&&!a&&(eXR.has(e)||(eXR.set(e,new Set),eX$.observe(e)),eXR.get(e).add(g)),function(){eXR.has(e)&&(eXR.get(e).delete(g),!eXR.get(e).size&&(eX$.unobserve(e),eXR.delete(e)))}},[i.current,a]),ef.createElement(eXW,{ref:n},c?ef.cloneElement(o,{ref:u}):o)}),eXQ=ef.forwardRef(function(e,t){var l=e.children;return("function"==typeof l?[l]:function e(t){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=[];return ey().Children.forEach(t,function(t){(null!=t||l.keepEmpty)&&(Array.isArray(t)?a=a.concat(e(t)):tN(t)&&t.props?a=a.concat(e(t.props.children,l)):a.push(t))}),a}(l)).map(function(l,a){var i=(null==l?void 0:l.key)||"".concat("rc-observer-key","-").concat(a);return ef.createElement(eXG,tg({},e,{key:i,ref:0===a?t:void 0}),l)})});function eXK(e){var t=ef.useRef();return t.current=e,ef.useCallback(function(){for(var e,l=arguments.length,a=Array(l),i=0;i<l;i++)a[i]=arguments[i];return null==(e=t.current)?void 0:e.call.apply(e,[t].concat(a))},[])}eXQ.Collection=function(e){var t=e.children,l=e.onBatchResize,a=ef.useRef(0),i=ef.useRef([]),n=ef.useContext(eXf),s=ef.useCallback(function(e,t,s){a.current+=1;var r=a.current;i.current.push({size:e,element:t,data:s}),Promise.resolve().then(function(){r===a.current&&(null==l||l(i.current),i.current=[])}),null==n||n(e,t,s)},[l,n]);return ef.createElement(eXf.Provider,{value:s},t)};var eXJ=tL()?ef.useLayoutEffect:ef.useEffect;let eXZ=function(e,t){var l=ef.useRef(!0);eXJ(function(){return e(l.current)},t),eXJ(function(){return l.current=!1,function(){l.current=!0}},[])};var eXX=ef.forwardRef(function(e,t){var l=e.height,a=e.offsetY,i=e.offsetX,n=e.children,s=e.prefixCls,r=e.onInnerResize,o=e.innerProps,d=e.rtl,c=e.extra,u={},p={display:"flex",flexDirection:"column"};return void 0!==a&&(u={height:l,position:"relative",overflow:"hidden"},p=tf(tf({},p),{},(0,th.A)((0,th.A)((0,th.A)((0,th.A)((0,th.A)({transform:"translateY(".concat(a,"px)")},d?"marginRight":"marginLeft",-i),"position","absolute"),"left",0),"right",0),"top",0))),ef.createElement("div",{style:u},ef.createElement(eXQ,{onResize:function(e){e.offsetHeight&&r&&r()}},ef.createElement("div",tg({style:p,className:t_()((0,th.A)({},"".concat(s,"-holder-inner"),s)),ref:t},o),n,c)))});function eX0(e){var t=e.children,l=e.setRef,a=ef.useCallback(function(e){l(e)},[]);return ef.cloneElement(t,{ref:a})}eXX.displayName="Filler";var eX2=function(e){return+setTimeout(e,16)},eX1=function(e){return clearTimeout(e)};"u">typeof window&&"requestAnimationFrame"in window&&(eX2=function(e){return window.requestAnimationFrame(e)},eX1=function(e){return window.cancelAnimationFrame(e)});var eX4=0,eX3=new Map,eX8=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,l=eX4+=1;return!function t(a){if(0===a)eX3.delete(l),e();else{var i=eX2(function(){t(a-1)});eX3.set(l,i)}}(t),l};eX8.cancel=function(e){var t=eX3.get(e);return eX3.delete(e),eX1(t)};var eX6=("u"<typeof navigator?"undefined":(0,tk.A)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);let eX5=function(e,t,l,a){var i=(0,ef.useRef)(!1),n=(0,ef.useRef)(null),s=(0,ef.useRef)({top:e,bottom:t,left:l,right:a});return s.current.top=e,s.current.bottom=t,s.current.left=l,s.current.right=a,function(e,t){var l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e?t<0&&s.current.left||t>0&&s.current.right:t<0&&s.current.top||t>0&&s.current.bottom;return l&&a?(clearTimeout(n.current),i.current=!1):(!a||i.current)&&(clearTimeout(n.current),i.current=!0,n.current=setTimeout(function(){i.current=!1},50)),!i.current&&a}};var eX7=function(){function e(){eXF(this,e),(0,th.A)(this,"maps",void 0),(0,th.A)(this,"id",0),(0,th.A)(this,"diffRecords",new Map),this.maps=Object.create(null)}return eXq(e,[{key:"set",value:function(e,t){this.diffRecords.set(e,this.maps[e]),this.maps[e]=t,this.id+=1}},{key:"get",value:function(e){return this.maps[e]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),e}();function eX9(e){var t=parseFloat(e);return isNaN(t)?0:t}var e0e=14/15;function e0t(e){return Math.floor(Math.pow(e,.5))}function e0l(e,t){return("touches"in e?e.touches[0]:e)[t?"pageX":"pageY"]-window[t?"scrollX":"scrollY"]}var e0a=ef.forwardRef(function(e,t){var l=e.prefixCls,a=e.rtl,i=e.scrollOffset,n=e.scrollRange,s=e.onStartMove,r=e.onStopMove,o=e.onScroll,d=e.horizontal,c=e.spinSize,u=e.containerSize,p=e.style,m=e.thumbStyle,g=e.showScrollBar,h=nT(ef.useState(!1),2),v=h[0],f=h[1],y=nT(ef.useState(null),2),x=y[0],b=y[1],_=nT(ef.useState(null),2),k=_[0],w=_[1],j=!a,S=ef.useRef(),M=ef.useRef(),N=nT(ef.useState(g),2),C=N[0],T=N[1],P=ef.useRef(),A=function(){!0!==g&&!1!==g&&(clearTimeout(P.current),T(!0),P.current=setTimeout(function(){T(!1)},3e3))},D=n-u||0,I=u-c||0,E=ef.useMemo(function(){return 0===i||0===D?0:i/D*I},[i,D,I]),z=ef.useRef({top:E,dragging:v,pageY:x,startTop:k});z.current={top:E,dragging:v,pageY:x,startTop:k};var L=function(e){f(!0),b(e0l(e,d)),w(z.current.top),s(),e.stopPropagation(),e.preventDefault()};ef.useEffect(function(){var e=function(e){e.preventDefault()},t=S.current,l=M.current;return t.addEventListener("touchstart",e,{passive:!1}),l.addEventListener("touchstart",L,{passive:!1}),function(){t.removeEventListener("touchstart",e),l.removeEventListener("touchstart",L)}},[]);var O=ef.useRef();O.current=D;var R=ef.useRef();R.current=I,ef.useEffect(function(){if(v){var e,t=function(t){var l=z.current,a=l.dragging,i=l.pageY,n=l.startTop;eX8.cancel(e);var s=S.current.getBoundingClientRect(),r=u/(d?s.width:s.height);if(a){var c=(e0l(t,d)-i)*r,p=n;!j&&d?p-=c:p+=c;var m=O.current,g=R.current,h=Math.ceil((g?p/g:0)*m);h=Math.min(h=Math.max(h,0),m),e=eX8(function(){o(h,d)})}},l=function(){f(!1),r()};return window.addEventListener("mousemove",t,{passive:!0}),window.addEventListener("touchmove",t,{passive:!0}),window.addEventListener("mouseup",l,{passive:!0}),window.addEventListener("touchend",l,{passive:!0}),function(){window.removeEventListener("mousemove",t),window.removeEventListener("touchmove",t),window.removeEventListener("mouseup",l),window.removeEventListener("touchend",l),eX8.cancel(e)}}},[v]),ef.useEffect(function(){return A(),function(){clearTimeout(P.current)}},[i]),ef.useImperativeHandle(t,function(){return{delayHidden:A}});var $="".concat(l,"-scrollbar"),F={position:"absolute",visibility:C?null:"hidden"},B={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return d?(Object.assign(F,{height:8,left:0,right:0,bottom:0}),Object.assign(B,(0,th.A)({height:"100%",width:c},j?"left":"right",E))):(Object.assign(F,(0,th.A)({width:8,top:0,bottom:0},j?"right":"left",0)),Object.assign(B,{width:"100%",height:c,top:E})),ef.createElement("div",{ref:S,className:t_()($,(0,th.A)((0,th.A)((0,th.A)({},"".concat($,"-horizontal"),d),"".concat($,"-vertical"),!d),"".concat($,"-visible"),C)),style:tf(tf({},F),p),onMouseDown:function(e){e.stopPropagation(),e.preventDefault()},onMouseMove:A},ef.createElement("div",{ref:M,className:t_()("".concat($,"-thumb"),(0,th.A)({},"".concat($,"-thumb-moving"),v)),style:tf(tf({},B),m),onMouseDown:L}))});function e0i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,l=e/t*e;return isNaN(l)&&(l=0),Math.floor(l=Math.max(l,20))}var e0n=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],e0s=[],e0r={overflowY:"auto",overflowAnchor:"none"},e0o=ef.forwardRef(function(e,t){var l,a,i,n,s,r,o,d,c,u,p,m,g,h,v,f,y,x,b,_,k,w,j,S,M,N,C,T,P,A,D,I,E,z=e.prefixCls,L=void 0===z?"rc-virtual-list":z,O=e.className,R=e.height,$=e.itemHeight,F=e.fullHeight,B=e.style,H=e.data,q=e.children,V=e.itemKey,Y=e.virtual,U=e.direction,W=e.scrollWidth,G=e.component,Q=e.onScroll,K=e.onVirtualScroll,J=e.onVisibleChange,Z=e.innerProps,X=e.extraRender,ee=e.styles,et=e.showScrollBar,el=void 0===et?"optional":et,ea=tx(e,e0n),ei=ef.useCallback(function(e){return"function"==typeof V?V(e):null==e?void 0:e[V]},[V]),en=function(e){var t=nT(ef.useState(0),2),l=t[0],a=t[1],i=(0,ef.useRef)(new Map),n=(0,ef.useRef)(new eX7),s=(0,ef.useRef)(0);function r(){s.current+=1}function o(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];r();var t=function(){var e=!1;i.current.forEach(function(t,l){if(t&&t.offsetParent){var a=t.offsetHeight,i=getComputedStyle(t),s=i.marginTop,r=i.marginBottom,o=a+eX9(s)+eX9(r);n.current.get(l)!==o&&(n.current.set(l,o),e=!0)}}),e&&a(function(e){return e+1})};if(e)t();else{s.current+=1;var l=s.current;Promise.resolve().then(function(){l===s.current&&t()})}}return(0,ef.useEffect)(function(){return r},[]),[function(t,l){var a=e(t);i.current.get(a),l?(i.current.set(a,l),o()):i.current.delete(a)},o,n.current,l]}(ei),es=nT(en,4),er=es[0],eo=es[1],ed=es[2],ec=es[3],eu=!!(!1!==Y&&R&&$),ep=ef.useMemo(function(){return Object.values(ed.maps).reduce(function(e,t){return e+t},0)},[ed.id,ed.maps]),em=eu&&H&&(Math.max($*H.length,ep)>R||!!W),eg="rtl"===U,eh=t_()(L,(0,th.A)({},"".concat(L,"-rtl"),eg),O),ev=H||e0s,ey=(0,ef.useRef)(),ex=(0,ef.useRef)(),eb=(0,ef.useRef)(),e_=nT((0,ef.useState)(0),2),ek=e_[0],ew=e_[1],ej=nT((0,ef.useState)(0),2),eS=ej[0],eM=ej[1],eN=nT((0,ef.useState)(!1),2),eC=eN[0],eT=eN[1],eP=function(){eT(!0)},eA=function(){eT(!1)};function eD(e){ew(function(t){var l,a=(l="function"==typeof e?e(t):e,Number.isNaN(eQ.current)||(l=Math.min(l,eQ.current)),l=Math.max(l,0));return ey.current.scrollTop=a,a})}var eI=(0,ef.useRef)({start:0,end:ev.length}),eE=(0,ef.useRef)(),ez=(a=(l=nT(ef.useState(ev),2))[0],i=l[1],s=(n=nT(ef.useState(null),2))[0],r=n[1],ef.useEffect(function(){var e=function(e,t,l){var a,i,n=e.length,s=t.length;if(0===n&&0===s)return null;n<s?(a=e,i=t):(a=t,i=e);var r={__EMPTY_ITEM__:!0};function o(e){return void 0!==e?l(e):r}for(var d=null,c=1!==Math.abs(n-s),u=0;u<i.length;u+=1){var p=o(a[u]);if(p!==o(i[u])){d=u,c=c||p!==o(i[u+1]);break}}return null===d?null:{index:d,multiple:c}}(a||[],ev||[],ei);(null==e?void 0:e.index)!==void 0&&r(ev[e.index]),i(ev)},[ev]),[s]);eE.current=nT(ez,1)[0];var eL=ef.useMemo(function(){if(!eu)return{scrollHeight:void 0,start:0,end:ev.length-1,offset:void 0};if(!em)return{scrollHeight:(null==(e=ex.current)?void 0:e.offsetHeight)||0,start:0,end:ev.length-1,offset:void 0};for(var e,t,l,a,i=0,n=ev.length,s=0;s<n;s+=1){var r=ei(ev[s]),o=ed.get(r),d=i+(void 0===o?$:o);d>=ek&&void 0===t&&(t=s,l=i),d>ek+R&&void 0===a&&(a=s),i=d}return void 0===t&&(t=0,l=0,a=Math.ceil(R/$)),void 0===a&&(a=ev.length-1),{scrollHeight:i,start:t,end:a=Math.min(a+1,ev.length-1),offset:l}},[em,eu,ek,ev,ec,R]),eO=eL.scrollHeight,eR=eL.start,e$=eL.end,eF=eL.offset;eI.current.start=eR,eI.current.end=e$,ef.useLayoutEffect(function(){var e=ed.getRecord();if(1===e.size){var t=Array.from(e.keys())[0],l=e.get(t),a=ev[eR];if(a&&void 0===l&&ei(a)===t){var i=ed.get(t)-$;eD(function(e){return e+i})}}ed.resetRecord()},[eO]);var eB=nT(ef.useState({width:0,height:R}),2),eH=eB[0],eq=eB[1],eV=(0,ef.useRef)(),eY=(0,ef.useRef)(),eU=ef.useMemo(function(){return e0i(eH.width,W)},[eH.width,W]),eW=ef.useMemo(function(){return e0i(eH.height,eO)},[eH.height,eO]),eG=eO-R,eQ=(0,ef.useRef)(eG);eQ.current=eG;var eK=ek<=0,eJ=ek>=eG,eZ=eS<=0,eX=eS>=W,e0=eX5(eK,eJ,eZ,eX),e2=function(){return{x:eg?-eS:eS,y:ek}},e1=(0,ef.useRef)(e2()),e4=eXK(function(e){if(K){var t=tf(tf({},e2()),e);(e1.current.x!==t.x||e1.current.y!==t.y)&&(K(t),e1.current=t)}});function e3(e,t){t?((0,iS.flushSync)(function(){eM(e)}),e4()):eD(e)}var e8=function(e){var t=e,l=W?W-eH.width:0;return Math.min(t=Math.max(t,0),l)},e6=eXK(function(e,t){t?((0,iS.flushSync)(function(){eM(function(t){return e8(t+(eg?-e:e))})}),e4()):eD(function(t){return t+e})}),e5=nT((o=!!W,d=(0,ef.useRef)(0),c=(0,ef.useRef)(null),u=(0,ef.useRef)(null),p=(0,ef.useRef)(!1),m=eX5(eK,eJ,eZ,eX),g=(0,ef.useRef)(null),h=(0,ef.useRef)(null),[function(e){if(eu){eX8.cancel(h.current),h.current=eX8(function(){g.current=null},2);var t,l,a=e.deltaX,i=e.deltaY,n=e.shiftKey,s=a,r=i;("sx"===g.current||!g.current&&n&&i&&!a)&&(s=i,r=0,g.current="sx");var v=Math.abs(s),f=Math.abs(r);if(null===g.current&&(g.current=o&&v>f?"x":"y"),"y"===g.current){t=e,l=r,eX8.cancel(c.current),!m(!1,l)&&(t._virtualHandled||(t._virtualHandled=!0,d.current+=l,u.current=l,eX6||t.preventDefault(),c.current=eX8(function(){var e=p.current?10:1;e6(d.current*e,!1),d.current=0})))}else e6(s,!0),eX6||e.preventDefault()}},function(e){eu&&(p.current=e.detail===u.current)}]),2),e7=e5[0],e9=e5[1];v=function(e,t,l,a){return!e0(e,t,l)&&(!a||!a._virtualHandled)&&(a&&(a._virtualHandled=!0),e7({preventDefault:function(){},deltaX:e?t:0,deltaY:e?0:t}),!0)},y=(0,ef.useRef)(!1),x=(0,ef.useRef)(0),b=(0,ef.useRef)(0),_=(0,ef.useRef)(null),k=(0,ef.useRef)(null),w=function(e){if(y.current){var t=Math.ceil(e.touches[0].pageX),l=Math.ceil(e.touches[0].pageY),a=x.current-t,i=b.current-l,n=Math.abs(a)>Math.abs(i);n?x.current=t:b.current=l;var s=v(n,n?a:i,!1,e);s&&e.preventDefault(),clearInterval(k.current),s&&(k.current=setInterval(function(){n?a*=e0e:i*=e0e;var e=Math.floor(n?a:i);(!v(n,e,!0)||.1>=Math.abs(e))&&clearInterval(k.current)},16))}},j=function(){y.current=!1,f()},S=function(e){f(),1!==e.touches.length||y.current||(y.current=!0,x.current=Math.ceil(e.touches[0].pageX),b.current=Math.ceil(e.touches[0].pageY),_.current=e.target,_.current.addEventListener("touchmove",w,{passive:!1}),_.current.addEventListener("touchend",j,{passive:!0}))},f=function(){_.current&&(_.current.removeEventListener("touchmove",w),_.current.removeEventListener("touchend",j))},eXZ(function(){return eu&&ey.current.addEventListener("touchstart",S,{passive:!0}),function(){var e;null==(e=ey.current)||e.removeEventListener("touchstart",S),f(),clearInterval(k.current)}},[eu]),M=function(e){eD(function(t){return t+e})},ef.useEffect(function(){var e=ey.current;if(em&&e){var t,l,a=!1,i=function(){eX8.cancel(t)},n=function e(){i(),t=eX8(function(){M(l),e()})},s=function(){a=!1,i()},r=function(e){!e.target.draggable&&0===e.button&&(e._virtualHandled||(e._virtualHandled=!0,a=!0))},o=function(t){if(a){var s=e0l(t,!1),r=e.getBoundingClientRect(),o=r.top,d=r.bottom;s<=o?(l=-e0t(o-s),n()):s>=d?(l=e0t(s-d),n()):i()}};return e.addEventListener("mousedown",r),e.ownerDocument.addEventListener("mouseup",s),e.ownerDocument.addEventListener("mousemove",o),e.ownerDocument.addEventListener("dragend",s),function(){e.removeEventListener("mousedown",r),e.ownerDocument.removeEventListener("mouseup",s),e.ownerDocument.removeEventListener("mousemove",o),e.ownerDocument.removeEventListener("dragend",s),i()}}},[em]),eXZ(function(){function e(e){var t=eK&&e.detail<0,l=eJ&&e.detail>0;!eu||t||l||e.preventDefault()}var t=ey.current;return t.addEventListener("wheel",e7,{passive:!1}),t.addEventListener("DOMMouseScroll",e9,{passive:!0}),t.addEventListener("MozMousePixelScroll",e,{passive:!1}),function(){t.removeEventListener("wheel",e7),t.removeEventListener("DOMMouseScroll",e9),t.removeEventListener("MozMousePixelScroll",e)}},[eu,eK,eJ]),eXZ(function(){if(W){var e=e8(eS);eM(e),e4({x:e})}},[eH.width,W]);var te=function(){var e,t;null==(e=eV.current)||e.delayHidden(),null==(t=eY.current)||t.delayHidden()},tt=(N=function(){return eo(!0)},C=ef.useRef(),P=(T=nT(ef.useState(null),2))[0],A=T[1],eXZ(function(){if(P&&P.times<10){if(!ey.current)return void A(function(e){return tf({},e)});N();var e=P.targetAlign,t=P.originAlign,l=P.index,a=P.offset,i=ey.current.clientHeight,n=!1,s=e,r=null;if(i){for(var o=e||t,d=0,c=0,u=0,p=Math.min(ev.length-1,l),m=0;m<=p;m+=1){var g=ei(ev[m]);c=d;var h=ed.get(g);d=u=c+(void 0===h?$:h)}for(var v="top"===o?a:i-a,f=p;f>=0;f-=1){var y=ei(ev[f]),x=ed.get(y);if(void 0===x){n=!0;break}if((v-=x)<=0)break}switch(o){case"top":r=c-a;break;case"bottom":r=u-i+a;break;default:var b=ey.current.scrollTop;c<b?s="top":u>b+i&&(s="bottom")}null!==r&&eD(r),r!==P.lastTop&&(n=!0)}n&&A(tf(tf({},P),{},{times:P.times+1,targetAlign:s,lastTop:r}))}},[P,ey.current]),function(e){if(null==e)return void te();if(eX8.cancel(C.current),"number"==typeof e)eD(e);else if(e&&"object"===(0,tk.A)(e)){var t,l=e.align;t="index"in e?e.index:ev.findIndex(function(t){return ei(t)===e.key});var a=e.offset;A({times:0,index:t,offset:void 0===a?0:a,originAlign:l})}});ef.useImperativeHandle(t,function(){return{nativeElement:eb.current,getScrollInfo:e2,scrollTo:function(e){e&&"object"===(0,tk.A)(e)&&("left"in e||"top"in e)?(void 0!==e.left&&eM(e8(e.left)),tt(e.top)):tt(e)}}}),eXZ(function(){J&&J(ev.slice(eR,e$+1),ev)},[eR,e$,ev]);var tl=(I=(D=nT(ef.useMemo(function(){return[new Map,[]]},[ev,ed.id,$]),2))[0],E=D[1],function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,l=I.get(e),a=I.get(t);if(void 0===l||void 0===a)for(var i=ev.length,n=E.length;n<i;n+=1){var s,r=ei(ev[n]);I.set(r,n);var o=null!=(s=ed.get(r))?s:$;if(E[n]=(E[n-1]||0)+o,r===e&&(l=n),r===t&&(a=n),void 0!==l&&void 0!==a)break}return{top:E[l-1]||0,bottom:E[a]}}),ta=null==X?void 0:X({start:eR,end:e$,virtual:em,offsetX:eS,offsetY:eF,rtl:eg,getSize:tl}),ti=ev.slice(eR,e$+1).map(function(e,t){var l=q(e,eR+t,{style:{width:W},offsetX:eS}),a=ei(e);return ef.createElement(eX0,{key:a,setRef:function(t){return er(e,t)}},l)}),tn=null;R&&(tn=tf((0,th.A)({},void 0===F||F?"height":"maxHeight",R),e0r),eu&&(tn.overflowY="hidden",W&&(tn.overflowX="hidden"),eC&&(tn.pointerEvents="none")));var ts={};return eg&&(ts.dir="rtl"),ef.createElement("div",tg({ref:eb,style:tf(tf({},B),{},{position:"relative"}),className:eh},ts,ea),ef.createElement(eXQ,{onResize:function(e){eq({width:e.offsetWidth,height:e.offsetHeight})}},ef.createElement(void 0===G?"div":G,{className:"".concat(L,"-holder"),style:tn,ref:ey,onScroll:function(e){var t=e.currentTarget.scrollTop;t!==ek&&eD(t),null==Q||Q(e),e4()},onMouseEnter:te},ef.createElement(eXX,{prefixCls:L,height:eO,offsetX:eS,offsetY:eF,scrollWidth:W,onInnerResize:eo,ref:ex,innerProps:Z,rtl:eg,extra:ta},ti))),em&&eO>R&&ef.createElement(e0a,{ref:eV,prefixCls:L,scrollOffset:ek,scrollRange:eO,rtl:eg,onScroll:e3,onStartMove:eP,onStopMove:eA,spinSize:eW,containerSize:eH.height,style:null==ee?void 0:ee.verticalScrollBar,thumbStyle:null==ee?void 0:ee.verticalScrollBarThumb,showScrollBar:el}),em&&W>eH.width&&ef.createElement(e0a,{ref:eY,prefixCls:L,scrollOffset:eS,scrollRange:W,rtl:eg,onScroll:e3,onStartMove:eP,onStopMove:eA,spinSize:eU,containerSize:eH.width,horizontal:!0,style:null==ee?void 0:ee.horizontalScrollBar,thumbStyle:null==ee?void 0:ee.horizontalScrollBarThumb,showScrollBar:el}))});function e0d(e){let{keyword:t,searchMode:l,perPage:a,filters:i,sort:n,subscriberPrefix:s,onDelta:r}=e,[o,d]=(0,ef.useState)([]),[c,u]=(0,ef.useState)(0),[p,m]=(0,ef.useState)(!1),[g,h]=(0,ef.useState)(null),[v,f]=(0,ef.useState)(1),y=(0,ef.useRef)(0),x=(0,ef.useRef)((0,eH.LP)(s)),b=(0,ef.useRef)(r);b.current=r;let _=(0,ef.useCallback)(e=>{var t;let l=eXg(e);0!==l.length&&(l.length,l.map(e=>(null==e?void 0:e.order_id)??(null==e?void 0:e.id)??(null==e?void 0:e.key)),d(e=>(function(e,t){if(!t.length)return e;let l=new Map;if(t.forEach(e=>{let t=eXm(e);void 0!==t&&l.set(String(t),e)}),0===l.size)return e;let a=!1,i=e.map(e=>{let t=eXm(e);if(void 0===t)return e;let i=l.get(String(t));return i?(a=!0,{...e,...i}):e});return a?i:e})(e,l)),null==(t=b.current)||t.call(b,l))},[s]),k=(0,ef.useCallback)(async(e,s)=>{let r=(t??"").trim();if(!r){d([]),u(0),h(null),f(1),eXu(x.current);return}let o=++y.current;m(!0),h(null);try{let t=await eXd({keyword:r,searchMode:l,filters:i,sort:n,page:e,perPage:a,subscriberId:x.current,callback:_,resetVisibleOrderIds:!s});if(o!==y.current)return;u(t.total),d(e=>s?[...e,...t.items]:t.items),f(e)}catch(e){if(o!==y.current)return;h(e),s||(d([]),u(0))}finally{o===y.current&&m(!1)}},[t,l,a,i,n,_]);(0,ef.useEffect)(()=>{let e=x.current;return()=>{eXu(e)}},[]),(0,ef.useEffect)(()=>{f(1),k(1,!1)},[k]);let w=o.length<c;return{items:o,total:c,loading:p,error:g,page:v,hasMore:w,fetchPage:k,subscriberId:x.current}}e0o.displayName="List";function e0c(e,t,l){return null==l||""===l?0:e[`${t}:${l}`]??0}function e0u(e,t){if(!Array.isArray(t)||0===t.length)return e;let l=null,a=new Set;for(let i of t){let t=e0p(i);if(null==t)continue;let n=`order:${t}`;a.has(n)||(a.add(n),null==l&&(l={...e}),l[n]=(l[n]??0)+1)}return l??e}function e0p(e){if(!e||"object"!=typeof e)return null;let t=e.order_id??e.id??e.key;return null==t||""===t?null:"string"==typeof t||"number"==typeof t?t:String(t)}class e0m extends ey().Component{static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){}render(){return this.state.hasError?(0,ev.jsxs)("div",{style:{padding:24,border:"1px dashed #e5e7eb",borderRadius:8,background:"#fafafa",color:"#6b7280",fontSize:13,lineHeight:1.6},children:[(0,ev.jsx)("div",{style:{fontWeight:600,color:"#111827",marginBottom:4},children:eN.getText("pisell-global-search.order-result-unavailable.title")}),(0,ev.jsx)("div",{children:eN.getText("pisell-global-search.order-result-unavailable.description")})]}):this.props.children}constructor(e){super(e),this.state={hasError:!1}}}let e0g=e=>{let{items:t,loading:l,keyword:a,detailRefreshVersions:i={}}=e,n=t.map(e=>({item:e,id:eXm(e)})).filter(e=>void 0!==e.id);return l&&0===n.length?(0,ev.jsx)("div",{className:"pisell-global-search-order-business__status",children:(0,ev.jsx)(ex.Spin,{})}):a&&0===n.length?(0,ev.jsx)("div",{className:"pisell-global-search-order-business__status pisell-global-search__empty",children:eN.getText("pisell-global-search.empty")}):0===n.length?null:(0,ev.jsx)("div",{className:"pisell-global-search-order-business",children:n.map(e=>{let{item:t,id:l}=e,a=e0c(i,"order",l),n=`global-search-business-detail-${l}`;return(0,ev.jsx)("div",{className:"pisell-global-search-order-business__item",children:(0,ev.jsx)(e0m,{children:(0,ev.jsx)(eXn,{refreshVersion:a,renderType:"current",tmpl:"B",variant:"tablet",summaryTwoColumn:!0,osProps:{osKey:n,orderId:Number(l),preloadedSalesDetail:t,autoBootstrap:!0,destroyOnUnmount:!0,syncDetailOnOrderChange:!0}})})},n)})})},e0h=ey().memo(e=>{let{keyword:t}=e,[l,a]=(0,ef.useState)({}),i=(0,ef.useRef)(!1),{items:n,total:s,loading:r,error:o,page:d,hasMore:c,fetchPage:u}=e0d({keyword:t,searchMode:"identifier",perPage:5,subscriberPrefix:"global-search-order-business",onDelta:(0,ef.useCallback)(e=>{a(t=>e0u(t,e))},[])});(0,ef.useEffect)(()=>{a({})},[t]),(0,ef.useEffect)(()=>{r||(i.current=!1)},[r]);let p=(0,ef.useRef)(null),[m,g]=(0,ef.useState)(0);(0,ef.useEffect)(()=>{let e=p.current;if(!e)return;let t=()=>g(e.clientHeight);t();let l=new ResizeObserver(t);return l.observe(e),()=>l.disconnect()},[]);let h=(0,ef.useCallback)(e=>{let{scrollTop:t,clientHeight:l,scrollHeight:a}=e.currentTarget;!r&&!i.current&&c&&a-t-l<360&&(i.current=!0,u(d+1,!0))},[r,c,u,d]),v=r&&0===n.length,f=!!o&&0===n.length,y=!r&&!o&&0===n.length;return(0,ev.jsxs)("div",{ref:p,className:"pisell-global-search-order-business pisell-global-search-order-business--virtual",children:[v&&(0,ev.jsx)("div",{className:"pisell-global-search-order-business__status",children:(0,ev.jsx)(ex.Spin,{})}),!v&&f&&(0,ev.jsx)("div",{className:"pisell-global-search-order-business__status pisell-global-search__empty",children:eN.getText("pisell-global-search.error")}),!v&&!f&&y&&(0,ev.jsx)("div",{className:"pisell-global-search-order-business__status pisell-global-search__empty",children:eN.getText("pisell-global-search.empty")}),n.length>0&&0===m&&(0,ev.jsx)("div",{className:"pisell-global-search-order-business__status",children:(0,ev.jsx)(ex.Spin,{size:"small"})}),n.length>0&&m>0&&(0,ev.jsx)(e0o,{data:n,height:r&&n.length>0?Math.max(m-44,0):m,itemHeight:360,virtual:!0,itemKey:e=>{let t=eXm(e)??e.order_id??"";return`${t}`},onScroll:h,children:e=>{let t=eXm(e),a=e0c(l,"order",t),i=`global-search-business-detail-${t}`;return(0,ev.jsx)("div",{className:"pisell-global-search-order-business__item",style:{marginBottom:6},children:(0,ev.jsx)(e0m,{children:(0,ev.jsx)(eXn,{refreshVersion:a,renderType:"current",tmpl:"B",variant:"tablet",summaryTwoColumn:!0,osProps:{osKey:i,orderId:Number(t),preloadedSalesDetail:e,autoBootstrap:!0,destroyOnUnmount:!0,syncDetailOnOrderChange:!0}})})},i)}}),r&&n.length>0&&(0,ev.jsx)("div",{style:{flex:"0 0 auto",height:44,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,ev.jsx)(ex.Spin,{size:"small"})})]})}),e0v=()=>({filter:{values:{}},sort:"created_at:desc"}),e0f=ey().memo(e=>{var t,l;let{keyword:a,searchMode:i="fuzzy",onAutoOpenUniqueOrderDetail:n,onOpenDetail:s,onRealtimePatchItems:r,previewLimit:o,onReportTotal:d,providerKey:c="order"}=e,u=ik(),p=null==u||null==(l=u.engine)||null==(t=l.props)?void 0:t.locale,m={en:{...eVJ.en,...eWM.en},"zh-CN":{...eVJ["zh-CN"],...eWM["zh-CN"]},"zh-HK":{...eVJ["zh-HK"],...eWM["zh-HK"]}};eN.init(m,p||"en");let[g,h]=(0,ef.useState)(e0v),v=(0,ef.useCallback)(e=>{h(e||{})},[]),f=(0,ef.useCallback)(()=>{h(e0v())},[]),y="number"==typeof o&&o>0,x=y?o:20,b=(0,ef.useMemo)(()=>{var e;return(e=>{let t={};if(!e||"object"!=typeof e)return t;for(let[l,a]of Object.entries(e))if(null!=a&&""!==a&&(!Array.isArray(a)||0!==a.length)){if("orderDate"===l){let[e,l]=Array.isArray(a)?a:[],i={};e&&(i.from=em()(e).startOf("day").format("YYYY-MM-DD HH:mm:ss")),l&&(i.to=em()(l).endOf("day").format("YYYY-MM-DD HH:mm:ss")),(i.from||i.to)&&(t.created_at=i);continue}if("total_amount"===l&&"object"==typeof a&&!Array.isArray(a)){let e={};void 0!==a.min&&null!==a.min&&""!==a.min&&(e.gte=Number(a.min)),void 0!==a.max&&null!==a.max&&""!==a.max&&(e.lte=Number(a.max)),Object.keys(e).length&&(t.total_amount=e);continue}t[l]=a}return t})(null==g||null==(e=g.filter)?void 0:e.values)},[g]),_=(0,ef.useMemo)(()=>(e=>{if(!e||"string"!=typeof e)return;let[t,l]=e.split(":");if(t)return[{field:t,direction:"asc"===l?"asc":"desc"}]})(null==g?void 0:g.sort),[g]),[k,w]=(0,ef.useState)(void 0),{items:j,total:S,loading:M,error:N,page:C,fetchPage:T}=e0d({keyword:a,searchMode:i,perPage:x,filters:b,sort:_,subscriberPrefix:"global-search-order-admin",onDelta:(0,ef.useCallback)(e=>{null==r||r("order",e)},[r])}),P=(0,ef.useMemo)(()=>({pageNumber:C,pageSize:x}),[C,x]),A=(0,ef.useRef)(d);A.current=d,(0,ef.useEffect)(()=>{var e;null==(e=A.current)||e.call(A,c,S)},[S,c]);let D=(0,ef.useRef)(a);(0,ef.useEffect)(()=>{D.current!==a&&(D.current=a,h(e=>{var t;let l=e0v();return e&&e.sort===l.sort&&(null==(t=e.filter)?void 0:t.values)&&0===Object.keys(e.filter.values).length?e:l}))},[a]),(0,ef.useEffect)(()=>{w(void 0)},[a,b,_]);let I=(0,ef.useCallback)(e=>{!y&&e>C&&T(e,!0)},[y,T,C]),E=(0,ef.useMemo)(()=>j.map(e=>{let t=eXm(e);return void 0===t?null:{...e,id:t,order_id:t}}).filter(e=>null!==e),[j]),z=(0,ef.useMemo)(()=>{let e=new Map;return E.forEach(t=>{(null==t?void 0:t.id)!==void 0&&(null==t?void 0:t.id)!==null&&e.set(String(null==t?void 0:t.id),t)}),e},[E]),L=(0,ef.useCallback)((e,t)=>{w(e),null==t||t({providerKey:"order",id:e,record:z.get(String(e))})},[z]),O=(0,ef.useCallback)(e=>{let{orderId:t}=e;L(t,s)},[s,L]),R=(0,ef.useRef)();(0,ef.useEffect)(()=>{if(!n)return;let e=function(e){var t;let{enabled:l,keyword:a,total:i,loading:n,error:s,records:r}=e,o=a.trim();if(!l||!o||n||s||1!==i||1!==r.length)return null;let d=null==(t=r[0])?void 0:t.id;return null==d||""===d?null:{key:JSON.stringify([o,String(d)]),orderId:d}}({enabled:!0,keyword:a,total:S,loading:M,error:N,records:E});e&&R.current!==e.key&&(R.current=e.key,L(e.orderId,n))},[N,a,M,n,L,E,S]);let $=eZk({onOpenDetail:s?O:void 0}),F=(0,ef.useMemo)(()=>{let e=$.getChildComponentProps,t={sale_brief:.7,payment_info:1,payment_method:1.3,order_origin:1.2,last_edit_account:1.2},l=new Set(["payment_method","payment_info","order_origin","last_edit_account"]);return{...$,getChildComponentProps:a=>{let i,n=(e?e(a):$.childComponentProps)||{},s=n.grid||{},r=n.toolBar||{},o=r.filter&&"object"==typeof r.filter?r.filter:{};return{...n,grid:{...s,columns:Array.isArray(i=s.columns)?i.map(e=>{if(!e)return e;let a="number"==typeof e.width?{...e,width:Math.max(Math.round(e.width*(t[e.key]??.8)),88)}:e;if("payment_status"===e.key)return{...a,className:[a.className,"pisell-global-search-col-payment-status"].filter(Boolean).join(" ")};if(l.has(e.key)){let e;return"function"!=typeof(e=a.render)?a:{...a,render:(t,l,a)=>(0,ev.jsx)("div",{className:"pisell-global-search-ellipsis-cell",children:e(t,l,a)})}}return a}):i,infiniteScroll:!0,virtual:!1},toolBar:{...r,search:!1,filter:{...o,defaultFilterValue:{...o.defaultFilterValue||{},quickFilter:[],values:{}}}}}}}},[$]),B=(0,ef.useMemo)(()=>{let e=F.getChildComponentProps;return[{...F,getChildComponentProps:t=>{let l=e?e(t):{},a=l.grid||{},i=a.rowClassName;return{...l,grid:{...a,rowClassName:(e,t,l)=>["function"==typeof i?i(e,t,l):i||"",void 0!==k&&(null==e?void 0:e.id)!=null&&String(e.id)===String(k)?"pisell-global-search-order-row--active":""].filter(Boolean).join(" ")}}}}]},[F,k]),H=p||("u">typeof localStorage?localStorage.getItem("umi_locale"):null)||"en-US";return(0,ev.jsx)(e0m,{children:(0,ev.jsx)(lL.PisellConfigProvider,{locale:"zh"===H?"zh-CN":H,children:(0,ev.jsx)(ej8,{dateAdapter:eSy,adapterLocale:"zh-CN"===p||"zh-HK"===p?"zh-cn":"en"===p||"en-US"===p?"en":"zh-cn",children:(0,ev.jsx)("div",{className:"pisell-global-search-order-table",children:N&&0===j.length&&!M?(0,ev.jsx)("div",{className:"pisell-global-search-order-business__status pisell-global-search__empty",children:eN.getText("pisell-global-search.error")}):(0,ev.jsx)(eV4,{perspectives:B,currentPerspective:"handle",data:E,loading:M,total:S,pagination:P,onPageChange:I,searchParams:g,onSearch:v,onReset:f,rowKey:"id"})})})})})});e0f.displayName="OrderAdminGrid";let e0y={key:"order",label:{en:"Sales","zh-CN":"订单","zh-HK":"訂單",ja:"売上",pt:"Vendas"},order:20,search:async e=>{let{keyword:t,signal:l,mode:a,pageSize:i,scope:n,onRealtimePatch:s,realtimeSubscriberId:r,onRealtimeCleanup:o}=e,d=(t??"").trim(),c="admin"===a?"fuzzy":"identifier";if(!d)return{list:[],total:0};let u="all"===n?eXc:eXd;if("business"===a){if("single"===n)return{list:[],total:0};let e=function(e){if("all"===e.scope&&"business"===e.mode)return e.id}({scope:n,mode:a,id:r});e&&(null==o||o(()=>{eXp(e)}));let t=await u({keyword:d,searchMode:c,perPage:i??20,signal:l,subscriberId:e,resetVisibleOrderIds:!0,callback:e?e=>{let t=eXg(e);t.length,t.map(e=>(null==e?void 0:e.order_id)??(null==e?void 0:e.id)??(null==e?void 0:e.key)),t.length>0&&(null==s||s(t))}:void 0});return{list:t.items,total:t.total}}return{list:[],total:0}},renderItem:e=>(0,ev.jsxs)("div",{style:{padding:6},children:[(0,ev.jsx)("div",{style:{fontWeight:600},children:e.shop_order_number||e.order_number||e.order_id}),e.customer_name&&(0,ev.jsx)("div",{style:{fontSize:12,color:"#6b7280"},children:e.customer_name})]}),renderResults:(e,t)=>{let{state:l,keyword:a,mode:i,layout:n}=e;return"business"===i?"single"===n?(0,ev.jsx)(e0h,{keyword:a}):(0,ev.jsx)(e0g,{items:l.list,loading:l.loading,keyword:a,detailRefreshVersions:t.detailRefreshVersions}):(0,ev.jsx)(e0f,{keyword:a,searchMode:t.searchMode,providerKey:"order",onAutoOpenUniqueOrderDetail:t.onAutoOpenUniqueOrderDetail,onOpenDetail:t.onOpenDetail,onRealtimePatchItems:t.onRealtimePatchItems,onReportTotal:t.onReportTotal,previewLimit:"grouped"===n?5:void 0})}},e0x=[e0y],e0b=e=>{var t,l,a,i,n,s,r,o,d;let{placeholder:c,providers:u,permissionContext:p,navigate:m,showModeSwitch:g=!0,modeOptions:h,allModePageSize:v=5,singleModePageSize:f=20,enableScanner:y=!0,historyKey:x="pisell_global_search_history",maxHistoryCount:b=10,variant:_,className:k,style:w}=e,j=ik(),S=eZ5(null==(t=eN.getLocale)?void 0:t.call(eN));eN.init(eZ6,S),(null==j||null==(a=j.appHelper)||null==(l=a.utils)?void 0:l.request)&&(z_.Em.setRequest(j.appHelper.utils.request),eV$=eVR(j.appHelper.utils.isWebPos));let M=(0,ef.useMemo)(()=>Array.isArray(u)&&u.length>0?u:e0x,[u]),N=(0,ef.useMemo)(()=>[...M.filter(e=>e&&e.enabledWhen?e.enabledWhen(p??{}):!!e)].sort((e,t)=>(e.order??Number.MAX_SAFE_INTEGER)-(t.order??Number.MAX_SAFE_INTEGER)),[M,p]),[C,T]=(0,ef.useState)(""),[P,A]=(0,ef.useState)({keyword:"",searchMode:"fuzzy"}),{keyword:D,searchMode:I}=P,E="phone"===_||"smallTablet"===_||"tablet"===_,[z,L]=(0,ef.useState)(null),O=(0,ef.useRef)({}),[R,$]=(0,ef.useState)({}),F=(0,ef.useCallback)(e=>{let{providerKey:t,id:l,record:a}=e;null!=l&&""!==l&&L({providerKey:t,id:l,record:a})},[]),B=(0,ef.useCallback)(e=>{var t,l,a;let{providerKey:i,id:n,record:s}=e;E?null==j||null==(a=j.appHelper)||null==(l=a.utils)||null==(t=l.action)||t.call(l,{type:"pisell1.handleOpenSaleDetail",data:{osProps:{orderId:n,osKey:"sales-management-item-detail",syncDetailOnOrderChange:!0}}}):F({providerKey:i,id:n,record:s})},[null==j||null==(n=j.appHelper)||null==(i=n.utils)?void 0:i.action,F,E]),H=E&&"function"!=typeof(null==j||null==(r=j.appHelper)||null==(s=r.utils)?void 0:s.action)?void 0:B,q=E?void 0:F;(0,ef.useEffect)(()=>{L(null),O.current={},$({})},[D]);let V=(0,ef.useCallback)((e,t)=>{"order"===e&&(L(e=>{if(!e||"order"!==e.providerKey)return e;let l=Array.isArray(t)?t.find(t=>String((null==t?void 0:t.order_id)??(null==t?void 0:t.id)??(null==t?void 0:t.key))===String(e.id)):void 0;if(!l)return e;let a=e.record&&"object"==typeof e.record?e.record:{};return{...e,record:{...a,...l}}}),$(e=>{let l=Array.isArray(t)&&0!==t.length?t.reduce((e,t)=>{let l=e0p(t);return null==l||(e[String(l)]=function e(t){return Array.isArray(t)?`[${t.map(e).join(",")}]`:t&&"object"==typeof t?`{${Object.keys(t).sort().map(l=>`${JSON.stringify(l)}:${e(t[l])}`).join(",")}}`:JSON.stringify(t)}(t)),e},{}):{},a={...O.current},i=Object.entries(l).filter(e=>{let[t,l]=e;return a[t]!==l}).map(e=>{let[t,l]=e;return a[t]=l,t});return O.current=a,e0u(e,Array.isArray(t)?t.filter(e=>i.includes(String((null==e?void 0:e.order_id)??(null==e?void 0:e.id)??(null==e?void 0:e.key)))):[])}))},[]),{rightWidth:Y,containerRef:U,onResizerMouseDown:W,resizing:G}=eZ1({initialRatio:.36}),Q="admin",K=N.length>=1,[J,Z]=(0,ef.useState)(K?eZ0:(null==(o=N[0])?void 0:o.key)??eZ0),X=K||J!==eZ0?J:(null==(d=N[0])?void 0:d.key)??eZ0,{stateMap:ee,reportProviderTotal:et}=eZ3({keyword:D,activeTab:X,providers:N,allModePageSize:v,singleModePageSize:f,mode:Q,onRealtimePatchItems:V}),el=(0,ef.useCallback)((e,t)=>{A({keyword:(e??C).trim(),searchMode:(null==t?void 0:t.source)==="scan"?"identifier":"fuzzy"})},[C]),ea=(0,ef.useMemo)(()=>[{label:(null==h?void 0:h.admin)?eZ9(h.admin,S):eZ7("pisell-global-search.mode.admin"),value:"admin"}],[h,S]),ei=(0,ef.useMemo)(()=>{let e=N.map(e=>({value:e.key,label:(0,ev.jsxs)("span",{className:"pisell-global-search-scope-bar__option",children:[e.icon,eZ9(e.label,S)]})}));return K&&e.unshift({value:eZ0,label:(0,ev.jsx)("span",{className:"pisell-global-search-scope-bar__option",children:eZ7("pisell-global-search.tab.all")})}),e},[N,K,S]),en=X===eZ0,es=(0,ef.useCallback)(()=>{},[]),er=(0,ef.useMemo)(()=>{if(!D||en)return!1;let e=N.find(e=>e.key===X);return!!(null==e?void 0:e.renderResults)},[D,en,N,X]),eo=!E&&!!D;return(0,ev.jsxs)("div",{className:`pisell-global-search-fp pisell-global-search-fp--${_||"desktop"} ${k??""}`.trim(),style:w,children:[(0,ev.jsxs)("section",{className:"pisell-global-search-fp__search-panel",children:[(0,ev.jsxs)("div",{className:"pisell-global-search-fp__search-row",children:[(0,ev.jsx)(eZX,{className:"pisell-global-search-fp__find",displayType:"inline",enableScanner:y,size:"phone"===_?"small":void 0,showHistory:!0,historyKey:x,maxHistoryCount:b,placeholder:c??eZ7("pisell-global-search.placeholder"),confirmButtonText:eZ7("pisell-global-search.search"),value:C,onChange:T,onSearch:(e,t)=>el(e,t)}),g&&ea.length>1&&(0,ev.jsx)("div",{className:"pisell-global-search-fp__mode-switch",children:(0,ev.jsx)(ex.Segmented,{options:ea,value:Q})})]}),(0,ev.jsx)(eXl,{options:ei,value:X,onChange:e=>Z(e)})]}),(0,ev.jsxs)("div",{className:`pisell-global-search-fp__body${G?" pisell-global-search-fp__body--resizing":""}`,ref:U,children:[(0,ev.jsx)("main",{className:`pisell-global-search-fp__main${er?" pisell-global-search-fp__main--bare":""}`,children:(()=>{if(!D)return(0,ev.jsx)("div",{className:"pisell-global-search-fp__empty",children:eZ7("pisell-global-search.empty.idle")});if(en)return(0,ev.jsx)(eXe,{providers:N,stateMap:ee,keyword:D,mode:Q,searchMode:I,locale:S,onJumpTab:e=>Z(e),onClose:es,navigate:m,onAutoOpenUniqueOrderDetail:H,onOpenDetail:q,onRealtimePatchItems:V,detailRefreshVersions:R,onReportTotal:et});let e=N.find(e=>e.key===X);if(!e)return null;let t=ee[e.key]??{loading:!1,list:[],total:0};return(0,ev.jsx)(eXt,{provider:e,state:t,keyword:D,mode:Q,searchMode:I,onClose:es,navigate:m,onAutoOpenUniqueOrderDetail:H,onOpenDetail:q,onRealtimePatchItems:V,detailRefreshVersions:R,onReportTotal:et})})()}),eo&&(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("div",{className:"pisell-global-search-fp__resizer",onMouseDown:W,role:"separator","aria-orientation":"vertical"}),(0,ev.jsx)("aside",{className:"pisell-global-search-fp__detail",style:{flex:`0 0 ${Y}`,width:Y},children:(()=>{if(!z)return(0,ev.jsx)("div",{className:"pisell-global-search-fp__detail-idle",children:eZ7("pisell-global-search.detail.idle")});if("order"===z.providerKey){let e=e0c(R,"order",z.id),t=`global-search-order-detail-${z.id}`;return(0,ev.jsx)(eXn,{refreshVersion:e,renderType:"current",tmpl:"B",variant:"tablet",summaryTwoColumn:!0,osProps:{osKey:t,orderId:Number(z.id),preloadedSalesDetail:z.record&&"object"==typeof z.record?z.record:void 0,autoBootstrap:!0,destroyOnUnmount:!0,syncDetailOnOrderChange:!0}},t)}return null})()})]})]})]})};e0b.displayName="PisellGlobalSearchFullPage";let e0_=iW(e0b);em().extend(eu()),em().extend(eh())})(),n})());
|
|
114
|
+
${eN.getText("pisell2.orderList.common.refundedAmount")}: $${r.toFixed(2)}`);let c=eZe[i]||"";return["voided","authorized"].includes(e)?(0,ev.jsx)(lL.PisellTags,{className:"cursor-pointer",style:{backgroundColor:c,whiteSpace:"nowrap"},children:eZt(i,a)||"-"}):(0,ev.jsx)(ex.Tooltip,{title:(0,ev.jsx)("div",{style:{whiteSpace:"pre-wrap"},children:d}),children:(0,ev.jsx)(lL.PisellTags,{className:"cursor-pointer",style:{backgroundColor:c,whiteSpace:"nowrap"},children:eZt(i,a)})})}},{title:eN.getText("pisell2.orderList.column.orderChannel"),dataIndex:"order_sales_channel",key:"order_sales_channel",width:160,render:e=>eZt(e,{online_store:eN.getText("pisell2.orderList.platform.online_store"),wholesalebusiness:eN.getText("pisell2.orderList.platform.wholesalebusiness"),"table-order":eN.getText("pisell2.orderList.platform.table-order"),mobile_order:eN.getText("pisell2.orderList.platform.mobile_order"),kiosk:eN.getText("pisell2.orderList.platform.kiosk"),pos:eN.getText("pisell2.orderList.platform.pos")})||"-"},{title:eN.getText("pisell2.orderList.column.productQuantity"),dataIndex:"product_quantity",key:"product_quantity",width:180,isShow:!1,render:e=>`${Number(e||0)}${eN.getText("pisell2.orderList.common.itemsCount")}`},{title:eN.getText("pisell2.orderList.column.orderStatus"),dataIndex:"status",key:"status",width:140,isShow:!1,render:e=>{let t=eJ8(eN),l=eJ6[e],a={};return l&&(a={borderColor:l.borderColor,color:l.textColor,whiteSpace:"nowrap"}),(0,ev.jsx)(lL.PisellTags,{className:"cursor-pointer",style:a,children:eZt(e,t)||"-"})}},{title:eN.getText("pisell2.orderList.column.processStatus"),dataIndex:"shipping_status",key:"shipping_status",width:140,isShow:!1,render:e=>{let t=eJ5(eN),l=eJ7[e],a={};return l&&(a={borderColor:l.borderColor,color:l.textColor,whiteSpace:"nowrap"}),(0,ev.jsx)(lL.PisellTags,{className:"cursor-pointer",style:a,children:eZt(e,t)||"-"})}},{title:eN.getText("pisell2.orderList.column.createInfo"),dataIndex:"create_account",key:"create_account",isShow:!1,width:180,render:(e,t)=>{let{created_at:l,create_account_id:a}=t||{},{first_name:i,last_name:n}=e||{},s=`${i||""} ${n||""}`;return Number(a)>0&&(s=eN.getText("pisell2.orderList.filter.customer.label")),(0,ev.jsxs)("div",{className:"compound-cell",children:[(0,ev.jsx)("div",{className:"title",children:`${s||"-"}`}),(0,ev.jsx)("div",{className:"subtitle",children:l||"-"})]})}},{title:eN.getText("pisell2.orderList.column.moreInfo"),dataIndex:"last_edit_account",key:"last_edit_account",isShow:!1,width:180,render:e=>{if(e){let{account:t,created_at:l}=e||{},{display_name:a}=t||{};return(0,ev.jsxs)("div",{className:"compound-cell",children:[(0,ev.jsx)("div",{className:"title",children:`${a||"-"}`}),(0,ev.jsx)("div",{className:"subtitle",children:l||"-"})]})}return"-"}}],[eN]),g=(null==p||null==(a=p.appHelper)?void 0:a.utils)||{};z_.Em.setRequest(null==g?void 0:g.request);let h=null==(s=window)||null==(n=s.app)||null==(i=n.history)?void 0:i.useParams,[v,f]=(0,ef.useState)([]),[y,x]=(0,ef.useState)([]),b=null==h?void 0:h(),_=null==g||null==(r=g.getApp)?void 0:r.call(g),k=(0,ef.useMemo)(()=>({list:{business_code:o||(null==b?void 0:b.biz)}}),[e.biz,null==b?void 0:b.biz]),w=(0,ef.useMemo)(()=>({columns:m,bordered:!0,rowKey:"id",scroll:{x:"max-content"},size:"small",onRow:e=>({onClick:()=>{var t,l,a;let i=encodeURIComponent((null==_||null==(a=_.history)||null==(l=a.instance)||null==(t=l.location)?void 0:t.pathname)||"");_.history.push(`/order-detail?id=${e.id}&goback=${i}`)}}),rowSelection:{selectedRowKeys:v,onChange:(e,t)=>{f(e),x(t)}}}),[m,v]),j=(0,ef.useMemo)(()=>({locales:eN,selectedKeys:v,selectedRows:y,onClearSelection:()=>{f([]),x([])}}),[eN,v,y]),S=(0,ef.useCallback)(()=>{f([]),x([])},[]);return(0,ev.jsx)(lL.Page,{style:{height:"100%"},children:(0,ev.jsx)(lL.PisellDataSourceContainer,{dataSource:{key:"orderList"},actions:{list:eVa},pagination:!0,extraParams:k,children:(0,ev.jsxs)(lL.PisellGridPro,{style:{height:"100vh",...d},className:c,children:[(0,ev.jsx)(lL.PisellGridPro.Header,{title:eN.getText("pisell2.orderList.title")}),(0,ev.jsx)(eZc,{clearSelectedData:S,__id:u,locales:eN}),(0,ev.jsx)(lL.PisellGridView,{children:(0,ev.jsx)(lL.PisellDataSourceContainer.Table,{...w,__id:u})}),(0,ev.jsx)(eZp,{...j}),(0,ev.jsx)(lL.PisellGridPro.Footer,{children:(0,ev.jsx)(lL.PisellDataSourceContainer.Pagination,{})})]})})},k.list.business_code)},eZg=e=>{var t;let{detail:l,...a}=e;if(!l)return;let{discount_list:i}=l;return{rowKey:(e=>{var t,l,a,i,n,s;let r={...e},o=`${r.product_id}`,d=o;if(r.product_variant_id&&(d+=`_${r.product_variant_id}`),null==r||null==(l=r.product_sku)||null==(t=l.option)?void 0:t.length)for(let e of null==r||null==(i=r.product_sku)?void 0:i.option){let t=`_${e.option_group_id}_${e.product_option_item_id||e.option_group_item_id}`;d+=`${t}_${e.quantity||e.num}`}if(null==r||null==(a=r.product_bundle)?void 0:a.length)for(let e of r.product_bundle){let t=`_${e.bundle_group_id}_${e.bundle_product_id}`;if(d+=`${t}_${e.quantity||e.num}`,null==e?void 0:e.option)for(let t of e.option){let e=`_${t.option_group_id}_${t.product_option_item_id}`;o+=e,d+=`${e}_${t.quantity||t.num}`}}return(null==r?void 0:r.session)&&(d+=`_${null==r||null==(n=r.session)?void 0:n.key}`),(null==r?void 0:r.schedule)&&(d+=`_${null==r||null==(s=r.schedule)?void 0:s.key}`),d})(e),product_id:l.product_id,option:((null==l||null==(t=l.product_sku)?void 0:t.option)||[]).map(e=>({...e,price:e.price||e.add_price})),bundle:(l.product_bundle||[]).map(t=>{let l=(null==t?void 0:t.bundle_sum_type)==="markdown"?`-${Number(t.bundle_sum_price)}`:Number(t.bundle_sum_price),a=(i||[]).filter(e=>{var l,a;return(null==e||null==(l=e.metadata)?void 0:l.custom_product_bundle_map_id)===(null==(a=t.metadata)?void 0:a.custom_product_bundle_map_id)});return{...t,booking_id:e.id,title:t.bundle_title,discount_list:a,group_id:t.bundle_group_id,id:t.bundle_id,product_id:t.bundle_product_id,_bundle_product_id:t.bundle_product_id,bundle_variant_id:t.bundle_variant_id,quantity:t.num,option:t.option.map(e=>({...e,name:e.name.auto,quantity:t.num,product_option_item_id:e.option_group_item_id})),price:t.bundle_selling_price??l,original_total:t.bundle_selling_price??l,original_price:t.bundle_selling_price??l,product_price:t.bundle_selling_price??l}}),product_variant_id:l.product_variant_id||0,quantity:Number(l.product_quantity)}};function eZh(e,t){if(!e)return;let l=t.editModeInitialState||{};e.setState({bookingConfigParams:t.bookingConfigParams,...l})}let eZv=async(e,t)=>{var l,a,i,n,s,r;let o=await eCz({shop_id:null==e||null==(i=e.appHelper)||null==(a=i.utils)||null==(l=a.getData)?void 0:l.call(a,"shop_id"),data:{scope:"board",section_code:["reservation","fulfillment","menu"],target:`${t}+pos`}},{prefix:!1,headers:{"Tenant-Id":null==e||null==(r=e.appHelper)||null==(s=r.utils)||null==(n=s.getData)?void 0:n.call(s,"tenant_id")}});return(null==o?void 0:o.data)||{}};function eZf(e){var t,l,a,i,n,s,r,o,d,c,u;let{open:p,order_id:m,onClose:g,callback:h,rulesHooks:v,createModeConfig:f,variant:y}=e,{preloaded:x,preloadedEditData:b,onEditDataReady:_}=e,k=ik();if(!x&&!m&&!f){let e=(null==(d=k.engine)?void 0:d.props)||{};m=e.order_id,p=e.open,h=e.callback,v=e.rulesHooks}let[w,j]=(0,ef.useState)(""),{productExtensionType:S}=euo,M=(0,lL.useToast)(),N=(0,ef.useRef)(null),[C,T]=(0,ef.useState)(x&&b?b:null),[P,A]=(0,ef.useState)(0),D=(0,ef.useCallback)(e=>{T(e),A(e=>e+1)},[]),I=(0,ef.useRef)(b),E=(0,ef.useRef)(null);if(x&&b&&b!==I.current){let e=I.current,t=!!(null==(c=b.editModeInitialState)?void 0:c.isEditTicketMode),l=!!(null==e||null==(u=e.editModeInitialState)?void 0:u.isEditTicketMode),a=null!=e&&l!==t,i=!N.current||!C||a||!t;I.current=b,i?(E.current=null,T(b),A(e=>e+1)):E.current=b}(0,ef.useEffect)(()=>{let e=E.current;e&&N.current&&(E.current=null,e.editModeInitialState,eZh(N.current,e))},[b]);let z=EU();eN.init(eue,(null==(n=k.appHelper.utils)||null==(i=n.getApp)||null==(a=i.call(n))||null==(l=a.locales)||null==(t=l.getLocale)?void 0:t.call(l))||(null==(r=k.appHelper.utils)||null==(s=r.storage)?void 0:s.get("umi_locale"))||"en");let{interaction:L,getSymbolic:O}=(null==(o=k.appHelper)?void 0:o.utils)||{};(0,ef.useEffect)(()=>{if(!p){var e,t,l,a,i;if(x){if("u">typeof window)try{let e=null==(i=window)||null==(a=i.shopApi)||null==(l=a.bookingTicket)?void 0:l.clearAllCart;"function"==typeof e&&e()}catch(e){}}else D(null);null==L||null==(t=L.utils)||null==(e=t.postMessageToApp)||e.call(t,{module:"cds",key:"cartUpdate",data:{currency_symbol:null==O?void 0:O(),total:"0",products:[],fees:[]}})}},[p,D,x]),(0,ef.useLayoutEffect)(()=>{z_.Em.setRequest(k.appHelper.utils.request)},[]),(0,ef.useEffect)(()=>{if(!p)return;let t=!0;if(x&&!m&&b)return void j(e.title||eN.getText("pisell2.ticket-booking.new-booking"));if(!m&&f){let t={...euo.modalState,...f.initialModalState};j(e.title||eN.getText("pisell2.ticket-booking.new-booking")),D({bookingConfigParams:f.bookingConfigParams,productDisplayConfig:f.productDisplayConfig||"sku-list-a2",businessCode:f.businessCode??"",editModeInitialState:{bookingId:0,bookingDetail:null,isParallelResourcesBooking:!0,modalState:t,open:!0,isBookingTicket2:!0,isEditTicketMode:!1,dialogCallback:e=>{var t,l;null==h||h(e),null==L||null==(l=L.utils)||null==(t=l.postMessageToApp)||t.call(l,{module:"cds",key:"cartUpdate",data:{currency_symbol:null==O?void 0:O(),total:"0",products:[],fees:[]}})},...Array.isArray(f.associated_menu_list_ids)&&f.associated_menu_list_ids.length>0?{associated_menu_list_ids:f.associated_menu_list_ids}:{},...f.order_type?{order_type:f.order_type}:{}}});return}return x||D(null),async function(){var l,a,i,n,s,r,o,d,c,u,p,g,v;if(m){null==M||null==(l=M.loading)||l.call(M);try{let l,g=await $Z(m);try{null==z||null==(c=z.addLog)||c.call(z,{metadata:{bookingOrigin:JSON.stringify(g)},title:`TicketBookingDialog-getBookingDetail ${m}`})}catch(e){}if(!g.business_code){null==M||null==(u=M.close)||u.call(M),ex.Modal.error({title:eN.getText("pisell2.ticket-booking.business-not-supported.title"),content:eN.getText("pisell2.ticket-booking.business-not-supported.content"),onOk:()=>{null==h||h({type:"no-support-business"})}});return}if(!t)return;j(e.title||(null==g||null==(a=g.bookings)?void 0:a.booking_id)||(null==g?void 0:g.shop_full_order_number));let y={appointment_booking:{productDisplayConfig:"sku-list-a2",bookingConfigParams:{item_type:"appointment_booking",sub_type:"ticket",osKey:"edit"},order_type:"appointment_booking"},virtual:{productDisplayConfig:"sku-list-a5",bookingConfigParams:{item_type:"appointment_booking",sub_type:"food",source_type:"pos",osKey:"edit"},order_type:"virtual"},"table-order":{productDisplayConfig:"sku-list-a5",bookingConfigParams:{item_type:"appointment_booking",sub_type:"food",source_type:"pos",osKey:"edit"},order_type:"table-order"}},b=[],w=await eZv(k,g.business_code);null==w||null==(i=w["menu.associated_menus"])||i.forEach(e=>{b.push(Number(e.value))});let S=null==(n=y[null==g?void 0:g.type])?void 0:n.bookingConfigParams,C=null==(s=y[null==g?void 0:g.type])?void 0:s.productDisplayConfig,T=g.business_code||"",P=null==(r=y[null==g?void 0:g.type])?void 0:r.order_type;f&&(f.bookingConfigParams&&"object"==typeof f.bookingConfigParams&&(S=f.bookingConfigParams),f.productDisplayConfig&&(C=f.productDisplayConfig),null!=f.businessCode&&""!==String(f.businessCode).trim()&&(T=String(f.businessCode).trim()));let A=((e,t)=>{var l,a,i,n;let{customer_id:s,holder:r,customer_name:o,email:d,phone:c,country_calling_code:u,bookings:p,customer:m,note:g,payment_status:h,is_other_entrance_edited:v,shop_discount:f,contacts_info:y,relation_details:x=[]}=e;p||(p={list:[]});let b=((null==m?void 0:m.display_name)||"").trim()||((null==m?void 0:m.nickname)||"").trim()||o||"",_={name:b,nickname:b,id:s||(null==m?void 0:m.id)||(null==m?void 0:m.customer_id)||1,email:null==m?void 0:m.email,phone:(null==m?void 0:m.phone)||"",country_calling_code:(null==m?void 0:m.country_calling_code)||"",cover:(null==m?void 0:m.cover)||"",waiver_form:(null==m?void 0:m.waiver_form)||[],contacts_info:{value:y}},k=null==p||null==(a=p.list)||null==(l=a[0])?void 0:l.start_date,w=em()(k?k+" "+(null==p||null==(n=p.list)||null==(i=n[0])?void 0:i.start_time):new Date),j=p.list.map(e=>{var t,l,a,i,n,s,r,o;let d,{detail:c,product:u,...p}=e,m=c||mockProduct,g=em()(p.start_date+" "+p.start_time),h=em()(p.end_date+" "+p.end_time),v=em()(h).add(1,"minute"),f={};return(null==e||null==(l=e.metadata)?void 0:l.groupId)&&(f.duration=v.diff(g,"days")),{_id:(Math.random()+"").replace(/\D/g,"").substring(0,11),...m,duration:(null==m?void 0:m.duration)||(null==u?void 0:u.duration),"schedule.ids":(null==m?void 0:m["schedule.ids"])||(null==u?void 0:u["schedule.ids"]),booking_id:p.id,id:m.product_id,title:m.product_title,quantity:Number(m.product_quantity),cover:m.product_cover,price:Number(m.source_product_price),relation_form_name:p.relation_form_name,product_resource:null==u?void 0:u.product_resource,capacity:null==u?void 0:u.capacity,_extend:{...p,quantity:Number(m.product_quantity),startDate:g,start_date:g,endDate:h,end_date:h,holder_id:(null==p||null==(i=p.holder)||null==(a=i.form_record)?void 0:a[0])||[],price:Number(m.source_product_price),product_name:m.product_title,discount_reason:m.product_discount_reason,order_detail_id:m.order_detail_id,total:Number(m.selling_price),origin_total:Number(m.original_price),payment_price:Number(m.payment_price),main_product_selling_price:null==(t=m.metadata)?void 0:t.main_product_selling_price,other:eZg(e),bundle_edit:0,discount_per:m.discount_per,discount_type:m.discount_type,discountway:m.discountway,capacity:null==(n=p.metadata)?void 0:n.capacity,resource:(e=>{if(!e.relation_type)try{var t;if((null==e?void 0:e.event_resources)&&(null==e||null==(t=e.event_resources)?void 0:t.length))return e.event_resources.reduce((e,t)=>(e[t.form_id]?e[t.form_id].push(t):e[t.form_id]=[t],e),{})}catch(e){}return e.relation_id})(p),...f,...(d=0,(null==(r=e.holder)||null==(s=r.form_record)?void 0:s.length)&&(d=e.holder.form_record[0]),!d&&(d=null==(o=e.metadata)?void 0:o.holder_id),{...e.metadata||{},holder_id:d})}}});j=[...j||[],...(x||[]).map(e=>{var t;return{...e,_id:(Math.random()+"").replace(/\D/g,"").substring(0,11),id:e.product_id,title:e.product_title,quantity:e.product_quantity,cover:e.product_cover,price:Number(e.source_product_price),booking_id:e.order_id,isEditBooking:!0,_extend:{main_product_selling_price:null==(t=e.metadata)?void 0:t.main_product_selling_price,discount_reason:e.product_discount_reason,order_detail_id:e.order_detail_id,discount_per:e.discount_per,discount_type:e.discount_type,discountway:e.discountway,product_name:e.product_title,total:Number(e.selling_price),origin_total:Number(e.original_price),payment_price:Number(e.payment_price),price:Number(e.source_product_price),quantity:e.product_quantity,bundle_edit:0,other:eZg(e),startDate:em()(),endDate:em()(),note:e.note},payment_price:Number(e.payment_price)}})];let S=(e=>{let{shop_discount:t,bookings:l,payment_status:a}=e,i=Array.isArray(null==l?void 0:l.list)?l.list:[],n=null==l?void 0:l.appointment_status;return!!i.some(e=>!e.detail)||!("cancelled"!==n&&["unfulfilled","paid","partially_paid","unpaid","payment_processing"].includes(a))})(e);return{...t,client:{...t.client,value:_,edit:!1,showModal:!1},contacts_info:{...(null==t?void 0:t.contacts_info)||{},edit:!1,value:y,client_id:null==_?void 0:_.id},date:{...t.date,value:w,edit:!1,showModal:!1},addons:{...t.addons,load:!1},pet:{...t.pet,showModal:!1,edit:!1},service:{...t.service,value:j,resources:[],addModal:!1,editModal:!1,edit:!1},notes:{...t.notes,orderNote:g,edit:!1},disabledEdit:S,channelDisabledEdit:!1,appointment_status:null==p?void 0:p.appointment_status}})(g,euo.modalState);try{null==z||null==(p=z.addLog)||p.call(z,{metadata:{modalState:JSON.stringify(A)},title:`TicketBookingDialog-getBookingDetail_formatBookingDetail ${m}`})}catch(e){}A.service.value=(A.service.value||[]).map(e=>({...e,edit:!0})),A.service.edit=!0;let{paidAmount:I,paidAmountWithoutSurcharge:E}=(v=g,{paidAmount:(l=((null==v?void 0:v.payments)||[]).filter(e=>(null==e?void 0:e.status)==="paid")).reduce((e,t)=>e+Number(t.amount),0),paidAmountWithoutSurcharge:l.reduce((e,t)=>e+Number(t.amount)-Number(t.service_fee||0),0)}),R={bookingConfigParams:S,productDisplayConfig:C,businessCode:T,editModeInitialState:{bookingId:"",bookingDetail:g,isParallelResourcesBooking:!0,modalState:A,paymentPaid:{value:{paidAmount:I,paidAmountWithoutSurcharge:E}},open:!0,isBookingTicket2:!0,isEditTicketMode:!0,dialogCallback:e=>{var t,l;null==h||h(e),null==L||null==(l=L.utils)||null==(t=l.postMessageToApp)||t.call(l,{module:"cds",key:"cartUpdate",data:{currency_symbol:null==O?void 0:O(),total:"0",products:[],fees:[]}})},...f&&Array.isArray(f.associated_menu_list_ids)&&f.associated_menu_list_ids.length>0?{associated_menu_list_ids:f.associated_menu_list_ids}:(null==b?void 0:b.length)?{associated_menu_list_ids:b}:{},...(null==f?void 0:f.order_type)||P?{order_type:(null==f?void 0:f.order_type)||P}:{}}};if(null==M||null==(o=M.close)||o.call(M),!(null==A||null==(d=A.service)?void 0:d.value)||A.service.value.length<=0)return void ex.Modal.error({title:eN.getText("pisell2.ticket-booking.no-service.title"),content:eN.getText("pisell2.ticket-booking.no-service.content"),onOk:()=>{null==h||h({type:"no-support-business"})}});x&&N.current?eZh(N.current,R):D(R),null==_||_(R)}catch(e){console.error("[TicketBookingDialog] getBookingDetail failed",e),null==z||null==(g=z.addLog)||g.call(z,{metadata:{error:null==e?void 0:e.message},title:`TicketBookingDialog-getBookingDetail failed ${m}`}),ex.Modal.error({title:eN.getText("pisell2.ticket-booking.business-not-supported.title"),content:eN.getText("pisell2.ticket-booking.business-not-supported.content"),onOk:()=>{null==h||h({type:"no-support-business"})}})}}}(),()=>{t=!1}},[p,m,f,x,b,D]);let R="phone"===y,$=(0,ef.useCallback)(()=>{var e,t;null==L||null==(t=L.utils)||null==(e=t.postMessageToApp)||e.call(t,{module:"cds",key:"cartUpdate",data:{currency_symbol:null==O?void 0:O(),total:"0",products:[],fees:[]}}),null==h||h({type:"close"}),null==g||g()},[h,g]),F=(0,ef.useMemo)(()=>R?null:(0,ev.jsxs)("div",{className:"ticket-booking-dialog-body-top-slot",children:[(0,ev.jsx)("div",{className:"ticket-booking-dialog-body-top-content",children:(0,ev.jsx)("div",{className:"ticket-booking-dialog-body-top-title",title:String(w||""),children:w})}),(0,ev.jsx)("button",{type:"button",className:"ticket-booking-dialog-body-top-close","aria-label":"Close",onClick:$,children:(0,ev.jsx)(lL.Iconfont,{type:"pisell2-x-close"})})]}),[$,R,w]);return(0,ev.jsx)(iB,{renderType:R?"drawer":"modal",showHandlerBar:R,onHandlerBarClick:$,props:R?{open:p,onClose:$,placement:"bottom",title:void 0,width:"100%",height:"95%",className:"ticket-booking-dialog-drawer-phone",rootClassName:"ticket-booking-dialog-drawer-phone-root",destroyOnClose:!1,forceRender:!!x,maskClosable:!1,footer:null,closable:!1,bodyStyle:{padding:0,height:"100%"}}:{open:p,onCancel:$,title:null,width:"99%",className:"ticket-booking-dialog-modal",destroyOnClose:!1,forceRender:!!x,header:!1,maskClosable:!1,footer:null,closeIcon:null,wrapClassName:"ticket-booking-dialog-wrapper",size:"large",bodyStyle:{padding:0,height:"100%"}},children:C?(0,ev.jsx)(eud,{isActive:p,rulesHooks:v,bookingConfigParams:C.bookingConfigParams,productExtensionType:S,isShowMenuBar:!1,isShowTimeBar:!1,isShowFloatButtons:!1,isEditTicketMode:!!m,editModeInitialState:C.editModeInitialState,productDisplayConfig:C.productDisplayConfig,businessCode:C.businessCode,bodyTopSlot:F,storeRef:N},P):(0,ev.jsx)(ex.Skeleton,{round:!0,active:!0,loading:!0})})}eZf.displayName="TicketBookingDialog";let eZy=iW(eZf);function eZx(e){let t=Array.isArray(e)?e[0]:e;return(null==t?void 0:t.value)&&"object"==typeof t.value?t.value:t&&"object"==typeof t?t:{}}function eZb(e,t){let l=t||(null==e?void 0:e.last_edit_account)||(null==e?void 0:e.create_account)||(null==e?void 0:e.customer);if(l&&"object"==typeof l){let e=String((null==l?void 0:l.display_name)||(null==l?void 0:l.customer_name)||[null==l?void 0:l.first_name,null==l?void 0:l.last_name].filter(Boolean).join(" ")).trim();if(e)return{...l,display_name:e}}return(null==e?void 0:e.customer_name)||(null==e?void 0:e.phone)||(null==e?void 0:e.email)?{display_name:(null==e?void 0:e.customer_name)||"",phone:(null==e?void 0:e.phone)||"",country_calling_code:(null==e?void 0:e.country_calling_code)||"",email:(null==e?void 0:e.email)||""}:null}function eZ_(e){var t,l,a,i;let n=Number(null==e||null==(t=e.summary)?void 0:t.total_amount),s=Number(null==e?void 0:e.total_amount),r=Number.isFinite(n)?n:Number.isFinite(s)?s:0,o=(null==e||null==(l=e.summary)?void 0:l.customer_paid_amount)?Number(null==e||null==(a=e.summary)?void 0:a.customer_paid_amount):null,d=Number((null==e?void 0:e.total_refund_amount)||(null==e||null==(i=e.summary)?void 0:i.total_refund_amount)||0),c=Array.isArray(null==e?void 0:e.payments)?e.payments:[],u=c.reduce((e,t)=>{if(!["paid","captured","success","completed"].includes(String((null==t?void 0:t.status)||"").toLowerCase()))return e;let l=Number((null==t?void 0:t.amount)??(null==t?void 0:t.origin_amount)??0);return!Number.isFinite(l)||l<=0?e:e+l},0),p=c.reduce((e,t)=>{if(!["refunded","partially_refunded","refund"].includes(String((null==t?void 0:t.status)||"").toLowerCase()))return e;let l=Number((null==t?void 0:t.amount)??(null==t?void 0:t.origin_amount)??0);return!Number.isFinite(l)||l<=0?e:e+l},0),m=Number.isFinite(o)?o:u,g=Number.isFinite(d)?d:p,h=Math.max(r-m,0);return{totalAmount:r,paidAmount:m,refundedAmount:g,dueAmount:h}}let eZk=e=>{var t,l,a,i,n,s,r,o;let d=ik(),c=null==d||null==(t=d.appHelper)?void 0:t.utils,u=null==c?void 0:c.translationOriginal,p=null==d||null==(i=d.appHelper)||null==(a=i.utils)||null==(l=a.getApp)?void 0:l.call(a),m=null==d||null==(s=d.appHelper)||null==(n=s.utils)?void 0:n.NativePage,g=null==e?void 0:e.onOpenDetail,h=null==d||null==(o=d.engine)||null==(r=o.props)?void 0:r.locale,v=BK(),f=null==e?void 0:e.businessCode,y=(0,ef.useMemo)(()=>{let e=eVk(),t={online_store:eN.getText("pisell2.salesManagement.order.platform.online_store"),wholesalebusiness:eN.getText("pisell2.salesManagement.order.platform.wholesalebusiness"),"table-order":eN.getText("pisell2.salesManagement.order.platform.table-order"),mobile_order:eN.getText("pisell2.salesManagement.order.platform.mobile_order"),kiosk:eN.getText("pisell2.salesManagement.order.platform.kiosk"),pos:eN.getText("pisell2.salesManagement.order.platform.pos")},l=eVj(),a=eVM(),i=eVC(),n={"dine-in":eN.getText("pisell2.salesManagement.order.shopServiceType.dine-in"),takeaway:eN.getText("pisell2.salesManagement.order.shopServiceType.takeaway")},s=eWm();return{PAYMENT_STATUS_LABEL_MAP:e,PLATFORM_LABEL_MAP:t,ORDER_STATUS_LABEL_MAP:l,SHIPPING_STATUS_LABEL_MAP:a,DELIVERY_TYPE_LABEL_MAP:i,SHOP_SERVICE_TYPE_LABEL_MAP:n,BUSINESS_LABEL_MAP:s,orderLabels:{saleBrief:eN.getText("pisell2.salesManagement.order.column.saleBrief"),customer:eN.getText("pisell2.salesManagement.order.column.customer"),contact:eN.getText("pisell2.salesManagement.order.column.contact"),paymentInfo:eN.getText("pisell2.salesManagement.order.column.paymentInfo"),paymentMethod:eN.getText("pisell2.salesManagement.order.column.paymentMethod"),items:eN.getText("pisell2.salesManagement.order.column.items"),paymentStatus:eN.getText("pisell2.salesManagement.order.column.paymentStatus"),orderOrigin:eN.getText("pisell2.salesManagement.order.column.orderOrigin"),shippingMethod:eN.getText("pisell2.salesManagement.order.column.shippingMethod"),fulfillmentMethod:eN.getText("pisell2.salesManagement.order.column.fulfillmentMethod"),orderStatus:eN.getText("pisell2.salesManagement.order.column.orderStatus"),fulfillmentStatus:eN.getText("pisell2.salesManagement.order.column.fulfillmentStatus"),updated:eN.getText("pisell2.salesManagement.order.column.updated"),orderId:eN.getText("pisell2.salesManagement.order.column.orderId"),orderNote:eN.getText("pisell2.salesManagement.order.common.orderNote"),internalNote:eN.getText("pisell2.salesManagement.order.common.internalNote"),createdBy:eN.getText("pisell2.salesManagement.order.common.createdBy"),guest:eN.getText("pisell2.salesManagement.order.common.guest"),walkIn:eN.getText("pisell2.salesManagement.order.common.walkIn")},amountLabels:{total:eN.getText("pisell2.salesManagement.order.common.totalAmount"),paid:eN.getText("pisell2.salesManagement.order.common.paidAmount"),due:eN.getText("pisell2.salesManagement.order.common.dueAmount"),refunded:eN.getText("pisell2.salesManagement.order.common.refundedAmount"),items:eN.getText("pisell2.salesManagement.order.common.itemsCount")}}},[h]),x=(0,ef.useCallback)(e=>{let{PAYMENT_STATUS_LABEL_MAP:t,PLATFORM_LABEL_MAP:l,ORDER_STATUS_LABEL_MAP:a,SHIPPING_STATUS_LABEL_MAP:i,DELIVERY_TYPE_LABEL_MAP:n,SHOP_SERVICE_TYPE_LABEL_MAP:s,BUSINESS_LABEL_MAP:r,orderLabels:o,amountLabels:d}=y;return[{title:o.saleBrief,key:"sale_brief",width:225,render:(l,a)=>{let i=null==a?void 0:a.shop_full_order_number,n=null==a?void 0:a.currency_symbol,{totalAmount:s}=eZ_(a),r=null==a?void 0:a.payment_status,c=null==a?void 0:a.note,u=null==a?void 0:a.internal_note,p=BY((null==a?void 0:a.id)||(null==a?void 0:a.order_id)||(null==a?void 0:a.orderId)),m=(null==a?void 0:a.tag)||(null==a?void 0:a.tags)||[],g=t[r]||r||"-",h=eVw[r]||"";return(0,ev.jsxs)("div",{className:"pisell-sales-grid-sale-brief",style:{display:"flex",flexDirection:"column"},children:[(0,ev.jsx)("div",{style:{fontWeight:"bold",textDecoration:"underline",color:"var(--theme-color, #7f56d9)"},children:i}),Array.isArray(m)&&m.length>0?(0,ev.jsx)("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:m.map(e=>(0,ev.jsx)(eWh,{style:{margin:0,maxWidth:160,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontWeight:500},children:null==e?void 0:e.name},`${null==e?void 0:e.id}`))}):null,(0,ev.jsxs)("div",{style:{fontWeight:"bold"},children:[(0,ev.jsxs)("span",{style:{marginRight:6},children:[d.total,":"]}),(0,ev.jsx)("span",{children:eWv(s,n)})]}),(0,ev.jsx)("div",{children:(0,ev.jsx)(eWh,{style:{backgroundColor:h,whiteSpace:"nowrap",border:"none",fontWeight:500},children:g})}),(0,ev.jsx)(eWw,{dataSource:{note:c,internalNotes:u,apis:p,onChange:(t,l,a)=>{e.refresh()}},labels:{orderNote:o.orderNote,internalNote:o.internalNote},style:{maxWidth:"100%"}})]})}},{title:o.customer,key:"customer",align:"center",width:150,uniformCompare:(e,t)=>{let l=null==t?void 0:t.customer;if(!l)return"-";let a=null==l?void 0:l.guest_code;return a?`${a}`:1===l.user_id?"walk-in":l},render:(e,t)=>{let l=null==t?void 0:t.customer;if(!l)return"-";if(null==l?void 0:l.guest_code)return(0,ev.jsx)("div",{className:"pisell-sales-grid-person-cell",children:(0,ev.jsx)("div",{style:{fontWeight:"bold"},children:o.guest})});let a=eWf([eWb((null==l?void 0:l.phone)||(null==t?void 0:t.phone),(null==l?void 0:l.country_calling_code)||(null==t?void 0:t.country_calling_code)),null==l?void 0:l.email]);return(0,ev.jsxs)("div",{className:"pisell-sales-grid-person-cell",children:[(0,ev.jsx)(VR,{dataSource:l,style:{fontSize:14}}),a.map((e,t)=>(0,ev.jsx)("div",{style:eWy.text,children:e},`${e}-${t}`))]})}},{title:o.contact,dataIndex:"contacts_info",key:"contacts_info",align:"center",width:150,uniformCompare:(e,t)=>e||"-",render:(e,t)=>{var l,a;let i,n,s,r,o,d,c,u=(i=eZx(e),n=eZx(null==t?void 0:t.contacts_info),s=eZx(null==t?void 0:t.contactsInfo),o=String((null==(r=Object.keys(i).length?i:Object.keys(n).length?n:s)?void 0:r.first_name)||"").trim(),d=String((null==r?void 0:r.last_name)||"").trim(),c=String((null==r?void 0:r.display_name)||`${o} ${d}`).trim(),{displayName:c,phone:"string"==typeof(null==r?void 0:r.phone)?r.phone:(null==r||null==(l=r.phone)?void 0:l.phone)||(null==r||null==(a=r.phone)?void 0:a.value)||(null==r?void 0:r.mobile)||(null==r?void 0:r.phone_number)||"",email:(null==r?void 0:r.email)||""});if(!(null==u?void 0:u.displayName)&&!(null==u?void 0:u.phone)&&!(null==u?void 0:u.email))return"-";let p=eWf([eWb(null==u?void 0:u.phone),null==u?void 0:u.email]);return(0,ev.jsxs)("div",{className:"pisell-sales-grid-person-cell",children:[(0,ev.jsx)(VR,{dataSource:{display_name:null==u?void 0:u.displayName},style:{fontSize:14}}),p.map((e,t)=>(0,ev.jsx)("div",{style:eWy.text,children:e},`${e}-${t}`))]})}},{title:o.paymentInfo,key:"payment_info",width:124,align:"center",render:(e,t)=>{let l=null==t?void 0:t.payment_status,a=null==t?void 0:t.currency_symbol,{totalAmount:i,paidAmount:n,refundedAmount:s,dueAmount:r}=eZ_(t),o={due:{fontWeight:"bold",color:"#D92D20"},refunded:{color:"#CA8504",fontWeight:"bold"}},c=[];return["payment_processing","unpaid","partially_paid"].includes(l)?(c.push({label:d.due,value:eWv(r,a),bold:!0,kind:"due"}),"partially_paid"===l&&c.push({label:d.paid,value:eWv(n,a),bold:!0,kind:"paid"}),c.push({label:d.total,value:eWv(i,a),kind:"total"})):"paid"===l?(c.push({label:d.paid,value:eWv(n,a),bold:!0,kind:"paid"}),c.push({label:d.total,value:eWv(i,a),kind:"total"})):["partially_refunded","refunded"].includes(l)?(c.push({label:d.refunded,value:eWv(s,a),bold:!0,kind:"refunded"}),c.push({label:d.paid,value:eWv(n,a),kind:"paid"}),c.push({label:d.total,value:eWv(i,a),kind:"total"})):(["voided","authorized"].includes(l),c.push({label:d.total,value:eWv(i,a),bold:!0,kind:"total"})),(0,ev.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4,alignItems:"flex-start"},children:c.map(e=>(0,ev.jsx)("div",{style:eWy.text,children:(0,ev.jsxs)("span",{style:{whiteSpace:"nowrap",...e.kind&&o[e.kind]?o[e.kind]:{}},children:[e.label,": ",e.value]})},e.label))})}},{title:o.items,key:"product_quantity",align:"center",width:120,render:(e,t)=>{let l=function(e){var t;let l=Number(null==e?void 0:e.product_quantity);if(Number.isFinite(l)&&l>=0)return l;let a=Number(null==e||null==(t=e.summary)?void 0:t.product_quantity);if(Number.isFinite(a)&&a>=0)return a;let i=Array.isArray(null==e?void 0:e.products)?e.products:[];return 0===i.length?0:i.reduce((e,t)=>{let l=Number((null==t?void 0:t.product_quantity)??(null==t?void 0:t.quantity)??0);return!Number.isFinite(l)||l<=0?e:e+l},0)}(t);return(0,ev.jsxs)("span",{style:{...eWy.text,textAlign:"center"},children:[l,d.items]})}},{title:o.paymentMethod,key:"payment_method",dataIndex:"payments",width:180,align:"center",render:(e,t)=>{let l=(null==t?void 0:t.payments)||(null==t?void 0:t.payment),a=Array.isArray(l)?l.filter(BX):[],i=null==t?void 0:t.currency_symbol;return 0===a.length?"-":(0,ev.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:8,alignItems:"flex-start"},children:a.map((e,t)=>{var l,a,n;let s=((null==e?void 0:e.voucher_id)?(null==u?void 0:u(null==e||null==(l=e.fund_record)?void 0:l.wallet_pass_name))||(null==e||null==(n=e.fund_record)||null==(a=n.wallet_pass_name)?void 0:a.default):"")||BJ(e,v),r=Number(null==e?void 0:e.amount),o=null==e?void 0:e.payment_time;return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[(0,ev.jsxs)("div",{style:{fontSize:14,lineHeight:"20px",color:"#101828",fontWeight:500,whiteSpace:"nowrap"},children:[(0,ev.jsx)("span",{children:s}),Number.isFinite(r)?(0,ev.jsxs)("span",{children:[": ",eWv(r,i)]}):null]}),o?(0,ev.jsx)(lL.PisellDateTimeDisplay,{value:o,layout:"inline",textAlign:"left",timeFormat:{padHour:!0},dateFormat:{showYear:!1,shortMonth:!0,showRelativeDay:!0,useCommaBeforeYear:!1},fields:{fieldOrder:["time","weekday","date"]},style:{...eWy.text,whiteSpace:"nowrap"}}):null]},(null==e?void 0:e.order_payment_id)||t)})})}},{title:o.orderOrigin,key:"order_origin",width:138,align:"center",render:(e,t)=>{let a=l[null==t?void 0:t.order_sales_channel]||l[null==t?void 0:t.order_platform]||(null==t?void 0:t.order_sales_channel)||(null==t?void 0:t.order_platform),i=(null==t?void 0:t.device_name)||(null==t?void 0:t.device)||(null==t?void 0:t.terminal),n=(null==t?void 0:t.created_at)||(null==t?void 0:t.order_time),s=eZb(t,null==t?void 0:t.create_account),d=eWf([a,i]);if(0===d.length)return null;let c=r[t.business_code];return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[c?(0,ev.jsx)("div",{children:(0,ev.jsx)(eWh,{color:eWg[t.business_code],style:{color:"black",fontWeight:500},children:c})}):null,d.map((e,t)=>(0,ev.jsx)("div",{style:eWy.text,children:e},`${e}-${t}`)),(0,ev.jsxs)("div",{style:{display:"flex",alignItems:"center",whiteSpace:"nowrap"},children:[(0,ev.jsxs)("span",{children:[o.createdBy,":"]}),s?(0,ev.jsx)(VR,{dataSource:s,style:{fontSize:14}}):(0,ev.jsx)("span",{style:{...eWy.text,marginLeft:4},children:"-"})]}),(0,ev.jsx)(lL.PisellDateTimeDisplay,{value:n,layout:"inline",textAlign:"left",timeFormat:{padHour:!0},dateFormat:{showYear:!1,shortMonth:!0,showRelativeDay:!0,useCommaBeforeYear:!1},fields:{fieldOrder:["time","weekday","date"]},style:{whiteSpace:"nowrap"}})]})}},{title:o.paymentStatus,dataIndex:"payment_status",key:"payment_status",align:"center",width:160,render:e=>{let l="partially_paid"===e?"unpaid":e,a=t[l]||e||"-",i=eVw[l]||"";return(0,ev.jsx)("div",{style:{textAlign:"center"},children:(0,ev.jsx)(lL.PisellTags,{style:{backgroundColor:i,whiteSpace:"nowrap"},children:a})})}},{title:o.fulfillmentMethod,key:"delivery_type",align:"center",width:160,render:(e,t)=>{let l=function(e,t){var l,a,i,n,s;let r=(null==e?void 0:e.delivery_type)||(null==e?void 0:e.shipping_type)||((null==e?void 0:e.type)==="delivery"||(null==e?void 0:e.business_code)==="delivery"?"local_delivery":void 0),o=(null==e||null==(a=e.metadata)||null==(l=a.shop_service_type)?void 0:l.server_type)||(null==e||null==(i=e.shop_service_type)?void 0:i.server_type)||(null==e?void 0:e.shop_service_type);if("shop_service"===r||null==r&&o){let e=null==(s=t.shopServiceTypeLabelMap)?void 0:s[o];return e?{label:e,color:null==eVP?void 0:eVP[o]}:null}let d=null==(n=t.deliveryTypeLabelMap)?void 0:n[r];return d&&"nil"!==r?{label:d,color:null==eVT?void 0:eVT[r]}:null}(t,{shopServiceTypeLabelMap:s,deliveryTypeLabelMap:n});return l?(0,ev.jsx)("div",{style:{textAlign:"center"},children:(0,ev.jsx)(eWh,{style:{whiteSpace:"nowrap",fontWeight:500},color:l.color,children:l.label})}):"-"},uniformCompare:(e,t)=>{var l,a;let i=(null==t?void 0:t.delivery_type)||"",n=(null==t||null==(a=t.metadata)||null==(l=a.shop_service_type)?void 0:l.server_type)||"";return`${i}|${n}`}},{title:o.orderStatus,dataIndex:"status",key:"status",align:"center",width:150,render:e=>{let t=eVS[e],l=a[e]||e||"-";return(0,ev.jsx)("div",{style:{textAlign:"center"},children:(0,ev.jsx)(lL.PisellTags,{style:{whiteSpace:"nowrap",borderColor:null==t?void 0:t.borderColor,color:null==t?void 0:t.textColor},children:l})})}},{title:o.fulfillmentStatus,dataIndex:"shipping_status",key:"shipping_status",align:"center",width:160,render:e=>{let t=eVN[e],l=i[e]||e||"-";return(0,ev.jsx)("div",{style:{textAlign:"center"},children:(0,ev.jsx)(lL.PisellTags,{style:{whiteSpace:"nowrap",borderColor:null==t?void 0:t.borderColor,color:null==t?void 0:t.textColor},children:l})})}},{title:o.updated,key:"last_edit_account",width:132,align:"center",render:(e,t)=>{let a=eZb(t,null==t?void 0:t.last_edit_account),i=null==t?void 0:t.updated_at,n=eWf([l[null==t?void 0:t.order_platform]||(null==t?void 0:t.order_platform)]);return(0,ev.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[a?(0,ev.jsx)(VR,{dataSource:a,style:{fontSize:14}}):(0,ev.jsx)("div",{style:{...eWy.text},children:"-"}),(0,ev.jsx)(lL.PisellDateTimeDisplay,{value:i,layout:"inline",textAlign:"left",timeFormat:{padHour:!0},dateFormat:{showYear:!1,shortMonth:!0,showRelativeDay:!0,useCommaBeforeYear:!1},fields:{fieldOrder:["time","weekday","date"]},style:{whiteSpace:"nowrap"}}),n.map((e,t)=>(0,ev.jsx)("div",{style:eWy.text,children:e},`${e}-${t}`))]})}},{title:o.orderId,dataIndex:"order_id",key:"order_id",align:"center",width:100,render:(e,t)=>{let l=null==t?void 0:t.shop_order_number;return(0,ev.jsx)("span",{style:{...eWy.text,textAlign:"center"},children:l})}}]},[y,u,v]);return(0,ef.useMemo)(()=>({key:"handle",label:"Handle",getChildComponentProps:e=>{let t,l,a,i;return{grid:{bordered:!0,collapseUniformColumns:!0,columns:x(e),defaultHiddenColumnKeys:["order_origin","payment_status","delivery_type","status","shipping_status","last_edit_account","id"],scroll:{x:"max-content",autoCalc:!0,scrollToFirstRowOnChange:!0},rowSelection:{fixed:!0,columnWidth:48},onRow:e=>({onClick:()=>{let t=(null==e?void 0:e.order_id)??(null==e?void 0:e.orderId)??(null==e?void 0:e.id);g?g({orderId:t,record:e}):null==c||c.action({type:"pisell1.handleOpenSaleDetail",data:{osProps:{orderId:t,osKey:"sales-management-item-detail",businessCode:f,syncDetailOnOrderChange:!0}}})}})},toolBar:{search:{showConfirmButton:!1},sort:{list:[{type:"time",isCustom:!0,name:"created_at",label:eN.getText("pisell2.salesManagement.order.sort.createdAt"),getSortItems:()=>[{key:"created_at:asc",label:eN.getText("pisell2.salesManagement.sort.oldestFirst")},{key:"created_at:desc",label:eN.getText("pisell2.salesManagement.sort.newestFirst")}]},{type:"time",isCustom:!0,name:"updated_at",label:eN.getText("pisell2.salesManagement.order.sort.updatedAt"),getSortItems:()=>[{key:"updated_at:asc",label:eN.getText("pisell2.salesManagement.sort.oldestFirst")},{key:"updated_at:desc",label:eN.getText("pisell2.salesManagement.sort.newestFirst")}]},{type:"number",isCustom:!1,name:"total_amount",label:eN.getText("pisell2.salesManagement.order.sort.totalAmount")},{type:"number",isCustom:!1,name:"amount_gap",label:eN.getText("pisell2.salesManagement.sort.balanceDue")},{type:"string",isCustom:!1,name:"customer_name",label:eN.getText("pisell2.salesManagement.order.sort.customerName")}]},quickFilter:{filterList:[{type:"rangePicker",name:"orderDate",key:"orderDate",props:{placeholder:eN.getText("pisell2.salesManagement.order.quickFilter.orderDate.placeholder")}}]},filter:{hiddenQuickFilter:!0,defaultFilterValue:{quickFilter:[],otherFilter:(t=eVj(),l=eVk(),a=eVM(),i=eVC(),[{name:"status",type:"single",key:"status",label:eN.getText("pisell2.salesManagement.order.filter.orderStatus.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.order.filter.orderStatus.placeholder"),options:Object.entries(t).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"payment_status",type:"single",key:"payment_status",label:eN.getText("pisell2.salesManagement.order.filter.paymentStatus.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.order.filter.paymentStatus.placeholder"),options:Object.entries(l).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"shipping_status",type:"single",key:"shipping_status",label:eN.getText("pisell2.salesManagement.order.filter.fulfillmentStatus.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.order.filter.fulfillmentStatus.placeholder"),options:Object.entries(a).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"customer_id",type:"single",key:"customer_id",label:eN.getText("pisell2.salesManagement.order.filter.customer.label"),other:{allowClear:!0,isSearchServer:!0,showSearch:!0,placeholder:eN.getText("pisell2.salesManagement.order.filter.customer.placeholder"),options:e=>eVi(e).then(e=>e.map(e=>({label:e.display_name,value:e.id})))}},{name:"order_sales_channel",type:"single",key:"order_sales_channel",label:eN.getText("pisell2.salesManagement.order.filter.salesChannel.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.order.filter.salesChannel.placeholder"),options:()=>eVs().then(e=>e.map(e=>({label:e.name,value:e.code})))}},{name:"payment_methods",type:"single",key:"payment_methods",label:eN.getText("pisell2.salesManagement.order.filter.paymentMethod.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",virtual:!1,placeholder:eN.getText("pisell2.salesManagement.order.filter.paymentMethod.placeholder"),options:()=>eVr().then(e=>Array.from(new Map(e.map(e=>[e.code,{label:e.name,value:e.code}])).values()))}},{name:"total_amount",type:"numberRange",key:"total_amount",label:eN.getText("pisell2.salesManagement.order.filter.totalAmount.label"),other:{placeholder:eN.getText("pisell2.salesManagement.order.filter.totalAmount.placeholder"),minInputNumberProps:{min:0},maxInputNumberProps:{min:0}}},{name:"tag_ids",type:"single",key:"tag_ids",label:eN.getText("pisell2.salesManagement.order.filter.tags.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",isSearchServer:!0,showSearch:!0,placeholder:eN.getText("pisell2.salesManagement.order.filter.tags.placeholder"),options:e=>eVn(e).then(e=>e.map(e=>({label:e.name,value:e.id})))}},{name:"delivery_type",type:"single",key:"delivery_type",label:eN.getText("pisell2.salesManagement.order.filter.fulfillmentMethod.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.order.filter.fulfillmentMethod.placeholder"),options:Object.entries(i).filter(e=>{let[t]=e;return!["nil","shop_service"].includes(t)}).map(e=>{let[t,l]=e;return{label:l,value:t}})}},{name:"delivery_zone_name",type:"text",key:"delivery_zone_name",label:eN.getText("pisell2.salesManagement.order.filter.deliveryZone.label"),other:{placeholder:eN.getText("pisell2.salesManagement.order.filter.deliveryZone.placeholder")}},{name:"location_id",type:"single",key:"location_id",label:eN.getText("pisell2.salesManagement.order.filter.pickupLocation.label"),other:{allowClear:!0,placeholder:eN.getText("pisell2.salesManagement.order.filter.pickupLocation.placeholder"),options:()=>eVd().then(e=>e.map(e=>({label:e.name,value:e.id})))}},{name:"shipping_order_number",type:"text",key:"shipping_order_number",label:eN.getText("pisell2.salesManagement.order.filter.trackingNumber.label"),other:{placeholder:eN.getText("pisell2.salesManagement.order.filter.trackingNumber.placeholder")}},{name:"logistics_company_id",type:"single",key:"logistics_company_id",label:eN.getText("pisell2.salesManagement.order.filter.logistics.label"),other:{allowClear:!0,mode:"multiple",maxTagCount:"responsive",placeholder:eN.getText("pisell2.salesManagement.order.filter.logistics.placeholder"),options:()=>eVo().then(e=>e.map(e=>({label:e.name,value:e.id})))}},{name:"zip",type:"text",key:"zip",label:eN.getText("pisell2.salesManagement.order.filter.zipCode.label"),other:{placeholder:eN.getText("pisell2.salesManagement.order.filter.zipCode.placeholder")}}]),values:{}}}},batchActionBar:{overflowThreshold:2,defaultActions:{showSelectAll:!1,showClear:!1,showInvert:!1,showDelete:!1}}}}}),[x,p,h,m,g,f])};function eZw(e){return"monitor"===e?{filter:{values:{order_payment_status:eVO,booking_time_start_between:[em()().startOf("day"),em()().endOf("day")]}}}:{filter:{values:{payment_status:eVO,orderDate:[em()(),em()()]}},sort:"created_at:desc"}}let eZj=e=>{var t,l,a,i,n,s,r,o,d,c,u,p,m,g,h,v,f,y,x;let b,_,k,{perspective:w,__id:j,keyword:S,mode:M,hideToolbarSearch:N,onOpenDetail:C}=e,T=ik(),P=(null==T||null==(t=T.appHelper)?void 0:t.utils)||{},{action:A}=P,D=null==P||null==(l=P.getApp)?void 0:l.call(P);z_.Em.setRequest(null==P?void 0:P.request),eV$=eVR(null==P?void 0:P.isWebPos);let I=rP(B$),E=!!(null==T||null==(i=T.engine)||null==(a=i.props)?void 0:a.isActive);eN.init(eWM,(null==T||null==(s=T.engine)||null==(n=s.props)?void 0:n.locale)||"en"),(0,ef.useEffect)(()=>{"monitor"===w&&setTimeout(()=>{null==A||A({type:"pisell1.registerBookingPlugin"})},300)},[w,A]);let z=null==D||null==(o=D.history)||null==(r=o.useParams)?void 0:r.call(o),L=(0,ef.useMemo)(()=>{if(!("u"<typeof window))return new URLSearchParams(window.location.search||"").get("business_code")||void 0},[]),O=(0,ef.useMemo)(()=>{let t=e.businessCode??e.biz??(null==z?void 0:z.business_code)??(null==z?void 0:z.biz)??L;return(null!=t?String(t).trim():"")||void 0},[e.businessCode,e.biz,null==z?void 0:z.business_code,null==z?void 0:z.biz,L]),R=(0,ef.useMemo)(()=>({list:{business_code:O,...void 0!==M?{mode:M}:{}}}),[O,M]),$=(_=eZk({onOpenDetail:b=(x={relationTables:Array.isArray(I.data)?I.data:[],onOpenDetail:C,businessCode:O}).onOpenDetail,businessCode:null==x?void 0:x.businessCode}),k=eWS(x,{onOpenDetail:b}),(0,ef.useMemo)(()=>[_,k],[_,k])),F=(0,ef.useMemo)(()=>N?($||[]).map(e=>{let t=null==e?void 0:e.getChildComponentProps;if("function"!=typeof t){var l;return{...e,childComponentProps:{...(null==e?void 0:e.childComponentProps)||{},toolBar:{...(null==e||null==(l=e.childComponentProps)?void 0:l.toolBar)||{},search:!1}}}}return{...e,getChildComponentProps:e=>{let l=t(e)||{};return{...l,toolBar:{...l.toolBar||{},search:!1}}}}}):$,[$,N]),B=function(e){var t,l,a,i,n;let{perspective:s,extParams:r,externalKeyword:o}=e,d=ik(),{action:c}=(null==d||null==(t=d.appHelper)?void 0:t.utils)||{},[u,p]=(0,ef.useState)({pageNumber:1,pageSize:20}),[m,g]=(0,ef.useState)(()=>eZw(s)),[h,v]=(0,ef.useState)([]),[f,y]=(0,ef.useState)([]),x=(0,ef.useRef)((0,eH.LP)()),b=(0,ef.useRef)((0,eH.LP)()),_=(0,ef.useRef)(null),k=(0,ef.useRef)(null),w=(0,ef.useMemo)(()=>{let{keyword:e,filter:t,sort:l}=m;return{keyword:void 0!==o?o:e,sort:l,...(null==t?void 0:t.values)||{},skip:u.pageNumber,num:u.pageSize}},[m,u.pageNumber,u.pageSize,o]),j=i0(e=>(null==e?void 0:e.data)??e),S=i0(async e=>eVH(e,{osServer:!0,subscriberId:x.current,callback:e=>{var t;let l=j(e);null!=l&&Array.isArray(l.list)&&0!==l.list.length&&(null==(t=_.current)||t.call(_,l))}})),M=i0(async e=>eVV(e,{osServer:!0,subscriberId:b.current,callback:e=>{var t;let l=j(e);null!=l&&Array.isArray(l.list)&&0!==l.list.length&&(null==(t=k.current)||t.call(k,eVq(l)))}})),N=rP(S,{manual:!0}),C=rP(M,{manual:!0});_.current=N.mutate,k.current=C.mutate;let T=(0,ef.useMemo)(()=>({...w,...(null==r?void 0:r.list)||{}}),[w,null==r?void 0:r.list]);(0,ef.useEffect)(()=>{"monitor"===s?C.run(T):N.run(T)},[s,T]),(0,ef.useEffect)(()=>{g(eZw(s)),p(e=>({...e,pageNumber:1})),v([]),y([])},[s]);let P=(0,ef.useCallback)((e,t)=>{e<1||t<1||p({pageNumber:e,pageSize:t})},[]),A=(0,ef.useCallback)(e=>{g(e||{}),p(e=>({...e,pageNumber:1}))},[]);(0,ef.useEffect)(()=>{void 0!==o&&p(e=>1===e.pageNumber?e:{...e,pageNumber:1})},[o]);let D=(0,ef.useCallback)(()=>{g(eZw(s)),p(e=>({...e,pageNumber:1}))},[s]),I=(0,ef.useCallback)((e,t)=>{v(e),y(t)},[]),E=(0,ef.useCallback)(e=>{"monitor"===s?C.run(T):N.run(T),e&&e.length>0&&c({type:"webpos.updateLocalOrdersApi",data:{order_ids:e}})},[s,T,C,N]),z=(0,ef.useCallback)(()=>"monitor"===s?C.runAsync(T):N.runAsync(T),[s,T,C,N]);(0,ef.useEffect)(()=>{"monitor"===s?eVY(x.current):eVU(b.current)},[s]),(0,ef.useEffect)(()=>()=>{eVY(x.current),eVU(b.current)},[]);let L="monitor"===s?(null==(l=C.data)?void 0:l.list)??[]:(null==(a=N.data)?void 0:a.list)??[],O="monitor"===s?C.loading:N.loading;return{data:L,loading:O,total:"monitor"===s?(null==(i=C.data)?void 0:i.count)??0:(null==(n=N.data)?void 0:n.count)??0,pagination:u,onPageChange:P,searchParams:m,onSearch:A,onReset:D,selectedKeys:h,selectedRows:f,onSelectionChange:I,rowKey:(0,ef.useMemo)(()=>e=>"handle"===s?(null==e?void 0:e.order_id)||(null==e?void 0:e.id):(null==e?void 0:e.id)??"",[s]),onRefresh:E,refreshAsync:z}}({perspective:w,extParams:R,externalKeyword:S}),H=(null==T||null==(c=T.engine)||null==(d=c.props)?void 0:d.locale)==="zh-CN"||(null==T||null==(p=T.engine)||null==(u=p.props)?void 0:u.locale)==="zh-HK"?"zh-cn":(null==T||null==(g=T.engine)||null==(m=g.props)?void 0:m.locale)==="en"||(null==T||null==(v=T.engine)||null==(h=v.props)?void 0:h.locale)==="en-US"?"en":"zh-cn",q=(null==T||null==(y=T.engine)||null==(f=y.props)?void 0:f.locale)||("u">typeof localStorage?localStorage.getItem("umi_locale"):null)||"en-US";return(0,ev.jsx)(lL.PisellConfigProvider,{locale:"zh"===q?"zh-CN":q,children:(0,ev.jsx)(ej8,{dateAdapter:eSy,adapterLocale:H,children:(0,ev.jsx)("div",{style:Object.assign({},{height:0},null==e?void 0:e.style),children:(0,ev.jsx)(eV4,{perspectives:F,currentPerspective:w,extParams:R,__id:j,data:B.data,loading:B.loading,total:B.total,pagination:B.pagination,onPageChange:B.onPageChange,searchParams:B.searchParams,onSearch:B.onSearch,onReset:B.onReset,selectedKeys:B.selectedKeys,selectedRows:B.selectedRows,onSelectionChange:B.onSelectionChange,rowKey:B.rowKey,onRefresh:B.onRefresh,refreshAsync:B.refreshAsync,enableScanner:E})})})})};function eZS(e,t){if(null==e||"number"==typeof e&&Number.isNaN(e))return t.missingValuePlaceholder??"—";let l=t.currencySymbol??"";return lE(e,l,{precision:t.amountPrecision??2,showCurrencySymbol:!!l,useThousandsSeparator:t.useThousandsSeparator??!1,hideDecimalForWholeNumbers:t.hideDecimalForWholeNumbers??!0})}let eZM="pisell-collapse",eZN=ey().memo(e=>{let{headMeta:t,headAmount:l,expanded:a,defaultExpanded:i=!1,onExpandChange:n,children:s,bodyRows:r,className:o,style:d}=e,[c,u]=(0,ef.useState)(i),p=void 0!==a,m=p?a:c,g=(0,ef.useCallback)(()=>{let e=!m;p||u(e),null==n||n(e)},[m,p,n]),h=t.segments??[];h.length||null==t.time&&null==t.date&&null==t.customer&&null==t.channel||((null!=t.time||null!=t.date)&&h.push((0,ev.jsx)("span",{className:`${eZM}-head-segment`,children:[t.time,t.date].filter(Boolean).join(" ")},"time")),null!=t.customer&&h.push((0,ev.jsx)("span",{className:`${eZM}-head-segment`,children:t.customer},"customer")),null!=t.channel&&h.push((0,ev.jsx)("span",{className:`${eZM}-head-segment`,children:t.channel},"channel")));let v=((null==r?void 0:r.length)??0)>0||null!=s;return(0,ev.jsx)("div",{className:t_()(eZM,o),style:d,"data-node-id":"14256:5103",children:(0,ev.jsxs)("div",{className:`${eZM}-item`,children:[(0,ev.jsxs)("div",{className:`${eZM}-head`,onClick:v?g:void 0,role:v?"button":void 0,tabIndex:v?0:void 0,onKeyDown:e=>{v&&("Enter"===e.key||" "===e.key)&&(e.preventDefault(),g())},children:[(0,ev.jsx)("div",{className:`${eZM}-head-left`,children:h.map((e,t)=>(0,ev.jsx)("span",{className:`${eZM}-head-segment`,children:e},t))}),(0,ev.jsxs)("div",{className:`${eZM}-head-right`,children:[(0,ev.jsx)("span",{className:`${eZM}-head-amount`,children:l}),v&&(0,ev.jsx)("span",{className:t_()(`${eZM}-head-chevron`,m&&`${eZM}-head-chevron-expanded`),"aria-label":m?"collapse":"expand",children:(0,ev.jsx)(AG,{style:{fontSize:12}})})]})]}),v&&m&&(0,ev.jsxs)("div",{className:`${eZM}-body`,children:[null==r?void 0:r.map((e,t)=>(0,ev.jsxs)("div",{className:`${eZM}-body-row`,children:[(0,ev.jsx)("div",{className:`${eZM}-body-left`,children:(0,ev.jsx)("ul",{children:(0,ev.jsx)("li",{children:e.label})})}),null!=e.amount&&(0,ev.jsx)("span",{className:`${eZM}-body-amount`,children:e.amount}),null!=e.action&&(0,ev.jsx)("button",{type:"button",className:`${eZM}-body-action`,onClick:t=>{var l,a;t.stopPropagation(),null==(a=e.action)||null==(l=a.onClick)||l.call(a)},children:e.action.label})]},t)),s]})]})})});eZN.displayName="Collapse";let eZC="pisell-financial-summary",eZT={row:8,rowLeft:8,meta:4,rowRight:6},eZP={1:{labelTextStyle:{fontSize:16,fontWeight:700,color:"#1B1B1B",lineHeight:"24px"},valueTextStyle:{fontSize:16,fontWeight:700,color:"#DC6803",lineHeight:"24px"},expandIconStyle:{size:16,width:16,height:16}},2:{labelTextStyle:{fontSize:16,fontWeight:700,color:"#1B1B1B",lineHeight:"24px"},valueTextStyle:{fontSize:16,fontWeight:700,color:"#DC6803",lineHeight:"24px"},expandIconStyle:{size:16,width:16,height:16},divider:{show:!0,color:"#D0D5DD",style:"solid"},showDotSeparator:!1},3:{labelTextStyle:{fontSize:16,fontWeight:500,color:"#000000",lineHeight:"24px"},valueTextStyle:{fontSize:16,fontWeight:500,color:"#000000",lineHeight:"24px"},metaTextStyle:{fontSize:16,fontWeight:400,color:"#667085",lineHeight:"24px"},infoIconStyle:{size:16,width:16,height:16}}},eZA=ey().memo(e=>{var t,l;let{data:a,showTotal:i=!0,showPaid:n=!0,showRefund:s=!0,showItemsCount:r=!0,showInfoIcon:o=!0,hideZeroAmountRows:d=!1,titleBalanceDue:c,titleTotal:u,titlePaid:p,titleRefund:m,currencySymbol:g="",amountPrecision:h=2,useThousandsSeparator:v=!1,hideDecimalForWholeNumbers:f=!0,missingValuePlaceholder:y="—",defaultExpandedLevel:x=0,className:b,style:_}=e,k=(0,ef.useMemo)(()=>({precision:h??2,showCurrencySymbol:!!g,useThousandsSeparator:v??!1,hideDecimalForWholeNumbers:f??!0}),[h,g,v,f]),w=(0,ef.useCallback)(e=>lE(e,g??"",k),[g,k]),j=(0,ef.useCallback)((e,t)=>void 0!==t?t:eN.getText(e),[c,u,p,m]),S=(0,ef.useMemo)(()=>(a.paid??[]).reduce((e,t)=>e+t.amount,0),[a.paid]),M=(0,ef.useMemo)(()=>(a.refund??[]).reduce((e,t)=>e+t.amount,0),[a.refund]),N=!1!==n&&((null==(t=a.paid)?void 0:t.length)??0)>0||!1!==s&&((null==(l=a.refund)?void 0:l.length)??0)>0,C=(0,ef.useMemo)(()=>{var e,t,l;let x=function(e,t){var l,a,i,n,s;let r=[],o=(e,l)=>void 0!==l?l:t.getText(e),d=[];if(!1!==t.showTotal&&e.total){let l=(n=e.total,(null==n||null==(s=n.children)?void 0:s.length)?n.children.map(e=>(function e(t,l,a){if(l.hideZeroAmountRows&&0===t.value)return null;let i=null==t.value||Number.isNaN(Number(t.value))?l.missingValuePlaceholder??"—":eZS(Number(t.value),l),n=(t.children??[]).map(t=>e(t,l,a+1)).filter(e=>null!=e);return{key:t.key??`line-${a}-${t.label}`,label:t.label,value:i,children:n.length>0?n:void 0,itemsCount:l.showItemsCount?t.itemsCount:void 0,infoTooltip:l.showInfoIcon?t.infoTooltip:void 0}})(e,t,2)).filter(e=>null!=e):[]),a=null==e.total.value||Number.isNaN(Number(e.total.value))?(null==(i=e.total.children)?void 0:i.length)?function e(t){let l=0;for(let i of t){var a;"number"!=typeof i.value||Number.isNaN(i.value)||(l+=i.value),(null==(a=i.children)?void 0:a.length)&&(l+=e(i.children))}return l}(e.total.children):void 0:Number(e.total.value),r=void 0===a||Number.isNaN(a)?void 0:eZS(a,t);d.push({key:"total",label:o("pisell2.financialSummary.total",t.titleTotal),value:r,children:l.length>0?l:void 0})}if(!t.skipPaidAndRefund&&!1!==t.showPaid&&(null==(l=e.paid)?void 0:l.length)){let l=e.paid.map(e=>{let l,a;return a=(l=[e.methodName??"",e.time??""].filter(Boolean)).length>0?l.join(" \xb7 "):void 0,{key:e.key??`paid-${e.amount}-${e.methodName}`,label:a??"—",value:eZS(e.amount,t),extra:e.detail}});d.push({key:"paid",label:o("pisell2.financialSummary.paid",t.titlePaid),children:l})}if(!t.skipPaidAndRefund&&!1!==t.showRefund&&(null==(a=e.refund)?void 0:a.length)){let l=e.refund.map(e=>({key:e.key??`refund-${e.amount}-${e.label}`,label:e.label??"—",value:eZS(e.amount,t),extra:e.detail}));d.push({key:"refund",label:o("pisell2.financialSummary.refund",t.titleRefund),children:l})}let c=d.length>0?{key:"summary-sections",label:"",value:void 0,children:d}:{key:"summary-sections",label:"",value:void 0,children:[]};return r.push({key:"balance-due",label:o("pisell2.financialSummary.balanceDue",t.titleBalanceDue),value:eZS(e.balanceDue,t),children:d.length>0?[c]:void 0}),r}(a,{currencySymbol:g,amountPrecision:h,useThousandsSeparator:v,hideDecimalForWholeNumbers:f,showItemsCount:r,showInfoIcon:o,hideZeroAmountRows:d,missingValuePlaceholder:y,getText:e=>eN.getText(e),titleBalanceDue:c,titleTotal:u,titlePaid:p,titleRefund:m,showTotal:i,showPaid:!N&&n,showRefund:!N&&s,skipPaidAndRefund:N});if(!N)return x;let b=x.slice()[0],_=null==b||null==(e=b.children)?void 0:e[0];if(!(null==_?void 0:_.children))return x;let k=_.children.slice();return!1!==n&&((null==(t=a.paid)?void 0:t.length)??0)>0&&k.push({key:"paid",label:j("pisell2.financialSummary.paid",p),value:w(S),expandedContent:(0,ev.jsx)("div",{className:`${eZC}-collapse-list`,style:{marginTop:8},children:(a.paid??[]).map((e,t)=>(0,ev.jsx)(eZD,{item:e,formatAmount:w},e.key??t))})}),!1!==s&&((null==(l=a.refund)?void 0:l.length)??0)>0&&k.push({key:"refund",label:j("pisell2.financialSummary.refund",m),value:w(M),expandedContent:(0,ev.jsx)("div",{className:`${eZC}-collapse-list`,style:{marginTop:8},children:(a.refund??[]).map((e,t)=>(0,ev.jsx)(eZI,{item:e,formatAmount:w},e.key??t))})}),[{...b,children:[{..._,children:k}]}]},[a,g,h,v,f,r,o,d,y,c,u,p,m,i,n,s,j,w,S,M,N]);return(0,ev.jsx)("div",{className:t_()(eZC,b),style:_,children:(0,ev.jsx)(lL.PisellHierarchicalSummaryList,{items:C,indent:16,rowGap:8,padding:20,gaps:eZT,levelConfig:eZP,defaultExpandedLevel:x})})});function eZD(e){let{item:t,formatAmount:l}=e,{headMeta:a,headAmount:i,bodyRows:n}=(0,ef.useMemo)(()=>{var e;let a;return a=((null==(e=t.bodyRows)?void 0:e.length)??0)>0?(t.bodyRows??[]).map(e=>({label:e.label,amount:e.amount??l(t.amount),action:e.action})):[{label:t.methodName??"—",amount:l(t.amount),action:{label:"Void",onClick:void 0}}],{headMeta:{time:t.time,date:t.date,customer:t.customer,channel:t.channel},headAmount:l(t.amount),bodyRows:a}},[t,l]);return(0,ev.jsx)(eZN,{headMeta:a,headAmount:i,defaultExpanded:!0,bodyRows:n})}function eZI(e){var t;let{item:l,formatAmount:a}=e,i=((null==(t=l.bodyRows)?void 0:t.length)??0)>0?l.bodyRows??[]:[{label:l.label??"—",amount:a(l.amount),action:{label:"Void",onClick:void 0}}];return(0,ev.jsx)(eZN,{headMeta:{time:l.time,date:l.date,customer:l.customer,channel:l.channel},headAmount:a(l.amount),defaultExpanded:!0,bodyRows:i})}eZA.displayName="PisellFinancialSummary";let eZE={en:{"pisell2.financialSummary.balanceDue":"Balance due","pisell2.financialSummary.total":"Total","pisell2.financialSummary.paid":"Paid","pisell2.financialSummary.refund":"Refund","pisell2.financialSummary.itemsCount":"N items"},"zh-CN":{"pisell2.financialSummary.balanceDue":"应付余额","pisell2.financialSummary.total":"合计","pisell2.financialSummary.paid":"已支付","pisell2.financialSummary.refund":"已退款","pisell2.financialSummary.itemsCount":"N 条"},"zh-HK":{"pisell2.financialSummary.balanceDue":"應付餘額","pisell2.financialSummary.total":"合計","pisell2.financialSummary.paid":"已支付","pisell2.financialSummary.refund":"已退款","pisell2.financialSummary.itemsCount":"N 條"}},eZz={en:{"pi-payment-result.success.title":"Payment successful","pi-payment-result.success.description":"Your payment has been completed.","pi-payment-result.failed.title":"Payment failed","pi-payment-result.failed.description":"The payment was not completed. Please check your payment app result and confirm the order status with the merchant.","pi-payment-result.failed.notFound.title":"Payment record not found","pi-payment-result.failed.notFound.description":"We could not find the payment record yet. Please check your payment app result and confirm the order status with the merchant.","pi-payment-result.failed.timeout.title":"Payment result query timed out","pi-payment-result.failed.timeout.description":"The payment result query timed out. Please check your payment app result and confirm the order status with the merchant to avoid duplicate payment.","pi-payment-result.failed.invalidParams.title":"Unable to query payment result","pi-payment-result.failed.invalidParams.description":"We could not query the payment result. Please check your payment app result and confirm the order status with the merchant.","pi-payment-result.querying.title":"Payment is being confirmed","pi-payment-result.querying.description":"Payment result is being confirmed."},"zh-CN":{"pi-payment-result.success.title":"支付成功","pi-payment-result.success.description":"您的支付已完成。","pi-payment-result.failed.title":"支付失败","pi-payment-result.failed.description":"本次支付未完成,请检查支付 App 结果,并与商家核对订单状态。","pi-payment-result.failed.notFound.title":"暂未查询到支付记录","pi-payment-result.failed.notFound.description":"暂未查询到支付记录,请检查您的支付 App 结果,并与商家核对订单状态。","pi-payment-result.failed.timeout.title":"支付结果查询超时","pi-payment-result.failed.timeout.description":"支付结果查询超时,请检查您的支付 App 结果,并与商家核对订单状态,避免重复支付。","pi-payment-result.failed.invalidParams.title":"无法查询支付结果","pi-payment-result.failed.invalidParams.description":"无法查询支付结果,请检查您的支付 App 结果,并与商家核对订单状态。","pi-payment-result.querying.title":"支付结果查询中","pi-payment-result.querying.description":"正在确认支付结果"},"zh-HK":{"pi-payment-result.success.title":"支付成功","pi-payment-result.success.description":"您的支付已完成。","pi-payment-result.failed.title":"支付失敗","pi-payment-result.failed.description":"本次支付未完成,請檢查支付 App 結果,並與商家核對訂單狀態。","pi-payment-result.failed.notFound.title":"暫未查詢到支付記錄","pi-payment-result.failed.notFound.description":"暫未查詢到支付記錄,請檢查您的支付 App 結果,並與商家核對訂單狀態。","pi-payment-result.failed.timeout.title":"支付結果查詢超時","pi-payment-result.failed.timeout.description":"支付結果查詢超時,請檢查您的支付 App 結果,並與商家核對訂單狀態,避免重複支付。","pi-payment-result.failed.invalidParams.title":"無法查詢支付結果","pi-payment-result.failed.invalidParams.description":"無法查詢支付結果,請檢查您的支付 App 結果,並與商家核對訂單狀態。","pi-payment-result.querying.title":"支付結果查詢中","pi-payment-result.querying.description":"正在確認支付結果"},ja:{"pi-payment-result.success.title":"支払いが完了しました","pi-payment-result.success.description":"お支払いが完了しました。","pi-payment-result.failed.title":"支払いに失敗しました","pi-payment-result.failed.description":"支払いは完了していません。支払いアプリの結果を確認し、店舗スタッフに注文状況をご確認ください。","pi-payment-result.failed.notFound.title":"支払い記録がまだ見つかりません","pi-payment-result.failed.notFound.description":"支払い記録がまだ見つかりません。支払いアプリの結果を確認し、店舗スタッフに注文状況をご確認ください。","pi-payment-result.failed.timeout.title":"支払い結果の確認がタイムアウトしました","pi-payment-result.failed.timeout.description":"支払い結果の確認がタイムアウトしました。重複支払いを避けるため、支払いアプリの結果を確認し、店舗スタッフに注文状況をご確認ください。","pi-payment-result.failed.invalidParams.title":"支払い結果を確認できません","pi-payment-result.failed.invalidParams.description":"支払い結果を確認できません。支払いアプリの結果を確認し、店舗スタッフに注文状況をご確認ください。","pi-payment-result.querying.title":"支払い結果を確認しています","pi-payment-result.querying.description":"支払い結果を確認しています。"},pt:{"pi-payment-result.success.title":"Pagamento realizado","pi-payment-result.success.description":"Seu pagamento foi concluido.","pi-payment-result.failed.title":"Falha no pagamento","pi-payment-result.failed.description":"O pagamento nao foi concluido. Verifique o resultado no app de pagamento e confirme o status do pedido com o comerciante.","pi-payment-result.failed.notFound.title":"Registro de pagamento nao encontrado","pi-payment-result.failed.notFound.description":"Ainda nao encontramos o registro de pagamento. Verifique o resultado no app de pagamento e confirme o status do pedido com o comerciante.","pi-payment-result.failed.timeout.title":"Consulta do resultado expirou","pi-payment-result.failed.timeout.description":"A consulta do resultado do pagamento expirou. Verifique o resultado no app de pagamento e confirme o status do pedido com o comerciante para evitar pagamento duplicado.","pi-payment-result.failed.invalidParams.title":"Nao foi possivel consultar o resultado","pi-payment-result.failed.invalidParams.description":"Nao foi possivel consultar o resultado do pagamento. Verifique o resultado no app de pagamento e confirme o status do pedido com o comerciante.","pi-payment-result.querying.title":"Confirmando pagamento","pi-payment-result.querying.description":"Confirmando o resultado do pagamento."}},eZL="pisell-pi-payment-result",eZO="4004",eZR="PaymentResultRequestTimeout",eZ$=["refused","cancelled","error"],eZF=()=>{if("u"<typeof window)return{};let e=new URLSearchParams(window.location.search||"");return{resultCode:e.get("resultCode"),paymentNumber:e.get("payment_number"),shopId:e.get("shop_id")}},eZB=(e,t,l)=>"failed"===e&&l&&"failed"!==l?`pi-payment-result.failed.${l}.${t}`:`pi-payment-result.${e}.${t}`,eZH=e=>{let{status:t}=e,l=Z_();return(0,ev.jsx)("div",{"aria-label":eN.getText(`pi-payment-result.${t}.title`),className:`${eZL}__icon ${eZL}__icon--${t}`,role:"img",style:{backgroundImage:`url(${l}/${"success"===t?"success.png":"failed"===t?"error.png":"loading.png"})`}})},eZq=(0,ef.memo)(e=>{var t,l;let{className:a,style:i}=e,n=ik();eN.init(eZz,(null==n||null==(l=n.engine)||null==(t=l.props)?void 0:t.locale)||"en");let s=(0,ef.useMemo)(eZF,[]),[r,o]=(0,ef.useState)(()=>{var e;let t,l;return"failed"==(l="authorised"===(t=null==(e=s.resultCode||(()=>{if("u">typeof window)return new URLSearchParams(window.location.search||"").get("resultCode")})())?void 0:e.trim().toLowerCase())?"success":t&&eZ$.includes(t)?"failed":"querying")?{status:l,failReason:"failed"}:{status:l}}),d=a?`${eZL} ${a}`:eZL,c=eZB(r.status,"title",r.failReason),u=eZB(r.status,"description",r.failReason);return(0,ef.useEffect)(()=>{if("querying"!==r.status)return;if(!s.paymentNumber||!s.shopId)return void o({status:"failed",failReason:"invalidParams"});let e=!1,t=null,l=null,a=null,i=()=>{t&&(clearTimeout(t),t=null),l&&(clearTimeout(l),l=null),a&&(clearTimeout(a),a=null)},n=t=>{e||(e=!0,i(),o(t))},d=async()=>{var l;if(!e)try{let i,r=await Promise.race([(i={shop_id:s.shopId,number:s.paymentNumber},z_.Em.getRequest().get("/h5/pay/transaction/result",i,{fullResult:!0})),new Promise((e,t)=>{a=setTimeout(()=>{t(Error(eZR))},1e4)})]);if(a&&(clearTimeout(a),a=null),e)return;if(`${(null==r?void 0:r.code)||""}`===eZO)return void n({status:"failed",failReason:"notFound"});let o=null==r||null==(l=r.data)?void 0:l.status;if("succeed"===o)return void n({status:"success"});if("failed"===o)return void n({status:"failed",failReason:"failed"});if("pending"===o||"processing"===o){t=setTimeout(d,2e3);return}n({status:"failed",failReason:"failed"})}catch(t){if(a&&(clearTimeout(a),a=null),e)return;if(t instanceof Error&&t.message===eZR)return void n({status:"failed",failReason:"timeout"});if(("object"==typeof t&&null!==t&&"code"in t?`${t.code||""}`:"")===eZO)return void n({status:"failed",failReason:"notFound"});n({status:"failed",failReason:"failed"})}};return l=setTimeout(()=>{n({status:"failed",failReason:"timeout"})},6e4),d(),()=>{e=!0,i()}},[r.status,s.paymentNumber,s.shopId]),(0,ev.jsx)("div",{className:d,style:i,children:(0,ev.jsxs)("div",{className:`${eZL}__card`,children:[(0,ev.jsx)(eZH,{status:r.status}),(0,ev.jsx)("h1",{className:`${eZL}__title`,children:eN.getText(c)}),(0,ev.jsx)("p",{className:`${eZL}__description`,children:eN.getText(u)})]})})}),eZV={en:{"pisell-cash-counting.countCash":"Count cash","pisell-cash-counting.subtitle":"Enter the quantity for each denomination. The total will be calculated automatically.","pisell-cash-counting.currency":"Currency","pisell-cash-counting.bills":"Bills","pisell-cash-counting.coins":"Coins","pisell-cash-counting.billsSubtotal":"Bills subtotal","pisell-cash-counting.coinsSubtotal":"Coins subtotal","pisell-cash-counting.subtotal":"Subtotal","pisell-cash-counting.total":"Total","pisell-cash-counting.clearAll":"Clear all","pisell-cash-counting.cancel":"Cancel","pisell-cash-counting.confirm":"Confirm","pisell-cash-counting.placeholder":"Please enter","pisell-cash-counting.empty":"No denomination config for this currency.","pisell-cash-counting.no-country-config":"No denomination data is configured for this region. Please contact your system administrator.","pisell-cash-counting.manual-vs-count-message-title":"Tip","pisell-cash-counting.manual-vs-count-message":"The actual amount was edited manually and no longer matches the cash count details.","pisell-cash-counting.use-count-total":"Use counted total","pisell-cash-counting.keep-manual-amount":"Keep manual amount","pisell2.customise-item.save":"Save","pisell2.booking.info.text.clear":"Clear"},"zh-CN":{"pisell-cash-counting.countCash":"数钱","pisell-cash-counting.subtitle":"请输入每个面额的数量,系统将自动计算现金总额。","pisell-cash-counting.currency":"币种","pisell-cash-counting.bills":"纸币","pisell-cash-counting.coins":"硬币","pisell-cash-counting.billsSubtotal":"纸币小计","pisell-cash-counting.coinsSubtotal":"硬币小计","pisell-cash-counting.subtotal":"小计","pisell-cash-counting.total":"合计","pisell-cash-counting.clearAll":"清空","pisell-cash-counting.cancel":"取消","pisell-cash-counting.confirm":"确认","pisell-cash-counting.placeholder":"请输入","pisell-cash-counting.empty":"当前币种暂无面额配置。","pisell-cash-counting.no-country-config":"该国家未配置数据,请联系系统人员","pisell-cash-counting.manual-vs-count-message-title":"提示","pisell-cash-counting.manual-vs-count-message":"实际金额已被手动修改,当前金额与数钱明细不一致。","pisell-cash-counting.use-count-total":"使用数钱金额","pisell-cash-counting.keep-manual-amount":"保留手动金额","pisell2.customise-item.save":"保存","pisell2.booking.info.text.clear":"清空"},"zh-HK":{"pisell-cash-counting.countCash":"數錢","pisell-cash-counting.subtitle":"請輸入每個面額的數量,系統會自動計算現金總額。","pisell-cash-counting.currency":"幣種","pisell-cash-counting.bills":"紙幣","pisell-cash-counting.coins":"硬幣","pisell-cash-counting.billsSubtotal":"紙幣小計","pisell-cash-counting.coinsSubtotal":"硬幣小計","pisell-cash-counting.subtotal":"小計","pisell-cash-counting.total":"合計","pisell-cash-counting.clearAll":"清空","pisell-cash-counting.cancel":"取消","pisell-cash-counting.confirm":"確認","pisell-cash-counting.placeholder":"請輸入","pisell-cash-counting.empty":"目前幣種暫無面額配置。","pisell-cash-counting.no-country-config":"該國家未配置數據,請聯繫系統人員","pisell-cash-counting.manual-vs-count-message-title":"提示","pisell-cash-counting.manual-vs-count-message":"實際金額已被手動修改,當前金額與數錢明細不一致。","pisell-cash-counting.use-count-total":"使用數錢金額","pisell-cash-counting.keep-manual-amount":"保留手動金額","pisell2.customise-item.save":"保存","pisell2.booking.info.text.clear":"清空"},ja:{"pisell-cash-counting.countCash":"現金を数える","pisell-cash-counting.subtitle":"各金種の数量を入力すると、合計金額が自動計算されます。","pisell-cash-counting.currency":"通貨","pisell-cash-counting.bills":"紙幣","pisell-cash-counting.coins":"硬貨","pisell-cash-counting.billsSubtotal":"紙幣小計","pisell-cash-counting.coinsSubtotal":"硬貨小計","pisell-cash-counting.subtotal":"小計","pisell-cash-counting.total":"合計","pisell-cash-counting.clearAll":"クリア","pisell-cash-counting.cancel":"キャンセル","pisell-cash-counting.confirm":"確認","pisell-cash-counting.placeholder":"入力してください","pisell-cash-counting.empty":"この通貨の金種設定がありません。","pisell-cash-counting.no-country-config":"この国・地域の金種データが設定されていません。システム管理者にお問い合わせください。","pisell-cash-counting.manual-vs-count-message-title":"ヒント","pisell-cash-counting.manual-vs-count-message":"実際の金額が手入力で変更され、現在の金額が現金集計の内訳と一致しません。","pisell-cash-counting.use-count-total":"集計金額を使う","pisell-cash-counting.keep-manual-amount":"手入力の金額を残す","pisell2.customise-item.save":"保存","pisell2.booking.info.text.clear":"清空"},pt:{"pisell-cash-counting.countCash":"Contar dinheiro","pisell-cash-counting.subtitle":"Insira a quantidade de cada denomina\xe7\xe3o. O total ser\xe1 calculado automaticamente.","pisell-cash-counting.currency":"Moeda","pisell-cash-counting.bills":"Notas","pisell-cash-counting.coins":"Moedas","pisell-cash-counting.billsSubtotal":"Subtotal de notas","pisell-cash-counting.coinsSubtotal":"Subtotal de moedas","pisell-cash-counting.subtotal":"Subtotal","pisell-cash-counting.total":"Total","pisell-cash-counting.clearAll":"Limpar","pisell-cash-counting.cancel":"Cancelar","pisell-cash-counting.confirm":"Confirmar","pisell-cash-counting.placeholder":"Insira","pisell-cash-counting.empty":"Nenhuma configura\xe7\xe3o de denomina\xe7\xe3o para esta moeda.","pisell-cash-counting.no-country-config":"N\xe3o h\xe1 dados de denomina\xe7\xe3o configurados para esta regi\xe3o. Contacte o administrador do sistema.","pisell-cash-counting.manual-vs-count-message-title":"Dica","pisell-cash-counting.manual-vs-count-message":"O valor real foi editado manualmente e j\xe1 n\xe3o coincide com os detalhes da contagem de numer\xe1rio.","pisell-cash-counting.use-count-total":"Usar total contado","pisell-cash-counting.keep-manual-amount":"Manter valor manual","pisell2.customise-item.save":"Salvar","pisell2.booking.info.text.clear":"Limpar"}},eZY=e=>`${e.currency_code}-${e.denomination_type}-${e.denomination_value}`,eZU=(e,t)=>{let l=Number(String(e??0).replace(/,/g,""));if(!Number.isFinite(l))return 0;let a=Math.pow(10,t);return Math.round(l*a)/a};function eZW(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:768,[t,l]=(0,ef.useState)("u">typeof window&&window.innerWidth<e);return(0,ef.useEffect)(()=>{if("u"<typeof window)return;let t=()=>{l(window.innerWidth<e)};return window.addEventListener("resize",t),t(),()=>{window.removeEventListener("resize",t)}},[e]),t}let eZG="pisell-private-cash-counting-modal",eZQ=(e,t,l)=>{let a=new Intl.NumberFormat(void 0,{minimumFractionDigits:l,maximumFractionDigits:l});return`${t}${a.format(e)}`},eZK=(0,ef.forwardRef)((e,t)=>{var l;let{currencyCode:a,currencyDenominations:i,decimalPlaces:n,symbol:s,modalWidth:r,onCancel:o,onConfirm:d}=e,{isTerminal:c}=(null==(l=ik().appHelper)?void 0:l.utils)||{},[u,p]=(0,ef.useState)(!1),[m,g]=(0,ef.useState)({}),h=eZW(1200),v=eZW(450);(0,ef.useImperativeHandle)(t,()=>({open:e=>{let{initialQuantities:t}=e;g(t),p(!0)},close:()=>p(!1)}));let f=(0,ef.useMemo)(()=>i.reduce((e,t)=>(e[t.denomination_type].push(t),e),{bill:[],coin:[]}),[i]),y=(0,ef.useMemo)(()=>i.map(e=>{let t=m[eZY(e)]??0;return{denomination:e,quantity:t,amount:eZU(e.denomination_value*t,n)}}),[i,m,n,eZY,eZU]),x=(0,ef.useMemo)(()=>y.filter(e=>"bill"===e.denomination.denomination_type).reduce((e,t)=>e+t.amount,0),[y]),b=(0,ef.useMemo)(()=>y.filter(e=>"coin"===e.denomination.denomination_type).reduce((e,t)=>e+t.amount,0),[y]),_=(0,ef.useMemo)(()=>x+b,[x,b]),k=()=>{p(!1),"function"==typeof o&&o()},w=()=>{let e={};i.forEach(t=>e[eZY(t)]=0),g(e)},j=()=>{"function"==typeof d&&d({amount:_,currencyCode:a,decimalPlaces:n,billSubtotal:x,coinSubtotal:b,details:y,quantities:m}),p(!1)},S=(e,t,l)=>{let a=f[e];return a.length?(0,ev.jsxs)("div",{className:`${eZG}__section`,children:[(0,ev.jsxs)("div",{className:`${eZG}__section-header`,children:[(0,ev.jsxs)("div",{className:`${eZG}__section-title`,children:[(0,ev.jsx)("span",{className:`${eZG}__dot ${eZG}__dot--${e}`}),(0,ev.jsx)("span",{children:t})]}),(0,ev.jsxs)("div",{className:`${eZG}__section-subtotal`,children:[(0,ev.jsx)("span",{children:eN.getText("pisell-cash-counting.subtotal")}),(0,ev.jsx)("strong",{children:eZQ(l,s,n)})]})]}),(0,ev.jsx)("div",{className:`${eZG}__denomination-list`,children:a.map(t=>{let l=eZY(t),a=m[l]??0,i=eZU(t.denomination_value*a,n);return(0,ev.jsxs)("div",{className:`${eZG}__denomination-row`,children:[(0,ev.jsxs)("div",{className:`${eZG}__denomination-left`,children:[(0,ev.jsx)("div",{className:`${eZG}__denomination-label ${eZG}__denomination-label--${e}`,children:t.denomination_label}),(0,ev.jsx)("div",{className:`${eZG}__stepper-wrap`,children:(0,ev.jsx)(IQ,{className:`${eZG}__stepper`,min:0,max:9999,value:a,plusOnlyAtZero:!1,shape:"square",onChange:e=>g(t=>({...t,[l]:e}))})})]}),(0,ev.jsx)("div",{className:`${eZG}__row-amount`,children:eZQ(i,s,n)})]},l)})})]}):null},M=(0,ef.useCallback)(()=>(0,ev.jsxs)("div",{className:`${eZG}__modal-header`,children:[(0,ev.jsx)(lL.Iconfont,{type:"pisell2-cash",className:`${eZG}__modal-header-icon`}),(0,ev.jsx)("div",{className:`${eZG}__modal-header-title`,children:eN.getText("pisell-cash-counting.countCash")}),(0,ev.jsx)(lL.Tag,{color:"blue",style:{border:"none"},children:a})]}),[a]),N=(0,ef.useCallback)(()=>(0,ev.jsxs)("div",{className:`${eZG}__footer`,children:[(0,ev.jsxs)("div",{className:`${eZG}__summary`,children:[(0,ev.jsxs)("div",{className:`${eZG}__summary-row`,children:[(0,ev.jsx)("span",{children:eN.getText("pisell-cash-counting.billsSubtotal")}),(0,ev.jsx)("strong",{children:eZQ(x,s,n)})]}),(0,ev.jsxs)("div",{className:`${eZG}__summary-row`,children:[(0,ev.jsx)("span",{children:eN.getText("pisell-cash-counting.coinsSubtotal")}),(0,ev.jsx)("strong",{children:eZQ(b,s,n)})]}),(0,ev.jsxs)("div",{className:`${eZG}__total-row`,children:[(0,ev.jsx)("span",{children:eN.getText("pisell-cash-counting.total")}),(0,ev.jsx)("strong",{children:eZQ(_,s,n)})]})]}),(0,ev.jsxs)("div",{className:`${eZG}__actions`,children:[(0,ev.jsx)(lL.Button,{type:"text",size:"large",onClick:w,children:eN.getText("pisell-cash-counting.clearAll")}),(0,ev.jsx)(lL.Button,{size:"large",onClick:k,children:eN.getText("pisell-cash-counting.cancel")}),(0,ev.jsx)(lL.Button,{type:"primary",size:"large",disabled:!i.length,onClick:j,children:eN.getText("pisell-cash-counting.confirm")})]})]}),[b,x,_,i,w,k,j]);return(0,ev.jsx)(lL.PisellModal,{destroyOnClose:!0,maskClosable:!1,footer:N(),open:u,title:M(),className:`${eZG}__modal-wrap`,bodyStyle:{padding:0},width:r||((null==c?void 0:c())?"80%":"880px"),onCancel:k,children:(0,ev.jsxs)("div",{className:`${eZG}__modal`,children:[(0,ev.jsxs)("div",{className:`${eZG}__modal-intro`,children:[(0,ev.jsx)(rD,{style:{fontSize:18,color:"#F2A63A"}}),eN.getText("pisell-cash-counting.subtitle")]}),(0,ev.jsx)("div",{className:`${eZG}__scroll ${h||v?`${eZG}__scroll-column`:""} ${v?`${eZG}__scroll-mobile`:""}`,children:0===i.length?(0,ev.jsx)("div",{className:`${eZG}__empty`,children:eN.getText("pisell-cash-counting.empty")}):(0,ev.jsxs)(ev.Fragment,{children:[S("bill",eN.getText("pisell-cash-counting.bills"),x),S("coin",eN.getText("pisell-cash-counting.coins"),b)]})})]})})}),eZJ="pisell-private-cash-counting",eZZ=e=>{var t,l;let a=ik();eN.init(eZV,(null==a||null==(l=a.engine)||null==(t=l.props)?void 0:t.locale)||"en");let{disabled:i=!1,countDisabled:n=!1,placeholder:s,layout:r="vertical",countCashButtonText:o,showCurrencySymbol:d=!0,useThousandsSeparator:c=!1,inputNumberProps:u,buttonProps:p,className:m,style:g,modalWidth:h}=e,{modalRef:v,triggerRef:f,keyboardOpen:y,setKeyboardOpen:x,currencyDenominations:b,decimalPlaces:_,symbol:k,currencyCode:w,currentValue:j,handleAmountChange:S,handleKeyboardClose:M,openCountModal:N,handleCountCancel:C,handleCountConfirm:T,manualCountMismatchOpen:P,confirmUseCountedTotal:A,confirmKeepManualAmount:D}=function(e){var t,l,a,i;let{value:n,defaultValue:s="",currencyCode:r,currencySymbol:o,amountPrecision:d,denominations:c=[],disabled:u=!1,countDisabled:p=!1,onChange:m,onCountConfirm:g,onCountCancel:h}=e,{store:v}=(null==(t=ik().appHelper)?void 0:t.utils)||{},f=(0,ef.useRef)(null),y=(0,ef.useRef)(null),[x,b]=(0,ef.useState)(!1),[_,k]=(0,ef.useState)(s),[w,j]=(0,ef.useState)({}),S=(0,ef.useRef)(null),M=(0,ef.useRef)(null),[N,C]=(0,ef.useState)(!1),T=(0,ef.useMemo)(()=>{var e,t;let l=(null==v||null==(t=v.getState)||null==(e=t.call(v))?void 0:e.global)||{};return{symbol:(null==l?void 0:l.symbol)||"$",currency_code:(null==l?void 0:l.currency_code)||"AUD"}},[null==v||null==(a=v.getState)||null==(l=a.call(v))?void 0:l.global]),P=(0,ef.useMemo)(()=>r||(null==T?void 0:T.currency_code),[r,null==T?void 0:T.currency_code]),A=(0,ef.useMemo)(()=>c.filter(e=>e.currency_code===P&&!1!==e.is_enabled&&!1!==e.effective_status&&"inactive"!==e.effective_status).sort((e,t)=>e.sort_order-t.sort_order),[P,c]),D=(0,ef.useMemo)(()=>{var e;return"number"==typeof d?d:(null==(e=A[0])?void 0:e.decimal_places)??2},[d,null==(i=A[0])?void 0:i.decimal_places]),I=(0,ef.useMemo)(()=>o||(null==T?void 0:T.symbol),[o,null==T?void 0:T.symbol]),E=(0,ef.useMemo)(()=>String(n??_),[n,_]),z=(0,ef.useCallback)((e,t)=>{void 0===n&&k(e),"function"==typeof m&&m(e,{source:t})},[D,m,n]),L=(0,ef.useCallback)(e=>{M.current=e,z(String(e),"manual")},[z]),O=(0,ef.useCallback)(()=>{var e;b(!1),(null==(e=S.current)?void 0:e.amount)&&Number(S.current.amount)!==Number(M.current)&&C(!0)},[C]),R=(0,ef.useCallback)(()=>{var e;z((null==(e=S.current)?void 0:e.amount)??"","count"),C(!1)},[z]),$=(0,ef.useCallback)(()=>{S.current=null,j({}),z(M.current??"","manual"),C(!1)},[z]),F=(0,ef.useCallback)(()=>{var e;if(u||p)return;if(0===A.length)return void ex.message.warning(eN.getText("pisell-cash-counting.no-country-config"));let t={...A.reduce((e,t)=>(e[eZY(t)]=0,e),{}),...w};b(!1),null==(e=f.current)||e.open({initialQuantities:t})},[w,p,A,u]);return{modalRef:f,triggerRef:y,keyboardOpen:x,setKeyboardOpen:b,currencyDenominations:A,decimalPlaces:D,symbol:I,currencyCode:P,currentValue:E,handleAmountChange:L,handleKeyboardClose:O,openCountModal:F,handleCountCancel:(0,ef.useCallback)(()=>{null==h||h()},[h]),handleCountConfirm:(0,ef.useCallback)(e=>{S.current=e,j(e.quantities),z(e.amount,"count"),"function"==typeof g&&g(e)},[g,z]),manualCountMismatchOpen:N,confirmUseCountedTotal:R,confirmKeepManualAmount:$}}(e);return(0,ev.jsxs)("div",{className:t_()(eZJ,m),style:g,children:[(0,ev.jsxs)("div",{className:t_()(`${eZJ}__field`,{[`${eZJ}__field--horizontal`]:"horizontal"===r}),ref:f,children:[(0,ev.jsx)(ex.InputNumber,{...u,controls:!1,disabled:i,precision:_,value:j,placeholder:s??eN.getText("pisell-cash-counting.placeholder"),className:t_()(`${eZJ}__input`,null==u?void 0:u.className),readOnly:!0,addonBefore:k,size:"large",style:{width:"100%"},onClick:()=>{i||x(!0)},onChange:S}),(0,ev.jsx)(ex.Button,{...p,type:"primary",disabled:i||n||(null==p?void 0:p.disabled),className:t_()(`${eZJ}__button`,null==p?void 0:p.className),onClick:e=>{var t;null==p||null==(t=p.onClick)||t.call(p,e),N()},children:o??eN.getText("pisell-cash-counting.countCash")})]}),(0,ev.jsx)(IU,{mode:"decimal",containerProps:{renderType:"modal",open:y,onCancel:M},value:j,originalValue:j,maxLength:10,precision:2,onChange:S,onEnter:M}),(0,ev.jsx)(lL.PisellModal.Information,{open:P,closable:!1,maskClosable:!1,title:eN.getText("pisell-cash-counting.manual-vs-count-message-title"),describe:eN.getText("pisell-cash-counting.manual-vs-count-message"),okText:eN.getText("pisell-cash-counting.keep-manual-amount"),cancelText:eN.getText("pisell-cash-counting.use-count-total"),onOk:D,onCancel:A}),(0,ev.jsx)(eZK,{ref:v,modalWidth:h,currencyCode:w,currencyDenominations:b,decimalPlaces:_,symbol:k,onCancel:C,onConfirm:T})]})},eZX=(0,ef.forwardRef)((e,t)=>{let{triggerType:l="input",searchMode:a="confirm",showConfirmButton:i=!0,enableScanner:n=!1,autoFocusOnOpen:s=!1,...r}=e;return(0,ev.jsx)(VJ,{ref:t,triggerType:l,searchMode:a,showConfirmButton:i,enableScanner:n,autoFocusOnOpen:s,...r})});eZX.displayName="GlobalSearchFind";let eZ0="__all__",eZ2=(e,t,l)=>Math.min(l,Math.max(t,e));function eZ1(e){let{initialRatio:t=.34,minRatio:l=.24,maxRatio:a=.6}=e||{},[i,n]=(0,ef.useState)(()=>eZ2(t,l,a)),[s,r]=(0,ef.useState)(!1),o=(0,ef.useRef)(null),d=(0,ef.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let t=o.current;if(!t)return;r(!0);let i=document.body.style.userSelect,s=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";let d=e=>{let i=t.getBoundingClientRect();i.width<=0||n(eZ2((i.right-e.clientX)/i.width,l,a))},c=()=>{r(!1),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",c),document.body.style.userSelect=i,document.body.style.cursor=s};document.addEventListener("mousemove",d),document.addEventListener("mouseup",c)},[l,a]);return{ratio:i,rightWidth:`${(100*i).toFixed(2)}%`,containerRef:o,onResizerMouseDown:d,resizing:s}}let eZ4={loading:!1,list:[],total:0};function eZ3(e){let{keyword:t,activeTab:l,providers:a,allModePageSize:i,singleModePageSize:n,mode:s,onRealtimePatchItems:r}=e,[o,d]=(0,ef.useState)(()=>{let e;return e={},a.forEach(t=>{e[t.key]={...eZ4}}),e}),c=(0,ef.useRef)(new Map),u=(0,ef.useRef)(new Map),p=(0,ef.useRef)({keyword:t,activeTab:l,providers:a,allModePageSize:i,singleModePageSize:n,mode:s,onRealtimePatchItems:r});p.current={keyword:t,activeTab:l,providers:a,allModePageSize:i,singleModePageSize:n,mode:s,onRealtimePatchItems:r};let m=(0,ef.useCallback)((e,t)=>{d(l=>({...l,[e]:{...l[e]??eZ4,...t}}))},[]),g=(0,ef.useCallback)((e,t)=>{d(l=>{let a=l[e]??eZ4;return a.total===t?l:{...l,[e]:{...a,total:t}}})},[]),h=(0,ef.useCallback)((e,t)=>{Array.isArray(t)&&0!==t.length&&d(l=>{let a=l[e]??eZ4,i=new Map;if(t.forEach(e=>{let t=eZ8(e);t&&i.set(t,e)}),0===i.size)return l;let n=!1,s=(a.list??[]).map(e=>{let t=eZ8(e);if(!t)return e;let l=i.get(t);return l?(n=!0,{...e,...l}):e});return n?{...l,[e]:{...a,list:s}}:l})},[]),v=(0,ef.useCallback)((e,t,l,a,i)=>{var n,s;null==(n=c.current.get(e.key))||n.abort(),null==(s=u.current.get(e.key))||s(),u.current.delete(e.key);let r=new AbortController;c.current.set(e.key,r);let o=`global-search-${String(e.key)}-${i}`;m(e.key,{loading:!0,error:void 0}),e.search({keyword:l,pageSize:t,signal:r.signal,mode:a,scope:i,onRealtimePatch:t=>{var l,a;h(e.key,t),null==(l=(a=p.current).onRealtimePatchItems)||l.call(a,e.key,t)},realtimeSubscriberId:o,onRealtimeCleanup:t=>{u.current.set(e.key,t)}}).then(t=>{r.signal.aborted||m(e.key,{loading:!1,list:t.list??[],total:t.total??0,resolvedKeyword:l,error:void 0})}).catch(t=>{r.signal.aborted||t instanceof Error&&"AbortError"===t.name||m(e.key,{loading:!1,error:t instanceof Error?t:Error(String(t))})})},[h,m]),f=(0,ef.useCallback)(()=>{let{keyword:e,activeTab:t,providers:l,allModePageSize:a,singleModePageSize:i,mode:n}=p.current;if(t===eZ0)l.forEach(t=>v(t,a,e,n,"all"));else{let a=l.find(e=>e.key===t);a&&v(a,i,e,n,"single")}},[v]);return(0,ef.useEffect)(()=>{f()},[t,l,a,s,f]),(0,ef.useEffect)(()=>{d(e=>{let t={...e};return a.forEach(e=>{t[e.key]||(t[e.key]={...eZ4})}),t})},[a]),(0,ef.useEffect)(()=>{let e=c.current,t=u.current;return()=>{e.forEach(e=>e.abort()),e.clear(),t.forEach(e=>e()),t.clear()}},[]),{stateMap:o,refresh:f,reportProviderTotal:g}}function eZ8(e){if(!e||"object"!=typeof e)return null;let t=e.order_id??e.id??e.key;return null==t||""===t?null:String(t)}let eZ6={en:{"pisell-global-search.title":"Global Search","pisell-global-search.description":"All-in-One Search","pisell-global-search.placeholder":"Search reservations, orders, resources…","pisell-global-search.search":"Search","pisell-global-search.tab.all":"All","pisell-global-search.empty":"No results","pisell-global-search.empty.idle":"Type to search across modules","pisell-global-search.view-all":"View all","pisell-global-search.loading":"Loading…","pisell-global-search.error":"Failed to load. Click to retry","pisell-global-search.mode.label":"Mode","pisell-global-search.mode.admin":"Admin","pisell-global-search.mode.business":"Business","pisell-global-search.scope.label":"Scope","pisell-global-search.detail.idle":"Select a row to view details","pisell-global-search.detail.title":"Details","pisell-global-search.providers-missing.title":"Providers not configured","pisell-global-search.providers-missing.description":"Pass business search providers in pro-code, for example:","pisell-global-search.order-result-unavailable.title":"Order results are temporarily unavailable","pisell-global-search.order-result-unavailable.description":"Order results require the admin lowcode engine context. View this inside an admin page, or check whether the engine context is injected."},"zh-CN":{"pisell-global-search.title":"全局搜索","pisell-global-search.description":"一站式搜索","pisell-global-search.placeholder":"搜索预约、订单、资源…","pisell-global-search.search":"搜索","pisell-global-search.tab.all":"全部","pisell-global-search.empty":"暂无结果","pisell-global-search.empty.idle":"输入关键词跨模块搜索","pisell-global-search.view-all":"查看全部","pisell-global-search.loading":"加载中…","pisell-global-search.error":"加载失败,点击重试","pisell-global-search.mode.label":"模式","pisell-global-search.mode.admin":"管理模式","pisell-global-search.mode.business":"业务模式","pisell-global-search.scope.label":"搜索范围","pisell-global-search.detail.idle":"选择左侧记录查看详情","pisell-global-search.detail.title":"详情","pisell-global-search.providers-missing.title":"未注入 providers","pisell-global-search.providers-missing.description":"请在 pro-code 中传入业务搜索 providers,例如:","pisell-global-search.order-result-unavailable.title":"订单结果暂不可用","pisell-global-search.order-result-unavailable.description":"订单结果依赖 admin lowcode 引擎上下文。请在 admin 页面内查看,或检查 engine context 是否注入。"},"zh-HK":{"pisell-global-search.title":"全局搜尋","pisell-global-search.description":"一站式搜尋","pisell-global-search.placeholder":"搜尋預約、訂單、資源…","pisell-global-search.search":"搜尋","pisell-global-search.tab.all":"全部","pisell-global-search.empty":"暫無結果","pisell-global-search.empty.idle":"輸入關鍵字跨模組搜尋","pisell-global-search.view-all":"查看全部","pisell-global-search.loading":"載入中…","pisell-global-search.error":"載入失敗,點擊重試","pisell-global-search.mode.label":"模式","pisell-global-search.mode.admin":"管理模式","pisell-global-search.mode.business":"業務模式","pisell-global-search.scope.label":"搜尋範圍","pisell-global-search.detail.idle":"選擇左側記錄查看詳情","pisell-global-search.detail.title":"詳情","pisell-global-search.providers-missing.title":"未注入 providers","pisell-global-search.providers-missing.description":"請在 pro-code 中傳入業務搜尋 providers,例如:","pisell-global-search.order-result-unavailable.title":"訂單結果暫不可用","pisell-global-search.order-result-unavailable.description":"訂單結果依賴 admin lowcode 引擎上下文。請在 admin 頁面內查看,或檢查 engine context 是否注入。"},ja:{"pisell-global-search.title":"グローバル検索","pisell-global-search.description":"オールインワン検索","pisell-global-search.placeholder":"予約、注文、リソースを検索…","pisell-global-search.search":"検索","pisell-global-search.tab.all":"すべて","pisell-global-search.empty":"結果がありません","pisell-global-search.empty.idle":"キーワードを入力して横断検索","pisell-global-search.view-all":"すべて表示","pisell-global-search.loading":"読み込み中…","pisell-global-search.error":"読み込みに失敗しました。クリックして再試行","pisell-global-search.mode.label":"モード","pisell-global-search.mode.admin":"管理モード","pisell-global-search.mode.business":"業務モード","pisell-global-search.scope.label":"検索範囲","pisell-global-search.detail.idle":"行を選択して詳細を表示","pisell-global-search.detail.title":"詳細","pisell-global-search.providers-missing.title":"providers が設定されていません","pisell-global-search.providers-missing.description":"pro-code で業務検索 providers を渡してください。例:","pisell-global-search.order-result-unavailable.title":"注文結果は一時的に利用できません","pisell-global-search.order-result-unavailable.description":"注文結果には admin lowcode エンジンコンテキストが必要です。admin ページ内で表示するか、engine context が注入されているか確認してください。"},pt:{"pisell-global-search.title":"Pesquisa Global","pisell-global-search.description":"Pesquisa Tudo-em-Um","pisell-global-search.placeholder":"Pesquise reservas, vendas, recursos…","pisell-global-search.search":"Pesquisar","pisell-global-search.tab.all":"Tudo","pisell-global-search.empty":"Nenhum resultado","pisell-global-search.empty.idle":"Digite uma palavra-chave para pesquisar","pisell-global-search.view-all":"Ver tudo","pisell-global-search.loading":"Carregando…","pisell-global-search.error":"Falha ao carregar. Clique para tentar novamente","pisell-global-search.mode.label":"Modo","pisell-global-search.mode.admin":"Modo de administra\xe7\xe3o","pisell-global-search.mode.business":"Modo de neg\xf3cios","pisell-global-search.scope.label":"Escopo","pisell-global-search.detail.idle":"Selecione uma linha para ver os detalhes","pisell-global-search.detail.title":"Detalhes","pisell-global-search.providers-missing.title":"Providers n\xe3o configurados","pisell-global-search.providers-missing.description":"Passe os providers de pesquisa de neg\xf3cios no pro-code, por exemplo:","pisell-global-search.order-result-unavailable.title":"Resultados de pedidos temporariamente indispon\xedveis","pisell-global-search.order-result-unavailable.description":"Os resultados de pedidos exigem o contexto do mecanismo lowcode admin. Veja dentro de uma p\xe1gina admin ou verifique se o engine context foi injetado."}};function eZ5(e){let t=String(e||"en").toLowerCase().replace("_","-");return"zh"===t||"zh-cn"===t||"zh-hans"===t?"zh-CN":"zh-hk"===t||"zh-tw"===t||"zh-hant"===t?"zh-HK":"ja"===t||t.startsWith("ja-")?"ja":"pt"===t||t.startsWith("pt-")?"pt":"en"}function eZ7(e){var t,l;let a=eN.getText(e);return a&&a!==e?a:(null==(l=eZ6[eZ5(null==(t=eN.getLocale)?void 0:t.call(eN))])?void 0:l[e])||eZ6.en[e]||e}function eZ9(e,t){return e&&(e[eZ5(t)]||e.en||e["zh-CN"]||e["zh-HK"])||""}let eXe=e=>{let{providers:t,stateMap:l,keyword:a,mode:i,searchMode:n,locale:s,onJumpTab:r,onClose:o,navigate:d,onAutoOpenUniqueOrderDetail:c,onOpenDetail:u,onRealtimePatchItems:p,detailRefreshVersions:m,onReportTotal:g}=e,h={searchMode:n,close:o,navigate:d,onAutoOpenUniqueOrderDetail:c,onOpenDetail:u,onRealtimePatchItems:p,detailRefreshVersions:m,onReportTotal:g};return t.every(e=>{var t;if(e.renderResults)return!1;let a=l[e.key];return!(null==a?void 0:a.loading)&&((null==a||null==(t=a.list)?void 0:t.length)??0)===0&&!(null==a?void 0:a.error)})?(0,ev.jsx)("div",{className:"pisell-global-search__empty",children:a?eN.getText("pisell-global-search.empty"):eN.getText("pisell-global-search.empty.idle")}):(0,ev.jsx)("div",{className:"pisell-global-search__groups",children:t.map(e=>{let t=l[e.key];if(!t)return null;let{loading:n,list:o,total:d,error:c}=t;return e.renderResults||n||0!==o.length||c?(0,ev.jsxs)("section",{className:"pisell-global-search__group",children:["business"!==i&&(0,ev.jsxs)("header",{className:"pisell-global-search__group-header",children:[(0,ev.jsxs)("span",{className:"pisell-global-search__group-title",children:[e.icon,eZ9(e.label,s),d>0&&(0,ev.jsxs)("span",{children:["(",d,")"]})]}),d>o.length&&(0,ev.jsx)("button",{type:"button",className:"pisell-global-search__view-all",onClick:()=>r(e.key),children:eN.getText("pisell-global-search.view-all")})]}),(0,ev.jsx)("div",{className:`pisell-global-search__group-body${e.renderResults?" pisell-global-search__group-body--bare":""}`,children:e.renderResults?e.renderResults({state:t,keyword:a,mode:i,layout:"grouped"},{keyword:a,...h}):n&&0===o.length?(0,ev.jsx)("div",{className:"pisell-global-search__group-loading",children:(0,ev.jsx)(ex.Spin,{size:"small"})}):c?(0,ev.jsx)("div",{className:"pisell-global-search__group-error",children:eN.getText("pisell-global-search.error")}):(0,ev.jsx)("ul",{className:"pisell-global-search__group-list",children:o.map((t,l)=>(0,ev.jsx)("li",{className:"pisell-global-search__group-item",children:e.renderItem(t,{keyword:a,...h})},function(e,t){if(e&&"object"==typeof e){if("string"==typeof e.id||"number"==typeof e.id)return e.id;if("string"==typeof e.key||"number"==typeof e.key)return e.key}return t}(t,l)))})})]},e.key):null})})},eXt=e=>{let{provider:t,state:l,keyword:a,mode:i,searchMode:n,onClose:s,navigate:r,onAutoOpenUniqueOrderDetail:o,onOpenDetail:d,onRealtimePatchItems:c,detailRefreshVersions:u,onReportTotal:p}=e,{loading:m,list:g,error:h}=l,v={keyword:a,searchMode:n,close:s,navigate:r,onAutoOpenUniqueOrderDetail:o,onOpenDetail:d,onRealtimePatchItems:c,detailRefreshVersions:u,onReportTotal:p};return t.renderResults?(0,ev.jsx)("div",{className:"pisell-global-search__single-custom",children:t.renderResults({state:l,keyword:a,mode:i,layout:"single"},v)}):m&&0===g.length?(0,ev.jsx)("div",{className:"pisell-global-search__single-loading",children:(0,ev.jsx)(ex.Spin,{})}):h?(0,ev.jsx)("div",{className:"pisell-global-search__single-error",children:eN.getText("pisell-global-search.error")}):0===g.length?(0,ev.jsx)("div",{className:"pisell-global-search__empty",children:a?eN.getText("pisell-global-search.empty"):eN.getText("pisell-global-search.empty.idle")}):(0,ev.jsx)("ul",{className:"pisell-global-search__single-list",children:g.map((e,l)=>(0,ev.jsx)("li",{className:"pisell-global-search__single-item",children:t.renderItem(e,v)},function(e,t){if(e&&"object"==typeof e){if("string"==typeof e.id||"number"==typeof e.id)return e.id;if("string"==typeof e.key||"number"==typeof e.key)return e.key}return t}(e,l)))})},eXl=e=>{let{options:t,value:l,onChange:a,scopeLabel:i,extra:n,className:s,style:r}=e;return t&&0!==t.length?(0,ev.jsxs)("div",{className:`pisell-global-search-scope-bar ${s??""}`.trim(),style:r,children:[(0,ev.jsx)("span",{className:"pisell-global-search-scope-bar__label",children:i??eN.getText("pisell-global-search.scope.label")}),(0,ev.jsx)(ex.Radio.Group,{className:"pisell-global-search-scope-bar__radio",value:l,onChange:e=>a(e.target.value),options:t}),n&&(0,ev.jsx)("div",{className:"pisell-global-search-scope-bar__extra",children:n})]}):n?(0,ev.jsxs)("div",{className:`pisell-global-search-scope-bar pisell-global-search-scope-bar--no-radio ${s??""}`.trim(),style:r,children:[(0,ev.jsx)("span",{className:"pisell-global-search-scope-bar__spacer"}),(0,ev.jsx)("div",{className:"pisell-global-search-scope-bar__extra",children:n})]}):null},eXa=(0,ef.forwardRef)((e,t)=>{var l,a,i,n,s;let{providers:r,permissionContext:o,activeTab:d,onActiveTabChange:c,allModePageSize:u=5,singleModePageSize:p=20,allTabLabel:m,navigate:g,defaultMode:h="business",mode:v,onModeChange:f,showModeSwitch:y=!0,modeOptions:x,submitMode:b="submit",lookupProps:_,variant:k,className:w,style:j}=e,S=ik(),M=eZ5(null==(l=eN.getLocale)?void 0:l.call(eN));eN.init(eZ6,M),(null==S||null==(i=S.appHelper)||null==(a=i.utils)?void 0:a.request)&&(z_.Em.setRequest(S.appHelper.utils.request),eV$=eVR(S.appHelper.utils.isWebPos));let N=(0,ef.useMemo)(()=>[...(Array.isArray(r)?r:[]).filter(e=>e&&e.enabledWhen?e.enabledWhen(o??{}):!!e)].sort((e,t)=>(e.order??Number.MAX_SAFE_INTEGER)-(t.order??Number.MAX_SAFE_INTEGER)),[r,o]),[C,T]=(0,ef.useState)(""),[P,A]=(0,ef.useState)(""),D="phone"===k||"smallTablet"===k||"tablet"===k,[I,E]=(0,ef.useState)(null),z=(0,ef.useCallback)(e=>{let{providerKey:t,id:l}=e;null!=l&&""!==l&&E({providerKey:t,id:l})},[]),L=D?void 0:z;(0,ef.useEffect)(()=>{E(null)},[C]);let{rightWidth:O,containerRef:R,onResizerMouseDown:$,resizing:F}=eZ1({initialRatio:.38}),B=N.length>=1,[H,q]=(0,ef.useState)(B?eZ0:(null==(n=N[0])?void 0:n.key)??eZ0),V=B||H!==eZ0?H:(null==(s=N[0])?void 0:s.key)??eZ0,Y=d??V,U=(0,ef.useCallback)(e=>{void 0===d&&q(e),null==c||c(e)},[d,c]),[W,G]=(0,ef.useState)(h),Q=v??W,K=(0,ef.useCallback)(e=>{void 0===v&&G(e),null==f||f(e)},[v,f]),{stateMap:J,refresh:Z,reportProviderTotal:X}=eZ3({keyword:C,activeTab:Y,providers:N,allModePageSize:u,singleModePageSize:p,mode:Q}),ee=(0,ef.useRef)(null);(0,ef.useImperativeHandle)(t,()=>({open:()=>{var e;return null==(e=ee.current)?void 0:e.open()},close:()=>{var e;return null==(e=ee.current)?void 0:e.close()},setKeyword:e=>{var t;null==(t=ee.current)||t.setKeyword(e),A(e),T(e)},getKeyword:()=>C,setActiveTab:U,setMode:K,getMode:()=>Q,refresh:Z}),[C,U,K,Q,Z]);let et=(0,ef.useMemo)(()=>{let e=N.map(e=>({value:e.key,label:(0,ev.jsxs)("span",{className:"pisell-global-search-scope-bar__option",children:[e.icon,eZ9(e.label,M)]})}));return B&&e.unshift({value:eZ0,label:(0,ev.jsx)("span",{className:"pisell-global-search-scope-bar__option",children:m?eZ9(m,M):eZ7("pisell-global-search.tab.all")})}),e},[N,B,m,M]),el=(0,ef.useMemo)(()=>{let e=(null==x?void 0:x.admin)?eZ9(x.admin,M):eZ7("pisell-global-search.mode.admin");return[{label:(null==x?void 0:x.business)?eZ9(x.business,M):eZ7("pisell-global-search.mode.business"),value:"business"},{label:e,value:"admin"}]},[x,M]),ea=y?(0,ev.jsx)(ex.Segmented,{className:"pisell-global-search__mode-segmented",options:el,value:Q,onChange:e=>K(e)}):null,ei=(0,ef.useCallback)((e,t)=>{let l=t??(()=>{var e;return null==(e=ee.current)?void 0:e.close()}),a=Y===eZ0,i=I?"order"===I.providerKey?(0,ev.jsx)(eV6,{renderType:"current",tmpl:"A",variant:"tablet",osProps:{osKey:"global-search-order-detail",orderId:Number(I.id),autoBootstrap:!0,destroyOnUnmount:!0}}):null:(0,ev.jsx)("div",{className:"pisell-global-search__detail-idle",children:eZ7("pisell-global-search.detail.idle")}),n=!D&&!!e&&"admin"===Q;return 0===N.length?(0,ev.jsx)("div",{className:`pisell-global-search ${w??""}`.trim(),style:j,children:(0,ev.jsxs)("div",{className:"pisell-global-search__empty",children:[(0,ev.jsx)("div",{style:{marginBottom:8,fontWeight:600},children:eZ7("pisell-global-search.providers-missing.title")}),(0,ev.jsxs)("div",{style:{fontSize:12,lineHeight:1.6},children:[eZ7("pisell-global-search.providers-missing.description"),(0,ev.jsx)("br",{}),(0,ev.jsx)("code",{style:{background:"#f3f4f6",padding:"0 4px"},children:"<PisellGlobalSearch providers={allProviders} />"})]})]})}):(0,ev.jsxs)("div",{className:`pisell-global-search pisell-global-search--${k||"desktop"} ${w??""}`.trim(),style:j,children:[(et.length>=1||ea)&&(0,ev.jsx)("div",{className:"pisell-global-search__scope-wrap",children:(0,ev.jsx)(eXl,{options:et,value:Y,onChange:e=>U(e),extra:ea})}),(0,ev.jsxs)("div",{className:`pisell-global-search__content${F?" pisell-global-search__content--resizing":""}`,ref:R,children:[(0,ev.jsx)("div",{className:"pisell-global-search__body",children:a?(0,ev.jsx)(eXe,{providers:N,stateMap:J,keyword:e,mode:Q,locale:M,onJumpTab:U,onClose:l,navigate:g,onOpenDetail:L,onReportTotal:X}):(()=>{let t=N.find(e=>e.key===Y);if(!t)return null;let a=J[t.key]??{loading:!1,list:[],total:0};return(0,ev.jsx)(eXt,{provider:t,state:a,keyword:e,mode:Q,onClose:l,navigate:g,onOpenDetail:L,onReportTotal:X})})()}),n&&(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("div",{className:"pisell-global-search__resizer",onMouseDown:$,role:"separator","aria-orientation":"vertical"}),(0,ev.jsx)("aside",{className:"pisell-global-search__detail",style:{flex:`0 0 ${O}`,width:O},children:i})]})]})]})},[Y,w,j,et,N,J,M,U,g,X,ea,Q,k,D,I,L,O,R,$,F]),en=(0,ef.useMemo)(()=>({triggerType:"input",displayType:"modal",placeholder:eZ7("pisell-global-search.placeholder"),confirmButtonText:eZ7("pisell-global-search.search"),modalWidth:1080,showHistory:!0,historyKey:"pisell_global_search_history",..._}),[_]),es="instant"===b?"realtime":"confirm",er=(0,ef.useCallback)(e=>{A(e),"instant"===b&&T(e)},[b]),eo=(0,ef.useCallback)(e=>{A(e),T(e)},[]);return(0,ev.jsx)(eZX,{ref:ee,size:"phone"===k?"small":void 0,...en,searchMode:es,value:P,onChange:er,onSearch:eo,resultRender:ei})});eXa.displayName="PisellGlobalSearch";let eXi=iW(eXa),eXn=e=>{let{refreshVersion:t=0,...l}=e,a=(0,ef.useRef)(null),i=(0,ef.useRef)(!1);return(0,ef.useEffect)(()=>{var e,t,n;if(!i.current){i.current=!0;return}let s=null==l||null==(e=l.osProps)?void 0:e.preloadedSalesDetail;s&&"object"==typeof s?null==(t=a.current)||t.refresh({preloadedSalesDetail:s}):null==(n=a.current)||n.refresh({forceRemote:!1})},[t]),(0,ev.jsx)(eV6,{ref:a,...l})},eXs=["bookings","products","payments","vouchers","surcharges","discount_list","relation_forms","contacts_info","holder","summary","customer","refunds"];function eXr(e){let{filters:t,sort:l,page:a=1,perPage:i=20}=e;return{page:a,per_page:i,...t&&Object.keys(t).length?{filters:t}:{},...l&&l.length?{sort:l}:{}}}function eXo(e,t,l){let a=Array.isArray(null==e?void 0:e.list)?e.list:[],i=Number((null==e?void 0:e.count)??a.length)||0,n=Number((null==e?void 0:e.skip)??t)||t,s=Number((null==e?void 0:e.size)??l)||l;return{items:a,total:i,page:n,perPage:s,hasMore:n*s<i}}async function eXd(e){let{page:t=1,perPage:l=20,signal:a,subscriberId:i,callback:n,resetVisibleOrderIds:s}=e,r={search_mode:e.searchMode,with:eXs,...eXr(e),keyword:e.keyword},o=await z_.Em.getRequest().post("/shop/es/search/sales",r,{fullResult:!0,isShopApi:!0,osServer:!0,signal:a,subscriberId:i,callback:n,resetVisibleOrderIds:s});return eXo(null==o?void 0:o.data,t,l)}async function eXc(e){var t;let{page:l=1,perPage:a=20,signal:i,subscriberId:n,callback:s,resetVisibleOrderIds:r}=e,o={search_mode:e.searchMode,with:eXs,keyword:e.keyword,modules:[{module:"sales",data:eXr(e)}]},d=await z_.Em.getRequest().post("/shop/es/search",o,{fullResult:!0,isShopApi:!0,osServer:!0,signal:i,subscriberId:n,callback:s,resetVisibleOrderIds:r}),c=null==d||null==(t=d.data)?void 0:t.results;return eXo(Array.isArray(c)?c.find(e=>(null==e?void 0:e.module)==="sales"):void 0,l,a)}async function eXu(e){await eVF("/shop/es/search/sales/unsubscribe",e,{fullResult:!0})}async function eXp(e){await eVF("/shop/es/search/unsubscribe",e,{fullResult:!0})}let eXm=e=>{let t=(null==e?void 0:e.order_id)??(null==e?void 0:e.id);if(null==t)return;let l=Number(t);return Number.isFinite(l)?l:void 0};function eXg(e){let t=(null==e?void 0:e.data)??e;if(Array.isArray(null==t?void 0:t.list))return t.list;let l=(Array.isArray(null==t?void 0:t.results)?t.results:[]).find(e=>(null==e?void 0:e.module)==="sales");return Array.isArray(null==l?void 0:l.list)?l.list:[]}function eXh(e){return e instanceof HTMLElement||e instanceof SVGElement}function eXv(e){var t,l=e&&"object"===(0,tk.A)(e)&&eXh(e.nativeElement)?e.nativeElement:eXh(e)?e:null;return l||(e instanceof ey().Component?null==(t=iM().findDOMNode)?void 0:t.call(iM(),e):null)}var eXf=ef.createContext(null),eXy=function(){if("u">typeof Map)return Map;function e(e,t){var l=-1;return e.some(function(e,a){return e[0]===t&&(l=a,!0)}),l}function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var l=e(this.__entries__,t),a=this.__entries__[l];return a&&a[1]},t.prototype.set=function(t,l){var a=e(this.__entries__,t);~a?this.__entries__[a][1]=l:this.__entries__.push([t,l])},t.prototype.delete=function(t){var l=this.__entries__,a=e(l,t);~a&&l.splice(a,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var l=0,a=this.__entries__;l<a.length;l++){var i=a[l];e.call(t,i[1],i[0])}},t}(),eXx="u">typeof window&&"u">typeof document&&window.document===document,eXb=void 0!==i.g&&i.g.Math===Math?i.g:"u">typeof self&&self.Math===Math?self:"u">typeof window&&window.Math===Math?window:Function("return this")(),eX_="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(eXb):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)},eXk=["top","right","bottom","left","width","height","size","weight"],eXw="u">typeof MutationObserver,eXj=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e){var t=!1,l=!1,a=0;function i(){t&&(t=!1,e()),l&&s()}function n(){eX_(i)}function s(){var e=Date.now();if(t){if(e-a<2)return;l=!0}else t=!0,l=!1,setTimeout(n,20);a=e}return s}(this.refresh.bind(this))}return e.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},e.prototype.removeObserver=function(e){var t=this.observers_,l=t.indexOf(e);~l&&t.splice(l,1),!t.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},e.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},e.prototype.connect_=function(){eXx&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),eXw?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){eXx&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,l=void 0===t?"":t;eXk.some(function(e){return!!~l.indexOf(e)})&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),eXS=function(e,t){for(var l=0,a=Object.keys(t);l<a.length;l++){var i=a[l];Object.defineProperty(e,i,{value:t[i],enumerable:!1,writable:!1,configurable:!0})}return e},eXM=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||eXb},eXN=eXA(0,0,0,0);function eXC(e){return parseFloat(e)||0}function eXT(e){for(var t=[],l=1;l<arguments.length;l++)t[l-1]=arguments[l];return t.reduce(function(t,l){return t+eXC(e["border-"+l+"-width"])},0)}var eXP="u">typeof SVGGraphicsElement?function(e){return e instanceof eXM(e).SVGGraphicsElement}:function(e){return e instanceof eXM(e).SVGElement&&"function"==typeof e.getBBox};function eXA(e,t,l,a){return{x:e,y:t,width:l,height:a}}var eXD=function(){function e(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=eXA(0,0,0,0),this.target=e}return e.prototype.isActive=function(){var e=function(e){if(!eXx)return eXN;if(eXP(e)){var t;return eXA(0,0,(t=e.getBBox()).width,t.height)}return function(e){var t,l=e.clientWidth,a=e.clientHeight;if(!l&&!a)return eXN;var i=eXM(e).getComputedStyle(e),n=function(e){for(var t={},l=0,a=["top","right","bottom","left"];l<a.length;l++){var i=a[l],n=e["padding-"+i];t[i]=eXC(n)}return t}(i),s=n.left+n.right,r=n.top+n.bottom,o=eXC(i.width),d=eXC(i.height);if("border-box"===i.boxSizing&&(Math.round(o+s)!==l&&(o-=eXT(i,"left","right")+s),Math.round(d+r)!==a&&(d-=eXT(i,"top","bottom")+r)),(t=e)!==eXM(t).document.documentElement){var c=Math.round(o+s)-l,u=Math.round(d+r)-a;1!==Math.abs(c)&&(o-=c),1!==Math.abs(u)&&(d-=u)}return eXA(n.left,n.top,o,d)}(e)}(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},e}(),eXI=function(e,t){var l,a,i,n,s,r=(l=t.x,a=t.y,i=t.width,n=t.height,eXS(s=Object.create(("u">typeof DOMRectReadOnly?DOMRectReadOnly:Object).prototype),{x:l,y:a,width:i,height:n,top:a,right:l+i,bottom:n+a,left:l}),s);eXS(this,{target:e,contentRect:r})},eXE=function(){function e(e,t,l){if(this.activeObservations_=[],this.observations_=new eXy,"function"!=typeof e)throw TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=t,this.callbackCtx_=l}return e.prototype.observe=function(e){if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");if(!("u"<typeof Element)&&Element instanceof Object){if(!(e instanceof eXM(e).Element))throw TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new eXD(e)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(e){if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");if(!("u"<typeof Element)&&Element instanceof Object){if(!(e instanceof eXM(e).Element))throw TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new eXI(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),eXz="u">typeof WeakMap?new WeakMap:new eXy,eXL=function e(t){if(!(this instanceof e))throw TypeError("Cannot call a class as a function.");if(!arguments.length)throw TypeError("1 argument required, but only 0 present.");var l=new eXE(t,eXj.getInstance(),this);eXz.set(this,l)};["observe","unobserve","disconnect"].forEach(function(e){eXL.prototype[e]=function(){var t;return(t=eXz.get(this))[e].apply(t,arguments)}});var eXO=void 0!==eXb.ResizeObserver?eXb.ResizeObserver:eXL,eXR=new Map,eX$=new eXO(function(e){e.forEach(function(e){var t,l=e.target;null==(t=eXR.get(l))||t.forEach(function(e){return e(l)})})});function eXF(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}var eXB=i(8544);function eXH(e,t){for(var l=0;l<t.length;l++){var a=t[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,(0,eXB.A)(a.key),a)}}function eXq(e,t,l){return t&&eXH(e.prototype,t),l&&eXH(e,l),Object.defineProperty(e,"prototype",{writable:!1}),e}function eXV(e,t){return(eXV=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function eXY(e){return(eXY=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eXU(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(eXU=function(){return!!e})()}var eXW=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");a.prototype=Object.create(e&&e.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),e&&eXV(a,e);var t,l=(t=eXU(),function(){var e,l=eXY(a);e=t?Reflect.construct(l,arguments,eXY(this).constructor):l.apply(this,arguments);if(e&&("object"==(0,tk.A)(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===this)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return this});function a(){return eXF(this,a),l.apply(this,arguments)}return eXq(a,[{key:"render",value:function(){return this.props.children}}]),a}(ef.Component),eXG=ef.forwardRef(function(e,t){var l=e.children,a=e.disabled,i=ef.useRef(null),n=ef.useRef(null),s=ef.useContext(eXf),r="function"==typeof l,o=r?l(i):l,d=ef.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),c=!r&&ef.isValidElement(o)&&tD(o),u=tA(c&&o&&tI(o)?o.props.propertyIsEnumerable("ref")?o.props.ref:o.ref:null,i),p=function(){var e;return eXv(i.current)||(i.current&&"object"===(0,tk.A)(i.current)?eXv(null==(e=i.current)?void 0:e.nativeElement):null)||eXv(n.current)};ef.useImperativeHandle(t,function(){return p()});var m=ef.useRef(e);m.current=e;var g=ef.useCallback(function(e){var t=m.current,l=t.onResize,a=t.data,i=e.getBoundingClientRect(),n=i.width,r=i.height,o=e.offsetWidth,c=e.offsetHeight,u=Math.floor(n),p=Math.floor(r);if(d.current.width!==u||d.current.height!==p||d.current.offsetWidth!==o||d.current.offsetHeight!==c){var g={width:u,height:p,offsetWidth:o,offsetHeight:c};d.current=g;var h=o===Math.round(n)?n:o,v=c===Math.round(r)?r:c,f=tf(tf({},g),{},{offsetWidth:h,offsetHeight:v});null==s||s(f,e,a),l&&Promise.resolve().then(function(){l(f,e)})}},[]);return ef.useEffect(function(){var e=p();return e&&!a&&(eXR.has(e)||(eXR.set(e,new Set),eX$.observe(e)),eXR.get(e).add(g)),function(){eXR.has(e)&&(eXR.get(e).delete(g),!eXR.get(e).size&&(eX$.unobserve(e),eXR.delete(e)))}},[i.current,a]),ef.createElement(eXW,{ref:n},c?ef.cloneElement(o,{ref:u}):o)}),eXQ=ef.forwardRef(function(e,t){var l=e.children;return("function"==typeof l?[l]:function e(t){var l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=[];return ey().Children.forEach(t,function(t){(null!=t||l.keepEmpty)&&(Array.isArray(t)?a=a.concat(e(t)):tN(t)&&t.props?a=a.concat(e(t.props.children,l)):a.push(t))}),a}(l)).map(function(l,a){var i=(null==l?void 0:l.key)||"".concat("rc-observer-key","-").concat(a);return ef.createElement(eXG,tg({},e,{key:i,ref:0===a?t:void 0}),l)})});function eXK(e){var t=ef.useRef();return t.current=e,ef.useCallback(function(){for(var e,l=arguments.length,a=Array(l),i=0;i<l;i++)a[i]=arguments[i];return null==(e=t.current)?void 0:e.call.apply(e,[t].concat(a))},[])}eXQ.Collection=function(e){var t=e.children,l=e.onBatchResize,a=ef.useRef(0),i=ef.useRef([]),n=ef.useContext(eXf),s=ef.useCallback(function(e,t,s){a.current+=1;var r=a.current;i.current.push({size:e,element:t,data:s}),Promise.resolve().then(function(){r===a.current&&(null==l||l(i.current),i.current=[])}),null==n||n(e,t,s)},[l,n]);return ef.createElement(eXf.Provider,{value:s},t)};var eXJ=tL()?ef.useLayoutEffect:ef.useEffect;let eXZ=function(e,t){var l=ef.useRef(!0);eXJ(function(){return e(l.current)},t),eXJ(function(){return l.current=!1,function(){l.current=!0}},[])};var eXX=ef.forwardRef(function(e,t){var l=e.height,a=e.offsetY,i=e.offsetX,n=e.children,s=e.prefixCls,r=e.onInnerResize,o=e.innerProps,d=e.rtl,c=e.extra,u={},p={display:"flex",flexDirection:"column"};return void 0!==a&&(u={height:l,position:"relative",overflow:"hidden"},p=tf(tf({},p),{},(0,th.A)((0,th.A)((0,th.A)((0,th.A)((0,th.A)({transform:"translateY(".concat(a,"px)")},d?"marginRight":"marginLeft",-i),"position","absolute"),"left",0),"right",0),"top",0))),ef.createElement("div",{style:u},ef.createElement(eXQ,{onResize:function(e){e.offsetHeight&&r&&r()}},ef.createElement("div",tg({style:p,className:t_()((0,th.A)({},"".concat(s,"-holder-inner"),s)),ref:t},o),n,c)))});function eX0(e){var t=e.children,l=e.setRef,a=ef.useCallback(function(e){l(e)},[]);return ef.cloneElement(t,{ref:a})}eXX.displayName="Filler";var eX2=function(e){return+setTimeout(e,16)},eX1=function(e){return clearTimeout(e)};"u">typeof window&&"requestAnimationFrame"in window&&(eX2=function(e){return window.requestAnimationFrame(e)},eX1=function(e){return window.cancelAnimationFrame(e)});var eX4=0,eX3=new Map,eX8=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,l=eX4+=1;return!function t(a){if(0===a)eX3.delete(l),e();else{var i=eX2(function(){t(a-1)});eX3.set(l,i)}}(t),l};eX8.cancel=function(e){var t=eX3.get(e);return eX3.delete(e),eX1(t)};var eX6=("u"<typeof navigator?"undefined":(0,tk.A)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent);let eX5=function(e,t,l,a){var i=(0,ef.useRef)(!1),n=(0,ef.useRef)(null),s=(0,ef.useRef)({top:e,bottom:t,left:l,right:a});return s.current.top=e,s.current.bottom=t,s.current.left=l,s.current.right=a,function(e,t){var l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e?t<0&&s.current.left||t>0&&s.current.right:t<0&&s.current.top||t>0&&s.current.bottom;return l&&a?(clearTimeout(n.current),i.current=!1):(!a||i.current)&&(clearTimeout(n.current),i.current=!0,n.current=setTimeout(function(){i.current=!1},50)),!i.current&&a}};var eX7=function(){function e(){eXF(this,e),(0,th.A)(this,"maps",void 0),(0,th.A)(this,"id",0),(0,th.A)(this,"diffRecords",new Map),this.maps=Object.create(null)}return eXq(e,[{key:"set",value:function(e,t){this.diffRecords.set(e,this.maps[e]),this.maps[e]=t,this.id+=1}},{key:"get",value:function(e){return this.maps[e]}},{key:"resetRecord",value:function(){this.diffRecords.clear()}},{key:"getRecord",value:function(){return this.diffRecords}}]),e}();function eX9(e){var t=parseFloat(e);return isNaN(t)?0:t}var e0e=14/15;function e0t(e){return Math.floor(Math.pow(e,.5))}function e0l(e,t){return("touches"in e?e.touches[0]:e)[t?"pageX":"pageY"]-window[t?"scrollX":"scrollY"]}var e0a=ef.forwardRef(function(e,t){var l=e.prefixCls,a=e.rtl,i=e.scrollOffset,n=e.scrollRange,s=e.onStartMove,r=e.onStopMove,o=e.onScroll,d=e.horizontal,c=e.spinSize,u=e.containerSize,p=e.style,m=e.thumbStyle,g=e.showScrollBar,h=nT(ef.useState(!1),2),v=h[0],f=h[1],y=nT(ef.useState(null),2),x=y[0],b=y[1],_=nT(ef.useState(null),2),k=_[0],w=_[1],j=!a,S=ef.useRef(),M=ef.useRef(),N=nT(ef.useState(g),2),C=N[0],T=N[1],P=ef.useRef(),A=function(){!0!==g&&!1!==g&&(clearTimeout(P.current),T(!0),P.current=setTimeout(function(){T(!1)},3e3))},D=n-u||0,I=u-c||0,E=ef.useMemo(function(){return 0===i||0===D?0:i/D*I},[i,D,I]),z=ef.useRef({top:E,dragging:v,pageY:x,startTop:k});z.current={top:E,dragging:v,pageY:x,startTop:k};var L=function(e){f(!0),b(e0l(e,d)),w(z.current.top),s(),e.stopPropagation(),e.preventDefault()};ef.useEffect(function(){var e=function(e){e.preventDefault()},t=S.current,l=M.current;return t.addEventListener("touchstart",e,{passive:!1}),l.addEventListener("touchstart",L,{passive:!1}),function(){t.removeEventListener("touchstart",e),l.removeEventListener("touchstart",L)}},[]);var O=ef.useRef();O.current=D;var R=ef.useRef();R.current=I,ef.useEffect(function(){if(v){var e,t=function(t){var l=z.current,a=l.dragging,i=l.pageY,n=l.startTop;eX8.cancel(e);var s=S.current.getBoundingClientRect(),r=u/(d?s.width:s.height);if(a){var c=(e0l(t,d)-i)*r,p=n;!j&&d?p-=c:p+=c;var m=O.current,g=R.current,h=Math.ceil((g?p/g:0)*m);h=Math.min(h=Math.max(h,0),m),e=eX8(function(){o(h,d)})}},l=function(){f(!1),r()};return window.addEventListener("mousemove",t,{passive:!0}),window.addEventListener("touchmove",t,{passive:!0}),window.addEventListener("mouseup",l,{passive:!0}),window.addEventListener("touchend",l,{passive:!0}),function(){window.removeEventListener("mousemove",t),window.removeEventListener("touchmove",t),window.removeEventListener("mouseup",l),window.removeEventListener("touchend",l),eX8.cancel(e)}}},[v]),ef.useEffect(function(){return A(),function(){clearTimeout(P.current)}},[i]),ef.useImperativeHandle(t,function(){return{delayHidden:A}});var $="".concat(l,"-scrollbar"),F={position:"absolute",visibility:C?null:"hidden"},B={position:"absolute",borderRadius:99,background:"var(--rc-virtual-list-scrollbar-bg, rgba(0, 0, 0, 0.5))",cursor:"pointer",userSelect:"none"};return d?(Object.assign(F,{height:8,left:0,right:0,bottom:0}),Object.assign(B,(0,th.A)({height:"100%",width:c},j?"left":"right",E))):(Object.assign(F,(0,th.A)({width:8,top:0,bottom:0},j?"right":"left",0)),Object.assign(B,{width:"100%",height:c,top:E})),ef.createElement("div",{ref:S,className:t_()($,(0,th.A)((0,th.A)((0,th.A)({},"".concat($,"-horizontal"),d),"".concat($,"-vertical"),!d),"".concat($,"-visible"),C)),style:tf(tf({},F),p),onMouseDown:function(e){e.stopPropagation(),e.preventDefault()},onMouseMove:A},ef.createElement("div",{ref:M,className:t_()("".concat($,"-thumb"),(0,th.A)({},"".concat($,"-thumb-moving"),v)),style:tf(tf({},B),m),onMouseDown:L}))});function e0i(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,l=e/t*e;return isNaN(l)&&(l=0),Math.floor(l=Math.max(l,20))}var e0n=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles","showScrollBar"],e0s=[],e0r={overflowY:"auto",overflowAnchor:"none"},e0o=ef.forwardRef(function(e,t){var l,a,i,n,s,r,o,d,c,u,p,m,g,h,v,f,y,x,b,_,k,w,j,S,M,N,C,T,P,A,D,I,E,z=e.prefixCls,L=void 0===z?"rc-virtual-list":z,O=e.className,R=e.height,$=e.itemHeight,F=e.fullHeight,B=e.style,H=e.data,q=e.children,V=e.itemKey,Y=e.virtual,U=e.direction,W=e.scrollWidth,G=e.component,Q=e.onScroll,K=e.onVirtualScroll,J=e.onVisibleChange,Z=e.innerProps,X=e.extraRender,ee=e.styles,et=e.showScrollBar,el=void 0===et?"optional":et,ea=tx(e,e0n),ei=ef.useCallback(function(e){return"function"==typeof V?V(e):null==e?void 0:e[V]},[V]),en=function(e){var t=nT(ef.useState(0),2),l=t[0],a=t[1],i=(0,ef.useRef)(new Map),n=(0,ef.useRef)(new eX7),s=(0,ef.useRef)(0);function r(){s.current+=1}function o(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];r();var t=function(){var e=!1;i.current.forEach(function(t,l){if(t&&t.offsetParent){var a=t.offsetHeight,i=getComputedStyle(t),s=i.marginTop,r=i.marginBottom,o=a+eX9(s)+eX9(r);n.current.get(l)!==o&&(n.current.set(l,o),e=!0)}}),e&&a(function(e){return e+1})};if(e)t();else{s.current+=1;var l=s.current;Promise.resolve().then(function(){l===s.current&&t()})}}return(0,ef.useEffect)(function(){return r},[]),[function(t,l){var a=e(t);i.current.get(a),l?(i.current.set(a,l),o()):i.current.delete(a)},o,n.current,l]}(ei),es=nT(en,4),er=es[0],eo=es[1],ed=es[2],ec=es[3],eu=!!(!1!==Y&&R&&$),ep=ef.useMemo(function(){return Object.values(ed.maps).reduce(function(e,t){return e+t},0)},[ed.id,ed.maps]),em=eu&&H&&(Math.max($*H.length,ep)>R||!!W),eg="rtl"===U,eh=t_()(L,(0,th.A)({},"".concat(L,"-rtl"),eg),O),ev=H||e0s,ey=(0,ef.useRef)(),ex=(0,ef.useRef)(),eb=(0,ef.useRef)(),e_=nT((0,ef.useState)(0),2),ek=e_[0],ew=e_[1],ej=nT((0,ef.useState)(0),2),eS=ej[0],eM=ej[1],eN=nT((0,ef.useState)(!1),2),eC=eN[0],eT=eN[1],eP=function(){eT(!0)},eA=function(){eT(!1)};function eD(e){ew(function(t){var l,a=(l="function"==typeof e?e(t):e,Number.isNaN(eQ.current)||(l=Math.min(l,eQ.current)),l=Math.max(l,0));return ey.current.scrollTop=a,a})}var eI=(0,ef.useRef)({start:0,end:ev.length}),eE=(0,ef.useRef)(),ez=(a=(l=nT(ef.useState(ev),2))[0],i=l[1],s=(n=nT(ef.useState(null),2))[0],r=n[1],ef.useEffect(function(){var e=function(e,t,l){var a,i,n=e.length,s=t.length;if(0===n&&0===s)return null;n<s?(a=e,i=t):(a=t,i=e);var r={__EMPTY_ITEM__:!0};function o(e){return void 0!==e?l(e):r}for(var d=null,c=1!==Math.abs(n-s),u=0;u<i.length;u+=1){var p=o(a[u]);if(p!==o(i[u])){d=u,c=c||p!==o(i[u+1]);break}}return null===d?null:{index:d,multiple:c}}(a||[],ev||[],ei);(null==e?void 0:e.index)!==void 0&&r(ev[e.index]),i(ev)},[ev]),[s]);eE.current=nT(ez,1)[0];var eL=ef.useMemo(function(){if(!eu)return{scrollHeight:void 0,start:0,end:ev.length-1,offset:void 0};if(!em)return{scrollHeight:(null==(e=ex.current)?void 0:e.offsetHeight)||0,start:0,end:ev.length-1,offset:void 0};for(var e,t,l,a,i=0,n=ev.length,s=0;s<n;s+=1){var r=ei(ev[s]),o=ed.get(r),d=i+(void 0===o?$:o);d>=ek&&void 0===t&&(t=s,l=i),d>ek+R&&void 0===a&&(a=s),i=d}return void 0===t&&(t=0,l=0,a=Math.ceil(R/$)),void 0===a&&(a=ev.length-1),{scrollHeight:i,start:t,end:a=Math.min(a+1,ev.length-1),offset:l}},[em,eu,ek,ev,ec,R]),eO=eL.scrollHeight,eR=eL.start,e$=eL.end,eF=eL.offset;eI.current.start=eR,eI.current.end=e$,ef.useLayoutEffect(function(){var e=ed.getRecord();if(1===e.size){var t=Array.from(e.keys())[0],l=e.get(t),a=ev[eR];if(a&&void 0===l&&ei(a)===t){var i=ed.get(t)-$;eD(function(e){return e+i})}}ed.resetRecord()},[eO]);var eB=nT(ef.useState({width:0,height:R}),2),eH=eB[0],eq=eB[1],eV=(0,ef.useRef)(),eY=(0,ef.useRef)(),eU=ef.useMemo(function(){return e0i(eH.width,W)},[eH.width,W]),eW=ef.useMemo(function(){return e0i(eH.height,eO)},[eH.height,eO]),eG=eO-R,eQ=(0,ef.useRef)(eG);eQ.current=eG;var eK=ek<=0,eJ=ek>=eG,eZ=eS<=0,eX=eS>=W,e0=eX5(eK,eJ,eZ,eX),e2=function(){return{x:eg?-eS:eS,y:ek}},e1=(0,ef.useRef)(e2()),e4=eXK(function(e){if(K){var t=tf(tf({},e2()),e);(e1.current.x!==t.x||e1.current.y!==t.y)&&(K(t),e1.current=t)}});function e3(e,t){t?((0,iS.flushSync)(function(){eM(e)}),e4()):eD(e)}var e8=function(e){var t=e,l=W?W-eH.width:0;return Math.min(t=Math.max(t,0),l)},e6=eXK(function(e,t){t?((0,iS.flushSync)(function(){eM(function(t){return e8(t+(eg?-e:e))})}),e4()):eD(function(t){return t+e})}),e5=nT((o=!!W,d=(0,ef.useRef)(0),c=(0,ef.useRef)(null),u=(0,ef.useRef)(null),p=(0,ef.useRef)(!1),m=eX5(eK,eJ,eZ,eX),g=(0,ef.useRef)(null),h=(0,ef.useRef)(null),[function(e){if(eu){eX8.cancel(h.current),h.current=eX8(function(){g.current=null},2);var t,l,a=e.deltaX,i=e.deltaY,n=e.shiftKey,s=a,r=i;("sx"===g.current||!g.current&&n&&i&&!a)&&(s=i,r=0,g.current="sx");var v=Math.abs(s),f=Math.abs(r);if(null===g.current&&(g.current=o&&v>f?"x":"y"),"y"===g.current){t=e,l=r,eX8.cancel(c.current),!m(!1,l)&&(t._virtualHandled||(t._virtualHandled=!0,d.current+=l,u.current=l,eX6||t.preventDefault(),c.current=eX8(function(){var e=p.current?10:1;e6(d.current*e,!1),d.current=0})))}else e6(s,!0),eX6||e.preventDefault()}},function(e){eu&&(p.current=e.detail===u.current)}]),2),e7=e5[0],e9=e5[1];v=function(e,t,l,a){return!e0(e,t,l)&&(!a||!a._virtualHandled)&&(a&&(a._virtualHandled=!0),e7({preventDefault:function(){},deltaX:e?t:0,deltaY:e?0:t}),!0)},y=(0,ef.useRef)(!1),x=(0,ef.useRef)(0),b=(0,ef.useRef)(0),_=(0,ef.useRef)(null),k=(0,ef.useRef)(null),w=function(e){if(y.current){var t=Math.ceil(e.touches[0].pageX),l=Math.ceil(e.touches[0].pageY),a=x.current-t,i=b.current-l,n=Math.abs(a)>Math.abs(i);n?x.current=t:b.current=l;var s=v(n,n?a:i,!1,e);s&&e.preventDefault(),clearInterval(k.current),s&&(k.current=setInterval(function(){n?a*=e0e:i*=e0e;var e=Math.floor(n?a:i);(!v(n,e,!0)||.1>=Math.abs(e))&&clearInterval(k.current)},16))}},j=function(){y.current=!1,f()},S=function(e){f(),1!==e.touches.length||y.current||(y.current=!0,x.current=Math.ceil(e.touches[0].pageX),b.current=Math.ceil(e.touches[0].pageY),_.current=e.target,_.current.addEventListener("touchmove",w,{passive:!1}),_.current.addEventListener("touchend",j,{passive:!0}))},f=function(){_.current&&(_.current.removeEventListener("touchmove",w),_.current.removeEventListener("touchend",j))},eXZ(function(){return eu&&ey.current.addEventListener("touchstart",S,{passive:!0}),function(){var e;null==(e=ey.current)||e.removeEventListener("touchstart",S),f(),clearInterval(k.current)}},[eu]),M=function(e){eD(function(t){return t+e})},ef.useEffect(function(){var e=ey.current;if(em&&e){var t,l,a=!1,i=function(){eX8.cancel(t)},n=function e(){i(),t=eX8(function(){M(l),e()})},s=function(){a=!1,i()},r=function(e){!e.target.draggable&&0===e.button&&(e._virtualHandled||(e._virtualHandled=!0,a=!0))},o=function(t){if(a){var s=e0l(t,!1),r=e.getBoundingClientRect(),o=r.top,d=r.bottom;s<=o?(l=-e0t(o-s),n()):s>=d?(l=e0t(s-d),n()):i()}};return e.addEventListener("mousedown",r),e.ownerDocument.addEventListener("mouseup",s),e.ownerDocument.addEventListener("mousemove",o),e.ownerDocument.addEventListener("dragend",s),function(){e.removeEventListener("mousedown",r),e.ownerDocument.removeEventListener("mouseup",s),e.ownerDocument.removeEventListener("mousemove",o),e.ownerDocument.removeEventListener("dragend",s),i()}}},[em]),eXZ(function(){function e(e){var t=eK&&e.detail<0,l=eJ&&e.detail>0;!eu||t||l||e.preventDefault()}var t=ey.current;return t.addEventListener("wheel",e7,{passive:!1}),t.addEventListener("DOMMouseScroll",e9,{passive:!0}),t.addEventListener("MozMousePixelScroll",e,{passive:!1}),function(){t.removeEventListener("wheel",e7),t.removeEventListener("DOMMouseScroll",e9),t.removeEventListener("MozMousePixelScroll",e)}},[eu,eK,eJ]),eXZ(function(){if(W){var e=e8(eS);eM(e),e4({x:e})}},[eH.width,W]);var te=function(){var e,t;null==(e=eV.current)||e.delayHidden(),null==(t=eY.current)||t.delayHidden()},tt=(N=function(){return eo(!0)},C=ef.useRef(),P=(T=nT(ef.useState(null),2))[0],A=T[1],eXZ(function(){if(P&&P.times<10){if(!ey.current)return void A(function(e){return tf({},e)});N();var e=P.targetAlign,t=P.originAlign,l=P.index,a=P.offset,i=ey.current.clientHeight,n=!1,s=e,r=null;if(i){for(var o=e||t,d=0,c=0,u=0,p=Math.min(ev.length-1,l),m=0;m<=p;m+=1){var g=ei(ev[m]);c=d;var h=ed.get(g);d=u=c+(void 0===h?$:h)}for(var v="top"===o?a:i-a,f=p;f>=0;f-=1){var y=ei(ev[f]),x=ed.get(y);if(void 0===x){n=!0;break}if((v-=x)<=0)break}switch(o){case"top":r=c-a;break;case"bottom":r=u-i+a;break;default:var b=ey.current.scrollTop;c<b?s="top":u>b+i&&(s="bottom")}null!==r&&eD(r),r!==P.lastTop&&(n=!0)}n&&A(tf(tf({},P),{},{times:P.times+1,targetAlign:s,lastTop:r}))}},[P,ey.current]),function(e){if(null==e)return void te();if(eX8.cancel(C.current),"number"==typeof e)eD(e);else if(e&&"object"===(0,tk.A)(e)){var t,l=e.align;t="index"in e?e.index:ev.findIndex(function(t){return ei(t)===e.key});var a=e.offset;A({times:0,index:t,offset:void 0===a?0:a,originAlign:l})}});ef.useImperativeHandle(t,function(){return{nativeElement:eb.current,getScrollInfo:e2,scrollTo:function(e){e&&"object"===(0,tk.A)(e)&&("left"in e||"top"in e)?(void 0!==e.left&&eM(e8(e.left)),tt(e.top)):tt(e)}}}),eXZ(function(){J&&J(ev.slice(eR,e$+1),ev)},[eR,e$,ev]);var tl=(I=(D=nT(ef.useMemo(function(){return[new Map,[]]},[ev,ed.id,$]),2))[0],E=D[1],function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,l=I.get(e),a=I.get(t);if(void 0===l||void 0===a)for(var i=ev.length,n=E.length;n<i;n+=1){var s,r=ei(ev[n]);I.set(r,n);var o=null!=(s=ed.get(r))?s:$;if(E[n]=(E[n-1]||0)+o,r===e&&(l=n),r===t&&(a=n),void 0!==l&&void 0!==a)break}return{top:E[l-1]||0,bottom:E[a]}}),ta=null==X?void 0:X({start:eR,end:e$,virtual:em,offsetX:eS,offsetY:eF,rtl:eg,getSize:tl}),ti=ev.slice(eR,e$+1).map(function(e,t){var l=q(e,eR+t,{style:{width:W},offsetX:eS}),a=ei(e);return ef.createElement(eX0,{key:a,setRef:function(t){return er(e,t)}},l)}),tn=null;R&&(tn=tf((0,th.A)({},void 0===F||F?"height":"maxHeight",R),e0r),eu&&(tn.overflowY="hidden",W&&(tn.overflowX="hidden"),eC&&(tn.pointerEvents="none")));var ts={};return eg&&(ts.dir="rtl"),ef.createElement("div",tg({ref:eb,style:tf(tf({},B),{},{position:"relative"}),className:eh},ts,ea),ef.createElement(eXQ,{onResize:function(e){eq({width:e.offsetWidth,height:e.offsetHeight})}},ef.createElement(void 0===G?"div":G,{className:"".concat(L,"-holder"),style:tn,ref:ey,onScroll:function(e){var t=e.currentTarget.scrollTop;t!==ek&&eD(t),null==Q||Q(e),e4()},onMouseEnter:te},ef.createElement(eXX,{prefixCls:L,height:eO,offsetX:eS,offsetY:eF,scrollWidth:W,onInnerResize:eo,ref:ex,innerProps:Z,rtl:eg,extra:ta},ti))),em&&eO>R&&ef.createElement(e0a,{ref:eV,prefixCls:L,scrollOffset:ek,scrollRange:eO,rtl:eg,onScroll:e3,onStartMove:eP,onStopMove:eA,spinSize:eW,containerSize:eH.height,style:null==ee?void 0:ee.verticalScrollBar,thumbStyle:null==ee?void 0:ee.verticalScrollBarThumb,showScrollBar:el}),em&&W>eH.width&&ef.createElement(e0a,{ref:eY,prefixCls:L,scrollOffset:eS,scrollRange:W,rtl:eg,onScroll:e3,onStartMove:eP,onStopMove:eA,spinSize:eU,containerSize:eH.width,horizontal:!0,style:null==ee?void 0:ee.horizontalScrollBar,thumbStyle:null==ee?void 0:ee.horizontalScrollBarThumb,showScrollBar:el}))});function e0d(e){let{keyword:t,searchMode:l,perPage:a,filters:i,sort:n,subscriberPrefix:s,onDelta:r}=e,[o,d]=(0,ef.useState)([]),[c,u]=(0,ef.useState)(0),[p,m]=(0,ef.useState)(!1),[g,h]=(0,ef.useState)(null),[v,f]=(0,ef.useState)(1),y=(0,ef.useRef)(0),x=(0,ef.useRef)((0,eH.LP)(s)),b=(0,ef.useRef)(r);b.current=r;let _=(0,ef.useCallback)(e=>{var t;let l=eXg(e);0!==l.length&&(l.length,l.map(e=>(null==e?void 0:e.order_id)??(null==e?void 0:e.id)??(null==e?void 0:e.key)),d(e=>(function(e,t){if(!t.length)return e;let l=new Map;if(t.forEach(e=>{let t=eXm(e);void 0!==t&&l.set(String(t),e)}),0===l.size)return e;let a=!1,i=e.map(e=>{let t=eXm(e);if(void 0===t)return e;let i=l.get(String(t));return i?(a=!0,{...e,...i}):e});return a?i:e})(e,l)),null==(t=b.current)||t.call(b,l))},[s]),k=(0,ef.useCallback)(async(e,s)=>{let r=(t??"").trim();if(!r){d([]),u(0),h(null),f(1),eXu(x.current);return}let o=++y.current;m(!0),h(null);try{let t=await eXd({keyword:r,searchMode:l,filters:i,sort:n,page:e,perPage:a,subscriberId:x.current,callback:_,resetVisibleOrderIds:!s});if(o!==y.current)return;u(t.total),d(e=>s?[...e,...t.items]:t.items),f(e)}catch(e){if(o!==y.current)return;h(e),s||(d([]),u(0))}finally{o===y.current&&m(!1)}},[t,l,a,i,n,_]);(0,ef.useEffect)(()=>{let e=x.current;return()=>{eXu(e)}},[]),(0,ef.useEffect)(()=>{f(1),k(1,!1)},[k]);let w=o.length<c;return{items:o,total:c,loading:p,error:g,page:v,hasMore:w,fetchPage:k,subscriberId:x.current}}e0o.displayName="List";function e0c(e,t,l){return null==l||""===l?0:e[`${t}:${l}`]??0}function e0u(e,t){if(!Array.isArray(t)||0===t.length)return e;let l=null,a=new Set;for(let i of t){let t=e0p(i);if(null==t)continue;let n=`order:${t}`;a.has(n)||(a.add(n),null==l&&(l={...e}),l[n]=(l[n]??0)+1)}return l??e}function e0p(e){if(!e||"object"!=typeof e)return null;let t=e.order_id??e.id??e.key;return null==t||""===t?null:"string"==typeof t||"number"==typeof t?t:String(t)}class e0m extends ey().Component{static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){}render(){return this.state.hasError?(0,ev.jsxs)("div",{style:{padding:24,border:"1px dashed #e5e7eb",borderRadius:8,background:"#fafafa",color:"#6b7280",fontSize:13,lineHeight:1.6},children:[(0,ev.jsx)("div",{style:{fontWeight:600,color:"#111827",marginBottom:4},children:eN.getText("pisell-global-search.order-result-unavailable.title")}),(0,ev.jsx)("div",{children:eN.getText("pisell-global-search.order-result-unavailable.description")})]}):this.props.children}constructor(e){super(e),this.state={hasError:!1}}}let e0g=e=>{let{items:t,loading:l,keyword:a,detailRefreshVersions:i={}}=e,n=t.map(e=>({item:e,id:eXm(e)})).filter(e=>void 0!==e.id);return l&&0===n.length?(0,ev.jsx)("div",{className:"pisell-global-search-order-business__status",children:(0,ev.jsx)(ex.Spin,{})}):a&&0===n.length?(0,ev.jsx)("div",{className:"pisell-global-search-order-business__status pisell-global-search__empty",children:eN.getText("pisell-global-search.empty")}):0===n.length?null:(0,ev.jsx)("div",{className:"pisell-global-search-order-business",children:n.map(e=>{let{item:t,id:l}=e,a=e0c(i,"order",l),n=`global-search-business-detail-${l}`;return(0,ev.jsx)("div",{className:"pisell-global-search-order-business__item",children:(0,ev.jsx)(e0m,{children:(0,ev.jsx)(eXn,{refreshVersion:a,renderType:"current",tmpl:"B",variant:"tablet",summaryTwoColumn:!0,osProps:{osKey:n,orderId:Number(l),preloadedSalesDetail:t,autoBootstrap:!0,destroyOnUnmount:!0,syncDetailOnOrderChange:!0}})})},n)})})},e0h=ey().memo(e=>{let{keyword:t}=e,[l,a]=(0,ef.useState)({}),i=(0,ef.useRef)(!1),{items:n,total:s,loading:r,error:o,page:d,hasMore:c,fetchPage:u}=e0d({keyword:t,searchMode:"identifier",perPage:5,subscriberPrefix:"global-search-order-business",onDelta:(0,ef.useCallback)(e=>{a(t=>e0u(t,e))},[])});(0,ef.useEffect)(()=>{a({})},[t]),(0,ef.useEffect)(()=>{r||(i.current=!1)},[r]);let p=(0,ef.useRef)(null),[m,g]=(0,ef.useState)(0);(0,ef.useEffect)(()=>{let e=p.current;if(!e)return;let t=()=>g(e.clientHeight);t();let l=new ResizeObserver(t);return l.observe(e),()=>l.disconnect()},[]);let h=(0,ef.useCallback)(e=>{let{scrollTop:t,clientHeight:l,scrollHeight:a}=e.currentTarget;!r&&!i.current&&c&&a-t-l<360&&(i.current=!0,u(d+1,!0))},[r,c,u,d]),v=r&&0===n.length,f=!!o&&0===n.length,y=!r&&!o&&0===n.length;return(0,ev.jsxs)("div",{ref:p,className:"pisell-global-search-order-business pisell-global-search-order-business--virtual",children:[v&&(0,ev.jsx)("div",{className:"pisell-global-search-order-business__status",children:(0,ev.jsx)(ex.Spin,{})}),!v&&f&&(0,ev.jsx)("div",{className:"pisell-global-search-order-business__status pisell-global-search__empty",children:eN.getText("pisell-global-search.error")}),!v&&!f&&y&&(0,ev.jsx)("div",{className:"pisell-global-search-order-business__status pisell-global-search__empty",children:eN.getText("pisell-global-search.empty")}),n.length>0&&0===m&&(0,ev.jsx)("div",{className:"pisell-global-search-order-business__status",children:(0,ev.jsx)(ex.Spin,{size:"small"})}),n.length>0&&m>0&&(0,ev.jsx)(e0o,{data:n,height:r&&n.length>0?Math.max(m-44,0):m,itemHeight:360,virtual:!0,itemKey:e=>{let t=eXm(e)??e.order_id??"";return`${t}`},onScroll:h,children:e=>{let t=eXm(e),a=e0c(l,"order",t),i=`global-search-business-detail-${t}`;return(0,ev.jsx)("div",{className:"pisell-global-search-order-business__item",style:{marginBottom:6},children:(0,ev.jsx)(e0m,{children:(0,ev.jsx)(eXn,{refreshVersion:a,renderType:"current",tmpl:"B",variant:"tablet",summaryTwoColumn:!0,osProps:{osKey:i,orderId:Number(t),preloadedSalesDetail:e,autoBootstrap:!0,destroyOnUnmount:!0,syncDetailOnOrderChange:!0}})})},i)}}),r&&n.length>0&&(0,ev.jsx)("div",{style:{flex:"0 0 auto",height:44,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,ev.jsx)(ex.Spin,{size:"small"})})]})}),e0v=()=>({filter:{values:{}},sort:"created_at:desc"}),e0f=ey().memo(e=>{var t,l;let{keyword:a,searchMode:i="fuzzy",onAutoOpenUniqueOrderDetail:n,onOpenDetail:s,onRealtimePatchItems:r,previewLimit:o,onReportTotal:d,providerKey:c="order"}=e,u=ik(),p=null==u||null==(l=u.engine)||null==(t=l.props)?void 0:t.locale,m={en:{...eVJ.en,...eWM.en},"zh-CN":{...eVJ["zh-CN"],...eWM["zh-CN"]},"zh-HK":{...eVJ["zh-HK"],...eWM["zh-HK"]}};eN.init(m,p||"en");let[g,h]=(0,ef.useState)(e0v),v=(0,ef.useCallback)(e=>{h(e||{})},[]),f=(0,ef.useCallback)(()=>{h(e0v())},[]),y="number"==typeof o&&o>0,x=y?o:20,b=(0,ef.useMemo)(()=>{var e;return(e=>{let t={};if(!e||"object"!=typeof e)return t;for(let[l,a]of Object.entries(e))if(null!=a&&""!==a&&(!Array.isArray(a)||0!==a.length)){if("orderDate"===l){let[e,l]=Array.isArray(a)?a:[],i={};e&&(i.from=em()(e).startOf("day").format("YYYY-MM-DD HH:mm:ss")),l&&(i.to=em()(l).endOf("day").format("YYYY-MM-DD HH:mm:ss")),(i.from||i.to)&&(t.created_at=i);continue}if("total_amount"===l&&"object"==typeof a&&!Array.isArray(a)){let e={};void 0!==a.min&&null!==a.min&&""!==a.min&&(e.gte=Number(a.min)),void 0!==a.max&&null!==a.max&&""!==a.max&&(e.lte=Number(a.max)),Object.keys(e).length&&(t.total_amount=e);continue}t[l]=a}return t})(null==g||null==(e=g.filter)?void 0:e.values)},[g]),_=(0,ef.useMemo)(()=>(e=>{if(!e||"string"!=typeof e)return;let[t,l]=e.split(":");if(t)return[{field:t,direction:"asc"===l?"asc":"desc"}]})(null==g?void 0:g.sort),[g]),[k,w]=(0,ef.useState)(void 0),{items:j,total:S,loading:M,error:N,page:C,fetchPage:T}=e0d({keyword:a,searchMode:i,perPage:x,filters:b,sort:_,subscriberPrefix:"global-search-order-admin",onDelta:(0,ef.useCallback)(e=>{null==r||r("order",e)},[r])}),P=(0,ef.useMemo)(()=>({pageNumber:C,pageSize:x}),[C,x]),A=(0,ef.useRef)(d);A.current=d,(0,ef.useEffect)(()=>{var e;null==(e=A.current)||e.call(A,c,S)},[S,c]);let D=(0,ef.useRef)(a);(0,ef.useEffect)(()=>{D.current!==a&&(D.current=a,h(e=>{var t;let l=e0v();return e&&e.sort===l.sort&&(null==(t=e.filter)?void 0:t.values)&&0===Object.keys(e.filter.values).length?e:l}))},[a]),(0,ef.useEffect)(()=>{w(void 0)},[a,b,_]);let I=(0,ef.useCallback)(e=>{!y&&e>C&&T(e,!0)},[y,T,C]),E=(0,ef.useMemo)(()=>j.map(e=>{let t=eXm(e);return void 0===t?null:{...e,id:t,order_id:t}}).filter(e=>null!==e),[j]),z=(0,ef.useMemo)(()=>{let e=new Map;return E.forEach(t=>{(null==t?void 0:t.id)!==void 0&&(null==t?void 0:t.id)!==null&&e.set(String(null==t?void 0:t.id),t)}),e},[E]),L=(0,ef.useCallback)((e,t)=>{w(e),null==t||t({providerKey:"order",id:e,record:z.get(String(e))})},[z]),O=(0,ef.useCallback)(e=>{let{orderId:t}=e;L(t,s)},[s,L]),R=(0,ef.useRef)();(0,ef.useEffect)(()=>{if(!n)return;let e=function(e){var t;let{enabled:l,keyword:a,total:i,loading:n,error:s,records:r}=e,o=a.trim();if(!l||!o||n||s||1!==i||1!==r.length)return null;let d=null==(t=r[0])?void 0:t.id;return null==d||""===d?null:{key:JSON.stringify([o,String(d)]),orderId:d}}({enabled:!0,keyword:a,total:S,loading:M,error:N,records:E});e&&R.current!==e.key&&(R.current=e.key,L(e.orderId,n))},[N,a,M,n,L,E,S]);let $=eZk({onOpenDetail:s?O:void 0}),F=(0,ef.useMemo)(()=>{let e=$.getChildComponentProps,t={sale_brief:.7,payment_info:1,payment_method:1.3,order_origin:1.2,last_edit_account:1.2},l=new Set(["payment_method","payment_info","order_origin","last_edit_account"]);return{...$,getChildComponentProps:a=>{let i,n=(e?e(a):$.childComponentProps)||{},s=n.grid||{},r=n.toolBar||{},o=r.filter&&"object"==typeof r.filter?r.filter:{};return{...n,grid:{...s,columns:Array.isArray(i=s.columns)?i.map(e=>{if(!e)return e;let a="number"==typeof e.width?{...e,width:Math.max(Math.round(e.width*(t[e.key]??.8)),88)}:e;if("payment_status"===e.key)return{...a,className:[a.className,"pisell-global-search-col-payment-status"].filter(Boolean).join(" ")};if(l.has(e.key)){let e;return"function"!=typeof(e=a.render)?a:{...a,render:(t,l,a)=>(0,ev.jsx)("div",{className:"pisell-global-search-ellipsis-cell",children:e(t,l,a)})}}return a}):i,infiniteScroll:!0,virtual:!1},toolBar:{...r,search:!1,filter:{...o,defaultFilterValue:{...o.defaultFilterValue||{},quickFilter:[],values:{}}}}}}}},[$]),B=(0,ef.useMemo)(()=>{let e=F.getChildComponentProps;return[{...F,getChildComponentProps:t=>{let l=e?e(t):{},a=l.grid||{},i=a.rowClassName;return{...l,grid:{...a,rowClassName:(e,t,l)=>["function"==typeof i?i(e,t,l):i||"",void 0!==k&&(null==e?void 0:e.id)!=null&&String(e.id)===String(k)?"pisell-global-search-order-row--active":""].filter(Boolean).join(" ")}}}}]},[F,k]),H=p||("u">typeof localStorage?localStorage.getItem("umi_locale"):null)||"en-US";return(0,ev.jsx)(e0m,{children:(0,ev.jsx)(lL.PisellConfigProvider,{locale:"zh"===H?"zh-CN":H,children:(0,ev.jsx)(ej8,{dateAdapter:eSy,adapterLocale:"zh-CN"===p||"zh-HK"===p?"zh-cn":"en"===p||"en-US"===p?"en":"zh-cn",children:(0,ev.jsx)("div",{className:"pisell-global-search-order-table",children:N&&0===j.length&&!M?(0,ev.jsx)("div",{className:"pisell-global-search-order-business__status pisell-global-search__empty",children:eN.getText("pisell-global-search.error")}):(0,ev.jsx)(eV4,{perspectives:B,currentPerspective:"handle",data:E,loading:M,total:S,pagination:P,onPageChange:I,searchParams:g,onSearch:v,onReset:f,rowKey:"id"})})})})})});e0f.displayName="OrderAdminGrid";let e0y={key:"order",label:{en:"Sales","zh-CN":"订单","zh-HK":"訂單",ja:"売上",pt:"Vendas"},order:20,search:async e=>{let{keyword:t,signal:l,mode:a,pageSize:i,scope:n,onRealtimePatch:s,realtimeSubscriberId:r,onRealtimeCleanup:o}=e,d=(t??"").trim(),c="admin"===a?"fuzzy":"identifier";if(!d)return{list:[],total:0};let u="all"===n?eXc:eXd;if("business"===a){if("single"===n)return{list:[],total:0};let e=function(e){if("all"===e.scope&&"business"===e.mode)return e.id}({scope:n,mode:a,id:r});e&&(null==o||o(()=>{eXp(e)}));let t=await u({keyword:d,searchMode:c,perPage:i??20,signal:l,subscriberId:e,resetVisibleOrderIds:!0,callback:e?e=>{let t=eXg(e);t.length,t.map(e=>(null==e?void 0:e.order_id)??(null==e?void 0:e.id)??(null==e?void 0:e.key)),t.length>0&&(null==s||s(t))}:void 0});return{list:t.items,total:t.total}}return{list:[],total:0}},renderItem:e=>(0,ev.jsxs)("div",{style:{padding:6},children:[(0,ev.jsx)("div",{style:{fontWeight:600},children:e.shop_order_number||e.order_number||e.order_id}),e.customer_name&&(0,ev.jsx)("div",{style:{fontSize:12,color:"#6b7280"},children:e.customer_name})]}),renderResults:(e,t)=>{let{state:l,keyword:a,mode:i,layout:n}=e;return"business"===i?"single"===n?(0,ev.jsx)(e0h,{keyword:a}):(0,ev.jsx)(e0g,{items:l.list,loading:l.loading,keyword:a,detailRefreshVersions:t.detailRefreshVersions}):(0,ev.jsx)(e0f,{keyword:a,searchMode:t.searchMode,providerKey:"order",onAutoOpenUniqueOrderDetail:t.onAutoOpenUniqueOrderDetail,onOpenDetail:t.onOpenDetail,onRealtimePatchItems:t.onRealtimePatchItems,onReportTotal:t.onReportTotal,previewLimit:"grouped"===n?5:void 0})}},e0x=[e0y],e0b=e=>{var t,l,a,i,n,s,r,o,d;let{placeholder:c,providers:u,permissionContext:p,navigate:m,showModeSwitch:g=!0,modeOptions:h,allModePageSize:v=5,singleModePageSize:f=20,enableScanner:y=!0,historyKey:x="pisell_global_search_history",maxHistoryCount:b=10,variant:_,className:k,style:w}=e,j=ik(),S=eZ5(null==(t=eN.getLocale)?void 0:t.call(eN));eN.init(eZ6,S),(null==j||null==(a=j.appHelper)||null==(l=a.utils)?void 0:l.request)&&(z_.Em.setRequest(j.appHelper.utils.request),eV$=eVR(j.appHelper.utils.isWebPos));let M=(0,ef.useMemo)(()=>Array.isArray(u)&&u.length>0?u:e0x,[u]),N=(0,ef.useMemo)(()=>[...M.filter(e=>e&&e.enabledWhen?e.enabledWhen(p??{}):!!e)].sort((e,t)=>(e.order??Number.MAX_SAFE_INTEGER)-(t.order??Number.MAX_SAFE_INTEGER)),[M,p]),[C,T]=(0,ef.useState)(""),[P,A]=(0,ef.useState)({keyword:"",searchMode:"fuzzy"}),{keyword:D,searchMode:I}=P,E="phone"===_||"smallTablet"===_||"tablet"===_,[z,L]=(0,ef.useState)(null),O=(0,ef.useRef)({}),[R,$]=(0,ef.useState)({}),F=(0,ef.useCallback)(e=>{let{providerKey:t,id:l,record:a}=e;null!=l&&""!==l&&L({providerKey:t,id:l,record:a})},[]),B=(0,ef.useCallback)(e=>{var t,l,a;let{providerKey:i,id:n,record:s}=e;E?null==j||null==(a=j.appHelper)||null==(l=a.utils)||null==(t=l.action)||t.call(l,{type:"pisell1.handleOpenSaleDetail",data:{osProps:{orderId:n,osKey:"sales-management-item-detail",syncDetailOnOrderChange:!0}}}):F({providerKey:i,id:n,record:s})},[null==j||null==(n=j.appHelper)||null==(i=n.utils)?void 0:i.action,F,E]),H=E&&"function"!=typeof(null==j||null==(r=j.appHelper)||null==(s=r.utils)?void 0:s.action)?void 0:B,q=E?void 0:F;(0,ef.useEffect)(()=>{L(null),O.current={},$({})},[D]);let V=(0,ef.useCallback)((e,t)=>{"order"===e&&(L(e=>{if(!e||"order"!==e.providerKey)return e;let l=Array.isArray(t)?t.find(t=>String((null==t?void 0:t.order_id)??(null==t?void 0:t.id)??(null==t?void 0:t.key))===String(e.id)):void 0;if(!l)return e;let a=e.record&&"object"==typeof e.record?e.record:{};return{...e,record:{...a,...l}}}),$(e=>{let l=Array.isArray(t)&&0!==t.length?t.reduce((e,t)=>{let l=e0p(t);return null==l||(e[String(l)]=function e(t){return Array.isArray(t)?`[${t.map(e).join(",")}]`:t&&"object"==typeof t?`{${Object.keys(t).sort().map(l=>`${JSON.stringify(l)}:${e(t[l])}`).join(",")}}`:JSON.stringify(t)}(t)),e},{}):{},a={...O.current},i=Object.entries(l).filter(e=>{let[t,l]=e;return a[t]!==l}).map(e=>{let[t,l]=e;return a[t]=l,t});return O.current=a,e0u(e,Array.isArray(t)?t.filter(e=>i.includes(String((null==e?void 0:e.order_id)??(null==e?void 0:e.id)??(null==e?void 0:e.key)))):[])}))},[]),{rightWidth:Y,containerRef:U,onResizerMouseDown:W,resizing:G}=eZ1({initialRatio:.36}),Q="admin",K=N.length>=1,[J,Z]=(0,ef.useState)(K?eZ0:(null==(o=N[0])?void 0:o.key)??eZ0),X=K||J!==eZ0?J:(null==(d=N[0])?void 0:d.key)??eZ0,{stateMap:ee,reportProviderTotal:et}=eZ3({keyword:D,activeTab:X,providers:N,allModePageSize:v,singleModePageSize:f,mode:Q,onRealtimePatchItems:V}),el=(0,ef.useCallback)((e,t)=>{A({keyword:(e??C).trim(),searchMode:(null==t?void 0:t.source)==="scan"?"identifier":"fuzzy"})},[C]),ea=(0,ef.useMemo)(()=>[{label:(null==h?void 0:h.admin)?eZ9(h.admin,S):eZ7("pisell-global-search.mode.admin"),value:"admin"}],[h,S]),ei=(0,ef.useMemo)(()=>{let e=N.map(e=>({value:e.key,label:(0,ev.jsxs)("span",{className:"pisell-global-search-scope-bar__option",children:[e.icon,eZ9(e.label,S)]})}));return K&&e.unshift({value:eZ0,label:(0,ev.jsx)("span",{className:"pisell-global-search-scope-bar__option",children:eZ7("pisell-global-search.tab.all")})}),e},[N,K,S]),en=X===eZ0,es=(0,ef.useCallback)(()=>{},[]),er=(0,ef.useMemo)(()=>{if(!D||en)return!1;let e=N.find(e=>e.key===X);return!!(null==e?void 0:e.renderResults)},[D,en,N,X]),eo=!E&&!!D;return(0,ev.jsxs)("div",{className:`pisell-global-search-fp pisell-global-search-fp--${_||"desktop"} ${k??""}`.trim(),style:w,children:[(0,ev.jsxs)("section",{className:"pisell-global-search-fp__search-panel",children:[(0,ev.jsxs)("div",{className:"pisell-global-search-fp__search-row",children:[(0,ev.jsx)(eZX,{className:"pisell-global-search-fp__find",displayType:"inline",enableScanner:y,size:"phone"===_?"small":void 0,showHistory:!0,historyKey:x,maxHistoryCount:b,placeholder:c??eZ7("pisell-global-search.placeholder"),confirmButtonText:eZ7("pisell-global-search.search"),value:C,onChange:T,onSearch:(e,t)=>el(e,t)}),g&&ea.length>1&&(0,ev.jsx)("div",{className:"pisell-global-search-fp__mode-switch",children:(0,ev.jsx)(ex.Segmented,{options:ea,value:Q})})]}),(0,ev.jsx)(eXl,{options:ei,value:X,onChange:e=>Z(e)})]}),(0,ev.jsxs)("div",{className:`pisell-global-search-fp__body${G?" pisell-global-search-fp__body--resizing":""}`,ref:U,children:[(0,ev.jsx)("main",{className:`pisell-global-search-fp__main${er?" pisell-global-search-fp__main--bare":""}`,children:(()=>{if(!D)return(0,ev.jsx)("div",{className:"pisell-global-search-fp__empty",children:eZ7("pisell-global-search.empty.idle")});if(en)return(0,ev.jsx)(eXe,{providers:N,stateMap:ee,keyword:D,mode:Q,searchMode:I,locale:S,onJumpTab:e=>Z(e),onClose:es,navigate:m,onAutoOpenUniqueOrderDetail:H,onOpenDetail:q,onRealtimePatchItems:V,detailRefreshVersions:R,onReportTotal:et});let e=N.find(e=>e.key===X);if(!e)return null;let t=ee[e.key]??{loading:!1,list:[],total:0};return(0,ev.jsx)(eXt,{provider:e,state:t,keyword:D,mode:Q,searchMode:I,onClose:es,navigate:m,onAutoOpenUniqueOrderDetail:H,onOpenDetail:q,onRealtimePatchItems:V,detailRefreshVersions:R,onReportTotal:et})})()}),eo&&(0,ev.jsxs)(ev.Fragment,{children:[(0,ev.jsx)("div",{className:"pisell-global-search-fp__resizer",onMouseDown:W,role:"separator","aria-orientation":"vertical"}),(0,ev.jsx)("aside",{className:"pisell-global-search-fp__detail",style:{flex:`0 0 ${Y}`,width:Y},children:(()=>{if(!z)return(0,ev.jsx)("div",{className:"pisell-global-search-fp__detail-idle",children:eZ7("pisell-global-search.detail.idle")});if("order"===z.providerKey){let e=e0c(R,"order",z.id),t=`global-search-order-detail-${z.id}`;return(0,ev.jsx)(eXn,{refreshVersion:e,renderType:"current",tmpl:"B",variant:"tablet",summaryTwoColumn:!0,osProps:{osKey:t,orderId:Number(z.id),preloadedSalesDetail:z.record&&"object"==typeof z.record?z.record:void 0,autoBootstrap:!0,destroyOnUnmount:!0,syncDetailOnOrderChange:!0}},t)}return null})()})]})]})]})};e0b.displayName="PisellGlobalSearchFullPage";let e0_=iW(e0b);em().extend(eu()),em().extend(eh())})(),n})());
|