PageSourceSearch

https://www.exploremaricopacountyparks.org/_next/static/chunks/pag…/[orderID]/receipt-6395ee7d8880206c.js

js exploremaricopacountyparks.org collected 2026-10-10 01:00:50 UTC 6,967 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7956],{14651:(e,r,i)=>{"use strict";i.d(r,{C:()=>u});var l=i(78488),a=i(48339),n=i(81204),t=i(63378),s=i(49191),d=i(25260),o=i(9917),c=i(23764);function u(e){var r;let{orderId:i,variant:u="secondary",size:f="md",className:p,onPrintSuccess:m}=e,[x,y]=(0,n.useState)(!1),{isConnected:v,isPrinting:g,print:h,tryReconnect:w,disconnect:j}=(0,d.C)(),{settings:N}=(0,s.Z5)(),_=(0,t.qN)(),b=(0,t.xN)(),E=null==N?void 0:N.defaultReceiptPrinterType,P=null!=(r=null==N?void 0:N.enableQzTrayPrinting)&&r;async function R(){try{await h(i),b("Receipt printed successfully"),m&&m()}catch(e){_("Failed to print receipt: ".concat(e instanceof Error?e.message:String(e))),await j(),y(!0)}}async function S(){if(v||await (0,o.z)(E,w,P))return void await R();y(!0)}let C="primary"===u?a.nO.Primary:a.nO.Secondary;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(C,{onClick:S,loading:g,size:"sm"===f?"sm":"default",className:p,children:"Print receipt"}),(0,l.jsx)(c.V,{open:x,onClose:function(){y(!1)}})]})}},16604:(e,r,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/[org]/manager/point-of-sale/orders/[orderID]/receipt",function(){return i(34741)}])},34741:(e,r,i)=>{"use strict";i.r(r),i.d(r,{default:()=>b});var l=i(78488),a=i(48339),n=i(44070),t=i(17563),s=i(81204),d=i(33237),o=i(72788),c=i(10427),u=i(94621),f=i(14651),p=i(12428),m=i(63378),x=i(83348),y=i(49191),v=i(25260),g=i(37650),h=i(24846),w=i(9917),j=i(5800),N=i(50801);let _=()=>{var e,r,i,u,_,b;let{getColor:E}=(0,a.wR)(),P=(0,t.useRouter)(),R=(0,j.HF)(P.query,"orderID"),S=(0,y.Z5)(),C=(0,m.qN)(),O=(0,m.xN)(),I=(0,d.mN)({defaultValues:{email_address:""}}),{register:k,formState:{errors:A},handleSubmit:D}=I,{data:q,loading:z}=(0,o.yZJ)({variables:{id:R},onError:e=>{h.A.error(e),C(e.message)},onCompleted(e){var r,i;(null==(i=e.order)||null==(r=i.user)?void 0:r.email)&&I.reset({email_address:I.getValues().email_address||e.order.user.email})}}),F=null==q?void 0:q.order,L=(null==(e=S.settings)?void 0:e.enableReceiptPrinting)===!0&&(null==(r=S.settings)?void 0:r.autoPrintReceiptOnComplete)===!0,{status:T}=function(e){let{orderId:r,enabled:i,preferredPrinterType:l,qzTrayEnabled:a}=e,[n,t]=(0,s.useState)("idle"),d=(0,s.useRef)(null),{tryReconnect:o,print:c,disconnect:u}=(0,v.C)(),f=(0,m.xN)(),p=(0,m.qN)(),x=(0,s.useCallback)(async e=>{if(t("printing"),!await (0,w.z)(l,o,a))return void t("failed");try{await c(e),t("success"),f("Receipt printed automatically")}catch(r){await u(),h.A.error("Auto-print failed",{error:r,orderId:e}),p("Auto-print failed — use the options below"),t("failed")}},[o,c,u,f,p,l,a]);return(0,s.useEffect)(()=>{i&&r&&d.current!==r&&(d.current=r,x(r))},[i,r,x]),{status:n}}({orderId:F?R:void 0,enabled:L,preferredPrinterType:null==(i=S.settings)?void 0:i.defaultReceiptPrinterType,qzTrayEnabled:null!=(b=null==(u=S.settings)?void 0:u.enableQzTrayPrinting)&&b}),[V,{loading:W}]=(0,o.ZUb)(),{generateReceipt:B,loading:U}=(0,x.W)({orderId:R,action:x.f.VIEW});if(z)return(0,l.jsx)("div",{className:"flex h-full justify-center",children:(0,l.jsx)(c.A,{})});if(!F)return(0,l.jsx)("div",{className:"flex h-full justify-center",children:(0,l.jsx)(a.Bq,{summary:"Order not found",details:"Start a new sale to continue",action:(0,l.jsx)(a.vx.Primary,{href:(0,N.PL)(S.slug,"/manager/point-of-sale/terminal"),children:"Start new sale"})})});let Y=L?"failed"===T:(null==(_=S.settings)?void 0:_.enableReceiptPrinting)===!0;return(0,l.jsx)("div",{className:"bg-surface-primary flex flex-row justify-around space-x-24",style:{backgroundColor:E("surface","primary")},children:(0,l.jsx)("div",{children:(0,l.jsxs)("div",{className:"flex max-h-[400px] w-[800px] flex-grow flex-col space-y-14",children:[(0,l.jsxs)("div",{className:"flex flex-col items-center space-y-2",children:[(0,l.jsx)(n.A,{className:"text-success",sx:{fontSize:"48px"},children:"Payment Successful"}),(0,l.jsx)(a.EY.TitleLarge,{children:"Payment Successful"}),"printing"===T&&(0,l.jsx)(a.EY.BodySmall,{color:"secondary",children:"Printing receipt…"}),"success"===T&&(0,l.jsx)(a.EY.BodySmall,{color:"secondary",children:"Receipt printed successfully"})]}),(!L||"failed"===T)&&(0,l.jsx)("form",{onSubmit:D(async e=>{var r,i,l,a,n,t,s,d;let o=await V({variables:{organization_id:S.organizationID,order_id:R,email_addresses:[e.email_address]}});(null==(i=o.data)||null==(r=i.sendReceiptEmail)?void 0:r.ok)&&!((null!=(a=null==(l=o.errors)?void 0:l.length)?a:0)>0)?O((null==(d=o.data)||null==(s=d.sendReceiptEmail)?void 0:s.message)||"Receipt sent"):C((null==(t=o.data)||null==(n=t.sendReceiptEmail)?void 0:n.error)||"Could not send receipt")}),children:(0,l.jsx)(d.Op,{...I,children:(0,l.jsxs)("div",{className:"space-y-6",children:[(0,l.jsx)(a.EY.BodySmallSemiBold,{children:"Email receipt"}),(0,l.jsxs)("div",{className:"flex flex-row items-center gap-4",children:[(0,l.jsx)(p.A,{label:"Email",required:!0,registration:k("email_address",{required:g.q5}),error:A.email_address,fieldProps:{fullWidth:!0,variant:"outlined"}}
1),(0,l.jsx)(a.nO.Secondary,{type:"submit",loading:W,children:"Send"})]})]})})}),(0,l.jsxs)("div",{className:"flex flex-row justify-between space-x-4",children:[(0,l.jsxs)("div",{className:"flex flex-row space-x-4",children:[(0,l.jsx)(a.nO.Secondary,{onClick:()=>B(),loading:U,children:"View receipt"}),Y&&(0,l.jsx)(f.C,{orderId:R,variant:"secondary"})]}),(0,l.jsx)(a.vx.Primary,{href:(0,N.PL)(S.slug,"/manager/point-of-sale/terminal"),children:"Done"})]})]})})})};_.PageLayout=u.A;let b=_},83348:(e,r,i)=>{"use strict";i.d(r,{W:()=>c,f:()=>o});var l=i(72788),a=i(1599),n=i(54971),t=i(24846),s=i(63378);let d="Error downloading receipt. Please contact an administrator if this issue persists.";var o=function(e){return e.DOWNLOAD="download",e.VIEW="view",e}({});function c(e){let{orderId:r,action:i,onSuccess:o,onError:c}=e,u=(0,s.xN)(),f=(0,s.qN)(),[p,{loading:m}]=(0,l.One)({variables:{order_id:r},onCompleted:e=>{var l,a;if(!(null==(l=e.downloadReceiptForOrderId)?void 0:l.pdf_data)){t.A.error("Error downloading PDF receipt for order ID ".concat(r,": No PDF data returned"),e),f(d),null==c||c();return}let s=e.downloadReceiptForOrderId.pdf_data,p=null!=(a=e.downloadReceiptForOrderId.file_name)?a:"receipt.pdf",m=(0,n.i)(s,"application/pdf"),x=URL.createObjectURL(m);if("download"===i){let e=document.createElement("a");e.href=x,e.download=p,document.body.appendChild(e),e.click(),document.body.removeChild(e),URL.revokeObjectURL(x),u("Receipt downloaded successfully")}else"view"===i&&window.open(x,"_blank");null==o||o()},onError:e=>{t.A.error("Error downloading PDF receipt for order ID ".concat(r,": ").concat(e.message),e),f(d),null==c||c()},...a.D});return{generateReceipt:p,loading:m}}},94621:(e,r,i)=>{"use strict";i.d(r,{A:()=>a});var l=i(78488);function a(e){let{children:r}=e;return(0,l.jsx)("div",{className:"mx-auto my-[200px] max-w-[1208px] px-8",children:r})}i(81204)}},e=>{e.O(0,[3661,6055,636,6593,8792],()=>e(e.s=16604)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.