PageSourceSearch

https://slive.ai/_next/static/chunks/84826-58a8fc03fe11ca7d.js

js slive.ai collected 2026-10-05 12:40:14 UTC 24,299 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[84826],{7250:(e,t,r)=>{r.d(t,{EQ:()=>d,Ay:()=>c,to:()=>p});var a=r(95155),l=r(12115),s=r(29722);r(5772);var n=r(50910),i=r(64484),o=r(43629),u=r(16639);function c({json:e,variables:t}){let r=(0,n.c)("applications.pos.tickets_designer"),[h,m]=(0,l.useState)("preview"),N=(0,l.useMemo)(()=>p(e),[e]);return e?.sequence&&0!==e.sequence.length?(0,a.jsx)("div",{children:(0,a.jsxs)(o.Tabs,{onValueChange:m,defaultValue:h,children:[(0,a.jsxs)(o.TabsList,{className:"w-full flex justify-between items-center mb-4 bg-transparent",children:[(0,a.jsx)("span",{}),(0,a.jsxs)("div",{className:"space-x-4",children:[(0,a.jsx)(u.Xi,{className:"preview"===h?"text-primary font-bold":"",value:"preview",children:r("designer.tabs.preview",{default:"Preview"})}),(0,a.jsx)(u.Xi,{className:"code"===h?"text-primary font-bold":"text-muted-foreground text-xs",value:"code",children:r("designer.tabs.code",{default:"Code"})})]})]}),(0,a.jsx)(o.TabsContent,{value:"preview",children:(0,a.jsx)(i.A,{lines:N,variables:t})}),(0,a.jsx)(o.TabsContent,{value:"code",children:(0,a.jsxs)("div",{className:"relative h-[600px] bg-muted border overflow-visible",children:[(0,a.jsx)(d,{position:"top"}),(0,a.jsx)("pre",{className:"font-mono text-sm leading-5 bg-muted p-4 h-full overflow-auto m-0 border-none rounded-none",children:N.map((e,t)=>{if("image"===e.type)return(0,a.jsx)("div",{className:(0,s.A)("relative h-16 whitespace-pre-wrap flex justify-start",e.cls),children:(0,a.jsx)("img",{src:e.url||"/Images/placeholder.svg",alt:"Logo/Image",width:96,height:96,className:"object-contain"})},t);if("table"===e.type){let r=e.table?.columns||[],l=e.table?.rows||[];return(0,a.jsx)("div",{className:(0,s.A)("whitespace-pre-wrap",e.cls,"overflow-x-auto"),children:(0,a.jsxs)("table",{className:"w-full table-fixed border border-border text-xs",children:[(0,a.jsx)("colgroup",{children:r.map((e,t)=>(0,a.jsx)("col",{style:{width:`${100/r.length}%`}},t))}),(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:r.map((e,t)=>(0,a.jsx)("th",{className:"border px-2 py-1 bg-muted truncate",children:e},t))})}),(0,a.jsx)("tbody",{children:l.map((e,t)=>(0,a.jsx)("tr",{children:e.map((e,t)=>(0,a.jsx)("td",{className:"border px-2 py-1 truncate max-w-[1px]",children:e},t))},t))})]})},t)}return"barcode"===e.type?(0,a.jsxs)("div",{className:(0,s.A)("whitespace-pre-wrap",e.cls),children:["Barcode Value: ",e.code||e.text]},t):"qr"===e.type?(0,a.jsxs)("div",{className:(0,s.A)("whitespace-pre-wrap",e.cls),children:["QR Code Value: ",e.data||e.text]},t):"separator"===e.type?""==e.txt?(0,a.jsx)("div",{className:(0,s.A)("whitespace-pre-wrap",e.cls),children:(0,a.jsx)("p",{children:" "})},t):(0,a.jsx)("div",{children:(0,a.jsx)(f,{text:e.txt,className:e.cls})},t):(0,a.jsx)("div",{className:(0,s.A)("whitespace-pre-wrap",e.cls),children:e.txt},t)})}),(0,a.jsx)(d,{position:"bottom"})]})})]})}):(0,a.jsxs)("div",{className:"relative flex flex-col items-center justify-center h-[600px] bg-muted border overflow-visible text-muted-foreground text-center p-8",children:[(0,a.jsx)(d,{position:"top"}),(0,a.jsx)("span",{className:"text-lg font-semibold mb-2",children:r("designer.preview_empty_title",{default:"No preview yet"})}),(0,a.jsx)("span",{className:"mb-2",children:r("designer.preview_empty_description",{default:"Add blocks to your ticket to see a live preview here."})}),(0,a.jsx)("span",{className:"text-sm",children:r("designer.preview_empty_hint",{default:"Your changes will appear instantly as you design your ticket."})}),(0,a.jsx)(d,{position:"bottom"})]})}function d({position:e}){return(0,a.jsx)("svg",{className:`absolute left-0 w-full h-2 ${"top"===e?"top-0":"bottom-0"}`,viewBox:"0 0 100 2",preserveAspectRatio:"none","aria-hidden":"true",focusable:"false",style:{zIndex:2},children:(0,a.jsx)("polygon",{points:"0,2 1,0 2,2 3,0 4,2 5,0 6,2 7,0 8,2 9,0 10,2 11,0 12,2 13,0 14,2 15,0 16,2 17,0 18,2 19,0 20,2 21,0 22,2 23,0 24,2 25,0 26,2 27,0 28,2 29,0 30,2 31,0 32,2 33,0 34,2 35,0 36,2 37,0 38,2 39,0 40,2 41,0 42,2 43,0 44,2 45,0 46,2 47,0 48,2 49,0 50,2 51,0 52,2 53,0 54,2 55,0 56,2 57,0 58,2 59,0 60,2 61,0 62,2 63,0 64,2 
165,0 66,2 67,0 68,2 69,0 70,2 71,0 72,2 73,0 74,2 75,0 76,2 77,0 78,2 79,0 80,2 81,0 82,2 83,0 84,2 85,0 86,2 87,0 88,2 89,0 90,2 91,0 92,2 93,0 94,2 95,0 96,2 97,0 98,2 99,0 100,2",fill:"#e5e7eb"})})}function p({sequence:e=[]}){return e.flatMap(e=>{let t=function(e={},t){let r=[];switch(e.fontSize){case"SMALL":r.push("text-xs");break;case"MEDIUM":r.push("text-base");break;case"LARGE":r.push("text-lg");break;case"EXTRA_LARGE":r.push("text-xl")}return"BOLD"===e.fontWeight?r.push("font-bold"):"NORMAL"===e.fontWeight&&r.push("font-normal"),"CENTER"===e.textAlign&&1!==t?r.push("text-center"):"RIGHT"===e.textAlign&&1!==t?r.push("text-right"):"LEFT"===e.textAlign&&1!==t&&r.push("text-left"),"CENTER"===e.textAlign&&1===t?r.push("justify-center"):"RIGHT"===e.textAlign&&1===t?r.push("justify-end"):"LEFT"===e.textAlign&&1===t&&r.push("justify-start"),4!==t&&("BLOCK_TWO"===e.blockType?r.push("grid","grid-cols-2","gap-2"):"BLOCK_THREE"===e.blockType&&r.push("grid","grid-cols-3","gap-2")),r.join(" ")}(e.style,e.type);switch(e.type){case 0:case"text":return[{type:"text",txt:e.value,cls:t}];case 1:case"logo":return[{type:"image",width:e.style?.width||10,height:e.style?.height||10,url:e.imageUrl,cls:t}];case 2:case"code":return[{type:"barcode",text:`Barcode: ${e.value}`,code:e.value,format:e.format,cls:t}];case 3:case"qr":return[{type:"qr",text:`QR: ${e.value}`,data:e.value,cls:t}];case 4:return[{type:"table",table:{columns:e.table?.columns??[],rows:e.table?.rows??[],dataSource:e.table?.dataSource},cls:t}];case 5:case"cut":return[{type:"cut",txt:"――――――――――――――――― CUT ―――――――――――――――――",cls:"text-center text-xs font-bold text-destructive"}];case 6:return[{type:"partial_cut",txt:"――――――――――――― PARTIAL CUT ―――――――――――――",cls:"text-center text-xs font-bold text-destructive"}];case 7:return[{type:"separator",txt:e.value??"—————",cls:t}];default:return[]}})}let f=({text:e,className:t})=>{let{repeatedText:r,containerRef:n}=(e=>{let[t,r]=(0,l.useState)(""),a=(0,l.useRef)(null),s=(0,l.useRef)(null);return(0,l.useEffect)(()=>{if("u"<typeof document)return;let t=()=>{if(a.current&&s.current){let t=a.current.offsetWidth,l=s.current.offsetWidth;l>0&&r(Array(Math.ceil(t/l)).fill(e).join(" "))}},l=document.createElement("span");return l.style.visibility="hidden",l.style.position="absolute",l.style.whiteSpace="nowrap",l.innerText=e,document.body.appendChild(l),s.current=l,t(),window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t),l&&l.parentNode===document.body&&document.body.removeChild(l),s.current===l&&(s.current=null)}},[e]),{repeatedText:t,containerRef:a}})(e);return(0,a.jsx)("div",{ref:n,className:(0,s.A)("whitespace-nowrap overflow-hidden",t),children:r})}},8983:(e,t,r)=>{r.d(t,{B6:()=>N,B_:()=>v,H:()=>n,JI:()=>k,Jf:()=>u,LH:()=>S,M7:()=>o,Mm:()=>x,Pg:()=>A,Qs:()=>W,TO:()=>_,Tj:()=>j,Ur:()=>z,Vl:()=>g,XQ:()=>M,Xn:()=>a,ZY:()=>l,_F:()=>E,_X:()=>y,aw:()=>m,e5:()=>H,hA:()=>U,kP:()=>q,mL:()=>F,md:()=>R,oP:()=>B,rC:()=>s,sf:()=>O,sm:()=>h,tL:()=>w,tm:()=>K,tq:()=>C,uA:()=>I,v2:()=>f,vZ:()=>L,wF:()=>i,wo:()=>p});let a=1e3,l=Object.freeze([{value:"1",i18nKey:"daily"},{value:"2",i18nKey:"monthly"},{value:"3",i18nKey:"yearly"}]),s="2",n={RETAIL_CLASIC_LEFT:0,RETAIL_CLASIC_RIGHT:1,RETAIL_MODERN_LEFT:2,RETAIL_MODERN_RIGHT:3,SELFCHECK:4},i=Object.freeze({NONE:0,LOOKUP_ITEM:1,ADD_ITEM:2,REMOVE_ITEM:3,CLEAR_TRANSACTION:4,ITEM_DISCOUNT:5,TRANSACTION_DISCOUNT:6,SUBTOTAL:7,PAY:8,CASH_PAYMENT:9,VOID_PAYMENT:10,PRINT_RECEIPT:11,EMAIL_RECEIPT:12,FINALIZE_SALE:13,RETURN_REFUND:14,OPEN_CASH_DRAWER:15,HOLD_TRANSACTION:16,USE_SCALE:17,PRICE:18,QR:19,CUSTOM_BUTTON_LINK:20,CUSTOM_BUTTON_APK:21,CUSTOM_BUTTON_EXT:22,LIMIT_AMOUNT_ALERT:23,SUSPEND_TRANSACTION:24,VPAY:25,QUANTITY_MULTIPLIER:26,PRINT_X_REPORT:27,PRINT_Z_REPORT:28,COUPON:29,REPRINT_DOCUMENT:30,PRINT_PENDING_DOCUMENT:31,IMPORT_QUOTATION:32,PARTIAL_WITHDRAWAL:33,CASH_CLOSE:34,LOAD_ON_HOLD:35,CANCEL_RETURN:36,PROCEED_REFUND:37,REMOVE_LIMIT_AMOUNT:38}),o=Object.freeze({NONE:0,CART:1,PAYMENT:2}),u=Object.freeze({NONE:0,FINGERPRINT:1,PIN:2,PASSWORD:3}),c=Object.freeze([u.PASSWORD]),d=Object.freeze({[u.NONE]:"authMethodNone",[u.PASSWORD]:"authMethodPassword",[u.FINGERPRINT]:"authMethodFingerprint",[u.PIN]:"authMethodPIN"});function p(e){return[u.NONE,...c].map(t=>({id:t,label:e(d[t])}))}let f=Object.freeze(new Set([i.LOOKUP_ITEM,i.CLEAR_TRANSACTION,i.FINALIZE_SALE,i.REMOVE_ITEM])),h=e=>f.has(Number(e));function m(e){if(!e)return null;let t=e=>new Set((e??[]).map(e=>i[e]).filter(e=>void 0!==e)),r=t(e.allowedButtonActions),a=t(e.buttonsRequiringAuth),l=e.paymentRules??{};return{allows:e=>r.has(Number(e)),requiresAuth:e=>a.has(Number(e)),allowsPaymentMethod:e=>{let t=l.blockMethodsAllowingChange&&e?.allowsChange,r=l.requireAutoDeclarationOrTerminal&&e?.isAutoDeclaration!==!0&&!U(e);return!t&&!r},allowsPayoutSelection:()=>!0!==l.blockMethodsAllowingChange}}function N(e=[],t,r=[]){if(null==t)return e;let a=new Map;
1r.forEach(e=>(e?.paymentMethods??[]).forEach(e=>{e?.code!=null&&a.set(e.code,e),e?.id!=null&&a.set(e.id,e)}));let l=!1,s=e.map(e=>{let r=e?.paymentMethods??[],s=r.filter(e=>{let r=a.get(e);return null==r||t.allowsPaymentMethod(r)});return s.length===r.length?e:(l=!0,{...e,paymentMethods:s})});return l?s:e}function x(e=[]){for(let t of e){let e=(t?.authMethods??[]).map(Number).filter(e=>e!==u.NONE),r=(t?.roles??[]).length>0;if(e.length>0&&!r)return{reason:"authMethodRequiresRoles",row:t};if(r&&0===e.length)return{reason:"rolesRequireAuthMethod",row:t}}return null}function E(e=[],t=null){if(!t)return null;for(let r of e){if(!r?.active)continue;if(!t.allows(r.action))return{reason:"buttonNotAllowedInSelfCheckout",row:r};if(!t.requiresAuth(r.action))continue;let e=(r.authMethods??[]).map(Number).includes(u.PASSWORD),a=(r.roles??[]).length>0;if(!e||!a)return{reason:"buttonRequiresAuthInSelfCheckout",row:r}}return null}let T=Object.freeze(new Set([i.CUSTOM_BUTTON_LINK,i.CUSTOM_BUTTON_APK,i.CUSTOM_BUTTON_EXT])),b=Object.freeze({[i.LOOKUP_ITEM]:"lookup_item",[i.ADD_ITEM]:"add_item",[i.REMOVE_ITEM]:"remove_item",[i.CLEAR_TRANSACTION]:"clear_transaction",[i.ITEM_DISCOUNT]:"item_discount",[i.TRANSACTION_DISCOUNT]:"transaction_discount",[i.FINALIZE_SALE]:"finalize_sale",[i.RETURN_REFUND]:"return_refund",[i.OPEN_CASH_DRAWER]:"open_cash_drawer",[i.HOLD_TRANSACTION]:"hold_transaction",[i.USE_SCALE]:"use_scale",[i.LIMIT_AMOUNT_ALERT]:"limit_amount_alert",[i.QUANTITY_MULTIPLIER]:"quantity_multiplier",[i.PRINT_X_REPORT]:"print_x_report",[i.PRINT_Z_REPORT]:"print_z_report",[i.COUPON]:"coupon",[i.REPRINT_DOCUMENT]:"reprint_document",[i.PRINT_PENDING_DOCUMENT]:"print_pending_document",[i.IMPORT_QUOTATION]:"import_quotation",[i.PARTIAL_WITHDRAWAL]:"partial_withdrawal",[i.CASH_CLOSE]:"cash_close",[i.LOAD_ON_HOLD]:"load_on_hold",[i.CANCEL_RETURN]:"cancel_return",[i.PROCEED_REFUND]:"proceed_refund",[i.REMOVE_LIMIT_AMOUNT]:"remove_limit_amount",[i.CUSTOM_BUTTON_LINK]:"custom_button_link",[i.CUSTOM_BUTTON_APK]:"custom_button_apk",[i.CUSTOM_BUTTON_EXT]:"custom_button_ext"}),_=({action:e,backendName:t,t:r,isCatalog:a})=>{let l=Number(e),s=b[l];return T.has(l)?t&&t.trim()?t:s?r(s):t:s?r(s):t??""};Object.freeze([i.PRINT_X_REPORT,i.PRINT_Z_REPORT]);let A=e=>{let t=Number(e);return Number.isFinite(t)?t:o.NONE},g=Object.freeze({ACTIVE:0,INACTIVE:1,UNDER_MAINTENANCE:2}),v=()=>!0,I=e=>e===g.ACTIVE,O=e=>e===g.UNDER_MAINTENANCE,R=e=>e===g.UNDER_MAINTENANCE,y=e=>e!==g.INACTIVE,w=(e,t)=>{switch(e){case"ACTIVE":return g.ACTIVE;case"UNPAIRED":case"INACTIVE":return g.INACTIVE;case"MAINTENANCE":case"REQUESTED":return g.UNDER_MAINTENANCE;default:return t}},j=[{id:"epson",label:"Epson"},{id:"hp",label:"HP"},{id:"brother",label:"Brother"}],C={epson:[{id:"tm-u220",label:"TM-U220"},{id:"lx-350",label:"LX-350"}],hp:[{id:"laserjet-1020",label:"LaserJet 1020"},{id:"deskjet-2130",label:"DeskJet 2130"}],brother:[{id:"hl-l2350dw",label:"HL-L2350DW"},{id:"mfc-l2710dw",label:"MFC-L2710DW"}]},S=[{apiValue:"PIN_PAD",formValue:"payment"},{apiValue:"PRINTER",formValue:"printer"},{apiValue:"SCALE",formValue:"scale"},{apiValue:"SCANNER",formValue:"scanner"},{apiValue:"FINGERPRINT",formValue:"fingerprint"}],L=[{apiValue:"ACTIVE",formValue:"active"},{apiValue:"INACTIVE",formValue:"inactive"},{apiValue:"MAINTENANCE",formValue:"maintenance"}],M=[{apiValue:"USB",formValue:"usb"},{apiValue:"BLUETOOTH",formValue:"bluetooth"},{apiValue:"WIFI",formValue:"wifi"},{apiValue:"ETHERNET",formValue:"Ethernet"},{apiValue:"SERIAL",formValue:"serial"},{apiValue:"RS232",formValue:"RS232"},{apiValue:"NFC",formValue:"nfc"},{apiValue:"NATIVE",formValue:"nativo"}],D=e=>(e??"").toString().trim().toLowerCase(),P=(e,t)=>D(e?.methodName)===D(t)||D(e?.provider)===D(t),U=e=>P(e,"SlivePay"),k=e=>P(e,"Cashea"),V=Object.freeze(["UbiiMobilePaymentPayout"]),F=e=>!V.includes(e?.methodName)&&("mobilepayment"!==D(e?.methodName)||"ubii"!==D(e?.provider)||e?.allowsPayout!==!0),B=e=>e?.allowsPayout===!0;Object.freeze(Object.fromEntries(Object.freeze(["NONE","ASSIGNED","NOTIFIED","DOWNLOADED","INSTALLING","INSTALLED","FAILED"]).map(e=>[e,e]))),Object.freeze({NONE:"app_update_status_none",ASSIGNED:"app_update_status_assigned",NOTIFIED:"app_update_status_notified",DOWNLOADED:"app_update_status_downloaded",INSTALLING:"app_update_status_installing",INSTALLED:"app_update_status_installed",FAILED:"app_update_status_failed"}),Object.freeze({NONE:"outline",ASSIGNED:"blue",NOTIFIED:"blue",DOWNLOADED:"blue",INSTALLING:"blue",INSTALLED:"successStatistic",FAILED:"destructiveStatistic"});let z=e=>{let t=Number(e);return Number.isFinite(t)?t:null};function H(e){let t=e?.packages??e?.installedPackages??[];return(Array.isArray(t)?t:[]).reduce((e,t)=>
1(t?.packageName&&(e[t.packageName]={versionCode:z(t?.versionCode),versionName:t?.versionName??t?.version??null}),e),{})}function W(e=[],t=[]){let r=[];return e.forEach(({packageName:e,installable:a})=>{let l=z(a?.versionCode);if(null===l)return;let s=t.filter(t=>{let r=z(t?.packages?.[e]?.versionCode);return null!==r&&r>l});s.length>0&&r.push({packageName:e,installable:a,devices:s})}),r}function q(e=[],t=[]){let r=new Map(e.map(e=>[e.packageName,e.installable])),a=[];return e.forEach(({packageName:e,installable:l})=>{let s=l?.requiresPackage,n=z(l?.minCompanionVersionCode);if(!s||null===n)return;let i=z(r.get(s)?.versionCode),o=t.filter(e=>{let t=i??z(e?.packages?.[s]?.versionCode);return null===t||t<n});o.length>0&&a.push({packageName:e,installable:l,companion:s,minimum:n,devices:o})}),a}function K(e=[],t=[]){let r=[];return e.forEach(({packageName:e,installable:a})=>{let l=new Map;t.forEach(t=>{let r=t?.packages?.[e],a=r?.versionName??(r?.versionCode!==null&&r?.versionCode!==void 0?String(r.versionCode):null)??"";l.set(a,(l.get(a)??0)+1)}),l.forEach((t,l)=>{r.push({packageName:e,count:t,from:""===l?null:l,to:a?.version||String(a?.versionCode??"")})})}),r}},9791:(e,t,r)=>{r.d(t,{E:()=>o,U:()=>u});var a=r(95155),l=r(49619),s=r(99428),n=r(32656),i=r(86190);function o(e){return e===n.H5.ERROR?"bg-destructive-tint text-foreground chat-edge border-l-2 border-l-destructive":e===n.H5.NOTICE?"bg-info-tint text-foreground chat-edge border-l-2 border-l-info":"chat-agent-surface text-foreground chat-edge border-l-2 border-l-primary"}let u=({isAstro:e,className:t,markClassName:r})=>(0,a.jsx)("span",{className:(0,i.cn)("flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-primary-100",t),children:e?(0,a.jsx)(s.A,{className:(0,i.cn)("h-3.5 w-3.5",r)}):(0,a.jsx)(l.A,{size:12,"aria-hidden":"true",className:(0,i.cn)("text-primary",r)})})},17538:(e,t,r)=>{r.d(t,{D:()=>i,f:()=>o});var a=r(12115),l=r(30539);let s=null,n=null;function i(){s=null}let o=e=>{let[t,r]=(0,a.useState)(s||[]),[i,o]=(0,a.useState)(!s),[u,c]=(0,a.useState)(!!s),[d,p]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=!1;return(n||(n=(0,l.k)(1,100).then(e=>{if(e?.Error===!0||e?.error===!0)throw Error(e?.Message?.en??e?.message?.en??"Failed to load ticket templates");let t=e?.data?.list??e?.Data?.list??[];return s=t,n=null,t}).catch(e=>{throw n=null,e}))).then(t=>{e||(r(t),c(!0),p(!1))}).catch(()=>{!e&&(s||(c(!1),p(!0)))}).finally(()=>{e||o(!1)}),()=>{e=!0}},[]),{templates:t.filter(t=>t?.documentType===e),loading:i,loaded:u,error:d}}},30539:(e,t,r)=>{r.d(t,{k:()=>l});var a=r(9339);let l=(0,a.createServerReference)("606df081bbe9352be705e065a03dfddedd54b1175f",a.callServer,void 0,a.findSourceMapURL,"getTicketTemplates")}
1,36625:(e,t,r)=>{r.d(t,{A:()=>N});var a=r(95155),l=r(12115),s=r(64484),n=r(7250),i=r(9339);let o=(0,i.createServerReference)("401661faf18cead1230b5b58939bc4e6d466bb1347",i.callServer,void 0,i.findSourceMapURL,"getTicketTemplateByCode"),u=(0,i.createServerReference)("406ba7995b5336ab346585fba0efc8aa0c2fb27459",i.callServer,void 0,i.findSourceMapURL,"getVariables"),c=new Map,d=new Map,p=new Map,f=new Map;var h=r(86190);let m=20,N=({code:e,documentType:t,enabled:r,size:i=m,className:N})=>{let{blocks:x,variables:E,loading:T}=((e,t,r)=>{let[a,s]=(0,l.useState)(()=>c.get(e)??null),[n,i]=(0,l.useState)(()=>p.get(t)??[]);return(0,l.useEffect)(()=>{s(c.get(e)??null)},[e]),(0,l.useEffect)(()=>{if(!r||!e)return;let a=!1;return Promise.all([(e=>{if(d.has(e))return d.get(e);let t=o(e).then(t=>{if(t?.Error===!0||t?.error===!0)throw Error(t?.Message?.en??t?.message?.en??"Failed to load ticket template");let r=t?.data?.blocks??t?.Data?.blocks??[];return c.set(e,r),r}).finally(()=>d.delete(e));return d.set(e,t),t})(e),(e=>{if(!e)return Promise.resolve([]);if(f.has(e))return f.get(e);let t=u(e).then(t=>{if(t?.Error===!0||t?.error===!0)return[];let r=t?.data??t?.Data??[];return p.set(e,r),r}).catch(()=>[]).finally(()=>f.delete(e));return f.set(e,t),t})(t)]).then(([e,t])=>{a||(s(e),i(t))}).catch(()=>{a||s([])}),()=>{a=!0}},[r,e,t]),{blocks:a??[],variables:n,loading:r&&null===a}})(e,t,r),b=(0,l.useMemo)(()=>(0,n.to)({sequence:x}),[x]);if(!r)return null;let _=Math.round(1.2*i),A=i/310;return(0,a.jsx)("div",{className:(0,h.cn)("shrink-0 overflow-hidden rounded-sm border bg-white-base relative",N),style:{width:i,height:_},children:T?(0,a.jsx)("div",{className:"h-full w-full animate-pulse bg-muted"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{style:{width:310,transform:`scale(${A})`,transformOrigin:"top left"},children:(0,a.jsx)(s.A,{lines:b,variables:E})}),i>=40&&(0,a.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 h-1/4 bg-gradient-to-t from-white-base to-transparent"})]})})}},64484:(e,t,r)=>{r.d(t,{A:()=>x});var a=r(95155),l=r(12115),s=r(35244),n=r.n(s),i=r(50910),o=r(86190);class u extends l.Component{static getDerivedStateFromError(){return{hasError:!0}}componentDidUpdate(e){this.state.hasError&&e.resetKey!==this.props.resetKey&&this.setState({hasError:!1})}render(){return this.state.hasError?this.props.fallback:this.props.children}constructor(...e){super(...e),this.state={hasError:!1}}}function c({code:e,cls:t,format:r}){let l=(0,i.c)("applications.pos.tickets_designer"),s=(t||"").split(/\s+/).filter(Boolean),d={"text-left":"justify-start","text-center":"justify-center","text-right":"justify-end"},p=s.find(e=>d[e])||"text-center",f=s.filter(e=>!d[e]),h=(0,o.cn)("w-full flex",d[p],f),m=(e||"").trim(),N=r||"CODE128";return m?(0,a.jsx)("div",{className:h,children:(0,a.jsx)(u,{resetKey:`${m}::${N}`,fallback:(0,a.jsx)("div",{className:"flex h-10 w-40 items-center justify-center rounded border border-dashed text-[10px] text-destructive",children:`Valor inv\xe1lido para ${N}`}),children:(0,a.jsx)(n(),{value:m,format:N,width:1.4,height:36,fontSize:11,margin:4,displayValue:!0})})}):(0,a.jsx)("div",{className:h,children:(0,a.jsx)("div",{className:"flex h-10 w-40 items-center justify-center rounded border border-dashed text-[10px] text-muted-foreground",children:l("previewNoValue")})})}var d=r(11439);let p=({size:e=100,className:t="",value:r})=>{let l=(0,i.c)("applications.pos.tickets_designer"),s=(t||"").split(/\s+/).filter(Boolean),n={"text-left":"justify-start","text-center":"justify-center","text-right":"justify-end"},u=s.find(e=>n[e])||"text-center",c=s.filter(e=>!n[e]),p=(0,o.cn)("w-full flex",n[u],c),f=null!=r&&String(r).trim()?String(r):null;return(0,a.jsx)("div",{className:p,children:f?(0,a.jsx)(d.h,{value:f,size:e,level:"M"}):(0,a.jsx)("div",{className:"flex items-center justify-center rounded border border-dashed text-[10px] text-muted-foreground",style:{width:e,height:e},children:l("previewNoValue")})})};var f=r(79785),h=r(7250);function m({line:e}){let t=(0,o.cn)("w-full flex",e.cls);return(0,a.jsx)("div",{className:t,children:(0,a.jsx)("img",{src:e?.url||"/Images/placeholder.svg",alt:"Logo/Image",className:"max-h-32 max-w-full object-contain grayscale"})})}function N(e,t){return"string"!=typeof e?e:e.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(e,r)=>{let a=r.split("."),l=null;if(1===a.length){let e=t.find(e=>e.key===a[0]);l=e?.mockupValue??""}else if(2===a.length){let e=t.find(e=>e.key===a[0]),r=e?.children?.find(e=>e.key===a[1]);l=r?.mockupValue??e?.mockupValue??""}return l??""})}let x=function({className:e="",lines:t=[],variables:r=[]}){let l=t.map((e,t)=>{switch(e.type){case"text":{let l=N(e.txt,r);return(0,a.jsx)("p",{className:(0,o.cn)("leading-tight text-[12px]",e.cls),style:{wordBreak:"break-word",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:l},t)}case"barcode":return(0,a.jsx)(c,{...e,code:N(e.code,r)},t);case"image":return(0,a.jsx)(m,{line:e},t);case"table":{let l={...e.table};return Array.isArray(l.rows)&&(l.rows=l.rows.map(e=>Array.isArray(e)?e.map(e=>N(e,r)):e)),(0,a.jsx)(f.A,{variables:r,...e,table:l},t)}case"qr":return(0,a.jsx)(p,{size:100,className:e?.cls,value:N(e.data,r)},t);case"separator":{let{cls:r,txt:l}=e,s="string"==typeof l&&l.length?l:"",n=Number(e?.len)||42,i=s.repeat(Math.ceil(n/(s.length||1))).slice(0,n);return(0,a.jsx)("p",{className:(0,o.cn)("font-mono leading-tight text-[12px] whitespace-pre w-full overflow-hidden",r),children:i},t)}default:return null}});return(0,a.jsx)("div",{className:"bg-white-base flex justify-center w-full rounded-md relative",children:(0,a.jsxs)("div",{className:`w-[310px] max-w-full min-h-96 bg-card py-8 px-4 roun
1ded-lg shadow-lg relative receipt-cut-edge text-xs space-y-1 overflow-hidden ${e}`,children:[(0,a.jsx)(h.EQ,{position:"top"}),l,(0,a.jsx)(h.EQ,{position:"bottom"})]})})}},79785:(e,t,r)=>{r.d(t,{A:()=>i});var a=r(95155),l=r(12115),s=r(86190);function n(e,t){return"string"!=typeof e?e:e.replace(/\{\{\s*([^{}]+?)\s*\}\}/g,(e,r)=>{let a=r.split(".");if(1===a.length){let e=t.find(e=>e.key===a[0]);return e?.mockupValue??""}if(2===a.length){let e=t.find(e=>e.key===a[0]),r=e?.children?.find(e=>e.key===a[1]);return r?.mockupValue??e?.mockupValue??""}let l=null;for(let e=0;e<a.length;e++)if(0===e)l=t.find(e=>e.key===a[0]);else if(l&&Array.isArray(l.children))l=l.children.find(t=>t.key===a[e]);else{l=null;break}return l?.mockupValue??""})}function i({table:e={},className:t="",previewLimit:r=15,variables:o=[]}){let{columns:u=[],rows:c=[],dataSource:d}=e||{},p=u.length||1,f=(e,t)=>1===t?"text-left":2===t?0===e?"text-left":"text-right":0===e?"text-left":e===t-1?"text-right":"text-center",h=(0,l.useMemo)(()=>(function(e,t){if(!Array.isArray(e))return[];if(e.every(e=>Array.isArray(e)))return e;let r=[];for(let a=0;a<e.length;a+=t)r.push(e.slice(a,a+t));return r})(c,p).slice(0,r).map(e=>e.map(e=>n(e,o))),[c,p,r,o]);return(0,a.jsxs)("section",{className:t,children:[(0,a.jsx)("div",{className:"grid gap-x-2 font-semibold text-xs",style:{gridTemplateColumns:`repeat(${p}, minmax(0,1fr))`},children:u.map((e,t)=>(0,a.jsx)("div",{className:f(t,p),children:n(e,o)},t))}),(0,a.jsxs)("div",{className:"mt-1 space-y-0.5",children:[0===h.length&&(0,a.jsx)("div",{className:"text-[12px] text-muted-foreground italic",children:"(Sin filas)"}),h.map((e,t)=>(0,a.jsx)("div",{className:"grid gap-x-2 text-[12px] leading-snug",style:{gridTemplateColumns:`repeat(${p}, minmax(0,1fr))`},children:e.map((e,t)=>(0,a.jsx)("div",{className:(0,s.cn)("break-words",f(t,p)),children:e},t))},t))]})]})}}}]);

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.