@worm-print-platform/canvas 1.6.1 → 1.6.3

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.
Files changed (67) hide show
  1. package/README.md +1 -1
  2. package/dist/browser-bundle.d.ts +1 -1
  3. package/dist/canvas.js +71 -29
  4. package/dist/core/default-template.d.ts +1 -1
  5. package/dist/core/element-definitions.d.ts +1 -1
  6. package/dist/core/format.d.ts +1 -1
  7. package/dist/core/h.d.ts +1 -1
  8. package/dist/core/icons.d.ts +1 -1
  9. package/dist/core/plugin.d.ts +1 -1
  10. package/dist/core/store.d.ts +1 -1
  11. package/dist/host-contract.d.ts +1 -1
  12. package/dist/index.cjs +43 -1
  13. package/dist/index.d.ts +1 -1
  14. package/dist/index.js +44 -2
  15. package/dist/print-designer.d.ts +1 -1
  16. package/dist/shell/binding.d.ts +1 -1
  17. package/dist/shell/canvas.d.ts +1 -1
  18. package/dist/shell/code.d.ts +1 -1
  19. package/dist/shell/color-picker.d.ts +1 -1
  20. package/dist/shell/controls.d.ts +1 -1
  21. package/dist/shell/crop-anchor.d.ts +1 -1
  22. package/dist/shell/elements.d.ts +1 -1
  23. package/dist/shell/expression-editor.d.ts +1 -1
  24. package/dist/shell/flow-list.d.ts +1 -1
  25. package/dist/shell/font-select.d.ts +1 -1
  26. package/dist/shell/format-bar.d.ts +1 -1
  27. package/dist/shell/help-content/en-US/advanced-settings.d.ts +1 -1
  28. package/dist/shell/help-content/en-US/changelog.d.ts +1 -1
  29. package/dist/shell/help-content/en-US/faq.d.ts +1 -1
  30. package/dist/shell/help-content/en-US/features.d.ts +1 -1
  31. package/dist/shell/help-content/en-US/getting-started.d.ts +1 -1
  32. package/dist/shell/help-content/en-US/shortcuts.d.ts +1 -1
  33. package/dist/shell/help-content/index.d.ts +1 -1
  34. package/dist/shell/help-content/th-TH/advanced-settings.d.ts +1 -1
  35. package/dist/shell/help-content/th-TH/changelog.d.ts +1 -1
  36. package/dist/shell/help-content/th-TH/faq.d.ts +1 -1
  37. package/dist/shell/help-content/th-TH/features.d.ts +1 -1
  38. package/dist/shell/help-content/th-TH/getting-started.d.ts +1 -1
  39. package/dist/shell/help-content/th-TH/shortcuts.d.ts +1 -1
  40. package/dist/shell/help-content/zh-CN/advanced-settings.d.ts +1 -1
  41. package/dist/shell/help-content/zh-CN/changelog.d.ts +1 -1
  42. package/dist/shell/help-content/zh-CN/faq.d.ts +1 -1
  43. package/dist/shell/help-content/zh-CN/features.d.ts +1 -1
  44. package/dist/shell/help-content/zh-CN/getting-started.d.ts +1 -1
  45. package/dist/shell/help-content/zh-CN/shortcuts.d.ts +1 -1
  46. package/dist/shell/help-modal.d.ts +1 -1
  47. package/dist/shell/page-extras.d.ts +1 -1
  48. package/dist/shell/panels.d.ts +1 -1
  49. package/dist/shell/plugin-ui.d.ts +1 -1
  50. package/dist/shell/prop-group.d.ts +1 -1
  51. package/dist/shell/property-panel.d.ts +1 -1
  52. package/dist/shell/property-search.d.ts +1 -1
  53. package/dist/shell/ruler.d.ts +1 -1
  54. package/dist/shell/table-props.d.ts +1 -1
  55. package/dist/shell/table.d.ts +1 -1
  56. package/dist/shell/toolbar-overflow.d.ts +1 -1
  57. package/dist/shell/toolbar.d.ts +1 -1
  58. package/dist/shell/watermark.d.ts +1 -1
  59. package/dist/test-setup.d.ts +1 -1
  60. package/dist/theme-tokens.d.ts +1 -1
  61. package/dist/version.d.ts +2 -2
  62. package/dist/vue3/PrintDesigner.d.ts +1 -1
  63. package/dist/vue3/PrintHtmlPreview.d.ts +1 -1
  64. package/dist/vue3/index.d.ts +1 -1
  65. package/dist/vue3/previewStyle.d.ts +1 -1
  66. package/dist/vue3/toolbarOverflow.d.ts +1 -1
  67. package/package.json +3 -3
package/dist/canvas.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(Z){typeof define=="function"&&define.amd?define(Z):Z()})((function(){"use strict";const Z=e=>typeof e=="string",yo=()=>{let e,t;const r=new Promise((o,n)=>{e=o,t=n});return r.resolve=e,r.reject=t,r},Tn=e=>e==null?"":String(e),Ng=e=>Z(e)&&/^[A-Za-z0-9_@.-]{1,128}$/.test(e)&&!e.includes("..")&&!["__proto__","constructor","prototype"].includes(e),Sa=e=>e?.callbackApi??e?.constructor?.callbackApi,Bg=(e,t,r)=>{e.forEach(o=>{t[o]&&(r[o]=t[o])})},Fg=/###/g,Ap=e=>e&&e.includes("###")?e.replace(Fg,"."):e,Op=e=>!e||Z(e),vo=(e,t,r)=>{const o=Z(t)?t.split("."):t;let n=0;for(;n<o.length-1;){if(Op(e))return{};const i=Ap(o[n]);!e[i]&&r&&(e[i]=new r),Object.prototype.hasOwnProperty.call(e,i)?e=e[i]:e={},++n}return Op(e)?{}:{obj:e,k:Ap(o[n])}},Rp=(e,t,r)=>{const{obj:o,k:n}=vo(e,t,Object);if(o!==void 0||t.length===1){o[n]=r;return}let i=t[t.length-1],a=t.slice(0,t.length-1),s=vo(e,a,Object);for(;s.obj===void 0&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),s=vo(e,a,Object),s?.obj&&typeof s.obj[`${s.k}.${i}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${i}`]=r},$g=(e,t,r,o)=>{const{obj:n,k:i}=vo(e,t,Object);(!Object.prototype.hasOwnProperty.call(n,i)||!n[i])&&(n[i]=[]),n[i].push(r)},Mn=(e,t)=>{const{obj:r,k:o}=vo(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,o))return r[o]},zg=(e,t,r)=>{const o=Mn(e,r);return o!==void 0?o:Mn(t,r)},Ip=e=>e===null||typeof e!="object"||e instanceof String,Lp=(e,t,r)=>{for(const o in t)o!=="__proto__"&&o!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,o)?Ip(e[o])||Ip(t[o])?r&&(e[o]=t[o]):Lp(e[o],t[o],r):e[o]=t[o]);return e},gr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),Hg={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ug=e=>Z(e)?e.replace(/[&<>"']/g,t=>Hg[t]):e;class qg{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const r=this.regExpMap.get(t);if(r!==void 0)return r;const o=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,o),this.regExpQueue.push(t),o}}const jg=[" ",",","?","!",";"],Wg=new qg(20),Vg=(e,t,r)=>{t=t||"",r=r||"";const o=jg.filter(a=>!t.includes(a)&&!r.includes(a));if(o.length===0)return!0;const n=Wg.getRegExp(`(${o.map(a=>a==="?"?"\\?":a).join("|")})`);let i=!n.test(e);if(!i){const a=e.indexOf(r);a>0&&!n.test(e.substring(0,a))&&(i=!0)}return i},Ta=(e,t,r=".")=>{if(!e)return;if(e[t]||!r)return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const o=t.split(r);let n=e;for(let i=0;i<o.length;){if(!n||typeof n!="object")return;let a,s="";for(let p=i;p<o.length;++p)if(p!==i&&(s+=r),s+=o[p],a=n[s],(typeof a=="function"||s==="__proto__")&&!Object.prototype.hasOwnProperty.call(n,s)&&(a=void 0),a!==void 0){if(["string","number","boolean"].includes(typeof a)&&p<o.length-1)continue;i+=p-i+1;break}n=a}return n},jr=e=>e?.replace(/_/g,"-"),Gg={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class wo{constructor(t,r={}){this.init(t,r)}init(t,r={}){this.prefix=r.prefix||"i18next:",this.logger=t||Gg,this.options=r,this.debug=r.debug,this.seen=new Set}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}once(t,r,...o){return!this.debug||this.seen.has(t)||this.seen.size>=1e3?null:(this.seen.add(t),this[r](...o))}forward(t,r,o,n){return n&&!this.debug?null:(t=t.map(i=>Z(i)?i.replace(/[\r\n\x00-\x1F\x7F]/g," "):i),Z(t[0])&&(t[0]=`${o}${this.prefix} ${t[0]}`),this.logger[r](t))}create(t){return new wo(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new wo(this.logger,t)}}var br=new wo;const Np=new WeakSet;class Cn{constructor(){this.observers={}}on(t,r){return t.split(" ").forEach(o=>{this.observers[o]||(this.observers[o]=new Map);const n=this.observers[o].get(r)||0;this.observers[o].set(r,n+1)}),this}off(t,r){(typeof t=="string"?t.split(" "):[t]).forEach(o=>{if(this.observers[o]){if(!r){delete this.observers[o];return}this.observers[o].delete(r),Np.has(r)&&this.observers[o].forEach((n,i)=>{i.listener===r&&this.observers[o].delete(i)})}})}once(t,r){const o=(...n)=>{this.off(t,o),r(...n)};return o.listener=r,Np.add(r),this.on(t,o),this}emit(t,...r){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([n,i])=>{for(let a=0;a<i;a++)n(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,i])=>{for(let a=0;a<i;a++)n(t,...r)})}}const Bp=new WeakSet,Ma=(e,...t)=>{if(t.some(r=>!Z(r)))throw new TypeError(`${e}: pass language, namespace${e==="addResource"?" and key":""} as separate strings; the dotted form ('en.translation.key') was removed in i18next v27`)};class Fp extends Cn{constructor(t,r={ns:["translation"],defaultNS:"translation"},o=br){super(),this.data=t||{},this.options=r,this.logger=o.create("resourceStore"),this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.includes(t)||this.options.ns.push(t)}removeNamespaces(t){const r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}getResource(t,r,o,n={}){const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,a=n.ignoreJSONStructure!==void 0?n.ignoreJSONStructure:this.options.ignoreJSONStructure,s=[t,r];o&&(Array.isArray(o)?s.push(...o):Z(o)&&i?s.push(...o.split(i)):s.push(o));const p=Mn(this.data,s);return p!=null||!a||!Z(o)?p:Ta(this.data?.[t]?.[r],o,i)}addResource(t,r,o,n,i={silent:!1}){Ma("addResource",t,r,o);const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let s=[t,r];o&&(s=s.concat(a?o.split(a):o)),this.addNamespaces(r),Rp(this.data,s,n),i.silent||this.emit("added",t,r,o,n)}addResources(t,r,o,n={silent:!1}){Ma("addResources",t,r),Object.keys(o||{}).forEach(i=>{i==="__proto__"||i==="constructor"||this.addResource(t,r,i,o[i],{silent:!0})}),n.silent||this.emit("added",t,r,o)}addResourceBundle(t,r,o,n,i,a={silent:!1,skipCopy:!1}){Ma("addResourceBundle",t,r);const s=[t,r];this.addNamespaces(r);let p=Mn(this.data,s)||{};a.skipCopy||(o=JSON.parse(JSON.stringify(o))),n?Lp(p,o,i):p={...p,...o},Rp(this.data,s,p),a.silent||this.emit("added",t,r,o)}removeResourceBundle(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}hasResourceBundle(t,r){return this.getResource(t,r)!==void 0}getResourceBundle(t,r){return r||(r=this.options.defaultNS),this.getResource(t,r)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const r=this.getDataByLanguage(t);return!!(r&&Object.keys(r)||[]).find(n=>{const i=r[n];return Bp.has(i)?!0:!i||Object.keys(i).length===0?!1:(typeof i=="object"&&Bp.add(i),!0)})}toJSON(){return this.data}}const $p=Symbol("i18next/PATH_KEY");function Kg(){const e=[],t=Object.create(null);let r;return t.get=(o,n)=>(r?.revoke?.(),n===$p?e:(e.push(n),r=Proxy.revocable(o,t),r.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Wr(e,t){const{[$p]:r}=e(Kg()),o=t?.keySeparator||".",n=t?.nsSeparator??":",i=t?.enableSelector==="strict";if(r.length>1&&n){const a=t?.ns,s=i?Array.isArray(a)?a:a?[a]:null:Array.isArray(a)?a:null;if(s&&(i?s:s.length>1?s.slice(1):[]).includes(r[0]))return`${r[0]}${n}${r.slice(1).join(o)}`}return r.join(o)}const _n=e=>!Z(e)&&typeof e!="boolean"&&typeof e!="number";class Dn extends Cn{constructor(t,r={}){super(),Bg(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils","postProcessors"],t,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=(t.logger||br).create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,r={interpolation:{}}){const o={...r};if(t==null)return!1;const n=this.resolve(t,o);if(n?.res===void 0)return!1;const i=_n(n.res);return!(o.returnObjects===!1&&i)}extractFromKey(t,r){let o=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");const n=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let i=r.ns||this.options.defaultNS||[];const a=o&&t.includes(o),s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!Vg(t,o,n);if(a&&!s){const p=t.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:t,namespaces:Z(i)?[i]:i};const l=t.split(o);(o!==n||o===n&&this.options.ns.includes(l[0]))&&(i=l.shift()),t=l.join(n===!1?o:n)}return{key:t,namespaces:Z(i)?[i]:i}}translate(t,r,o){let n=typeof r=="object"?{...r}:r;if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";typeof t=="function"&&(t=Wr(t,{...this.options,...n})),Array.isArray(t)||(t=[String(t)]),t=t.map(M=>typeof M=="function"?Wr(M,{...this.options,...n}):String(M));const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:s,namespaces:p}=this.extractFromKey(t[t.length-1],n),l=p[p.length-1];let d=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const u=n.lng||this.language,c=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u?.toLowerCase()==="cimode")return c?i?{res:`${l}${d}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${d}${s}`:i?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:s;const f=this.resolve(t,n);let h=f?.res;const b=f?.usedKey||s,k=f?.exactUsedKey||s,v=["[object Number]","[object Function]","[object RegExp]"],w=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,P=!this.i18nFormat||this.i18nFormat.handleAsObject,E=n.count!==void 0&&!Z(n.count),D=Dn.hasDefaultValue(n),O=E?this.pluralResolver.getSuffix(u,n.count,n):"",A=n.ordinal&&E?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",R=E&&!n.ordinal&&n.count===0,_=this.options.pluralSeparator,I=R&&n[`defaultValue${_}zero`]||n[`defaultValue${O}`]||n[`defaultValue${A}`]||(n.defaultValue??(E?n[`defaultValue${n.ordinal?`${_}ordinal${_}`:_}other`]:void 0));let S=h;P&&!h&&D&&(S=I);const B=_n(S),F=Object.prototype.toString.apply(S),H=P&&S&&B&&!v.includes(F)&&!(Z(w)&&Array.isArray(S)),le=H&&!n.returnObjects&&!this.options.returnObjects;if(le&&this.options.returnedObjectHandler){const M=this.options.returnedObjectHandler(b,S,{...n,ns:p});return i?(f.res=M,f.usedParams=this.getUsedParamsDetails(n),f):M}if(le&&this.logger.warn("accessing an object - but returnObjects options is not enabled!"),H&&!le){if(a){const M=Array.isArray(S),ne=M?[]:{},Se=M?k:b;for(const Pe in S)if(Object.prototype.hasOwnProperty.call(S,Pe)){const K=`${Se}${a}${Pe}`;D&&!h?ne[Pe]=this.translate(K,{...n,defaultValue:_n(I)?I[Pe]:void 0,joinArrays:!1,ns:p}):ne[Pe]=this.translate(K,{...n,joinArrays:!1,ns:p}),ne[Pe]===K&&(ne[Pe]=S[Pe])}h=ne}}else if(P&&Z(w)&&Array.isArray(h))h=h.join(w),h&&(h=this.extendTranslation(h,t,n,f,o));else{let M=!1,ne=!1;le&&(h=void 0),!this.isValidLookup(h)&&D&&!(le&&_n(I))&&(M=!0,h=I),!this.isValidLookup(h)&&!(M&&h==="")&&(ne=!0,h=s);const Pe=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ne?void 0:h,K=D&&I!==h&&this.options.updateMissing;if(!le&&(ne||M||K)){if(this.logger.log(K?"updateKey":"missingKey",u,l,E&&!K?`${s}${this.pluralResolver.getSuffix(u,n.count,n)}`:s,K?I:h),a){const ke=this.resolve(s,{...n,keySeparator:!1});ke&&ke.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ue=[];const me=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&me&&me[0])for(let ke=0;ke<me.length;ke++)ue.push(me[ke]);else this.options.saveMissingTo==="all"?ue=this.languageUtils.toResolveHierarchy(n.lng||this.language):ue.push(n.lng||this.language);const we=(ke,te,Me)=>{const se=D&&Me!==h?Me:Pe;this.options.missingKeyHandler?this.options.missingKeyHandler(ke,l,te,se,K,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(ke,l,te,se,K,n,void 0,this.utils?.hasLoadedNamespace),this.emit("missingKey",ke,l,te,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&E?ue.forEach(ke=>{const te=this.pluralResolver.getSuffixes(ke,n);R&&n[`defaultValue${this.options.pluralSeparator}zero`]&&!te.includes(`${this.options.pluralSeparator}zero`)&&te.push(`${this.options.pluralSeparator}zero`),te.forEach(Me=>{we([ke],s+Me,n[`defaultValue${Me}`]||I)})}):we(ue,s,I))}h=this.extendTranslation(h,t,n,f,o),ne&&h===s&&this.options.appendNamespaceToMissingKey&&(h=`${l}${d}${s}`),(ne||M)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${d}${s}`:s,M?h:void 0,n))}return i?(f.res=h,f.usedParams=this.getUsedParamsDetails(n),f):h}extendTranslation(t,r,o,n,i){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...o},o.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init({...o,interpolation:{...this.options.interpolation,...o.interpolation}});const p=Z(t)&&(o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let l;if(p){const u=t.includes(this.interpolator.nestingPrefixText)?t.match(this.interpolator.nestingRegexp):null;l=u&&u.length}let d=o.replace&&!Z(o.replace)?o.replace:o;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),t=this.interpolator.interpolate(t,d,o.lng||this.language||n.usedLng,o),p){const u=t.includes(this.interpolator.nestingPrefixText)?t.match(this.interpolator.nestingRegexp):null,c=u&&u.length;l<c&&(o.nest=!1)}!o.lng&&n&&n.res&&(o.lng=this.language||n.usedLng),o.nest!==!1&&(t=this.interpolator.nest(t,(...u)=>i?.[0]===u[0]&&!o.context?(this.logger.warn(`It seems you are nesting recursively key: ${u[0]} in key: ${r[0]}`),null):this.translate(...u,r),o)),o.interpolation&&this.interpolator.reset()}const a=o.postProcess||this.options.postProcess,s=Z(a)?[a]:a;if(t!=null&&s?.length&&o.applyPostProcessor!==!1){const p=this.options?.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(o)},...o}:o;s.forEach(l=>{const d=this.postProcessors?.[l];if(!d){this.logger.once(`postProcess:${l}`,"warn",`postProcess: '${l}' is not registered on this i18next instance; call use() with it on this instance`);return}t=d.process(t,r,p,this)??t})}return t}resolve(t,r={}){let o,n,i,a,s;return Z(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(p=>typeof p=="function"?Wr(p,{...this.options,...r}):p)),t.forEach(p=>{if(this.isValidLookup(o))return;const l=this.extractFromKey(p,r),d=l.key;n=d;let u=l.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const c=r.count!==void 0&&!Z(r.count),f=c&&!r.ordinal&&r.count===0,h=r.context!==void 0&&(Z(r.context)||typeof r.context=="number")&&r.context!=="",b=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);u.forEach(k=>{this.isValidLookup(o)||(s=k,!this.checkedLoadedFor[`${b[0]}-${k}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(this.checkedLoadedFor[`${b[0]}-${k}`]=!0,this.logger.warn(`key "${n}" for languages "${b.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(v=>{if(this.isValidLookup(o))return;a=v;const w=[d];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(w,d,v,k,r);else{let E;c&&(E=this.pluralResolver.getSuffix(v,r.count,r));const D=`${this.options.pluralSeparator}zero`,O=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(r.ordinal&&E.startsWith(O)&&w.push(d+E.replace(O,this.options.pluralSeparator)),w.push(d+E),f&&w.push(d+D)),h){const A=`${d}${this.options.contextSeparator||"_"}${r.context}`;w.push(A),c&&(r.ordinal&&E.startsWith(O)&&w.push(A+E.replace(O,this.options.pluralSeparator)),w.push(A+E),f&&w.push(A+D))}if(c){const A=`${r.ordinal?O:this.options.pluralSeparator}other`;E!==A&&(h&&w.unshift(`${d}${this.options.contextSeparator||"_"}${r.context}${A}`),w.unshift(d+A))}}let P;for(;P=w.pop();)this.isValidLookup(o)||(i=P,o=this.getResource(v,k,P,r))}))})}),{res:o,usedKey:n,exactUsedKey:i,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,r,o,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,r,o,n):this.resourceStore.getResource(t,r,o,n)}getUsedParamsDetails(t={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],o=t.replace&&!Z(t.replace);let n=o?t.replace:t;if(o&&typeof t.count<"u"&&(n={...n,count:t.count}),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!o){n={...n};for(const i of r)delete n[i]}return n}static hasDefaultValue(t){const r="defaultValue";for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&o.startsWith(r)&&t[o]!==void 0)return!0;return!1}}class zp{constructor(t,r=br){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=r.create("languageUtils"),this.resolveHierarchyCache={},this.formattedCodes=new Map}clearCache(){this.resolveHierarchyCache={},this.formattedCodes.clear()}getScriptPartFromCode(t){if(t=jr(t),!t||!t.includes("-"))return null;const r=t.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(t){if(t=jr(t),!t||!t.includes("-"))return t;const r=t.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(t){if(!Z(t))return t;let r=this.formattedCodes.get(t);return r!==void 0||(r=this.formatUncached(t),this.formattedCodes.size>=1e3&&this.formattedCodes.clear(),this.formattedCodes.set(t,r)),r}formatUncached(t){const r=t.includes("-");if(r||this.options.cleanCode!==!1){let o;try{o=Intl.getCanonicalLocales(t)[0]}catch{}if(o&&(r||o.toLowerCase()===t.toLowerCase()))return this.options.lowerCaseLng?o.toLowerCase():o;if(o)return t.toLowerCase()}return this.options.lowerCaseLng||this.options.cleanCode&&!r?t.toLowerCase():t}isSupportedCode(t){if((this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length)return!0;if(!Array.isArray(this.supportedLngs))return this.supportedLngs.includes(t);const r=this.formatLanguageCode(t);return this.supportedLngs.some(o=>this.formatLanguageCode(o)===r)}getBestMatchFromCodes(t){if(!t)return null;let r;return t.forEach(o=>{if(r)return;const n=this.formatLanguageCode(o);(!this.options.supportedLngs||this.isSupportedCode(n))&&(r=n)}),!r&&this.options.supportedLngs&&t.forEach(o=>{if(r)return;const n=this.getScriptPartFromCode(o);if(this.isSupportedCode(n))return r=n;const i=this.getLanguagePartFromCode(o);if(this.isSupportedCode(i))return r=i;r=this.options.supportedLngs.map(a=>this.formatLanguageCode(a)).find(a=>a===i?!0:!a.includes("-")&&!i.includes("-")?!1:!!(a.includes("-")&&!i.includes("-")&&a.slice(0,a.indexOf("-"))===i))}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),Z(t)&&(t=[t]),Array.isArray(t))return t;const o=i=>Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(!r)return o("default")||[];let n=o(r);return n||(n=o(this.getScriptPartFromCode(r))),n||(n=o(this.formatLanguageCode(r))),n||(n=o(this.getLanguagePartFromCode(r))),n||(n=o("default")),n||[]}toResolveHierarchy(t,r){const o=this.options.fallbackLng,n=Array.isArray(o)?o.join("|"):o;n!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=n);const i=r===void 0||r===!1||Z(r),a=r===void 0&&typeof this.options.fallbackLng=="function",s=Z(t)&&i&&!a;let p=null;if(s){let c;r===void 0?c="undefined":r===!1?c="boolean:false":c=`string:${r}`,p=`${t.length}:${t}|${c}`}if(p!==null){const c=this.resolveHierarchyCache[p];if(c!==void 0)return c.slice()}const l=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],t),d=[],u=c=>{c&&(this.isSupportedCode(c)?d.push(c):this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`))};return Z(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&u(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&u(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&u(this.getLanguagePartFromCode(t))):Z(t)&&u(this.formatLanguageCode(t)),l.forEach(c=>{const f=this.formatLanguageCode(c);d.includes(f)||u(f)}),p!==null?(Object.keys(this.resolveHierarchyCache).length>=1e3&&(this.resolveHierarchyCache={}),this.resolveHierarchyCache[p]=d,d.slice()):d}}const Hp={zero:0,one:1,two:2,few:3,many:4,other:5},Up={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Yg{constructor(t,r={},o=br){this.languageUtils=t,this.options=r,this.logger=o.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,r={}){const o=jr(t==="dev"?"en":t),n=r.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:o,type:n});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(o,{type:n})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Up;if(!t.match(/-|_/))return Up;const p=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(p,r)}return Object.keys(this.pluralRulesCache).length>=1e3&&(this.pluralRulesCache={}),this.pluralRulesCache[i]=a,a}needsPlural(t,r={}){let o=this.getRule(t,r);return o||(o=this.getRule("dev",r)),o?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,r,o={}){return this.getSuffixes(t,o).map(n=>`${r}${n}`)}getSuffixes(t,r={}){let o=this.getRule(t,r);return o||(o=this.getRule("dev",r)),o?o.resolvedOptions().pluralCategories.sort((n,i)=>Hp[n]-Hp[i]).map(n=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${n}`):[]}getSuffix(t,r,o={}){const n=this.getRule(t,o);return n?`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${n.select(r)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",r,o))}}const qp=(e,t,r,o=".",n=!0)=>{let i=zg(e,t,r);return i==null&&n&&Z(r)&&(i=Ta(e,r,o),i===void 0&&(i=Ta(t,r,o))),i};class jp{constructor(t={},r=br){this.logger=r.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(o=>o),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:r,escapeValue:o,useRawValueToEscape:n,prefix:i,suffix:a,formatSeparator:s,unescapeSuffix:p,unescapePrefix:l,nestingPrefix:d,nestingSuffix:u,nestingOptionsSeparator:c,maxReplaces:f,alwaysFormat:h}=t.interpolation;this.escape=r!==void 0?r:Ug,this.escapeValue=o!==void 0?o:!0,this.useRawValueToEscape=n!==void 0?n:!1,this.prefix=i?gr(i):"{{",this.suffix=a?gr(a):"}}",this.formatSeparator=s||",",this.unescapePrefix=p?"":l?gr(l):"-",this.unescapeSuffix=this.unescapePrefix?"":p?gr(p):"",this.prefixText=i||"{{",this.nestingPrefixText=d||"$t(",this.nestingPrefix=gr(d||"$t("),this.nestingSuffix=gr(u||")"),this.nestingOptionsSeparator=c||",",this.maxReplaces=f||1e3,this.alwaysFormat=h!==void 0?h:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(r,o)=>r?.source===o?(r.lastIndex=0,r):new RegExp(o,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']|"[^"]*"|'[^']*'|\\((?:[^()"']|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,r,o,n){let i,a,s;const p=t,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=k=>{if(!k.includes(this.formatSeparator)){const E=qp(r,l,k,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,o,{...n,...r,interpolationkey:k}):E}const v=k.split(this.formatSeparator),w=v.shift().trim(),P=v.join(this.formatSeparator).trim();return this.format(qp(r,l,w,this.options.keySeparator,this.options.ignoreJSONStructure),P,o,{...n,...r,interpolationkey:w})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const u=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;if(Z(t)&&!t.includes(this.prefixText))return t;const f=[{regex:this.regexpUnescape,safeValue:k=>k},{regex:this.regexp,safeValue:k=>this.escapeValue?this.escape(k):k}],h=[];let b=0;return f.forEach(k=>{for(s=0;i=k.regex.exec(t);){const v=i.index-b,w=h.find(([D,O])=>v>=D&&v<O);if(w){k.regex.lastIndex=w[1]+b;continue}const P=i[1].trim();if(a=d(P),a===void 0)if(typeof u=="function"){const D=u(t,i,n);a=Z(D)?D:""}else if(n&&Object.prototype.hasOwnProperty.call(n,P.split(this.formatSeparator)[0].trim()))a="";else if(c){this.logger.debug&&this.logger.once(`${p}\0${i[0]}`,"warn",`missed to pass in variable ${P} for interpolating ${p}`),a=i[0];continue}else this.logger.warn(`missed to pass in variable ${P} for interpolating ${t}`),a="";else!Z(a)&&!this.useRawValueToEscape&&(a=Tn(a));const E=Tn(k.safeValue(a));if(t=t.slice(0,i.index)+E+t.slice(i.index+i[0].length),c?(k.regex===this.regexpUnescape?h.push([i.index,i.index+E.length]):b+=E.length-i[0].length,k.regex.lastIndex+=E.length,k.regex.lastIndex-=i[0].length):k.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,r,o={}){let n,i,a;const s=(u,c)=>{const f=this.nestingOptionsSeparator;if(!u.includes(f))return u;const h=u.split(new RegExp(`${gr(f)}[ ]*{`));let b=`{${h[1]}`;u=h[0],b=this.interpolate(b,a);const k=b.match(/'/g),v=b.match(/"/g);((k?.length??0)%2===0&&!v||(v?.length??0)%2!==0)&&(b=b.replace(/'/g,'"'));try{a=JSON.parse(b),c&&(a={...c,...a})}catch(w){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,w),`${u}${f}${b}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,u};if(Z(t)&&!t.includes(this.nestingPrefixText))return t;const p=new RegExp(this.nestingRegexp);let l="",d=0;for(;n=p.exec(t);){let u=[];a={...o},a=a.replace&&!Z(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const c=/{.*}/s.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(c!==-1&&(u=n[1].slice(c).split(this.formatSeparator).map(f=>f.trim()).filter(Boolean),n[1]=n[1].slice(0,c)),i=r(s.call(this,n[1].trim(),a),a),i&&n[0]===t&&!Z(i))return i;Z(i)||(i=Tn(i)),i||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${t}`),i=""),u.length&&(i=u.reduce((f,h)=>this.format(f,h,o.lng,{...o,interpolationkey:n[1].trim()}),i.trim())),l+=t.slice(d,n.index)+Tn(i),d=p.lastIndex,this.regexp.lastIndex=0}return d?l+t.slice(d):t}}const Xg=e=>{let t=e.toLowerCase().trim();const r={};if(e.includes("(")){const o=e.split("(");t=o[0].toLowerCase().trim();const n=o[1].slice(0,-1);t==="currency"&&!n.includes(":")?r.currency||(r.currency=n.trim()):t==="relativetime"&&!n.includes(":")?r.range||(r.range=n.trim()):n.split(";").forEach(a=>{if(a){const[s,...p]=a.split(":"),l=p.join(":").trim().replace(/^'+|'+$/g,""),d=s.trim();r[d]||(r[d]=l),l==="false"&&(r[d]=!1),l==="true"&&(r[d]=!0),isNaN(l)||(r[d]=parseInt(l,10))}})}return{formatName:t,formatOptions:r}},Zg=1e3,Wp=e=>{const t=new Map;return(r,o,n)=>{let i=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(i={...i,[n.interpolationkey]:void 0});let a;try{a=o+JSON.stringify(i)}catch{return e(jr(o),n)(r)}let s=t.get(a);return s||(s=e(jr(o),n),t.size>=Zg&&t.delete(t.keys().next().value),t.set(a,s)),s(r)}},Jg=e=>(t,r,o)=>e(jr(r),o)(t);class Qg{constructor(t={}){this.logger=br.create("formatter"),this.options=t,this.init(t)}init(t,r={interpolation:{}}){t?.logger?.create&&(this.logger=t.logger.create("formatter")),this.formatSeparator=r.interpolation.formatSeparator||",";const o=r.cacheInBuiltFormats?Wp:Jg;this.formats={number:o((n,i)=>{const a=new Intl.NumberFormat(n,{...i});return s=>a.format(s)}),currency:o((n,i)=>{const a=new Intl.NumberFormat(n,{...i,style:"currency"});return s=>a.format(s)}),datetime:o((n,i)=>{const a=new Intl.DateTimeFormat(n,{...i});return s=>a.format(s)}),relativetime:o((n,i)=>{const a=new Intl.RelativeTimeFormat(n,{...i});return s=>a.format(s,i.range||"day")}),list:o((n,i)=>{const a=new Intl.ListFormat(n,{...i});return s=>a.format(s)})}}add(t,r){this.formats[t.toLowerCase().trim()]=r}addCached(t,r){this.formats[t.toLowerCase().trim()]=Wp(r)}format(t,r,o,n={}){if(!r||t==null)return t;const i=r.split(this.formatSeparator),a=[];for(let p=0;p<i.length;p++){let l=i[p];for(;l.indexOf("(")>-1&&!l.includes(")")&&p+1<i.length;)l=`${l}${this.formatSeparator}${i[++p]}`;a.push(l)}return a.reduce((p,l)=>{const{formatName:d,formatOptions:u}=Xg(l);if(this.formats[d]){let c=p;try{const f=n?.formatParams?.[n.interpolationkey]||{},h=f.locale||f.lng||n.locale||n.lng||o;c=this.formats[d](p,h,{...u,...n,...f})}catch(f){this.logger.warn(f)}return c}else this.logger.warn(`there was no format function for ${d}`);return p},t)}}const eb=1e3,tb=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class rb extends Cn{constructor(t,r,o,n={}){super(),this.backend=t,this.store=r,this.services=o,this.languageUtils=o.languageUtils,this.options=n,this.logger=(o.logger||br).create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.failed=new Set,this.queue=[],this.backend?.init?.(o,n.backend,n),this.callbackApi=Sa(this.backend),this.backend&&this.callbackApi===void 0&&(this.backend.read||this.backend.create)&&this.logger.deprecate("backend: set callbackApi to declare the calling convention (true: read(language, namespace, callback) and create(languages, namespace, key, fallbackValue, callback, options); false: both return a promise or a value); guessing it from the number of parameters is deprecated")}queueLoad(t,r,o,n){const i={},a={},s={},p={};return t.forEach(l=>{let d=!0;r.forEach(u=>{const c=`${l}|${u}`;!o.reload&&this.store.hasResourceBundle(l,u)?this.state[c]=2:!o.reload&&this.state[c]<0||(this.state[c]===1?a[c]===void 0&&(a[c]=!0):(this.state[c]=1,d=!1,a[c]===void 0&&(a[c]=!0),i[c]===void 0&&(i[c]=!0),p[u]===void 0&&(p[u]=!0)))}),d||(s[l]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(p)}}loaded(t,r,o){const n=t.split("|"),i=n[0],a=n[1];if(r&&this.emit("failedLoading",i,a,r),!r&&o&&this.store.addResourceBundle(i,a,o,void 0,void 0,{skipCopy:!0}),this.state[t]=r?-1:2,r&&o&&(this.state[t]=0),this.failed.delete(t),r&&(this.failed.add(t),this.failed.size>eb)){const l=this.failed.values().next().value;this.failed.delete(l),this.state[l]<1&&delete this.state[l]}const s={},p=[];if(this.queue.forEach(l=>{if($g(l.loaded,[i],a),tb(l,t),r&&l.errors.push(r),l.pendingCount===0&&!l.done){Object.keys(l.loaded).forEach(d=>{Object.prototype.hasOwnProperty.call(s,d)||(s[d]={});const u=l.loaded[d];u.length&&u.forEach(c=>{s[d][c]===void 0&&(s[d][c]=!0)})}),l.done=!0;try{l.errors.length?l.callback(l.errors):l.callback()}catch(d){p.push(d)}}}),this.queue=this.queue.filter(l=>!l.done),this.emit("loaded",s),p.length)throw p[0]}read(t,r,o,n=0,i=this.retryTimeout,a){if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:r,fcName:o,tried:n,wait:i,callback:a});return}this.readingCalls++;const s=(l,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const u=this.waitingReads.shift();this.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}if(l&&d&&n<this.maxRetries){setTimeout(()=>{this.read(t,r,o,n+1,i*2,a)},i);return}a(l,d)},p=this.backend[o].bind(this.backend);if(this.callbackApi===!1||this.callbackApi===void 0&&p.length===2){let l;try{l=p(t,r)}catch(d){s(d);return}l&&typeof l.then=="function"?l.then(d=>s(null,d),s):s(null,l);return}return p(t,r,s)}prepareLoading(t,r,o={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();Z(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Z(r)&&(r=[r]);const i=this.queueLoad(t,r,o,n);if(!i.toLoad.length)return i.pending.length||n(),null;i.toLoad.forEach(a=>{this.loadOne(a)})}load(t,r,o){this.prepareLoading(t,r,{},o)}reload(t,r,o){this.prepareLoading(t,r,{reload:!0},o)}loadOne(t,r=""){const o=t.split("|"),n=o[0],i=o[1];this.read(n,i,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${r}loading namespace ${i} for language ${n} failed`,a),!a&&s&&this.logger.log(`${r}loaded namespace ${i} for language ${n}`,s),this.loaded(t,a,s)})}saveMissing(t,r,o,n,i,a={},s=()=>{},p=this.newestCloneHasLoadedNamespace||this.services?.utils?.hasLoadedNamespace){if(p&&!p(r)){this.logger.warn(`did not save key "${o}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(o==null||o==="")){if(this.backend?.create){const l={...a,isUpdate:i},d=this.backend.create.bind(this.backend);if(this.callbackApi===!1||this.callbackApi===void 0&&d.length<6)try{let u;this.callbackApi===!1||d.length===5?u=d(t,r,o,n,l):u=d(t,r,o,n),u&&typeof u.then=="function"?u.then(c=>s(null,c)).catch(s):s(null,u)}catch(u){s(u)}else d(t,r,o,n,s,l)}!t||!t[0]||this.store.addResource(t[0],r,o,n)}}}const Ca=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:!1,fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!1,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Z(e[1])&&(t.defaultValue=e[1]),Z(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const r=e[3]||e[2];Object.keys(r).forEach(o=>{t[o]=r[o]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Vp=e=>(Z(e.ns)&&(e.ns=[e.ns]),Z(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Z(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),An=()=>{},Gp=e=>{const t=Ca(),r={...t,...e};return r.interpolation={...t.interpolation,...e.interpolation},typeof r.overloadTranslationOptionHandler!="function"&&(r.overloadTranslationOptionHandler=t.overloadTranslationOptionHandler),r},Kp=e=>{const t=[].concat(e.supportedLngs||[],e.preload||[]);t.push(...Object.keys(e.resources||{}));const r=e.fallbackLng;return Z(r)||Array.isArray(r)?t.push(...[].concat(r)):r&&typeof r=="object"&&Object.keys(r).forEach(o=>{o!=="default"&&t.push(o),t.push(...[].concat(r[o]))}),t},_a=(e,t)=>!Z(t)||Ng(t)||e.configuredLngs?.has(t)?!1:(e.logger.once(`lng:${t}`,"warn",`refused the language code '${t.slice(0,64)}' from lng, changeLanguage(), the language detector or loadLanguages(): it is not configured and has other characters than letters, digits, '-', '_', '@' and '.' (or '..', or more than 128). List it in supportedLngs to use it`),!0),ob=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(r=>{typeof e[r]=="function"&&(e[r]=e[r].bind(e))})};class xo extends Cn{constructor(t={},r){if(super(),this.userOptions=Vp(t),this.options=Gp(this.userOptions),this.services={postProcessors:Object.create(null)},this.logger=new wo(null,this.options),this.modules={external:[]},ob(this),r&&!this.isInitialized&&!t.isClone){if(!this.userOptions.initAsync)return this.init(t,r),this;setTimeout(()=>{this.init(t,r)},0)}}init(t={},r){this.isInitializing=!0,typeof t=="function"&&(r=t,t={}),t.defaultNS==null&&t.ns&&(Z(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0])),Vp(t);const o={...this.userOptions,...t};this.options=Gp({...this.options,...t}),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator),this.options.isClone||(this.configuredLngs=new Set([...this.configuredLngs||[],...Kp(o)]));const n=l=>l?typeof l=="function"?new l:l:null;if(!this.options.isClone){this.logger.init(n(this.modules.logger),this.options);const{logger:l}=this;this.pendingWarnings?.forEach(f=>this.logger.warn(f)),this.pendingWarnings=void 0;let d;this.modules.formatter?d=this.modules.formatter:d=Qg;const u=new zp(this.options,l);this.store=new Fp(this.options.resources,this.options,l);const c=this.services;c.logger=l,c.resourceStore=this.store,c.languageUtils=u,c.pluralResolver=new Yg(u,{prepend:this.options.pluralSeparator},l),d&&(c.formatter=n(d),c.formatter.init&&c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new jp(this.options,l),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this),reloadResources:this.reloadResources.bind(this)},c.backendConnector=new rb(n(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",(f,...h)=>{this.emit(f,...h)}),this.modules.languageDetector&&(c.languageDetector=n(this.modules.languageDetector),c.languageDetector.init&&c.languageDetector.init(c,this.options.detection,this.options),c.languageDetector.async&&Sa(c.languageDetector)===void 0&&this.logger.deprecate("languageDetector: set callbackApi to declare how the async detect() answers (true: detect(callback); false: detect() returns a promise); guessing it from the number of parameters is deprecated")),this.modules.i18nFormat&&(c.i18nFormat=n(this.modules.i18nFormat),c.i18nFormat.init&&c.i18nFormat.init(this)),this.translator=new Dn(this.services,this.options),this.translator.on("*",(f,...h)=>{this.emit(f,...h)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,r||(r=An),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(l=>{this[l]=(...d)=>this.store[l](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=(...d)=>(this.store[l](...d),this)});const s=yo(),p=()=>{const l=(d,u)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(u),r(d,u)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initAsync?p():setTimeout(p,0),s}loadResources(t,r=An){let o=r;const n=Z(t)?t:this.language;if(typeof t=="function"&&(o=t),!this.options.resources||this.options.partialBundledLanguages){if(n?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return o();const i=[],a=s=>{if(!s||s==="cimode")return;this.services.languageUtils.toResolveHierarchy(s).forEach(l=>{l!=="cimode"&&(i.includes(l)||i.push(l))})};n?a(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(p=>a(p)),this.options.preload?.forEach?.(s=>a(s)),this.services.backendConnector.load(i,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),o(s)})}else o(null)}reloadResources(t,r,o){const n=yo();if(typeof t=="function"&&(o=t,t=void 0),typeof r=="function"&&(o=r,r=void 0),!t){const i=Object.keys(this.services.backendConnector.state).map(a=>a.split("|")[0]);t=[...new Set([...this.languages||[],...i])].filter(a=>a!=="cimode")}return r||(r=this.options.ns),o||(o=An),this.services.backendConnector.reload(t,r,i=>{n.resolve(),o(i)}),n}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");const r=o=>{if(this.modules[o]&&this.modules[o]!==t){const n=`use: this ${o} replaces the ${o} passed to an earlier use() call; only one ${o} is used per instance`;this.isInitializing||this.isInitialized?this.logger.warn(n):(this.pendingWarnings=this.pendingWarnings||[]).push(n)}this.modules[o]=t};return t.type==="backend"&&r("backend"),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&r("languageDetector"),t.type==="i18nFormat"&&r("i18nFormat"),t.type==="postProcessor"&&(this.services.postProcessors[t.name]=t),t.type==="formatter"&&r("formatter"),t.type==="3rdParty"&&this.modules.external.push(t),this}hydrate(t,r){return this.options.isClone?this:this.services.resourceStore?(t&&!this.initializedStoreOnce&&(this.services.resourceStore.data=t,Object.values(t).forEach(o=>{Object.keys(o).forEach(n=>{this.options.ns.includes(n)||this.options.ns.push(n)})}),this.initializedStoreOnce=!0,this.isInitialized=!0),r&&!this.initializedLanguageOnce&&(this.changeLanguage(r),this.initializedLanguageOnce=!0),this):(this.logger.warn("hydrate: call init() first, the instance has no resource store yet"),this)}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let r=0;r<this.languages.length;r++){const o=this.languages[r];if(!["cimode","dev"].includes(o)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}!this.resolvedLanguage&&!this.languages.includes(t)&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,r){this.isLanguageChangingTo=t;const o=yo();this.emit("languageChanging",t);const n=s=>{this.language=s,this.languages=this.services.languageUtils.toResolveHierarchy(s),this.resolvedLanguage=void 0,this.setResolvedLanguage(s)},i=(s,p)=>{p?this.isLanguageChangingTo===t&&(n(p),this.translator.changeLanguage(p),this.isLanguageChangingTo=void 0,this.emit("languageChanged",p),this.logger.log("languageChanged",p)):this.isLanguageChangingTo=void 0,o.resolve((...l)=>this.t(...l)),r&&r(s,(...l)=>this.t(...l))},a=s=>{!t&&!s&&this.services.languageDetector&&(s=[]);const{supportedLngs:p}=this.options;if(s&&!p){const u=[].concat(s).filter(c=>!_a(this,c));u.length<[].concat(s).length&&(s=u)}const l=Z(s)?s:s&&s[0];let d=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(Z(s)?[s]:s);p&&_a(this,d)&&(d=this.services.languageUtils.getBestMatchFromCodes([])),d&&(this.language||n(d),this.translator.language||this.translator.changeLanguage(d),this.services.languageDetector?.cacheUserLanguage?.(d)),this.loadResources(d,u=>{i(u,d)})};if(!t&&this.services.languageDetector&&!this.services.languageDetector.async)a(this.services.languageDetector.detect());else if(!t&&this.services.languageDetector&&this.services.languageDetector.async){const s=Sa(this.services.languageDetector);s===!1||s===void 0&&this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a)}else a(t);return o}getFixedT(t,r,o,n){const i=n?.scopeNs,a=(s,p,...l)=>{let d;typeof p!="object"?d=this.options.overloadTranslationOptionHandler([s,p].concat(l)):d={...p},d.lng=d.lng||a.lng,d.lngs=d.lngs||a.lngs;const u=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||a.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||o||a.keyPrefix);const c={...this.options,...d};Array.isArray(i)&&!u&&(c.ns=i),typeof d.keyPrefix=="function"&&(d.keyPrefix=Wr(d.keyPrefix,c));const f=this.options.keySeparator||".";let h;return d.keyPrefix&&Array.isArray(s)?h=s.map(b=>(typeof b=="function"&&(b=Wr(b,c)),`${d.keyPrefix}${f}${b}`)):(typeof s=="function"&&(s=Wr(s,c)),h=d.keyPrefix?`${d.keyPrefix}${f}${s}`:s),this.t(h,d)};return Z(t)?a.lng=t:a.lngs=t,a.ns=r,a.keyPrefix=o,a}t(...t){return this.translator?this.translator.translate(...t):(this.logger.warn("t: called before init(); returning an empty string"),"")}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t,this.translator?.options&&(this.translator.options.defaultNS=t)}hasLoadedNamespace(t,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const o=r.lng||this.resolvedLanguage||this.languages[0],n=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;const a=(l,d)=>{const u=this.services.backendConnector.state[`${l}|${d}`];return u===-1||u===0||u===2};if(r.precheck){const l=r.precheck(this,a);if(l!==void 0)return l}if(this.hasResourceBundle(o,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages)return!0;const{languageUtils:s}=this.services,p=r.lng?s.isSupportedCode(o)&&s.toResolveHierarchy(o,!1)[0]:o;return!!((!p||a(p,t))&&(!n||a(i,t)))}loadNamespaces(t,r){const o=yo();return!this.options.ns||!this.services.backendConnector?(r&&r(),Promise.resolve()):(Z(t)&&(t=[t]),t.forEach(n=>{this.options.ns.includes(n)||this.options.ns.push(n)}),this.loadResources(n=>{o.resolve(),r&&r(n)}),o)}loadLanguages(t,r){const o=yo();Z(t)&&(t=[t]);const n=this.options.preload||[],i=t.filter(a=>!n.includes(a)&&!_a(this,a)&&this.services.languageUtils.isSupportedCode(a));return i.length?(this.options.preload=n.concat(i),this.loadResources(a=>{o.resolve(),r&&r(a)}),o):(r&&r(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"ltr";try{const n=new Intl.Locale(t);if(n&&n.getTextInfo){const i=n.getTextInfo();if(i&&i.direction)return i.direction}}catch{}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],o=this.services?.languageUtils||new zp(Ca());return t.toLowerCase().indexOf("-latn")>1?"ltr":r.includes(o.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},r){const o=new xo(t,r);return o.createInstance=xo.createInstance,o}cloneInstance(t={},r=An){const o=t.forkResourceStore;o&&(t={...t},delete t.forkResourceStore);const n={...this.options,preload:!1,...t,isClone:!0},i=new xo(n);if(i.logger=t.debug!==void 0||t.prefix!==void 0?this.logger.clone(t):this.logger,["store","language"].forEach(s=>{i[s]=this[s]}),i.services={...this.services},i.services.postProcessors=Object.create(this.services.postProcessors),i.services.utils={...i.services.utils,hasLoadedNamespace:i.hasLoadedNamespace.bind(i),reloadResources:i.reloadResources.bind(i)},o){const s=l=>{const d=Array.isArray(l)?[...l]:{...l};return Object.keys(d).forEach(u=>{d[u]&&typeof d[u]=="object"&&(d[u]=s(d[u]))}),d},p=s(this.store.data);i.store=new Fp(p,n,this.logger),i.services.resourceStore=i.store}if(t.interpolation){const p={...Ca().interpolation,...this.options.interpolation,...t.interpolation},l={...n,interpolation:p};i.services.interpolator=new jp(l,this.logger)}return i.configuredLngs=new Set([...this.configuredLngs||[],...Kp(t)]),i.translator=new Dn(i.services,n),i.translator.on("*",(s,...p)=>{i.emit(s,...p)}),i.init(n,r),i.translator.options=n,i.translator.backendConnector.newestCloneHasLoadedNamespace=i.hasLoadedNamespace.bind(i),i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const nt=xo.createInstance(),Da=nt.createInstance;nt.dir,nt.init,nt.loadResources,nt.reloadResources,nt.use,nt.changeLanguage,nt.getFixedT,nt.t,nt.exists,nt.setDefaultNamespace,nt.hasLoadedNamespace,nt.loadNamespaces,nt.loadLanguages;const nb={"toolbar.save":"保存","toolbar.preview":"预览","diagnostic.expressionUnexpectedEnd":"表达式意外结束","diagnostic.parser.trailingContent":"表达式存在多余内容: {value}","diagnostic.parser.expected":'位置 {pos}: 期望 "{value}"',"diagnostic.parser.memberName":"位置 {pos}: 成员访问需要属性名","diagnostic.parser.invalidNumber":"非法数字: {value}","diagnostic.parser.objectKey":"位置 {pos}: 对象键必须是标识符或字符串","diagnostic.parser.unexpectedToken":"位置 {pos}: 意外的符号: {value}","diagnostic.lexer.unterminatedString":"字符串未闭合","diagnostic.lexer.keyword":"不允许使用关键字: {word}","diagnostic.lexer.forbidden":"禁止访问: {word}","diagnostic.lexer.noFunctionDef":"不允许函数定义","diagnostic.lexer.noAssignment":"不允许赋值","diagnostic.lexer.noMultipleStatements":"不允许多条语句","diagnostic.lexer.invalidChar":"非法字符: {ch}","diagnostic.evaluator.undefinedIdentifier":"未定义的标识符: {name}","diagnostic.evaluator.unknownOperator":"未知运算符: {op}","diagnostic.evaluator.unknownUnaryOperator":"未知一元运算符: {op}","diagnostic.evaluator.nullProperty":"无法访问空值的属性","diagnostic.evaluator.forbiddenProperty":"禁止访问属性: {property}","diagnostic.evaluator.mathNotMethod":"Math.{name} 不是方法","diagnostic.evaluator.noMethodCall":"不支持方法调用,请使用顶级函数","diagnostic.evaluator.notFunction":"{name} 不是函数","diagnostic.evaluator.forbiddenCall":"不允许调用: {name}","diagnostic.template.unclosedBrace":"位置 {pos}: 花括号未闭合","diagnostic.template.emptyExpression":"位置 {pos}: 空表达式","diagnostic.pagination.insufficientHeight":"页面可用高度不足: paper={paper}mm, margins={margins}mm, header={header}mm, footer={footer}mm","diagnostic.pagination.repeatHeaderOverflow":"表格 {id} 的重复表头高度 ({repeat}mm) 超过页面可用高度 ({avail}mm),请减少重复表头行","diagnostic.tiling.continuousUnsupported":"连续纸不支持拼版打印,请将模板纸张改为固定纸张或关闭拼版","diagnostic.tiling.sheetContinuous":"拼版目标纸张不能是连续纸","diagnostic.tiling.sheetSizeInvalid":"拼版自定义纸张宽高必须是大于 0 的数值(mm)","diagnostic.tiling.columnsInvalid":"拼版列数必须是大于 0 的整数","diagnostic.tiling.rotationNote":"(内容旋转 {angle}°,每格 {width}×{height}mm)","diagnostic.tiling.columnsExceedWidth":"拼版列数 {columns} 超出纸面可用宽度:{sheet}mm − 左右留白 {margin}mm = {avail}mm,最多可放 {max} 列;当前 {columns} 列 {label}mm 标签含间距需要 {need}mm{rotation}","diagnostic.tiling.labelHeightExceed":"标签高度 {height}mm 超出纸面可用高度 {avail}mm,拼版每张 0 行;请缩小标签高度或改用横向纸{rotation}","diagnostic.multiTemplate.emptyPages":"多页面模板至少需要一页","diagnostic.multiTemplate.continuous":"多页面模板不支持连续纸({page})","diagnostic.multiTemplate.tiling":"多页面模板不支持标签拼版({page})","diagnostic.multiTemplate.paperMismatch":"多页面模板各页纸张尺寸必须一致({page} {width}×{height}mm 与首页 {firstWidth}×{firstHeight}mm 不同)","diagnostic.multiTemplate.emptyData":"多页面模板至少需要一份数据","diagnostic.multiTemplate.pageLabelNamed":"第 {index} 页「{name}」","diagnostic.multiTemplate.pageLabelPlain":"第 {index} 页","client.cancelled":"连接已取消","client.invalidToken":"配对 token 无效或来源未授权","client.notRunning":"未发现运行中的打印客户端(已探测默认端口区间),请确认客户端已启动","client.notConnected":"打印客户端未连接","client.timeout":"请求 {type} 超时未响应","client.closed":"连接已关闭","client.disconnected":"与客户端的连接中断","client.unregisteredHandler":"桌面端请求未注册处理器","client.internalError":"内部错误","table.atLeastTwoCells":"至少选择 2 个单元格","table.crossRowTypes":"合并区域不能跨越不同类型的行","table.dataVerticalMerge":"数据行将按列表展开,纵向合并请使用单元格属性「按值合并」","table.partialOverlap":"选区与已有合并区域部分重叠","table.lastRow":"不能删除最后一行","table.lastColumn":"不能删除最后一列","table.dataRowExists":"数据行已存在(第 {row} 行),全表最多一行","table.headerContinuous":"标题行必须从表格顶部连续设置","table.subtotalAfterData":"请先设置数据行,小计/汇总行必须位于数据行之后","table.subtotalBeforeData":"小计/汇总行必须位于数据行之后","table.subtotalBeforeSummary":"小计行必须位于汇总行之前","table.summaryAfterSubtotal":"汇总行必须位于小计行之后","table.headerBreak":"取消该标题行会导致标题行不连续,请先调整后续标题行","table.defaultHeader":"列{index}","table.borderHint":"线型 / 宽度 / 颜色是待应用规格:选中格已有的边框规格一致时会填进这三行;四边不一致的项显示「混合」,一条边都没有时显示「无 / 0」。改完点「全部 / 外侧 / 内部」或勾选上、下、左、右某条边才会写入选中的单元格;「无」是清除边框","table.borderHintMulti":"多选时不回显单格边框:线型 / 宽度 / 颜色按当前设置作为批写规格,点「全部 / 外侧 / 内部」或勾选某条边后写入所有选中格;「无」是清除边框","table.borderHintMixed":"当前单元格四边边框规格不一致:带「混合」的项不谎报,未改项在点「全部 / 外侧 / 内部」或勾选单边时按缺省档(实线 0.75pt)写入,改任一项即按该值批写","diagnostic.pagination.overflowTop":"元素 {id} 旋转 {rot}° 后顶部超出页首 {amount}mm,打印将被裁切","diagnostic.pagination.overflowRight":"元素 {id} 超出纸面右侧 {amount}mm,打印将被裁切","diagnostic.pagination.overflowLeft":"元素 {id} 超出纸面左侧 {amount}mm,打印将被裁切","crop.sampleNote":"图片还没设置,上面按内置示例图演示取位;换上真图后档位与可挪量按真图重算","crop.verticalPosition":"垂直位置 (%)","crop.horizontalPosition":"水平位置 (%)","crop.scaleLabel":"放大比例 (%)","crop.originalValue":"已保留模板里的原值;改动下面任一项就整体替换成新的取位","crop.movableBoth":"水平可挪 {x}mm、垂直可挪 {y}mm:0 贴左/贴顶,100 贴右/贴底","crop.movableX":"水平可挪 {x}mm;垂直这一轴已贴满,挪不动","crop.movableY":"垂直可挪 {y}mm;水平这一轴已贴满,挪不动","crop.noRoom":"这个缩放下图与框正好一样大,两轴都没有可挪的余量","crop.top":"顶部","crop.center":"居中","crop.bottom":"底部","crop.left":"左侧","crop.right":"右侧","crop.topLeft":"左上","crop.topCenter":"上中","crop.topRight":"右上","crop.middleLeft":"左中","crop.middleRight":"右中","crop.bottomLeft":"左下","crop.bottomCenter":"下中","crop.bottomRight":"右下","crop.fitContain":"包含(保持比例)","crop.fitCover":"剪裁(等比铺满后裁边)","crop.fitFill":"拉伸填满","crop.fitNone":"原始尺寸","crop.fitScaleDown":"缩小(保持比例)","barcode.recommendOk":"按 {dpi}dpi 推荐条宽倍率 {rec}(每模块 {recDots} 个打印点 = {width}mm,取达到 {min}mm 下限的最小档);当前倍率 {current} 折算为 {curDots} 点 / {curWidth}mm,已达标。这里只提示,不会替你改值","barcode.recommendLow":"按 {dpi}dpi 推荐条宽倍率 {rec}(每模块 {recDots} 个打印点 = {width}mm,取达到 {min}mm 下限的最小档);当前倍率 {current} 只有 {curDots} 点 / {curWidth}mm,低于下限。这里只提示,不会替你改值","code.rotateNote":"条码与二维码仅支持 90° 步进;任意角度需 385dpi 以上打印头","colorPicker.pickColor":"颜色选择","colorPicker.hexValue":"颜色值","colorPicker.customColor":"自定义颜色","colorPicker.hue":"色相","colorPicker.commonColors":"常用颜色","colorPicker.clear":"清除选中的颜色","colorPicker.clearShort":"清除","save.geometryWarningConfirm":`出纸提示:部分内容超出纸面,打印时会被裁切。
1
+ (function(Z){typeof define=="function"&&define.amd?define(Z):Z()})((function(){"use strict";const Z=e=>typeof e=="string",yo=()=>{let e,t;const r=new Promise((o,n)=>{e=o,t=n});return r.resolve=e,r.reject=t,r},Tn=e=>e==null?"":String(e),Bg=e=>Z(e)&&/^[A-Za-z0-9_@.-]{1,128}$/.test(e)&&!e.includes("..")&&!["__proto__","constructor","prototype"].includes(e),Sa=e=>e?.callbackApi??e?.constructor?.callbackApi,Ng=(e,t,r)=>{e.forEach(o=>{t[o]&&(r[o]=t[o])})},Fg=/###/g,Ap=e=>e&&e.includes("###")?e.replace(Fg,"."):e,Op=e=>!e||Z(e),vo=(e,t,r)=>{const o=Z(t)?t.split("."):t;let n=0;for(;n<o.length-1;){if(Op(e))return{};const i=Ap(o[n]);!e[i]&&r&&(e[i]=new r),Object.prototype.hasOwnProperty.call(e,i)?e=e[i]:e={},++n}return Op(e)?{}:{obj:e,k:Ap(o[n])}},Rp=(e,t,r)=>{const{obj:o,k:n}=vo(e,t,Object);if(o!==void 0||t.length===1){o[n]=r;return}let i=t[t.length-1],a=t.slice(0,t.length-1),s=vo(e,a,Object);for(;s.obj===void 0&&a.length;)i=`${a[a.length-1]}.${i}`,a=a.slice(0,a.length-1),s=vo(e,a,Object),s?.obj&&typeof s.obj[`${s.k}.${i}`]<"u"&&(s.obj=void 0);s.obj[`${s.k}.${i}`]=r},$g=(e,t,r,o)=>{const{obj:n,k:i}=vo(e,t,Object);(!Object.prototype.hasOwnProperty.call(n,i)||!n[i])&&(n[i]=[]),n[i].push(r)},Mn=(e,t)=>{const{obj:r,k:o}=vo(e,t);if(r&&Object.prototype.hasOwnProperty.call(r,o))return r[o]},zg=(e,t,r)=>{const o=Mn(e,r);return o!==void 0?o:Mn(t,r)},Ip=e=>e===null||typeof e!="object"||e instanceof String,Lp=(e,t,r)=>{for(const o in t)o!=="__proto__"&&o!=="constructor"&&(Object.prototype.hasOwnProperty.call(e,o)?Ip(e[o])||Ip(t[o])?r&&(e[o]=t[o]):Lp(e[o],t[o],r):e[o]=t[o]);return e},gr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),Hg={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Ug=e=>Z(e)?e.replace(/[&<>"']/g,t=>Hg[t]):e;class qg{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const r=this.regExpMap.get(t);if(r!==void 0)return r;const o=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,o),this.regExpQueue.push(t),o}}const jg=[" ",",","?","!",";"],Wg=new qg(20),Vg=(e,t,r)=>{t=t||"",r=r||"";const o=jg.filter(a=>!t.includes(a)&&!r.includes(a));if(o.length===0)return!0;const n=Wg.getRegExp(`(${o.map(a=>a==="?"?"\\?":a).join("|")})`);let i=!n.test(e);if(!i){const a=e.indexOf(r);a>0&&!n.test(e.substring(0,a))&&(i=!0)}return i},Ta=(e,t,r=".")=>{if(!e)return;if(e[t]||!r)return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const o=t.split(r);let n=e;for(let i=0;i<o.length;){if(!n||typeof n!="object")return;let a,s="";for(let p=i;p<o.length;++p)if(p!==i&&(s+=r),s+=o[p],a=n[s],(typeof a=="function"||s==="__proto__")&&!Object.prototype.hasOwnProperty.call(n,s)&&(a=void 0),a!==void 0){if(["string","number","boolean"].includes(typeof a)&&p<o.length-1)continue;i+=p-i+1;break}n=a}return n},jr=e=>e?.replace(/_/g,"-"),Gg={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class wo{constructor(t,r={}){this.init(t,r)}init(t,r={}){this.prefix=r.prefix||"i18next:",this.logger=t||Gg,this.options=r,this.debug=r.debug,this.seen=new Set}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}once(t,r,...o){return!this.debug||this.seen.has(t)||this.seen.size>=1e3?null:(this.seen.add(t),this[r](...o))}forward(t,r,o,n){return n&&!this.debug?null:(t=t.map(i=>Z(i)?i.replace(/[\r\n\x00-\x1F\x7F]/g," "):i),Z(t[0])&&(t[0]=`${o}${this.prefix} ${t[0]}`),this.logger[r](t))}create(t){return new wo(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new wo(this.logger,t)}}var br=new wo;const Bp=new WeakSet;class Cn{constructor(){this.observers={}}on(t,r){return t.split(" ").forEach(o=>{this.observers[o]||(this.observers[o]=new Map);const n=this.observers[o].get(r)||0;this.observers[o].set(r,n+1)}),this}off(t,r){(typeof t=="string"?t.split(" "):[t]).forEach(o=>{if(this.observers[o]){if(!r){delete this.observers[o];return}this.observers[o].delete(r),Bp.has(r)&&this.observers[o].forEach((n,i)=>{i.listener===r&&this.observers[o].delete(i)})}})}once(t,r){const o=(...n)=>{this.off(t,o),r(...n)};return o.listener=r,Bp.add(r),this.on(t,o),this}emit(t,...r){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([n,i])=>{for(let a=0;a<i;a++)n(...r)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([n,i])=>{for(let a=0;a<i;a++)n(t,...r)})}}const Np=new WeakSet,Ma=(e,...t)=>{if(t.some(r=>!Z(r)))throw new TypeError(`${e}: pass language, namespace${e==="addResource"?" and key":""} as separate strings; the dotted form ('en.translation.key') was removed in i18next v27`)};class Fp extends Cn{constructor(t,r={ns:["translation"],defaultNS:"translation"},o=br){super(),this.data=t||{},this.options=r,this.logger=o.create("resourceStore"),this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.includes(t)||this.options.ns.push(t)}removeNamespaces(t){const r=this.options.ns.indexOf(t);r>-1&&this.options.ns.splice(r,1)}getResource(t,r,o,n={}){const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,a=n.ignoreJSONStructure!==void 0?n.ignoreJSONStructure:this.options.ignoreJSONStructure,s=[t,r];o&&(Array.isArray(o)?s.push(...o):Z(o)&&i?s.push(...o.split(i)):s.push(o));const p=Mn(this.data,s);return p!=null||!a||!Z(o)?p:Ta(this.data?.[t]?.[r],o,i)}addResource(t,r,o,n,i={silent:!1}){Ma("addResource",t,r,o);const a=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let s=[t,r];o&&(s=s.concat(a?o.split(a):o)),this.addNamespaces(r),Rp(this.data,s,n),i.silent||this.emit("added",t,r,o,n)}addResources(t,r,o,n={silent:!1}){Ma("addResources",t,r),Object.keys(o||{}).forEach(i=>{i==="__proto__"||i==="constructor"||this.addResource(t,r,i,o[i],{silent:!0})}),n.silent||this.emit("added",t,r,o)}addResourceBundle(t,r,o,n,i,a={silent:!1,skipCopy:!1}){Ma("addResourceBundle",t,r);const s=[t,r];this.addNamespaces(r);let p=Mn(this.data,s)||{};a.skipCopy||(o=JSON.parse(JSON.stringify(o))),n?Lp(p,o,i):p={...p,...o},Rp(this.data,s,p),a.silent||this.emit("added",t,r,o)}removeResourceBundle(t,r){this.hasResourceBundle(t,r)&&delete this.data[t][r],this.removeNamespaces(r),this.emit("removed",t,r)}hasResourceBundle(t,r){return this.getResource(t,r)!==void 0}getResourceBundle(t,r){return r||(r=this.options.defaultNS),this.getResource(t,r)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const r=this.getDataByLanguage(t);return!!(r&&Object.keys(r)||[]).find(n=>{const i=r[n];return Np.has(i)?!0:!i||Object.keys(i).length===0?!1:(typeof i=="object"&&Np.add(i),!0)})}toJSON(){return this.data}}const $p=Symbol("i18next/PATH_KEY");function Kg(){const e=[],t=Object.create(null);let r;return t.get=(o,n)=>(r?.revoke?.(),n===$p?e:(e.push(n),r=Proxy.revocable(o,t),r.proxy)),Proxy.revocable(Object.create(null),t).proxy}function Wr(e,t){const{[$p]:r}=e(Kg()),o=t?.keySeparator||".",n=t?.nsSeparator??":",i=t?.enableSelector==="strict";if(r.length>1&&n){const a=t?.ns,s=i?Array.isArray(a)?a:a?[a]:null:Array.isArray(a)?a:null;if(s&&(i?s:s.length>1?s.slice(1):[]).includes(r[0]))return`${r[0]}${n}${r.slice(1).join(o)}`}return r.join(o)}const _n=e=>!Z(e)&&typeof e!="boolean"&&typeof e!="number";class Dn extends Cn{constructor(t,r={}){super(),Ng(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils","postProcessors"],t,this),this.options=r,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=(t.logger||br).create("translator"),this.checkedLoadedFor={}}changeLanguage(t){t&&(this.language=t)}exists(t,r={interpolation:{}}){const o={...r};if(t==null)return!1;const n=this.resolve(t,o);if(n?.res===void 0)return!1;const i=_n(n.res);return!(o.returnObjects===!1&&i)}extractFromKey(t,r){let o=r.nsSeparator!==void 0?r.nsSeparator:this.options.nsSeparator;o===void 0&&(o=":");const n=r.keySeparator!==void 0?r.keySeparator:this.options.keySeparator;let i=r.ns||this.options.defaultNS||[];const a=o&&t.includes(o),s=!this.options.userDefinedKeySeparator&&!r.keySeparator&&!this.options.userDefinedNsSeparator&&!r.nsSeparator&&!Vg(t,o,n);if(a&&!s){const p=t.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:t,namespaces:Z(i)?[i]:i};const l=t.split(o);(o!==n||o===n&&this.options.ns.includes(l[0]))&&(i=l.shift()),t=l.join(n===!1?o:n)}return{key:t,namespaces:Z(i)?[i]:i}}translate(t,r,o){let n=typeof r=="object"?{...r}:r;if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),t==null)return"";typeof t=="function"&&(t=Wr(t,{...this.options,...n})),Array.isArray(t)||(t=[String(t)]),t=t.map(M=>typeof M=="function"?Wr(M,{...this.options,...n}):String(M));const i=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:s,namespaces:p}=this.extractFromKey(t[t.length-1],n),l=p[p.length-1];let d=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const u=n.lng||this.language,c=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u?.toLowerCase()==="cimode")return c?i?{res:`${l}${d}${s}`,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${d}${s}`:i?{res:s,usedKey:s,exactUsedKey:s,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:s;const f=this.resolve(t,n);let h=f?.res;const b=f?.usedKey||s,k=f?.exactUsedKey||s,v=["[object Number]","[object Function]","[object RegExp]"],w=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,P=!this.i18nFormat||this.i18nFormat.handleAsObject,E=n.count!==void 0&&!Z(n.count),D=Dn.hasDefaultValue(n),O=E?this.pluralResolver.getSuffix(u,n.count,n):"",A=n.ordinal&&E?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",R=E&&!n.ordinal&&n.count===0,_=this.options.pluralSeparator,I=R&&n[`defaultValue${_}zero`]||n[`defaultValue${O}`]||n[`defaultValue${A}`]||(n.defaultValue??(E?n[`defaultValue${n.ordinal?`${_}ordinal${_}`:_}other`]:void 0));let S=h;P&&!h&&D&&(S=I);const N=_n(S),F=Object.prototype.toString.apply(S),H=P&&S&&N&&!v.includes(F)&&!(Z(w)&&Array.isArray(S)),le=H&&!n.returnObjects&&!this.options.returnObjects;if(le&&this.options.returnedObjectHandler){const M=this.options.returnedObjectHandler(b,S,{...n,ns:p});return i?(f.res=M,f.usedParams=this.getUsedParamsDetails(n),f):M}if(le&&this.logger.warn("accessing an object - but returnObjects options is not enabled!"),H&&!le){if(a){const M=Array.isArray(S),ne=M?[]:{},Se=M?k:b;for(const Pe in S)if(Object.prototype.hasOwnProperty.call(S,Pe)){const K=`${Se}${a}${Pe}`;D&&!h?ne[Pe]=this.translate(K,{...n,defaultValue:_n(I)?I[Pe]:void 0,joinArrays:!1,ns:p}):ne[Pe]=this.translate(K,{...n,joinArrays:!1,ns:p}),ne[Pe]===K&&(ne[Pe]=S[Pe])}h=ne}}else if(P&&Z(w)&&Array.isArray(h))h=h.join(w),h&&(h=this.extendTranslation(h,t,n,f,o));else{let M=!1,ne=!1;le&&(h=void 0),!this.isValidLookup(h)&&D&&!(le&&_n(I))&&(M=!0,h=I),!this.isValidLookup(h)&&!(M&&h==="")&&(ne=!0,h=s);const Pe=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ne?void 0:h,K=D&&I!==h&&this.options.updateMissing;if(!le&&(ne||M||K)){if(this.logger.log(K?"updateKey":"missingKey",u,l,E&&!K?`${s}${this.pluralResolver.getSuffix(u,n.count,n)}`:s,K?I:h),a){const ke=this.resolve(s,{...n,keySeparator:!1});ke&&ke.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ue=[];const me=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&me&&me[0])for(let ke=0;ke<me.length;ke++)ue.push(me[ke]);else this.options.saveMissingTo==="all"?ue=this.languageUtils.toResolveHierarchy(n.lng||this.language):ue.push(n.lng||this.language);const we=(ke,te,Me)=>{const se=D&&Me!==h?Me:Pe;this.options.missingKeyHandler?this.options.missingKeyHandler(ke,l,te,se,K,n):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(ke,l,te,se,K,n,void 0,this.utils?.hasLoadedNamespace),this.emit("missingKey",ke,l,te,h)};this.options.saveMissing&&(this.options.saveMissingPlurals&&E?ue.forEach(ke=>{const te=this.pluralResolver.getSuffixes(ke,n);R&&n[`defaultValue${this.options.pluralSeparator}zero`]&&!te.includes(`${this.options.pluralSeparator}zero`)&&te.push(`${this.options.pluralSeparator}zero`),te.forEach(Me=>{we([ke],s+Me,n[`defaultValue${Me}`]||I)})}):we(ue,s,I))}h=this.extendTranslation(h,t,n,f,o),ne&&h===s&&this.options.appendNamespaceToMissingKey&&(h=`${l}${d}${s}`),(ne||M)&&this.options.parseMissingKeyHandler&&(h=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}${d}${s}`:s,M?h:void 0,n))}return i?(f.res=h,f.usedParams=this.getUsedParamsDetails(n),f):h}extendTranslation(t,r,o,n,i){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...o},o.lng||this.language||n.usedLng,n.usedNS,n.usedKey,{resolved:n});else if(!o.skipInterpolation){o.interpolation&&this.interpolator.init({...o,interpolation:{...this.options.interpolation,...o.interpolation}});const p=Z(t)&&(o?.interpolation?.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let l;if(p){const u=t.includes(this.interpolator.nestingPrefixText)?t.match(this.interpolator.nestingRegexp):null;l=u&&u.length}let d=o.replace&&!Z(o.replace)?o.replace:o;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),t=this.interpolator.interpolate(t,d,o.lng||this.language||n.usedLng,o),p){const u=t.includes(this.interpolator.nestingPrefixText)?t.match(this.interpolator.nestingRegexp):null,c=u&&u.length;l<c&&(o.nest=!1)}!o.lng&&n&&n.res&&(o.lng=this.language||n.usedLng),o.nest!==!1&&(t=this.interpolator.nest(t,(...u)=>i?.[0]===u[0]&&!o.context?(this.logger.warn(`It seems you are nesting recursively key: ${u[0]} in key: ${r[0]}`),null):this.translate(...u,r),o)),o.interpolation&&this.interpolator.reset()}const a=o.postProcess||this.options.postProcess,s=Z(a)?[a]:a;if(t!=null&&s?.length&&o.applyPostProcessor!==!1){const p=this.options?.postProcessPassResolved?{i18nResolved:{...n,usedParams:this.getUsedParamsDetails(o)},...o}:o;s.forEach(l=>{const d=this.postProcessors?.[l];if(!d){this.logger.once(`postProcess:${l}`,"warn",`postProcess: '${l}' is not registered on this i18next instance; call use() with it on this instance`);return}t=d.process(t,r,p,this)??t})}return t}resolve(t,r={}){let o,n,i,a,s;return Z(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(p=>typeof p=="function"?Wr(p,{...this.options,...r}):p)),t.forEach(p=>{if(this.isValidLookup(o))return;const l=this.extractFromKey(p,r),d=l.key;n=d;let u=l.namespaces;this.options.fallbackNS&&(u=u.concat(this.options.fallbackNS));const c=r.count!==void 0&&!Z(r.count),f=c&&!r.ordinal&&r.count===0,h=r.context!==void 0&&(Z(r.context)||typeof r.context=="number")&&r.context!=="",b=r.lngs?r.lngs:this.languageUtils.toResolveHierarchy(r.lng||this.language,r.fallbackLng);u.forEach(k=>{this.isValidLookup(o)||(s=k,!this.checkedLoadedFor[`${b[0]}-${k}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(s)&&(this.checkedLoadedFor[`${b[0]}-${k}`]=!0,this.logger.warn(`key "${n}" for languages "${b.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),b.forEach(v=>{if(this.isValidLookup(o))return;a=v;const w=[d];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(w,d,v,k,r);else{let E;c&&(E=this.pluralResolver.getSuffix(v,r.count,r));const D=`${this.options.pluralSeparator}zero`,O=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(c&&(r.ordinal&&E.startsWith(O)&&w.push(d+E.replace(O,this.options.pluralSeparator)),w.push(d+E),f&&w.push(d+D)),h){const A=`${d}${this.options.contextSeparator||"_"}${r.context}`;w.push(A),c&&(r.ordinal&&E.startsWith(O)&&w.push(A+E.replace(O,this.options.pluralSeparator)),w.push(A+E),f&&w.push(A+D))}if(c){const A=`${r.ordinal?O:this.options.pluralSeparator}other`;E!==A&&(h&&w.unshift(`${d}${this.options.contextSeparator||"_"}${r.context}${A}`),w.unshift(d+A))}}let P;for(;P=w.pop();)this.isValidLookup(o)||(i=P,o=this.getResource(v,k,P,r))}))})}),{res:o,usedKey:n,exactUsedKey:i,usedLng:a,usedNS:s}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,r,o,n={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,r,o,n):this.resourceStore.getResource(t,r,o,n)}getUsedParamsDetails(t={}){const r=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],o=t.replace&&!Z(t.replace);let n=o?t.replace:t;if(o&&typeof t.count<"u"&&(n={...n,count:t.count}),this.options.interpolation.defaultVariables&&(n={...this.options.interpolation.defaultVariables,...n}),!o){n={...n};for(const i of r)delete n[i]}return n}static hasDefaultValue(t){const r="defaultValue";for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)&&o.startsWith(r)&&t[o]!==void 0)return!0;return!1}}class zp{constructor(t,r=br){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=r.create("languageUtils"),this.resolveHierarchyCache={},this.formattedCodes=new Map}clearCache(){this.resolveHierarchyCache={},this.formattedCodes.clear()}getScriptPartFromCode(t){if(t=jr(t),!t||!t.includes("-"))return null;const r=t.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}getLanguagePartFromCode(t){if(t=jr(t),!t||!t.includes("-"))return t;const r=t.split("-");return this.formatLanguageCode(r[0])}formatLanguageCode(t){if(!Z(t))return t;let r=this.formattedCodes.get(t);return r!==void 0||(r=this.formatUncached(t),this.formattedCodes.size>=1e3&&this.formattedCodes.clear(),this.formattedCodes.set(t,r)),r}formatUncached(t){const r=t.includes("-");if(r||this.options.cleanCode!==!1){let o;try{o=Intl.getCanonicalLocales(t)[0]}catch{}if(o&&(r||o.toLowerCase()===t.toLowerCase()))return this.options.lowerCaseLng?o.toLowerCase():o;if(o)return t.toLowerCase()}return this.options.lowerCaseLng||this.options.cleanCode&&!r?t.toLowerCase():t}isSupportedCode(t){if((this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length)return!0;if(!Array.isArray(this.supportedLngs))return this.supportedLngs.includes(t);const r=this.formatLanguageCode(t);return this.supportedLngs.some(o=>this.formatLanguageCode(o)===r)}getBestMatchFromCodes(t){if(!t)return null;let r;return t.forEach(o=>{if(r)return;const n=this.formatLanguageCode(o);(!this.options.supportedLngs||this.isSupportedCode(n))&&(r=n)}),!r&&this.options.supportedLngs&&t.forEach(o=>{if(r)return;const n=this.getScriptPartFromCode(o);if(this.isSupportedCode(n))return r=n;const i=this.getLanguagePartFromCode(o);if(this.isSupportedCode(i))return r=i;r=this.options.supportedLngs.map(a=>this.formatLanguageCode(a)).find(a=>a===i?!0:!a.includes("-")&&!i.includes("-")?!1:!!(a.includes("-")&&!i.includes("-")&&a.slice(0,a.indexOf("-"))===i))}),r||(r=this.getFallbackCodes(this.options.fallbackLng)[0]),r}getFallbackCodes(t,r){if(!t)return[];if(typeof t=="function"&&(t=t(r)),Z(t)&&(t=[t]),Array.isArray(t))return t;const o=i=>Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(!r)return o("default")||[];let n=o(r);return n||(n=o(this.getScriptPartFromCode(r))),n||(n=o(this.formatLanguageCode(r))),n||(n=o(this.getLanguagePartFromCode(r))),n||(n=o("default")),n||[]}toResolveHierarchy(t,r){const o=this.options.fallbackLng,n=Array.isArray(o)?o.join("|"):o;n!==this._cachedFallbackLng&&(this.resolveHierarchyCache={},this._cachedFallbackLng=n);const i=r===void 0||r===!1||Z(r),a=r===void 0&&typeof this.options.fallbackLng=="function",s=Z(t)&&i&&!a;let p=null;if(s){let c;r===void 0?c="undefined":r===!1?c="boolean:false":c=`string:${r}`,p=`${t.length}:${t}|${c}`}if(p!==null){const c=this.resolveHierarchyCache[p];if(c!==void 0)return c.slice()}const l=this.getFallbackCodes((r===!1?[]:r)||this.options.fallbackLng||[],t),d=[],u=c=>{c&&(this.isSupportedCode(c)?d.push(c):this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`))};return Z(t)&&(t.includes("-")||t.includes("_"))?(this.options.load!=="languageOnly"&&u(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&u(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&u(this.getLanguagePartFromCode(t))):Z(t)&&u(this.formatLanguageCode(t)),l.forEach(c=>{const f=this.formatLanguageCode(c);d.includes(f)||u(f)}),p!==null?(Object.keys(this.resolveHierarchyCache).length>=1e3&&(this.resolveHierarchyCache={}),this.resolveHierarchyCache[p]=d,d.slice()):d}}const Hp={zero:0,one:1,two:2,few:3,many:4,other:5},Up={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class Yg{constructor(t,r={},o=br){this.languageUtils=t,this.options=r,this.logger=o.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,r={}){const o=jr(t==="dev"?"en":t),n=r.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:o,type:n});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let a;try{a=new Intl.PluralRules(o,{type:n})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Up;if(!t.match(/-|_/))return Up;const p=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(p,r)}return Object.keys(this.pluralRulesCache).length>=1e3&&(this.pluralRulesCache={}),this.pluralRulesCache[i]=a,a}needsPlural(t,r={}){let o=this.getRule(t,r);return o||(o=this.getRule("dev",r)),o?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,r,o={}){return this.getSuffixes(t,o).map(n=>`${r}${n}`)}getSuffixes(t,r={}){let o=this.getRule(t,r);return o||(o=this.getRule("dev",r)),o?o.resolvedOptions().pluralCategories.sort((n,i)=>Hp[n]-Hp[i]).map(n=>`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${n}`):[]}getSuffix(t,r,o={}){const n=this.getRule(t,o);return n?`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${n.select(r)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",r,o))}}const qp=(e,t,r,o=".",n=!0)=>{let i=zg(e,t,r);return i==null&&n&&Z(r)&&(i=Ta(e,r,o),i===void 0&&(i=Ta(t,r,o))),i};class jp{constructor(t={},r=br){this.logger=r.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(o=>o),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:r,escapeValue:o,useRawValueToEscape:n,prefix:i,suffix:a,formatSeparator:s,unescapeSuffix:p,unescapePrefix:l,nestingPrefix:d,nestingSuffix:u,nestingOptionsSeparator:c,maxReplaces:f,alwaysFormat:h}=t.interpolation;this.escape=r!==void 0?r:Ug,this.escapeValue=o!==void 0?o:!0,this.useRawValueToEscape=n!==void 0?n:!1,this.prefix=i?gr(i):"{{",this.suffix=a?gr(a):"}}",this.formatSeparator=s||",",this.unescapePrefix=p?"":l?gr(l):"-",this.unescapeSuffix=this.unescapePrefix?"":p?gr(p):"",this.prefixText=i||"{{",this.nestingPrefixText=d||"$t(",this.nestingPrefix=gr(d||"$t("),this.nestingSuffix=gr(u||")"),this.nestingOptionsSeparator=c||",",this.maxReplaces=f||1e3,this.alwaysFormat=h!==void 0?h:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(r,o)=>r?.source===o?(r.lastIndex=0,r):new RegExp(o,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']|"[^"]*"|'[^']*'|\\((?:[^()"']|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,r,o,n){let i,a,s;const p=t,l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=k=>{if(!k.includes(this.formatSeparator)){const E=qp(r,l,k,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,o,{...n,...r,interpolationkey:k}):E}const v=k.split(this.formatSeparator),w=v.shift().trim(),P=v.join(this.formatSeparator).trim();return this.format(qp(r,l,w,this.options.keySeparator,this.options.ignoreJSONStructure),P,o,{...n,...r,interpolationkey:w})};this.resetRegExp(),!this.escapeValue&&typeof t=="string"&&/\$t\([^)]*\{[^}]*\{\{/.test(t)&&this.logger.warn("nesting options string contains interpolated variables with escapeValue: false — if any of those values are attacker-controlled they can inject additional nesting options (e.g. redirect lng/ns). Sanitise untrusted input before passing it to t(), or keep escapeValue: true.");const u=n?.missingInterpolationHandler||this.options.missingInterpolationHandler,c=n?.interpolation?.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;if(Z(t)&&!t.includes(this.prefixText))return t;const f=[{regex:this.regexpUnescape,safeValue:k=>k},{regex:this.regexp,safeValue:k=>this.escapeValue?this.escape(k):k}],h=[];let b=0;return f.forEach(k=>{for(s=0;i=k.regex.exec(t);){const v=i.index-b,w=h.find(([D,O])=>v>=D&&v<O);if(w){k.regex.lastIndex=w[1]+b;continue}const P=i[1].trim();if(a=d(P),a===void 0)if(typeof u=="function"){const D=u(t,i,n);a=Z(D)?D:""}else if(n&&Object.prototype.hasOwnProperty.call(n,P.split(this.formatSeparator)[0].trim()))a="";else if(c){this.logger.debug&&this.logger.once(`${p}\0${i[0]}`,"warn",`missed to pass in variable ${P} for interpolating ${p}`),a=i[0];continue}else this.logger.warn(`missed to pass in variable ${P} for interpolating ${t}`),a="";else!Z(a)&&!this.useRawValueToEscape&&(a=Tn(a));const E=Tn(k.safeValue(a));if(t=t.slice(0,i.index)+E+t.slice(i.index+i[0].length),c?(k.regex===this.regexpUnescape?h.push([i.index,i.index+E.length]):b+=E.length-i[0].length,k.regex.lastIndex+=E.length,k.regex.lastIndex-=i[0].length):k.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),t}nest(t,r,o={}){let n,i,a;const s=(u,c)=>{const f=this.nestingOptionsSeparator;if(!u.includes(f))return u;const h=u.split(new RegExp(`${gr(f)}[ ]*{`));let b=`{${h[1]}`;u=h[0],b=this.interpolate(b,a);const k=b.match(/'/g),v=b.match(/"/g);((k?.length??0)%2===0&&!v||(v?.length??0)%2!==0)&&(b=b.replace(/'/g,'"'));try{a=JSON.parse(b),c&&(a={...c,...a})}catch(w){return this.logger.warn(`failed parsing options string in nesting for key ${u}`,w),`${u}${f}${b}`}return a.defaultValue&&a.defaultValue.includes(this.prefix)&&delete a.defaultValue,u};if(Z(t)&&!t.includes(this.nestingPrefixText))return t;const p=new RegExp(this.nestingRegexp);let l="",d=0;for(;n=p.exec(t);){let u=[];a={...o},a=a.replace&&!Z(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const c=/{.*}/s.test(n[1])?n[1].lastIndexOf("}")+1:n[1].indexOf(this.formatSeparator);if(c!==-1&&(u=n[1].slice(c).split(this.formatSeparator).map(f=>f.trim()).filter(Boolean),n[1]=n[1].slice(0,c)),i=r(s.call(this,n[1].trim(),a),a),i&&n[0]===t&&!Z(i))return i;Z(i)||(i=Tn(i)),i||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${t}`),i=""),u.length&&(i=u.reduce((f,h)=>this.format(f,h,o.lng,{...o,interpolationkey:n[1].trim()}),i.trim())),l+=t.slice(d,n.index)+Tn(i),d=p.lastIndex,this.regexp.lastIndex=0}return d?l+t.slice(d):t}}const Xg=e=>{let t=e.toLowerCase().trim();const r={};if(e.includes("(")){const o=e.split("(");t=o[0].toLowerCase().trim();const n=o[1].slice(0,-1);t==="currency"&&!n.includes(":")?r.currency||(r.currency=n.trim()):t==="relativetime"&&!n.includes(":")?r.range||(r.range=n.trim()):n.split(";").forEach(a=>{if(a){const[s,...p]=a.split(":"),l=p.join(":").trim().replace(/^'+|'+$/g,""),d=s.trim();r[d]||(r[d]=l),l==="false"&&(r[d]=!1),l==="true"&&(r[d]=!0),isNaN(l)||(r[d]=parseInt(l,10))}})}return{formatName:t,formatOptions:r}},Zg=1e3,Wp=e=>{const t=new Map;return(r,o,n)=>{let i=n;n&&n.interpolationkey&&n.formatParams&&n.formatParams[n.interpolationkey]&&n[n.interpolationkey]&&(i={...i,[n.interpolationkey]:void 0});let a;try{a=o+JSON.stringify(i)}catch{return e(jr(o),n)(r)}let s=t.get(a);return s||(s=e(jr(o),n),t.size>=Zg&&t.delete(t.keys().next().value),t.set(a,s)),s(r)}},Jg=e=>(t,r,o)=>e(jr(r),o)(t);class Qg{constructor(t={}){this.logger=br.create("formatter"),this.options=t,this.init(t)}init(t,r={interpolation:{}}){t?.logger?.create&&(this.logger=t.logger.create("formatter")),this.formatSeparator=r.interpolation.formatSeparator||",";const o=r.cacheInBuiltFormats?Wp:Jg;this.formats={number:o((n,i)=>{const a=new Intl.NumberFormat(n,{...i});return s=>a.format(s)}),currency:o((n,i)=>{const a=new Intl.NumberFormat(n,{...i,style:"currency"});return s=>a.format(s)}),datetime:o((n,i)=>{const a=new Intl.DateTimeFormat(n,{...i});return s=>a.format(s)}),relativetime:o((n,i)=>{const a=new Intl.RelativeTimeFormat(n,{...i});return s=>a.format(s,i.range||"day")}),list:o((n,i)=>{const a=new Intl.ListFormat(n,{...i});return s=>a.format(s)})}}add(t,r){this.formats[t.toLowerCase().trim()]=r}addCached(t,r){this.formats[t.toLowerCase().trim()]=Wp(r)}format(t,r,o,n={}){if(!r||t==null)return t;const i=r.split(this.formatSeparator),a=[];for(let p=0;p<i.length;p++){let l=i[p];for(;l.indexOf("(")>-1&&!l.includes(")")&&p+1<i.length;)l=`${l}${this.formatSeparator}${i[++p]}`;a.push(l)}return a.reduce((p,l)=>{const{formatName:d,formatOptions:u}=Xg(l);if(this.formats[d]){let c=p;try{const f=n?.formatParams?.[n.interpolationkey]||{},h=f.locale||f.lng||n.locale||n.lng||o;c=this.formats[d](p,h,{...u,...n,...f})}catch(f){this.logger.warn(f)}return c}else this.logger.warn(`there was no format function for ${d}`);return p},t)}}const eb=1e3,tb=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class rb extends Cn{constructor(t,r,o,n={}){super(),this.backend=t,this.store=r,this.services=o,this.languageUtils=o.languageUtils,this.options=n,this.logger=(o.logger||br).create("backendConnector"),this.waitingReads=[],this.maxParallelReads=n.maxParallelReads||10,this.readingCalls=0,this.maxRetries=n.maxRetries>=0?n.maxRetries:5,this.retryTimeout=n.retryTimeout>=1?n.retryTimeout:350,this.state={},this.failed=new Set,this.queue=[],this.backend?.init?.(o,n.backend,n),this.callbackApi=Sa(this.backend),this.backend&&this.callbackApi===void 0&&(this.backend.read||this.backend.create)&&this.logger.deprecate("backend: set callbackApi to declare the calling convention (true: read(language, namespace, callback) and create(languages, namespace, key, fallbackValue, callback, options); false: both return a promise or a value); guessing it from the number of parameters is deprecated")}queueLoad(t,r,o,n){const i={},a={},s={},p={};return t.forEach(l=>{let d=!0;r.forEach(u=>{const c=`${l}|${u}`;!o.reload&&this.store.hasResourceBundle(l,u)?this.state[c]=2:!o.reload&&this.state[c]<0||(this.state[c]===1?a[c]===void 0&&(a[c]=!0):(this.state[c]=1,d=!1,a[c]===void 0&&(a[c]=!0),i[c]===void 0&&(i[c]=!0),p[u]===void 0&&(p[u]=!0)))}),d||(s[l]=!0)}),(Object.keys(i).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:n}),{toLoad:Object.keys(i),pending:Object.keys(a),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(p)}}loaded(t,r,o){const n=t.split("|"),i=n[0],a=n[1];if(r&&this.emit("failedLoading",i,a,r),!r&&o&&this.store.addResourceBundle(i,a,o,void 0,void 0,{skipCopy:!0}),this.state[t]=r?-1:2,r&&o&&(this.state[t]=0),this.failed.delete(t),r&&(this.failed.add(t),this.failed.size>eb)){const l=this.failed.values().next().value;this.failed.delete(l),this.state[l]<1&&delete this.state[l]}const s={},p=[];if(this.queue.forEach(l=>{if($g(l.loaded,[i],a),tb(l,t),r&&l.errors.push(r),l.pendingCount===0&&!l.done){Object.keys(l.loaded).forEach(d=>{Object.prototype.hasOwnProperty.call(s,d)||(s[d]={});const u=l.loaded[d];u.length&&u.forEach(c=>{s[d][c]===void 0&&(s[d][c]=!0)})}),l.done=!0;try{l.errors.length?l.callback(l.errors):l.callback()}catch(d){p.push(d)}}}),this.queue=this.queue.filter(l=>!l.done),this.emit("loaded",s),p.length)throw p[0]}read(t,r,o,n=0,i=this.retryTimeout,a){if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:r,fcName:o,tried:n,wait:i,callback:a});return}this.readingCalls++;const s=(l,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const u=this.waitingReads.shift();this.read(u.lng,u.ns,u.fcName,u.tried,u.wait,u.callback)}if(l&&d&&n<this.maxRetries){setTimeout(()=>{this.read(t,r,o,n+1,i*2,a)},i);return}a(l,d)},p=this.backend[o].bind(this.backend);if(this.callbackApi===!1||this.callbackApi===void 0&&p.length===2){let l;try{l=p(t,r)}catch(d){s(d);return}l&&typeof l.then=="function"?l.then(d=>s(null,d),s):s(null,l);return}return p(t,r,s)}prepareLoading(t,r,o={},n){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),n&&n();Z(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Z(r)&&(r=[r]);const i=this.queueLoad(t,r,o,n);if(!i.toLoad.length)return i.pending.length||n(),null;i.toLoad.forEach(a=>{this.loadOne(a)})}load(t,r,o){this.prepareLoading(t,r,{},o)}reload(t,r,o){this.prepareLoading(t,r,{reload:!0},o)}loadOne(t,r=""){const o=t.split("|"),n=o[0],i=o[1];this.read(n,i,"read",void 0,void 0,(a,s)=>{a&&this.logger.warn(`${r}loading namespace ${i} for language ${n} failed`,a),!a&&s&&this.logger.log(`${r}loaded namespace ${i} for language ${n}`,s),this.loaded(t,a,s)})}saveMissing(t,r,o,n,i,a={},s=()=>{},p=this.newestCloneHasLoadedNamespace||this.services?.utils?.hasLoadedNamespace){if(p&&!p(r)){this.logger.warn(`did not save key "${o}" as the namespace "${r}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(o==null||o==="")){if(this.backend?.create){const l={...a,isUpdate:i},d=this.backend.create.bind(this.backend);if(this.callbackApi===!1||this.callbackApi===void 0&&d.length<6)try{let u;this.callbackApi===!1||d.length===5?u=d(t,r,o,n,l):u=d(t,r,o,n),u&&typeof u.then=="function"?u.then(c=>s(null,c)).catch(s):s(null,u)}catch(u){s(u)}else d(t,r,o,n,s,l)}!t||!t[0]||this.store.addResource(t[0],r,o,n)}}}const Ca=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:!1,fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",enableSelector:!1,partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!1,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Z(e[1])&&(t.defaultValue=e[1]),Z(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const r=e[3]||e[2];Object.keys(r).forEach(o=>{t[o]=r[o]})}return t},interpolation:{escapeValue:!0,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Vp=e=>(Z(e.ns)&&(e.ns=[e.ns]),Z(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Z(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&!e.supportedLngs.includes("cimode")&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e),An=()=>{},Gp=e=>{const t=Ca(),r={...t,...e};return r.interpolation={...t.interpolation,...e.interpolation},typeof r.overloadTranslationOptionHandler!="function"&&(r.overloadTranslationOptionHandler=t.overloadTranslationOptionHandler),r},Kp=e=>{const t=[].concat(e.supportedLngs||[],e.preload||[]);t.push(...Object.keys(e.resources||{}));const r=e.fallbackLng;return Z(r)||Array.isArray(r)?t.push(...[].concat(r)):r&&typeof r=="object"&&Object.keys(r).forEach(o=>{o!=="default"&&t.push(o),t.push(...[].concat(r[o]))}),t},_a=(e,t)=>!Z(t)||Bg(t)||e.configuredLngs?.has(t)?!1:(e.logger.once(`lng:${t}`,"warn",`refused the language code '${t.slice(0,64)}' from lng, changeLanguage(), the language detector or loadLanguages(): it is not configured and has other characters than letters, digits, '-', '_', '@' and '.' (or '..', or more than 128). List it in supportedLngs to use it`),!0),ob=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(r=>{typeof e[r]=="function"&&(e[r]=e[r].bind(e))})};class xo extends Cn{constructor(t={},r){if(super(),this.userOptions=Vp(t),this.options=Gp(this.userOptions),this.services={postProcessors:Object.create(null)},this.logger=new wo(null,this.options),this.modules={external:[]},ob(this),r&&!this.isInitialized&&!t.isClone){if(!this.userOptions.initAsync)return this.init(t,r),this;setTimeout(()=>{this.init(t,r)},0)}}init(t={},r){this.isInitializing=!0,typeof t=="function"&&(r=t,t={}),t.defaultNS==null&&t.ns&&(Z(t.ns)?t.defaultNS=t.ns:t.ns.includes("translation")||(t.defaultNS=t.ns[0])),Vp(t);const o={...this.userOptions,...t};this.options=Gp({...this.options,...t}),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator),this.options.isClone||(this.configuredLngs=new Set([...this.configuredLngs||[],...Kp(o)]));const n=l=>l?typeof l=="function"?new l:l:null;if(!this.options.isClone){this.logger.init(n(this.modules.logger),this.options);const{logger:l}=this;this.pendingWarnings?.forEach(f=>this.logger.warn(f)),this.pendingWarnings=void 0;let d;this.modules.formatter?d=this.modules.formatter:d=Qg;const u=new zp(this.options,l);this.store=new Fp(this.options.resources,this.options,l);const c=this.services;c.logger=l,c.resourceStore=this.store,c.languageUtils=u,c.pluralResolver=new Yg(u,{prepend:this.options.pluralSeparator},l),d&&(c.formatter=n(d),c.formatter.init&&c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new jp(this.options,l),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this),reloadResources:this.reloadResources.bind(this)},c.backendConnector=new rb(n(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",(f,...h)=>{this.emit(f,...h)}),this.modules.languageDetector&&(c.languageDetector=n(this.modules.languageDetector),c.languageDetector.init&&c.languageDetector.init(c,this.options.detection,this.options),c.languageDetector.async&&Sa(c.languageDetector)===void 0&&this.logger.deprecate("languageDetector: set callbackApi to declare how the async detect() answers (true: detect(callback); false: detect() returns a promise); guessing it from the number of parameters is deprecated")),this.modules.i18nFormat&&(c.i18nFormat=n(this.modules.i18nFormat),c.i18nFormat.init&&c.i18nFormat.init(this)),this.translator=new Dn(this.services,this.options),this.translator.on("*",(f,...h)=>{this.emit(f,...h)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,r||(r=An),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(l=>{this[l]=(...d)=>this.store[l](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=(...d)=>(this.store[l](...d),this)});const s=yo(),p=()=>{const l=(d,u)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),s.resolve(u),r(d,u)};if((this.languages||this.isLanguageChangingTo)&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initAsync?p():setTimeout(p,0),s}loadResources(t,r=An){let o=r;const n=Z(t)?t:this.language;if(typeof t=="function"&&(o=t),!this.options.resources||this.options.partialBundledLanguages){if(n?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return o();const i=[],a=s=>{if(!s||s==="cimode")return;this.services.languageUtils.toResolveHierarchy(s).forEach(l=>{l!=="cimode"&&(i.includes(l)||i.push(l))})};n?a(n):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(p=>a(p)),this.options.preload?.forEach?.(s=>a(s)),this.services.backendConnector.load(i,this.options.ns,s=>{!s&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),o(s)})}else o(null)}reloadResources(t,r,o){const n=yo();if(typeof t=="function"&&(o=t,t=void 0),typeof r=="function"&&(o=r,r=void 0),!t){const i=Object.keys(this.services.backendConnector.state).map(a=>a.split("|")[0]);t=[...new Set([...this.languages||[],...i])].filter(a=>a!=="cimode")}return r||(r=this.options.ns),o||(o=An),this.services.backendConnector.reload(t,r,i=>{n.resolve(),o(i)}),n}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");const r=o=>{if(this.modules[o]&&this.modules[o]!==t){const n=`use: this ${o} replaces the ${o} passed to an earlier use() call; only one ${o} is used per instance`;this.isInitializing||this.isInitialized?this.logger.warn(n):(this.pendingWarnings=this.pendingWarnings||[]).push(n)}this.modules[o]=t};return t.type==="backend"&&r("backend"),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&r("languageDetector"),t.type==="i18nFormat"&&r("i18nFormat"),t.type==="postProcessor"&&(this.services.postProcessors[t.name]=t),t.type==="formatter"&&r("formatter"),t.type==="3rdParty"&&this.modules.external.push(t),this}hydrate(t,r){return this.options.isClone?this:this.services.resourceStore?(t&&!this.initializedStoreOnce&&(this.services.resourceStore.data=t,Object.values(t).forEach(o=>{Object.keys(o).forEach(n=>{this.options.ns.includes(n)||this.options.ns.push(n)})}),this.initializedStoreOnce=!0,this.isInitialized=!0),r&&!this.initializedLanguageOnce&&(this.changeLanguage(r),this.initializedLanguageOnce=!0),this):(this.logger.warn("hydrate: call init() first, the instance has no resource store yet"),this)}setResolvedLanguage(t){if(!(!t||!this.languages)&&!["cimode","dev"].includes(t)){for(let r=0;r<this.languages.length;r++){const o=this.languages[r];if(!["cimode","dev"].includes(o)&&this.store.hasLanguageSomeTranslations(o)){this.resolvedLanguage=o;break}}!this.resolvedLanguage&&!this.languages.includes(t)&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,r){this.isLanguageChangingTo=t;const o=yo();this.emit("languageChanging",t);const n=s=>{this.language=s,this.languages=this.services.languageUtils.toResolveHierarchy(s),this.resolvedLanguage=void 0,this.setResolvedLanguage(s)},i=(s,p)=>{p?this.isLanguageChangingTo===t&&(n(p),this.translator.changeLanguage(p),this.isLanguageChangingTo=void 0,this.emit("languageChanged",p),this.logger.log("languageChanged",p)):this.isLanguageChangingTo=void 0,o.resolve((...l)=>this.t(...l)),r&&r(s,(...l)=>this.t(...l))},a=s=>{!t&&!s&&this.services.languageDetector&&(s=[]);const{supportedLngs:p}=this.options;if(s&&!p){const u=[].concat(s).filter(c=>!_a(this,c));u.length<[].concat(s).length&&(s=u)}const l=Z(s)?s:s&&s[0];let d=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(Z(s)?[s]:s);p&&_a(this,d)&&(d=this.services.languageUtils.getBestMatchFromCodes([])),d&&(this.language||n(d),this.translator.language||this.translator.changeLanguage(d),this.services.languageDetector?.cacheUserLanguage?.(d)),this.loadResources(d,u=>{i(u,d)})};if(!t&&this.services.languageDetector&&!this.services.languageDetector.async)a(this.services.languageDetector.detect());else if(!t&&this.services.languageDetector&&this.services.languageDetector.async){const s=Sa(this.services.languageDetector);s===!1||s===void 0&&this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a)}else a(t);return o}getFixedT(t,r,o,n){const i=n?.scopeNs,a=(s,p,...l)=>{let d;typeof p!="object"?d=this.options.overloadTranslationOptionHandler([s,p].concat(l)):d={...p},d.lng=d.lng||a.lng,d.lngs=d.lngs||a.lngs;const u=d.ns!==void 0&&d.ns!==null;d.ns=d.ns||a.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||o||a.keyPrefix);const c={...this.options,...d};Array.isArray(i)&&!u&&(c.ns=i),typeof d.keyPrefix=="function"&&(d.keyPrefix=Wr(d.keyPrefix,c));const f=this.options.keySeparator||".";let h;return d.keyPrefix&&Array.isArray(s)?h=s.map(b=>(typeof b=="function"&&(b=Wr(b,c)),`${d.keyPrefix}${f}${b}`)):(typeof s=="function"&&(s=Wr(s,c)),h=d.keyPrefix?`${d.keyPrefix}${f}${s}`:s),this.t(h,d)};return Z(t)?a.lng=t:a.lngs=t,a.ns=r,a.keyPrefix=o,a}t(...t){return this.translator?this.translator.translate(...t):(this.logger.warn("t: called before init(); returning an empty string"),"")}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t,this.translator?.options&&(this.translator.options.defaultNS=t)}hasLoadedNamespace(t,r={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const o=r.lng||this.resolvedLanguage||this.languages[0],n=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(o.toLowerCase()==="cimode")return!0;const a=(l,d)=>{const u=this.services.backendConnector.state[`${l}|${d}`];return u===-1||u===0||u===2};if(r.precheck){const l=r.precheck(this,a);if(l!==void 0)return l}if(this.hasResourceBundle(o,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages)return!0;const{languageUtils:s}=this.services,p=r.lng?s.isSupportedCode(o)&&s.toResolveHierarchy(o,!1)[0]:o;return!!((!p||a(p,t))&&(!n||a(i,t)))}loadNamespaces(t,r){const o=yo();return!this.options.ns||!this.services.backendConnector?(r&&r(),Promise.resolve()):(Z(t)&&(t=[t]),t.forEach(n=>{this.options.ns.includes(n)||this.options.ns.push(n)}),this.loadResources(n=>{o.resolve(),r&&r(n)}),o)}loadLanguages(t,r){const o=yo();Z(t)&&(t=[t]);const n=this.options.preload||[],i=t.filter(a=>!n.includes(a)&&!_a(this,a)&&this.services.languageUtils.isSupportedCode(a));return i.length?(this.options.preload=n.concat(i),this.loadResources(a=>{o.resolve(),r&&r(a)}),o):(r&&r(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"ltr";try{const n=new Intl.Locale(t);if(n&&n.getTextInfo){const i=n.getTextInfo();if(i&&i.direction)return i.direction}}catch{}const r=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],o=this.services?.languageUtils||new zp(Ca());return t.toLowerCase().indexOf("-latn")>1?"ltr":r.includes(o.getLanguagePartFromCode(t))||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},r){const o=new xo(t,r);return o.createInstance=xo.createInstance,o}cloneInstance(t={},r=An){const o=t.forkResourceStore;o&&(t={...t},delete t.forkResourceStore);const n={...this.options,preload:!1,...t,isClone:!0},i=new xo(n);if(i.logger=t.debug!==void 0||t.prefix!==void 0?this.logger.clone(t):this.logger,["store","language"].forEach(s=>{i[s]=this[s]}),i.services={...this.services},i.services.postProcessors=Object.create(this.services.postProcessors),i.services.utils={...i.services.utils,hasLoadedNamespace:i.hasLoadedNamespace.bind(i),reloadResources:i.reloadResources.bind(i)},o){const s=l=>{const d=Array.isArray(l)?[...l]:{...l};return Object.keys(d).forEach(u=>{d[u]&&typeof d[u]=="object"&&(d[u]=s(d[u]))}),d},p=s(this.store.data);i.store=new Fp(p,n,this.logger),i.services.resourceStore=i.store}if(t.interpolation){const p={...Ca().interpolation,...this.options.interpolation,...t.interpolation},l={...n,interpolation:p};i.services.interpolator=new jp(l,this.logger)}return i.configuredLngs=new Set([...this.configuredLngs||[],...Kp(t)]),i.translator=new Dn(i.services,n),i.translator.on("*",(s,...p)=>{i.emit(s,...p)}),i.init(n,r),i.translator.options=n,i.translator.backendConnector.newestCloneHasLoadedNamespace=i.hasLoadedNamespace.bind(i),i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const nt=xo.createInstance(),Da=nt.createInstance;nt.dir,nt.init,nt.loadResources,nt.reloadResources,nt.use,nt.changeLanguage,nt.getFixedT,nt.t,nt.exists,nt.setDefaultNamespace,nt.hasLoadedNamespace,nt.loadNamespaces,nt.loadLanguages;const nb={"toolbar.save":"保存","toolbar.preview":"预览","diagnostic.expressionUnexpectedEnd":"表达式意外结束","diagnostic.parser.trailingContent":"表达式存在多余内容: {value}","diagnostic.parser.expected":'位置 {pos}: 期望 "{value}"',"diagnostic.parser.memberName":"位置 {pos}: 成员访问需要属性名","diagnostic.parser.invalidNumber":"非法数字: {value}","diagnostic.parser.objectKey":"位置 {pos}: 对象键必须是标识符或字符串","diagnostic.parser.unexpectedToken":"位置 {pos}: 意外的符号: {value}","diagnostic.lexer.unterminatedString":"字符串未闭合","diagnostic.lexer.keyword":"不允许使用关键字: {word}","diagnostic.lexer.forbidden":"禁止访问: {word}","diagnostic.lexer.noFunctionDef":"不允许函数定义","diagnostic.lexer.noAssignment":"不允许赋值","diagnostic.lexer.noMultipleStatements":"不允许多条语句","diagnostic.lexer.invalidChar":"非法字符: {ch}","diagnostic.evaluator.undefinedIdentifier":"未定义的标识符: {name}","diagnostic.evaluator.unknownOperator":"未知运算符: {op}","diagnostic.evaluator.unknownUnaryOperator":"未知一元运算符: {op}","diagnostic.evaluator.nullProperty":"无法访问空值的属性","diagnostic.evaluator.forbiddenProperty":"禁止访问属性: {property}","diagnostic.evaluator.mathNotMethod":"Math.{name} 不是方法","diagnostic.evaluator.noMethodCall":"不支持方法调用,请使用顶级函数","diagnostic.evaluator.notFunction":"{name} 不是函数","diagnostic.evaluator.forbiddenCall":"不允许调用: {name}","diagnostic.template.unclosedBrace":"位置 {pos}: 花括号未闭合","diagnostic.template.emptyExpression":"位置 {pos}: 空表达式","diagnostic.pagination.insufficientHeight":"页面可用高度不足: paper={paper}mm, margins={margins}mm, header={header}mm, footer={footer}mm","diagnostic.pagination.repeatHeaderOverflow":"表格 {id} 的重复表头高度 ({repeat}mm) 超过页面可用高度 ({avail}mm),请减少重复表头行","diagnostic.tiling.continuousUnsupported":"连续纸不支持拼版打印,请将模板纸张改为固定纸张或关闭拼版","diagnostic.tiling.sheetContinuous":"拼版目标纸张不能是连续纸","diagnostic.tiling.sheetSizeInvalid":"拼版自定义纸张宽高必须是大于 0 的数值(mm)","diagnostic.tiling.columnsInvalid":"拼版列数必须是大于 0 的整数","diagnostic.tiling.rotationNote":"(内容旋转 {angle}°,每格 {width}×{height}mm)","diagnostic.tiling.columnsExceedWidth":"拼版列数 {columns} 超出纸面可用宽度:{sheet}mm − 左右留白 {margin}mm = {avail}mm,最多可放 {max} 列;当前 {columns} 列 {label}mm 标签含间距需要 {need}mm{rotation}","diagnostic.tiling.labelHeightExceed":"标签高度 {height}mm 超出纸面可用高度 {avail}mm,拼版每张 0 行;请缩小标签高度或改用横向纸{rotation}","diagnostic.multiTemplate.emptyPages":"多页面模板至少需要一页","diagnostic.multiTemplate.continuous":"多页面模板不支持连续纸({page})","diagnostic.multiTemplate.tiling":"多页面模板不支持标签拼版({page})","diagnostic.multiTemplate.paperMismatch":"多页面模板各页纸张尺寸必须一致({page} {width}×{height}mm 与首页 {firstWidth}×{firstHeight}mm 不同)","diagnostic.multiTemplate.emptyData":"多页面模板至少需要一份数据","diagnostic.multiTemplate.pageLabelNamed":"第 {index} 页「{name}」","diagnostic.multiTemplate.pageLabelPlain":"第 {index} 页","client.cancelled":"连接已取消","client.invalidToken":"配对 token 无效或来源未授权","client.notRunning":"未发现运行中的打印客户端(已探测默认端口区间),请确认客户端已启动","client.notConnected":"打印客户端未连接","client.timeout":"请求 {type} 超时未响应","client.closed":"连接已关闭","client.disconnected":"与客户端的连接中断","client.unregisteredHandler":"桌面端请求未注册处理器","client.internalError":"内部错误","table.atLeastTwoCells":"至少选择 2 个单元格","table.crossRowTypes":"合并区域不能跨越不同类型的行","table.dataVerticalMerge":"数据行将按列表展开,纵向合并请使用单元格属性「按值合并」","table.partialOverlap":"选区与已有合并区域部分重叠","table.lastRow":"不能删除最后一行","table.lastColumn":"不能删除最后一列","table.dataRowExists":"数据行已存在(第 {row} 行),全表最多一行","table.headerContinuous":"标题行必须从表格顶部连续设置","table.subtotalAfterData":"请先设置数据行,小计/汇总行必须位于数据行之后","table.subtotalBeforeData":"小计/汇总行必须位于数据行之后","table.subtotalBeforeSummary":"小计行必须位于汇总行之前","table.summaryAfterSubtotal":"汇总行必须位于小计行之后","table.headerBreak":"取消该标题行会导致标题行不连续,请先调整后续标题行","table.defaultHeader":"列{index}","table.borderHint":"线型 / 宽度 / 颜色是待应用规格:选中格已有的边框规格一致时会填进这三行;四边不一致的项显示「混合」,一条边都没有时显示「无 / 0」。改完点「全部 / 外侧 / 内部」或勾选上、下、左、右某条边才会写入选中的单元格;「无」是清除边框","table.borderHintMulti":"多选时不回显单格边框:线型 / 宽度 / 颜色按当前设置作为批写规格,点「全部 / 外侧 / 内部」或勾选某条边后写入所有选中格;「无」是清除边框","table.borderHintMixed":"当前单元格四边边框规格不一致:带「混合」的项不谎报,未改项在点「全部 / 外侧 / 内部」或勾选单边时按缺省档(实线 0.75pt)写入,改任一项即按该值批写","diagnostic.pagination.overflowTop":"元素 {id} 旋转 {rot}° 后顶部超出页首 {amount}mm,打印将被裁切","diagnostic.pagination.overflowRight":"元素 {id} 超出纸面右侧 {amount}mm,打印将被裁切","diagnostic.pagination.overflowLeft":"元素 {id} 超出纸面左侧 {amount}mm,打印将被裁切","crop.sampleNote":"图片还没设置,上面按内置示例图演示取位;换上真图后档位与可挪量按真图重算","crop.verticalPosition":"垂直位置 (%)","crop.horizontalPosition":"水平位置 (%)","crop.scaleLabel":"放大比例 (%)","crop.originalValue":"已保留模板里的原值;改动下面任一项就整体替换成新的取位","crop.movableBoth":"水平可挪 {x}mm、垂直可挪 {y}mm:0 贴左/贴顶,100 贴右/贴底","crop.movableX":"水平可挪 {x}mm;垂直这一轴已贴满,挪不动","crop.movableY":"垂直可挪 {y}mm;水平这一轴已贴满,挪不动","crop.noRoom":"这个缩放下图与框正好一样大,两轴都没有可挪的余量","crop.top":"顶部","crop.center":"居中","crop.bottom":"底部","crop.left":"左侧","crop.right":"右侧","crop.topLeft":"左上","crop.topCenter":"上中","crop.topRight":"右上","crop.middleLeft":"左中","crop.middleRight":"右中","crop.bottomLeft":"左下","crop.bottomCenter":"下中","crop.bottomRight":"右下","crop.fitContain":"包含(保持比例)","crop.fitCover":"剪裁(等比铺满后裁边)","crop.fitFill":"拉伸填满","crop.fitNone":"原始尺寸","crop.fitScaleDown":"缩小(保持比例)","barcode.recommendOk":"按 {dpi}dpi 推荐条宽倍率 {rec}(每模块 {recDots} 个打印点 = {width}mm,取达到 {min}mm 下限的最小档);当前倍率 {current} 折算为 {curDots} 点 / {curWidth}mm,已达标。这里只提示,不会替你改值","barcode.recommendLow":"按 {dpi}dpi 推荐条宽倍率 {rec}(每模块 {recDots} 个打印点 = {width}mm,取达到 {min}mm 下限的最小档);当前倍率 {current} 只有 {curDots} 点 / {curWidth}mm,低于下限。这里只提示,不会替你改值","code.rotateNote":"条码与二维码仅支持 90° 步进;任意角度需 385dpi 以上打印头","colorPicker.pickColor":"颜色选择","colorPicker.hexValue":"颜色值","colorPicker.customColor":"自定义颜色","colorPicker.hue":"色相","colorPicker.commonColors":"常用颜色","colorPicker.clear":"清除选中的颜色","colorPicker.clearShort":"清除","save.geometryWarningConfirm":`出纸提示:部分内容超出纸面,打印时会被裁切。
2
2
  是否接受裁切并继续保存?
3
3
  点击“确定”继续保存,点击“取消”返回修改。
4
4
 
@@ -10,7 +10,7 @@ Click OK to save, Cancel to go back and edit.
10
10
  ยอมรับการตัดและบันทึกต่อหรือไม่?
11
11
  คลิก ตกลง เพื่อบันทึก คลิก ยกเลิก เพื่อกลับไปแก้ไข
12
12
 
13
- {warnings}`,"store.tilingSinglePage":"เมื่อเปิดการจัดเรียงชิ้น อนุญาตให้มีหน้าออกแบบได้เพียงหน้าเดียว","elementGroup.chart":"แผนภูมิ","service.printData.emptyArray":"ข้อมูลการพิมพ์เป็นชุดต้องเป็นอาร์เรย์อ็อบเจกต์ที่ไม่ว่างเปล่า","service.printData.tooMany":"การพิมพ์เป็นชุดรองรับได้มากสุด {max} ชุด ได้ {count} ชุด","service.printData.itemNotObject":"รายการข้อมูลการพิมพ์ชุดที่ {index} ต้องเป็นอ็อบเจกต์","service.printData.notObjectOrArray":"printData ต้องเป็นอ็อบเจกต์หรืออาร์เรย์",...{"binding.k1":"อัปโหลดรูปภาพ","binding.k2":"รองรับเฉพาะไฟล์รูปภาพ","binding.k3":"ไม่ได้ตั้งค่าการอัปโหลดรูปภาพ","binding.k4":"กำลังอัปโหลด...","binding.k5":"อัปโหลดรูปภาพล้มเหลว","binding.k6":"อัปโหลดรูปภาพล้มเหลว","binding.k7":"อัปโหลดรูปภาพ","binding.k8":"รองรับรูปภาพ jpg/png/gif/bmp/webp/svg; ป้อนเส้นทางสัมพัทธ์หลังอัปโหลด","binding.k9":"เนื้อหา","binding.k10":"ป้อนเนื้อหา รองรับนิพจน์ {field}","canvas.k11":"ส่วนหัว","canvas.k12":"ส่วนท้าย","canvas.k13":"+ องค์ประกอบ","canvas.k14":"+ ข้อความคงที่","canvas.k15":"+ ฟิลด์ข้อมูล","canvas.k16":"คัดลอก","canvas.k17":"ตัด","canvas.k18":"วาง","canvas.k19":"ลบ","canvas.k20":"นำไปด้านหน้าสุด","canvas.k21":"เลื่อนขึ้น","canvas.k22":"เลื่อนลง","canvas.k23":"ส่งไปด้านหลังสุด","canvas.k24":"วาง","canvas.k25":"เลือกทั้งหมด","canvas.k26":"ยกเลิกการเลือก","code.k27":"คิวอาร์โค้ด","controls.k28":"ลด","controls.k29":"ลด","controls.k30":"เพิ่ม","controls.k31":"เพิ่ม","controls.k32":"คำอธิบายฟิลด์","controls.k33":"คืนค่าเริ่มต้น","controls.k34":"คืนค่าเริ่มต้น ({v0}{v1})","controls.k35":"{v0} (ใช้กับเซลล์ที่เลือกทั้งหมด)","controls.k36":"ตัวเลือกสี","cropAnchor.k37":"กำหนดเอง (คงเดิม)","cropAnchor.k38":"ค่าเริ่มต้น 100","cropAnchor.k39":"รูปตัวอย่าง","cropAnchor.k40":"รูปต้นฉบับ","elements.k41":"ข้อความ","elements.k42":"เนื้อหาข้อความยาว","elements.k43":"รูปภาพ","flowList.k44":"สมุนไพร 20g","flowList.k45":"สมุนไพร 15g","flowList.k46":"สมุนไพร 10g","flowList.k47":"สมุนไพร 10g","flowList.k48":"สมุนไพร 10g","flowList.k49":"สมุนไพร 10g","flowList.k50":"สมุนไพร 10g","fontSelect.k51":"ค่าเริ่มต้น","fontSelect.k52":"{v0} (ไม่ทราบ)","fontSelect.k53":'ใช้ "{v0}"',"formatBar.k54":"เส้นทึบ","formatBar.k55":"เส้นประ","formatBar.k56":"เส้นจุด","formatBar.k57":"เส้นคู่","formatBar.k58":"ออกจากเครื่องมือถ่ายรูปแบบ (Esc)","formatBar.k59":"เครื่องมือถ่ายรูปแบบ (ไม่รองรับเซลล์ตาราง)","formatBar.k60":"เครื่องมือถ่ายรูปแบบ (เลือกองค์ประกอบก่อน)","formatBar.k61":"เครื่องมือถ่ายรูปแบบ (เลือกองค์ประกอบต้นทางเพียงหนึ่ง)","formatBar.k62":"เครื่องมือถ่ายรูปแบบ: คลิกครั้งเดียวเพื่อถ่ายครั้งเดียว คลิกสองครั้งเพื่อถ่ายต่อเนื่อง","formatBar.k63":"{v0} (เลือกองค์ประกอบข้อความ)","formatBar.k64":"ไม่มีเส้นขอบ","formatBar.k65":"เส้นขอบทั้งหมด","formatBar.k66":"เส้นขอบด้านนอก","formatBar.k67":"เส้นขอบด้านใน","formatBar.k68":"เส้นขอบด้านใน (เฉพาะเซลล์ตาราง)","formatBar.k69":"เส้นขอบบน","formatBar.k70":"เส้นขอบล่าง","formatBar.k71":"เส้นขอบซ้าย","formatBar.k72":"เส้นขอบขวา","formatBar.k73":"{v0} (คลิกอีกครั้งเพื่อยกเลิก, รูปแบบ = ไม่มี)","formatBar.k74":"ความกว้าง","formatBar.k75":"ผสม","formatBar.k76":"สี","formatBar.k77":"สีเส้นขอบ","formatBar.k78":"เส้นขอบทั้งสี่ด้านไม่สอดคล้องกัน: รายการที่เว้นไว้ไม่ได้รายงานค่าผิด; ค่าที่ตั้งไว้ล่วงหน้า/ด้านเดียวใช้ค่าเริ่มต้น (เส้นทึบ 0.75 / #333333)","formatBar.k79":"จัดชิดซ้าย","formatBar.k80":"จัดกึ่งกลาง","formatBar.k81":"จัดชิดขวา","formatBar.k82":"จัดชอบแนว (เติมความกว้างบรรทัด รวมบรรทัดสุดท้าย)","formatBar.k83":"จัดชิดบน","formatBar.k84":"จัดกึ่งกลางแนวตั้ง","formatBar.k85":"จัดชิดล่าง","formatBar.k86":"ผสม","formatBar.k87":"ค่าเริ่มต้น","formatBar.k88":"ผสม","formatBar.k89":"ค่าเริ่มต้น","formatBar.k90":"ตัวหนา","formatBar.k91":"ขีดเส้นใต้","formatBar.k92":"ขีดฆ่า","formatBar.k93":"สีตัวอักษร {v0}","formatBar.fontDisabledHint":"(เลือกหรือผสมองค์ประกอบข้อความ)","formatBar.k94":"สีพื้นหลัง","formatBar.k95":"การจัดตำแหน่ง","formatBar.k96":"การจัดตำแหน่ง (เลือกองค์ประกอบข้อความหรือเซลล์)","formatBar.k97":"การจัดตำแหน่ง","formatBar.k98":"เส้นขอบ","formatBar.k99":"เส้นขอบ (เลือกองค์ประกอบ)","formatBar.k100":"เส้นขอบ","helpModal.k101":"ช่วยเหลือ","helpModal.k102":"ปิด","pageExtras.k103":"อัปโหลดภาพพื้นหลัง","pageExtras.k104":"รองรับเฉพาะไฟล์รูปภาพ","pageExtras.k105":"ไม่ได้ตั้งค่าการอัปโหลดภาพพื้นหลังออกแบบ","pageExtras.k106":"กำลังอัปโหลด...","pageExtras.k107":"อัปโหลดภาพพื้นหลังออกแบบล้มเหลว","pageExtras.k108":"อัปโหลดภาพพื้นหลังออกแบบล้มเหลว","pageExtras.k109":"อัปโหลดภาพพื้นหลัง","pageExtras.k110":"พื้นหลังออกแบบ","pageExtras.k111":"เฉพาะในตัวออกแบบ เพื่อการจัดตำแหน่ง; ไม่แสดงในตัวอย่างหรือการพิมพ์","pageExtras.k112":"หมุน ({v0}°)","pageExtras.k113":"ลบ","pageExtras.k114":"กำหนดเอง","pageExtras.k115":" แนวนอน","pageExtras.k116":" แนวตั้ง","pageExtras.k117":"แผ่นเป้าหมาย {v0}{v1} {v2}×{v3}mm · {v4} คอลัมน์ × {v5} แถว = {v6} เซลล์/แผ่น · แต่ละเซลล์ {v7}×{v8}mm","pageExtras.k118":"การพิมพ์แบบจัดเรียงชิ้น","pageExtras.k119":"จัดเรียงฉลากเป็นแถว × คอลัมน์บนแผ่นใหญ่เพื่อพิมพ์เป็นชุด","pageExtras.k120":"เปิดใช้งานการจัดเรียงชิ้น","pageExtras.k121":"กระดาษต่อเนื่องไม่รองรับการจัดเรียงชิ้น","pageExtras.k122":"แผ่นเป้าหมาย","pageExtras.k123":"กำหนดเอง","pageExtras.k124":"ขนาดแผ่นเป้าหมาย (mm)","pageExtras.k125":"แนวของแผ่นเป้าหมาย","pageExtras.k126":"แนวตั้ง","pageExtras.k127":"แนวนอน","pageExtras.k128":"ระยะขอบการจัดเรียงชิ้น (mm)","pageExtras.k129":"บน","pageExtras.k130":"ล่าง","pageExtras.k131":"ซ้าย","pageExtras.k132":"ขวา","pageExtras.k133":"ระยะห่างและจำนวนคอลัมน์ของเซลล์","pageExtras.k134":"ระยะห่างแนวนอน","pageExtras.k135":"ระยะห่างแนวตั้ง","pageExtras.k136":"จำนวนคอลัมน์","panels.k137":"ขยายแผงทรัพยากร","panels.k138":"องค์ประกอบ","panels.k139":"ฟิลด์","panels.k140":"เลเยอร์","panels.k141":"ทรัพยากร","panels.k142":"ยุบแผงทรัพยากร","panels.k143":"องค์ประกอบ","panels.k144":"ฟิลด์","panels.k145":"เลเยอร์","panels.k146":"ลากองค์ประกอบไปยังพื้นที่ทำงาน","panels.k147":"ฟิลด์ธุรกิจ","panels.k148":"ค้นหาฟิลด์...","panels.k149":"ค้นหาฟิลด์","panels.k150":"{v0} ({v1}) · คลิกเพื่อคัดลอกชื่อฟิลด์ · ค้าง Ctrl (⌘ บน Mac) ขณะลากเพื่อแทรกชื่อฟิลด์","panels.k151":"คัดลอกแล้ว","panels.k152":"ไม่มีฟิลด์","panels.k153":"ส่วนหัว","panels.k154":"ส่วนท้าย","panels.k155":"เลเยอร์","panels.k156":"นำไปด้านหน้าสุด","panels.k157":"เลื่อนขึ้น","panels.k158":"เลื่อนลง","panels.k159":"ส่งไปด้านหลังสุด","panels.k160":"จัดกลุ่ม (Ctrl+G)","panels.k161":"ยกเลิกจัดกลุ่ม (Ctrl+Shift+G)","panels.k162":"หน้า {v0}","panels.k163":"{v0} (ดับเบิลคลิกเพื่อเปลี่ยนชื่อ)","panels.k164":"ดับเบิลคลิกเพื่อเปลี่ยนชื่อ","panels.k165":"หน้า {v0}","panels.k166":"เทมเพลตแบบจัดเรียงชิ้นอนุญาตให้มีหน้าออกแบบได้เพียงหน้าเดียว","panels.k167":"เพิ่มหน้า (ต่อหน้าเปล่าหลังหน้าปัจจุบัน)","panels.k168":"เทมเพลตแบบจัดเรียงชิ้นอนุญาตให้มีหน้าออกแบบได้เพียงหน้าเดียว","panels.k169":'ทำซ้ำหน้าปัจจุบัน "{v0}"',"panels.k170":'ลบหน้าปัจจุบัน "{v0}"',"panels.k171":"เฉพาะเทมเพลตหลายหน้าที่ลบหน้าได้","panels.k172":'ย้าย "{v0}" ไปหน้าถัดไป',"panels.k173":'ย้าย "{v0}" ไปหน้าก่อนหน้า',"panels.k174":"แนวนอน","panels.k175":"แนวตั้ง","panels.k176":"ซูม {v0}%","propertyPanel.k177":"ทั้งหมด","propertyPanel.k178":"ด้านนอก","propertyPanel.k179":"ด้านใน","propertyPanel.k180":"ไม่มี","propertyPanel.k181":"บน","propertyPanel.k182":"ขวา","propertyPanel.k183":"ล่าง","propertyPanel.k184":"ซ้าย","propertyPanel.k185":"ตำแหน่งและขนาด","propertyPanel.k186":"ระยะขอบ (mm)","propertyPanel.k187":"บน","propertyPanel.k188":"ขวา","propertyPanel.k189":"ล่าง","propertyPanel.k190":"ซ้าย","propertyPanel.k191":"การหมุน (°)","propertyPanel.k192":"ทวนเข็มนาฬิกา 90°","propertyPanel.k193":"หมุนทวนเข็มนาฬิกา 90°","propertyPanel.k194":"ตามเข็มนาฬิกา 90°","propertyPanel.k195":"หมุนตามเข็มนาฬิกา 90°","propertyPanel.k196":"ลักษณะ","propertyPanel.k197":"ฟอนต์","propertyPanel.k198":"ค่าเริ่มต้น","propertyPanel.k199":"ขนาดฟอนต์","propertyPanel.k200":"น้ำหนักฟอนต์","propertyPanel.k201":"ปกติ","propertyPanel.k202":"หนา","propertyPanel.k203":"หนาขึ้น","propertyPanel.k204":"บางลง","propertyPanel.k205":"การจัดตำแหน่ง","propertyPanel.k206":"ซ้าย","propertyPanel.k207":"กลาง","propertyPanel.k208":"ขวา","propertyPanel.k209":"ชิดสองด้าน","propertyPanel.k210":"จัดแนวตั้ง","propertyPanel.k211":"บน","propertyPanel.k212":"กลาง","propertyPanel.k213":"ล่าง","propertyPanel.k214":"สี","propertyPanel.k215":"สีตัวอักษร","propertyPanel.k216":"สีพื้นหลัง","propertyPanel.k217":"สีพื้นหลัง","propertyPanel.k218":"ระยะบรรทัด","propertyPanel.k219":"ระยะห่างตัวอักษร","propertyPanel.k220":"ข้อความล้น","propertyPanel.k221":"ตัดทิ้ง","propertyPanel.k222":"ย่อให้พอดี","propertyPanel.k223":"ความสูงแถวอัตโนมัติ","propertyPanel.k224":"ขนาดฟอนต์ขั้นต่ำ (pt)","propertyPanel.k225":"ค่าเริ่มต้น 6","propertyPanel.k226":"เว้นวรรคบรรทัดแรก (อักขระ)","propertyPanel.k227":"ค่าเริ่มต้น 0","propertyPanel.k228":"ตัดคำอัตโนมัติ","propertyPanel.k229":"คงการขึ้นบรรทัด","propertyPanel.k230":"โหมดการปรับขนาด","propertyPanel.k231":"จุดยึดการครอป","propertyPanel.k232":"ไม่รองรับการตั้งค่าลักษณะสำหรับองค์ประกอบนี้","propertyPanel.k233":"การตั้งค่าบาร์โค้ด","propertyPanel.k234":"ประเภทรหัส","propertyPanel.k235":"CODE128 (ทั่วไป)","propertyPanel.k236":"EAN13 (ค้าปลีก)","propertyPanel.k237":"DPI ของเครื่องพิมพ์","propertyPanel.k238":"ไม่ระบุ (แสดงตามความกว้างแท่น)","propertyPanel.k239":"203 dpi (8 จุด/mm)","propertyPanel.k240":"300 dpi (11.8 จุด/mm)","propertyPanel.k241":"600 dpi (23.6 จุด/mm)","propertyPanel.k242":"เมื่อตั้งค่า ความกว้างแท่นจะปรับเป็นจุดพิมพ์เต็ม: บาร์โค้ดแสดงตามความกว้างแท่น ถ้าพอดีจะพิมพ์ตามนั้น มิเช่นนั้นจะย่อขนาดตามสัดส่วน","propertyPanel.k243":"ความกว้างแท่น (อัตราส่วน)","propertyPanel.k244":"ตั้งค่า DPI ของเครื่องพิมพ์แล้ว: ความกว้างแท่นปรับเป็นจุดเต็มที่ใกล้ที่สุด (DPI แทนค่า mm) จะย่อขนาดถ้าไม่พอดี","propertyPanel.k245":"ใช้ 3+ สำหรับเครื่องพิมพ์ความร้อน/ดอทเมทริกซ์: กำหนดขนาดแท่นที่พิมพ์ แท่นหนาจะเสถียรกว่า","propertyPanel.k246":"โซนเงียบ (โมดูล)","propertyPanel.k247":"ค่าเริ่มต้น 10","propertyPanel.k248":"ความสูงแท่น (mm)","propertyPanel.k249":"ค่าเริ่มต้น 30 โมดูล","propertyPanel.k250":"แสดงข้อความ","propertyPanel.k251":"ขนาดข้อความ (เทียบความสูงแท่น 30)","propertyPanel.k252":"ค่าเริ่มต้น 10","propertyPanel.k253":"การแก้ไขข้อผิดพลาด","propertyPanel.k254":"L (ต่ำสุด ความจุสูงสุด)","propertyPanel.k255":"M (แนะนำ)","propertyPanel.k256":"H (สูงสุด)","propertyPanel.k257":"โซนเงียบ (โมดูล)","propertyPanel.k258":"ค่าเริ่มต้น 0","propertyPanel.k259":"การตั้งค่าแบบกำหนดเอง","propertyPanel.k260":"ขนาดบาร์โค้ดขึ้นกับความกว้างแท่นและ DPI ของเครื่องพิมพ์: พิมพ์ตามความกว้างแท่นถ้าพอดี มิเช่นนั้นย่อขนาด; การดึงจะทำให้แท่นไม่เป็นจำนวนเต็ม จึงไม่มีโหมดปรับขนาด—ใช้ความกว้าง/สูงสูงสุดเป็นขีดจำกัด หากต้องการให้ใหญ่ขึ้น: เพิ่มความกว้างแท่น ลดโซนเงียบ หรือซ่อนข้อความเพื่อพื้นที่มากขึ้น","propertyPanel.k261":"โหมดการปรับขนาด","propertyPanel.k262":"ความกว้างสูงสุด (mm)","propertyPanel.k263":"ค่าเริ่มต้น","propertyPanel.k264":"ความสูงสูงสุด (mm)","propertyPanel.k265":"ค่าเริ่มต้น","propertyPanel.k266":"รายการแบบไหล","propertyPanel.k267":"โหมดการจัดวาง","propertyPanel.k268":"ความสูงคงที่","propertyPanel.k269":"การแบ่งหน้าแบบไดนามิก","propertyPanel.k270":"ระยะบน (mm)","propertyPanel.k271":"ระยะขวา (mm)","propertyPanel.k272":"ระยะล่าง (mm)","propertyPanel.k273":"ระยะซ้าย (mm)","propertyPanel.k274":"จำนวนคอลัมน์ต่อแถว","propertyPanel.k275":"ความสูงแถว (mm)","propertyPanel.k276":"ระยะห่างแนวนอนของเซลล์ (mm)","propertyPanel.k277":"ขยายคอลัมน์เมื่อเนื้อหายาว","propertyPanel.k278":"จำนวนคอลัมน์ขยายสูงสุด","propertyPanel.k279":"ที่ขนาดฟอนต์และความกว้างปัจจุบัน {v0} คอลัมน์ค่อนข้างแคบ (พอดีประมาณ {v1}) ค่าไม่เปลี่ยน; การพิมพ์ใช้ {v2} คอลัมน์","propertyPanel.k280":"ผสม","propertyPanel.k281":"เส้นขอบและพื้นหลัง","propertyPanel.k282":"รูปแบบเส้น","propertyPanel.k283":"ความกว้างเส้นขอบ","propertyPanel.k284":"ผสม","propertyPanel.k285":"สีเส้นขอบ","propertyPanel.k286":"สีเส้นขอบ","propertyPanel.k287":"สีพื้นหลัง","propertyPanel.k288":"สีพื้นหลัง","propertyPanel.k289":"การตั้งค่าขั้นสูง","propertyPanel.k290":"ล็อก","propertyPanel.k291":"ทำซ้ำทุกหน้า","propertyPanel.k292":"ตรึงทุกหน้า","propertyPanel.k293":"ลำดับชั้น","propertyPanel.k294":"ลบองค์ประกอบ","propertyPanel.k295":"หมายเหตุการตั้งค่าขั้นสูง","propertyPanel.k296":"หมายเหตุการตั้งค่าขั้นสูง","propertyPanel.k297":"อื่นๆ","propertyPanel.k298":"การตั้งค่าหน้ากระดาษ","propertyPanel.k299":"ขนาดกระดาษ","propertyPanel.k300":"ขนาดกำหนดเอง","propertyPanel.k301":"ความกว้างกระดาษ (mm)","propertyPanel.k302":"ขนาดกำหนดเอง (mm)","propertyPanel.k303":"แนวกระดาษ","propertyPanel.k304":"แนวตั้ง","propertyPanel.k305":"แนวนอน","propertyPanel.k306":"การสลับจะเปลี่ยนความกว้าง/สูงของกระดาษ (เนื้อหาจัดวางบนขนาดใหม่)","propertyPanel.k307":"การหมุนเนื้อหา","propertyPanel.k308":"สำหรับการจัดเรียงชิ้น ฉลากแต่ละชิ้นหมุนตามมนี้; ที่ 90°/270° ความกว้าง/สูงของเซลล์สลับและคอลัมน์เติมตามขีดใหม่; 0° หมายถึงไม่หมุน (ค่าเริ่มต้น)","propertyPanel.k309":"ทั้งหน้าหมุนสำหรับการพิมพ์; ที่ 90°/270° ความกว้าง/สูงของกระดาษสลับเพื่อพอดีโดยไม่บิดเบือนหรือตัด; 0° หมายถึงไม่หมุน (ค่าเริ่มต้น)","propertyPanel.k310":"สีพื้นหลังหน้ากระดาษ","propertyPanel.k311":"สีพื้นหลังหน้ากระดาษ","propertyPanel.k312":"ระยะขอบ (mm)","propertyPanel.k313":"บน","propertyPanel.k314":"ล่าง","propertyPanel.k315":"ซ้าย","propertyPanel.k316":"ขวา","propertyPanel.k317":"ความสูงส่วนหัว/ท้าย (mm)","propertyPanel.k318":"ความสูงส่วนหัว","propertyPanel.k319":"ความสูงส่วนท้าย","propertyPanel.k320":"ขยายแผงคุณสมบัติ","propertyPanel.k321":"คุณสมบัติองค์ประกอบ","propertyPanel.k322":"คุณสมบัติหน้ากระดาษ","propertyPanel.k323":"แผงคุณสมบัติ","propertyPanel.k324":"ยุบแผงคุณสมบัติ","propertyPanel.k325":"คุณสมบัติองค์ประกอบ","propertyPanel.k326":"คุณสมบัติหน้ากระดาษ","propertyPanel.k327":"เลือกองค์ประกอบบนพื้นที่ทำงาน","propertyPanel.k328":"คุณสมบัติที่กำหนดเอง","propertySearch.k328":"ค้นหาคุณสมบัติ...","propertySearch.k329":"ค้นหาคุณสมบัติ","tableProps.k330":"ส่วนหัวหลายระดับทำซ้ำทั้งกลุ่ม เมื่อเลือก แถวหัวทั้งหมดจะซ้ำที่ด้านบนของทุกหน้า","tableProps.k331":"แถวหัว","tableProps.k332":"แถวข้อมูล","tableProps.k333":"แถวรวมย่อย (ต่อหน้า)","tableProps.k334":"แถวสรุป","tableProps.k335":"CODE128 (ทั่วไป)","tableProps.k336":"EAN13 (ค้าปลีก)","tableProps.k337":"L (ต่ำสุด ความจุสูงสุด)","tableProps.k338":"M (แนะนำ)","tableProps.k339":"H (สูงสุด)","tableProps.k340":"ตัดทิ้ง","tableProps.k341":"ย่อให้พอดี","tableProps.k342":"ความสูงแถวอัตโนมัติ","tableProps.k343":"เลือกหลายรายการ","tableProps.k344":"คุณสมบัติแถว","tableProps.k345":"คุณสมบัติแถว","tableProps.k346":"ประเภทแถว","tableProps.k347":"ความสูงแถว (mm)","tableProps.k348":"ทำซ้ำส่วนหัวทุกหน้า","tableProps.k349":"การตั้งค่าตาราง","tableProps.k350":"ฟิลด์แหล่งข้อมูลรายการ","tableProps.k351":"ฟอนต์เริ่มต้น","tableProps.k352":"ค่าเริ่มต้น","tableProps.k353":"ขนาดฟอนต์เริ่มต้น (pt)","tableProps.k354":"ค่าเริ่มต้น","tableProps.k355":"สีข้อความเริ่มต้น","tableProps.k356":"สีข้อความเริ่มต้น","tableProps.k357":"ระยะภายในเริ่มต้น (mm)","tableProps.k358":"ค่าเริ่มต้น","tableProps.k359":"ความกว้างคอลัมน์ (mm)","tableProps.k360":"คอลัมน์ {v0}","tableProps.k361":"ความกว้างตารางไม่เกินความกว้างที่พิมพ์ได้ {v0}mm; คอลัมน์ {v1} ปรับเป็น {v2}mm","tableProps.k362":"เปิดใช้งานการแบ่งหน้า","tableProps.k363":"เข้าร่วมการแบ่งหน้า","tableProps.k364":"หน้าเดียวกับองค์ประกอบถัดไป","tableProps.k365":"การตั้งค่าการแบ่งหน้า","tableProps.k366":"บน","tableProps.k367":"ขวา","tableProps.k368":"ล่าง","tableProps.k369":"ซ้าย","tableProps.k370":"เซลล์","tableProps.k371":"เซลล์","tableProps.k372":"เลือกหลายรายการ","tableProps.k373":"เฉพาะแถวข้อมูลที่รองรับการรวมตามค่า","tableProps.k374":"คืนค่าเริ่มต้น (ตามค่าตาราง)","tableProps.k375":"เซลล์","tableProps.k376":"เลือก {v0} เซลล์ · ตั้งค่าเป็นชุด: ไม่แสดงรายเซลล์ การเปลี่ยนใช้กับเซลล์ที่เลือกทั้งหมด","tableProps.k377":"ประเภทเซลล์","tableProps.k378":"ข้อความ","tableProps.k379":"บาร์โค้ด","tableProps.k380":"คิวอาร์โค้ด","tableProps.k381":"รูปภาพ","tableProps.k382":"ประเภทรหัส","tableProps.k383":"แสดงข้อความ","tableProps.k384":"ความกว้างแท่น (อัตราส่วน)","tableProps.k385":"ตั้งค่า DPI ของเครื่องพิมพ์แล้ว: ความกว้างแท่นปรับเป็นจุดเต็ม (DPI แทนค่า mm) จะย่อขนาดถ้าเซลล์ไม่พอดี","tableProps.k386":"ใช้ 3+ สำหรับเครื่องพิมพ์ความร้อน/ดอทเมทริกซ์: กำหนดขนาดแท่นที่พิมพ์ แท่นหนาจะเสถียรกว่า","tableProps.k387":"โซนเงียบ (โมดูล)","tableProps.k388":"ค่าเริ่มต้น 10","tableProps.k389":"ความสูงแท่น (mm)","tableProps.k390":"ค่าเริ่มต้น 30 โมดูล","tableProps.k391":"ขนาดข้อความ (เทียบความสูงแท่น 30)","tableProps.k392":"ค่าเริ่มต้น 10","tableProps.k393":"DPI ของเครื่องพิมพ์","tableProps.k394":"ไม่ระบุ (แสดงตามความกว้างแท่น)","tableProps.k395":"203 dpi (8 จุด/mm)","tableProps.k396":"300 dpi (11.8 จุด/mm)","tableProps.k397":"600 dpi (23.6 จุด/mm)","tableProps.k398":"เมื่อตั้งค่า ความกว้างแท่นจะปรับเป็นจุดพิมพ์เต็ม: บาร์โค้ดแสดงตามความกว้างแท่น ถ้าพอดีจะพิมพ์ตามนั้น มิเช่นนั้นจะย่อขนาดตามสัดส่วน","tableProps.k399":"การแก้ไขข้อผิดพลาด","tableProps.k400":"โซนเงียบ (โมดูล)","tableProps.k401":"ค่าเริ่มต้น 0","tableProps.k402":"ขนาดบาร์โค้ดของเซลล์ขึ้นกับความกว้างแท่นและ DPI ของเครื่องพิมพ์: พิมพ์ตามความกว้างแท่นถ้าพอดี มิเช่นนั้นย่อขนาด; ไม่มีโหมดปรับขนาด (จะทำให้แท่นไม่เป็นจำนวนเต็ม)—ใช้ความกว้าง/สูงสูงสุดเป็นขีดจำกัด หากต้องการให้ใหญ่ขึ้น: เพิ่มความกว้างแท่น ลดโซนเงียบ หรือซ่อนข้อความ","tableProps.k403":"โหมดการปรับขนาด","tableProps.k404":"จุดยึดการครอป","tableProps.k405":"ความกว้างสูงสุด (mm)","tableProps.k406":"ค่าเริ่มต้น","tableProps.k407":"ความสูงสูงสุด (mm)","tableProps.k408":"ค่าเริ่มต้น","tableProps.k409":"เนื้อหา","tableProps.k410":"เลือกหลายรายการ (รายการที่ป้อนจะแทนที่เซลล์ที่เลือกทั้งหมด)","tableProps.k411":"ป้อนเนื้อหา รองรับนิพจน์ {field}","tableProps.k412":"จัดแนวนอน","tableProps.k413":"ซ้าย","tableProps.k414":"กลาง","tableProps.k415":"ขวา","tableProps.k416":"ชิดสองด้าน","tableProps.k417":"จัดแนวตั้ง","tableProps.k418":"บน","tableProps.k419":"กลาง","tableProps.k420":"ล่าง","tableProps.k421":"ฟอนต์","tableProps.k422":"สืบทอดค่าเริ่มต้น","tableProps.k423":"ขนาดฟอนต์ (pt)","tableProps.k424":"ค่าเริ่มต้น","tableProps.k425":"หนา","tableProps.k426":"สีข้อความ","tableProps.k427":"สีข้อความ","tableProps.k428":"สีพื้นหลัง","tableProps.k429":"สีพื้นหลัง","tableProps.k430":"เส้นขอบ","tableProps.k431":"ผสม","tableProps.k432":"เลือกหลายรายการ","tableProps.k433":"ผสม","tableProps.k434":"สีเส้นขอบ","tableProps.k435":"ทั้งหมด","tableProps.k436":"ด้านนอก","tableProps.k437":"ด้านใน","tableProps.k438":"ไม่มี","tableProps.k439":"ระยะภายใน (mm)","tableProps.k440":"ค่าเริ่มต้น","tableProps.k441":"ตัดคำอัตโนมัติ","tableProps.k442":"ข้อความล้น","tableProps.k443":"ขนาดฟอนต์ขั้นต่ำ (pt)","tableProps.k444":"ค่าเริ่มต้น 6","tableProps.k445":"รวมเซลล์","tableProps.k446":"รวมเซลล์","tableProps.k447":"แยกเซลล์","tableProps.k448":"รวมตามค่า","tableProps.k449":"แถวข้อมูลที่อยู่ติดกันที่มีค่าเท่ากันจะรวมแนวตั้ง; ข้ามหน้าจะแบ่งตามหน้าและทำซ้ำค่าในหน้าต่อเนื่อง","table.k450":"หัว","table.k451":"ข้อมูล","table.k452":"ย่อย","table.k453":"รวม","table.k454":"แถวหัว","table.k455":"แถวข้อมูล","table.k456":"แถวรวมย่อย","table.k457":"แถวสรุป","table.k458":"บาร์โค้ด","table.k459":"รูปภาพ","table.k460":"หลังแทรก ความกว้างตาราง {v0}mm เกินความกว้างที่พิมพ์ได้ {v1}mm; ลดความกว้างคอลัมน์ก่อน","table.k461":"ประเภทแถวไม่ระบุ","table.k462":"ไม่มีเซลล์ที่เลือก","table.k463":"เฉพาะแถวข้อมูลที่รองรับการรวมตามค่า","table.k464":"ไม่มีเซลล์ที่เลือก","table.k465":"ประเภทแถวรองรับการตั้งค่าแถวเดียวเท่านั้น","table.k466":"ไม่มีเซลล์ที่เลือก","table.k467":"แทรกแถวด้านบน","table.k468":"แทรกแถวด้านล่าง","table.k469":"ลบแถว","table.k470":"แทรกคอลัมน์ด้านซ้าย","table.k471":"แทรกคอลัมน์ด้านขวา","table.k472":"ลบคอลัมน์","table.k473":"รวมเซลล์","table.k474":"แยกเซลล์","table.k475":"รวมตามค่า","table.k476":"ประเภทแถว","table.k477":"ตัวจับปรับความกว้างคอลัมน์ {v0}","toolbarOverflow.k478":"คลิปบอร์ด","toolbarOverflow.k479":"เครื่องมือถ่ายรูปแบบ","toolbarOverflow.k480":"ซูม","toolbarOverflow.k481":"จัดระเบียบ / มุมมอง","toolbarOverflow.k482":"เส้นขอบ","toolbarOverflow.k483":"สี","toolbarOverflow.k484":"การจัดตำแหน่ง","toolbarOverflow.k485":"รูปแบบข้อความ","toolbarOverflow.k486":"ฟอนต์และขนาด","toolbarOverflow.k487":"เพิ่มเติม","toolbarOverflow.k488":'{v0}<span class="tb-btn-text">เพิ่มเติม</span>{v1}',"toolbar.k489":"แก้ไขเทมเพลต","toolbar.k490":"เทมเพลตใหม่","toolbar.k491":"จัดตำแหน่ง / กระจาย","toolbar.k492":"จัดชิดซ้าย","toolbar.k493":"จัดชิดขวา","toolbar.k494":"จัดชิดบน","toolbar.k495":"จัดชิดล่าง","toolbar.k496":"จัดกึ่งกลาง","toolbar.k497":"จัดกึ่งกลางแนวตั้ง","toolbar.k498":"กระจายแนวนอน","toolbar.k499":"กระจายแนวตั้ง","toolbar.k500":"ลำดับชั้น","toolbar.k501":"นำไปด้านหน้าสุด","toolbar.k502":"เลื่อนไปข้างหน้า","toolbar.k503":"เลื่อนไปข้างหลัง","toolbar.k504":"ส่งไปด้านหลังสุด","toolbar.k505":"จัดกลุ่ม","toolbar.k506":"จัดกลุ่ม (Ctrl+G)","toolbar.k507":"ยกเลิกจัดกลุ่ม (Ctrl+Shift+G)","toolbar.k508":"ไม้บรรทัด","toolbar.k509":"แสดง/ซ่อนไม้บรรทัด","toolbar.k510":"ตารางนำทาง","toolbar.k511":"แสดง/ซ่อนพื้นหลังตารางนำทาง","toolbar.k512":"กรอบประ","toolbar.k513":"แสดง/ซ่อนแนวประสำหรับตารางไร้เส้นขอบ","toolbar.k514":"ดูดติด","toolbar.k515":"สลับการดูดองค์ประกอบเข้าตารางนำทาง","toolbar.k516":"ตัวออกแบบเทมเพลตการพิมพ์","toolbar.k517":"เลิกทำ","toolbar.k518":"ทำซ้ำ","toolbar.k519":"จัดระเบียบ","toolbar.k520":"จัดระเบียบ","toolbar.k521":"มุมมอง","toolbar.k522":"มุมมอง","toolbar.k523":"พอดีกับหน้าต่าง","toolbar.k524":"ซูมออก","toolbar.k525":"ซูมเข้า","toolbar.k526":"คัดลอก (Ctrl+C) เลือกองค์ประกอบก่อน","toolbar.k527":"คัดลอก (Ctrl+C)","toolbar.k528":"วาง (Ctrl+V) เลือกองค์ประกอบก่อน","toolbar.k529":"วาง (Ctrl+V) คลิปบอร์ดว่าง","toolbar.k530":"วาง (Ctrl+V)","toolbar.k531":"ลบ (Delete) เลือกองค์ประกอบก่อน","toolbar.k532":"ลบ (Delete)","toolbar.k533":"ช่วยเหลือ","toolbar.k534":"ดูตัวอย่างผลการพิมพ์","toolbar.k535":"ตัวอย่าง","toolbar.k536":"บันทึกเทมเพลต","toolbar.k537":"บันทึก","watermark.k538":"ลายน้ำ","watermark.k539":"นิพจน์ลายน้ำ","watermark.k540":"ป้อนข้อความได้เลย หรือนิพจน์: {order.no}, {printDate}","watermark.k541":'ดับเบิลคลิกหรือคลิก "แก้ไขนิพจน์" เพื่อเปิดตัวแก้ไขนิพจน์',"watermark.k542":"แก้ไขนิพจน์","watermark.k543":"ค่าทดสอบ","watermark.k544":"แสดงในตัวอย่างเมื่อนิพจน์ไม่มีค่า","watermark.k545":"มุมหมุน","watermark.k546":"สี","watermark.k547":"สีลายน้ำ","watermark.k548":"ความโปร่งใส","watermark.k549":"ความหนาแน่น","watermark.k550":"กำหนดเอง","watermark.k551":"ความกว้างชิ้น","watermark.k552":"ความสูงชิ้น","elementDefinitions.k553":"ข้อความ","elementDefinitions.k554":"บาร์โค้ด","elementDefinitions.k555":"คิวอาร์โค้ด","elementDefinitions.k556":"รูปภาพ","elementDefinitions.k557":"ตาราง","elementDefinitions.k558":"ข้อความยาว","elementDefinitions.k559":"รายการแบบไหล","elementDefinitions.k560":"เส้นแนวนอน","elementDefinitions.k561":"เส้นแนวตั้ง","elementDefinitions.k562":"สี่เหลี่ยมผืนผ้า","elementDefinitions.k563":"วงรี","elementDefinitions.k564":"หมายเลขหน้า","elementDefinitions.k565":"registerElementDefinition: type ต้องเป็นสตริงที่ไม่ว่างเปล่า","elementDefinitions.k566":"registerElementDefinition: label ต้องเป็นสตริงที่ไม่ว่างเปล่า","elementDefinitions.k567":"registerElementRenderer: ต้องการ type และฟังก์ชัน render","panels.paperRotated":" (หมุน {rot}°)","panels.statusElements":"{count} องค์ประกอบ{selected}","panels.statusSelected":" (เลือก {n})"},...{"expression.tabField":"ฟิลด์","expression.tabVariable":"ตัวแปร","expression.tabFunction":"ฟังก์ชัน","expression.placeholderField":"ค้นหาฟิลด์...","expression.placeholderVariable":"ค้นหาตัวแปร...","expression.placeholderFunction":"ค้นหาฟังก์ชัน...","expression.fnSum":"ผลรวม","expression.fnAvg":"ค่าเฉลี่ย","expression.fnCount":"จำนวน","expression.fnMin":"ค่าต่ำสุด","expression.fnMax":"ค่าสูงสุด","expression.fnAdd":"บวก","expression.fnSub":"ลบ","expression.fnMul":"คูณ","expression.fnDiv":"หาร","expression.fnRound":"ปัดเศษ","expression.fnRoundUp":"ปัดขึ้น","expression.fnRoundDown":"ปัดลง","expression.fnRoundBank":"ปัดเศษแบบธนาคาร","expression.fnMoney":"จัดรูปแบบจำนวนเงิน","expression.fnDate":"จัดรูปแบบวันที่","expression.fnUpper":"จำนวนเงินเป็นตัวอักษร","expression.fnIf":"เงื่อนไข","expression.varPageIndex":"หน้าปัจจุบัน","expression.varTotalPages":"จำนวนหน้าทั้งหมด","expression.varPrintDate":"วันที่พิมพ์","expression.varPrintTime":"เวลาพิมพ์","expression.groupAggregate":"ฟังก์ชันรวมค่า","expression.groupMath":"คณิตศาสตร์","expression.groupFormat":"การจัดรูปแบบ","expression.previewEmpty":"(ดูตัวอย่างหลังป้อนนิพจน์)","expression.previewNoValue":"(ไม่สามารถคำนวณได้)","expression.previewError":"(นิพจน์ผิดพลาด)","expression.k1":"ประเภท","expression.k2":"วิธีป้อน","expression.k3":"ดับเบิลคลิกฟิลด์ ตัวแปร หรือฟังก์ชันทางด้านซ้ายเพื่อแทรก","expression.k4":"ค้าง Ctrl (⌘ บน Mac) ขณะดับเบิลคลิกเพื่อแทรกชื่อฟิลด์เป็นข้อความคงที่","expression.k5":"ป้อนข้อความคงที่ได้เลย เช่น ชื่อผู้จัดจำหน่าย","expression.k6":"ฟิลด์ ตัวแปร และฟังก์ชันแบบไดนามิกต้องอยู่ใน {}","expression.k7":"ตัวอย่าง: {SUM(supplier.name)}","expression.k8":"ป้อนคีย์ภาษาไทยได้โดยตรงเป็น {field} เช่น {name}","expression.k9":"หมายเหตุ: ซ้อนได้เพียงหนึ่งระดับ","expression.k10":"ฟังก์ชัน","expression.k11":"SUM(field) - ผลรวม","expression.k12":"AVG(field) - ค่าเฉลี่ย","expression.k13":"COUNT(field) - จำนวน","expression.k14":"IF(cond, true, false) - เงื่อนไข","expression.k15":"เลขคณิต: {qty * price}, {ADD(qty, 1)}","expression.k16":"การปัดเศษ: ROUND ปัดครึ่งขึ้น / ROUNDUP ปัดขึ้น / ROUNDDOWN ปัดลง / ROUNDBANK แบบธนาคาร","expression.k17":"ตัวแปรระบบ","expression.k18":"{pageIndex} - หน้าปัจจุบัน","expression.k19":"{totalPages} - จำนวนหน้าทั้งหมด","expression.k20":"{printDate} - วันที่พิมพ์","expression.k21":"ตัวอย่าง","expression.k22":"ข้อความคงที่: ชื่อผู้จัดจำหน่าย","expression.k23":"ฟิลด์ไดนามิก: {supplier.name}","expression.k24":"เรียกใช้ฟังก์ชัน: {SUM(amount)}","expression.k25":'เงื่อนไข: {IF(amount>1000, "ใหญ่", "เล็ก")}',"expression.k26":"เลขคณิตและปัดเศษ: {ROUND(qty * price, 2)}","expression.k27":"ไม่มีฟิลด์","expression.k28":"คัดลอกแล้ว","expression.k29":"ประเภท","expression.k30":"ข้อมูลช่วยเหลือ","expression.k31":"วิธีป้อน","expression.k32":"ผลตัวอย่าง","expression.k33":"แก้ไขนิพจน์","expression.k34":"ปิด","expression.k35":"ยกเลิก","expression.k36":"ยืนยัน"}},sb={constants:{"constants.borderStyle.none":"无","constants.borderStyle.solid":"实线","constants.borderStyle.dashed":"虚线","constants.borderStyle.dotted":"点线","constants.borderStyle.double":"双线","constants.paper.A4.label":"A4 210×297mm","constants.paper.A3.label":"A3 297×420mm","constants.paper.A5.label":"A5 148×210mm","constants.paper.Letter.label":"Letter 216×279mm","constants.paper.Legal.label":"Legal 216×356mm","constants.paper.DOT_FULL.label":"全等分 241×279.4mm","constants.paper.DOT_HALF.label":"二等分 241×139.7mm","constants.paper.DOT_THIRD.label":"三等分 241×93.1mm","constants.paper.LABEL_80X60.label":"80×60mm","constants.paper.LABEL_60X40.label":"60×40mm","constants.paper.LABEL_40X30.label":"40×30mm","constants.paper.THERMAL_57.label":"57mm","constants.paper.THERMAL_80.label":"80mm","constants.paper.THERMAL_110.label":"110mm","constants.paper.CONTINUOUS.label":"连续纸(自定义宽度)","constants.paper.group.common":"常用纸张","constants.paper.group.dotMatrix":"针式打印纸","constants.paper.group.labels":"标签纸","constants.paper.group.receipt":"小票纸","constants.paper.group.continuous":"连续纸","constants.watermark.density.dense":"密","constants.watermark.density.medium":"中(默认)","constants.watermark.density.loose":"疏","constants.watermark.density.size":"({w}×{h})","constants.label.content":"内容","constants.hint.border.apply":"线型 / 宽度 / 颜色即时生效,这三行显示的就是当前生效规格:已有边框时任改一行都会按新规格铺满四边并清掉单边覆盖;上、下、左、右只给选中的边加框,撤掉一边会把它其余三边落成单边;「无」清除边框,「内部」仅表格单元格可用","constants.hint.border.pending":"线型 / 宽度 / 颜色是待应用规格:选中格已有的边框规格一致时会填进这三行;四边不一致的项显示「混合」,一条边都没有时显示「无 / 0」。改完点「全部 / 外侧 / 内部」或勾选上、下、左、右某条边才会写入选中的单元格;「无」是清除边框","constants.hint.border.multi":"多选时不回显单格边框:线型 / 宽度 / 颜色按当前设置作为批写规格,点「全部 / 外侧 / 内部」或勾选某条边后写入所有选中格;「无」是清除边框","constants.hint.border.mixed":"当前单元格四边边框规格不一致:带「混合」的项不谎报,未改项在点「全部 / 外侧 / 内部」或勾选单边时按缺省档(实线 0.75pt)写入,改任一项即按该值批写"}},lb={constants:{"constants.borderStyle.none":"None","constants.borderStyle.solid":"Solid","constants.borderStyle.dashed":"Dashed","constants.borderStyle.dotted":"Dotted","constants.borderStyle.double":"Double","constants.paper.A4.label":"A4 210×297mm","constants.paper.A3.label":"A3 297×420mm","constants.paper.A5.label":"A5 148×210mm","constants.paper.Letter.label":"Letter 216×279mm","constants.paper.Legal.label":"Legal 216×356mm","constants.paper.DOT_FULL.label":"Full sheet 241×279.4mm","constants.paper.DOT_HALF.label":"Half sheet 241×139.7mm","constants.paper.DOT_THIRD.label":"Third sheet 241×93.1mm","constants.paper.LABEL_80X60.label":"80×60mm","constants.paper.LABEL_60X40.label":"60×40mm","constants.paper.LABEL_40X30.label":"40×30mm","constants.paper.THERMAL_57.label":"57mm","constants.paper.THERMAL_80.label":"80mm","constants.paper.THERMAL_110.label":"110mm","constants.paper.CONTINUOUS.label":"Continuous paper (custom width)","constants.paper.group.common":"Common","constants.paper.group.dotMatrix":"Dot-matrix","constants.paper.group.labels":"Labels","constants.paper.group.receipt":"Receipt","constants.paper.group.continuous":"Continuous","constants.watermark.density.dense":"Dense","constants.watermark.density.medium":"Medium (default)","constants.watermark.density.loose":"Sparse","constants.watermark.density.size":" ({w}×{h})","constants.label.content":"Content","constants.hint.border.apply":'Line style / width / color apply immediately; these three rows show the effective spec. With an existing border, changing any row fills all four sides and clears per-side overrides. Top / right / bottom / left add a border only to the selected side; removing one turns the other three into per-side borders. "None" clears the border; "Inside" is available for table cells only.',"constants.hint.border.pending":'Line style / width / color are a pending spec: they are prefilled when the selected cells share one border spec. Mixed values show "Mixed"; no border shows "None / 0". Click All / Outside / Inside or tick a side (top / right / bottom / left) to write to the selected cells; "None" clears the border.',"constants.hint.border.multi":'Multi-select does not show a single cell border: line style / width / color act as a batch spec. Click All / Outside / Inside or tick a side to apply to all selected cells; "None" clears the border.',"constants.hint.border.mixed":'The four sides of this cell have different border specs: "Mixed" is shown instead of a false value. Untouched fields fall back to the default (Solid 0.75pt) when you click All / Outside / Inside or tick a side; changing any field writes that value to the batch.'}},pb={constants:{"constants.borderStyle.none":"ไม่มี","constants.borderStyle.solid":"เส้นทึบ","constants.borderStyle.dashed":"เส้นประ","constants.borderStyle.dotted":"เส้นจุด","constants.borderStyle.double":"เส้นคู่","constants.paper.A4.label":"A4 210×297mm","constants.paper.A3.label":"A3 297×420mm","constants.paper.A5.label":"A5 148×210mm","constants.paper.Letter.label":"Letter 216×279mm","constants.paper.Legal.label":"Legal 216×356mm","constants.paper.DOT_FULL.label":"แผ่นเต็ม 241×279.4mm","constants.paper.DOT_HALF.label":"แผ่นครึ่ง 241×139.7mm","constants.paper.DOT_THIRD.label":"แผ่นหนึ่งในสาม 241×93.1mm","constants.paper.LABEL_80X60.label":"80×60mm","constants.paper.LABEL_60X40.label":"60×40mm","constants.paper.LABEL_40X30.label":"40×30mm","constants.paper.THERMAL_57.label":"57mm","constants.paper.THERMAL_80.label":"80mm","constants.paper.THERMAL_110.label":"110mm","constants.paper.CONTINUOUS.label":"กระดาษต่อเนื่อง (ความกว้างกำหนดเอง)","constants.paper.group.common":"กระดาษทั่วไป","constants.paper.group.dotMatrix":"กระดาษดอทเมทริกซ์","constants.paper.group.labels":"ฉลาก","constants.paper.group.receipt":"ใบเสร็จ","constants.paper.group.continuous":"กระดาษต่อเนื่อง","constants.watermark.density.dense":"หนาแน่น","constants.watermark.density.medium":"กลาง (ค่าเริ่มต้น)","constants.watermark.density.loose":"ห่าง","constants.watermark.density.size":" ({w}×{h})","constants.label.content":"เนื้อหา","constants.hint.border.apply":'รูปแบบเส้น/ความกว้าง/สีมีผลทันที สามบรรทัดนี้แสดงผลที่มีผลอยู่: เมื่อมีเส้นขอบอยู่แล้ว การเปลี่ยนแถวใดจะเติมสี่ด้านและลบการเขียนทับรายด้าน; บน/ขวา/ล่าง/ซ้ายเพิ่มเส้นเฉพาะด้านที่เลือก การลบด้านหนึ่งจะทำให้สามด้านที่เหลือเป็นเส้นแยก; "ไม่มี" ลบเส้นขอบ "ด้านใน" ใช้สำหรับเซลล์ตารางเท่านั้น',"constants.hint.border.pending":'รูปแบบเส้น/ความกว้าง/สีเป็นค่าที่รอใช้งาน: จะเติมในสามบรรทัดนี้เมื่อเซลล์ที่เลือกมีเส้นขอบสอดคล้องกัน; ค่าที่ไม่ตรงกันแสดง "ผสม" ไม่มีเส้นแสดง "ไม่มี / 0" แก้แล้วคลิก ทั้งหมด/ด้านนอก/ด้านใน หรือทำเครื่องหมายด้านใดด้านหนึ่งจึงเขียนลงเซลล์ที่เลือก; "ไม่มี" ลบเส้นขอบ',"constants.hint.border.multi":'การเลือกหลายรายการไม่แสดงเส้นขอบของเซลล์เดี่ยว: รูปแบบเส้น/ความกว้าง/สีเป็นค่าเขียนเป็นชุด คลิก ทั้งหมด/ด้านนอก/ด้านใน หรือทำเครื่องหมายด้านใดด้านหนึ่งเพื่อเขียนทุกเซลล์ที่เลือก; "ไม่มี" ลบเส้นขอบ',"constants.hint.border.mixed":'เส้นขอบสี่ด้านของเซลล์นี้ไม่สอดคล้องกัน: รายการ "ผสม" ไม่รายงานค่าผิด; รายการที่ไม่เปลี่ยนใช้ค่าเริ่มต้น (เส้นทึบ 0.75pt) เมื่อคลิก ทั้งหมด/ด้านนอก/ด้านใน หรือทำเครื่องหมายด้านเดียว; เปลี่ยนรายการใดจะเขียนค่านั้นเป็นชุด'}},db={propertyTips:{"propertyTips.ap-long-text-indent":"长文本每段首行空出的宽度,单位「字符」:填 2 即缩进两个汉字宽(中文排版惯例),按 em 落纸——字号被「自动缩小」压小时缩进同步变窄。仅长文本元素生效,写在普通文本上不生效","propertyTips.ap-img-fit":"图片在元素框内的缩放方式:包含=完整显示、可能留白;剪裁=铺满框并按「裁剪锚点」取一块;拉伸=填满框会变形;原始尺寸与缩小不放大。画布与三条出纸链路同一口径(缺省包含)","propertyTips.ap-img-object-position":"取位(仅「剪裁」档有这一行):剪裁把图等比铺满元素框,多出来的那一条边按这里选的位置取舍。先选位置档(贴边/居中/贴另一头),再按百分比微调,0 贴左/贴顶,100 挪到另一头,水平与垂直各自独立;缺省取正中间(保住证件照头顶就选顶部)。其余缩放模式图比框小或刚好铺满,没有可裁的边,所以不出本行","propertyTips.ap-img-fit-scale":"剪裁放大:等比铺满之后把画面再推大这么多,两轴才真的各多出一条边可裁——图与框同比例时不放大就什么都裁不掉。100=不放大(缺省),上限 400;超出框的部分由元素框裁掉。锚点选中的那一点既是取位的钉住点、也是放大的中心,两者共用同一个值。仅「剪裁」档生效,其余缩放模式不出本行","propertyTips.ap-rotate":"元素绕自身中心旋转的角度(度,0~359):出纸时按旋转后外接盒分页与结算,底部放不下自动移页,超出纸面左右缘或顶部会被裁切并给出纸提示。表格、流式列表与表格下方跟随区的元素不支持旋转(这三类不出本行);条码与二维码的任意角度需 385dpi 以上打印头,低分辨率打印机只按 90° 步进出纸","propertyTips.fl-columns":"一行排几个单元,必须由你指定——不随内容自动算列数。填的列数乘单元宽放不下元素框时只给提示、不改你的数,出纸按你填的排","propertyTips.fl-row-height":"每个单元行的最低高度(毫米),与表格行高同一口径:内容比它高时这一行会撑高,不会裁字","propertyTips.fl-gap-x":"相邻单元之间的横向留白(毫米);纵向不留缝,行与行的距离由行高承担","propertyTips.fl-auto-span":"单元内容比一列还宽时,让它占掉两个或更多列位;当前行剩不够放就把整个单元挪到下一行行首(绝不把词切两半)。默认关——开着时出纸栏数由字号与框宽决定","propertyTips.fl-max-span":"跨列的列数上限,最大只能等于「每行列数」:把每行列数改小时,这里会被一并顶回去","propertyTips.fl-layout-mode":"容器高度由谁决定:固定高度=维持设计高度、一框一页,超高裁切(存量模板默认值,输出不变);动态分页=容器高度由内容撑开,内容满页后按行续页,每一页都画完整边框,元素下方的跟随区与表格同一套规则","propertyTips.fl-padding-top":"动态分页模式下容器顶部与第一行内容之间的留白(毫米),仅动态模式生效;每页切片都按它留白并计入分页预算,负值与非法值按 0 处理","propertyTips.fl-padding-right":"动态分页模式下容器右侧与内容之间的留白(毫米),会压缩参与列宽估算的内容宽度,仅动态模式生效","propertyTips.fl-padding-bottom":"动态分页模式下容器底部与最后一行内容之间的留白(毫米),每页切片都按它留白并计入分页预算,仅动态模式生效","propertyTips.fl-padding-left":"动态分页模式下容器左侧与内容之间的留白(毫米),会压缩参与列宽估算的内容宽度,仅动态模式生效","propertyTips.cd-bar-quiet-zone":"条形码左右两端的空白格数(1 格 = 1 条宽):缺省 10,正是一维码码制要求的下限;数值越小白边越窄、同样的框内条越粗(可放大)。填 0 即不留白边,但静区参与「条→空→条」跳变,紧邻文字或表格线时可能扫不出,需实打验证","propertyTips.cd-bar-height":"黑白条本体的目标高度(mm,不含下方文字):折算粒度就是每模块物理宽,所以只能精确到它的整数倍。条宽优先——可用框高装不下时期望条高让位,绝不把条宽挤窄(热敏出纸清晰度靠条宽)。与「最大高度」分工不同:那条限的是整图(含文字)的上限","propertyTips.cd-quiet-zone":"二维码四周留出的空白格数:0 即不留白边、码面等比铺满元素框(此时靠框外的白纸充当静区);数值越大白边越宽、码面在框内越小(缺省 0,需 ISO/IEC 18004 推荐静区时填 4)"}},cb={propertyTips:{"propertyTips.ap-long-text-indent":'First-line indent for each paragraph of a long-text element, in characters: 2 means two Chinese characters wide (a common CJK convention), laid out in em units — it scales down when "Auto shrink" reduces the font size. Applies to long-text elements only; setting it on plain text has no effect.',"propertyTips.ap-img-fit":"How the image is scaled inside the element box. Contain: show the whole image, possibly with blank space. Crop: fill the box and take a region based on the crop anchor. Stretch: fill the box and distort. Original size / Shrink: never enlarge. The canvas and all three print pipelines use the same rule (Contain by default).","propertyTips.ap-img-object-position":"Crop anchor (only shown for Crop mode): cropping scales the image to fill the box, and this picks which extra edge to keep. Choose a position preset (edge / center / opposite edge), then fine-tune with the percentage: 0 aligns left/top, 100 aligns to the other end; horizontal and vertical are independent. The default is centered (choose Top to keep the head in ID photos). Other fit modes have no crop edge, so this row is hidden.","propertyTips.ap-img-fit-scale":"Crop zoom: after filling the box, enlarge the image by this much so both axes gain a crop margin — when image and box have the same aspect ratio, no zoom means nothing can be cropped. 100 = no zoom (default), maximum 400; anything outside the box is clipped by the element frame. The chosen anchor is both the pinning point and the zoom center. Shown for Crop mode only.","propertyTips.ap-rotate":"Rotation of the element about its own center, in degrees (0–359). During printing, pagination and layout use the rotated bounding box: content that does not fit at the bottom moves to the next page, and content beyond the left/right/top paper edges is clipped with a print warning. Tables, flow lists and elements in the follow-up zone below a table do not support rotation (this row is hidden for them); arbitrary angles for barcodes and QR codes require a 385dpi+ print head — lower-resolution printers only output in 90° steps.","propertyTips.fl-columns":"The number of cells per row must be specified by you — it is never inferred from content. If the column count times the cell width does not fit the element box, you get a hint but your value is not changed, and print output follows what you entered.","propertyTips.fl-row-height":"Minimum height of each cell row, in millimetres, using the same rule as table row height: a row grows when its content is taller, and text is never clipped.","propertyTips.fl-gap-x":"Horizontal whitespace between adjacent cells, in millimetres. No vertical gap is inserted; the distance between rows comes from the row height.","propertyTips.fl-auto-span":"When a cell is wider than one column, let it span two or more columns; if the current row has too few columns left, move the whole cell to the start of the next row (never split a word). Off by default — when on, the printed column count depends on font size and box width.","propertyTips.fl-max-span":'Upper limit for column spanning; it can never exceed "Columns per row". Lowering the column count also pushes this value down.',"propertyTips.fl-layout-mode":"What decides the container height. Fixed height: keep the designed height, one box per page, clip overflow (the default for existing templates, output unchanged). Dynamic pagination: the container grows with its content, continues row by row after a page fills, draws a complete border on every page, and follows the same rules as tables for the follow-up zone below the element.","propertyTips.fl-padding-top":"Whitespace between the top of the container and the first content row in dynamic pagination mode, in millimetres. Only applies in dynamic mode; every page slice uses this padding and counts it in the pagination budget. Negative or invalid values are treated as 0.","propertyTips.fl-padding-right":"Whitespace between the right side of the container and the content in dynamic pagination mode, in millimetres; it reduces the content width available for column-width estimation. Only applies in dynamic mode.","propertyTips.fl-padding-bottom":"Whitespace between the bottom of the container and the last content row in dynamic pagination mode, in millimetres. Only applies in dynamic mode; every page slice uses this padding and counts it in the pagination budget.","propertyTips.fl-padding-left":"Whitespace between the left side of the container and the content in dynamic pagination mode, in millimetres; it reduces the content width available for column-width estimation. Only applies in dynamic mode.","propertyTips.cd-bar-quiet-zone":"Number of blank modules on each side of a barcode (1 module = 1 bar width): the default of 10 is the minimum required by 1D symbologies. Smaller values narrow the quiet zone and make bars thicker in the same box (they can be enlarged). Setting 0 removes the white margin, but the quiet zone participates in bar-space-bar transitions, so codes next to text or table lines may fail to scan — verify with a real print.","propertyTips.cd-bar-height":'Target height of the black bars themselves, in millimetres (excluding the text below). The granularity is the physical width of one module, so only integer multiples are exact. Bar width takes priority: if the available height cannot fit the desired bar height, the height gives way — bars are never narrowed (thermal print clarity depends on bar width). This differs from "Maximum height", which limits the whole image including text.',"propertyTips.cd-quiet-zone":"Number of blank modules around a QR code: 0 means no white margin and the code scales to fill the element box (the surrounding white paper acts as the quiet zone). Larger values widen the margin and make the code smaller in the box. The default is 0; use 4 for the quiet zone recommended by ISO/IEC 18004."}},ub={propertyTips:{"propertyTips.ap-long-text-indent":'ระยะเว้นบรรทัดแรกของแต่ละย่อหน้าในข้อความยาว หน่วยเป็นอักขระ: ใส่ 2 หมายถึงเว้นสองตัวอักษรจีน (ตามธรรมเนียม CJK) คำนวณเป็นหน่วย em — จะย่อตามเมื่อ "ย่ออัตโนมัติ" ลดขนาดฟอนต์ ใช้เฉพาะองค์ประกอบข้อความยาว การตั้งค่าบนข้อความธรรมดาไม่มีผล',"propertyTips.ap-img-fit":"วิธีปรับขนาดรูปภาพภายในกรอบองค์ประกอบ พอดี: แสดงรูปทั้งหมดอาจมีช่องว่าง ครอบ: เติมกรอบแล้วตัดตามจุดยึดการครอป ดึง: เติมกรอบและบิดเบือน ขนาดต้นฉบับ/ย่อ: ไม่ขยาย พื้นที่ทำงานและทั้งสามไปป์ไลน์การพิมพ์ใช้กฎเดียวกัน (ค่าเริ่มต้นพอดี)","propertyTips.ap-img-object-position":"จุดยึดการครอป (แสดงเฉพาะโหมดครอบ): การครอปปรับรูปให้เติมกรอบ ตัวเลือกนี้เลือกขอบส่วนเกินที่ต้องการคงไว้ เลือกระดับตำแหน่ง (ชิดขอบ/กลาง/ชิดอีกด้าน) แล้วปรับด้วยเปอร์เซ็นต์: 0 ชิดซ้าย/บน 100 ชิดขวา/ล่าง แนวนอนและแนวตั้งอิสระต่อกัน ค่าเริ่มต้นอยู่กึ่งกลาง (เลือก บน เพื่อคงศีรษะในรูปบัตรประจำตัว) โหมดอื่นไม่มีขอบให้ครอปจึงซ่อนบรรทัดนี้","propertyTips.ap-img-fit-scale":"ขยายการครอป: หลังเติมกรอบแล้วขยายภาพอีกมากน้อยเพียงนี้ เพื่อให้ทั้งสองแกนมีขอบให้ครอป — เมื่อรูปและกรอบมีอัตราส่วนเท่ากัน การไม่ขยายจะครอปไม่ได้เลย 100 = ไม่ขยาย (ค่าเริ่มต้น) สูงสุด 400 ส่วนที่เกินกรอบถูกตัดโดยกรอบองค์ประกอบ จุดยึดที่เลือกเป็นทั้งจุดตรึงและศูนย์กลางการขยาย แสดงเฉพาะโหมดครอบ","propertyTips.ap-rotate":"มุมหมุนขององค์ประกอบรอบจุดศูนย์กลางตัวเอง เป็นองศา (0–359) ขณะพิมพ์ การแบ่งหน้าและการจัดวางใช้กล่องล้อมรอบที่หมุนแล้ว: เนื้อหาที่ไม่พอด้านล่างย้ายไปหน้าถัดไป และเนื้อหาที่เกินขอบกระดาษซ้าย/ขวา/บนถูกตัดพร้อมคำเตือน ตาราง รายการแบบไหล และองค์ประกอบในโซนตามหลังตารางไม่รองรับการหมุน (ซ่อนบรรทัดนี้); มุมใดๆ ของบาร์โค้ดและคิวอาร์โค้ดต้องการหัวพิมพ์ 385dpi ขึ้นไป — เครื่องพิมพ์ความละเอียดต่ำกว่าส่งออกได้เฉพาะขั้น 90°","propertyTips.fl-columns":"จำนวนเซลล์ต่อแถวต้องระบุเองเสมอ — ไม่คำนวณจากเนื้อหา หากจำนวนคอลัมน์คูณความกว้างเซลล์ไม่พอดีกับกรอบองค์ประกอบจะมีคำแนะนำแต่ค่าไม่เปลี่ยน และผลการพิมพ์เป็นไปตามที่ป้อน","propertyTips.fl-row-height":"ความสูงขั้นต่ำของแถวเซลล์แต่ละแถว เป็นมิลลิเมตร ใช้กฎเดียวกับความสูงแถวตาราง: แถวจะสูงขึ้นเมื่อเนื้อหาสูงกว่า และข้อความไม่ถูกตัด","propertyTips.fl-gap-x":"ช่องว่างแนวนอนระหว่างเซลล์ที่อยู่ติดกัน เป็นมิลลิเมตร ไม่มีการเว้นช่องแนวตั้ง ระยะระหว่างแถวมาจากความสูงแถว","propertyTips.fl-auto-span":"เมื่อเซลล์กว้างกว่าหนึ่งคอลัมน์ ให้ขยายครอบสองคอลัมน์ขึ้นไป; หากแถวปัจจุบันเหลือคอลัมน์ไม่พอ ย้ายเซลล์ทั้งหมดไปขึ้นต้นแถวถัดไป (ไม่ตัดคำ) ปิดอยู่โดยค่าเริ่มต้น — เมื่อเปิด จำนวนคอลัมน์ที่พิมพ์ขึ้นกับขนาดฟอนต์และความกว้างกรอบ","propertyTips.fl-max-span":'ขีดจำกัดบนของการขยายคอลัมน์ ห้ามเกิน "จำนวนคอลัมน์ต่อแถว" การลดจำนวนคอลัมน์จะดันค่านี้ลงด้วย',"propertyTips.fl-layout-mode":"อะไรเป็นตัวกำหนดความสูงของคอนเทนเนอร์ ความสูงคงที่: คงความสูงที่ออกแบบ หนึ่งกรอบต่อหน้า ตัดส่วนเกิน (ค่าเริ่มต้นของเทมเพลตเดิม ผลไม่เปลี่ยน) การแบ่งหน้าแบบไดนามิก: คอนเทนเนอร์ ขยายตามเนื้อหา ดำเนินต่อเป็นแถวหลังหน้าเต็ม วาดเส้นขอบครบทุกหน้า และปฏิบัติตามกฎเดียวกับตารางสำหรับโซนตามหลังองค์ประกอบ","propertyTips.fl-padding-top":"ช่องว่างระหว่างด้านบนของคอนเทนเนอร์กับแถวเนื้อหาแรกในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร ใช้เฉพาะโหมดไดนามิก ทุกชิ้นของหน้าใช้ระยะนี้และนับรวมในงบการแบ่งหน้า ค่าติดลบหรือไม่ถูกต้องถือเป็น 0","propertyTips.fl-padding-right":"ช่องว่างระหว่างด้านขวาของคอนเทนเนอร์กับเนื้อหาในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร จะลดความกว้างเนื้อหาที่ใช้คำนวณความกว้างคอลัมน์ ใช้เฉพาะโหมดไดนามิก","propertyTips.fl-padding-bottom":"ช่องว่างระหว่างด้านล่างของคอนเทนเนอร์กับแถวเนื้อหาสุดท้ายในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร ใช้เฉพาะโหมดไดนามิก ทุกชิ้นของหน้าใช้ระยะนี้และนับรวมในงบการแบ่งหน้า","propertyTips.fl-padding-left":"ช่องว่างระหว่างด้านซ้ายของคอนเทนเนอร์กับเนื้อหาในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร จะลดความกว้างเนื้อหาที่ใช้คำนวณความกว้างคอลัมน์ ใช้เฉพาะโหมดไดนามิก","propertyTips.cd-bar-quiet-zone":"จำนวนโมดูลว่างสองข้างของบาร์โค้ด (1 โมดูล = 1 ความกว้างแท่น): ค่าเริ่มต้น 10 คือค่าต่ำสุดที่รหัสแบบหนึ่งมิติต้องการ ค่าที่เล็กลงทำให้โซนเงียบแคบและแท่นหนาขึ้นในกรอบเดียวกัน (สามารถขยายได้) การตั้ง 0 ลบขอบขาว แต่โซนเงียบมีส่วนในการเปลี่ยนแท่น-ช่อง-แท่น รหัสที่อยู่ติดข้อความหรือเส้นตารางอาจสแกนไม่ได้ — ตรวจด้วยการพิมพ์จริง","propertyTips.cd-bar-height":'ความสูงเป้าหมายของแท่นดำเอง เป็นมิลลิเมตร (ไม่รวมข้อความด้านล่าง) ความละเอียดคือความกว้างทางกายภาพของหนึ่งโมดูล จึงแม่นยำเฉพาะจำนวนเต็มเท่านั้น ความกว้างแท่นมีสิทธิ์ก่อน: หากความสูงที่มีไม่พอตามที่ต้องการ ความสูงจะยอมตาม — ไม่เคยทำให้แท่นแคบลง (ความชัดของการพิมพ์ความร้อนขึ้นกับความกว้างแท่น) ต่างจาก "ความสูงสูงสุด" ที่จำกัดทั้งภาพรวมข้อความ',"propertyTips.cd-quiet-zone":"จำนวนโมดูลว่างรอบคิวอาร์โค้ด: 0 หมายถึงไม่มีขอบขาวและรหัสขยายเติมกรอบ (กระดาษขาวรอบนอกทำหน้าที่โซนเงียบ) ค่าที่ใหญ่ขึ้นทำให้ขอบกว้างและรหัสเล็กลงในกรอบ ค่าเริ่มต้น 0 ใช้ 4 สำหรับโซนเงียบตามที่ ISO/IEC 18004 แนะนำ"}};function Yp(e){if(typeof e!="string")return"zh-CN";const t=e.trim();return t?/^en([-_]|$)/i.test(t)?"en-US":/^th([-_]|$)/i.test(t)?"th-TH":t:"zh-CN"}function Xp(){try{if(typeof navigator<"u"&&typeof navigator.language=="string")return Yp(navigator.language)}catch{}return"zh-CN"}function fb(){const e=Da();return e.init({resources:{"zh-CN":{core:nb,constants:sb.constants,propertyTips:db.propertyTips},"en-US":{core:ib,constants:lb.constants,propertyTips:cb.propertyTips},"th-TH":{core:ab,constants:pb.constants,propertyTips:ub.propertyTips}},lng:Xp(),fallbackLng:"zh-CN",ns:["core"],defaultNS:"core",keySeparator:!1,nsSeparator:!1,interpolation:{prefix:"{",suffix:"}",escapeValue:!1},returnNull:!1,returnEmptyString:!1,saveMissing:!0,missingKeyHandler:()=>{}}),e}const Aa=fb(),hb=new Set,mb=new Set;Aa.on("missingKey",(e,t,r)=>{Aa.exists(r,{lng:"zh-CN"})||hb.add(r)});function Zp(){return Xp()}function er(){return Zp()}function gb(e,t){return typeof e=="string"?e:e==null?t:String(e)}function bb(e,t,r){const o=Aa.getFixedT(Yp(e),kb()),n=r?o(t,r):o(t);return gb(n,t)}function $(e,t){return bb(Zp(),e,t)}function kb(){return["user",...mb,"constants","propertyTips","core"]}function tr(e,t,r){return new Intl.NumberFormat(t,r).format(e)}function yb(){let e=0;return function(){return e+=1,`cell-${Date.now().toString(36)}-${e}`}}function vb(){let e=0;return function(){return e+=1,`row-${Date.now().toString(36)}-${e}`}}const wb=yb(),xb=vb(),rr={width:.75,style:"solid",color:"#333333"};function Oa(e){return JSON.parse(JSON.stringify(e))}function Ra(e){return{id:wb(),borders:{top:{...rr},right:{...rr},bottom:{...rr},left:{...rr}},...e}}function Pb(){const e=[50,50,50],t=(o,n)=>({id:xb(),type:o,height:8,...n!==void 0?{repeatOnPage:n}:{},cells:e.map(()=>Ra())}),r=t("header",!0);return r.cells.forEach((o,n)=>{o.formatter=$("table.defaultHeader",{index:n+1}),o.align="center",o.fontWeight="bold"}),{rows:[r,t("data"),t("subtotal"),t("summary")],colWidths:e}}function Po(e,t,r){if(!e[t].cells[r].merged)return{r:t,c:r};for(let o=t;o>=0;o--)for(let n=r;n>=0;n--){const i=e[o].cells[n];if(i.merged)continue;const a=i.rowspan??1,s=i.colspan??1;if(o+a-1>=t&&n+s-1>=r)return{r:o,c:n}}return{r:t,c:r}}function kr(e,t,r){const o=Po(e,t,r),n=e[o.r].cells[o.c];return{r1:o.r,c1:o.c,r2:o.r+(n.rowspan??1)-1,c2:o.c+(n.colspan??1)-1}}function Jp(e,t,r){let o={r1:Math.min(t.r,r.r),c1:Math.min(t.c,r.c),r2:Math.max(t.r,r.r),c2:Math.max(t.c,r.c)};for(;;){let n=!1;for(let i=o.r1;i<=o.r2;i++)for(let a=o.c1;a<=o.c2;a++){const s=kr(e,i,a),p={r1:Math.min(o.r1,s.r1),c1:Math.min(o.c1,s.c1),r2:Math.max(o.r2,s.r2),c2:Math.max(o.c2,s.c2)};(p.r1!==o.r1||p.c1!==o.c1||p.r2!==o.r2||p.c2!==o.c2)&&(o=p,n=!0)}if(!n)return o}}function Qp(e,t){if((t.r2-t.r1+1)*(t.c2-t.c1+1)<2)return $("table.atLeastTwoCells");const o=new Set;for(let i=t.r1;i<=t.r2;i++)o.add(e[i].type);if(o.size>1)return $("table.crossRowTypes");if(t.r2>t.r1&&o.has("data"))return $("table.dataVerticalMerge");const n=Jp(e,{r:t.r1,c:t.c1},{r:t.r2,c:t.c2});return n.r1!==t.r1||n.c1!==t.c1||n.r2!==t.r2||n.c2!==t.c2?$("table.partialOverlap"):null}function ed(e,t){const r=e[t.r1].cells[t.c1],o=[];for(let n=t.r1;n<=t.r2;n++)for(let i=t.c1;i<=t.c2;i++){const a=e[n].cells[i];a.formatter&&o.push(a.formatter),!(n===t.r1&&i===t.c1)&&(a.merged=!0,a.rowspan=1,a.colspan=1,a.formatter="")}r.rowspan=t.r2-t.r1+1,r.colspan=t.c2-t.c1+1,r.formatter=o.join(" ")}function td(e,t){for(let r=t.r1;r<=t.r2;r++)for(let o=t.c1;o<=t.c2;o++){const n=e[r].cells[o];if(!n.merged&&((n.rowspan??1)>1||(n.colspan??1)>1)){const i=kr(e,r,o),a=n;for(let s=i.r1;s<=i.r2;s++)for(let p=i.c1;p<=i.c2;p++){const l=e[s].cells[p];l.merged=!1,l.rowspan=1,l.colspan=1,Eb(a,l)}n.rowspan=1,n.colspan=1}}}function Eb(e,t){e!==t&&(t.align=e.align,t.valign=e.valign,t.fontSize=e.fontSize,t.fontFamily=e.fontFamily,t.fontWeight=e.fontWeight,t.color=e.color,t.backgroundColor=e.backgroundColor,t.borders=e.borders?Oa(e.borders):void 0,t.padding=e.padding,t.wordWrap=e.wordWrap)}function rd(e,t,r){const o=r==="above"?t:t+1,n=e[t],i=n.cells.length,a=n.type==="data"?"header":n.type,s={id:`row-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,type:a,height:n.height,...a==="header"?{repeatOnPage:[e[o-1],e[o]].find(p=>p?.type==="header")?.repeatOnPage===!0}:{},cells:Array.from({length:i},()=>Ra())};for(let p=0;p<i;p++)if(o>0&&o<e.length){const l=kr(e,o-1,p);if(l.r1<o&&l.r2>=o){const d=e[l.r1].cells[l.c1];d.rowspan=(d.rowspan??1)+1,s.cells[p].merged=!0}}e.splice(o,0,s)}function Sb(e,t){if(e.length<=1)return $("table.lastRow");const r=e[t],o=r.cells.length;for(let n=0;n<o;n++){const i=r.cells[n];if(!i.merged&&(i.rowspan??1)>1){const a=e[t+1].cells[n];Object.assign(a,Oa(i),{id:a.id}),a.rowspan=(i.rowspan??1)-1,a.merged=!1}else if(i.merged){const a=kr(e,t,n);if(a.r1<t&&a.c1===n){const s=e[a.r1].cells[a.c1];s.rowspan=(s.rowspan??1)-1}}}return e.splice(t,1),null}function od(e,t,r,o){const n=o==="left"?r:r+1;t.splice(n,0,t[r]);for(const i of e){const a=Ra();if(n>0&&n<i.cells.length){const s=e.indexOf(i),p=kr(e,s,n-1);if(p.c1<n&&p.c2>=n){const l=e[p.r1].cells[p.c1];s===p.r1&&(l.colspan=(l.colspan??1)+1),a.merged=!0}}i.cells.splice(n,0,a)}}function Tb(e,t,r){if(t.length<=1)return $("table.lastColumn");for(let o=0;o<e.length;o++){const n=e[o].cells[r];if(!n.merged&&(n.colspan??1)>1){const i=e[o].cells[r+1];Object.assign(i,Oa(n),{id:i.id}),i.colspan=(n.colspan??1)-1,i.merged=!1}else if(n.merged){const i=kr(e,o,r);if(i.c1<r&&i.r1===o){const a=e[i.r1].cells[i.c1];a.colspan=(a.colspan??1)-1}}}for(const o of e)o.cells.splice(r,1);return t.splice(r,1),null}function Ia(e,t,r){if(r==="data"){const o=e.findIndex((n,i)=>n.type==="data"&&i!==t);if(o>=0)return $("table.dataRowExists",{row:o+1})}if(r==="header"){for(let o=0;o<t;o++)if(e[o].type!=="header")return $("table.headerContinuous")}if(r==="subtotal"||r==="summary"){const o=e.findIndex(n=>n.type==="data");if(o<0)return $("table.subtotalAfterData");if(t<o)return $("table.subtotalBeforeData")}if(r==="subtotal"&&e.slice(0,t).some(o=>o.type==="summary"))return $("table.subtotalBeforeSummary");if(r==="summary"&&e.slice(t+1).some(o=>o.type==="subtotal"))return $("table.summaryAfterSubtotal");if(e[t].type==="header"&&r!=="header"){for(let o=t+1;o<e.length;o++)if(e[o].type==="header")return $("table.headerBreak")}if(e[t].type=r,r==="header"){const o=[e[t-1],e[t+1]].find(n=>n?.type==="header");e[t].repeatOnPage=e[t].repeatOnPage!==void 0?e[t].repeatOnPage===!0:o?.repeatOnPage===!0}else delete e[t].repeatOnPage;return null}function Mb(e,t){for(const r of e){if(r.type!=="header")break;r.repeatOnPage=t}}function nd(e,t,r,o){for(let n=t.r1;n<=t.r2;n++)for(let i=t.c1;i<=t.c2;i++){const a=e[n].cells[i];if(a.merged)continue;if(r==="none"){delete a.borders;continue}const s=kr(e,n,i),p=s.r1===t.r1,l=s.r2===t.r2,d=s.c1===t.c1,u=s.c2===t.c2,c={...a.borders??{}};r==="all"?(c.top={...o},c.bottom={...o},c.left={...o},c.right={...o}):r==="outer"?(p&&(c.top={...o}),l&&(c.bottom={...o}),d&&(c.left={...o}),u&&(c.right={...o})):r==="inner"&&(p||(c.top={...o}),l||(c.bottom={...o}),d||(c.left={...o}),u||(c.right={...o})),a.borders=c}}const Cb="constants.hint.border.pending",_b="constants.hint.border.multi",Db="constants.hint.border.mixed";function id(e,t,r){const o={...e.borders??{}};r?o[t]={...r}:delete o[t],e.borders=o.top||o.right||o.bottom||o.left?o:void 0}function On(e,t){const r=[];for(let o=t.r1;o<=t.r2;o++)for(let n=t.c1;n<=t.c2;n++){const i=e[o]?.cells[n];i&&!i.merged&&r.push(i)}return r}function La(e,t){const r=On(e,t).length;return{mode:r>1?"multi":"single",count:r}}function Ab(e,t){const r=On(e,t);if(!r.length)return null;const o=r[0].cellType??"text";return r.every(n=>(n.cellType??"text")===o)?o:null}function ad(e,t){const r=[];for(const n of On(e,t))for(const i of["top","right","bottom","left"]){const a=n.borders?.[i];a&&r.push(a)}const o=n=>{if(!r.length)return;const i=n(r[0]);return r.every(a=>n(a)===i)?i:"mixed"};return{width:o(n=>n.width),style:o(n=>n.style),color:o(n=>n.color)}}const Ob="1px dashed rgba(0,0,0,0.18)";function Rn(e,t={}){return e&&e.style!=="none"?`${e.width}pt ${e.style} ${e.color}`:t.designMode&&t.showGhostBorder!==!1?Ob:"none"}function Eo(e){const t=(e.tableColWidths??[]).reduce((o,n)=>o+n,0),r=(e.tableRows??[]).reduce((o,n)=>o+n.height,0);e.width=Math.round(t*100)/100,e.height=Math.round(r*100)/100}const sd=5;function Rb(e,t,r,o){const n=e.reduce((s,p,l)=>l===t?s:s+p,0),i=o===1/0?1/0:Math.max(sd,o-n),a=Math.round(r*10)/10;return Math.min(Math.max(a,sd),i)}const ld=Symbol.for("worm-print-platform.element-capabilities.v1"),pd=globalThis;function yr(){const e=pd[ld];if(e)return e;const t={entries:new Map,nextSeq:0,bootstrapped:!1};return pd[ld]=t,dd(t),t}const Ib={left:7,top:17.6,width:42.3,height:7.1},Lb=Object.freeze({text:"示例文本",longText:"示例长文本内容",barcode:"12345678",qrcode:"qrcode"});function Nb(e){if(e)return Lb[e]}const So=Object.freeze({text:{zoneAllowed:!0,defaultTextFit:"clip",bindings:[{targetPath:"options.formatter",label:"内容",labelKey:"constants.label.content",dataSource:"main"}],defaultOptions:()=>({formatter:"文本",exampleValue:"示例文本",fontSize:12,textAlign:"left",height:5.3}),title:"文本"},longText:{defaultTextFit:"autoHeight",bindings:[{targetPath:"options.formatter",label:"内容",labelKey:"constants.label.content",dataSource:"main"},{targetPath:"options.styler",label:"样式",dataSource:"main"}],defaultOptions:()=>({width:141.1,height:28.2,fontSize:12,lineHeight:18,exampleValue:"示例长文本内容"}),title:"长文"},barcode:{zoneAllowed:!0,codeRotationDpiGated:!0,bindings:[{targetPath:"options.formatter",label:"内容",labelKey:"constants.label.content",dataSource:"main"}],defaultOptions:()=>({width:56.4,height:14.1,title:"条形码",barcodeType:"code128",testData:"12345678",exampleValue:"12345678"}),title:"条形码"},qrcode:{zoneAllowed:!0,codeRotationDpiGated:!0,bindings:[{targetPath:"options.formatter",label:"内容",labelKey:"constants.label.content",dataSource:"main"}],defaultOptions:()=>({width:28.2,height:28.2,title:"二维码",testData:"qrcode",exampleValue:"qrcode"}),title:"二维码"},image:{zoneAllowed:!0,bindings:[{targetPath:"options.src",label:"内容",labelKey:"constants.label.content",dataSource:"main",placeholder:"输入图片路径,支持 /docfiles/... 相对路径、绝对 URL 或 {字段} 表达式"}],defaultOptions:()=>({width:28.2,height:28.2,fit:"contain"}),title:"图片"},table:{rotationExcluded:!0,acceptsElementBorder:!1,bindings:[],defaultOptions:()=>{const{rows:e,colWidths:t}=Pb(),r=t.reduce((n,i)=>n+i,0),o=e.reduce((n,i)=>n+i.height,0);return{width:r,height:o,tableMode:"dynamic",tableRows:e,tableColWidths:t,tableDefaultFontSize:10,tableDefaultColor:"#333333",tableDefaultPadding:1,fields:[],tablePagination:{enabled:!0}}},title:"表格"},flowList:{rotationExcluded:!0,defaultTextFit:"clip",bindings:[{targetPath:"options.formatter",label:"单元模板",dataSource:"main",placeholder:"{drugs.name} {drugs.spec}"}],defaultOptions:()=>({width:141.1,height:21.2,fontSize:12,formatter:"{name} {spec}",flowColumns:4,flowRowHeight:8,flowGapX:4,flowAutoSpan:!1,flowMaxSpan:2,flowLayoutMode:"fixed",flowPaddingTop:0,flowPaddingRight:0,flowPaddingBottom:0,flowPaddingLeft:0}),title:"流式列表"},hline:{zoneAllowed:!0,acceptsElementBorder:!1,defaultOptions:()=>({width:70.6,height:1.8,borderWidth:.75}),title:"横线"},vline:{zoneAllowed:!0,acceptsElementBorder:!1,defaultOptions:()=>({width:1.8,height:35.3,borderWidth:.75}),title:"竖线"},rect:{zoneAllowed:!0,acceptsElementBorder:!1,defaultOptions:()=>({width:28.2,height:28.2,borderWidth:1,borderColor:"#333"}),title:"矩形"},oval:{zoneAllowed:!0,acceptsElementBorder:!1,defaultOptions:()=>({width:28.2,height:28.2,borderWidth:1,borderColor:"#333"}),title:"椭圆"},html:{blocked:!0,defaultOptions:()=>({width:28.2,height:28.2}),title:"HTML"},pageNumber:{title:"页码"}});function dd(e){if(!e.bootstrapped){e.bootstrapped=!0;for(const[t,r]of Object.entries(So))e.entries.has(t)||e.entries.set(t,{caps:r,seq:e.nextSeq++})}}function Bb(e,t){if(!e||typeof e!="string")throw new Error("registerElementCapabilities: type 必须是非空字符串");if(!t||typeof t!="object")throw new Error("registerElementCapabilities: caps 必须是对象");const r=yr(),o=r.nextSeq++;return r.entries.set(e,{caps:t,seq:o}),()=>{if(yr().entries.get(e)?.caps!==t)return;const i=So[e];i?yr().entries.set(e,{caps:i,seq:o}):yr().entries.delete(e)}}function gt(e){return e?{...yr().entries.get(e)?.caps??{},type:e}:{type:""}}function Na(){return[...yr().entries.entries()].sort((e,t)=>e[1].seq-t[1].seq).map(([e])=>e)}function Fb(){const e=yr();e.entries.clear(),e.nextSeq=0,e.bootstrapped=!1,dd(e)}function $b(){return{...Ib}}const cd=Symbol.for("worm-print-platform.element-plugin-registry.v1"),ud=globalThis;function Ba(){const e=ud[cd];if(e)return e;const t={plugins:new Map,typeIndex:new Map,configs:new Map,legacyAliases:new Map};return ud[cd]=t,t}function zb(e,t){const r=e.render||t.render?{...e.render,...t.render}:void 0,o=e.designer||t.designer?{...e.designer,...t.designer}:void 0;return{...e,kind:t,binding:t.binding??e.binding,render:r,designer:o}}function Vr(e){const t=Ba().typeIndex.get(e);return t?zb(t.plugin,t.kind):void 0}function fd(){return[...Ba().typeIndex.values()]}function Hb(){return Object.fromEntries(Ba().legacyAliases)}function To(e){return e/2.83464566929}function In(e){return e*(25.4/96)}function vr(e){return e*(96/25.4)}const hd=6,Ub=1,qb=["clip","shrink","autoHeight"];function md(e){return typeof e=="string"&&qb.includes(e)?e:void 0}const jb={text:"clip",longText:"autoHeight",flowList:"clip"};function Ln(e,t){const r=gt(e).defaultTextFit;return md(t?.textFit)??r??jb[e]??"clip"}function gd(e){if(e?.keepLineBreaks===!0&&e.wordWrap!==!1)return"pre-wrap"}function bd(e){return e?.wordWrap===!1?"nowrap":void 0}function Fa(e){return md(e?.textFit)??(e?.wordWrap===!1?"clip":"autoHeight")}function Mo(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?hd:Math.max(e,Ub)}function $a(e){return Math.round(e*100)/100}function Wb(e){return Math.floor(e*100)/100}function Vb(e,t,r,o){return`${e}#${t}#${r}:${o}`}function Gb(e){const t=e.indexOf("#");if(t<0)return;const r=e.lastIndexOf("#"),o=e.slice(t+1,r);if(o!=="b"&&o!=="st"&&o!=="sm")return;const[n,i]=e.slice(r+1).split(":").map(Number);if(!(!Number.isFinite(n)||!Number.isFinite(i)))return{elementId:e.slice(0,t),kind:o,rowIndex:n,colIndex:i}}function kd(e,t){return(e||"contain")==="cover"?t:void 0}function za(e,t,r,o=1){const n=Math.max(r?.colspan??1,1);let i=0;for(let p=0;p<n;p++)i+=e[t+p]??0;if(i<=0)return 0;const a=r?.padding??o,s=(To(r?.borders?.left?.width??0)+To(r?.borders?.right?.width??0))/2;return Math.max(i-a*2-s,.5)}function Co(e,t,r,o=1){const n=Math.max(r?.rowspan??1,1);let i=0;for(let p=0;p<n;p++)i+=e[t+p]?.height??8;const a=r?.padding??o,s=(To(r?.borders?.top?.width??0)+To(r?.borders?.bottom?.width??0))/2;return Math.max(i-a*2-s,.5)}const Ha=1,yd=12,Kb=3,Yb=100,Xb=0,Zb=50;function wr(e){return e==="dynamic"?"dynamic":"fixed"}function Gr(e){const t=r=>{const o=e[r];return typeof o=="number"&&Number.isFinite(o)&&o>0?o:0};return{top:t("flowPaddingTop"),right:t("flowPaddingRight"),bottom:t("flowPaddingBottom"),left:t("flowPaddingLeft")}}function vd(e,t){return Math.max(0,e-t.left-t.right)}const wd=25.4/72;function Jb(e,t,r,o){return typeof e!="number"||!Number.isFinite(e)?o:Math.min(r,Math.max(t,Math.round(e)))}function bt(e){return Jb(e,Ha,yd,4)}function Et(e){return typeof e!="number"||!Number.isFinite(e)?4:Math.min(Zb,Math.max(Xb,e))}function or(e){return typeof e!="number"||!Number.isFinite(e)?8:Math.min(Yb,Math.max(Kb,e))}function xr(e,t){const r=bt(t),o=Math.min(2,r);return typeof e!="number"||!Number.isFinite(e)?o:Math.min(r,Math.max(1,Math.round(e)))}function Qb(e,t,r){const o=bt(t),n=Et(r),i=e-n*(o-1);return i<=0?0:i/o}function e0(e,t,r){const o=Math.max(1,Math.floor(r));return e*o+t*(o-1)}function xd(e,t){if(!e)return 0;const r=typeof t=="number"&&Number.isFinite(t)&&t>0?t*wd:12*wd;let o=0;for(const n of e){if(n===" "){o+=.28;continue}const i=n.codePointAt(0)??0;i>=12288&&i<=12351||i>=13312&&i<=19903||i>=19968&&i<=40959||i>=63744&&i<=64255||i>=65280&&i<=65376||i>=65504&&i<=65510||i>=131072?o+=1:/^[0-9A-Z]$/.test(n)?o+=.6:/^[a-z]$/.test(n)?o+=.5:/^[\u0020-\u007f]$/.test(n)?o+=.4:o+=.75}return o*r}function t0(e,t){if(!t.autoSpan)return 1;const r=xr(t.maxSpan,t.columns);if(r<=1||t.colUnitMm<=0)return 1;const o=xd(e,t.fontSizePt);for(let n=1;n<=r;n++)if(o<=e0(t.colUnitMm,t.gapX,n))return n;return r}function Ua(e,t){const r=bt(t.columns),o=Et(t.gapX),n=Qb(t.width,r,o),i=xr(t.maxSpan,r),a=[];let s=[],p=0;for(const l of e){const d=String(l??""),u=t0(d,{...t,columns:r,gapX:o,maxSpan:i,colUnitMm:n});s.length>0&&p+u>r&&(a.push({cells:s}),s=[],p=0),s.push({text:d,span:u}),p+=u}return s.length>0&&a.push({cells:s}),a}function Nn(e,t){if(typeof e!="string"||!e.includes("{")||!t)return;const r=new Set;for(const o of e.matchAll(/\{([^{}]*)\}/g))for(const n of(o[1]??"").split(/[^A-Za-z0-9_\u4e00-\u9fa5.]/)){const i=n.split(".")[0];i&&!/^\d/.test(i)&&r.add(i)}for(const o of r)if(Array.isArray(t[o]))return o}function r0(e,t,r){const o=Et(t),n=xd("一",r);if(n<=0||e<=0)return Ha;const i=Math.floor((e+o)/(n+o));return Math.min(yd,Math.max(Ha,i))}const Pd=e=>`${Math.round(e*1e3)/1e3}mm`;function o0(e){const t=bt(e.columns),r=Et(e.gapX),o=or(e.rowHeight);return["display:grid",`grid-template-columns:repeat(${t},minmax(0,1fr))`,`column-gap:${Pd(r)}`,`grid-auto-rows:minmax(${Pd(o)},auto)`].join(";")}const _o=25.4,Ed=10;function qa(e){return typeof e=="number"&&Number.isFinite(e)?Math.max(0,Math.floor(e)):Ed}const nr=30,Bn=10,ja=2,Sd=0,n0=.25,Wa=.254;function i0(e){if(typeof e!="number"||!Number.isFinite(e)||e<=0)return null;const t=e/_o;for(let r=2;r<=8;r+=.5){const o=Math.max(1,Math.round(Fn(r)*t)),n=o/t;if(n>=Wa-1e-9)return{barWidth:r,dotsPerModule:o,moduleWidthMm:n}}return null}function Td(e,t,r=$){const o=i0(e);if(!o)return"";const n=l=>String(Number(l.toFixed(3))),i=Fn(t??2),a=Math.max(1,Math.round(i*e/_o)),s=a/(e/_o),p=s>=Wa-1e-9;return r(p?"barcode.recommendOk":"barcode.recommendLow",{dpi:e,rec:o.barWidth,recDots:o.dotsPerModule,width:n(o.moduleWidthMm),min:n(Wa),current:t??2,curDots:a,curWidth:n(s)})}function Do(e){const t=typeof e=="number"&&Number.isFinite(e)?e:2;return Math.max(1,t/2)}function Fn(e){return Do(e)*n0}function a0(e){const{barHeightMm:t,moduleWidthMm:r,boxHeightMm:o,textModules:n}=e,i=typeof t=="number"&&Number.isFinite(t)&&t>0,a=typeof r=="number"&&Number.isFinite(r)&&r>0;if(!i||!a)return nr;const s=Math.max(1,Math.round(t/r));if(!(typeof o=="number"&&Number.isFinite(o)&&o>0))return s;const l=typeof n=="number"&&Number.isFinite(n)&&n>0?n:0,d=Math.floor((o-l*r)/r);return Math.max(1,Math.min(s,d))}function Md(e,t,r){const o=Math.max(1,Math.round(e*r)),n=Math.floor(t*r);if(n<1)return null;const i=Math.min(o,n);return{dotsPerModule:i,preferredDots:o,moduleWidthMm:i/r}}function s0(e){const t=Fn(e.barWidth),r=Math.max(1,Math.ceil(e.unitWidth)),o=e.boxWidthMm>0?e.boxWidthMm/r:Number.POSITIVE_INFINITY,n=e.dpi;if(typeof n=="number"&&Number.isFinite(n)&&n>0){const i=Md(t,o,n/_o);if(i)return i.moduleWidthMm}return Math.min(t,o)}function Kr(e,t){const r=typeof e=="number"&&e>0?e:Number.POSITIVE_INFINITY,o=typeof t=="number"&&t>0?Math.min(r,t):r;return Number.isFinite(o)?o:0}function l0(e){const t=Math.max(1,Math.ceil(e.unitWidth)),r=Math.max(1,Math.ceil(e.unitHeight)),o=Fn(e.barWidth),n=Math.min(e.boxWidthMm>0?e.boxWidthMm/t:Number.POSITIVE_INFINITY,e.boxHeightMm>0?e.boxHeightMm/r:Number.POSITIVE_INFINITY),i=e.dpi;if(typeof i=="number"&&Number.isFinite(i)&&i>0){const s=Md(o,n,i/_o);if(s)return{moduleWidthMm:s.moduleWidthMm,widthMm:t*s.moduleWidthMm,heightMm:r*s.moduleWidthMm,dotsPerModule:s.dotsPerModule,scaledDown:s.dotsPerModule<s.preferredDots}}const a=Math.min(o,n);return{moduleWidthMm:a,widthMm:t*a,heightMm:r*a,dotsPerModule:null,scaledDown:a<o}}function Va(e){const t=Do(e.barWidth),r=p=>l0({unitWidth:p.widthUnits/t,unitHeight:p.heightUnits/t,boxWidthMm:e.boxWidthMm,boxHeightMm:e.boxHeightMm,dpi:e.dpi,barWidth:e.barWidth}),o=e.measure(nr);if(!o)return{barHeightModules:nr,size:null};if(!(typeof e.barHeightMm=="number"&&Number.isFinite(e.barHeightMm)&&e.barHeightMm>0))return{barHeightModules:nr,size:r(o)};const i=Math.max(0,o.heightUnits/t-nr),a=a0({barHeightMm:e.barHeightMm,moduleWidthMm:s0({unitWidth:o.widthUnits/t,boxWidthMm:e.boxWidthMm,dpi:e.dpi,barWidth:e.barWidth}),boxHeightMm:e.boxHeightMm,textModules:i});if(a===nr)return{barHeightModules:a,size:r(o)};const s=e.measure(a);return s?{barHeightModules:a,size:r(s)}:{barHeightModules:nr,size:null}}const Ao=["top","right","bottom","left"],p0=new Set(["rect","oval","hline","vline","table"]);function $n(e){if(!e)return!1;const t=gt(e).acceptsElementBorder;return t===void 0?!p0.has(e):t}const d0=new Set(["solid","dashed","dotted","double"]);function Cd(e,t,r){return typeof e!="number"||!Number.isFinite(e)||e<=0||t==="none"?null:{borderWidth:`${e}pt`,borderStyle:typeof t=="string"&&d0.has(t)?t:"solid",borderColor:r||"#000"}}function zn(e,t){if(!$n(e))return null;const r=Cd(t?.borderWidth,t?.borderStyle,t?.borderColor),o={},n=t?.borders;if(n)for(const i of Ao){const a=n[i];if(!a)continue;const s=Cd(a.width,a.style,a.color);s&&(o[i]=s)}return!r&&Object.keys(o).length===0?null:{all:r,edges:o}}const c0=/[;"'<>\\(){}\[\]@!#]/,u0=64,Oo=100,_d=400;function f0(e){const t=(e??"").trim();return!t||t.length>u0||c0.test(t)?"":t}function Dd(e,t){if((e||"contain")!=="cover"||typeof t!="number"||!Number.isFinite(t))return;const r=Math.round(t);if(!(r<=Oo))return Math.min(r,_d)}function Ga(e,t,r){const o=f0(r),n={};o&&(n.objectPosition=o);const i=Dd(e,t);return i!==void 0&&(n.transform=`scale(${Number((i/100).toFixed(2))})`,n.transformOrigin=o||"50% 50%"),n}function Ro(e){return typeof e!="number"||!Number.isFinite(e)?0:(e%360+360)%360}function Ad(e,t,r){const o=e.width,n=t,i=Ro(r);let a,s;if(i===0||i===180)a=o,s=n;else if(i===90||i===270)a=n,s=o;else{const p=i*Math.PI/180;a=o*Math.abs(Math.cos(p))+n*Math.abs(Math.sin(p)),s=o*Math.abs(Math.sin(p))+n*Math.abs(Math.cos(p))}return{left:e.left-(a-o)/2,top:e.top-(s-n)/2,width:a,height:s}}const Od=385,h0=new Set(["table","flowList"]);function Rd(e){const t=gt(e).rotationExcluded;return t===void 0?h0.has(e):t}function Id(e){const t=gt(e).codeRotationDpiGated;return t===void 0?e==="barcode"||e==="qrcode":t}function m0(e=$){return e("code.rotateNote")}function g0(e,t){if(!Id(e))return!0;const r=t?.printerDpi;return typeof r=="number"&&r>0&&r>=Od}function Ka(e,t,r){const o=t?.rotate;if(typeof o!="number"||!Number.isFinite(o))return;const n=Ro(o);if(n!==0&&!Rd(e)){if(Id(e)){if(n===90||n===180||n===270)return n;const i=t?.printerDpi;if(typeof i=="number"&&i>0&&i<Od){const a=Ro(Math.round(n/90)*90);return a===0?void 0:a}}return n}}const Hn=e=>typeof e=="number"&&Number.isFinite(e)?e:0;function kt(e){const t=e??{};return{top:Hn(t.marginTop),right:Hn(t.marginRight),bottom:Hn(t.marginBottom),left:Hn(t.marginLeft)}}function Un(e){const t=kt(e);return["top","right","bottom","left"].filter(r=>t[r]!==0).map(r=>`margin-${r}:${t[r]}mm`).join(";")}function Xe(e={},t=e.height??0){const r=kt(e),o=e.left??0,n=e.top??0,i=e.width??100,a=t,s={left:o+r.left,top:n+r.top,right:o+r.left+i,bottom:n+r.top+a,width:i,height:a},p={left:o,top:n,right:o+r.left+i+r.right,bottom:n+r.top+a+r.bottom,width:Math.max(0,r.left+i+r.right),height:Math.max(0,r.top+a+r.bottom)};return{border:s,margin:p}}const Pr={A4:{width:210,height:297},A3:{width:297,height:420},A5:{width:148,height:210},Letter:{width:216,height:279},Legal:{width:216,height:356},DOT_FULL:{width:241,height:279.4},DOT_HALF:{width:241,height:139.7},DOT_THIRD:{width:241,height:93.1},LABEL_80X60:{width:80,height:60},LABEL_60X40:{width:60,height:40},LABEL_40X30:{width:40,height:30},THERMAL_57:{width:57,height:297},THERMAL_80:{width:80,height:297},THERMAL_110:{width:110,height:297},CUSTOM:{width:210,height:297},CONTINUOUS:{width:80,height:297}},b0=new Set(["CONTINUOUS","THERMAL_57","THERMAL_80","THERMAL_110"]);function Yr(e){return b0.has(e)}function yt(e){const t=Yr(e.paperSize),r=e.paperSize==="CUSTOM"||t?{width:e.customWidth??Pr[e.paperSize].width,height:e.customHeight??Pr[e.paperSize].height}:Pr[e.paperSize];return e.orientation==="landscape"&&!t?{width:r.height,height:r.width}:{...r}}function Er(e){if(Yr(e.paperSize))return yt(e);const r=yt(e);return e.outputRotation===90||e.outputRotation===270?{width:r.height,height:r.width}:r}function Ya(e){return Yr(e.paperSize)?0:e.outputRotation??0}function It(e){return Yr(e.paperSize)}function qn(e){return e.options?.pagination??e.pagination}function k0(e){return e.options?.tablePagination??e.tablePagination}const y0=2;function jn(e){return e.type==="table"||e.printElementType?.type==="table"}function Io(e){return(e.type||e.printElementType?.type||"text")==="flowList"&&wr(e.options?.flowLayoutMode)==="dynamic"}function Xa(e){return jn(e)||Io(e)}function Wn(e){return e.options?.fixed!==!0&&e.options?.repeatOnEveryPage===!0}function Za(e){return e.options?.fixed===!0}function Ld(e){return e.type||e.printElementType?.type||"text"}function Nd(e){return Ka(Ld(e),e.options)}function Sr(e,t){const r=t.get(e.id)?.measuredHeight??e.options?.height??0,o=kt(e.options),{border:n}=Xe({left:e.options?.left??0,top:e.options?.top??0,width:e.options?.width??100,height:r,...e.options},r),i=Nd(e),a=i===void 0?n:Ad(n,r,i);return{height:a.height,shift:n.top-a.top,top:a.top,rot:i,outerTop:a.top-o.top,outerBottom:a.top+a.height+o.bottom,outerHeight:Math.max(0,o.top+a.height+o.bottom)}}function v0(e,t){const r=e.options?.tableColWidths??[],o=jn(e)&&r.length>0?r.reduce((p,l)=>p+l,0):e.options?.width??0,n=t.get(e.id)?.measuredHeight??e.options?.height??0,{border:i}=Xe({...e.options,left:e.options?.left??0,top:e.options?.top??0,width:o,height:n},n),a=Nd(e);if(a===void 0)return{left:i.left,width:i.width};const s=Ad(i,n,a);return{left:s.left,width:s.width}}function w0(e){const t=e.options??{},r=t.top??0,n=(t.tableRows??[]).reduce((a,s)=>a+(s.height??0),0),i=Math.max(t.height??0,n);return r+kt(t).top+i}function Lo(e){if(Io(e)){const t=e.options??{};return(t.top??0)+kt(t).top+Math.max(t.height??0,0)}return w0(e)}function Bd(e){return(t,r)=>{const o=t.options?.top??0,n=r.options?.top??0;if(o!==n)return o-n;const i=t.options?.zIndex??0,a=r.options?.zIndex??0;return i!==a?i-a:(e.get(t.id)??0)-(e.get(r.id)??0)}}function Fd(e){const r=e.filter(s=>typeof s.id=="string").map(s=>s).filter(s=>!Wn(s)&&!Za(s)),o=new Map;r.forEach((s,p)=>o.set(s.id,p));const n=[...r].sort(Bd(o)),i=new Set;for(const s of n)Xa(s)||s.options?.groupId&&i.add(s.id);const a=new Set;for(const s of $d(n,i).values())for(const p of s)a.add(p);return a}function $d(e,t){const r=new Map;let o=null,n=-1,i=0,a=0;for(const s of e){if(Xa(s)){o=s.id,n=Lo(s)+kt(s.options).bottom;const d=s.options?.tableColWidths??[],u=d.length>0?d.reduce((f,h)=>f+h,0):s.options?.width??0,c=Xe({...s.options,width:u}).margin;i=c.left,a=c.right,r.set(s.id,[]);continue}if(t?.has(s.id)||!o||(s.options?.top??0)<n)continue;const l=Xe({width:0,...s.options}).margin;l.right<=i||l.left>=a||r.get(o).push(s.id)}return r}function Ja(e,t,r,o){const n=Lo(e)+kt(e.options).bottom;let i=n;for(const a of t){const s=r.elements.find(p=>p.id===a);s&&(i=Math.max(i,Xe({width:0,...s.options}).margin.bottom))}return Math.max(i-n,0)}function zd(e,t){return Math.max(e.options?.height??0,t.get(e.id)?.measuredHeight??0)}const Hd=25.4/72;function Ud(e){const t=e.options??{};if((e.type||e.printElementType?.type||"text")!=="vline")return{width:100,...t};const n=(t.borderWidth??.75)*Hd/2+.05;return{...t,left:(t.left??0)-n,width:n*2}}function Tr(e){const t=Xe(Ud(e)).margin;return[t.left,t.right]}function x0(e){const t=Xe(Ud(e)).border;return[t.left,t.right]}function No(e,t){return e[0]<t[1]&&t[0]<e[1]}function qd(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function P0(e,t,r){const o=new Map;for(const f of r.values()){if(f.length<2)continue;const h={anchorId:f[0].id,ids:f.map(b=>b.id),forceFirstPage:f.some(b=>qn(b)?.pageable===!1),band:f.map(Tr).reduce(qd)};for(const b of f)o.set(b.id,h)}const n=e.filter(f=>!jn(f)&&!Io(f)&&!f.options?.groupId&&qn(f)?.pageable!==!1),i=new Map;n.forEach(f=>i.set(f.id,f.id));const a=f=>{let h=f;for(;i.get(h)!==h;)h=i.get(h);let b=f;for(;i.get(b)!==h;){const k=i.get(b);i.set(b,h),b=k}return h},s=(f,h)=>{const b=a(f),k=a(h);b!==k&&i.set(k,b)},p=[],l=f=>Xe({width:100,...f.options,height:zd(f,t)},zd(f,t)).border,d=[...n].sort((f,h)=>l(f).top-l(h).top);for(const f of d){const h=l(f),b=h.top;for(let w=p.length-1;w>=0;w--)p[w].bottom<=b&&p.splice(w,1);const k=h.bottom,v=x0(f);for(const w of p)w.bottom>b&&No(w.x,v)&&s(f.id,w.id);p.push({id:f.id,top:b,bottom:k,x:v})}const u=new Map(n.map(f=>[f.id,f])),c=new Map;for(const f of n){const h=a(f.id),b=c.get(h);b?b.push(f.id):c.set(h,[f.id])}for(const f of c.values()){if(f.length<2)continue;const h={anchorId:f[0],ids:f,forceFirstPage:!1,band:f.map(b=>Tr(u.get(b))).reduce(qd)};for(const b of f)o.set(b,h)}return o}function Qa(e,t){const r=yt(e),{top:o,bottom:n}=e.margins,i=e.header?.height??0,a=e.footer?.height??0,s=It(e),p=s?Number.POSITIVE_INFINITY:r.height-o-n-i-a;if(!s&&p<=0)throw new Error($("diagnostic.pagination.insufficientHeight",{paper:r.height,margins:o+n,header:i,footer:a}));const l=new Map;e.elements.forEach((C,q)=>l.set(C.id,q));const d=[...e.elements].sort(Bd(l)),u=d.filter(Wn),c=d.filter(Za),f=d.filter(C=>!Wn(C)&&!Za(C)),h=u.reduce((C,q)=>{const U=Sr(q,t);return{minTop:Math.min(C.minTop,U.outerTop),maxBottom:Math.max(C.maxBottom,U.outerBottom)}},{minTop:Number.POSITIVE_INFINITY,maxBottom:Number.NEGATIVE_INFINITY}),b=!s&&u.length>0,k=b?h.minTop:0,v=b?Math.max(0,h.maxBottom-k):0,w=new Set,P=new Map;for(const C of f){if(Xa(C))continue;const q=C.options?.groupId;if(!q)continue;w.add(C.id);const U=P.get(q);U?U.push(C):P.set(q,[C])}const E=$d(f,w),D=new Map;for(const[C,q]of E)for(const U of q)D.set(U,C);const O=new Set,A=C=>{for(const q of C)O.add(q)},R=new Map;for(const C of d)R.set(C.id,C);const _=P0(f,t,P),I=[];let S=[],B=[],F=[],H=!1;function le(){return p-y0-(H?v:0)}function M(C){let q=0;for(const U of B)No(C,[U.x0,U.x1])&&(q+=U.height);return Math.max(0,q)}function ne(C,q,U){F.push({x0:C[0],x1:C[1],renderBottom:q,designBottom:U})}function Se(C){let q;for(const U of F)No(C,[U.x0,U.x1])&&(!q||U.renderBottom>=q.renderBottom)&&(q=U);return q}function Pe(C,q){const U=C.options?.top??0;if(H)return{top:ke(q),extra:0};const V=Se(q);if(!V||V.renderBottom<=U)return{top:U,extra:0};const j=Math.max(U,V.renderBottom+U-V.designBottom);return{top:j,extra:Math.max(0,j-V.renderBottom)}}function K(C){return le()-M(C)}function ue(C){const q=B.filter(U=>No(C,[U.x0,U.x1]));for(let U=0;U<q.length;U++)for(let V=U+1;V<q.length;V++)if(!No([q[U].x0,q[U].x1],[q[V].x0,q[V].x1]))return!0;return!1}function me(C,q){B.push({x0:C[0],x1:C[1],height:q})}function we(C,q=Tr(C)){return H?ke(q):C.options?.top??0}function ke(C){return(H?v:0)+M(C)}let te=!1,Me=[];function se(C,q,U){U<=0||Me.push($("diagnostic.pagination.overflowTop",{id:C.id,rot:q,amount:tr(Math.round(U*100)/100,er())}))}function Je(){I.push(te||Me.length>0?{pageIndex:I.length,sections:[...S],...te?{overflow:!0}:{},...Me.length>0?{warnings:[...Me]}:{}}:{pageIndex:I.length,sections:[...S]})}function ze(C){C>p&&(te=!0)}function ve(C=!1){if(S.length===0){te=te||C;return}Je(),S=[],B=[],F=[],H=!0,te=!1,Me=[]}let Ee=0;for(;Ee<f.length;){const C=f[Ee];if(D.has(C.id)&&O.has(C.id)){Ee++;continue}const q=_.get(C.id);if(q&&q.anchorId!==C.id){Ee++;continue}if(qn(C)?.pageable===!1||q?.forceFirstPage){const U=I[0],V=U?.sections??S,j=(J,pe,T)=>{U?T>0&&(U.warnings=[...U.warnings??[],$("diagnostic.pagination.overflowTop",{id:J.id,rot:pe,amount:tr(Math.round(T*100)/100,er())})]):se(J,pe,T)};if(q){let J=Number.POSITIVE_INFINITY,pe=Number.NEGATIVE_INFINITY,T=Number.NEGATIVE_INFINITY,X;for(const ee of q.ids){const ie=R.get(ee);if(!ie)continue;const ce=Sr(ie,t);J=Math.min(J,ce.top),pe=Math.max(pe,ce.outerBottom),T=Math.max(T,Xe({width:0,...ie.options}).margin.bottom),ce.rot!==void 0&&(X={el:ie,rot:ce.rot})}X&&j(X.el,X.rot,-J);for(const ee of q.ids)V.push({elementId:ee,type:"element",renderTop:R.get(ee)?.options?.top??0});!U&&T>Number.NEGATIVE_INFINITY&&ne(q.band,Math.max(pe,0),T)}else{const J=Sr(C,t),pe=Xe({width:0,...C.options}).margin.bottom;U||ne(Tr(C),J.outerBottom,pe),J.rot!==void 0&&j(C,J.rot,-J.top),V.push({elementId:C.id,type:"element",renderTop:C.options?.top??0})}Ee++;continue}jn(C)?Ee=mo(C,t,Ee):Io(C)?Ee=xe(C,t,Ee):q?Ee=xn(q,Ee):Ee=wn(C,t,f,Ee)}S.length>0&&Je(),I.length===0&&I.push({pageIndex:0,sections:[]});const ho=new Map(d.map((C,q)=>[C.id,q]));for(const C of I){const q=C.pageIndex>0?-k:0,U=u.map(j=>({elementId:j.id,type:"element",renderTop:(j.options?.top??0)+q})),V=c.map(j=>({elementId:j.id,type:"element",renderTop:j.options?.top??0}));C.sections=[...C.sections,...U,...V].sort((j,J)=>(ho.get(j.elementId)??Number.MAX_SAFE_INTEGER)-(ho.get(J.elementId)??Number.MAX_SAFE_INTEGER));for(const j of[...u,...c]){const J=Sr(j,t),pe=Wn(j)?q:0;if(J.outerBottom+pe>p&&(C.overflow=!0),J.rot!==void 0&&J.top+pe<0){const T=Math.round(-(J.top+pe)*100)/100;C.warnings=[...C.warnings??[],$("diagnostic.pagination.overflowTop",{id:j.id,rot:J.rot,amount:tr(T,er())})]}}}return vn(),I;function vn(){if(s)return;const C=e.margins.left;for(const q of I){const U=[];for(const V of q.sections){if(V.type==="flow-group")continue;const j=R.get(V.elementId);if(!j)continue;const{left:J,width:pe}=v0(j,t),T=C+J,X=T+pe-r.width,ee=-T;X>.01?U.push($("diagnostic.pagination.overflowRight",{id:j.id,amount:tr(Math.round(X*100)/100,er())})):ee>.01&&U.push($("diagnostic.pagination.overflowLeft",{id:j.id,amount:tr(Math.round(ee*100)/100,er())}))}U.length>0&&(q.warnings=[...q.warnings??[],...U])}}function wn(C,q,U,V){const j=Tr(C),J=Sr(C,q),pe=J.outerHeight,T=()=>{const ee=we(C,j),ie=H?ee+J.shift:ee,ce=ie-(C.options?.top??0);ze(J.outerBottom+ce),J.rot!==void 0&&!H&&se(C,J.rot,-J.top),S.push({elementId:C.id,type:"element",renderTop:ie}),me(j,pe),ne(j,ie+J.outerHeight,Xe({width:0,...C.options}).margin.bottom)};if(!H&&J.outerBottom<=p&&ue(j)||pe<=K(j)){if(T(),qn(C)?.keepWithNext&&V+1<U.length){const ee=U[V+1],ie=Sr(ee,q).outerHeight;if(pe+ie>le())return V+1;ie>K(j)&&(S.pop(),B.pop(),ve(),T())}return V+1}return ve(),T(),V+1}function xn(C,q){const U=C.ids.map(ce=>R.get(ce)).filter(ce=>!!ce);let V=Number.POSITIVE_INFINITY,j=Number.NEGATIVE_INFINITY,J=Number.NEGATIVE_INFINITY,pe;for(const ce of U){const Te=Sr(ce,t);V=Math.min(V,Te.outerTop),j=Math.max(j,Te.outerBottom),J=Math.max(J,Xe({width:0,...ce.options}).margin.bottom),Te.rot!==void 0&&(pe={el:ce,rot:Te.rot})}const T=Math.max(j-V,0),X=C.band,ee=()=>{const ce=H?ke(X)-V:0;ze(V+ce+T),pe&&!H&&se(pe.el,pe.rot,-V);for(const Te of U)S.push({elementId:Te.id,type:"element",renderTop:(Te.options?.top??0)+ce});me(X,T),ne(X,V+ce+T,J)};if(T<=K(X))return ee(),q+1;const ie=ke(X)+(H?0:V);return ve(ie+T>p),ee(),q+1}function mo(C,q,U){const V=C.options??{},j=V._renderRows??[],J=q.get(C.id)?.measuredRowHeights??[],pe=(V._subtotalTemplates?.length??0)>0,T=(V._summaryRows?.length??0)>0,X=pe?jd(j,J,"subtotal"):0,ee=T?jd(j,J,"summary"):0,ie=fe=>pe&&fe.type==="subtotal"||T&&fe.type==="summary",ce=j.filter(fe=>!ie(fe)),Te=J.filter((fe,ye)=>!ie(j[ye]));V._renderRows=ce;const Le=Math.min(ce.length,Te.length),Ke=V._repeatHeaderCount??0,ot=q.get(C.id)?.repeatHeaderHeight??J.slice(0,Ke).reduce((fe,ye)=>fe+ye,0),He=le(),ct=kt(V),Ce=ct.top+ct.bottom,De=Tr(C),{top:At,extra:Hr}=Pe(C,De);!H&&Hr>0&&me(De,Hr);let ut=At,Ae=0;const qt=()=>{Dt(C,q,De);const fe=E.get(C.id)??[],ye=fe.length>0?Ja(C,fe,e):0,ft=Lo(C)+kt(V).bottom,ht=S[S.length-1],Pn=ht?.type==="flow-group"&&ht.elementId===C.id,mp=Pn?ht.groupTop??V.top??0:ut,gp=Pn&&(ht.startRow??0)===(ht.endRow??0)&&!(ht.subtotal||ht.summary)?0:Ae;return ne(De,mp+gp+ye,ft+ye),U+1};if(ot>He)throw new Error($("diagnostic.pagination.repeatHeaderOverflow",{id:C.id,repeat:tr(ot,er()),avail:tr(He,er())}));if(Le===0)return S.push({elementId:C.id,type:"table-slice",startRow:0,endRow:0,summary:ee>0,renderTop:At}),ut=At,Ae=Math.max(0,ee),me(De,Math.max(0,ee+Ce)),qt();const xt=Te.slice(0,Le).reduce((fe,ye)=>fe+ye,0),Qe=Math.max(0,xt+X+ee+Ce);if(k0(C)?.enabled===!1){Qe>K(De)&&S.length>0&&ve();const fe=H?we(C,De):At;return S.push({elementId:C.id,type:"table-slice",startRow:0,endRow:Le,subtotal:X>0,summary:ee>0,renderTop:fe}),ut=fe,Ae=Math.max(0,Qe),me(De,Qe),qt()}const Pt=E0(ce,Le);let Jt=0,hr=!0,$e=At,Ue=Ce;const Ur=()=>K(De)-Ue,qr=(fe,ye)=>{S.push({elementId:C.id,type:"table-slice",startRow:Jt,endRow:fe,subtotal:X>0,...!hr&&ye?{repeatHeader:!0}:{},renderTop:$e}),me(De,Math.max(0,Ue)),ut=$e,Ae=Math.max(0,Ue),Ue=0};for(const fe of Pt){const ye=Te.slice(fe.start,fe.end).reduce((ft,ht)=>ft+ht,0);if(ye+X<=Ur()){Ue+=ye;continue}fe.start>Jt&&(qr(fe.start,Ke>0),hr=!1,Jt=fe.start),ve(),$e=we(C,De),Ue=Ce,hr||(Ue+=ot),Ue+=ye}if(Jt<Le&&qr(Le,Ke>0),ee>0)if(ee<=Ur()){const fe=S.length-1,ye=S[fe];if(ye&&ye.type==="table-slice"&&ye.elementId===C.id)S[fe]={...ye,summary:!0},me(De,ee),Ae+=ee;else{ve();const ft=we(C,De);S.push({elementId:C.id,type:"table-slice",startRow:Le,endRow:Le,summary:!0,renderTop:ft}),ut=ft,Ae=Math.max(0,ee+Ce),me(De,Math.max(0,ee+Ce))}}else{ve();const fe=we(C,De);S.push({elementId:C.id,type:"table-slice",startRow:Le,endRow:Le,summary:!0,renderTop:fe}),ut=fe,Ae=Math.max(0,ee+Ce),me(De,Math.max(0,ee+Ce))}return qt()}function xe(C,q,U){const V=C.options??{},j=q.get(C.id)?.measuredFlowRowHeights??[],pe=(Array.isArray(V._flowRows)?V._flowRows:[]).length,T=or(V.flowRowHeight);if(pe===0)return U+1;const X=Gr(V),ee=zn(Ld(C),V),ie=$e=>{if(!$e)return 0;const Ue=Number.parseFloat($e.borderWidth);return Number.isFinite(Ue)?Ue*Hd:0},ce=$e=>{const Ue=ee?.edges?.[$e];return ie(Ue||(ee?.all??void 0))},Te=kt(V),Le=Te.top+Te.bottom+X.top+X.bottom+ce("top")+ce("bottom"),Ke=Tr(C);let ot=0,He=Pe(C,Ke).top,ct=H?0:He,Ce=0,De=He,At=0;const Hr=()=>(H?K(Ke):le()-ct)-Ce-Le,ut=$e=>{S.push({elementId:C.id,type:"flow-list-slice",startFlowRow:ot,endFlowRow:$e,renderTop:He});const Ue=H?He:M(Ke),Ur=He+Le+Ce;me(Ke,Math.max(0,Ur-Ue)),De=He,At=Le+Ce,Ce=0};let Ae=0;for(;Ae<pe;){const $e=j[Ae]??T;if($e<=Hr()){Ce+=$e,Ae++;continue}if($e+Le>le()){Ae>ot&&(ut(Ae),ot=Ae),S.length>0&&ve(),He=we(C,Ke),ct=H?0:He,Ce=$e,ze(He+Le+Ce),Ae++;continue}if(S.length===0&&Ce===0&&!H){Ce+=$e,ze(He+Le+Ce),Ae++;continue}Ae>ot&&(ut(Ae),ot=Ae),ve(),He=we(C,Ke),ct=H?0:He}ot<pe&&ut(pe),Dt(C,q,Ke);const qt=E.get(C.id)??[],xt=qt.length>0?Ja(C,qt,e):0,Qe=S[S.length-1],Pt=Qe?.type==="flow-group"&&Qe.elementId===C.id,Jt=Pt?Qe.groupTop??V.top??0:De,hr=Pt&&(Qe.startFlowRow??0)===(Qe.endFlowRow??0)?0:At;return ne(Ke,Jt+hr+xt,Lo(C)+Te.bottom+xt),U+1}function Dt(C,q,U){const V=E.get(C.id)??[];if(V.length===0)return;const j=Ja(C,V,e),J=C.options??{};if(j<=K(U)){const pe=S.length-1,T=S[pe];if(T&&(T.type==="table-slice"||T.type==="flow-list-slice")&&T.elementId===C.id){S[pe]={...T,type:"flow-group",followElementIds:V,groupTop:T.renderTop??J.top??0},me(U,j),A(V);return}}ve(),S.push({elementId:C.id,type:"flow-group",startRow:0,endRow:0,...Io(C)?{startFlowRow:0,endFlowRow:0}:{},followElementIds:V,groupTop:we(C,U)}),me(U,j),A(V)}}function E0(e,t){const r=[];let o=0,n=1;for(let i=0;i<t;i++){for(const a of e[i]?.cells??[])!a.merged&&(a.rowspan??1)>1&&(n=Math.max(n,i+a.rowspan));i+1>=n&&(r.push({start:o,end:i+1}),o=i+1,n=o+1)}return r}function jd(e,t,r){let o=0;for(let n=0;n<e.length;n++)e[n]?.type===r&&(o+=t[n]??0);return o}const Vn=25,Wd=5;function S0(e){return Math.max(Vn,e)}function Vd(e,t,r=1.1){const o=t>0?e*r:e/r;return S0(Math.round(o))}function T0(e,t,r,o,n=.9){if(r<=0||o<=0)return 100;const i=Math.min(e/r,t/o)*n,a=Math.round(i*100);return Math.max(Wd,a)}const M0=2;function Gd(e){const t=e.gap??M0,r=[...e.units].sort((i,a)=>i.order-a.order);if(e.available<=0)return{movedIds:[],overflowRemains:!1};if(r.some(i=>i.width<=0))return{movedIds:[],overflowRemains:!1};const o=i=>{const a=r.filter(p=>!i.has(p.id));return e.pinned+a.reduce((p,l)=>p+l.width+t,0)+(i.size>0?e.moreTriggerWidth+t:0)<=e.available};if(o(new Set))return{movedIds:[],overflowRemains:!1};const n=new Set;for(const i of r)if(n.add(i.id),o(n))return{movedIds:[...n],overflowRemains:!1};return{movedIds:[...n],overflowRemains:!0}}function C0(e){const t=e.gap??4,r=e.boundaryBottom-e.triggerBottom-t,o=e.triggerTop-e.boundaryTop-t;return r>=e.overlayHeight?"down":o>r?"up":"down"}function _0(){return Na().filter(e=>gt(e).blocked===!0)}_0();function D0(e){if(!e)return!1;const t=gt(e).blocked;return t===void 0?So[e]?.blocked===!0:t}function Xr(){return`el-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function es(e){const t=$b(),r=gt(e).defaultOptions?.();if(r)return{...t,...r};const o=Vr(e)?.kind.defaultOptions?.();return o?{...t,...o}:t}function ts(e,t){return{id:Xr(),options:{...es(e),...t},printElementType:{type:e,title:gt(e).title||Vr(e)?.kind.label||String(e)}}}const A0=["left","top","width","height","marginTop","marginRight","marginBottom","marginLeft"];function O0(e){return e.type??e.printElementType?.type}function R0(e){const t=r=>(r??[]).filter(o=>!D0(O0(o)));return{...e,elements:t(e.elements),header:e.header?{...e.header,elements:t(e.header.elements)}:e.header,footer:e.footer?{...e.footer,elements:t(e.footer.elements)}:e.footer}}function I0(e){const t={...e.options};for(const r of A0){const o=t[r];typeof o=="number"&&Number.isFinite(o)&&(t[r]=L0(To(o)))}return{...e,options:t}}function L0(e){return Math.round(e*100)/100}function N0(e){const t={...e};delete t.firstPageOverlay;const r=R0(t);if(r.unit==="mm")return r;const o=r,n=i=>i?.map(I0)??[];return{...o,unit:"mm",elements:n(o.elements),header:o.header?{...o.header,elements:n(o.header.elements)}:o.header,footer:o.footer?{...o.footer,elements:n(o.footer.elements)}:o.footer}}const rs="labels",Lt={A4:{width:210,height:297,labelKey:"constants.paper.A4.label",group:"common"},A3:{width:297,height:420,labelKey:"constants.paper.A3.label",group:"common"},A5:{width:148,height:210,labelKey:"constants.paper.A5.label",group:"common"},Letter:{width:216,height:279,labelKey:"constants.paper.Letter.label",group:"common"},Legal:{width:216,height:356,labelKey:"constants.paper.Legal.label",group:"common"},DOT_FULL:{width:241,height:279.4,labelKey:"constants.paper.DOT_FULL.label",group:"dotMatrix"},DOT_HALF:{width:241,height:139.7,labelKey:"constants.paper.DOT_HALF.label",group:"dotMatrix"},DOT_THIRD:{width:241,height:93.1,labelKey:"constants.paper.DOT_THIRD.label",group:"dotMatrix"},LABEL_80X60:{width:80,height:60,labelKey:"constants.paper.LABEL_80X60.label",group:rs},LABEL_60X40:{width:60,height:40,labelKey:"constants.paper.LABEL_60X40.label",group:rs},LABEL_40X30:{width:40,height:30,labelKey:"constants.paper.LABEL_40X30.label",group:rs},THERMAL_57:{width:57,height:297,continuous:!0,labelKey:"constants.paper.THERMAL_57.label",group:"receipt"},THERMAL_80:{width:80,height:297,continuous:!0,labelKey:"constants.paper.THERMAL_80.label",group:"receipt"},THERMAL_110:{width:110,height:297,continuous:!0,labelKey:"constants.paper.THERMAL_110.label",group:"receipt"},CONTINUOUS:{width:80,height:297,continuous:!0,labelKey:"constants.paper.CONTINUOUS.label",group:"continuous"}};function Gn(e){return!!e&&Lt[e]?.continuous===!0}function ir(e){const t=Gn(e.paperSize);let r;if(e.paperSize==="CUSTOM"||t){const o=Lt[e.paperSize];r={width:e.customWidth??o?.width??210,height:e.customHeight??o?.height??297}}else{const o=Lt[e.paperSize]||Lt.A4;r={width:o.width,height:o.height}}return e.orientation==="landscape"&&!t?{width:r.height,height:r.width}:r}const os=.75,B0="constants.hint.border.apply",Bo=["top","right","bottom","left"];function Kd(e){const t={};for(const r of Bo){const o=e.map(n=>!!n?.[r]);t[r]=o.length>0&&o.every(Boolean)?"on":o.some(Boolean)?"mixed":"off"}return t}const Yd=[{value:"none",labelKey:"constants.borderStyle.none"},{value:"solid",labelKey:"constants.borderStyle.solid"},{value:"dashed",labelKey:"constants.borderStyle.dashed"},{value:"dotted",labelKey:"constants.borderStyle.dotted"},{value:"double",labelKey:"constants.borderStyle.double"}],F0=new Set(["solid","dashed","dotted","double"]),Zr="none";function Fo(e,t){const r=e.borders?.[t];if(r&&r.style!==Zr&&typeof r.width=="number"&&Number.isFinite(r.width)&&r.width>0)return!0;const o=e.borderWidth;return e.borderStyle!==Zr&&typeof o=="number"&&Number.isFinite(o)&&o>0}function $0(e){const t={};for(const r of Bo)Fo(e,r)&&(t[r]=e.borders?.[r]??{width:e.borderWidth});return t}function z0(e){const t=e.borderWidth;return{width:typeof t=="number"&&Number.isFinite(t)&&t>0?t:os,style:e.borderStyle||"solid",color:e.borderColor||"#333333"}}function Xd(e,t,r){if(t!=="inner"){if(e.borders=void 0,t==="none"){e.borderWidth=0;return}e.borderWidth=r.width,e.borderStyle=r.style,e.borderColor=r.color}}function Zd(e){return Bo.some(t=>Fo(e,t))}function ns(e,t){if(!e.length)return;const r=e[0]?.[t];return e.every(o=>o[t]===r)?r:"mixed"}function H0(e){if(!e)return;const t=typeof e.style=="string"&&F0.has(e.style)?e.style:"solid";return{width:e.width,style:e.style===void 0?void 0:t,color:e.color}}function U0(e){const t=Bo.map(o=>e.borders?.[o]).filter(o=>typeof o?.width=="number"&&Number.isFinite(o.width)&&o.width>0).map(o=>H0(o));if(!t.length)return;const r=ns(t,"style");return{width:ns(t,"width"),style:r===void 0?"solid":r,color:ns(t,"color")}}function Jd(e){const t=e.borderWidth,r=typeof t=="number"&&Number.isFinite(t),o=U0(e),n=r&&t>0;if(o&&!n)return o;const i=n?e.borderStyle||"solid":Zr;return r?{width:t,style:i,color:e.borderColor}:{width:void 0,style:i,color:void 0}}function Qd(e){const t=Jd(e);return{width:typeof t.width=="number"&&t.width>0?t.width:os,style:typeof t.style=="string"&&t.style!==Zr?t.style:"solid",color:typeof t.color=="string"?t.color:"#333333"}}function q0(e,t){e.borderWidth=t.width,e.borderStyle=t.style,e.borderColor=t.color,e.borders=void 0}function j0(e,t,r){if(t==="borderStyle"&&r===Zr){const o=Zd(e);e.borderStyle=Zr,o&&(e.borderWidth=0,e.borders=void 0);return}if(!Zd(e)){if(t==="borderStyle"){e.borderStyle=r,e.borderWidth=os;return}Object.assign(e,{[t]:r});return}if(t==="borderWidth"&&(typeof r!="number"||!(r>0))){e.borderWidth=typeof r=="number"&&r<0?0:r,e.borders=void 0;return}q0(e,z0({...e,[t]:r}))}function is(e,t,r,o){if(r!==Fo(e,t)){if(!r){const n=e.borderWidth;if(typeof n!="number"||!(n>0)){ec(e,t,null);return}const i={};for(const a of Bo){if(a===t)continue;const s=e.borders?.[a];i[a]={width:s?.width??n,...s?.style!==void 0?{style:s.style}:e.borderStyle!==void 0?{style:e.borderStyle}:{},...s?.color!==void 0?{color:s.color}:e.borderColor!==void 0?{color:e.borderColor}:{}}}e.borders=i,e.borderWidth=0;return}ec(e,t,o??Qd(e))}}function ec(e,t,r){const o={...e.borders??{}};r?o[t]={width:r.width,style:r.style,color:r.color}:delete o[t],e.borders=o}const tc=96/25.4,rc=1,W0=8,V0=210;function as(e,t){if(!e||typeof e!="object")return;if(Array.isArray(e)){for(const o of e)as(o,t);return}const r=e;typeof r.printerDpi=="number"&&r.printerDpi>0&&t.add(r.printerDpi);for(const o of Object.keys(r)){if(o==="printerDpi")continue;const n=r[o];n&&typeof n=="object"&&as(n,t)}}function G0(e){if(!e)return null;const t=new Set;return as(e,t),t.size?Math.max(...t):null}function K0(e){if(!e)return V0*tc;const t=e.pages?.length?e.pages:[e];return Math.max(...t.map(r=>{const o=ir(r);return((r.outputRotation===90||r.outputRotation===270)&&!Gn(r.paperSize)?o.height:o.width)*tc}))}function Y0(e,t){return e<=0||t<=0?rc:Math.min(W0,Math.max(rc,Math.floor(e/t)))}function X0(e,t,r){const o=[];return e&&o.push({key:"dots",value:e/96,label:`点阵 ${e}dpi`,tip:`1 屏幕像素 = 1 个打印点(${e}dpi ÷ 96dpi)。条与间隙按纸面逐点显示,不会在屏幕上糊成一片`}),o.push({key:"fit",value:Y0(t,r),label:"适配",tip:"按容器宽放大到放得下整页的最大整数倍"},{key:"100",value:1,label:"100%",tip:"按 CSS 真实尺寸显示(1mm = 3.78 屏幕像素),热敏点距在此档不可分辨"},{key:"200",value:2,label:"200%",tip:"整数倍放大,避免非整数缩放带来的半像素边"},{key:"400",value:4,label:"400%",tip:"整数倍放大,避免非整数缩放带来的半像素边"}),o}function oc(e){return"100"}function Z0(e,t){return!e||t==="dots"?"":`条码看不清?切「点阵 ${e}dpi」档(1 屏幕像素 = 1 打印点)`}const nc="print-preview-zoom-guard";function J0(e,t){if(!e?.documentElement)return;let r=e.getElementById(nc);r||(r=e.createElement("style"),r.id=nc,(e.head??e.documentElement).appendChild(r)),r.textContent=`html{zoom:${t}}@media print{html{zoom:1 !important}}`}function Q0(e,t,r){return e.some(o=>o.key===t)?t:oc()}function e1(e,t){return e.find(r=>r.key===t)?.value??1}function t1(){return Na().filter(e=>gt(e).zoneAllowed===!0)}t1();function ic(e){return gt(e).zoneAllowed===!0}function r1(e){return ir(e)}function ss(e){const t=r1(e),r=e.margins,o=e.header.height,n=e.footer.height,i=t.width-r.left-r.right,a=t.height-r.top-r.bottom-o-n,s=(p,l,d,u)=>({left:p,top:l,width:d,height:u});return{header:s(r.left,r.top,i,o),content:s(r.left,r.top+o,i,a),footer:s(r.left,t.height-r.bottom-n,i,n)}}function ac(e,t,r){const o=ss(e);return o.footer.height>0&&r>=o.footer.top?"footer":o.header.height>0&&r<o.header.top+o.header.height?"header":"content"}function ls(e,t){const r=e.options;r.width=Math.min(r.width,t.width),r.height=Math.min(r.height,t.height),r.left=Math.min(Math.max(0,r.left),t.width-r.width),r.top=Math.min(Math.max(0,r.top),t.height-r.height)}function o1(e,t){const r=ss(t),o=e.zone||"content",n=r[o],i=n.left+e.options.left+e.options.width/2,a=n.top+e.options.top+e.options.height/2;let s=ac(t,i,a),p=!1;if(s!=="content"&&!ic(e.printElementType.type)&&(s="content",p=!0),s!==o){const l=r[s];e.options.left=n.left+e.options.left-l.left,e.options.top=n.top+e.options.top-l.top,e.zone=s}return s!=="content"?ls(e,r[s]):p&&ls(e,r.content),{rejected:p}}const ps=22,ds=[1,2,5,10,20,50,100,200,500,1e3];function n1(e,t=64){const r=e*3.7795275590551185;for(const o of ds)if(o*r>=t)return o;return ds[ds.length-1]}function i1(e){const t=Math.floor(Math.log10(e)+1e-9),r=e/10**t;return r===5||r===1&&e>=10?e/5:r===2?e/2:null}function a1(e){return Math.round(e*1e3)/1e3}function s1(e,t,r){if(t<e||r<=0)return[];const n=i1(r)??r,i=Math.ceil(e/n-1e-9)*n,a=Math.floor((t-i)/n+1e-9),s=[];for(let p=0;p<=a;p++){const l=a1(i+p*n);Math.abs(l/r-Math.round(l/r))<1e-6?s.push({mm:l,major:!0,label:String(l)}):s.push({mm:l,major:!1})}return s}const sc=["#000000","#333333","#666666","#999999","#cccccc","#ffffff","#e53935","#fb8c00","#1e88e5","#43a047","#8d6e63","#00acc1"],cs=[{group:"position-size",groupLabel:"位置与尺寸",items:[{key:"ps-left",keywords:["X","横坐标","left","位置"]},{key:"ps-top",keywords:["Y","纵坐标","top","位置"]},{key:"ps-width",keywords:["W","宽度","width","尺寸"]},{key:"ps-height",keywords:["H","高度","height","尺寸"]},{key:"ps-margin-top",keywords:["上外边距","外边距","margintop"],default:0,defaultUnit:"mm"},{key:"ps-margin-right",keywords:["右外边距","外边距","marginright"],default:0,defaultUnit:"mm"},{key:"ps-margin-bottom",keywords:["下外边距","外边距","marginbottom"],default:0,defaultUnit:"mm"},{key:"ps-margin-left",keywords:["左外边距","外边距","marginleft"],default:0,defaultUnit:"mm"}]},{group:"appearance",groupLabel:"外观",items:[{key:"ap-font-family",keywords:["字体","字体名","字体族","fontfamily"]},{key:"ap-font-size",keywords:["字体大小","fontsize","字号"]},{key:"ap-font-weight",keywords:["字体粗细","粗体","bold"]},{key:"ap-align",keywords:["对齐","align"]},{key:"ap-vertical-align",keywords:["垂直对齐","verticalalign","顶对齐","底对齐"]},{key:"ap-color",keywords:["颜色","color"]},{key:"ap-bg-color",keywords:["背景色","background"]},{key:"ap-line-height",keywords:["行高","lineheight"]},{key:"ap-letter-spacing",keywords:["字间距","letterspacing"]},{key:"ap-text-fit",keywords:["溢出","溢出显示","截断","自动缩小","自适应行高","textfit","overflow"]},{key:"ap-shrink-min",keywords:["最小字号","缩放下限","shrinkminfontsize"],default:hd,defaultUnit:"pt"},{key:"ap-word-wrap",keywords:["自动换行","不换行","wordwrap"]},{key:"ap-keep-line-breaks",keywords:["保留换行符","换行符","手动换行","保留空格","连续空格","行首空格","keeplinebreaks"]},{key:"ap-long-text-indent",keywords:["首行缩进","缩进","indent","longtextindent","两字符","段首"],tipKey:"propertyTips.ap-long-text-indent"},{key:"ap-img-fit",keywords:["缩放模式","拉伸","等比","fit","contain","cover","填充","裁剪","剪裁","锚点"],tipKey:"propertyTips.ap-img-fit"},{key:"ap-img-object-position",keywords:["裁剪锚点","剪裁锚点","锚点","objectposition","object-position","对齐点","上移","头顶"],tipKey:"propertyTips.ap-img-object-position"},{key:"ap-img-fit-scale",keywords:["放大比例","剪裁放大","放大倍数","取景","裁切范围","fitscale","zoom"],default:Oo,defaultUnit:"%",tipKey:"propertyTips.ap-img-fit-scale"},{key:"ap-rotate",keywords:["旋转","角度","rotate","angle","顺时针","逆时针","90度","直角"],tipKey:"propertyTips.ap-rotate"}]},{group:"flow-list",groupLabel:"流式列表",items:[{key:"fl-columns",keywords:["每行列数","列数","栏数","几列","flowcolumns"],tipKey:"propertyTips.fl-columns"},{key:"fl-row-height",keywords:["行高","每行高度","单元高度","flowrowheight"],tipKey:"propertyTips.fl-row-height"},{key:"fl-gap-x",keywords:["单元间距","横向间距","格间距","列间距","flowgapx"],tipKey:"propertyTips.fl-gap-x"},{key:"fl-auto-span",keywords:["自适应","跨列","内容过长","占两列","自动换行","flowsautspan","flowautospan"],tipKey:"propertyTips.fl-auto-span"},{key:"fl-max-span",keywords:["最多跨几列","跨列上限","flowmaxspan"],tipKey:"propertyTips.fl-max-span"},{key:"fl-layout-mode",default:"fixed",keywords:["布局模式","容器模式","固定高度","动态分页","自动高度","flowlayoutmode"],tipKey:"propertyTips.fl-layout-mode"},{key:"fl-padding-top",keywords:["上内边距","内边距","顶边距","flowpaddingtop"],default:0,defaultUnit:"mm",tipKey:"propertyTips.fl-padding-top"},{key:"fl-padding-right",keywords:["右内边距","内边距","右边距","flowpaddingright"],default:0,defaultUnit:"mm",tipKey:"propertyTips.fl-padding-right"},{key:"fl-padding-bottom",keywords:["下内边距","内边距","底边距","flowpaddingbottom"],default:0,defaultUnit:"mm",tipKey:"propertyTips.fl-padding-bottom"},{key:"fl-padding-left",keywords:["左内边距","内边距","左边距","flowpaddingleft"],default:0,defaultUnit:"mm",tipKey:"propertyTips.fl-padding-left"}]},{group:"code",groupLabel:"条码设置",items:[{key:"cd-type",keywords:["码制","条码类型","条形码类型","barcodetype","code128","ean13","code39","itf14"]},{key:"cd-dpi",keywords:["打印机分辨率","dpi","打印点","点阵对齐","203","300"]},{key:"cd-bar-width",keywords:["条宽","条粗细","barwidth","模块宽"]},{key:"cd-bar-quiet-zone",keywords:["条码静区","条码白边","条形码留白","条码空白边","barquietzone"],default:Ed,defaultUnit:"模块",tipKey:"propertyTips.cd-bar-quiet-zone"},{key:"cd-bar-height",keywords:["条高","条码高度","条区高度","条码多高","barheight"],default:nr,defaultUnit:"模块",tipKey:"propertyTips.cd-bar-height"},{key:"cd-show-text",keywords:["显示文本","条码文本","显示数字"]},{key:"cd-font-size",keywords:["条码字号","文本字号"],default:Bn,defaultUnit:"模块"},{key:"cd-ec-level",keywords:["纠错级别","容错","qrcodelevel"]},{key:"cd-quiet-zone",keywords:["静区","静区宽度","白边","空白边","留白","铺满","quietzone"],default:Sd,defaultUnit:"模块",tipKey:"propertyTips.cd-quiet-zone"},{key:"cd-fit",keywords:["缩放模式","拉伸","等比","fit","contain","cover"]},{key:"cd-max-width",keywords:["最大宽度","最大宽","maxwidth"]},{key:"cd-max-height",keywords:["最大高度","最大高","maxheight"]}]},{group:"content",groupLabel:"内容",items:[{key:"ct-title",keywords:["内容","文本","title"]},{key:"ct-formatter",keywords:["格式化","表达式","formatter"]},{key:"ct-table-mode",keywords:["数据模式","静态布局","动态数据"]},{key:"ct-table-source",keywords:["数据源","列表字段"]},{key:"ct-table-font",keywords:["默认字号","默认颜色","默认内边距"]},{key:"ct-table-cols",keywords:["列宽","表格列"]}]},{group:"border-bg",groupLabel:"边框与背景",items:[{key:"bb-border-style",keywords:["线型","边框线型","实线","虚线","点线","双线","borderstyle"]},{key:"bb-border-width",keywords:["边框宽度","border"]},{key:"bb-border-color",keywords:["边框颜色"]},{key:"bb-bg-color",keywords:["背景色","background"]}]},{group:"binding",groupLabel:"字段绑定",items:[{key:"bd-formatter",keywords:["格式化","表达式","formatter","fx","字段","绑定","field"]},{key:"bd-content",keywords:["内容","表达式","文本","变量"]}]},{group:"pagination",groupLabel:"分页",items:[{key:"pg-enabled",keywords:["分页","pagination","启用分页"]},{key:"pg-pageable",keywords:["参与分页","pageable"]},{key:"pg-keep-with-next",keywords:["同页","keepWithNext"]}]},{group:"advanced",groupLabel:"高级",items:[{key:"ad-locked",keywords:["锁定","lock"]},{key:"ad-fixed",keywords:["每页重复","repeat"]},{key:"ad-fixed-position",keywords:["固定","每页固定","fixed"]},{key:"ad-z-index",keywords:["层级","zindex"]},{key:"ad-delete",keywords:["删除"]}]}];function lc(e,t){const r=e.trim().toLowerCase();return r?t.some(o=>o.toLowerCase().includes(r)):!0}function l1(e){const t=[],r=new Set;for(const o of cs){const n=o.items.filter(i=>lc(e,[...i.keywords,o.groupLabel]));if(n.length>0){t.push(o.group);for(const i of n)r.add(i.key)}}return{groups:t,itemKeys:r}}function p1(e){for(const t of cs)for(const r of t.items)if(r.key===e&&r.default!==void 0)return{value:r.default,unit:r.defaultUnit}}function d1(e){return/[\u1100-\u115F\u2E80-\uA4CF\uAC00-\uD7A3\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFF60\uFFE0-\uFFE6]/.test(e)}function c1(e){let t=0;for(const r of e)t+=d1(r)?1:.55;return t}function u1(e){return c1(e)>=4}const f1=new Set(["constructor","__proto__","prototype","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),h1=new Set(["new","function","class","this","delete","typeof","void","in","of","var","let","const","return","if","while","for"]);function us(e){const t=[];let r=0;const o=e.length;for(;r<o;){const n=e[r];if(/\s/.test(n)){r++;continue}if(/[0-9]/.test(n)||n==="."&&r+1<o&&/[0-9]/.test(e[r+1])){let s=r;for(;s<o&&/[0-9.]/.test(e[s]);)s++;t.push({type:"num",value:e.slice(r,s),position:r}),r=s;continue}if(n==="'"||n==='"'){let s=r+1,p="";for(;s<o&&e[s]!==n;)e[s]==="\\"&&s+1<o?(p+=e[s+1],s+=2):(p+=e[s],s++);if(s>=o)throw new Error($("diagnostic.lexer.unterminatedString"));t.push({type:"str",value:p,position:r}),r=s+1;continue}if(/[A-Za-z_$\u4e00-\u9fff]/.test(n)){let s=r;for(;s<o&&/[A-Za-z0-9_$\u4e00-\u9fff]/.test(e[s]);)s++;const p=e.slice(r,s);if(h1.has(p))throw new Error($("diagnostic.lexer.keyword",{word:p}));if(f1.has(p))throw new Error($("diagnostic.lexer.forbidden",{word:p}));p==="true"||p==="false"?t.push({type:"bool",value:p,position:r}):t.push({type:"ident",value:p,position:r}),r=s;continue}const i=e.slice(r,r+3);if(i==="==="||i==="!=="){t.push({type:"punc",value:i,position:r}),r+=3;continue}const a=e.slice(r,r+2);if(a==="=>")throw new Error($("diagnostic.lexer.noFunctionDef"));if(["==","!=","<=",">=","&&","||"].includes(a)){t.push({type:"punc",value:a,position:r}),r+=2;continue}if(n==="=")throw new Error($("diagnostic.lexer.noAssignment"));if(n===";")throw new Error($("diagnostic.lexer.noMultipleStatements"));if("+-*/%()[]{},:.?!<>".includes(n)){t.push({type:"punc",value:n,position:r}),r++;continue}throw new Error($("diagnostic.lexer.invalidChar",{ch:n}))}return t}function fs(e){return new m1(e).parse()}class m1{constructor(t){this.pos=0,this.tokens=t}parse(){const t=this.parseTernary();if(this.pos<this.tokens.length)throw new Error($("diagnostic.parser.trailingContent",{value:this.tokens[this.pos].value}));return t}peek(){return this.tokens[this.pos]}next(){const t=this.tokens[this.pos++];if(!t)throw new Error($("diagnostic.expressionUnexpectedEnd"));return t}eatPunc(t){const r=this.peek();return r&&r.type==="punc"&&r.value===t?(this.pos++,!0):!1}expectPunc(t){if(!this.eatPunc(t)){const r=this.peek()?.position??0;throw new Error($("diagnostic.parser.expected",{pos:r,value:t}))}}parseTernary(){const t=this.parseLogicalOr();if(this.eatPunc("?")){const r=this.parseTernary();this.expectPunc(":");const o=this.parseTernary();return{type:"ternary",cond:t,consequent:r,alternate:o}}return t}parseLogicalOr(){let t=this.parseLogicalAnd();for(;this.eatPunc("||");){const r=this.parseLogicalAnd();t={type:"binary",op:"||",left:t,right:r}}return t}parseLogicalAnd(){let t=this.parseEquality();for(;this.eatPunc("&&");){const r=this.parseEquality();t={type:"binary",op:"&&",left:t,right:r}}return t}parseEquality(){let t=this.parseRelational();for(;;){const r=this.peek();if(r?.type==="punc"&&["==","!=","===","!=="].includes(r.value)){this.pos++;const o=this.parseRelational();t={type:"binary",op:r.value,left:t,right:o}}else return t}}parseRelational(){let t=this.parseAdditive();for(;;){const r=this.peek();if(r?.type==="punc"&&["<",">","<=",">="].includes(r.value)){this.pos++;const o=this.parseAdditive();t={type:"binary",op:r.value,left:t,right:o}}else return t}}parseAdditive(){let t=this.parseMultiplicative();for(;;){const r=this.peek();if(r?.type==="punc"&&(r.value==="+"||r.value==="-")){this.pos++;const o=this.parseMultiplicative();t={type:"binary",op:r.value,left:t,right:o}}else return t}}parseMultiplicative(){let t=this.parseUnary();for(;;){const r=this.peek();if(r?.type==="punc"&&["*","/","%"].includes(r.value)){this.pos++;const o=this.parseUnary();t={type:"binary",op:r.value,left:t,right:o}}else return t}}parseUnary(){const t=this.peek();if(t?.type==="punc"&&["!","-","+"].includes(t.value)){this.pos++;const r=this.parseUnary();return{type:"unary",op:t.value,arg:r,prefix:!0}}return this.parsePostfix()}parsePostfix(){let t=this.parsePrimary();for(;;)if(this.eatPunc(".")){const r=this.next();if(r.type!=="ident")throw new Error($("diagnostic.parser.memberName",{pos:r.position}));t={type:"member",object:t,property:r.value,computed:!1}}else if(this.eatPunc("[")){const r=this.parseTernary();this.expectPunc("]"),r.type==="str"?t={type:"member",object:t,property:r.value,computed:!1}:t={type:"member",object:t,property:r.name??String(r.value),computed:!0}}else if(this.peek()?.type==="punc"&&this.peek()?.value==="("&&(t.type==="ident"||t.type==="member")){this.pos++;const r=this.parseArgs();t={type:"call",callee:t,args:r}}else return t}parseArgs(){const t=[];if(this.eatPunc(")"))return t;for(;;){if(t.push(this.parseTernary()),this.eatPunc(")"))return t;this.expectPunc(",")}}parsePrimary(){const t=this.next();if(t.type==="num"){const r=Number(t.value);if(isNaN(r))throw new Error($("diagnostic.parser.invalidNumber",{value:t.value}));return{type:"num",value:r}}if(t.type==="str")return{type:"str",value:t.value};if(t.type==="bool")return{type:"bool",value:t.value==="true"};if(t.type==="ident")return{type:"ident",name:t.value};if(t.value==="("){const r=this.parseTernary();return this.expectPunc(")"),r}if(t.value==="["){const r=[];if(!this.eatPunc("]"))for(;r.push(this.parseTernary()),!this.eatPunc("]");)this.expectPunc(",");return{type:"array",elements:r}}if(t.value==="{"){const r=[];if(!this.eatPunc("}"))for(;;){const o=this.next();if(o.type!=="ident"&&o.type!=="str")throw new Error($("diagnostic.parser.objectKey",{pos:o.position}));if(this.expectPunc(":"),r.push({key:o.value,value:this.parseTernary()}),this.eatPunc("}"))break;this.expectPunc(",")}return{type:"object",properties:r}}throw new Error($("diagnostic.parser.unexpectedToken",{pos:t.position,value:t.value}))}}const pc=20,g1=8;function at(e,t=0){if(typeof e=="number")return Number.isFinite(e)?e:t;if(typeof e=="string"){const r=e.trim();if(r==="")return t;const o=Number(r);return Number.isFinite(o)?o:t}return e==null?t:typeof e=="boolean"?e?1:0:t}function b1(e){if(typeof e=="number")return Number.isFinite(e);if(typeof e=="string"){const t=e.trim();return t!==""&&Number.isFinite(Number(t))}return!1}function Jr(e){return!Number.isFinite(e)||Number.isInteger(e)||Math.abs(e)>=1e15?e:Number(e.toPrecision(12))}function Qr(e){if(!Number.isFinite(e)||Number.isInteger(e))return 0;const t=String(e);if(t.includes("e")||t.includes("E"))return 0;const r=t.indexOf(".");return r===-1?0:t.length-r-1}function hs(e,t){if(!Number.isFinite(e))return 0;const r=Math.min(Math.max(t,0),12);if(r===0)return Math.round(e);const o=10**r,n=e*o;return!Number.isFinite(n)||Math.abs(n)>=1e15?Jr(e):Math.round(n)/o}function ms(e,t){const r=at(e),o=at(t),n=r+o;return hs(n,Math.max(Qr(r),Qr(o)))}function gs(e,t){const r=at(e),o=at(t),n=r-o;return hs(n,Math.max(Qr(r),Qr(o)))}function dc(e,t){const r=at(e),o=at(t),n=r*o;return hs(n,Qr(r)+Qr(o))}function cc(e,t){const r=at(e),o=at(t);return o===0?0:Jr(r/o)}function k1(e,t){const r=at(e),o=at(t);return o===0?0:Jr(r%o)}function y1(e){if(e==null)return 2;const t=Math.trunc(at(e,2));return Number.isFinite(t)?Math.min(Math.max(t,-pc),pc):2}function Kn(e,t,r){const o=at(e,0),n=y1(t);if(o===0)return 0;if(Math.abs(o)>=1e21)return Jr(o);const i=Math.max(n,0)+g1,a=o.toFixed(i);if(!/^-?\d+(\.\d+)?$/.test(a))return Jr(o);const s=a.startsWith("-"),p=a.replace("-","").replace(".","");let l=BigInt(p||"0");s&&(l=-l);const d=10n**BigInt(i-n),u=l<0n?-1n:1n,c=l<0n?-l:l;let f=c/d;const h=c%d,b=2n*h;r==="up"?h!==0n&&(f+=1n):r!=="down"&&b>=d&&(b>d||r==="half-up"||f%2n===1n)&&(f+=1n);const k=u*f;return Jr(n>=0?Number(k)/10**n:Number(k)*10**-n)}const bs={Math,Number,String,Boolean,parseInt,parseFloat,isNaN,true:!0,false:!1,null:null,undefined:void 0},v1=new Set(["constructor","__proto__","prototype","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),w1=new Set(["Number","String","Boolean","parseInt","parseFloat","isNaN"]);function et(e,t,r={}){switch(e.type){case"num":return e.value;case"str":return e.value;case"bool":return e.value;case"ident":return x1(e.name,t);case"binary":return P1(e,t,r);case"unary":return E1(e,t,r);case"ternary":return et(e.cond,t,r)?et(e.consequent,t,r):et(e.alternate,t,r);case"member":return M1(e,t,r);case"call":return C1(e,t,r);case"array":return e.elements.map(o=>et(o,t,r));case"object":return Object.fromEntries(e.properties.map(o=>[o.key,et(o.value,t,r)]))}}function x1(e,t,r){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];if(Object.prototype.hasOwnProperty.call(bs,e))return bs[e];throw new Error($("diagnostic.evaluator.undefinedIdentifier",{name:e}))}function P1(e,t,r){const o=et(e.left,t,r),n=et(e.right,t,r);switch(e.op){case"+":return T1(o,n)?ms(o,n):S1(o,n);case"-":return gs(o,n);case"*":return dc(o,n);case"/":return cc(o,n);case"%":return k1(o,n);case"<":return o<n;case">":return o>n;case"<=":return o<=n;case">=":return o>=n;case"==":return o==n;case"!=":return o!=n;case"===":return o===n;case"!==":return o!==n;case"&&":return o&&n;case"||":return o||n;default:throw new Error($("diagnostic.evaluator.unknownOperator",{op:e.op}))}}function E1(e,t,r){const o=et(e.arg,t,r);switch(e.op){case"-":return gs(0,o);case"+":return at(o);case"!":return!o;default:throw new Error($("diagnostic.evaluator.unknownUnaryOperator",{op:e.op}))}}function S1(e,t){return`${e==null?"":String(e)}${t==null?"":String(t)}`}function T1(e,t){const r=uc(e),o=uc(t);return r==="other"||o==="other"?!1:r==="num"||o==="num"}function uc(e){return e==null||e===""?"neutral":b1(e)?"num":"other"}function M1(e,t,r){const o=et(e.object,t,r);if(o==null)throw new Error($("diagnostic.evaluator.nullProperty"));if(v1.has(e.property))throw new Error($("diagnostic.evaluator.forbiddenProperty",{property:e.property}));return o[e.property]}function C1(e,t,r){if(e.callee.type==="ident"&&w1.has(e.callee.name)){const n=bs[e.callee.name],i=e.args.map(a=>et(a,t,r));return n(...i)}if(e.callee.type==="member"&&e.callee.object.type==="ident"&&e.callee.object.name==="Math"){const n=Math[e.callee.property];if(typeof n!="function")throw new Error($("diagnostic.evaluator.mathNotMethod",{name:e.callee.property}));const i=e.args.map(a=>et(a,t,r));return n(...i)}let o;if(e.callee.type==="ident")o=e.callee.name;else if(e.callee.type==="member")throw new Error($("diagnostic.evaluator.noMethodCall"));if(o&&r[o]){const n=e.args.map(i=>et(i,t,r));return r[o](...n)}throw o&&Object.prototype.hasOwnProperty.call(t,o)?new Error($("diagnostic.evaluator.notFunction",{name:o})):new Error($("diagnostic.evaluator.forbiddenCall",{name:o??"表达式"}))}function _1(e){const t=[];let r=0;const o=e.length;for(;r<o;){if(e[r]==="{"){let i=1,a=r+1;for(;a<o&&i>0;)e[a]==="{"?i++:e[a]==="}"&&i--,a++;if(i!==0)throw new Error($("diagnostic.template.unclosedBrace",{pos:r}));const s=e.slice(r+1,a-1);if(s.trim()==="")throw new Error($("diagnostic.template.emptyExpression",{pos:r}));const p=us(s),l=fs(p);t.push({type:"expr",expression:l}),r=a;continue}let n=r;for(;n<o&&e[n]!=="{";)e[n]==="\\"&&n+1<o&&(e[n+1]==="{"||e[n+1]==="}")?n+=2:n++;t.push({type:"text",value:e.slice(r,n).replace(/\\([{}])/g,"$1")}),r=n}return{type:"template",parts:t}}function D1(e,t,r={}){let o="";for(const n of e.parts)if(n.type==="text")o+=n.value;else{const i=et(n.expression,t,r);o+=String(i??"")}return o}function fc(e,t={}){const r=_1(e);return o=>D1(r,o,t)}function $o(e,t){if(e==null||t==null)return;if(typeof e=="object"&&t in e)return e[t];const r=t.split(".");let o=e;for(const n of r){if(o==null)return;o=o[n]}return o}function hc(e){const t=Number(e);if(isNaN(t))return String(e);const r=t<0?"-":"",o=Math.abs(t),[n,i]=o.toFixed(2).split("."),a=n.replace(/\B(?=(\d{3})+(?!\d))/g,",");return`${r}${a}.${i}`}function mc(e,t){let r;if(e instanceof Date)r=e;else if(typeof e=="number")r=new Date(e);else if(typeof e=="string")r=new Date(e);else return String(e);if(isNaN(r.getTime()))return String(e);const o=n=>String(n).padStart(2,"0");return t.replace("YYYY",String(r.getFullYear())).replace("MM",o(r.getMonth()+1)).replace("DD",o(r.getDate())).replace("HH",o(r.getHours())).replace("mm",o(r.getMinutes())).replace("ss",o(r.getSeconds()))}const ks=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],A1=["","拾","佰","仟"],O1=["","万","亿","万亿","亿亿"];function R1(e){let t="",r=!1;for(let o=3;o>=0;o--){const n=Math.floor(e/10**o)%10;if(n===0){t&&(r=!0);continue}r&&(t+="零",r=!1),t+=ks[n]+A1[o]}return t}function gc(e){const t=Number(e);if(isNaN(t))return String(e);if(t===0)return"零元整";const r=t<0?"负":"",[o,n]=Math.abs(t).toFixed(2).split("."),i=Math.ceil(o.length/4);let a="",s=!1;for(let d=i-1;d>=0;d--){const u=o.length-d*4,c=parseInt(o.slice(Math.max(0,u-4),u),10);if(c===0){a&&(s=!0);continue}a&&(s||c<1e3)&&(a+="零"),s=!1,a+=R1(c)+(O1[d]??"")}a=`${a||"零"}元`;const p=parseInt(n[0],10),l=parseInt(n[1],10);return p===0&&l===0?a+="整":(p===0?a+="零":a+=ks[p]+"角",l>0&&(a+=ks[l]+"分")),r+a}function bc(e,t,r){return e?t:r}function ys(e,t){return e.reduce((r,o)=>r+(Number($o(o,t))||0),0)}function kc(e,t){return e.length===0?0:ys(e,t)/e.length}function yc(e,t){return e.length}function vc(e,t){return e.length===0?0:Math.min(...e.map(r=>Number($o(r,t))||0))}function wc(e,t){return e.length===0?0:Math.max(...e.map(r=>Number($o(r,t))||0))}function xc(...e){return e.reduce((t,r)=>ms(t,r),0)}function Pc(...e){return e.length===0?0:e.slice(1).reduce((t,r)=>gs(t,r),ms(e[0],0))}function Ec(...e){return e.length===0?0:e.reduce((t,r)=>dc(t,r),1)}function Sc(e,t){return cc(e,t)}function Tc(e,t){return Kn(e,t,"half-up")}function Yn(e,t){return Kn(e,t,"up")}function Xn(e,t){return Kn(e,t,"down")}function Mc(e,t){return Kn(e,t,"half-even")}class I1{constructor(){this.functions={}}registerFunction(t,r){this.functions[t]=r}evaluate(t,r){const o=us(t),n=fs(o);return et(n,r,this.functions)}render(t,r){return fc(t,this.functions)(r)}}const vs=new I1,L1={MONEY:hc,DATE:mc,UPPER:gc,IF:bc,CONCAT:(...e)=>e.filter(t=>t!=null).map(String).join(""),IFEMPTY:(e,t)=>e!=null&&e!==""?String(e):t,LEN:e=>String(e).length,ADD:xc,SUB:Pc,MUL:Ec,DIV:Sc,ROUND:Tc,ROUNDUP:Yn,CEIL:Yn,ROUNDDOWN:Xn,FLOOR:Xn,ROUNDBANK:Mc};for(const[e,t]of Object.entries(L1))vs.registerFunction(e,t);function N1(e,t,r){switch(e.toUpperCase()){case"SUM":return ys(r,t);case"AVG":return kc(r,t);case"COUNT":return yc(r);case"MIN":return vc(r,t);case"MAX":return wc(r,t);default:return 0}}function B1(e,t){return vs.evaluate(e,t)}function ar(e,t,r){if(!e)return"";if(!e.includes("{"))return e;const o=Array.isArray(t.rows)?t.rows:[],n=e.replace(/\{([^}]+)\}/g,(i,a)=>{let s=a.trim();return s=s.replace(/\b(SUM|AVG|COUNT|MIN|MAX)\(([^)]+)\)/g,(p,l,d)=>{const u=d.trim().replace(/^['"]|['"]$/g,"");return String(N1(l,u,o))}),`{${s}}`});try{return vs.render(n,t)}catch{return r??e}}function Cc(e,t,r,o){const n={...Qn(),...t??{}},i=JSON.parse(JSON.stringify(e));i.header?.elements&&(i.header.elements=i.header.elements.map(s=>ws(s,n,r))),i.footer?.elements&&(i.footer.elements=i.footer.elements.map(s=>ws(s,n,r))),i.elements=i.elements.map(s=>ws(s,n,r));const a=o??r;if(a&&i.fonts?.length){const s=a.replace(/\/+$/,"");i.fonts=i.fonts.map(p=>({...p,files:(p.files??[]).map(l=>({...l,url:l.url?.startsWith("/")&&!l.url.startsWith("//")?s+l.url:l.url}))}))}return i}function ws(e,t,r){const o={...e,options:{...e.options}};if(!(o.type==="flowList"||o.printElementType?.type==="flowList")&&typeof o.options.formatter=="string"){const p=o.options.formatter;if(Ho(p))o.options.rawFormatter=p;else{const l=o.type||o.printElementType?.type,d=typeof o.options.exampleValue=="string"?o.options.exampleValue:Nb(l);o.options.formatter=ar(p,t,d)}}if((o.type==="image"||o.printElementType?.type==="image")&&typeof o.options.src=="string"){let p=o.options.src;if(p.includes("{")){const l=typeof o.options.exampleValue=="string"?o.options.exampleValue:"";p=ar(p,t,l)}p&&r&&!/^([a-z][a-z\d+\-.]*:|\/\/)/i.test(p)&&(p=r.replace(/\/+$/,"")+(p.startsWith("/")?p:`/${p}`)),o.options.src=p}(o.type==="table"||o.printElementType?.type==="table")&&$1(o,t),(o.type==="flowList"||o.printElementType?.type==="flowList")&&F1(o,t);const a=o.type||o.printElementType?.type||"text",s=Vr(a)?.binding?.bind;if(s){const p=s(o.options,t);p&&typeof p=="object"&&Object.assign(o.options,p)}return o}function F1(e,t){const r=typeof e.options.formatter=="string"?e.options.formatter:"",o={...e.options,dataSource:e.options.dataSource??Nn(r,t)},{list:n,key:i}=_c(o,t),a=p=>i?{...t,...p,[i]:p}:{...t,...p},s=n.map(p=>r?Ho(r)?r:ar(r,a(p)):String(p??""));if(e.options._flowItems=s,e.options._flowRawFormatter=Ho(r)?r:void 0,wr(e.options.flowLayoutMode)==="dynamic"){const p=vd(e.options.width??0,Gr(e.options)),l=s.length>0?s:String(e.options.testData??"").split(/\r?\n/).map(d=>d.trim()).filter(Boolean);e.options._flowRows=Ua(l,{width:p,columns:bt(e.options.flowColumns),gapX:Et(e.options.flowGapX),fontSizePt:e.options.fontSize??12,autoSpan:e.options.flowAutoSpan===!0,maxSpan:xr(e.options.flowMaxSpan,e.options.flowColumns)})}}function _c(e,t){const r=e.dataSource??e.fields?.[0]?.dataSource??e.fields?.[0]?.field;if(r)return{list:Array.isArray(t[r])?t[r]:[],key:r};for(const[o,n]of Object.entries(t))if(Array.isArray(n))return{list:n,key:o};return{list:[],key:r}}function $1(e,t){const r=e.options,o=r.tableRows;if(!Array.isArray(o)||o.length===0)return;const n=r.tableMode??"dynamic",{list:i,key:a}=n==="dynamic"?_c(r,t):{list:[],key:void 0},s=h=>a?{...t,...h,[a]:h}:{...t,...h},p=a?i.map(h=>({...h,[a]:h})):i,l=[],d=[],u=[],c=[];let f=-1;for(const h of o){if(n==="dynamic"&&h.type==="data"){z1(h.cells);for(const b of i){f<0&&(f=l.length);const k=s(b);l.push(Jn(h,v=>Zn(v,k))),d.push(k)}continue}if(n==="dynamic"&&h.type==="subtotal"){const b=Jn(h,k=>Zn(k,{rows:p,...t}),!0);u.push(b),l.push(b);continue}if(n==="dynamic"&&h.type==="summary"){const b=Jn(h,k=>Zn(k,{rows:p,...t}));c.push(b),l.push(b);continue}l.push(Jn(h,b=>Zn(b,t)))}r._renderRows=l,r._repeatHeaderCount=H1(o),r._dataRowCtx=d,r._dataStartIdx=f<0?l.length:f,r._subtotalTemplates=u,r._summaryRows=c,r._mainData=t}function z1(e){const t=new Set;e.forEach((r,o)=>{if(!r||r.merged)return;const n=Math.max(r.colspan??1,1);for(let i=1;i<n;i++)t.add(o+i)}),e.forEach((r,o)=>{r.rowspan&&(r.rowspan=1),r.merged&&!t.has(o)&&(r.merged=!1)})}function Zn(e,t){const r=e.formatter;return r?Ho(r)?r:ar(r,t,""):""}function Jn(e,t,r=!1){return{type:e.type,height:e.height??8,cells:e.cells.map(o=>({content:o.merged?"":t(o),...(r||Ho(o.formatter))&&!o.merged?{rawFormatter:o.formatter??""}:{},cellType:o.cellType,barcodeType:o.barcodeType,qrCodeLevel:o.qrCodeLevel,qrQuietZone:o.qrQuietZone,barQuietZone:o.barQuietZone,barHeight:o.barHeight,barWidth:o.barWidth,barFontSize:o.barFontSize,showBarcodeText:o.showBarcodeText,printerDpi:o.printerDpi,fit:o.fit,objectPosition:o.objectPosition,fitScale:o.fitScale,maxWidth:o.maxWidth,maxHeight:o.maxHeight,rowspan:o.rowspan??1,colspan:o.colspan??1,merged:o.merged===!0,...o.mergeSameValue===!0?{mergeSameValue:!0}:{},align:o.align,valign:o.valign,fontSize:o.fontSize,fontFamily:o.fontFamily,fontWeight:o.fontWeight,color:o.color,backgroundColor:o.backgroundColor,borders:o.borders,padding:o.padding,wordWrap:o.wordWrap,textFit:o.textFit,shrinkMinFontSize:o.shrinkMinFontSize}))}}function H1(e){const t=U1(e);return t===0||!e.slice(0,t).some(o=>o.repeatOnPage===!0)?0:j1(e,t)}function U1(e){let t=0;for(const r of e){if(r?.type!=="header")break;t++}return t}function q1(e,t){for(let r=0;r<t;r++)for(const o of e[r]?.cells??[])if(!o?.merged&&r+(o?.rowspan??1)>t)return!1;return!0}function j1(e,t){for(let r=t;r>=1;r--)if(q1(e,r))return r;return 1}const zo=e=>String(e).padStart(2,"0");function Qn(e=new Date,t={}){return{printDate:`${e.getFullYear()}-${zo(e.getMonth()+1)}-${zo(e.getDate())}`,printTime:`${zo(e.getHours())}:${zo(e.getMinutes())}:${zo(e.getSeconds())}`,pageIndex:t.pageIndex??1,totalPages:t.totalPages??1}}function Ho(e){return typeof e=="string"&&/\b(pageIndex|totalPages)\b/.test(e)}function xs(e,t=new Date){const{printDate:r,printTime:o}=Qn(t);return e.replace(/\{printDate\}/g,r).replace(/\{printTime\}/g,o)}function Uo(e){const t=[];for(const r of e??[]){const o=r?.family?.trim();if(!o)continue;const n=`"${o.replace(/"/g,"")}"`;for(const i of r.files??[]){const a=i?.url?.trim();if(!a)continue;const s=Number.isFinite(i.weight)?Number(i.weight):400,p=i.style==="italic"?"italic":"normal";t.push(`@font-face{font-family:${n};src:url("${a}")${W1(a)};font-weight:${s};font-style:${p};font-display:block;}`)}}return t.length?`${t.join("")}
13
+ {warnings}`,"store.tilingSinglePage":"เมื่อเปิดการจัดเรียงชิ้น อนุญาตให้มีหน้าออกแบบได้เพียงหน้าเดียว","elementGroup.chart":"แผนภูมิ","service.printData.emptyArray":"ข้อมูลการพิมพ์เป็นชุดต้องเป็นอาร์เรย์อ็อบเจกต์ที่ไม่ว่างเปล่า","service.printData.tooMany":"การพิมพ์เป็นชุดรองรับได้มากสุด {max} ชุด ได้ {count} ชุด","service.printData.itemNotObject":"รายการข้อมูลการพิมพ์ชุดที่ {index} ต้องเป็นอ็อบเจกต์","service.printData.notObjectOrArray":"printData ต้องเป็นอ็อบเจกต์หรืออาร์เรย์",...{"binding.k1":"อัปโหลดรูปภาพ","binding.k2":"รองรับเฉพาะไฟล์รูปภาพ","binding.k3":"ไม่ได้ตั้งค่าการอัปโหลดรูปภาพ","binding.k4":"กำลังอัปโหลด...","binding.k5":"อัปโหลดรูปภาพล้มเหลว","binding.k6":"อัปโหลดรูปภาพล้มเหลว","binding.k7":"อัปโหลดรูปภาพ","binding.k8":"รองรับรูปภาพ jpg/png/gif/bmp/webp/svg; ป้อนเส้นทางสัมพัทธ์หลังอัปโหลด","binding.k9":"เนื้อหา","binding.k10":"ป้อนเนื้อหา รองรับนิพจน์ {field}","canvas.k11":"ส่วนหัว","canvas.k12":"ส่วนท้าย","canvas.k13":"+ องค์ประกอบ","canvas.k14":"+ ข้อความคงที่","canvas.k15":"+ ฟิลด์ข้อมูล","canvas.k16":"คัดลอก","canvas.k17":"ตัด","canvas.k18":"วาง","canvas.k19":"ลบ","canvas.k20":"นำไปด้านหน้าสุด","canvas.k21":"เลื่อนขึ้น","canvas.k22":"เลื่อนลง","canvas.k23":"ส่งไปด้านหลังสุด","canvas.k24":"วาง","canvas.k25":"เลือกทั้งหมด","canvas.k26":"ยกเลิกการเลือก","code.k27":"คิวอาร์โค้ด","controls.k28":"ลด","controls.k29":"ลด","controls.k30":"เพิ่ม","controls.k31":"เพิ่ม","controls.k32":"คำอธิบายฟิลด์","controls.k33":"คืนค่าเริ่มต้น","controls.k34":"คืนค่าเริ่มต้น ({v0}{v1})","controls.k35":"{v0} (ใช้กับเซลล์ที่เลือกทั้งหมด)","controls.k36":"ตัวเลือกสี","cropAnchor.k37":"กำหนดเอง (คงเดิม)","cropAnchor.k38":"ค่าเริ่มต้น 100","cropAnchor.k39":"รูปตัวอย่าง","cropAnchor.k40":"รูปต้นฉบับ","elements.k41":"ข้อความ","elements.k42":"เนื้อหาข้อความยาว","elements.k43":"รูปภาพ","flowList.k44":"สมุนไพร 20g","flowList.k45":"สมุนไพร 15g","flowList.k46":"สมุนไพร 10g","flowList.k47":"สมุนไพร 10g","flowList.k48":"สมุนไพร 10g","flowList.k49":"สมุนไพร 10g","flowList.k50":"สมุนไพร 10g","fontSelect.k51":"ค่าเริ่มต้น","fontSelect.k52":"{v0} (ไม่ทราบ)","fontSelect.k53":'ใช้ "{v0}"',"formatBar.k54":"เส้นทึบ","formatBar.k55":"เส้นประ","formatBar.k56":"เส้นจุด","formatBar.k57":"เส้นคู่","formatBar.k58":"ออกจากเครื่องมือถ่ายรูปแบบ (Esc)","formatBar.k59":"เครื่องมือถ่ายรูปแบบ (ไม่รองรับเซลล์ตาราง)","formatBar.k60":"เครื่องมือถ่ายรูปแบบ (เลือกองค์ประกอบก่อน)","formatBar.k61":"เครื่องมือถ่ายรูปแบบ (เลือกองค์ประกอบต้นทางเพียงหนึ่ง)","formatBar.k62":"เครื่องมือถ่ายรูปแบบ: คลิกครั้งเดียวเพื่อถ่ายครั้งเดียว คลิกสองครั้งเพื่อถ่ายต่อเนื่อง","formatBar.k63":"{v0} (เลือกองค์ประกอบข้อความ)","formatBar.k64":"ไม่มีเส้นขอบ","formatBar.k65":"เส้นขอบทั้งหมด","formatBar.k66":"เส้นขอบด้านนอก","formatBar.k67":"เส้นขอบด้านใน","formatBar.k68":"เส้นขอบด้านใน (เฉพาะเซลล์ตาราง)","formatBar.k69":"เส้นขอบบน","formatBar.k70":"เส้นขอบล่าง","formatBar.k71":"เส้นขอบซ้าย","formatBar.k72":"เส้นขอบขวา","formatBar.k73":"{v0} (คลิกอีกครั้งเพื่อยกเลิก, รูปแบบ = ไม่มี)","formatBar.k74":"ความกว้าง","formatBar.k75":"ผสม","formatBar.k76":"สี","formatBar.k77":"สีเส้นขอบ","formatBar.k78":"เส้นขอบทั้งสี่ด้านไม่สอดคล้องกัน: รายการที่เว้นไว้ไม่ได้รายงานค่าผิด; ค่าที่ตั้งไว้ล่วงหน้า/ด้านเดียวใช้ค่าเริ่มต้น (เส้นทึบ 0.75 / #333333)","formatBar.k79":"จัดชิดซ้าย","formatBar.k80":"จัดกึ่งกลาง","formatBar.k81":"จัดชิดขวา","formatBar.k82":"จัดชอบแนว (เติมความกว้างบรรทัด รวมบรรทัดสุดท้าย)","formatBar.k83":"จัดชิดบน","formatBar.k84":"จัดกึ่งกลางแนวตั้ง","formatBar.k85":"จัดชิดล่าง","formatBar.k86":"ผสม","formatBar.k87":"ค่าเริ่มต้น","formatBar.k88":"ผสม","formatBar.k89":"ค่าเริ่มต้น","formatBar.k90":"ตัวหนา","formatBar.k91":"ขีดเส้นใต้","formatBar.k92":"ขีดฆ่า","formatBar.k93":"สีตัวอักษร {v0}","formatBar.fontDisabledHint":"(เลือกหรือผสมองค์ประกอบข้อความ)","formatBar.k94":"สีพื้นหลัง","formatBar.k95":"การจัดตำแหน่ง","formatBar.k96":"การจัดตำแหน่ง (เลือกองค์ประกอบข้อความหรือเซลล์)","formatBar.k97":"การจัดตำแหน่ง","formatBar.k98":"เส้นขอบ","formatBar.k99":"เส้นขอบ (เลือกองค์ประกอบ)","formatBar.k100":"เส้นขอบ","helpModal.k101":"ช่วยเหลือ","helpModal.k102":"ปิด","pageExtras.k103":"อัปโหลดภาพพื้นหลัง","pageExtras.k104":"รองรับเฉพาะไฟล์รูปภาพ","pageExtras.k105":"ไม่ได้ตั้งค่าการอัปโหลดภาพพื้นหลังออกแบบ","pageExtras.k106":"กำลังอัปโหลด...","pageExtras.k107":"อัปโหลดภาพพื้นหลังออกแบบล้มเหลว","pageExtras.k108":"อัปโหลดภาพพื้นหลังออกแบบล้มเหลว","pageExtras.k109":"อัปโหลดภาพพื้นหลัง","pageExtras.k110":"พื้นหลังออกแบบ","pageExtras.k111":"เฉพาะในตัวออกแบบ เพื่อการจัดตำแหน่ง; ไม่แสดงในตัวอย่างหรือการพิมพ์","pageExtras.k112":"หมุน ({v0}°)","pageExtras.k113":"ลบ","pageExtras.k114":"กำหนดเอง","pageExtras.k115":" แนวนอน","pageExtras.k116":" แนวตั้ง","pageExtras.k117":"แผ่นเป้าหมาย {v0}{v1} {v2}×{v3}mm · {v4} คอลัมน์ × {v5} แถว = {v6} เซลล์/แผ่น · แต่ละเซลล์ {v7}×{v8}mm","pageExtras.k118":"การพิมพ์แบบจัดเรียงชิ้น","pageExtras.k119":"จัดเรียงฉลากเป็นแถว × คอลัมน์บนแผ่นใหญ่เพื่อพิมพ์เป็นชุด","pageExtras.k120":"เปิดใช้งานการจัดเรียงชิ้น","pageExtras.k121":"กระดาษต่อเนื่องไม่รองรับการจัดเรียงชิ้น","pageExtras.k122":"แผ่นเป้าหมาย","pageExtras.k123":"กำหนดเอง","pageExtras.k124":"ขนาดแผ่นเป้าหมาย (mm)","pageExtras.k125":"แนวของแผ่นเป้าหมาย","pageExtras.k126":"แนวตั้ง","pageExtras.k127":"แนวนอน","pageExtras.k128":"ระยะขอบการจัดเรียงชิ้น (mm)","pageExtras.k129":"บน","pageExtras.k130":"ล่าง","pageExtras.k131":"ซ้าย","pageExtras.k132":"ขวา","pageExtras.k133":"ระยะห่างและจำนวนคอลัมน์ของเซลล์","pageExtras.k134":"ระยะห่างแนวนอน","pageExtras.k135":"ระยะห่างแนวตั้ง","pageExtras.k136":"จำนวนคอลัมน์","panels.k137":"ขยายแผงทรัพยากร","panels.k138":"องค์ประกอบ","panels.k139":"ฟิลด์","panels.k140":"เลเยอร์","panels.k141":"ทรัพยากร","panels.k142":"ยุบแผงทรัพยากร","panels.k143":"องค์ประกอบ","panels.k144":"ฟิลด์","panels.k145":"เลเยอร์","panels.k146":"ลากองค์ประกอบไปยังพื้นที่ทำงาน","panels.k147":"ฟิลด์ธุรกิจ","panels.k148":"ค้นหาฟิลด์...","panels.k149":"ค้นหาฟิลด์","panels.k150":"{v0} ({v1}) · คลิกเพื่อคัดลอกชื่อฟิลด์ · ค้าง Ctrl (⌘ บน Mac) ขณะลากเพื่อแทรกชื่อฟิลด์","panels.k151":"คัดลอกแล้ว","panels.k152":"ไม่มีฟิลด์","panels.k153":"ส่วนหัว","panels.k154":"ส่วนท้าย","panels.k155":"เลเยอร์","panels.k156":"นำไปด้านหน้าสุด","panels.k157":"เลื่อนขึ้น","panels.k158":"เลื่อนลง","panels.k159":"ส่งไปด้านหลังสุด","panels.k160":"จัดกลุ่ม (Ctrl+G)","panels.k161":"ยกเลิกจัดกลุ่ม (Ctrl+Shift+G)","panels.k162":"หน้า {v0}","panels.k163":"{v0} (ดับเบิลคลิกเพื่อเปลี่ยนชื่อ)","panels.k164":"ดับเบิลคลิกเพื่อเปลี่ยนชื่อ","panels.k165":"หน้า {v0}","panels.k166":"เทมเพลตแบบจัดเรียงชิ้นอนุญาตให้มีหน้าออกแบบได้เพียงหน้าเดียว","panels.k167":"เพิ่มหน้า (ต่อหน้าเปล่าหลังหน้าปัจจุบัน)","panels.k168":"เทมเพลตแบบจัดเรียงชิ้นอนุญาตให้มีหน้าออกแบบได้เพียงหน้าเดียว","panels.k169":'ทำซ้ำหน้าปัจจุบัน "{v0}"',"panels.k170":'ลบหน้าปัจจุบัน "{v0}"',"panels.k171":"เฉพาะเทมเพลตหลายหน้าที่ลบหน้าได้","panels.k172":'ย้าย "{v0}" ไปหน้าถัดไป',"panels.k173":'ย้าย "{v0}" ไปหน้าก่อนหน้า',"panels.k174":"แนวนอน","panels.k175":"แนวตั้ง","panels.k176":"ซูม {v0}%","propertyPanel.k177":"ทั้งหมด","propertyPanel.k178":"ด้านนอก","propertyPanel.k179":"ด้านใน","propertyPanel.k180":"ไม่มี","propertyPanel.k181":"บน","propertyPanel.k182":"ขวา","propertyPanel.k183":"ล่าง","propertyPanel.k184":"ซ้าย","propertyPanel.k185":"ตำแหน่งและขนาด","propertyPanel.k186":"ระยะขอบ (mm)","propertyPanel.k187":"บน","propertyPanel.k188":"ขวา","propertyPanel.k189":"ล่าง","propertyPanel.k190":"ซ้าย","propertyPanel.k191":"การหมุน (°)","propertyPanel.k192":"ทวนเข็มนาฬิกา 90°","propertyPanel.k193":"หมุนทวนเข็มนาฬิกา 90°","propertyPanel.k194":"ตามเข็มนาฬิกา 90°","propertyPanel.k195":"หมุนตามเข็มนาฬิกา 90°","propertyPanel.k196":"ลักษณะ","propertyPanel.k197":"ฟอนต์","propertyPanel.k198":"ค่าเริ่มต้น","propertyPanel.k199":"ขนาดฟอนต์","propertyPanel.k200":"น้ำหนักฟอนต์","propertyPanel.k201":"ปกติ","propertyPanel.k202":"หนา","propertyPanel.k203":"หนาขึ้น","propertyPanel.k204":"บางลง","propertyPanel.k205":"การจัดตำแหน่ง","propertyPanel.k206":"ซ้าย","propertyPanel.k207":"กลาง","propertyPanel.k208":"ขวา","propertyPanel.k209":"ชิดสองด้าน","propertyPanel.k210":"จัดแนวตั้ง","propertyPanel.k211":"บน","propertyPanel.k212":"กลาง","propertyPanel.k213":"ล่าง","propertyPanel.k214":"สี","propertyPanel.k215":"สีตัวอักษร","propertyPanel.k216":"สีพื้นหลัง","propertyPanel.k217":"สีพื้นหลัง","propertyPanel.k218":"ระยะบรรทัด","propertyPanel.k219":"ระยะห่างตัวอักษร","propertyPanel.k220":"ข้อความล้น","propertyPanel.k221":"ตัดทิ้ง","propertyPanel.k222":"ย่อให้พอดี","propertyPanel.k223":"ความสูงแถวอัตโนมัติ","propertyPanel.k224":"ขนาดฟอนต์ขั้นต่ำ (pt)","propertyPanel.k225":"ค่าเริ่มต้น 6","propertyPanel.k226":"เว้นวรรคบรรทัดแรก (อักขระ)","propertyPanel.k227":"ค่าเริ่มต้น 0","propertyPanel.k228":"ตัดคำอัตโนมัติ","propertyPanel.k229":"คงการขึ้นบรรทัด","propertyPanel.k230":"โหมดการปรับขนาด","propertyPanel.k231":"จุดยึดการครอป","propertyPanel.k232":"ไม่รองรับการตั้งค่าลักษณะสำหรับองค์ประกอบนี้","propertyPanel.k233":"การตั้งค่าบาร์โค้ด","propertyPanel.k234":"ประเภทรหัส","propertyPanel.k235":"CODE128 (ทั่วไป)","propertyPanel.k236":"EAN13 (ค้าปลีก)","propertyPanel.k237":"DPI ของเครื่องพิมพ์","propertyPanel.k238":"ไม่ระบุ (แสดงตามความกว้างแท่น)","propertyPanel.k239":"203 dpi (8 จุด/mm)","propertyPanel.k240":"300 dpi (11.8 จุด/mm)","propertyPanel.k241":"600 dpi (23.6 จุด/mm)","propertyPanel.k242":"เมื่อตั้งค่า ความกว้างแท่นจะปรับเป็นจุดพิมพ์เต็ม: บาร์โค้ดแสดงตามความกว้างแท่น ถ้าพอดีจะพิมพ์ตามนั้น มิเช่นนั้นจะย่อขนาดตามสัดส่วน","propertyPanel.k243":"ความกว้างแท่น (อัตราส่วน)","propertyPanel.k244":"ตั้งค่า DPI ของเครื่องพิมพ์แล้ว: ความกว้างแท่นปรับเป็นจุดเต็มที่ใกล้ที่สุด (DPI แทนค่า mm) จะย่อขนาดถ้าไม่พอดี","propertyPanel.k245":"ใช้ 3+ สำหรับเครื่องพิมพ์ความร้อน/ดอทเมทริกซ์: กำหนดขนาดแท่นที่พิมพ์ แท่นหนาจะเสถียรกว่า","propertyPanel.k246":"โซนเงียบ (โมดูล)","propertyPanel.k247":"ค่าเริ่มต้น 10","propertyPanel.k248":"ความสูงแท่น (mm)","propertyPanel.k249":"ค่าเริ่มต้น 30 โมดูล","propertyPanel.k250":"แสดงข้อความ","propertyPanel.k251":"ขนาดข้อความ (เทียบความสูงแท่น 30)","propertyPanel.k252":"ค่าเริ่มต้น 10","propertyPanel.k253":"การแก้ไขข้อผิดพลาด","propertyPanel.k254":"L (ต่ำสุด ความจุสูงสุด)","propertyPanel.k255":"M (แนะนำ)","propertyPanel.k256":"H (สูงสุด)","propertyPanel.k257":"โซนเงียบ (โมดูล)","propertyPanel.k258":"ค่าเริ่มต้น 0","propertyPanel.k259":"การตั้งค่าแบบกำหนดเอง","propertyPanel.k260":"ขนาดบาร์โค้ดขึ้นกับความกว้างแท่นและ DPI ของเครื่องพิมพ์: พิมพ์ตามความกว้างแท่นถ้าพอดี มิเช่นนั้นย่อขนาด; การดึงจะทำให้แท่นไม่เป็นจำนวนเต็ม จึงไม่มีโหมดปรับขนาด—ใช้ความกว้าง/สูงสูงสุดเป็นขีดจำกัด หากต้องการให้ใหญ่ขึ้น: เพิ่มความกว้างแท่น ลดโซนเงียบ หรือซ่อนข้อความเพื่อพื้นที่มากขึ้น","propertyPanel.k261":"โหมดการปรับขนาด","propertyPanel.k262":"ความกว้างสูงสุด (mm)","propertyPanel.k263":"ค่าเริ่มต้น","propertyPanel.k264":"ความสูงสูงสุด (mm)","propertyPanel.k265":"ค่าเริ่มต้น","propertyPanel.k266":"รายการแบบไหล","propertyPanel.k267":"โหมดการจัดวาง","propertyPanel.k268":"ความสูงคงที่","propertyPanel.k269":"การแบ่งหน้าแบบไดนามิก","propertyPanel.k270":"ระยะบน (mm)","propertyPanel.k271":"ระยะขวา (mm)","propertyPanel.k272":"ระยะล่าง (mm)","propertyPanel.k273":"ระยะซ้าย (mm)","propertyPanel.k274":"จำนวนคอลัมน์ต่อแถว","propertyPanel.k275":"ความสูงแถว (mm)","propertyPanel.k276":"ระยะห่างแนวนอนของเซลล์ (mm)","propertyPanel.k277":"ขยายคอลัมน์เมื่อเนื้อหายาว","propertyPanel.k278":"จำนวนคอลัมน์ขยายสูงสุด","propertyPanel.k279":"ที่ขนาดฟอนต์และความกว้างปัจจุบัน {v0} คอลัมน์ค่อนข้างแคบ (พอดีประมาณ {v1}) ค่าไม่เปลี่ยน; การพิมพ์ใช้ {v2} คอลัมน์","propertyPanel.k280":"ผสม","propertyPanel.k281":"เส้นขอบและพื้นหลัง","propertyPanel.k282":"รูปแบบเส้น","propertyPanel.k283":"ความกว้างเส้นขอบ","propertyPanel.k284":"ผสม","propertyPanel.k285":"สีเส้นขอบ","propertyPanel.k286":"สีเส้นขอบ","propertyPanel.k287":"สีพื้นหลัง","propertyPanel.k288":"สีพื้นหลัง","propertyPanel.k289":"การตั้งค่าขั้นสูง","propertyPanel.k290":"ล็อก","propertyPanel.k291":"ทำซ้ำทุกหน้า","propertyPanel.k292":"ตรึงทุกหน้า","propertyPanel.k293":"ลำดับชั้น","propertyPanel.k294":"ลบองค์ประกอบ","propertyPanel.k295":"หมายเหตุการตั้งค่าขั้นสูง","propertyPanel.k296":"หมายเหตุการตั้งค่าขั้นสูง","propertyPanel.k297":"อื่นๆ","propertyPanel.k298":"การตั้งค่าหน้ากระดาษ","propertyPanel.k299":"ขนาดกระดาษ","propertyPanel.k300":"ขนาดกำหนดเอง","propertyPanel.k301":"ความกว้างกระดาษ (mm)","propertyPanel.k302":"ขนาดกำหนดเอง (mm)","propertyPanel.k303":"แนวกระดาษ","propertyPanel.k304":"แนวตั้ง","propertyPanel.k305":"แนวนอน","propertyPanel.k306":"การสลับจะเปลี่ยนความกว้าง/สูงของกระดาษ (เนื้อหาจัดวางบนขนาดใหม่)","propertyPanel.k307":"การหมุนเนื้อหา","propertyPanel.k308":"สำหรับการจัดเรียงชิ้น ฉลากแต่ละชิ้นหมุนตามมนี้; ที่ 90°/270° ความกว้าง/สูงของเซลล์สลับและคอลัมน์เติมตามขีดใหม่; 0° หมายถึงไม่หมุน (ค่าเริ่มต้น)","propertyPanel.k309":"ทั้งหน้าหมุนสำหรับการพิมพ์; ที่ 90°/270° ความกว้าง/สูงของกระดาษสลับเพื่อพอดีโดยไม่บิดเบือนหรือตัด; 0° หมายถึงไม่หมุน (ค่าเริ่มต้น)","propertyPanel.k310":"สีพื้นหลังหน้ากระดาษ","propertyPanel.k311":"สีพื้นหลังหน้ากระดาษ","propertyPanel.k312":"ระยะขอบ (mm)","propertyPanel.k313":"บน","propertyPanel.k314":"ล่าง","propertyPanel.k315":"ซ้าย","propertyPanel.k316":"ขวา","propertyPanel.k317":"ความสูงส่วนหัว/ท้าย (mm)","propertyPanel.k318":"ความสูงส่วนหัว","propertyPanel.k319":"ความสูงส่วนท้าย","propertyPanel.k320":"ขยายแผงคุณสมบัติ","propertyPanel.k321":"คุณสมบัติองค์ประกอบ","propertyPanel.k322":"คุณสมบัติหน้ากระดาษ","propertyPanel.k323":"แผงคุณสมบัติ","propertyPanel.k324":"ยุบแผงคุณสมบัติ","propertyPanel.k325":"คุณสมบัติองค์ประกอบ","propertyPanel.k326":"คุณสมบัติหน้ากระดาษ","propertyPanel.k327":"เลือกองค์ประกอบบนพื้นที่ทำงาน","propertyPanel.k328":"คุณสมบัติที่กำหนดเอง","propertySearch.k328":"ค้นหาคุณสมบัติ...","propertySearch.k329":"ค้นหาคุณสมบัติ","tableProps.k330":"ส่วนหัวหลายระดับทำซ้ำทั้งกลุ่ม เมื่อเลือก แถวหัวทั้งหมดจะซ้ำที่ด้านบนของทุกหน้า","tableProps.k331":"แถวหัว","tableProps.k332":"แถวข้อมูล","tableProps.k333":"แถวรวมย่อย (ต่อหน้า)","tableProps.k334":"แถวสรุป","tableProps.k335":"CODE128 (ทั่วไป)","tableProps.k336":"EAN13 (ค้าปลีก)","tableProps.k337":"L (ต่ำสุด ความจุสูงสุด)","tableProps.k338":"M (แนะนำ)","tableProps.k339":"H (สูงสุด)","tableProps.k340":"ตัดทิ้ง","tableProps.k341":"ย่อให้พอดี","tableProps.k342":"ความสูงแถวอัตโนมัติ","tableProps.k343":"เลือกหลายรายการ","tableProps.k344":"คุณสมบัติแถว","tableProps.k345":"คุณสมบัติแถว","tableProps.k346":"ประเภทแถว","tableProps.k347":"ความสูงแถว (mm)","tableProps.k348":"ทำซ้ำส่วนหัวทุกหน้า","tableProps.k349":"การตั้งค่าตาราง","tableProps.k350":"ฟิลด์แหล่งข้อมูลรายการ","tableProps.k351":"ฟอนต์เริ่มต้น","tableProps.k352":"ค่าเริ่มต้น","tableProps.k353":"ขนาดฟอนต์เริ่มต้น (pt)","tableProps.k354":"ค่าเริ่มต้น","tableProps.k355":"สีข้อความเริ่มต้น","tableProps.k356":"สีข้อความเริ่มต้น","tableProps.k357":"ระยะภายในเริ่มต้น (mm)","tableProps.k358":"ค่าเริ่มต้น","tableProps.k359":"ความกว้างคอลัมน์ (mm)","tableProps.k360":"คอลัมน์ {v0}","tableProps.k361":"ความกว้างตารางไม่เกินความกว้างที่พิมพ์ได้ {v0}mm; คอลัมน์ {v1} ปรับเป็น {v2}mm","tableProps.k362":"เปิดใช้งานการแบ่งหน้า","tableProps.k363":"เข้าร่วมการแบ่งหน้า","tableProps.k364":"หน้าเดียวกับองค์ประกอบถัดไป","tableProps.k365":"การตั้งค่าการแบ่งหน้า","tableProps.k366":"บน","tableProps.k367":"ขวา","tableProps.k368":"ล่าง","tableProps.k369":"ซ้าย","tableProps.k370":"เซลล์","tableProps.k371":"เซลล์","tableProps.k372":"เลือกหลายรายการ","tableProps.k373":"เฉพาะแถวข้อมูลที่รองรับการรวมตามค่า","tableProps.k374":"คืนค่าเริ่มต้น (ตามค่าตาราง)","tableProps.k375":"เซลล์","tableProps.k376":"เลือก {v0} เซลล์ · ตั้งค่าเป็นชุด: ไม่แสดงรายเซลล์ การเปลี่ยนใช้กับเซลล์ที่เลือกทั้งหมด","tableProps.k377":"ประเภทเซลล์","tableProps.k378":"ข้อความ","tableProps.k379":"บาร์โค้ด","tableProps.k380":"คิวอาร์โค้ด","tableProps.k381":"รูปภาพ","tableProps.k382":"ประเภทรหัส","tableProps.k383":"แสดงข้อความ","tableProps.k384":"ความกว้างแท่น (อัตราส่วน)","tableProps.k385":"ตั้งค่า DPI ของเครื่องพิมพ์แล้ว: ความกว้างแท่นปรับเป็นจุดเต็ม (DPI แทนค่า mm) จะย่อขนาดถ้าเซลล์ไม่พอดี","tableProps.k386":"ใช้ 3+ สำหรับเครื่องพิมพ์ความร้อน/ดอทเมทริกซ์: กำหนดขนาดแท่นที่พิมพ์ แท่นหนาจะเสถียรกว่า","tableProps.k387":"โซนเงียบ (โมดูล)","tableProps.k388":"ค่าเริ่มต้น 10","tableProps.k389":"ความสูงแท่น (mm)","tableProps.k390":"ค่าเริ่มต้น 30 โมดูล","tableProps.k391":"ขนาดข้อความ (เทียบความสูงแท่น 30)","tableProps.k392":"ค่าเริ่มต้น 10","tableProps.k393":"DPI ของเครื่องพิมพ์","tableProps.k394":"ไม่ระบุ (แสดงตามความกว้างแท่น)","tableProps.k395":"203 dpi (8 จุด/mm)","tableProps.k396":"300 dpi (11.8 จุด/mm)","tableProps.k397":"600 dpi (23.6 จุด/mm)","tableProps.k398":"เมื่อตั้งค่า ความกว้างแท่นจะปรับเป็นจุดพิมพ์เต็ม: บาร์โค้ดแสดงตามความกว้างแท่น ถ้าพอดีจะพิมพ์ตามนั้น มิเช่นนั้นจะย่อขนาดตามสัดส่วน","tableProps.k399":"การแก้ไขข้อผิดพลาด","tableProps.k400":"โซนเงียบ (โมดูล)","tableProps.k401":"ค่าเริ่มต้น 0","tableProps.k402":"ขนาดบาร์โค้ดของเซลล์ขึ้นกับความกว้างแท่นและ DPI ของเครื่องพิมพ์: พิมพ์ตามความกว้างแท่นถ้าพอดี มิเช่นนั้นย่อขนาด; ไม่มีโหมดปรับขนาด (จะทำให้แท่นไม่เป็นจำนวนเต็ม)—ใช้ความกว้าง/สูงสูงสุดเป็นขีดจำกัด หากต้องการให้ใหญ่ขึ้น: เพิ่มความกว้างแท่น ลดโซนเงียบ หรือซ่อนข้อความ","tableProps.k403":"โหมดการปรับขนาด","tableProps.k404":"จุดยึดการครอป","tableProps.k405":"ความกว้างสูงสุด (mm)","tableProps.k406":"ค่าเริ่มต้น","tableProps.k407":"ความสูงสูงสุด (mm)","tableProps.k408":"ค่าเริ่มต้น","tableProps.k409":"เนื้อหา","tableProps.k410":"เลือกหลายรายการ (รายการที่ป้อนจะแทนที่เซลล์ที่เลือกทั้งหมด)","tableProps.k411":"ป้อนเนื้อหา รองรับนิพจน์ {field}","tableProps.k412":"จัดแนวนอน","tableProps.k413":"ซ้าย","tableProps.k414":"กลาง","tableProps.k415":"ขวา","tableProps.k416":"ชิดสองด้าน","tableProps.k417":"จัดแนวตั้ง","tableProps.k418":"บน","tableProps.k419":"กลาง","tableProps.k420":"ล่าง","tableProps.k421":"ฟอนต์","tableProps.k422":"สืบทอดค่าเริ่มต้น","tableProps.k423":"ขนาดฟอนต์ (pt)","tableProps.k424":"ค่าเริ่มต้น","tableProps.k425":"หนา","tableProps.k426":"สีข้อความ","tableProps.k427":"สีข้อความ","tableProps.k428":"สีพื้นหลัง","tableProps.k429":"สีพื้นหลัง","tableProps.k430":"เส้นขอบ","tableProps.k431":"ผสม","tableProps.k432":"เลือกหลายรายการ","tableProps.k433":"ผสม","tableProps.k434":"สีเส้นขอบ","tableProps.k435":"ทั้งหมด","tableProps.k436":"ด้านนอก","tableProps.k437":"ด้านใน","tableProps.k438":"ไม่มี","tableProps.k439":"ระยะภายใน (mm)","tableProps.k440":"ค่าเริ่มต้น","tableProps.k441":"ตัดคำอัตโนมัติ","tableProps.k442":"ข้อความล้น","tableProps.k443":"ขนาดฟอนต์ขั้นต่ำ (pt)","tableProps.k444":"ค่าเริ่มต้น 6","tableProps.k445":"รวมเซลล์","tableProps.k446":"รวมเซลล์","tableProps.k447":"แยกเซลล์","tableProps.k448":"รวมตามค่า","tableProps.k449":"แถวข้อมูลที่อยู่ติดกันที่มีค่าเท่ากันจะรวมแนวตั้ง; ข้ามหน้าจะแบ่งตามหน้าและทำซ้ำค่าในหน้าต่อเนื่อง","table.k450":"หัว","table.k451":"ข้อมูล","table.k452":"ย่อย","table.k453":"รวม","table.k454":"แถวหัว","table.k455":"แถวข้อมูล","table.k456":"แถวรวมย่อย","table.k457":"แถวสรุป","table.k458":"บาร์โค้ด","table.k459":"รูปภาพ","table.k460":"หลังแทรก ความกว้างตาราง {v0}mm เกินความกว้างที่พิมพ์ได้ {v1}mm; ลดความกว้างคอลัมน์ก่อน","table.k461":"ประเภทแถวไม่ระบุ","table.k462":"ไม่มีเซลล์ที่เลือก","table.k463":"เฉพาะแถวข้อมูลที่รองรับการรวมตามค่า","table.k464":"ไม่มีเซลล์ที่เลือก","table.k465":"ประเภทแถวรองรับการตั้งค่าแถวเดียวเท่านั้น","table.k466":"ไม่มีเซลล์ที่เลือก","table.k467":"แทรกแถวด้านบน","table.k468":"แทรกแถวด้านล่าง","table.k469":"ลบแถว","table.k470":"แทรกคอลัมน์ด้านซ้าย","table.k471":"แทรกคอลัมน์ด้านขวา","table.k472":"ลบคอลัมน์","table.k473":"รวมเซลล์","table.k474":"แยกเซลล์","table.k475":"รวมตามค่า","table.k476":"ประเภทแถว","table.k477":"ตัวจับปรับความกว้างคอลัมน์ {v0}","toolbarOverflow.k478":"คลิปบอร์ด","toolbarOverflow.k479":"เครื่องมือถ่ายรูปแบบ","toolbarOverflow.k480":"ซูม","toolbarOverflow.k481":"จัดระเบียบ / มุมมอง","toolbarOverflow.k482":"เส้นขอบ","toolbarOverflow.k483":"สี","toolbarOverflow.k484":"การจัดตำแหน่ง","toolbarOverflow.k485":"รูปแบบข้อความ","toolbarOverflow.k486":"ฟอนต์และขนาด","toolbarOverflow.k487":"เพิ่มเติม","toolbarOverflow.k488":'{v0}<span class="tb-btn-text">เพิ่มเติม</span>{v1}',"toolbar.k489":"แก้ไขเทมเพลต","toolbar.k490":"เทมเพลตใหม่","toolbar.k491":"จัดตำแหน่ง / กระจาย","toolbar.k492":"จัดชิดซ้าย","toolbar.k493":"จัดชิดขวา","toolbar.k494":"จัดชิดบน","toolbar.k495":"จัดชิดล่าง","toolbar.k496":"จัดกึ่งกลาง","toolbar.k497":"จัดกึ่งกลางแนวตั้ง","toolbar.k498":"กระจายแนวนอน","toolbar.k499":"กระจายแนวตั้ง","toolbar.k500":"ลำดับชั้น","toolbar.k501":"นำไปด้านหน้าสุด","toolbar.k502":"เลื่อนไปข้างหน้า","toolbar.k503":"เลื่อนไปข้างหลัง","toolbar.k504":"ส่งไปด้านหลังสุด","toolbar.k505":"จัดกลุ่ม","toolbar.k506":"จัดกลุ่ม (Ctrl+G)","toolbar.k507":"ยกเลิกจัดกลุ่ม (Ctrl+Shift+G)","toolbar.k508":"ไม้บรรทัด","toolbar.k509":"แสดง/ซ่อนไม้บรรทัด","toolbar.k510":"ตารางนำทาง","toolbar.k511":"แสดง/ซ่อนพื้นหลังตารางนำทาง","toolbar.k512":"กรอบประ","toolbar.k513":"แสดง/ซ่อนแนวประสำหรับตารางไร้เส้นขอบ","toolbar.k514":"ดูดติด","toolbar.k515":"สลับการดูดองค์ประกอบเข้าตารางนำทาง","toolbar.k516":"ตัวออกแบบเทมเพลตการพิมพ์","toolbar.k517":"เลิกทำ","toolbar.k518":"ทำซ้ำ","toolbar.k519":"จัดระเบียบ","toolbar.k520":"จัดระเบียบ","toolbar.k521":"มุมมอง","toolbar.k522":"มุมมอง","toolbar.k523":"พอดีกับหน้าต่าง","toolbar.k524":"ซูมออก","toolbar.k525":"ซูมเข้า","toolbar.k526":"คัดลอก (Ctrl+C) เลือกองค์ประกอบก่อน","toolbar.k527":"คัดลอก (Ctrl+C)","toolbar.k528":"วาง (Ctrl+V) เลือกองค์ประกอบก่อน","toolbar.k529":"วาง (Ctrl+V) คลิปบอร์ดว่าง","toolbar.k530":"วาง (Ctrl+V)","toolbar.k531":"ลบ (Delete) เลือกองค์ประกอบก่อน","toolbar.k532":"ลบ (Delete)","toolbar.k533":"ช่วยเหลือ","toolbar.k534":"ดูตัวอย่างผลการพิมพ์","toolbar.k535":"ตัวอย่าง","toolbar.k536":"บันทึกเทมเพลต","toolbar.k537":"บันทึก","watermark.k538":"ลายน้ำ","watermark.k539":"นิพจน์ลายน้ำ","watermark.k540":"ป้อนข้อความได้เลย หรือนิพจน์: {order.no}, {printDate}","watermark.k541":'ดับเบิลคลิกหรือคลิก "แก้ไขนิพจน์" เพื่อเปิดตัวแก้ไขนิพจน์',"watermark.k542":"แก้ไขนิพจน์","watermark.k543":"ค่าทดสอบ","watermark.k544":"แสดงในตัวอย่างเมื่อนิพจน์ไม่มีค่า","watermark.k545":"มุมหมุน","watermark.k546":"สี","watermark.k547":"สีลายน้ำ","watermark.k548":"ความโปร่งใส","watermark.k549":"ความหนาแน่น","watermark.k550":"กำหนดเอง","watermark.k551":"ความกว้างชิ้น","watermark.k552":"ความสูงชิ้น","elementDefinitions.k553":"ข้อความ","elementDefinitions.k554":"บาร์โค้ด","elementDefinitions.k555":"คิวอาร์โค้ด","elementDefinitions.k556":"รูปภาพ","elementDefinitions.k557":"ตาราง","elementDefinitions.k558":"ข้อความยาว","elementDefinitions.k559":"รายการแบบไหล","elementDefinitions.k560":"เส้นแนวนอน","elementDefinitions.k561":"เส้นแนวตั้ง","elementDefinitions.k562":"สี่เหลี่ยมผืนผ้า","elementDefinitions.k563":"วงรี","elementDefinitions.k564":"หมายเลขหน้า","elementDefinitions.k565":"registerElementDefinition: type ต้องเป็นสตริงที่ไม่ว่างเปล่า","elementDefinitions.k566":"registerElementDefinition: label ต้องเป็นสตริงที่ไม่ว่างเปล่า","elementDefinitions.k567":"registerElementRenderer: ต้องการ type และฟังก์ชัน render","panels.paperRotated":" (หมุน {rot}°)","panels.statusElements":"{count} องค์ประกอบ{selected}","panels.statusSelected":" (เลือก {n})"},...{"expression.tabField":"ฟิลด์","expression.tabVariable":"ตัวแปร","expression.tabFunction":"ฟังก์ชัน","expression.placeholderField":"ค้นหาฟิลด์...","expression.placeholderVariable":"ค้นหาตัวแปร...","expression.placeholderFunction":"ค้นหาฟังก์ชัน...","expression.fnSum":"ผลรวม","expression.fnAvg":"ค่าเฉลี่ย","expression.fnCount":"จำนวน","expression.fnMin":"ค่าต่ำสุด","expression.fnMax":"ค่าสูงสุด","expression.fnAdd":"บวก","expression.fnSub":"ลบ","expression.fnMul":"คูณ","expression.fnDiv":"หาร","expression.fnRound":"ปัดเศษ","expression.fnRoundUp":"ปัดขึ้น","expression.fnRoundDown":"ปัดลง","expression.fnRoundBank":"ปัดเศษแบบธนาคาร","expression.fnMoney":"จัดรูปแบบจำนวนเงิน","expression.fnDate":"จัดรูปแบบวันที่","expression.fnUpper":"จำนวนเงินเป็นตัวอักษร","expression.fnIf":"เงื่อนไข","expression.varPageIndex":"หน้าปัจจุบัน","expression.varTotalPages":"จำนวนหน้าทั้งหมด","expression.varPrintDate":"วันที่พิมพ์","expression.varPrintTime":"เวลาพิมพ์","expression.groupAggregate":"ฟังก์ชันรวมค่า","expression.groupMath":"คณิตศาสตร์","expression.groupFormat":"การจัดรูปแบบ","expression.previewEmpty":"(ดูตัวอย่างหลังป้อนนิพจน์)","expression.previewNoValue":"(ไม่สามารถคำนวณได้)","expression.previewError":"(นิพจน์ผิดพลาด)","expression.k1":"ประเภท","expression.k2":"วิธีป้อน","expression.k3":"ดับเบิลคลิกฟิลด์ ตัวแปร หรือฟังก์ชันทางด้านซ้ายเพื่อแทรก","expression.k4":"ค้าง Ctrl (⌘ บน Mac) ขณะดับเบิลคลิกเพื่อแทรกชื่อฟิลด์เป็นข้อความคงที่","expression.k5":"ป้อนข้อความคงที่ได้เลย เช่น ชื่อผู้จัดจำหน่าย","expression.k6":"ฟิลด์ ตัวแปร และฟังก์ชันแบบไดนามิกต้องอยู่ใน {}","expression.k7":"ตัวอย่าง: {SUM(supplier.name)}","expression.k8":"ป้อนคีย์ภาษาไทยได้โดยตรงเป็น {field} เช่น {name}","expression.k9":"หมายเหตุ: ซ้อนได้เพียงหนึ่งระดับ","expression.k10":"ฟังก์ชัน","expression.k11":"SUM(field) - ผลรวม","expression.k12":"AVG(field) - ค่าเฉลี่ย","expression.k13":"COUNT(field) - จำนวน","expression.k14":"IF(cond, true, false) - เงื่อนไข","expression.k15":"เลขคณิต: {qty * price}, {ADD(qty, 1)}","expression.k16":"การปัดเศษ: ROUND ปัดครึ่งขึ้น / ROUNDUP ปัดขึ้น / ROUNDDOWN ปัดลง / ROUNDBANK แบบธนาคาร","expression.k17":"ตัวแปรระบบ","expression.k18":"{pageIndex} - หน้าปัจจุบัน","expression.k19":"{totalPages} - จำนวนหน้าทั้งหมด","expression.k20":"{printDate} - วันที่พิมพ์","expression.k21":"ตัวอย่าง","expression.k22":"ข้อความคงที่: ชื่อผู้จัดจำหน่าย","expression.k23":"ฟิลด์ไดนามิก: {supplier.name}","expression.k24":"เรียกใช้ฟังก์ชัน: {SUM(amount)}","expression.k25":'เงื่อนไข: {IF(amount>1000, "ใหญ่", "เล็ก")}',"expression.k26":"เลขคณิตและปัดเศษ: {ROUND(qty * price, 2)}","expression.k27":"ไม่มีฟิลด์","expression.k28":"คัดลอกแล้ว","expression.k29":"ประเภท","expression.k30":"ข้อมูลช่วยเหลือ","expression.k31":"วิธีป้อน","expression.k32":"ผลตัวอย่าง","expression.k33":"แก้ไขนิพจน์","expression.k34":"ปิด","expression.k35":"ยกเลิก","expression.k36":"ยืนยัน"}},sb={constants:{"constants.borderStyle.none":"无","constants.borderStyle.solid":"实线","constants.borderStyle.dashed":"虚线","constants.borderStyle.dotted":"点线","constants.borderStyle.double":"双线","constants.paper.A4.label":"A4 210×297mm","constants.paper.A3.label":"A3 297×420mm","constants.paper.A5.label":"A5 148×210mm","constants.paper.Letter.label":"Letter 216×279mm","constants.paper.Legal.label":"Legal 216×356mm","constants.paper.DOT_FULL.label":"全等分 241×279.4mm","constants.paper.DOT_HALF.label":"二等分 241×139.7mm","constants.paper.DOT_THIRD.label":"三等分 241×93.1mm","constants.paper.LABEL_80X60.label":"80×60mm","constants.paper.LABEL_60X40.label":"60×40mm","constants.paper.LABEL_40X30.label":"40×30mm","constants.paper.THERMAL_57.label":"57mm","constants.paper.THERMAL_80.label":"80mm","constants.paper.THERMAL_110.label":"110mm","constants.paper.CONTINUOUS.label":"连续纸(自定义宽度)","constants.paper.group.common":"常用纸张","constants.paper.group.dotMatrix":"针式打印纸","constants.paper.group.labels":"标签纸","constants.paper.group.receipt":"小票纸","constants.paper.group.continuous":"连续纸","constants.watermark.density.dense":"密","constants.watermark.density.medium":"中(默认)","constants.watermark.density.loose":"疏","constants.watermark.density.size":"({w}×{h})","constants.label.content":"内容","constants.hint.border.apply":"线型 / 宽度 / 颜色即时生效,这三行显示的就是当前生效规格:已有边框时任改一行都会按新规格铺满四边并清掉单边覆盖;上、下、左、右只给选中的边加框,撤掉一边会把它其余三边落成单边;「无」清除边框,「内部」仅表格单元格可用","constants.hint.border.pending":"线型 / 宽度 / 颜色是待应用规格:选中格已有的边框规格一致时会填进这三行;四边不一致的项显示「混合」,一条边都没有时显示「无 / 0」。改完点「全部 / 外侧 / 内部」或勾选上、下、左、右某条边才会写入选中的单元格;「无」是清除边框","constants.hint.border.multi":"多选时不回显单格边框:线型 / 宽度 / 颜色按当前设置作为批写规格,点「全部 / 外侧 / 内部」或勾选某条边后写入所有选中格;「无」是清除边框","constants.hint.border.mixed":"当前单元格四边边框规格不一致:带「混合」的项不谎报,未改项在点「全部 / 外侧 / 内部」或勾选单边时按缺省档(实线 0.75pt)写入,改任一项即按该值批写"}},lb={constants:{"constants.borderStyle.none":"None","constants.borderStyle.solid":"Solid","constants.borderStyle.dashed":"Dashed","constants.borderStyle.dotted":"Dotted","constants.borderStyle.double":"Double","constants.paper.A4.label":"A4 210×297mm","constants.paper.A3.label":"A3 297×420mm","constants.paper.A5.label":"A5 148×210mm","constants.paper.Letter.label":"Letter 216×279mm","constants.paper.Legal.label":"Legal 216×356mm","constants.paper.DOT_FULL.label":"Full sheet 241×279.4mm","constants.paper.DOT_HALF.label":"Half sheet 241×139.7mm","constants.paper.DOT_THIRD.label":"Third sheet 241×93.1mm","constants.paper.LABEL_80X60.label":"80×60mm","constants.paper.LABEL_60X40.label":"60×40mm","constants.paper.LABEL_40X30.label":"40×30mm","constants.paper.THERMAL_57.label":"57mm","constants.paper.THERMAL_80.label":"80mm","constants.paper.THERMAL_110.label":"110mm","constants.paper.CONTINUOUS.label":"Continuous paper (custom width)","constants.paper.group.common":"Common","constants.paper.group.dotMatrix":"Dot-matrix","constants.paper.group.labels":"Labels","constants.paper.group.receipt":"Receipt","constants.paper.group.continuous":"Continuous","constants.watermark.density.dense":"Dense","constants.watermark.density.medium":"Medium (default)","constants.watermark.density.loose":"Sparse","constants.watermark.density.size":" ({w}×{h})","constants.label.content":"Content","constants.hint.border.apply":'Line style / width / color apply immediately; these three rows show the effective spec. With an existing border, changing any row fills all four sides and clears per-side overrides. Top / right / bottom / left add a border only to the selected side; removing one turns the other three into per-side borders. "None" clears the border; "Inside" is available for table cells only.',"constants.hint.border.pending":'Line style / width / color are a pending spec: they are prefilled when the selected cells share one border spec. Mixed values show "Mixed"; no border shows "None / 0". Click All / Outside / Inside or tick a side (top / right / bottom / left) to write to the selected cells; "None" clears the border.',"constants.hint.border.multi":'Multi-select does not show a single cell border: line style / width / color act as a batch spec. Click All / Outside / Inside or tick a side to apply to all selected cells; "None" clears the border.',"constants.hint.border.mixed":'The four sides of this cell have different border specs: "Mixed" is shown instead of a false value. Untouched fields fall back to the default (Solid 0.75pt) when you click All / Outside / Inside or tick a side; changing any field writes that value to the batch.'}},pb={constants:{"constants.borderStyle.none":"ไม่มี","constants.borderStyle.solid":"เส้นทึบ","constants.borderStyle.dashed":"เส้นประ","constants.borderStyle.dotted":"เส้นจุด","constants.borderStyle.double":"เส้นคู่","constants.paper.A4.label":"A4 210×297mm","constants.paper.A3.label":"A3 297×420mm","constants.paper.A5.label":"A5 148×210mm","constants.paper.Letter.label":"Letter 216×279mm","constants.paper.Legal.label":"Legal 216×356mm","constants.paper.DOT_FULL.label":"แผ่นเต็ม 241×279.4mm","constants.paper.DOT_HALF.label":"แผ่นครึ่ง 241×139.7mm","constants.paper.DOT_THIRD.label":"แผ่นหนึ่งในสาม 241×93.1mm","constants.paper.LABEL_80X60.label":"80×60mm","constants.paper.LABEL_60X40.label":"60×40mm","constants.paper.LABEL_40X30.label":"40×30mm","constants.paper.THERMAL_57.label":"57mm","constants.paper.THERMAL_80.label":"80mm","constants.paper.THERMAL_110.label":"110mm","constants.paper.CONTINUOUS.label":"กระดาษต่อเนื่อง (ความกว้างกำหนดเอง)","constants.paper.group.common":"กระดาษทั่วไป","constants.paper.group.dotMatrix":"กระดาษดอทเมทริกซ์","constants.paper.group.labels":"ฉลาก","constants.paper.group.receipt":"ใบเสร็จ","constants.paper.group.continuous":"กระดาษต่อเนื่อง","constants.watermark.density.dense":"หนาแน่น","constants.watermark.density.medium":"กลาง (ค่าเริ่มต้น)","constants.watermark.density.loose":"ห่าง","constants.watermark.density.size":" ({w}×{h})","constants.label.content":"เนื้อหา","constants.hint.border.apply":'รูปแบบเส้น/ความกว้าง/สีมีผลทันที สามบรรทัดนี้แสดงผลที่มีผลอยู่: เมื่อมีเส้นขอบอยู่แล้ว การเปลี่ยนแถวใดจะเติมสี่ด้านและลบการเขียนทับรายด้าน; บน/ขวา/ล่าง/ซ้ายเพิ่มเส้นเฉพาะด้านที่เลือก การลบด้านหนึ่งจะทำให้สามด้านที่เหลือเป็นเส้นแยก; "ไม่มี" ลบเส้นขอบ "ด้านใน" ใช้สำหรับเซลล์ตารางเท่านั้น',"constants.hint.border.pending":'รูปแบบเส้น/ความกว้าง/สีเป็นค่าที่รอใช้งาน: จะเติมในสามบรรทัดนี้เมื่อเซลล์ที่เลือกมีเส้นขอบสอดคล้องกัน; ค่าที่ไม่ตรงกันแสดง "ผสม" ไม่มีเส้นแสดง "ไม่มี / 0" แก้แล้วคลิก ทั้งหมด/ด้านนอก/ด้านใน หรือทำเครื่องหมายด้านใดด้านหนึ่งจึงเขียนลงเซลล์ที่เลือก; "ไม่มี" ลบเส้นขอบ',"constants.hint.border.multi":'การเลือกหลายรายการไม่แสดงเส้นขอบของเซลล์เดี่ยว: รูปแบบเส้น/ความกว้าง/สีเป็นค่าเขียนเป็นชุด คลิก ทั้งหมด/ด้านนอก/ด้านใน หรือทำเครื่องหมายด้านใดด้านหนึ่งเพื่อเขียนทุกเซลล์ที่เลือก; "ไม่มี" ลบเส้นขอบ',"constants.hint.border.mixed":'เส้นขอบสี่ด้านของเซลล์นี้ไม่สอดคล้องกัน: รายการ "ผสม" ไม่รายงานค่าผิด; รายการที่ไม่เปลี่ยนใช้ค่าเริ่มต้น (เส้นทึบ 0.75pt) เมื่อคลิก ทั้งหมด/ด้านนอก/ด้านใน หรือทำเครื่องหมายด้านเดียว; เปลี่ยนรายการใดจะเขียนค่านั้นเป็นชุด'}},db={propertyTips:{"propertyTips.ap-long-text-indent":"长文本每段首行空出的宽度,单位「字符」:填 2 即缩进两个汉字宽(中文排版惯例),按 em 落纸——字号被「自动缩小」压小时缩进同步变窄。仅长文本元素生效,写在普通文本上不生效","propertyTips.ap-img-fit":"图片在元素框内的缩放方式:包含=完整显示、可能留白;剪裁=铺满框并按「裁剪锚点」取一块;拉伸=填满框会变形;原始尺寸与缩小不放大。画布与三条出纸链路同一口径(缺省包含)","propertyTips.ap-img-object-position":"取位(仅「剪裁」档有这一行):剪裁把图等比铺满元素框,多出来的那一条边按这里选的位置取舍。先选位置档(贴边/居中/贴另一头),再按百分比微调,0 贴左/贴顶,100 挪到另一头,水平与垂直各自独立;缺省取正中间(保住证件照头顶就选顶部)。其余缩放模式图比框小或刚好铺满,没有可裁的边,所以不出本行","propertyTips.ap-img-fit-scale":"剪裁放大:等比铺满之后把画面再推大这么多,两轴才真的各多出一条边可裁——图与框同比例时不放大就什么都裁不掉。100=不放大(缺省),上限 400;超出框的部分由元素框裁掉。锚点选中的那一点既是取位的钉住点、也是放大的中心,两者共用同一个值。仅「剪裁」档生效,其余缩放模式不出本行","propertyTips.ap-rotate":"元素绕自身中心旋转的角度(度,0~359):出纸时按旋转后外接盒分页与结算,底部放不下自动移页,超出纸面左右缘或顶部会被裁切并给出纸提示。表格、流式列表与表格下方跟随区的元素不支持旋转(这三类不出本行);条码与二维码的任意角度需 385dpi 以上打印头,低分辨率打印机只按 90° 步进出纸","propertyTips.fl-columns":"一行排几个单元,必须由你指定——不随内容自动算列数。填的列数乘单元宽放不下元素框时只给提示、不改你的数,出纸按你填的排","propertyTips.fl-row-height":"每个单元行的最低高度(毫米),与表格行高同一口径:内容比它高时这一行会撑高,不会裁字","propertyTips.fl-gap-x":"相邻单元之间的横向留白(毫米);纵向不留缝,行与行的距离由行高承担","propertyTips.fl-auto-span":"单元内容比一列还宽时,让它占掉两个或更多列位;当前行剩不够放就把整个单元挪到下一行行首(绝不把词切两半)。默认关——开着时出纸栏数由字号与框宽决定","propertyTips.fl-max-span":"跨列的列数上限,最大只能等于「每行列数」:把每行列数改小时,这里会被一并顶回去","propertyTips.fl-layout-mode":"容器高度由谁决定:固定高度=维持设计高度、一框一页,超高裁切(存量模板默认值,输出不变);动态分页=容器高度由内容撑开,内容满页后按行续页,每一页都画完整边框,元素下方的跟随区与表格同一套规则","propertyTips.fl-padding-top":"动态分页模式下容器顶部与第一行内容之间的留白(毫米),仅动态模式生效;每页切片都按它留白并计入分页预算,负值与非法值按 0 处理","propertyTips.fl-padding-right":"动态分页模式下容器右侧与内容之间的留白(毫米),会压缩参与列宽估算的内容宽度,仅动态模式生效","propertyTips.fl-padding-bottom":"动态分页模式下容器底部与最后一行内容之间的留白(毫米),每页切片都按它留白并计入分页预算,仅动态模式生效","propertyTips.fl-padding-left":"动态分页模式下容器左侧与内容之间的留白(毫米),会压缩参与列宽估算的内容宽度,仅动态模式生效","propertyTips.cd-bar-quiet-zone":"条形码左右两端的空白格数(1 格 = 1 条宽):缺省 10,正是一维码码制要求的下限;数值越小白边越窄、同样的框内条越粗(可放大)。填 0 即不留白边,但静区参与「条→空→条」跳变,紧邻文字或表格线时可能扫不出,需实打验证","propertyTips.cd-bar-height":"黑白条本体的目标高度(mm,不含下方文字):折算粒度就是每模块物理宽,所以只能精确到它的整数倍。条宽优先——可用框高装不下时期望条高让位,绝不把条宽挤窄(热敏出纸清晰度靠条宽)。与「最大高度」分工不同:那条限的是整图(含文字)的上限","propertyTips.cd-quiet-zone":"二维码四周留出的空白格数:0 即不留白边、码面等比铺满元素框(此时靠框外的白纸充当静区);数值越大白边越宽、码面在框内越小(缺省 0,需 ISO/IEC 18004 推荐静区时填 4)"}},cb={propertyTips:{"propertyTips.ap-long-text-indent":'First-line indent for each paragraph of a long-text element, in characters: 2 means two Chinese characters wide (a common CJK convention), laid out in em units — it scales down when "Auto shrink" reduces the font size. Applies to long-text elements only; setting it on plain text has no effect.',"propertyTips.ap-img-fit":"How the image is scaled inside the element box. Contain: show the whole image, possibly with blank space. Crop: fill the box and take a region based on the crop anchor. Stretch: fill the box and distort. Original size / Shrink: never enlarge. The canvas and all three print pipelines use the same rule (Contain by default).","propertyTips.ap-img-object-position":"Crop anchor (only shown for Crop mode): cropping scales the image to fill the box, and this picks which extra edge to keep. Choose a position preset (edge / center / opposite edge), then fine-tune with the percentage: 0 aligns left/top, 100 aligns to the other end; horizontal and vertical are independent. The default is centered (choose Top to keep the head in ID photos). Other fit modes have no crop edge, so this row is hidden.","propertyTips.ap-img-fit-scale":"Crop zoom: after filling the box, enlarge the image by this much so both axes gain a crop margin — when image and box have the same aspect ratio, no zoom means nothing can be cropped. 100 = no zoom (default), maximum 400; anything outside the box is clipped by the element frame. The chosen anchor is both the pinning point and the zoom center. Shown for Crop mode only.","propertyTips.ap-rotate":"Rotation of the element about its own center, in degrees (0–359). During printing, pagination and layout use the rotated bounding box: content that does not fit at the bottom moves to the next page, and content beyond the left/right/top paper edges is clipped with a print warning. Tables, flow lists and elements in the follow-up zone below a table do not support rotation (this row is hidden for them); arbitrary angles for barcodes and QR codes require a 385dpi+ print head — lower-resolution printers only output in 90° steps.","propertyTips.fl-columns":"The number of cells per row must be specified by you — it is never inferred from content. If the column count times the cell width does not fit the element box, you get a hint but your value is not changed, and print output follows what you entered.","propertyTips.fl-row-height":"Minimum height of each cell row, in millimetres, using the same rule as table row height: a row grows when its content is taller, and text is never clipped.","propertyTips.fl-gap-x":"Horizontal whitespace between adjacent cells, in millimetres. No vertical gap is inserted; the distance between rows comes from the row height.","propertyTips.fl-auto-span":"When a cell is wider than one column, let it span two or more columns; if the current row has too few columns left, move the whole cell to the start of the next row (never split a word). Off by default — when on, the printed column count depends on font size and box width.","propertyTips.fl-max-span":'Upper limit for column spanning; it can never exceed "Columns per row". Lowering the column count also pushes this value down.',"propertyTips.fl-layout-mode":"What decides the container height. Fixed height: keep the designed height, one box per page, clip overflow (the default for existing templates, output unchanged). Dynamic pagination: the container grows with its content, continues row by row after a page fills, draws a complete border on every page, and follows the same rules as tables for the follow-up zone below the element.","propertyTips.fl-padding-top":"Whitespace between the top of the container and the first content row in dynamic pagination mode, in millimetres. Only applies in dynamic mode; every page slice uses this padding and counts it in the pagination budget. Negative or invalid values are treated as 0.","propertyTips.fl-padding-right":"Whitespace between the right side of the container and the content in dynamic pagination mode, in millimetres; it reduces the content width available for column-width estimation. Only applies in dynamic mode.","propertyTips.fl-padding-bottom":"Whitespace between the bottom of the container and the last content row in dynamic pagination mode, in millimetres. Only applies in dynamic mode; every page slice uses this padding and counts it in the pagination budget.","propertyTips.fl-padding-left":"Whitespace between the left side of the container and the content in dynamic pagination mode, in millimetres; it reduces the content width available for column-width estimation. Only applies in dynamic mode.","propertyTips.cd-bar-quiet-zone":"Number of blank modules on each side of a barcode (1 module = 1 bar width): the default of 10 is the minimum required by 1D symbologies. Smaller values narrow the quiet zone and make bars thicker in the same box (they can be enlarged). Setting 0 removes the white margin, but the quiet zone participates in bar-space-bar transitions, so codes next to text or table lines may fail to scan — verify with a real print.","propertyTips.cd-bar-height":'Target height of the black bars themselves, in millimetres (excluding the text below). The granularity is the physical width of one module, so only integer multiples are exact. Bar width takes priority: if the available height cannot fit the desired bar height, the height gives way — bars are never narrowed (thermal print clarity depends on bar width). This differs from "Maximum height", which limits the whole image including text.',"propertyTips.cd-quiet-zone":"Number of blank modules around a QR code: 0 means no white margin and the code scales to fill the element box (the surrounding white paper acts as the quiet zone). Larger values widen the margin and make the code smaller in the box. The default is 0; use 4 for the quiet zone recommended by ISO/IEC 18004."}},ub={propertyTips:{"propertyTips.ap-long-text-indent":'ระยะเว้นบรรทัดแรกของแต่ละย่อหน้าในข้อความยาว หน่วยเป็นอักขระ: ใส่ 2 หมายถึงเว้นสองตัวอักษรจีน (ตามธรรมเนียม CJK) คำนวณเป็นหน่วย em — จะย่อตามเมื่อ "ย่ออัตโนมัติ" ลดขนาดฟอนต์ ใช้เฉพาะองค์ประกอบข้อความยาว การตั้งค่าบนข้อความธรรมดาไม่มีผล',"propertyTips.ap-img-fit":"วิธีปรับขนาดรูปภาพภายในกรอบองค์ประกอบ พอดี: แสดงรูปทั้งหมดอาจมีช่องว่าง ครอบ: เติมกรอบแล้วตัดตามจุดยึดการครอป ดึง: เติมกรอบและบิดเบือน ขนาดต้นฉบับ/ย่อ: ไม่ขยาย พื้นที่ทำงานและทั้งสามไปป์ไลน์การพิมพ์ใช้กฎเดียวกัน (ค่าเริ่มต้นพอดี)","propertyTips.ap-img-object-position":"จุดยึดการครอป (แสดงเฉพาะโหมดครอบ): การครอปปรับรูปให้เติมกรอบ ตัวเลือกนี้เลือกขอบส่วนเกินที่ต้องการคงไว้ เลือกระดับตำแหน่ง (ชิดขอบ/กลาง/ชิดอีกด้าน) แล้วปรับด้วยเปอร์เซ็นต์: 0 ชิดซ้าย/บน 100 ชิดขวา/ล่าง แนวนอนและแนวตั้งอิสระต่อกัน ค่าเริ่มต้นอยู่กึ่งกลาง (เลือก บน เพื่อคงศีรษะในรูปบัตรประจำตัว) โหมดอื่นไม่มีขอบให้ครอปจึงซ่อนบรรทัดนี้","propertyTips.ap-img-fit-scale":"ขยายการครอป: หลังเติมกรอบแล้วขยายภาพอีกมากน้อยเพียงนี้ เพื่อให้ทั้งสองแกนมีขอบให้ครอป — เมื่อรูปและกรอบมีอัตราส่วนเท่ากัน การไม่ขยายจะครอปไม่ได้เลย 100 = ไม่ขยาย (ค่าเริ่มต้น) สูงสุด 400 ส่วนที่เกินกรอบถูกตัดโดยกรอบองค์ประกอบ จุดยึดที่เลือกเป็นทั้งจุดตรึงและศูนย์กลางการขยาย แสดงเฉพาะโหมดครอบ","propertyTips.ap-rotate":"มุมหมุนขององค์ประกอบรอบจุดศูนย์กลางตัวเอง เป็นองศา (0–359) ขณะพิมพ์ การแบ่งหน้าและการจัดวางใช้กล่องล้อมรอบที่หมุนแล้ว: เนื้อหาที่ไม่พอด้านล่างย้ายไปหน้าถัดไป และเนื้อหาที่เกินขอบกระดาษซ้าย/ขวา/บนถูกตัดพร้อมคำเตือน ตาราง รายการแบบไหล และองค์ประกอบในโซนตามหลังตารางไม่รองรับการหมุน (ซ่อนบรรทัดนี้); มุมใดๆ ของบาร์โค้ดและคิวอาร์โค้ดต้องการหัวพิมพ์ 385dpi ขึ้นไป — เครื่องพิมพ์ความละเอียดต่ำกว่าส่งออกได้เฉพาะขั้น 90°","propertyTips.fl-columns":"จำนวนเซลล์ต่อแถวต้องระบุเองเสมอ — ไม่คำนวณจากเนื้อหา หากจำนวนคอลัมน์คูณความกว้างเซลล์ไม่พอดีกับกรอบองค์ประกอบจะมีคำแนะนำแต่ค่าไม่เปลี่ยน และผลการพิมพ์เป็นไปตามที่ป้อน","propertyTips.fl-row-height":"ความสูงขั้นต่ำของแถวเซลล์แต่ละแถว เป็นมิลลิเมตร ใช้กฎเดียวกับความสูงแถวตาราง: แถวจะสูงขึ้นเมื่อเนื้อหาสูงกว่า และข้อความไม่ถูกตัด","propertyTips.fl-gap-x":"ช่องว่างแนวนอนระหว่างเซลล์ที่อยู่ติดกัน เป็นมิลลิเมตร ไม่มีการเว้นช่องแนวตั้ง ระยะระหว่างแถวมาจากความสูงแถว","propertyTips.fl-auto-span":"เมื่อเซลล์กว้างกว่าหนึ่งคอลัมน์ ให้ขยายครอบสองคอลัมน์ขึ้นไป; หากแถวปัจจุบันเหลือคอลัมน์ไม่พอ ย้ายเซลล์ทั้งหมดไปขึ้นต้นแถวถัดไป (ไม่ตัดคำ) ปิดอยู่โดยค่าเริ่มต้น — เมื่อเปิด จำนวนคอลัมน์ที่พิมพ์ขึ้นกับขนาดฟอนต์และความกว้างกรอบ","propertyTips.fl-max-span":'ขีดจำกัดบนของการขยายคอลัมน์ ห้ามเกิน "จำนวนคอลัมน์ต่อแถว" การลดจำนวนคอลัมน์จะดันค่านี้ลงด้วย',"propertyTips.fl-layout-mode":"อะไรเป็นตัวกำหนดความสูงของคอนเทนเนอร์ ความสูงคงที่: คงความสูงที่ออกแบบ หนึ่งกรอบต่อหน้า ตัดส่วนเกิน (ค่าเริ่มต้นของเทมเพลตเดิม ผลไม่เปลี่ยน) การแบ่งหน้าแบบไดนามิก: คอนเทนเนอร์ ขยายตามเนื้อหา ดำเนินต่อเป็นแถวหลังหน้าเต็ม วาดเส้นขอบครบทุกหน้า และปฏิบัติตามกฎเดียวกับตารางสำหรับโซนตามหลังองค์ประกอบ","propertyTips.fl-padding-top":"ช่องว่างระหว่างด้านบนของคอนเทนเนอร์กับแถวเนื้อหาแรกในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร ใช้เฉพาะโหมดไดนามิก ทุกชิ้นของหน้าใช้ระยะนี้และนับรวมในงบการแบ่งหน้า ค่าติดลบหรือไม่ถูกต้องถือเป็น 0","propertyTips.fl-padding-right":"ช่องว่างระหว่างด้านขวาของคอนเทนเนอร์กับเนื้อหาในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร จะลดความกว้างเนื้อหาที่ใช้คำนวณความกว้างคอลัมน์ ใช้เฉพาะโหมดไดนามิก","propertyTips.fl-padding-bottom":"ช่องว่างระหว่างด้านล่างของคอนเทนเนอร์กับแถวเนื้อหาสุดท้ายในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร ใช้เฉพาะโหมดไดนามิก ทุกชิ้นของหน้าใช้ระยะนี้และนับรวมในงบการแบ่งหน้า","propertyTips.fl-padding-left":"ช่องว่างระหว่างด้านซ้ายของคอนเทนเนอร์กับเนื้อหาในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร จะลดความกว้างเนื้อหาที่ใช้คำนวณความกว้างคอลัมน์ ใช้เฉพาะโหมดไดนามิก","propertyTips.cd-bar-quiet-zone":"จำนวนโมดูลว่างสองข้างของบาร์โค้ด (1 โมดูล = 1 ความกว้างแท่น): ค่าเริ่มต้น 10 คือค่าต่ำสุดที่รหัสแบบหนึ่งมิติต้องการ ค่าที่เล็กลงทำให้โซนเงียบแคบและแท่นหนาขึ้นในกรอบเดียวกัน (สามารถขยายได้) การตั้ง 0 ลบขอบขาว แต่โซนเงียบมีส่วนในการเปลี่ยนแท่น-ช่อง-แท่น รหัสที่อยู่ติดข้อความหรือเส้นตารางอาจสแกนไม่ได้ — ตรวจด้วยการพิมพ์จริง","propertyTips.cd-bar-height":'ความสูงเป้าหมายของแท่นดำเอง เป็นมิลลิเมตร (ไม่รวมข้อความด้านล่าง) ความละเอียดคือความกว้างทางกายภาพของหนึ่งโมดูล จึงแม่นยำเฉพาะจำนวนเต็มเท่านั้น ความกว้างแท่นมีสิทธิ์ก่อน: หากความสูงที่มีไม่พอตามที่ต้องการ ความสูงจะยอมตาม — ไม่เคยทำให้แท่นแคบลง (ความชัดของการพิมพ์ความร้อนขึ้นกับความกว้างแท่น) ต่างจาก "ความสูงสูงสุด" ที่จำกัดทั้งภาพรวมข้อความ',"propertyTips.cd-quiet-zone":"จำนวนโมดูลว่างรอบคิวอาร์โค้ด: 0 หมายถึงไม่มีขอบขาวและรหัสขยายเติมกรอบ (กระดาษขาวรอบนอกทำหน้าที่โซนเงียบ) ค่าที่ใหญ่ขึ้นทำให้ขอบกว้างและรหัสเล็กลงในกรอบ ค่าเริ่มต้น 0 ใช้ 4 สำหรับโซนเงียบตามที่ ISO/IEC 18004 แนะนำ"}};function Yp(e){if(typeof e!="string")return"zh-CN";const t=e.trim();return t?/^en([-_]|$)/i.test(t)?"en-US":/^th([-_]|$)/i.test(t)?"th-TH":t:"zh-CN"}function Xp(){try{if(typeof navigator<"u"&&typeof navigator.language=="string")return Yp(navigator.language)}catch{}return"zh-CN"}function fb(){const e=Da();return e.init({resources:{"zh-CN":{core:nb,constants:sb.constants,propertyTips:db.propertyTips},"en-US":{core:ib,constants:lb.constants,propertyTips:cb.propertyTips},"th-TH":{core:ab,constants:pb.constants,propertyTips:ub.propertyTips}},lng:Xp(),fallbackLng:"zh-CN",ns:["core"],defaultNS:"core",keySeparator:!1,nsSeparator:!1,interpolation:{prefix:"{",suffix:"}",escapeValue:!1},returnNull:!1,returnEmptyString:!1,saveMissing:!0,missingKeyHandler:()=>{}}),e}const Aa=fb(),hb=new Set,mb=new Set;Aa.on("missingKey",(e,t,r)=>{Aa.exists(r,{lng:"zh-CN"})||hb.add(r)});function Zp(){return Xp()}function er(){return Zp()}function gb(e,t){return typeof e=="string"?e:e==null?t:String(e)}function bb(e,t,r){const o=Aa.getFixedT(Yp(e),kb()),n=r?o(t,r):o(t);return gb(n,t)}function $(e,t){return bb(Zp(),e,t)}function kb(){return["user",...mb,"constants","propertyTips","core"]}function tr(e,t,r){return new Intl.NumberFormat(t,r).format(e)}function yb(){let e=0;return function(){return e+=1,`cell-${Date.now().toString(36)}-${e}`}}function vb(){let e=0;return function(){return e+=1,`row-${Date.now().toString(36)}-${e}`}}const wb=yb(),xb=vb(),rr={width:.75,style:"solid",color:"#333333"};function Oa(e){return JSON.parse(JSON.stringify(e))}function Ra(e){return{id:wb(),borders:{top:{...rr},right:{...rr},bottom:{...rr},left:{...rr}},...e}}function Pb(){const e=[50,50,50],t=(o,n)=>({id:xb(),type:o,height:8,...n!==void 0?{repeatOnPage:n}:{},cells:e.map(()=>Ra())}),r=t("header",!0);return r.cells.forEach((o,n)=>{o.formatter=$("table.defaultHeader",{index:n+1}),o.align="center",o.fontWeight="bold"}),{rows:[r,t("data"),t("subtotal"),t("summary")],colWidths:e}}function Po(e,t,r){if(!e[t].cells[r].merged)return{r:t,c:r};for(let o=t;o>=0;o--)for(let n=r;n>=0;n--){const i=e[o].cells[n];if(i.merged)continue;const a=i.rowspan??1,s=i.colspan??1;if(o+a-1>=t&&n+s-1>=r)return{r:o,c:n}}return{r:t,c:r}}function kr(e,t,r){const o=Po(e,t,r),n=e[o.r].cells[o.c];return{r1:o.r,c1:o.c,r2:o.r+(n.rowspan??1)-1,c2:o.c+(n.colspan??1)-1}}function Jp(e,t,r){let o={r1:Math.min(t.r,r.r),c1:Math.min(t.c,r.c),r2:Math.max(t.r,r.r),c2:Math.max(t.c,r.c)};for(;;){let n=!1;for(let i=o.r1;i<=o.r2;i++)for(let a=o.c1;a<=o.c2;a++){const s=kr(e,i,a),p={r1:Math.min(o.r1,s.r1),c1:Math.min(o.c1,s.c1),r2:Math.max(o.r2,s.r2),c2:Math.max(o.c2,s.c2)};(p.r1!==o.r1||p.c1!==o.c1||p.r2!==o.r2||p.c2!==o.c2)&&(o=p,n=!0)}if(!n)return o}}function Qp(e,t){if((t.r2-t.r1+1)*(t.c2-t.c1+1)<2)return $("table.atLeastTwoCells");const o=new Set;for(let i=t.r1;i<=t.r2;i++)o.add(e[i].type);if(o.size>1)return $("table.crossRowTypes");if(t.r2>t.r1&&o.has("data"))return $("table.dataVerticalMerge");const n=Jp(e,{r:t.r1,c:t.c1},{r:t.r2,c:t.c2});return n.r1!==t.r1||n.c1!==t.c1||n.r2!==t.r2||n.c2!==t.c2?$("table.partialOverlap"):null}function ed(e,t){const r=e[t.r1].cells[t.c1],o=[];for(let n=t.r1;n<=t.r2;n++)for(let i=t.c1;i<=t.c2;i++){const a=e[n].cells[i];a.formatter&&o.push(a.formatter),!(n===t.r1&&i===t.c1)&&(a.merged=!0,a.rowspan=1,a.colspan=1,a.formatter="")}r.rowspan=t.r2-t.r1+1,r.colspan=t.c2-t.c1+1,r.formatter=o.join(" ")}function td(e,t){for(let r=t.r1;r<=t.r2;r++)for(let o=t.c1;o<=t.c2;o++){const n=e[r].cells[o];if(!n.merged&&((n.rowspan??1)>1||(n.colspan??1)>1)){const i=kr(e,r,o),a=n;for(let s=i.r1;s<=i.r2;s++)for(let p=i.c1;p<=i.c2;p++){const l=e[s].cells[p];l.merged=!1,l.rowspan=1,l.colspan=1,Eb(a,l)}n.rowspan=1,n.colspan=1}}}function Eb(e,t){e!==t&&(t.align=e.align,t.valign=e.valign,t.fontSize=e.fontSize,t.fontFamily=e.fontFamily,t.fontWeight=e.fontWeight,t.color=e.color,t.backgroundColor=e.backgroundColor,t.borders=e.borders?Oa(e.borders):void 0,t.padding=e.padding,t.wordWrap=e.wordWrap)}function rd(e,t,r){const o=r==="above"?t:t+1,n=e[t],i=n.cells.length,a=n.type==="data"?"header":n.type,s={id:`row-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,6)}`,type:a,height:n.height,...a==="header"?{repeatOnPage:[e[o-1],e[o]].find(p=>p?.type==="header")?.repeatOnPage===!0}:{},cells:Array.from({length:i},()=>Ra())};for(let p=0;p<i;p++)if(o>0&&o<e.length){const l=kr(e,o-1,p);if(l.r1<o&&l.r2>=o){const d=e[l.r1].cells[l.c1];d.rowspan=(d.rowspan??1)+1,s.cells[p].merged=!0}}e.splice(o,0,s)}function Sb(e,t){if(e.length<=1)return $("table.lastRow");const r=e[t],o=r.cells.length;for(let n=0;n<o;n++){const i=r.cells[n];if(!i.merged&&(i.rowspan??1)>1){const a=e[t+1].cells[n];Object.assign(a,Oa(i),{id:a.id}),a.rowspan=(i.rowspan??1)-1,a.merged=!1}else if(i.merged){const a=kr(e,t,n);if(a.r1<t&&a.c1===n){const s=e[a.r1].cells[a.c1];s.rowspan=(s.rowspan??1)-1}}}return e.splice(t,1),null}function od(e,t,r,o){const n=o==="left"?r:r+1;t.splice(n,0,t[r]);for(const i of e){const a=Ra();if(n>0&&n<i.cells.length){const s=e.indexOf(i),p=kr(e,s,n-1);if(p.c1<n&&p.c2>=n){const l=e[p.r1].cells[p.c1];s===p.r1&&(l.colspan=(l.colspan??1)+1),a.merged=!0}}i.cells.splice(n,0,a)}}function Tb(e,t,r){if(t.length<=1)return $("table.lastColumn");for(let o=0;o<e.length;o++){const n=e[o].cells[r];if(!n.merged&&(n.colspan??1)>1){const i=e[o].cells[r+1];Object.assign(i,Oa(n),{id:i.id}),i.colspan=(n.colspan??1)-1,i.merged=!1}else if(n.merged){const i=kr(e,o,r);if(i.c1<r&&i.r1===o){const a=e[i.r1].cells[i.c1];a.colspan=(a.colspan??1)-1}}}for(const o of e)o.cells.splice(r,1);return t.splice(r,1),null}function Ia(e,t,r){if(r==="data"){const o=e.findIndex((n,i)=>n.type==="data"&&i!==t);if(o>=0)return $("table.dataRowExists",{row:o+1})}if(r==="header"){for(let o=0;o<t;o++)if(e[o].type!=="header")return $("table.headerContinuous")}if(r==="subtotal"||r==="summary"){const o=e.findIndex(n=>n.type==="data");if(o<0)return $("table.subtotalAfterData");if(t<o)return $("table.subtotalBeforeData")}if(r==="subtotal"&&e.slice(0,t).some(o=>o.type==="summary"))return $("table.subtotalBeforeSummary");if(r==="summary"&&e.slice(t+1).some(o=>o.type==="subtotal"))return $("table.summaryAfterSubtotal");if(e[t].type==="header"&&r!=="header"){for(let o=t+1;o<e.length;o++)if(e[o].type==="header")return $("table.headerBreak")}if(e[t].type=r,r==="header"){const o=[e[t-1],e[t+1]].find(n=>n?.type==="header");e[t].repeatOnPage=e[t].repeatOnPage!==void 0?e[t].repeatOnPage===!0:o?.repeatOnPage===!0}else delete e[t].repeatOnPage;return null}function Mb(e,t){for(const r of e){if(r.type!=="header")break;r.repeatOnPage=t}}function nd(e,t,r,o){for(let n=t.r1;n<=t.r2;n++)for(let i=t.c1;i<=t.c2;i++){const a=e[n].cells[i];if(a.merged)continue;if(r==="none"){delete a.borders;continue}const s=kr(e,n,i),p=s.r1===t.r1,l=s.r2===t.r2,d=s.c1===t.c1,u=s.c2===t.c2,c={...a.borders??{}};r==="all"?(c.top={...o},c.bottom={...o},c.left={...o},c.right={...o}):r==="outer"?(p&&(c.top={...o}),l&&(c.bottom={...o}),d&&(c.left={...o}),u&&(c.right={...o})):r==="inner"&&(p||(c.top={...o}),l||(c.bottom={...o}),d||(c.left={...o}),u||(c.right={...o})),a.borders=c}}const Cb="constants.hint.border.pending",_b="constants.hint.border.multi",Db="constants.hint.border.mixed";function id(e,t,r){const o={...e.borders??{}};r?o[t]={...r}:delete o[t],e.borders=o.top||o.right||o.bottom||o.left?o:void 0}function On(e,t){const r=[];for(let o=t.r1;o<=t.r2;o++)for(let n=t.c1;n<=t.c2;n++){const i=e[o]?.cells[n];i&&!i.merged&&r.push(i)}return r}function La(e,t){const r=On(e,t).length;return{mode:r>1?"multi":"single",count:r}}function Ab(e,t){const r=On(e,t);if(!r.length)return null;const o=r[0].cellType??"text";return r.every(n=>(n.cellType??"text")===o)?o:null}function ad(e,t){const r=[];for(const n of On(e,t))for(const i of["top","right","bottom","left"]){const a=n.borders?.[i];a&&r.push(a)}const o=n=>{if(!r.length)return;const i=n(r[0]);return r.every(a=>n(a)===i)?i:"mixed"};return{width:o(n=>n.width),style:o(n=>n.style),color:o(n=>n.color)}}const Ob="1px dashed rgba(0,0,0,0.18)";function Rn(e,t={}){return e&&e.style!=="none"?`${e.width}pt ${e.style} ${e.color}`:t.designMode&&t.showGhostBorder!==!1?Ob:"none"}function Eo(e){const t=(e.tableColWidths??[]).reduce((o,n)=>o+n,0),r=(e.tableRows??[]).reduce((o,n)=>o+n.height,0);e.width=Math.round(t*100)/100,e.height=Math.round(r*100)/100}const sd=5;function Rb(e,t,r,o){const n=e.reduce((s,p,l)=>l===t?s:s+p,0),i=o===1/0?1/0:Math.max(sd,o-n),a=Math.round(r*10)/10;return Math.min(Math.max(a,sd),i)}const ld=Symbol.for("worm-print-platform.element-capabilities.v1"),pd=globalThis;function yr(){const e=pd[ld];if(e)return e;const t={entries:new Map,nextSeq:0,bootstrapped:!1};return pd[ld]=t,dd(t),t}const Ib={left:7,top:17.6,width:42.3,height:7.1},Lb=Object.freeze({text:"示例文本",longText:"示例长文本内容",barcode:"12345678",qrcode:"qrcode"});function Bb(e){if(e)return Lb[e]}const So=Object.freeze({text:{zoneAllowed:!0,defaultTextFit:"clip",bindings:[{targetPath:"options.formatter",label:"内容",labelKey:"constants.label.content",dataSource:"main"}],defaultOptions:()=>({formatter:"文本",exampleValue:"示例文本",fontSize:12,textAlign:"left",height:5.3}),title:"文本"},longText:{defaultTextFit:"autoHeight",bindings:[{targetPath:"options.formatter",label:"内容",labelKey:"constants.label.content",dataSource:"main"},{targetPath:"options.styler",label:"样式",dataSource:"main"}],defaultOptions:()=>({width:141.1,height:28.2,fontSize:12,lineHeight:18,exampleValue:"示例长文本内容"}),title:"长文"},barcode:{zoneAllowed:!0,codeRotationDpiGated:!0,bindings:[{targetPath:"options.formatter",label:"内容",labelKey:"constants.label.content",dataSource:"main"}],defaultOptions:()=>({width:56.4,height:14.1,title:"条形码",barcodeType:"code128",testData:"12345678",exampleValue:"12345678"}),title:"条形码"},qrcode:{zoneAllowed:!0,codeRotationDpiGated:!0,bindings:[{targetPath:"options.formatter",label:"内容",labelKey:"constants.label.content",dataSource:"main"}],defaultOptions:()=>({width:28.2,height:28.2,title:"二维码",testData:"qrcode",exampleValue:"qrcode"}),title:"二维码"},image:{zoneAllowed:!0,bindings:[{targetPath:"options.src",label:"内容",labelKey:"constants.label.content",dataSource:"main",placeholder:"输入图片路径,支持 /docfiles/... 相对路径、绝对 URL 或 {字段} 表达式"}],defaultOptions:()=>({width:28.2,height:28.2,fit:"contain"}),title:"图片"},table:{rotationExcluded:!0,acceptsElementBorder:!1,bindings:[],defaultOptions:()=>{const{rows:e,colWidths:t}=Pb(),r=t.reduce((n,i)=>n+i,0),o=e.reduce((n,i)=>n+i.height,0);return{width:r,height:o,tableMode:"dynamic",tableRows:e,tableColWidths:t,tableDefaultFontSize:10,tableDefaultColor:"#333333",tableDefaultPadding:1,fields:[],tablePagination:{enabled:!0}}},title:"表格"},flowList:{rotationExcluded:!0,defaultTextFit:"clip",bindings:[{targetPath:"options.formatter",label:"单元模板",dataSource:"main",placeholder:"{drugs.name} {drugs.spec}"}],defaultOptions:()=>({width:141.1,height:21.2,fontSize:12,formatter:"{name} {spec}",flowColumns:4,flowRowHeight:8,flowGapX:4,flowAutoSpan:!1,flowMaxSpan:2,flowLayoutMode:"fixed",flowPaddingTop:0,flowPaddingRight:0,flowPaddingBottom:0,flowPaddingLeft:0}),title:"流式列表"},hline:{zoneAllowed:!0,acceptsElementBorder:!1,defaultOptions:()=>({width:70.6,height:1.8,borderWidth:.75}),title:"横线"},vline:{zoneAllowed:!0,acceptsElementBorder:!1,defaultOptions:()=>({width:1.8,height:35.3,borderWidth:.75}),title:"竖线"},rect:{zoneAllowed:!0,acceptsElementBorder:!1,defaultOptions:()=>({width:28.2,height:28.2,borderWidth:1,borderColor:"#333"}),title:"矩形"},oval:{zoneAllowed:!0,acceptsElementBorder:!1,defaultOptions:()=>({width:28.2,height:28.2,borderWidth:1,borderColor:"#333"}),title:"椭圆"},html:{blocked:!0,defaultOptions:()=>({width:28.2,height:28.2}),title:"HTML"},pageNumber:{title:"页码"}});function dd(e){if(!e.bootstrapped){e.bootstrapped=!0;for(const[t,r]of Object.entries(So))e.entries.has(t)||e.entries.set(t,{caps:r,seq:e.nextSeq++})}}function Nb(e,t){if(!e||typeof e!="string")throw new Error("registerElementCapabilities: type 必须是非空字符串");if(!t||typeof t!="object")throw new Error("registerElementCapabilities: caps 必须是对象");const r=yr(),o=r.nextSeq++;return r.entries.set(e,{caps:t,seq:o}),()=>{if(yr().entries.get(e)?.caps!==t)return;const i=So[e];i?yr().entries.set(e,{caps:i,seq:o}):yr().entries.delete(e)}}function gt(e){return e?{...yr().entries.get(e)?.caps??{},type:e}:{type:""}}function Ba(){return[...yr().entries.entries()].sort((e,t)=>e[1].seq-t[1].seq).map(([e])=>e)}function Fb(){const e=yr();e.entries.clear(),e.nextSeq=0,e.bootstrapped=!1,dd(e)}function $b(){return{...Ib}}const cd=Symbol.for("worm-print-platform.element-plugin-registry.v1"),ud=globalThis;function Na(){const e=ud[cd];if(e)return e;const t={plugins:new Map,typeIndex:new Map,configs:new Map,legacyAliases:new Map};return ud[cd]=t,t}function zb(e,t){const r=e.render||t.render?{...e.render,...t.render}:void 0,o=e.designer||t.designer?{...e.designer,...t.designer}:void 0;return{...e,kind:t,binding:t.binding??e.binding,render:r,designer:o}}function Vr(e){const t=Na().typeIndex.get(e);return t?zb(t.plugin,t.kind):void 0}function fd(){return[...Na().typeIndex.values()]}function Hb(){return Object.fromEntries(Na().legacyAliases)}function To(e){return e/2.83464566929}function In(e){return e*(25.4/96)}function vr(e){return e*(96/25.4)}const hd=6,Ub=1,qb=["clip","shrink","autoHeight"];function md(e){return typeof e=="string"&&qb.includes(e)?e:void 0}const jb={text:"clip",longText:"autoHeight",flowList:"clip"};function Ln(e,t){const r=gt(e).defaultTextFit;return md(t?.textFit)??r??jb[e]??"clip"}function gd(e){if(e?.keepLineBreaks===!0&&e.wordWrap!==!1)return"pre-wrap"}function bd(e){return e?.wordWrap===!1?"nowrap":void 0}function Fa(e){return md(e?.textFit)??(e?.wordWrap===!1?"clip":"autoHeight")}function Mo(e){return typeof e!="number"||!Number.isFinite(e)||e<=0?hd:Math.max(e,Ub)}function $a(e){return Math.round(e*100)/100}function Wb(e){return Math.floor(e*100)/100}function Vb(e,t,r,o){return`${e}#${t}#${r}:${o}`}function Gb(e){const t=e.indexOf("#");if(t<0)return;const r=e.lastIndexOf("#"),o=e.slice(t+1,r);if(o!=="b"&&o!=="st"&&o!=="sm")return;const[n,i]=e.slice(r+1).split(":").map(Number);if(!(!Number.isFinite(n)||!Number.isFinite(i)))return{elementId:e.slice(0,t),kind:o,rowIndex:n,colIndex:i}}function kd(e,t){return(e||"contain")==="cover"?t:void 0}function za(e,t,r,o=1){const n=Math.max(r?.colspan??1,1);let i=0;for(let p=0;p<n;p++)i+=e[t+p]??0;if(i<=0)return 0;const a=r?.padding??o,s=(To(r?.borders?.left?.width??0)+To(r?.borders?.right?.width??0))/2;return Math.max(i-a*2-s,.5)}function Co(e,t,r,o=1){const n=Math.max(r?.rowspan??1,1);let i=0;for(let p=0;p<n;p++)i+=e[t+p]?.height??8;const a=r?.padding??o,s=(To(r?.borders?.top?.width??0)+To(r?.borders?.bottom?.width??0))/2;return Math.max(i-a*2-s,.5)}const Ha=1,yd=12,Kb=3,Yb=100,Xb=0,Zb=50;function wr(e){return e==="dynamic"?"dynamic":"fixed"}function Gr(e){const t=r=>{const o=e[r];return typeof o=="number"&&Number.isFinite(o)&&o>0?o:0};return{top:t("flowPaddingTop"),right:t("flowPaddingRight"),bottom:t("flowPaddingBottom"),left:t("flowPaddingLeft")}}function vd(e,t){return Math.max(0,e-t.left-t.right)}const wd=25.4/72;function Jb(e,t,r,o){return typeof e!="number"||!Number.isFinite(e)?o:Math.min(r,Math.max(t,Math.round(e)))}function bt(e){return Jb(e,Ha,yd,4)}function Et(e){return typeof e!="number"||!Number.isFinite(e)?4:Math.min(Zb,Math.max(Xb,e))}function or(e){return typeof e!="number"||!Number.isFinite(e)?8:Math.min(Yb,Math.max(Kb,e))}function xr(e,t){const r=bt(t),o=Math.min(2,r);return typeof e!="number"||!Number.isFinite(e)?o:Math.min(r,Math.max(1,Math.round(e)))}function Qb(e,t,r){const o=bt(t),n=Et(r),i=e-n*(o-1);return i<=0?0:i/o}function e0(e,t,r){const o=Math.max(1,Math.floor(r));return e*o+t*(o-1)}function xd(e,t){if(!e)return 0;const r=typeof t=="number"&&Number.isFinite(t)&&t>0?t*wd:12*wd;let o=0;for(const n of e){if(n===" "){o+=.28;continue}const i=n.codePointAt(0)??0;i>=12288&&i<=12351||i>=13312&&i<=19903||i>=19968&&i<=40959||i>=63744&&i<=64255||i>=65280&&i<=65376||i>=65504&&i<=65510||i>=131072?o+=1:/^[0-9A-Z]$/.test(n)?o+=.6:/^[a-z]$/.test(n)?o+=.5:/^[\u0020-\u007f]$/.test(n)?o+=.4:o+=.75}return o*r}function t0(e,t){if(!t.autoSpan)return 1;const r=xr(t.maxSpan,t.columns);if(r<=1||t.colUnitMm<=0)return 1;const o=xd(e,t.fontSizePt);for(let n=1;n<=r;n++)if(o<=e0(t.colUnitMm,t.gapX,n))return n;return r}function Ua(e,t){const r=bt(t.columns),o=Et(t.gapX),n=Qb(t.width,r,o),i=xr(t.maxSpan,r),a=[];let s=[],p=0;for(const l of e){const d=String(l??""),u=t0(d,{...t,columns:r,gapX:o,maxSpan:i,colUnitMm:n});s.length>0&&p+u>r&&(a.push({cells:s}),s=[],p=0),s.push({text:d,span:u}),p+=u}return s.length>0&&a.push({cells:s}),a}function Bn(e,t){if(typeof e!="string"||!e.includes("{")||!t)return;const r=new Set;for(const o of e.matchAll(/\{([^{}]*)\}/g))for(const n of(o[1]??"").split(/[^A-Za-z0-9_\u4e00-\u9fa5.]/)){const i=n.split(".")[0];i&&!/^\d/.test(i)&&r.add(i)}for(const o of r)if(Array.isArray(t[o]))return o}function r0(e,t,r){const o=Et(t),n=xd("一",r);if(n<=0||e<=0)return Ha;const i=Math.floor((e+o)/(n+o));return Math.min(yd,Math.max(Ha,i))}const Pd=e=>`${Math.round(e*1e3)/1e3}mm`;function o0(e){const t=bt(e.columns),r=Et(e.gapX),o=or(e.rowHeight);return["display:grid",`grid-template-columns:repeat(${t},minmax(0,1fr))`,`column-gap:${Pd(r)}`,`grid-auto-rows:minmax(${Pd(o)},auto)`].join(";")}const _o=25.4,Ed=10;function qa(e){return typeof e=="number"&&Number.isFinite(e)?Math.max(0,Math.floor(e)):Ed}const nr=30,Nn=10,ja=2,Sd=0,n0=.25,Wa=.254;function i0(e){if(typeof e!="number"||!Number.isFinite(e)||e<=0)return null;const t=e/_o;for(let r=2;r<=8;r+=.5){const o=Math.max(1,Math.round(Fn(r)*t)),n=o/t;if(n>=Wa-1e-9)return{barWidth:r,dotsPerModule:o,moduleWidthMm:n}}return null}function Td(e,t,r=$){const o=i0(e);if(!o)return"";const n=l=>String(Number(l.toFixed(3))),i=Fn(t??2),a=Math.max(1,Math.round(i*e/_o)),s=a/(e/_o),p=s>=Wa-1e-9;return r(p?"barcode.recommendOk":"barcode.recommendLow",{dpi:e,rec:o.barWidth,recDots:o.dotsPerModule,width:n(o.moduleWidthMm),min:n(Wa),current:t??2,curDots:a,curWidth:n(s)})}function Do(e){const t=typeof e=="number"&&Number.isFinite(e)?e:2;return Math.max(1,t/2)}function Fn(e){return Do(e)*n0}function a0(e){const{barHeightMm:t,moduleWidthMm:r,boxHeightMm:o,textModules:n}=e,i=typeof t=="number"&&Number.isFinite(t)&&t>0,a=typeof r=="number"&&Number.isFinite(r)&&r>0;if(!i||!a)return nr;const s=Math.max(1,Math.round(t/r));if(!(typeof o=="number"&&Number.isFinite(o)&&o>0))return s;const l=typeof n=="number"&&Number.isFinite(n)&&n>0?n:0,d=Math.floor((o-l*r)/r);return Math.max(1,Math.min(s,d))}function Md(e,t,r){const o=Math.max(1,Math.round(e*r)),n=Math.floor(t*r);if(n<1)return null;const i=Math.min(o,n);return{dotsPerModule:i,preferredDots:o,moduleWidthMm:i/r}}function s0(e){const t=Fn(e.barWidth),r=Math.max(1,Math.ceil(e.unitWidth)),o=e.boxWidthMm>0?e.boxWidthMm/r:Number.POSITIVE_INFINITY,n=e.dpi;if(typeof n=="number"&&Number.isFinite(n)&&n>0){const i=Md(t,o,n/_o);if(i)return i.moduleWidthMm}return Math.min(t,o)}function Kr(e,t){const r=typeof e=="number"&&e>0?e:Number.POSITIVE_INFINITY,o=typeof t=="number"&&t>0?Math.min(r,t):r;return Number.isFinite(o)?o:0}function l0(e){const t=Math.max(1,Math.ceil(e.unitWidth)),r=Math.max(1,Math.ceil(e.unitHeight)),o=Fn(e.barWidth),n=Math.min(e.boxWidthMm>0?e.boxWidthMm/t:Number.POSITIVE_INFINITY,e.boxHeightMm>0?e.boxHeightMm/r:Number.POSITIVE_INFINITY),i=e.dpi;if(typeof i=="number"&&Number.isFinite(i)&&i>0){const s=Md(o,n,i/_o);if(s)return{moduleWidthMm:s.moduleWidthMm,widthMm:t*s.moduleWidthMm,heightMm:r*s.moduleWidthMm,dotsPerModule:s.dotsPerModule,scaledDown:s.dotsPerModule<s.preferredDots}}const a=Math.min(o,n);return{moduleWidthMm:a,widthMm:t*a,heightMm:r*a,dotsPerModule:null,scaledDown:a<o}}function Va(e){const t=Do(e.barWidth),r=p=>l0({unitWidth:p.widthUnits/t,unitHeight:p.heightUnits/t,boxWidthMm:e.boxWidthMm,boxHeightMm:e.boxHeightMm,dpi:e.dpi,barWidth:e.barWidth}),o=e.measure(nr);if(!o)return{barHeightModules:nr,size:null};if(!(typeof e.barHeightMm=="number"&&Number.isFinite(e.barHeightMm)&&e.barHeightMm>0))return{barHeightModules:nr,size:r(o)};const i=Math.max(0,o.heightUnits/t-nr),a=a0({barHeightMm:e.barHeightMm,moduleWidthMm:s0({unitWidth:o.widthUnits/t,boxWidthMm:e.boxWidthMm,dpi:e.dpi,barWidth:e.barWidth}),boxHeightMm:e.boxHeightMm,textModules:i});if(a===nr)return{barHeightModules:a,size:r(o)};const s=e.measure(a);return s?{barHeightModules:a,size:r(s)}:{barHeightModules:nr,size:null}}const Ao=["top","right","bottom","left"],p0=new Set(["rect","oval","hline","vline","table"]);function $n(e){if(!e)return!1;const t=gt(e).acceptsElementBorder;return t===void 0?!p0.has(e):t}const d0=new Set(["solid","dashed","dotted","double"]);function Cd(e,t,r){return typeof e!="number"||!Number.isFinite(e)||e<=0||t==="none"?null:{borderWidth:`${e}pt`,borderStyle:typeof t=="string"&&d0.has(t)?t:"solid",borderColor:r||"#000"}}function zn(e,t){if(!$n(e))return null;const r=Cd(t?.borderWidth,t?.borderStyle,t?.borderColor),o={},n=t?.borders;if(n)for(const i of Ao){const a=n[i];if(!a)continue;const s=Cd(a.width,a.style,a.color);s&&(o[i]=s)}return!r&&Object.keys(o).length===0?null:{all:r,edges:o}}const c0=/[;"'<>\\(){}\[\]@!#]/,u0=64,Oo=100,_d=400;function f0(e){const t=(e??"").trim();return!t||t.length>u0||c0.test(t)?"":t}function Dd(e,t){if((e||"contain")!=="cover"||typeof t!="number"||!Number.isFinite(t))return;const r=Math.round(t);if(!(r<=Oo))return Math.min(r,_d)}function Ga(e,t,r){const o=f0(r),n={};o&&(n.objectPosition=o);const i=Dd(e,t);return i!==void 0&&(n.transform=`scale(${Number((i/100).toFixed(2))})`,n.transformOrigin=o||"50% 50%"),n}function Ro(e){return typeof e!="number"||!Number.isFinite(e)?0:(e%360+360)%360}function Ad(e,t,r){const o=e.width,n=t,i=Ro(r);let a,s;if(i===0||i===180)a=o,s=n;else if(i===90||i===270)a=n,s=o;else{const p=i*Math.PI/180;a=o*Math.abs(Math.cos(p))+n*Math.abs(Math.sin(p)),s=o*Math.abs(Math.sin(p))+n*Math.abs(Math.cos(p))}return{left:e.left-(a-o)/2,top:e.top-(s-n)/2,width:a,height:s}}const Od=385,h0=new Set(["table","flowList"]);function Rd(e){const t=gt(e).rotationExcluded;return t===void 0?h0.has(e):t}function Id(e){const t=gt(e).codeRotationDpiGated;return t===void 0?e==="barcode"||e==="qrcode":t}function m0(e=$){return e("code.rotateNote")}function g0(e,t){if(!Id(e))return!0;const r=t?.printerDpi;return typeof r=="number"&&r>0&&r>=Od}function Ka(e,t,r){const o=t?.rotate;if(typeof o!="number"||!Number.isFinite(o))return;const n=Ro(o);if(n!==0&&!Rd(e)){if(Id(e)){if(n===90||n===180||n===270)return n;const i=t?.printerDpi;if(typeof i=="number"&&i>0&&i<Od){const a=Ro(Math.round(n/90)*90);return a===0?void 0:a}}return n}}const Hn=e=>typeof e=="number"&&Number.isFinite(e)?e:0;function kt(e){const t=e??{};return{top:Hn(t.marginTop),right:Hn(t.marginRight),bottom:Hn(t.marginBottom),left:Hn(t.marginLeft)}}function Un(e){const t=kt(e);return["top","right","bottom","left"].filter(r=>t[r]!==0).map(r=>`margin-${r}:${t[r]}mm`).join(";")}function Xe(e={},t=e.height??0){const r=kt(e),o=e.left??0,n=e.top??0,i=e.width??100,a=t,s={left:o+r.left,top:n+r.top,right:o+r.left+i,bottom:n+r.top+a,width:i,height:a},p={left:o,top:n,right:o+r.left+i+r.right,bottom:n+r.top+a+r.bottom,width:Math.max(0,r.left+i+r.right),height:Math.max(0,r.top+a+r.bottom)};return{border:s,margin:p}}const Pr={A4:{width:210,height:297},A3:{width:297,height:420},A5:{width:148,height:210},Letter:{width:216,height:279},Legal:{width:216,height:356},DOT_FULL:{width:241,height:279.4},DOT_HALF:{width:241,height:139.7},DOT_THIRD:{width:241,height:93.1},LABEL_80X60:{width:80,height:60},LABEL_60X40:{width:60,height:40},LABEL_40X30:{width:40,height:30},THERMAL_57:{width:57,height:297},THERMAL_80:{width:80,height:297},THERMAL_110:{width:110,height:297},CUSTOM:{width:210,height:297},CONTINUOUS:{width:80,height:297}},b0=new Set(["CONTINUOUS","THERMAL_57","THERMAL_80","THERMAL_110"]);function Yr(e){return b0.has(e)}function yt(e){const t=Yr(e.paperSize),r=e.paperSize==="CUSTOM"||t?{width:e.customWidth??Pr[e.paperSize].width,height:e.customHeight??Pr[e.paperSize].height}:Pr[e.paperSize];return e.orientation==="landscape"&&!t?{width:r.height,height:r.width}:{...r}}function Er(e){if(Yr(e.paperSize))return yt(e);const r=yt(e);return e.outputRotation===90||e.outputRotation===270?{width:r.height,height:r.width}:r}function Ya(e){return Yr(e.paperSize)?0:e.outputRotation??0}function It(e){return Yr(e.paperSize)}function qn(e){return e.options?.pagination??e.pagination}function k0(e){return e.options?.tablePagination??e.tablePagination}const y0=2;function jn(e){return e.type==="table"||e.printElementType?.type==="table"}function Io(e){return(e.type||e.printElementType?.type||"text")==="flowList"&&wr(e.options?.flowLayoutMode)==="dynamic"}function Xa(e){return jn(e)||Io(e)}function Wn(e){return e.options?.fixed!==!0&&e.options?.repeatOnEveryPage===!0}function Za(e){return e.options?.fixed===!0}function Ld(e){return e.type||e.printElementType?.type||"text"}function Bd(e){return Ka(Ld(e),e.options)}function Sr(e,t){const r=t.get(e.id)?.measuredHeight??e.options?.height??0,o=kt(e.options),{border:n}=Xe({left:e.options?.left??0,top:e.options?.top??0,width:e.options?.width??100,height:r,...e.options},r),i=Bd(e),a=i===void 0?n:Ad(n,r,i);return{height:a.height,shift:n.top-a.top,top:a.top,rot:i,outerTop:a.top-o.top,outerBottom:a.top+a.height+o.bottom,outerHeight:Math.max(0,o.top+a.height+o.bottom)}}function v0(e,t){const r=e.options?.tableColWidths??[],o=jn(e)&&r.length>0?r.reduce((p,l)=>p+l,0):e.options?.width??0,n=t.get(e.id)?.measuredHeight??e.options?.height??0,{border:i}=Xe({...e.options,left:e.options?.left??0,top:e.options?.top??0,width:o,height:n},n),a=Bd(e);if(a===void 0)return{left:i.left,width:i.width};const s=Ad(i,n,a);return{left:s.left,width:s.width}}function w0(e){const t=e.options??{},r=t.top??0,n=(t.tableRows??[]).reduce((a,s)=>a+(s.height??0),0),i=Math.max(t.height??0,n);return r+kt(t).top+i}function Lo(e){if(Io(e)){const t=e.options??{};return(t.top??0)+kt(t).top+Math.max(t.height??0,0)}return w0(e)}function Nd(e){return(t,r)=>{const o=t.options?.top??0,n=r.options?.top??0;if(o!==n)return o-n;const i=t.options?.zIndex??0,a=r.options?.zIndex??0;return i!==a?i-a:(e.get(t.id)??0)-(e.get(r.id)??0)}}function Fd(e){const r=e.filter(s=>typeof s.id=="string").map(s=>s).filter(s=>!Wn(s)&&!Za(s)),o=new Map;r.forEach((s,p)=>o.set(s.id,p));const n=[...r].sort(Nd(o)),i=new Set;for(const s of n)Xa(s)||s.options?.groupId&&i.add(s.id);const a=new Set;for(const s of $d(n,i).values())for(const p of s)a.add(p);return a}function $d(e,t){const r=new Map;let o=null,n=-1,i=0,a=0;for(const s of e){if(Xa(s)){o=s.id,n=Lo(s)+kt(s.options).bottom;const d=s.options?.tableColWidths??[],u=d.length>0?d.reduce((f,h)=>f+h,0):s.options?.width??0,c=Xe({...s.options,width:u}).margin;i=c.left,a=c.right,r.set(s.id,[]);continue}if(t?.has(s.id)||!o||(s.options?.top??0)<n)continue;const l=Xe({width:0,...s.options}).margin;l.right<=i||l.left>=a||r.get(o).push(s.id)}return r}function Ja(e,t,r,o){const n=Lo(e)+kt(e.options).bottom;let i=n;for(const a of t){const s=r.elements.find(p=>p.id===a);s&&(i=Math.max(i,Xe({width:0,...s.options}).margin.bottom))}return Math.max(i-n,0)}function zd(e,t){return Math.max(e.options?.height??0,t.get(e.id)?.measuredHeight??0)}const Hd=25.4/72;function Ud(e){const t=e.options??{};if((e.type||e.printElementType?.type||"text")!=="vline")return{width:100,...t};const n=(t.borderWidth??.75)*Hd/2+.05;return{...t,left:(t.left??0)-n,width:n*2}}function Tr(e){const t=Xe(Ud(e)).margin;return[t.left,t.right]}function x0(e){const t=Xe(Ud(e)).border;return[t.left,t.right]}function Bo(e,t){return e[0]<t[1]&&t[0]<e[1]}function qd(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function P0(e,t,r){const o=new Map;for(const f of r.values()){if(f.length<2)continue;const h={anchorId:f[0].id,ids:f.map(b=>b.id),forceFirstPage:f.some(b=>qn(b)?.pageable===!1),band:f.map(Tr).reduce(qd)};for(const b of f)o.set(b.id,h)}const n=e.filter(f=>!jn(f)&&!Io(f)&&!f.options?.groupId&&qn(f)?.pageable!==!1),i=new Map;n.forEach(f=>i.set(f.id,f.id));const a=f=>{let h=f;for(;i.get(h)!==h;)h=i.get(h);let b=f;for(;i.get(b)!==h;){const k=i.get(b);i.set(b,h),b=k}return h},s=(f,h)=>{const b=a(f),k=a(h);b!==k&&i.set(k,b)},p=[],l=f=>Xe({width:100,...f.options,height:zd(f,t)},zd(f,t)).border,d=[...n].sort((f,h)=>l(f).top-l(h).top);for(const f of d){const h=l(f),b=h.top;for(let w=p.length-1;w>=0;w--)p[w].bottom<=b&&p.splice(w,1);const k=h.bottom,v=x0(f);for(const w of p)w.bottom>b&&Bo(w.x,v)&&s(f.id,w.id);p.push({id:f.id,top:b,bottom:k,x:v})}const u=new Map(n.map(f=>[f.id,f])),c=new Map;for(const f of n){const h=a(f.id),b=c.get(h);b?b.push(f.id):c.set(h,[f.id])}for(const f of c.values()){if(f.length<2)continue;const h={anchorId:f[0],ids:f,forceFirstPage:!1,band:f.map(b=>Tr(u.get(b))).reduce(qd)};for(const b of f)o.set(b,h)}return o}function Qa(e,t){const r=yt(e),{top:o,bottom:n}=e.margins,i=e.header?.height??0,a=e.footer?.height??0,s=It(e),p=s?Number.POSITIVE_INFINITY:r.height-o-n-i-a;if(!s&&p<=0)throw new Error($("diagnostic.pagination.insufficientHeight",{paper:r.height,margins:o+n,header:i,footer:a}));const l=new Map;e.elements.forEach((C,q)=>l.set(C.id,q));const d=[...e.elements].sort(Nd(l)),u=d.filter(Wn),c=d.filter(Za),f=d.filter(C=>!Wn(C)&&!Za(C)),h=u.reduce((C,q)=>{const U=Sr(q,t);return{minTop:Math.min(C.minTop,U.outerTop),maxBottom:Math.max(C.maxBottom,U.outerBottom)}},{minTop:Number.POSITIVE_INFINITY,maxBottom:Number.NEGATIVE_INFINITY}),b=!s&&u.length>0,k=b?h.minTop:0,v=b?Math.max(0,h.maxBottom-k):0,w=new Set,P=new Map;for(const C of f){if(Xa(C))continue;const q=C.options?.groupId;if(!q)continue;w.add(C.id);const U=P.get(q);U?U.push(C):P.set(q,[C])}const E=$d(f,w),D=new Map;for(const[C,q]of E)for(const U of q)D.set(U,C);const O=new Set,A=C=>{for(const q of C)O.add(q)},R=new Map;for(const C of d)R.set(C.id,C);const _=P0(f,t,P),I=[];let S=[],N=[],F=[],H=!1;function le(){return p-y0-(H?v:0)}function M(C){let q=0;for(const U of N)Bo(C,[U.x0,U.x1])&&(q+=U.height);return Math.max(0,q)}function ne(C,q,U){F.push({x0:C[0],x1:C[1],renderBottom:q,designBottom:U})}function Se(C){let q;for(const U of F)Bo(C,[U.x0,U.x1])&&(!q||U.renderBottom>=q.renderBottom)&&(q=U);return q}function Pe(C,q){const U=C.options?.top??0;if(H)return{top:ke(q),extra:0};const V=Se(q);if(!V||V.renderBottom<=U)return{top:U,extra:0};const j=Math.max(U,V.renderBottom+U-V.designBottom);return{top:j,extra:Math.max(0,j-V.renderBottom)}}function K(C){return le()-M(C)}function ue(C){const q=N.filter(U=>Bo(C,[U.x0,U.x1]));for(let U=0;U<q.length;U++)for(let V=U+1;V<q.length;V++)if(!Bo([q[U].x0,q[U].x1],[q[V].x0,q[V].x1]))return!0;return!1}function me(C,q){N.push({x0:C[0],x1:C[1],height:q})}function we(C,q=Tr(C)){return H?ke(q):C.options?.top??0}function ke(C){return(H?v:0)+M(C)}let te=!1,Me=[];function se(C,q,U){U<=0||Me.push($("diagnostic.pagination.overflowTop",{id:C.id,rot:q,amount:tr(Math.round(U*100)/100,er())}))}function Je(){I.push(te||Me.length>0?{pageIndex:I.length,sections:[...S],...te?{overflow:!0}:{},...Me.length>0?{warnings:[...Me]}:{}}:{pageIndex:I.length,sections:[...S]})}function ze(C){C>p&&(te=!0)}function ve(C=!1){if(S.length===0){te=te||C;return}Je(),S=[],N=[],F=[],H=!0,te=!1,Me=[]}let Ee=0;for(;Ee<f.length;){const C=f[Ee];if(D.has(C.id)&&O.has(C.id)){Ee++;continue}const q=_.get(C.id);if(q&&q.anchorId!==C.id){Ee++;continue}if(qn(C)?.pageable===!1||q?.forceFirstPage){const U=I[0],V=U?.sections??S,j=(J,pe,T)=>{U?T>0&&(U.warnings=[...U.warnings??[],$("diagnostic.pagination.overflowTop",{id:J.id,rot:pe,amount:tr(Math.round(T*100)/100,er())})]):se(J,pe,T)};if(q){let J=Number.POSITIVE_INFINITY,pe=Number.NEGATIVE_INFINITY,T=Number.NEGATIVE_INFINITY,X;for(const ee of q.ids){const ie=R.get(ee);if(!ie)continue;const ce=Sr(ie,t);J=Math.min(J,ce.top),pe=Math.max(pe,ce.outerBottom),T=Math.max(T,Xe({width:0,...ie.options}).margin.bottom),ce.rot!==void 0&&(X={el:ie,rot:ce.rot})}X&&j(X.el,X.rot,-J);for(const ee of q.ids)V.push({elementId:ee,type:"element",renderTop:R.get(ee)?.options?.top??0});!U&&T>Number.NEGATIVE_INFINITY&&ne(q.band,Math.max(pe,0),T)}else{const J=Sr(C,t),pe=Xe({width:0,...C.options}).margin.bottom;U||ne(Tr(C),J.outerBottom,pe),J.rot!==void 0&&j(C,J.rot,-J.top),V.push({elementId:C.id,type:"element",renderTop:C.options?.top??0})}Ee++;continue}jn(C)?Ee=mo(C,t,Ee):Io(C)?Ee=xe(C,t,Ee):q?Ee=xn(q,Ee):Ee=wn(C,t,f,Ee)}S.length>0&&Je(),I.length===0&&I.push({pageIndex:0,sections:[]});const ho=new Map(d.map((C,q)=>[C.id,q]));for(const C of I){const q=C.pageIndex>0?-k:0,U=u.map(j=>({elementId:j.id,type:"element",renderTop:(j.options?.top??0)+q})),V=c.map(j=>({elementId:j.id,type:"element",renderTop:j.options?.top??0}));C.sections=[...C.sections,...U,...V].sort((j,J)=>(ho.get(j.elementId)??Number.MAX_SAFE_INTEGER)-(ho.get(J.elementId)??Number.MAX_SAFE_INTEGER));for(const j of[...u,...c]){const J=Sr(j,t),pe=Wn(j)?q:0;if(J.outerBottom+pe>p&&(C.overflow=!0),J.rot!==void 0&&J.top+pe<0){const T=Math.round(-(J.top+pe)*100)/100;C.warnings=[...C.warnings??[],$("diagnostic.pagination.overflowTop",{id:j.id,rot:J.rot,amount:tr(T,er())})]}}}return vn(),I;function vn(){if(s)return;const C=e.margins.left;for(const q of I){const U=[];for(const V of q.sections){if(V.type==="flow-group")continue;const j=R.get(V.elementId);if(!j)continue;const{left:J,width:pe}=v0(j,t),T=C+J,X=T+pe-r.width,ee=-T;X>.01?U.push($("diagnostic.pagination.overflowRight",{id:j.id,amount:tr(Math.round(X*100)/100,er())})):ee>.01&&U.push($("diagnostic.pagination.overflowLeft",{id:j.id,amount:tr(Math.round(ee*100)/100,er())}))}U.length>0&&(q.warnings=[...q.warnings??[],...U])}}function wn(C,q,U,V){const j=Tr(C),J=Sr(C,q),pe=J.outerHeight,T=()=>{const ee=we(C,j),ie=H?ee+J.shift:ee,ce=ie-(C.options?.top??0);ze(J.outerBottom+ce),J.rot!==void 0&&!H&&se(C,J.rot,-J.top),S.push({elementId:C.id,type:"element",renderTop:ie}),me(j,pe),ne(j,ie+J.outerHeight,Xe({width:0,...C.options}).margin.bottom)};if(!H&&J.outerBottom<=p&&ue(j)||pe<=K(j)){if(T(),qn(C)?.keepWithNext&&V+1<U.length){const ee=U[V+1],ie=Sr(ee,q).outerHeight;if(pe+ie>le())return V+1;ie>K(j)&&(S.pop(),N.pop(),ve(),T())}return V+1}return ve(),T(),V+1}function xn(C,q){const U=C.ids.map(ce=>R.get(ce)).filter(ce=>!!ce);let V=Number.POSITIVE_INFINITY,j=Number.NEGATIVE_INFINITY,J=Number.NEGATIVE_INFINITY,pe;for(const ce of U){const Te=Sr(ce,t);V=Math.min(V,Te.outerTop),j=Math.max(j,Te.outerBottom),J=Math.max(J,Xe({width:0,...ce.options}).margin.bottom),Te.rot!==void 0&&(pe={el:ce,rot:Te.rot})}const T=Math.max(j-V,0),X=C.band,ee=()=>{const ce=H?ke(X)-V:0;ze(V+ce+T),pe&&!H&&se(pe.el,pe.rot,-V);for(const Te of U)S.push({elementId:Te.id,type:"element",renderTop:(Te.options?.top??0)+ce});me(X,T),ne(X,V+ce+T,J)};if(T<=K(X))return ee(),q+1;const ie=ke(X)+(H?0:V);return ve(ie+T>p),ee(),q+1}function mo(C,q,U){const V=C.options??{},j=V._renderRows??[],J=q.get(C.id)?.measuredRowHeights??[],pe=(V._subtotalTemplates?.length??0)>0,T=(V._summaryRows?.length??0)>0,X=pe?jd(j,J,"subtotal"):0,ee=T?jd(j,J,"summary"):0,ie=fe=>pe&&fe.type==="subtotal"||T&&fe.type==="summary",ce=j.filter(fe=>!ie(fe)),Te=J.filter((fe,ye)=>!ie(j[ye]));V._renderRows=ce;const Le=Math.min(ce.length,Te.length),Ke=V._repeatHeaderCount??0,ot=q.get(C.id)?.repeatHeaderHeight??J.slice(0,Ke).reduce((fe,ye)=>fe+ye,0),He=le(),ct=kt(V),Ce=ct.top+ct.bottom,De=Tr(C),{top:At,extra:Hr}=Pe(C,De);!H&&Hr>0&&me(De,Hr);let ut=At,Ae=0;const qt=()=>{Dt(C,q,De);const fe=E.get(C.id)??[],ye=fe.length>0?Ja(C,fe,e):0,ft=Lo(C)+kt(V).bottom,ht=S[S.length-1],Pn=ht?.type==="flow-group"&&ht.elementId===C.id,mp=Pn?ht.groupTop??V.top??0:ut,gp=Pn&&(ht.startRow??0)===(ht.endRow??0)&&!(ht.subtotal||ht.summary)?0:Ae;return ne(De,mp+gp+ye,ft+ye),U+1};if(ot>He)throw new Error($("diagnostic.pagination.repeatHeaderOverflow",{id:C.id,repeat:tr(ot,er()),avail:tr(He,er())}));if(Le===0)return S.push({elementId:C.id,type:"table-slice",startRow:0,endRow:0,summary:ee>0,renderTop:At}),ut=At,Ae=Math.max(0,ee),me(De,Math.max(0,ee+Ce)),qt();const xt=Te.slice(0,Le).reduce((fe,ye)=>fe+ye,0),Qe=Math.max(0,xt+X+ee+Ce);if(k0(C)?.enabled===!1){Qe>K(De)&&S.length>0&&ve();const fe=H?we(C,De):At;return S.push({elementId:C.id,type:"table-slice",startRow:0,endRow:Le,subtotal:X>0,summary:ee>0,renderTop:fe}),ut=fe,Ae=Math.max(0,Qe),me(De,Qe),qt()}const Pt=E0(ce,Le);let Jt=0,hr=!0,$e=At,Ue=Ce;const Ur=()=>K(De)-Ue,qr=(fe,ye)=>{S.push({elementId:C.id,type:"table-slice",startRow:Jt,endRow:fe,subtotal:X>0,...!hr&&ye?{repeatHeader:!0}:{},renderTop:$e}),me(De,Math.max(0,Ue)),ut=$e,Ae=Math.max(0,Ue),Ue=0};for(const fe of Pt){const ye=Te.slice(fe.start,fe.end).reduce((ft,ht)=>ft+ht,0);if(ye+X<=Ur()){Ue+=ye;continue}fe.start>Jt&&(qr(fe.start,Ke>0),hr=!1,Jt=fe.start),ve(),$e=we(C,De),Ue=Ce,hr||(Ue+=ot),Ue+=ye}if(Jt<Le&&qr(Le,Ke>0),ee>0)if(ee<=Ur()){const fe=S.length-1,ye=S[fe];if(ye&&ye.type==="table-slice"&&ye.elementId===C.id)S[fe]={...ye,summary:!0},me(De,ee),Ae+=ee;else{ve();const ft=we(C,De);S.push({elementId:C.id,type:"table-slice",startRow:Le,endRow:Le,summary:!0,renderTop:ft}),ut=ft,Ae=Math.max(0,ee+Ce),me(De,Math.max(0,ee+Ce))}}else{ve();const fe=we(C,De);S.push({elementId:C.id,type:"table-slice",startRow:Le,endRow:Le,summary:!0,renderTop:fe}),ut=fe,Ae=Math.max(0,ee+Ce),me(De,Math.max(0,ee+Ce))}return qt()}function xe(C,q,U){const V=C.options??{},j=q.get(C.id)?.measuredFlowRowHeights??[],pe=(Array.isArray(V._flowRows)?V._flowRows:[]).length,T=or(V.flowRowHeight);if(pe===0)return U+1;const X=Gr(V),ee=zn(Ld(C),V),ie=$e=>{if(!$e)return 0;const Ue=Number.parseFloat($e.borderWidth);return Number.isFinite(Ue)?Ue*Hd:0},ce=$e=>{const Ue=ee?.edges?.[$e];return ie(Ue||(ee?.all??void 0))},Te=kt(V),Le=Te.top+Te.bottom+X.top+X.bottom+ce("top")+ce("bottom"),Ke=Tr(C);let ot=0,He=Pe(C,Ke).top,ct=H?0:He,Ce=0,De=He,At=0;const Hr=()=>(H?K(Ke):le()-ct)-Ce-Le,ut=$e=>{S.push({elementId:C.id,type:"flow-list-slice",startFlowRow:ot,endFlowRow:$e,renderTop:He});const Ue=H?He:M(Ke),Ur=He+Le+Ce;me(Ke,Math.max(0,Ur-Ue)),De=He,At=Le+Ce,Ce=0};let Ae=0;for(;Ae<pe;){const $e=j[Ae]??T;if($e<=Hr()){Ce+=$e,Ae++;continue}if($e+Le>le()){Ae>ot&&(ut(Ae),ot=Ae),S.length>0&&ve(),He=we(C,Ke),ct=H?0:He,Ce=$e,ze(He+Le+Ce),Ae++;continue}if(S.length===0&&Ce===0&&!H){Ce+=$e,ze(He+Le+Ce),Ae++;continue}Ae>ot&&(ut(Ae),ot=Ae),ve(),He=we(C,Ke),ct=H?0:He}ot<pe&&ut(pe),Dt(C,q,Ke);const qt=E.get(C.id)??[],xt=qt.length>0?Ja(C,qt,e):0,Qe=S[S.length-1],Pt=Qe?.type==="flow-group"&&Qe.elementId===C.id,Jt=Pt?Qe.groupTop??V.top??0:De,hr=Pt&&(Qe.startFlowRow??0)===(Qe.endFlowRow??0)?0:At;return ne(Ke,Jt+hr+xt,Lo(C)+Te.bottom+xt),U+1}function Dt(C,q,U){const V=E.get(C.id)??[];if(V.length===0)return;const j=Ja(C,V,e),J=C.options??{};if(j<=K(U)){const pe=S.length-1,T=S[pe];if(T&&(T.type==="table-slice"||T.type==="flow-list-slice")&&T.elementId===C.id){S[pe]={...T,type:"flow-group",followElementIds:V,groupTop:T.renderTop??J.top??0},me(U,j),A(V);return}}ve(),S.push({elementId:C.id,type:"flow-group",startRow:0,endRow:0,...Io(C)?{startFlowRow:0,endFlowRow:0}:{},followElementIds:V,groupTop:we(C,U)}),me(U,j),A(V)}}function E0(e,t){const r=[];let o=0,n=1;for(let i=0;i<t;i++){for(const a of e[i]?.cells??[])!a.merged&&(a.rowspan??1)>1&&(n=Math.max(n,i+a.rowspan));i+1>=n&&(r.push({start:o,end:i+1}),o=i+1,n=o+1)}return r}function jd(e,t,r){let o=0;for(let n=0;n<e.length;n++)e[n]?.type===r&&(o+=t[n]??0);return o}const Vn=25,Wd=5;function S0(e){return Math.max(Vn,e)}function Vd(e,t,r=1.1){const o=t>0?e*r:e/r;return S0(Math.round(o))}function T0(e,t,r,o,n=.9){if(r<=0||o<=0)return 100;const i=Math.min(e/r,t/o)*n,a=Math.round(i*100);return Math.max(Wd,a)}const M0=2;function Gd(e){const t=e.gap??M0,r=[...e.units].sort((i,a)=>i.order-a.order);if(e.available<=0)return{movedIds:[],overflowRemains:!1};if(r.some(i=>i.width<=0))return{movedIds:[],overflowRemains:!1};const o=i=>{const a=r.filter(p=>!i.has(p.id));return e.pinned+a.reduce((p,l)=>p+l.width+t,0)+(i.size>0?e.moreTriggerWidth+t:0)<=e.available};if(o(new Set))return{movedIds:[],overflowRemains:!1};const n=new Set;for(const i of r)if(n.add(i.id),o(n))return{movedIds:[...n],overflowRemains:!1};return{movedIds:[...n],overflowRemains:!0}}function C0(e){const t=e.gap??4,r=e.boundaryBottom-e.triggerBottom-t,o=e.triggerTop-e.boundaryTop-t;return r>=e.overlayHeight?"down":o>r?"up":"down"}function _0(){return Ba().filter(e=>gt(e).blocked===!0)}_0();function D0(e){if(!e)return!1;const t=gt(e).blocked;return t===void 0?So[e]?.blocked===!0:t}function Xr(){return`el-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}function es(e){const t=$b(),r=gt(e).defaultOptions?.();if(r)return{...t,...r};const o=Vr(e)?.kind.defaultOptions?.();return o?{...t,...o}:t}function ts(e,t){return{id:Xr(),options:{...es(e),...t},printElementType:{type:e,title:gt(e).title||Vr(e)?.kind.label||String(e)}}}const A0=["left","top","width","height","marginTop","marginRight","marginBottom","marginLeft"];function O0(e){return e.type??e.printElementType?.type}function R0(e){const t=r=>(r??[]).filter(o=>!D0(O0(o)));return{...e,elements:t(e.elements),header:e.header?{...e.header,elements:t(e.header.elements)}:e.header,footer:e.footer?{...e.footer,elements:t(e.footer.elements)}:e.footer}}function I0(e){const t={...e.options};for(const r of A0){const o=t[r];typeof o=="number"&&Number.isFinite(o)&&(t[r]=L0(To(o)))}return{...e,options:t}}function L0(e){return Math.round(e*100)/100}function B0(e){const t={...e};delete t.firstPageOverlay;const r=R0(t);if(r.unit==="mm")return r;const o=r,n=i=>i?.map(I0)??[];return{...o,unit:"mm",elements:n(o.elements),header:o.header?{...o.header,elements:n(o.header.elements)}:o.header,footer:o.footer?{...o.footer,elements:n(o.footer.elements)}:o.footer}}const rs="labels",Lt={A4:{width:210,height:297,labelKey:"constants.paper.A4.label",group:"common"},A3:{width:297,height:420,labelKey:"constants.paper.A3.label",group:"common"},A5:{width:148,height:210,labelKey:"constants.paper.A5.label",group:"common"},Letter:{width:216,height:279,labelKey:"constants.paper.Letter.label",group:"common"},Legal:{width:216,height:356,labelKey:"constants.paper.Legal.label",group:"common"},DOT_FULL:{width:241,height:279.4,labelKey:"constants.paper.DOT_FULL.label",group:"dotMatrix"},DOT_HALF:{width:241,height:139.7,labelKey:"constants.paper.DOT_HALF.label",group:"dotMatrix"},DOT_THIRD:{width:241,height:93.1,labelKey:"constants.paper.DOT_THIRD.label",group:"dotMatrix"},LABEL_80X60:{width:80,height:60,labelKey:"constants.paper.LABEL_80X60.label",group:rs},LABEL_60X40:{width:60,height:40,labelKey:"constants.paper.LABEL_60X40.label",group:rs},LABEL_40X30:{width:40,height:30,labelKey:"constants.paper.LABEL_40X30.label",group:rs},THERMAL_57:{width:57,height:297,continuous:!0,labelKey:"constants.paper.THERMAL_57.label",group:"receipt"},THERMAL_80:{width:80,height:297,continuous:!0,labelKey:"constants.paper.THERMAL_80.label",group:"receipt"},THERMAL_110:{width:110,height:297,continuous:!0,labelKey:"constants.paper.THERMAL_110.label",group:"receipt"},CONTINUOUS:{width:80,height:297,continuous:!0,labelKey:"constants.paper.CONTINUOUS.label",group:"continuous"}};function Gn(e){return!!e&&Lt[e]?.continuous===!0}function ir(e){const t=Gn(e.paperSize);let r;if(e.paperSize==="CUSTOM"||t){const o=Lt[e.paperSize];r={width:e.customWidth??o?.width??210,height:e.customHeight??o?.height??297}}else{const o=Lt[e.paperSize]||Lt.A4;r={width:o.width,height:o.height}}return e.orientation==="landscape"&&!t?{width:r.height,height:r.width}:r}const os=.75,N0="constants.hint.border.apply",No=["top","right","bottom","left"];function Kd(e){const t={};for(const r of No){const o=e.map(n=>!!n?.[r]);t[r]=o.length>0&&o.every(Boolean)?"on":o.some(Boolean)?"mixed":"off"}return t}const Yd=[{value:"none",labelKey:"constants.borderStyle.none"},{value:"solid",labelKey:"constants.borderStyle.solid"},{value:"dashed",labelKey:"constants.borderStyle.dashed"},{value:"dotted",labelKey:"constants.borderStyle.dotted"},{value:"double",labelKey:"constants.borderStyle.double"}],F0=new Set(["solid","dashed","dotted","double"]),Zr="none";function Fo(e,t){const r=e.borders?.[t];if(r&&r.style!==Zr&&typeof r.width=="number"&&Number.isFinite(r.width)&&r.width>0)return!0;const o=e.borderWidth;return e.borderStyle!==Zr&&typeof o=="number"&&Number.isFinite(o)&&o>0}function $0(e){const t={};for(const r of No)Fo(e,r)&&(t[r]=e.borders?.[r]??{width:e.borderWidth});return t}function z0(e){const t=e.borderWidth;return{width:typeof t=="number"&&Number.isFinite(t)&&t>0?t:os,style:e.borderStyle||"solid",color:e.borderColor||"#333333"}}function Xd(e,t,r){if(t!=="inner"){if(e.borders=void 0,t==="none"){e.borderWidth=0;return}e.borderWidth=r.width,e.borderStyle=r.style,e.borderColor=r.color}}function Zd(e){return No.some(t=>Fo(e,t))}function ns(e,t){if(!e.length)return;const r=e[0]?.[t];return e.every(o=>o[t]===r)?r:"mixed"}function H0(e){if(!e)return;const t=typeof e.style=="string"&&F0.has(e.style)?e.style:"solid";return{width:e.width,style:e.style===void 0?void 0:t,color:e.color}}function U0(e){const t=No.map(o=>e.borders?.[o]).filter(o=>typeof o?.width=="number"&&Number.isFinite(o.width)&&o.width>0).map(o=>H0(o));if(!t.length)return;const r=ns(t,"style");return{width:ns(t,"width"),style:r===void 0?"solid":r,color:ns(t,"color")}}function Jd(e){const t=e.borderWidth,r=typeof t=="number"&&Number.isFinite(t),o=U0(e),n=r&&t>0;if(o&&!n)return o;const i=n?e.borderStyle||"solid":Zr;return r?{width:t,style:i,color:e.borderColor}:{width:void 0,style:i,color:void 0}}function Qd(e){const t=Jd(e);return{width:typeof t.width=="number"&&t.width>0?t.width:os,style:typeof t.style=="string"&&t.style!==Zr?t.style:"solid",color:typeof t.color=="string"?t.color:"#333333"}}function q0(e,t){e.borderWidth=t.width,e.borderStyle=t.style,e.borderColor=t.color,e.borders=void 0}function j0(e,t,r){if(t==="borderStyle"&&r===Zr){const o=Zd(e);e.borderStyle=Zr,o&&(e.borderWidth=0,e.borders=void 0);return}if(!Zd(e)){if(t==="borderStyle"){e.borderStyle=r,e.borderWidth=os;return}Object.assign(e,{[t]:r});return}if(t==="borderWidth"&&(typeof r!="number"||!(r>0))){e.borderWidth=typeof r=="number"&&r<0?0:r,e.borders=void 0;return}q0(e,z0({...e,[t]:r}))}function is(e,t,r,o){if(r!==Fo(e,t)){if(!r){const n=e.borderWidth;if(typeof n!="number"||!(n>0)){ec(e,t,null);return}const i={};for(const a of No){if(a===t)continue;const s=e.borders?.[a];i[a]={width:s?.width??n,...s?.style!==void 0?{style:s.style}:e.borderStyle!==void 0?{style:e.borderStyle}:{},...s?.color!==void 0?{color:s.color}:e.borderColor!==void 0?{color:e.borderColor}:{}}}e.borders=i,e.borderWidth=0;return}ec(e,t,o??Qd(e))}}function ec(e,t,r){const o={...e.borders??{}};r?o[t]={width:r.width,style:r.style,color:r.color}:delete o[t],e.borders=o}const tc=96/25.4,rc=1,W0=8,V0=210;function as(e,t){if(!e||typeof e!="object")return;if(Array.isArray(e)){for(const o of e)as(o,t);return}const r=e;typeof r.printerDpi=="number"&&r.printerDpi>0&&t.add(r.printerDpi);for(const o of Object.keys(r)){if(o==="printerDpi")continue;const n=r[o];n&&typeof n=="object"&&as(n,t)}}function G0(e){if(!e)return null;const t=new Set;return as(e,t),t.size?Math.max(...t):null}function K0(e){if(!e)return V0*tc;const t=e.pages?.length?e.pages:[e];return Math.max(...t.map(r=>{const o=ir(r);return((r.outputRotation===90||r.outputRotation===270)&&!Gn(r.paperSize)?o.height:o.width)*tc}))}function Y0(e,t){return e<=0||t<=0?rc:Math.min(W0,Math.max(rc,Math.floor(e/t)))}function X0(e,t,r){const o=[];return e&&o.push({key:"dots",value:e/96,label:`点阵 ${e}dpi`,tip:`1 屏幕像素 = 1 个打印点(${e}dpi ÷ 96dpi)。条与间隙按纸面逐点显示,不会在屏幕上糊成一片`}),o.push({key:"fit",value:Y0(t,r),label:"适配",tip:"按容器宽放大到放得下整页的最大整数倍"},{key:"100",value:1,label:"100%",tip:"按 CSS 真实尺寸显示(1mm = 3.78 屏幕像素),热敏点距在此档不可分辨"},{key:"200",value:2,label:"200%",tip:"整数倍放大,避免非整数缩放带来的半像素边"},{key:"400",value:4,label:"400%",tip:"整数倍放大,避免非整数缩放带来的半像素边"}),o}function oc(e){return"100"}function Z0(e,t){return!e||t==="dots"?"":`条码看不清?切「点阵 ${e}dpi」档(1 屏幕像素 = 1 打印点)`}const nc="print-preview-zoom-guard";function J0(e,t){if(!e?.documentElement)return;let r=e.getElementById(nc);r||(r=e.createElement("style"),r.id=nc,(e.head??e.documentElement).appendChild(r)),r.textContent=`html{zoom:${t}}@media print{html{zoom:1 !important}}`}function Q0(e,t,r){return e.some(o=>o.key===t)?t:oc()}function e1(e,t){return e.find(r=>r.key===t)?.value??1}function t1(){return Ba().filter(e=>gt(e).zoneAllowed===!0)}t1();function ic(e){return gt(e).zoneAllowed===!0}function r1(e){return ir(e)}function ss(e){const t=r1(e),r=e.margins,o=e.header.height,n=e.footer.height,i=t.width-r.left-r.right,a=t.height-r.top-r.bottom-o-n,s=(p,l,d,u)=>({left:p,top:l,width:d,height:u});return{header:s(r.left,r.top,i,o),content:s(r.left,r.top+o,i,a),footer:s(r.left,t.height-r.bottom-n,i,n)}}function ac(e,t,r){const o=ss(e);return o.footer.height>0&&r>=o.footer.top?"footer":o.header.height>0&&r<o.header.top+o.header.height?"header":"content"}function ls(e,t){const r=e.options;r.width=Math.min(r.width,t.width),r.height=Math.min(r.height,t.height),r.left=Math.min(Math.max(0,r.left),t.width-r.width),r.top=Math.min(Math.max(0,r.top),t.height-r.height)}function o1(e,t){const r=ss(t),o=e.zone||"content",n=r[o],i=n.left+e.options.left+e.options.width/2,a=n.top+e.options.top+e.options.height/2;let s=ac(t,i,a),p=!1;if(s!=="content"&&!ic(e.printElementType.type)&&(s="content",p=!0),s!==o){const l=r[s];e.options.left=n.left+e.options.left-l.left,e.options.top=n.top+e.options.top-l.top,e.zone=s}return s!=="content"?ls(e,r[s]):p&&ls(e,r.content),{rejected:p}}const ps=22,ds=[1,2,5,10,20,50,100,200,500,1e3];function n1(e,t=64){const r=e*3.7795275590551185;for(const o of ds)if(o*r>=t)return o;return ds[ds.length-1]}function i1(e){const t=Math.floor(Math.log10(e)+1e-9),r=e/10**t;return r===5||r===1&&e>=10?e/5:r===2?e/2:null}function a1(e){return Math.round(e*1e3)/1e3}function s1(e,t,r){if(t<e||r<=0)return[];const n=i1(r)??r,i=Math.ceil(e/n-1e-9)*n,a=Math.floor((t-i)/n+1e-9),s=[];for(let p=0;p<=a;p++){const l=a1(i+p*n);Math.abs(l/r-Math.round(l/r))<1e-6?s.push({mm:l,major:!0,label:String(l)}):s.push({mm:l,major:!1})}return s}const sc=["#000000","#333333","#666666","#999999","#cccccc","#ffffff","#e53935","#fb8c00","#1e88e5","#43a047","#8d6e63","#00acc1"],cs=[{group:"position-size",groupLabel:"位置与尺寸",items:[{key:"ps-left",keywords:["X","横坐标","left","位置"]},{key:"ps-top",keywords:["Y","纵坐标","top","位置"]},{key:"ps-width",keywords:["W","宽度","width","尺寸"]},{key:"ps-height",keywords:["H","高度","height","尺寸"]},{key:"ps-margin-top",keywords:["上外边距","外边距","margintop"],default:0,defaultUnit:"mm"},{key:"ps-margin-right",keywords:["右外边距","外边距","marginright"],default:0,defaultUnit:"mm"},{key:"ps-margin-bottom",keywords:["下外边距","外边距","marginbottom"],default:0,defaultUnit:"mm"},{key:"ps-margin-left",keywords:["左外边距","外边距","marginleft"],default:0,defaultUnit:"mm"}]},{group:"appearance",groupLabel:"外观",items:[{key:"ap-font-family",keywords:["字体","字体名","字体族","fontfamily"]},{key:"ap-font-size",keywords:["字体大小","fontsize","字号"]},{key:"ap-font-weight",keywords:["字体粗细","粗体","bold"]},{key:"ap-align",keywords:["对齐","align"]},{key:"ap-vertical-align",keywords:["垂直对齐","verticalalign","顶对齐","底对齐"]},{key:"ap-color",keywords:["颜色","color"]},{key:"ap-bg-color",keywords:["背景色","background"]},{key:"ap-line-height",keywords:["行高","lineheight"]},{key:"ap-letter-spacing",keywords:["字间距","letterspacing"]},{key:"ap-text-fit",keywords:["溢出","溢出显示","截断","自动缩小","自适应行高","textfit","overflow"]},{key:"ap-shrink-min",keywords:["最小字号","缩放下限","shrinkminfontsize"],default:hd,defaultUnit:"pt"},{key:"ap-word-wrap",keywords:["自动换行","不换行","wordwrap"]},{key:"ap-keep-line-breaks",keywords:["保留换行符","换行符","手动换行","保留空格","连续空格","行首空格","keeplinebreaks"]},{key:"ap-long-text-indent",keywords:["首行缩进","缩进","indent","longtextindent","两字符","段首"],tipKey:"propertyTips.ap-long-text-indent"},{key:"ap-img-fit",keywords:["缩放模式","拉伸","等比","fit","contain","cover","填充","裁剪","剪裁","锚点"],tipKey:"propertyTips.ap-img-fit"},{key:"ap-img-object-position",keywords:["裁剪锚点","剪裁锚点","锚点","objectposition","object-position","对齐点","上移","头顶"],tipKey:"propertyTips.ap-img-object-position"},{key:"ap-img-fit-scale",keywords:["放大比例","剪裁放大","放大倍数","取景","裁切范围","fitscale","zoom"],default:Oo,defaultUnit:"%",tipKey:"propertyTips.ap-img-fit-scale"},{key:"ap-rotate",keywords:["旋转","角度","rotate","angle","顺时针","逆时针","90度","直角"],tipKey:"propertyTips.ap-rotate"}]},{group:"flow-list",groupLabel:"流式列表",items:[{key:"fl-columns",keywords:["每行列数","列数","栏数","几列","flowcolumns"],tipKey:"propertyTips.fl-columns"},{key:"fl-row-height",keywords:["行高","每行高度","单元高度","flowrowheight"],tipKey:"propertyTips.fl-row-height"},{key:"fl-gap-x",keywords:["单元间距","横向间距","格间距","列间距","flowgapx"],tipKey:"propertyTips.fl-gap-x"},{key:"fl-auto-span",keywords:["自适应","跨列","内容过长","占两列","自动换行","flowsautspan","flowautospan"],tipKey:"propertyTips.fl-auto-span"},{key:"fl-max-span",keywords:["最多跨几列","跨列上限","flowmaxspan"],tipKey:"propertyTips.fl-max-span"},{key:"fl-layout-mode",default:"fixed",keywords:["布局模式","容器模式","固定高度","动态分页","自动高度","flowlayoutmode"],tipKey:"propertyTips.fl-layout-mode"},{key:"fl-padding-top",keywords:["上内边距","内边距","顶边距","flowpaddingtop"],default:0,defaultUnit:"mm",tipKey:"propertyTips.fl-padding-top"},{key:"fl-padding-right",keywords:["右内边距","内边距","右边距","flowpaddingright"],default:0,defaultUnit:"mm",tipKey:"propertyTips.fl-padding-right"},{key:"fl-padding-bottom",keywords:["下内边距","内边距","底边距","flowpaddingbottom"],default:0,defaultUnit:"mm",tipKey:"propertyTips.fl-padding-bottom"},{key:"fl-padding-left",keywords:["左内边距","内边距","左边距","flowpaddingleft"],default:0,defaultUnit:"mm",tipKey:"propertyTips.fl-padding-left"}]},{group:"code",groupLabel:"条码设置",items:[{key:"cd-type",keywords:["码制","条码类型","条形码类型","barcodetype","code128","ean13","code39","itf14"]},{key:"cd-dpi",keywords:["打印机分辨率","dpi","打印点","点阵对齐","203","300"]},{key:"cd-bar-width",keywords:["条宽","条粗细","barwidth","模块宽"]},{key:"cd-bar-quiet-zone",keywords:["条码静区","条码白边","条形码留白","条码空白边","barquietzone"],default:Ed,defaultUnit:"模块",tipKey:"propertyTips.cd-bar-quiet-zone"},{key:"cd-bar-height",keywords:["条高","条码高度","条区高度","条码多高","barheight"],default:nr,defaultUnit:"模块",tipKey:"propertyTips.cd-bar-height"},{key:"cd-show-text",keywords:["显示文本","条码文本","显示数字"]},{key:"cd-font-size",keywords:["条码字号","文本字号"],default:Nn,defaultUnit:"模块"},{key:"cd-ec-level",keywords:["纠错级别","容错","qrcodelevel"]},{key:"cd-quiet-zone",keywords:["静区","静区宽度","白边","空白边","留白","铺满","quietzone"],default:Sd,defaultUnit:"模块",tipKey:"propertyTips.cd-quiet-zone"},{key:"cd-fit",keywords:["缩放模式","拉伸","等比","fit","contain","cover"]},{key:"cd-max-width",keywords:["最大宽度","最大宽","maxwidth"]},{key:"cd-max-height",keywords:["最大高度","最大高","maxheight"]}]},{group:"content",groupLabel:"内容",items:[{key:"ct-title",keywords:["内容","文本","title"]},{key:"ct-formatter",keywords:["格式化","表达式","formatter"]},{key:"ct-table-mode",keywords:["数据模式","静态布局","动态数据"]},{key:"ct-table-source",keywords:["数据源","列表字段"]},{key:"ct-table-font",keywords:["默认字号","默认颜色","默认内边距"]},{key:"ct-table-cols",keywords:["列宽","表格列"]}]},{group:"border-bg",groupLabel:"边框与背景",items:[{key:"bb-border-style",keywords:["线型","边框线型","实线","虚线","点线","双线","borderstyle"]},{key:"bb-border-width",keywords:["边框宽度","border"]},{key:"bb-border-color",keywords:["边框颜色"]},{key:"bb-bg-color",keywords:["背景色","background"]}]},{group:"binding",groupLabel:"字段绑定",items:[{key:"bd-formatter",keywords:["格式化","表达式","formatter","fx","字段","绑定","field"]},{key:"bd-content",keywords:["内容","表达式","文本","变量"]}]},{group:"pagination",groupLabel:"分页",items:[{key:"pg-enabled",keywords:["分页","pagination","启用分页"]},{key:"pg-pageable",keywords:["参与分页","pageable"]},{key:"pg-keep-with-next",keywords:["同页","keepWithNext"]}]},{group:"advanced",groupLabel:"高级",items:[{key:"ad-locked",keywords:["锁定","lock"]},{key:"ad-fixed",keywords:["每页重复","repeat"]},{key:"ad-fixed-position",keywords:["固定","每页固定","fixed"]},{key:"ad-z-index",keywords:["层级","zindex"]},{key:"ad-delete",keywords:["删除"]}]}];function lc(e,t){const r=e.trim().toLowerCase();return r?t.some(o=>o.toLowerCase().includes(r)):!0}function l1(e){const t=[],r=new Set;for(const o of cs){const n=o.items.filter(i=>lc(e,[...i.keywords,o.groupLabel]));if(n.length>0){t.push(o.group);for(const i of n)r.add(i.key)}}return{groups:t,itemKeys:r}}function p1(e){for(const t of cs)for(const r of t.items)if(r.key===e&&r.default!==void 0)return{value:r.default,unit:r.defaultUnit}}function d1(e){return/[\u1100-\u115F\u2E80-\uA4CF\uAC00-\uD7A3\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFF60\uFFE0-\uFFE6]/.test(e)}function c1(e){let t=0;for(const r of e)t+=d1(r)?1:.55;return t}function u1(e){return c1(e)>=4}const f1=new Set(["constructor","__proto__","prototype","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),h1=new Set(["new","function","class","this","delete","typeof","void","in","of","var","let","const","return","if","while","for"]);function us(e){const t=[];let r=0;const o=e.length;for(;r<o;){const n=e[r];if(/\s/.test(n)){r++;continue}if(/[0-9]/.test(n)||n==="."&&r+1<o&&/[0-9]/.test(e[r+1])){let s=r;for(;s<o&&/[0-9.]/.test(e[s]);)s++;t.push({type:"num",value:e.slice(r,s),position:r}),r=s;continue}if(n==="'"||n==='"'){let s=r+1,p="";for(;s<o&&e[s]!==n;)e[s]==="\\"&&s+1<o?(p+=e[s+1],s+=2):(p+=e[s],s++);if(s>=o)throw new Error($("diagnostic.lexer.unterminatedString"));t.push({type:"str",value:p,position:r}),r=s+1;continue}if(/[A-Za-z_$\u4e00-\u9fff]/.test(n)){let s=r;for(;s<o&&/[A-Za-z0-9_$\u4e00-\u9fff]/.test(e[s]);)s++;const p=e.slice(r,s);if(h1.has(p))throw new Error($("diagnostic.lexer.keyword",{word:p}));if(f1.has(p))throw new Error($("diagnostic.lexer.forbidden",{word:p}));p==="true"||p==="false"?t.push({type:"bool",value:p,position:r}):t.push({type:"ident",value:p,position:r}),r=s;continue}const i=e.slice(r,r+3);if(i==="==="||i==="!=="){t.push({type:"punc",value:i,position:r}),r+=3;continue}const a=e.slice(r,r+2);if(a==="=>")throw new Error($("diagnostic.lexer.noFunctionDef"));if(["==","!=","<=",">=","&&","||"].includes(a)){t.push({type:"punc",value:a,position:r}),r+=2;continue}if(n==="=")throw new Error($("diagnostic.lexer.noAssignment"));if(n===";")throw new Error($("diagnostic.lexer.noMultipleStatements"));if("+-*/%()[]{},:.?!<>".includes(n)){t.push({type:"punc",value:n,position:r}),r++;continue}throw new Error($("diagnostic.lexer.invalidChar",{ch:n}))}return t}function fs(e){return new m1(e).parse()}class m1{constructor(t){this.pos=0,this.tokens=t}parse(){const t=this.parseTernary();if(this.pos<this.tokens.length)throw new Error($("diagnostic.parser.trailingContent",{value:this.tokens[this.pos].value}));return t}peek(){return this.tokens[this.pos]}next(){const t=this.tokens[this.pos++];if(!t)throw new Error($("diagnostic.expressionUnexpectedEnd"));return t}eatPunc(t){const r=this.peek();return r&&r.type==="punc"&&r.value===t?(this.pos++,!0):!1}expectPunc(t){if(!this.eatPunc(t)){const r=this.peek()?.position??0;throw new Error($("diagnostic.parser.expected",{pos:r,value:t}))}}parseTernary(){const t=this.parseLogicalOr();if(this.eatPunc("?")){const r=this.parseTernary();this.expectPunc(":");const o=this.parseTernary();return{type:"ternary",cond:t,consequent:r,alternate:o}}return t}parseLogicalOr(){let t=this.parseLogicalAnd();for(;this.eatPunc("||");){const r=this.parseLogicalAnd();t={type:"binary",op:"||",left:t,right:r}}return t}parseLogicalAnd(){let t=this.parseEquality();for(;this.eatPunc("&&");){const r=this.parseEquality();t={type:"binary",op:"&&",left:t,right:r}}return t}parseEquality(){let t=this.parseRelational();for(;;){const r=this.peek();if(r?.type==="punc"&&["==","!=","===","!=="].includes(r.value)){this.pos++;const o=this.parseRelational();t={type:"binary",op:r.value,left:t,right:o}}else return t}}parseRelational(){let t=this.parseAdditive();for(;;){const r=this.peek();if(r?.type==="punc"&&["<",">","<=",">="].includes(r.value)){this.pos++;const o=this.parseAdditive();t={type:"binary",op:r.value,left:t,right:o}}else return t}}parseAdditive(){let t=this.parseMultiplicative();for(;;){const r=this.peek();if(r?.type==="punc"&&(r.value==="+"||r.value==="-")){this.pos++;const o=this.parseMultiplicative();t={type:"binary",op:r.value,left:t,right:o}}else return t}}parseMultiplicative(){let t=this.parseUnary();for(;;){const r=this.peek();if(r?.type==="punc"&&["*","/","%"].includes(r.value)){this.pos++;const o=this.parseUnary();t={type:"binary",op:r.value,left:t,right:o}}else return t}}parseUnary(){const t=this.peek();if(t?.type==="punc"&&["!","-","+"].includes(t.value)){this.pos++;const r=this.parseUnary();return{type:"unary",op:t.value,arg:r,prefix:!0}}return this.parsePostfix()}parsePostfix(){let t=this.parsePrimary();for(;;)if(this.eatPunc(".")){const r=this.next();if(r.type!=="ident")throw new Error($("diagnostic.parser.memberName",{pos:r.position}));t={type:"member",object:t,property:r.value,computed:!1}}else if(this.eatPunc("[")){const r=this.parseTernary();this.expectPunc("]"),r.type==="str"?t={type:"member",object:t,property:r.value,computed:!1}:t={type:"member",object:t,property:r.name??String(r.value),computed:!0}}else if(this.peek()?.type==="punc"&&this.peek()?.value==="("&&(t.type==="ident"||t.type==="member")){this.pos++;const r=this.parseArgs();t={type:"call",callee:t,args:r}}else return t}parseArgs(){const t=[];if(this.eatPunc(")"))return t;for(;;){if(t.push(this.parseTernary()),this.eatPunc(")"))return t;this.expectPunc(",")}}parsePrimary(){const t=this.next();if(t.type==="num"){const r=Number(t.value);if(isNaN(r))throw new Error($("diagnostic.parser.invalidNumber",{value:t.value}));return{type:"num",value:r}}if(t.type==="str")return{type:"str",value:t.value};if(t.type==="bool")return{type:"bool",value:t.value==="true"};if(t.type==="ident")return{type:"ident",name:t.value};if(t.value==="("){const r=this.parseTernary();return this.expectPunc(")"),r}if(t.value==="["){const r=[];if(!this.eatPunc("]"))for(;r.push(this.parseTernary()),!this.eatPunc("]");)this.expectPunc(",");return{type:"array",elements:r}}if(t.value==="{"){const r=[];if(!this.eatPunc("}"))for(;;){const o=this.next();if(o.type!=="ident"&&o.type!=="str")throw new Error($("diagnostic.parser.objectKey",{pos:o.position}));if(this.expectPunc(":"),r.push({key:o.value,value:this.parseTernary()}),this.eatPunc("}"))break;this.expectPunc(",")}return{type:"object",properties:r}}throw new Error($("diagnostic.parser.unexpectedToken",{pos:t.position,value:t.value}))}}const pc=20,g1=8;function at(e,t=0){if(typeof e=="number")return Number.isFinite(e)?e:t;if(typeof e=="string"){const r=e.trim();if(r==="")return t;const o=Number(r);return Number.isFinite(o)?o:t}return e==null?t:typeof e=="boolean"?e?1:0:t}function b1(e){if(typeof e=="number")return Number.isFinite(e);if(typeof e=="string"){const t=e.trim();return t!==""&&Number.isFinite(Number(t))}return!1}function Jr(e){return!Number.isFinite(e)||Number.isInteger(e)||Math.abs(e)>=1e15?e:Number(e.toPrecision(12))}function Qr(e){if(!Number.isFinite(e)||Number.isInteger(e))return 0;const t=String(e);if(t.includes("e")||t.includes("E"))return 0;const r=t.indexOf(".");return r===-1?0:t.length-r-1}function hs(e,t){if(!Number.isFinite(e))return 0;const r=Math.min(Math.max(t,0),12);if(r===0)return Math.round(e);const o=10**r,n=e*o;return!Number.isFinite(n)||Math.abs(n)>=1e15?Jr(e):Math.round(n)/o}function ms(e,t){const r=at(e),o=at(t),n=r+o;return hs(n,Math.max(Qr(r),Qr(o)))}function gs(e,t){const r=at(e),o=at(t),n=r-o;return hs(n,Math.max(Qr(r),Qr(o)))}function dc(e,t){const r=at(e),o=at(t),n=r*o;return hs(n,Qr(r)+Qr(o))}function cc(e,t){const r=at(e),o=at(t);return o===0?0:Jr(r/o)}function k1(e,t){const r=at(e),o=at(t);return o===0?0:Jr(r%o)}function y1(e){if(e==null)return 2;const t=Math.trunc(at(e,2));return Number.isFinite(t)?Math.min(Math.max(t,-pc),pc):2}function Kn(e,t,r){const o=at(e,0),n=y1(t);if(o===0)return 0;if(Math.abs(o)>=1e21)return Jr(o);const i=Math.max(n,0)+g1,a=o.toFixed(i);if(!/^-?\d+(\.\d+)?$/.test(a))return Jr(o);const s=a.startsWith("-"),p=a.replace("-","").replace(".","");let l=BigInt(p||"0");s&&(l=-l);const d=10n**BigInt(i-n),u=l<0n?-1n:1n,c=l<0n?-l:l;let f=c/d;const h=c%d,b=2n*h;r==="up"?h!==0n&&(f+=1n):r!=="down"&&b>=d&&(b>d||r==="half-up"||f%2n===1n)&&(f+=1n);const k=u*f;return Jr(n>=0?Number(k)/10**n:Number(k)*10**-n)}const bs={Math,Number,String,Boolean,parseInt,parseFloat,isNaN,true:!0,false:!1,null:null,undefined:void 0},v1=new Set(["constructor","__proto__","prototype","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),w1=new Set(["Number","String","Boolean","parseInt","parseFloat","isNaN"]);function et(e,t,r={}){switch(e.type){case"num":return e.value;case"str":return e.value;case"bool":return e.value;case"ident":return x1(e.name,t);case"binary":return P1(e,t,r);case"unary":return E1(e,t,r);case"ternary":return et(e.cond,t,r)?et(e.consequent,t,r):et(e.alternate,t,r);case"member":return M1(e,t,r);case"call":return C1(e,t,r);case"array":return e.elements.map(o=>et(o,t,r));case"object":return Object.fromEntries(e.properties.map(o=>[o.key,et(o.value,t,r)]))}}function x1(e,t,r){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];if(Object.prototype.hasOwnProperty.call(bs,e))return bs[e];throw new Error($("diagnostic.evaluator.undefinedIdentifier",{name:e}))}function P1(e,t,r){const o=et(e.left,t,r),n=et(e.right,t,r);switch(e.op){case"+":return T1(o,n)?ms(o,n):S1(o,n);case"-":return gs(o,n);case"*":return dc(o,n);case"/":return cc(o,n);case"%":return k1(o,n);case"<":return o<n;case">":return o>n;case"<=":return o<=n;case">=":return o>=n;case"==":return o==n;case"!=":return o!=n;case"===":return o===n;case"!==":return o!==n;case"&&":return o&&n;case"||":return o||n;default:throw new Error($("diagnostic.evaluator.unknownOperator",{op:e.op}))}}function E1(e,t,r){const o=et(e.arg,t,r);switch(e.op){case"-":return gs(0,o);case"+":return at(o);case"!":return!o;default:throw new Error($("diagnostic.evaluator.unknownUnaryOperator",{op:e.op}))}}function S1(e,t){return`${e==null?"":String(e)}${t==null?"":String(t)}`}function T1(e,t){const r=uc(e),o=uc(t);return r==="other"||o==="other"?!1:r==="num"||o==="num"}function uc(e){return e==null||e===""?"neutral":b1(e)?"num":"other"}function M1(e,t,r){const o=et(e.object,t,r);if(o==null)throw new Error($("diagnostic.evaluator.nullProperty"));if(v1.has(e.property))throw new Error($("diagnostic.evaluator.forbiddenProperty",{property:e.property}));return o[e.property]}function C1(e,t,r){if(e.callee.type==="ident"&&w1.has(e.callee.name)){const n=bs[e.callee.name],i=e.args.map(a=>et(a,t,r));return n(...i)}if(e.callee.type==="member"&&e.callee.object.type==="ident"&&e.callee.object.name==="Math"){const n=Math[e.callee.property];if(typeof n!="function")throw new Error($("diagnostic.evaluator.mathNotMethod",{name:e.callee.property}));const i=e.args.map(a=>et(a,t,r));return n(...i)}let o;if(e.callee.type==="ident")o=e.callee.name;else if(e.callee.type==="member")throw new Error($("diagnostic.evaluator.noMethodCall"));if(o&&r[o]){const n=e.args.map(i=>et(i,t,r));return r[o](...n)}throw o&&Object.prototype.hasOwnProperty.call(t,o)?new Error($("diagnostic.evaluator.notFunction",{name:o})):new Error($("diagnostic.evaluator.forbiddenCall",{name:o??"表达式"}))}function _1(e){const t=[];let r=0;const o=e.length;for(;r<o;){if(e[r]==="{"){let i=1,a=r+1;for(;a<o&&i>0;)e[a]==="{"?i++:e[a]==="}"&&i--,a++;if(i!==0)throw new Error($("diagnostic.template.unclosedBrace",{pos:r}));const s=e.slice(r+1,a-1);if(s.trim()==="")throw new Error($("diagnostic.template.emptyExpression",{pos:r}));const p=us(s),l=fs(p);t.push({type:"expr",expression:l}),r=a;continue}let n=r;for(;n<o&&e[n]!=="{";)e[n]==="\\"&&n+1<o&&(e[n+1]==="{"||e[n+1]==="}")?n+=2:n++;t.push({type:"text",value:e.slice(r,n).replace(/\\([{}])/g,"$1")}),r=n}return{type:"template",parts:t}}function D1(e,t,r={}){let o="";for(const n of e.parts)if(n.type==="text")o+=n.value;else{const i=et(n.expression,t,r);o+=String(i??"")}return o}function fc(e,t={}){const r=_1(e);return o=>D1(r,o,t)}function $o(e,t){if(e==null||t==null)return;if(typeof e=="object"&&t in e)return e[t];const r=t.split(".");let o=e;for(const n of r){if(o==null)return;o=o[n]}return o}function hc(e){const t=Number(e);if(isNaN(t))return String(e);const r=t<0?"-":"",o=Math.abs(t),[n,i]=o.toFixed(2).split("."),a=n.replace(/\B(?=(\d{3})+(?!\d))/g,",");return`${r}${a}.${i}`}function mc(e,t){let r;if(e instanceof Date)r=e;else if(typeof e=="number")r=new Date(e);else if(typeof e=="string")r=new Date(e);else return String(e);if(isNaN(r.getTime()))return String(e);const o=n=>String(n).padStart(2,"0");return t.replace("YYYY",String(r.getFullYear())).replace("MM",o(r.getMonth()+1)).replace("DD",o(r.getDate())).replace("HH",o(r.getHours())).replace("mm",o(r.getMinutes())).replace("ss",o(r.getSeconds()))}const ks=["零","壹","贰","叁","肆","伍","陆","柒","捌","玖"],A1=["","拾","佰","仟"],O1=["","万","亿","万亿","亿亿"];function R1(e){let t="",r=!1;for(let o=3;o>=0;o--){const n=Math.floor(e/10**o)%10;if(n===0){t&&(r=!0);continue}r&&(t+="零",r=!1),t+=ks[n]+A1[o]}return t}function gc(e){const t=Number(e);if(isNaN(t))return String(e);if(t===0)return"零元整";const r=t<0?"负":"",[o,n]=Math.abs(t).toFixed(2).split("."),i=Math.ceil(o.length/4);let a="",s=!1;for(let d=i-1;d>=0;d--){const u=o.length-d*4,c=parseInt(o.slice(Math.max(0,u-4),u),10);if(c===0){a&&(s=!0);continue}a&&(s||c<1e3)&&(a+="零"),s=!1,a+=R1(c)+(O1[d]??"")}a=`${a||"零"}元`;const p=parseInt(n[0],10),l=parseInt(n[1],10);return p===0&&l===0?a+="整":(p===0?a+="零":a+=ks[p]+"角",l>0&&(a+=ks[l]+"分")),r+a}function bc(e,t,r){return e?t:r}function ys(e,t){return e.reduce((r,o)=>r+(Number($o(o,t))||0),0)}function kc(e,t){return e.length===0?0:ys(e,t)/e.length}function yc(e,t){return e.length}function vc(e,t){return e.length===0?0:Math.min(...e.map(r=>Number($o(r,t))||0))}function wc(e,t){return e.length===0?0:Math.max(...e.map(r=>Number($o(r,t))||0))}function xc(...e){return e.reduce((t,r)=>ms(t,r),0)}function Pc(...e){return e.length===0?0:e.slice(1).reduce((t,r)=>gs(t,r),ms(e[0],0))}function Ec(...e){return e.length===0?0:e.reduce((t,r)=>dc(t,r),1)}function Sc(e,t){return cc(e,t)}function Tc(e,t){return Kn(e,t,"half-up")}function Yn(e,t){return Kn(e,t,"up")}function Xn(e,t){return Kn(e,t,"down")}function Mc(e,t){return Kn(e,t,"half-even")}class I1{constructor(){this.functions={}}registerFunction(t,r){this.functions[t]=r}evaluate(t,r){const o=us(t),n=fs(o);return et(n,r,this.functions)}render(t,r){return fc(t,this.functions)(r)}}const vs=new I1,L1={MONEY:hc,DATE:mc,UPPER:gc,IF:bc,CONCAT:(...e)=>e.filter(t=>t!=null).map(String).join(""),IFEMPTY:(e,t)=>e!=null&&e!==""?String(e):t,LEN:e=>String(e).length,ADD:xc,SUB:Pc,MUL:Ec,DIV:Sc,ROUND:Tc,ROUNDUP:Yn,CEIL:Yn,ROUNDDOWN:Xn,FLOOR:Xn,ROUNDBANK:Mc};for(const[e,t]of Object.entries(L1))vs.registerFunction(e,t);function B1(e,t,r){switch(e.toUpperCase()){case"SUM":return ys(r,t);case"AVG":return kc(r,t);case"COUNT":return yc(r);case"MIN":return vc(r,t);case"MAX":return wc(r,t);default:return 0}}function N1(e,t){return vs.evaluate(e,t)}function ar(e,t,r){if(!e)return"";if(!e.includes("{"))return e;const o=Array.isArray(t.rows)?t.rows:[],n=e.replace(/\{([^}]+)\}/g,(i,a)=>{let s=a.trim();return s=s.replace(/\b(SUM|AVG|COUNT|MIN|MAX)\(([^)]+)\)/g,(p,l,d)=>{const u=d.trim().replace(/^['"]|['"]$/g,"");return String(B1(l,u,o))}),`{${s}}`});try{return vs.render(n,t)}catch{return r??e}}function Cc(e,t,r,o){const n={...Qn(),...t??{}},i=JSON.parse(JSON.stringify(e));i.header?.elements&&(i.header.elements=i.header.elements.map(s=>ws(s,n,r))),i.footer?.elements&&(i.footer.elements=i.footer.elements.map(s=>ws(s,n,r))),i.elements=i.elements.map(s=>ws(s,n,r));const a=o??r;if(a&&i.fonts?.length){const s=a.replace(/\/+$/,"");i.fonts=i.fonts.map(p=>({...p,files:(p.files??[]).map(l=>({...l,url:l.url?.startsWith("/")&&!l.url.startsWith("//")?s+l.url:l.url}))}))}return i}function ws(e,t,r){const o={...e,options:{...e.options}};if(!(o.type==="flowList"||o.printElementType?.type==="flowList")&&typeof o.options.formatter=="string"){const p=o.options.formatter;if(Ho(p))o.options.rawFormatter=p;else{const l=o.type||o.printElementType?.type,d=typeof o.options.exampleValue=="string"?o.options.exampleValue:Bb(l);o.options.formatter=ar(p,t,d)}}if((o.type==="image"||o.printElementType?.type==="image")&&typeof o.options.src=="string"){let p=o.options.src;if(p.includes("{")){const l=typeof o.options.exampleValue=="string"?o.options.exampleValue:"";p=ar(p,t,l)}p&&r&&!/^([a-z][a-z\d+\-.]*:|\/\/)/i.test(p)&&(p=r.replace(/\/+$/,"")+(p.startsWith("/")?p:`/${p}`)),o.options.src=p}(o.type==="table"||o.printElementType?.type==="table")&&$1(o,t),(o.type==="flowList"||o.printElementType?.type==="flowList")&&F1(o,t);const a=o.type||o.printElementType?.type||"text",s=Vr(a)?.binding?.bind;if(s){const p=s(o.options,t);p&&typeof p=="object"&&Object.assign(o.options,p)}return o}function F1(e,t){const r=typeof e.options.formatter=="string"?e.options.formatter:"",o={...e.options,dataSource:e.options.dataSource??Bn(r,t)},{list:n,key:i}=_c(o,t),a=p=>i?{...t,...p,[i]:p}:{...t,...p},s=n.map(p=>r?Ho(r)?r:ar(r,a(p)):String(p??""));if(e.options._flowItems=s,e.options._flowRawFormatter=Ho(r)?r:void 0,wr(e.options.flowLayoutMode)==="dynamic"){const p=vd(e.options.width??0,Gr(e.options)),l=s.length>0?s:String(e.options.testData??"").split(/\r?\n/).map(d=>d.trim()).filter(Boolean);e.options._flowRows=Ua(l,{width:p,columns:bt(e.options.flowColumns),gapX:Et(e.options.flowGapX),fontSizePt:e.options.fontSize??12,autoSpan:e.options.flowAutoSpan===!0,maxSpan:xr(e.options.flowMaxSpan,e.options.flowColumns)})}}function _c(e,t){const r=e.dataSource??e.fields?.[0]?.dataSource??e.fields?.[0]?.field;if(r)return{list:Array.isArray(t[r])?t[r]:[],key:r};for(const[o,n]of Object.entries(t))if(Array.isArray(n))return{list:n,key:o};return{list:[],key:r}}function $1(e,t){const r=e.options,o=r.tableRows;if(!Array.isArray(o)||o.length===0)return;const n=r.tableMode??"dynamic",{list:i,key:a}=n==="dynamic"?_c(r,t):{list:[],key:void 0},s=h=>a?{...t,...h,[a]:h}:{...t,...h},p=a?i.map(h=>({...h,[a]:h})):i,l=[],d=[],u=[],c=[];let f=-1;for(const h of o){if(n==="dynamic"&&h.type==="data"){z1(h.cells);for(const b of i){f<0&&(f=l.length);const k=s(b);l.push(Jn(h,v=>Zn(v,k))),d.push(k)}continue}if(n==="dynamic"&&h.type==="subtotal"){const b=Jn(h,k=>Zn(k,{rows:p,...t}),!0);u.push(b),l.push(b);continue}if(n==="dynamic"&&h.type==="summary"){const b=Jn(h,k=>Zn(k,{rows:p,...t}));c.push(b),l.push(b);continue}l.push(Jn(h,b=>Zn(b,t)))}r._renderRows=l,r._repeatHeaderCount=H1(o),r._dataRowCtx=d,r._dataStartIdx=f<0?l.length:f,r._subtotalTemplates=u,r._summaryRows=c,r._mainData=t}function z1(e){const t=new Set;e.forEach((r,o)=>{if(!r||r.merged)return;const n=Math.max(r.colspan??1,1);for(let i=1;i<n;i++)t.add(o+i)}),e.forEach((r,o)=>{r.rowspan&&(r.rowspan=1),r.merged&&!t.has(o)&&(r.merged=!1)})}function Zn(e,t){const r=e.formatter;return r?Ho(r)?r:ar(r,t,""):""}function Jn(e,t,r=!1){return{type:e.type,height:e.height??8,cells:e.cells.map(o=>({content:o.merged?"":t(o),...(r||Ho(o.formatter))&&!o.merged?{rawFormatter:o.formatter??""}:{},cellType:o.cellType,barcodeType:o.barcodeType,qrCodeLevel:o.qrCodeLevel,qrQuietZone:o.qrQuietZone,barQuietZone:o.barQuietZone,barHeight:o.barHeight,barWidth:o.barWidth,barFontSize:o.barFontSize,showBarcodeText:o.showBarcodeText,printerDpi:o.printerDpi,fit:o.fit,objectPosition:o.objectPosition,fitScale:o.fitScale,maxWidth:o.maxWidth,maxHeight:o.maxHeight,rowspan:o.rowspan??1,colspan:o.colspan??1,merged:o.merged===!0,...o.mergeSameValue===!0?{mergeSameValue:!0}:{},align:o.align,valign:o.valign,fontSize:o.fontSize,fontFamily:o.fontFamily,fontWeight:o.fontWeight,color:o.color,backgroundColor:o.backgroundColor,borders:o.borders,padding:o.padding,wordWrap:o.wordWrap,textFit:o.textFit,shrinkMinFontSize:o.shrinkMinFontSize}))}}function H1(e){const t=U1(e);return t===0||!e.slice(0,t).some(o=>o.repeatOnPage===!0)?0:j1(e,t)}function U1(e){let t=0;for(const r of e){if(r?.type!=="header")break;t++}return t}function q1(e,t){for(let r=0;r<t;r++)for(const o of e[r]?.cells??[])if(!o?.merged&&r+(o?.rowspan??1)>t)return!1;return!0}function j1(e,t){for(let r=t;r>=1;r--)if(q1(e,r))return r;return 1}const zo=e=>String(e).padStart(2,"0");function Qn(e=new Date,t={}){return{printDate:`${e.getFullYear()}-${zo(e.getMonth()+1)}-${zo(e.getDate())}`,printTime:`${zo(e.getHours())}:${zo(e.getMinutes())}:${zo(e.getSeconds())}`,pageIndex:t.pageIndex??1,totalPages:t.totalPages??1}}function Ho(e){return typeof e=="string"&&/\b(pageIndex|totalPages)\b/.test(e)}function xs(e,t=new Date){const{printDate:r,printTime:o}=Qn(t);return e.replace(/\{printDate\}/g,r).replace(/\{printTime\}/g,o)}function Uo(e){const t=[];for(const r of e??[]){const o=r?.family?.trim();if(!o)continue;const n=`"${o.replace(/"/g,"")}"`;for(const i of r.files??[]){const a=i?.url?.trim();if(!a)continue;const s=Number.isFinite(i.weight)?Number(i.weight):400,p=i.style==="italic"?"italic":"normal";t.push(`@font-face{font-family:${n};src:url("${a}")${W1(a)};font-weight:${s};font-style:${p};font-display:block;}`)}}return t.length?`${t.join("")}
14
14
  `:""}function W1(e){const t=e.split(/[?#]/)[0].toLowerCase();return t.endsWith(".woff2")?' format("woff2")':t.endsWith(".woff")?' format("woff")':t.endsWith(".ttf")?' format("truetype")':t.endsWith(".otf")?' format("opentype")':""}const Ps=['"Microsoft YaHei"','"PingFang SC"','"Helvetica Neue"',"Arial","sans-serif"];function Es(e){return e.replace(/&/g,"&amp;").replace(/"/g,"&quot;")}function Ss(e){const t=e?.trim();return t?[t.includes(",")?t:`"${t.replace(/"/g,"")}"`,...Ps].join(", "):Ps.join(", ")}function Ts(e){return e?Ss(e):"inherit"}function V1(e){const t=[],r=new Set;for(const o of e??[]){const n=o?.family?.trim();if(!n)continue;const i=n.toLowerCase();if(r.has(i))continue;r.add(i);const a=o?.label?.trim();t.push(a?{family:n,label:a}:{family:n})}return t}function Dc(e,t){const r=t?.trim().toLowerCase();if(r)return e.find(o=>o.family.trim().toLowerCase()===r)}function Ac(e){return e.label?`${e.label}(${e.family})`:e.family}function qo(e){return e.toLowerCase().replace(/\s+/g,"")}function Oc(e,t){if(e===t)return 0;if(e.startsWith(t))return 1;if(e.includes(t))return 2;let r=0;for(const o of e)if(o===t[r]&&r++,r===t.length)return 3;return-1}function G1(e,t){const r=Oc(qo(e.family),t);if(!e.label)return r;const o=Oc(qo(e.label),t);return r<0?o:o<0?r:Math.min(r,o)}function K1(e,t){const r=qo(t.trim());return r?e.map((o,n)=>({font:o,index:n,rank:G1(o,r)})).filter(o=>o.rank>=0).sort((o,n)=>o.rank-n.rank||o.index-n.index).map(o=>o.font):[...e]}function Q(e){return`${e}mm`}function Ms(e,t){const r=Er(e);return t&&t>0&&It(e)?{width:r.width,height:t}:r}function Rc(e,t){const r=yt(e);return t&&t>0&&It(e)?{width:r.width,height:t}:r}function Ic(){return`
15
15
  /* ── 全局重置 ── */
16
16
  * { margin: 0; padding: 0; box-sizing: border-box; }
@@ -47,7 +47,7 @@ body { font-family: ${Ps.join(", ")}; }
47
47
  position: absolute;
48
48
  pointer-events: none;
49
49
  }
50
- `}function Nc(){return`
50
+ `}function Bc(){return`
51
51
  /* ── 元素通用定位 ── */
52
52
  .print-element {
53
53
  position: absolute;
@@ -83,7 +83,7 @@ body { font-family: ${Ps.join(", ")}; }
83
83
  height: auto;
84
84
  overflow: visible;
85
85
  }
86
- `}function Bc(e,t){return`
86
+ `}function Nc(e,t){return`
87
87
  /* ── 打印纸张:浏览器原生打印按此尺寸分页(Playwright page.pdf 以显式宽高为准,无副作用) ── */
88
88
  @page${t?` ${t}`:""} { size: ${Q(e.width)} ${Q(e.height)}; margin: 0; }
89
89
  `}function Fc(e,t,r,o=""){const n=`
@@ -140,7 +140,7 @@ ${r}.content-area {
140
140
  position: relative;
141
141
  overflow: visible;
142
142
  }
143
- `}function Y1(){return[Ic(),Lc(),Nc()].join("").trim()}function X1(e,t,r){return Bc(Ms(e,t),r).trim()}function Z1(e,t,r){const o=Ya(e),n=o!==0,i=Ms(e,r),a=Rc(e,r),s=t?`${t}.print-page`:".print-page",p=t?`${t} `:"";return[$c(e,i,s,n),zc(e,a,p),...n?[Fc(a,e.margins,o,p)]:[]].join("").trim()}function jo(e,t){const r=Ya(e),o=r!==0,n=Ms(e,t),i=Rc(e,t);return[Bc(n),Ic(),$c(e,n,".print-page",o),Lc(),zc(e,i,""),Nc(),...o?[Fc(i,e.margins,r)]:[]].join("").trim()}const Cs=".print-copy:not(:last-child){break-after:page;page-break-after:always;}";function J1(e,t){if(!It(e))return`${jo(e)}
143
+ `}function Y1(){return[Ic(),Lc(),Bc()].join("").trim()}function X1(e,t,r){return Nc(Ms(e,t),r).trim()}function Z1(e,t,r){const o=Ya(e),n=o!==0,i=Ms(e,r),a=Rc(e,r),s=t?`${t}.print-page`:".print-page",p=t?`${t} `:"";return[$c(e,i,s,n),zc(e,a,p),...n?[Fc(a,e.margins,o,p)]:[]].join("").trim()}function jo(e,t){const r=Ya(e),o=r!==0,n=Ms(e,t),i=Rc(e,t);return[Nc(n),Ic(),$c(e,n,".print-page",o),Lc(),zc(e,i,""),Bc(),...o?[Fc(i,e.margins,r)]:[]].join("").trim()}const Cs=".print-copy:not(:last-child){break-after:page;page-break-after:always;}";function J1(e,t){if(!It(e))return`${jo(e)}
144
144
  ${Cs}`;const{bottom:r}=e.margins,o=e.footer?.height??0,n=yt(e).width,i=jo(e,t[0]?.heightMm),a=t.map((s,p)=>{const l=s.heightMm,d=[`@page copy${p} { size: ${Q(n)} ${l?Q(l):"auto"}; margin: 0; }`,`.print-copy-${p} { page: copy${p}; }`];return l&&(d.push(`.print-copy-${p} .print-page { min-height: ${Q(l)}; }`),d.push(`.print-copy-${p} .page-footer { top: ${Q(l-r-o)}; }`)),d.join(`
145
145
  `)}).join(`
146
146
  `);return`${i}
@@ -178,7 +178,7 @@ ${Cs}`}function Q1(e){return`
178
178
  否则设计器预览错位 3.17mm、与出纸不一致 */
179
179
  .print-tile > .print-page { margin: 0; box-shadow: none; }
180
180
  }
181
- `}function ei(e,t,r,o,n,i){const a=["position:absolute",`left:${Q(e)}`,`top:${Q(t)}`,`width:${Q(r)}`];o!==void 0&&o>0&&a.push(`height:${Q(o)}`),n!==void 0&&a.push(`z-index:${n}`);const s=Un(i);return s&&a.push(s),a.join(";")+";"}const Hc=25.4/96,ge={color:"#cccccc",opacity:.15,rotate:-30,tileWidth:260,tileHeight:180,minTileWidth:140,minTileHeight:100,fontSize:16},ek={dense:{width:200,height:120,labelKey:"constants.watermark.density.dense"},medium:{width:260,height:180,labelKey:"constants.watermark.density.medium"},loose:{width:340,height:260,labelKey:"constants.watermark.density.loose"}};function Uc(e,t,r){const o=typeof e=="number"&&Number.isFinite(e)?e:t;return Math.max(r,Math.round(o))}function tk(e){return{width:Uc(e?.tileWidth,ge.tileWidth,ge.minTileWidth),height:Uc(e?.tileHeight,ge.tileHeight,ge.minTileHeight)}}function rk(e){return e?!e.mode||e.mode==="fixed"?!!e.content&&e.content.trim().length>0:!!e.binding&&e.binding.trim().length>0:!1}function ok(e,t,r){if(!e)return"";let o="";if(!e.mode||e.mode==="fixed")o=e.content??"";else if(typeof e.binding=="string"&&e.binding.trim()){const n=e.binding.trim(),i=Array.isArray(t)?t[0]??{}:t??{},a={...Qn(),...r,...i};let s;if(n.includes("{"))s=ar(n,a);else{try{s=B1(n,a)}catch{s=void 0}(s==null||typeof s=="object")&&(s=$o(i,n))}s!=null&&typeof s!="object"&&String(s)!==n?o=String(s):o=(typeof e.testData=="string"?e.testData.trim():"")?e.testData:`[${e.binding}]`}return e.timestamp&&o&&(o=`${o} ${nk(e.format)}`),o}function Wo(e){return String(e).padStart(2,"0")}function nk(e){const t=e&&e.trim()?e:"YYYY-MM-DD HH:mm",r=new Date,o={YYYY:String(r.getFullYear()),MM:Wo(r.getMonth()+1),DD:Wo(r.getDate()),HH:Wo(r.getHours()),mm:Wo(r.getMinutes()),ss:Wo(r.getSeconds())};return t.replace(/YYYY|MM|DD|HH|mm|ss/g,n=>o[n]??n)}function ti(e){return Math.round(e*1e4)/1e4}function ik(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function qc(e,t,r,o){if(!rk(e))return null;const n=ok(e,t,o);if(!n)return null;const i=tk(e),a=ti(i.width*Hc),s=ti(i.height*Hc),p={width:Math.max(0,Number.isFinite(r?.width)?r.width:0),height:Math.max(0,Number.isFinite(r?.height)?r.height:0)},l=Math.max(1,Math.ceil(p.width/a)),d=Math.max(1,Math.ceil(p.height/s)),u=[];for(let c=0;c<d;c++)for(let f=0;f<l;f++)u.push({leftMm:ti(f*a),topMm:ti(c*s),widthMm:a,heightMm:s});return{text:n,color:e?.color||ge.color,rotate:e?.rotate??ge.rotate,opacity:e?.opacity??ge.opacity,fontSizePx:ge.fontSize,tileWidthPx:i.width,tileHeightPx:i.height,tileWidthMm:a,tileHeightMm:s,columns:l,rows:d,tiles:u}}function ak(e,t){const r=e.tileWidthPx,o=e.tileHeightPx,n=r/2,i=o/2;return`<svg class="watermark-tile" style="${`left:${t.leftMm}mm;top:${t.topMm}mm;width:${t.widthMm}mm;height:${t.heightMm}mm`}" viewBox="0 0 ${r} ${o}" xmlns="http://www.w3.org/2000/svg"><text x="${n}" y="${i}" font-size="${e.fontSizePx}" fill="${e.color}" text-anchor="middle" dominant-baseline="middle" transform="rotate(${e.rotate},${n},${i})">${ik(e.text)}</text></svg>`}function jc(e,t,r,o){const n=qc(e,t,r,o);if(!n)return"";const i=n.tiles.map(a=>ak(n,a)).join(`
181
+ `}function ei(e,t,r,o,n,i){const a=["position:absolute",`left:${Q(e)}`,`top:${Q(t)}`,`width:${Q(r)}`];o!==void 0&&o>0&&a.push(`height:${Q(o)}`),n!==void 0&&a.push(`z-index:${n}`);const s=Un(i);return s&&a.push(s),a.join(";")+";"}const Hc=25.4/96,ge={color:"#cccccc",opacity:.15,rotate:-30,tileWidth:260,tileHeight:180,minTileWidth:140,minTileHeight:100,fontSize:16},ek={dense:{width:200,height:120,labelKey:"constants.watermark.density.dense"},medium:{width:260,height:180,labelKey:"constants.watermark.density.medium"},loose:{width:340,height:260,labelKey:"constants.watermark.density.loose"}};function Uc(e,t,r){const o=typeof e=="number"&&Number.isFinite(e)?e:t;return Math.max(r,Math.round(o))}function tk(e){return{width:Uc(e?.tileWidth,ge.tileWidth,ge.minTileWidth),height:Uc(e?.tileHeight,ge.tileHeight,ge.minTileHeight)}}function rk(e){return e?!e.mode||e.mode==="fixed"?!!e.content&&e.content.trim().length>0:!!e.binding&&e.binding.trim().length>0:!1}function ok(e,t,r){if(!e)return"";let o="";if(!e.mode||e.mode==="fixed")o=e.content??"";else if(typeof e.binding=="string"&&e.binding.trim()){const n=e.binding.trim(),i=Array.isArray(t)?t[0]??{}:t??{},a={...Qn(),...r,...i};let s;if(n.includes("{"))s=ar(n,a);else{try{s=N1(n,a)}catch{s=void 0}(s==null||typeof s=="object")&&(s=$o(i,n))}s!=null&&typeof s!="object"&&String(s)!==n?o=String(s):o=(typeof e.testData=="string"?e.testData.trim():"")?e.testData:`[${e.binding}]`}return e.timestamp&&o&&(o=`${o} ${nk(e.format)}`),o}function Wo(e){return String(e).padStart(2,"0")}function nk(e){const t=e&&e.trim()?e:"YYYY-MM-DD HH:mm",r=new Date,o={YYYY:String(r.getFullYear()),MM:Wo(r.getMonth()+1),DD:Wo(r.getDate()),HH:Wo(r.getHours()),mm:Wo(r.getMinutes()),ss:Wo(r.getSeconds())};return t.replace(/YYYY|MM|DD|HH|mm|ss/g,n=>o[n]??n)}function ti(e){return Math.round(e*1e4)/1e4}function ik(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function qc(e,t,r,o){if(!rk(e))return null;const n=ok(e,t,o);if(!n)return null;const i=tk(e),a=ti(i.width*Hc),s=ti(i.height*Hc),p={width:Math.max(0,Number.isFinite(r?.width)?r.width:0),height:Math.max(0,Number.isFinite(r?.height)?r.height:0)},l=Math.max(1,Math.ceil(p.width/a)),d=Math.max(1,Math.ceil(p.height/s)),u=[];for(let c=0;c<d;c++)for(let f=0;f<l;f++)u.push({leftMm:ti(f*a),topMm:ti(c*s),widthMm:a,heightMm:s});return{text:n,color:e?.color||ge.color,rotate:e?.rotate??ge.rotate,opacity:e?.opacity??ge.opacity,fontSizePx:ge.fontSize,tileWidthPx:i.width,tileHeightPx:i.height,tileWidthMm:a,tileHeightMm:s,columns:l,rows:d,tiles:u}}function ak(e,t){const r=e.tileWidthPx,o=e.tileHeightPx,n=r/2,i=o/2;return`<svg class="watermark-tile" style="${`left:${t.leftMm}mm;top:${t.topMm}mm;width:${t.widthMm}mm;height:${t.heightMm}mm`}" viewBox="0 0 ${r} ${o}" xmlns="http://www.w3.org/2000/svg"><text x="${n}" y="${i}" font-size="${e.fontSizePx}" fill="${e.color}" text-anchor="middle" dominant-baseline="middle" transform="rotate(${e.rotate},${n},${i})">${ik(e.text)}</text></svg>`}function jc(e,t,r,o){const n=qc(e,t,r,o);if(!n)return"";const i=n.tiles.map(a=>ak(n,a)).join(`
182
182
  `);return`
183
183
  <div class="watermark-layer" style="opacity:${n.opacity}">
184
184
  ${i}
@@ -221,18 +221,18 @@ ${t}
221
221
  <img src="${St(i.src??"")}" style="width:100%;height:100%;object-fit:${i.fit||"contain"};${Jc(i.fit,i.fitScale,i.objectPosition)}" />
222
222
  </div>`;case"barcode":case"qrcode":{const P=String(i.formatter??i.testData??"").trim();return`<div class="print-element" style="${k}"${v}>
223
223
  ${tu(P,d,i,{fallback:`<span>${St(P)}</span>`,codeRenderer:n?.codeRenderer,fit:i.fit,maxWidth:i.maxWidth,maxHeight:i.maxHeight,printerDpi:i.printerDpi,targetWidthMm:i.width,targetHeightMm:i.height})}
224
- </div>`}case"hline":return`<div class="print-element" style="${k};border-top:${i.borderWidth||.75}pt ${i.borderStyle||"solid"} ${i.borderColor||"#333"};height:0;"${v}></div>`;case"vline":return`<div class="print-element" style="${k};border-left:${i.borderWidth||.75}pt ${i.borderStyle||"solid"} ${i.borderColor||"#333"};width:0;"${v}></div>`;case"rect":return`<div class="print-element" style="${k};border:${i.borderWidth||1}pt ${i.borderStyle||"solid"} ${i.borderColor||"#333"};"${v}></div>`;case"oval":return`<div class="print-element" style="${k};border:${i.borderWidth||1}pt ${i.borderStyle||"solid"} ${i.borderColor||"#333"};border-radius:50%;"${v}></div>`;case"longText":return`<div class="print-element" style="${k}${Go(i,"1.5")}${Tk(i)}${Zc(i)}${Qc(u,i)}"${v}${w}>${St(i.formatter??i.testData??"")}</div>`;case"flowList":{const P=bt(i.flowColumns),E=Et(i.flowGapX),D=or(i.flowRowHeight),O=xr(i.flowMaxSpan,P),A=Array.isArray(i._flowItems)?i._flowItems:void 0,R=A&&A.length>0?A:String(i.testData??"").split(/\r?\n/).map(S=>S.trim()).filter(Boolean),_={width:p,columns:P,gapX:E,rowHeight:D,maxSpan:O,fontSizePt:i.fontSize??12,autoSpan:i.flowAutoSpan===!0};if(c){const S=Gr(i),B=Array.isArray(i._flowRows)?i._flowRows:Ua(R,{..._,width:vd(p,S)});return`<div class="print-element" style="${k}${Go(i)}display:block;box-sizing:border-box;height:auto;overflow:visible;padding:${Nt(S.top)} ${Nt(S.right)} ${Nt(S.bottom)} ${Nt(S.left)};"${v}${w}>
225
- ${As(B,P,E,D)}
224
+ </div>`}case"hline":return`<div class="print-element" style="${k};border-top:${i.borderWidth||.75}pt ${i.borderStyle||"solid"} ${i.borderColor||"#333"};height:0;"${v}></div>`;case"vline":return`<div class="print-element" style="${k};border-left:${i.borderWidth||.75}pt ${i.borderStyle||"solid"} ${i.borderColor||"#333"};width:0;"${v}></div>`;case"rect":return`<div class="print-element" style="${k};border:${i.borderWidth||1}pt ${i.borderStyle||"solid"} ${i.borderColor||"#333"};"${v}></div>`;case"oval":return`<div class="print-element" style="${k};border:${i.borderWidth||1}pt ${i.borderStyle||"solid"} ${i.borderColor||"#333"};border-radius:50%;"${v}></div>`;case"longText":return`<div class="print-element" style="${k}${Go(i,"1.5")}${Tk(i)}${Zc(i)}${Qc(u,i)}"${v}${w}>${St(i.formatter??i.testData??"")}</div>`;case"flowList":{const P=bt(i.flowColumns),E=Et(i.flowGapX),D=or(i.flowRowHeight),O=xr(i.flowMaxSpan,P),A=Array.isArray(i._flowItems)?i._flowItems:void 0,R=A&&A.length>0?A:String(i.testData??"").split(/\r?\n/).map(S=>S.trim()).filter(Boolean),_={width:p,columns:P,gapX:E,rowHeight:D,maxSpan:O,fontSizePt:i.fontSize??12,autoSpan:i.flowAutoSpan===!0};if(c){const S=Gr(i),N=Array.isArray(i._flowRows)?i._flowRows:Ua(R,{..._,width:vd(p,S)});return`<div class="print-element" style="${k}${Go(i)}display:block;box-sizing:border-box;height:auto;overflow:visible;padding:${Bt(S.top)} ${Bt(S.right)} ${Bt(S.bottom)} ${Bt(S.left)};"${v}${w}>
225
+ ${As(N,P,E,D)}
226
226
  </div>`}const I=Ua(R,_).flatMap(S=>S.cells).map(S=>`<div class="print-flow-cell"${S.span>1?` style="grid-column:span ${S.span};"`:""}>${St(S.text)}</div>`).join(`
227
227
  `);return`<div class="print-element" style="${k}${Go(i)}overflow:hidden;${o0(_)};"${v}${w}>
228
228
  ${I}
229
- </div>`}case"html":return`<div class="print-element" style="${k}"${v}>${i.testData??i.title??""}</div>`;default:{const P=Vr(d);if(P?.render){const E={type:d,...i,widthMm:p,heightMm:f??l??0,fontFamily:i.fontFamily,key:Vc({type:d,...i})},D=n?.renderers?.[d];try{const O=D?D.render(E):P.render.html?.(E);if(typeof O=="string"&&O.length>0)return`<div class="print-element" style="${k}"${v}>${O}</div>`}catch{}}return`<div class="print-element" style="${k}${Go(i)}${Zc(i)}${Qc(u,i)}"${v}${w}>${St(i.formatter??i.testData??"")}</div>`}}}function Nt(e){return`${Math.round(e*1e3)/1e3}mm`}function Ck(e,t,r){return["display:grid",`grid-template-columns:repeat(${e},minmax(0,1fr))`,`column-gap:${Nt(t)}`,`min-height:${Nt(r)}`].join(";")}function As(e,t,r,o,n=0){return e.map((i,a)=>{const s=i.cells.map(p=>`<div class="print-flow-cell"${p.span>1?` style="grid-column:span ${p.span};"`:""}>${St(p.text)}</div>`).join(`
229
+ </div>`}case"html":return`<div class="print-element" style="${k}"${v}>${i.testData??i.title??""}</div>`;default:{const P=Vr(d);if(P?.render){const E={type:d,...i,widthMm:p,heightMm:f??l??0,fontFamily:i.fontFamily,key:Vc({type:d,...i})},D=n?.renderers?.[d];try{const O=D?D.render(E):P.render.html?.(E);if(typeof O=="string"&&O.length>0)return`<div class="print-element" style="${k}"${v}>${O}</div>`}catch{}}return`<div class="print-element" style="${k}${Go(i)}${Zc(i)}${Qc(u,i)}"${v}${w}>${St(i.formatter??i.testData??"")}</div>`}}}function Bt(e){return`${Math.round(e*1e3)/1e3}mm`}function Ck(e,t,r){return["display:grid",`grid-template-columns:repeat(${e},minmax(0,1fr))`,`column-gap:${Bt(t)}`,`min-height:${Bt(r)}`].join(";")}function As(e,t,r,o,n=0){return e.map((i,a)=>{const s=i.cells.map(p=>`<div class="print-flow-cell"${p.span>1?` style="grid-column:span ${p.span};"`:""}>${St(p.text)}</div>`).join(`
230
230
  `);return`<div class="print-flow-row" data-flow-row-index="${n+a}" style="${Ck(t,r,o)};">
231
231
  ${s}
232
232
  </div>`}).join(`
233
- `)}function eu(e,t){let r="";const o=zn(e,t);if(o?.all&&(r+=`border:${o.all.borderWidth} ${o.all.borderStyle} ${o.all.borderColor};`),o)for(const i of Ao){const a=o.edges[i];a&&(r+=`border-${i}:${a.borderWidth} ${a.borderStyle} ${a.borderColor};`)}const n=Gr(t);return r+=`${Go(t)}display:block;box-sizing:border-box;height:auto;overflow:visible;padding:${Nt(n.top)} ${Nt(n.right)} ${Nt(n.bottom)} ${Nt(n.left)};`,r}function _k(e,t,r){const o=e.options??{},n=Array.isArray(o._flowRows)?o._flowRows:[],i=t.startFlowRow??0,a=t.endFlowRow??n.length;if(i>=a)return"";const s=e.type||e.printElementType?.type||"flowList",p=ei(o.left??0,t.renderTop??o.top??0,o.width??100,void 0,o.zIndex,o),l=bt(o.flowColumns),d=Et(o.flowGapX),u=or(o.flowRowHeight);return`<div class="print-flowlist-slice" style="${p}${eu(s,o)}">
233
+ `)}function eu(e,t){let r="";const o=zn(e,t);if(o?.all&&(r+=`border:${o.all.borderWidth} ${o.all.borderStyle} ${o.all.borderColor};`),o)for(const i of Ao){const a=o.edges[i];a&&(r+=`border-${i}:${a.borderWidth} ${a.borderStyle} ${a.borderColor};`)}const n=Gr(t);return r+=`${Go(t)}display:block;box-sizing:border-box;height:auto;overflow:visible;padding:${Bt(n.top)} ${Bt(n.right)} ${Bt(n.bottom)} ${Bt(n.left)};`,r}function _k(e,t,r){const o=e.options??{},n=Array.isArray(o._flowRows)?o._flowRows:[],i=t.startFlowRow??0,a=t.endFlowRow??n.length;if(i>=a)return"";const s=e.type||e.printElementType?.type||"flowList",p=ei(o.left??0,t.renderTop??o.top??0,o.width??100,void 0,o.zIndex,o),l=bt(o.flowColumns),d=Et(o.flowGapX),u=or(o.flowRowHeight);return`<div class="print-flowlist-slice" style="${p}${eu(s,o)}">
234
234
  ${As(n.slice(i,a),l,d,u,i)}
235
- </div>`}function tu(e,t,r,o){if(!e||!o.codeRenderer)return o.fallback;const{fallback:n,codeRenderer:i,fit:a,maxWidth:s,maxHeight:p}=o,l=t==="barcode";try{const d=i.render(e,t,{barcodeType:r.barcodeType,qrCodeLevel:r.qrCodeLevel!=null?String(r.qrCodeLevel):void 0,qrQuietZone:typeof r.qrQuietZone=="number"?r.qrQuietZone:void 0,barQuietZone:typeof r.barQuietZone=="number"?r.barQuietZone:void 0,barHeightMm:typeof r.barHeight=="number"?r.barHeight:void 0,showText:r.hideTitle!==void 0?!r.hideTitle:r.showBarcodeText,barWidth:typeof r.barWidth=="number"?r.barWidth:void 0,fontSize:typeof(r.barFontSize??r.fontSize)=="number"?r.barFontSize??r.fontSize:void 0,printerDpi:l?o.printerDpi:void 0,targetWidthMm:l?Kr(o.targetWidthMm,s):void 0,targetHeightMm:l?Kr(o.targetHeightMm,p):void 0});if(l&&/^<svg[\s>]/i.test(d))return Dk(d);const u=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`,c=[];c.push("width:100%","height:100%","max-width:100%","max-height:100%","display:block","margin:auto"),c.push(`object-fit:${a||"contain"}`),s&&c.push(`max-width:${s}mm`),p&&c.push(`max-height:${p}mm`);const f=c.join(";");return`<img src="${u}" style="${f}" />`}catch{return n}}function Dk(e){return`<div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden;">${e.replace(/<svg\b/,'<svg style="display:block"')}</div>`}function Ak(e,t){const r=[],o=e.fittedFontSize??e.fontSize??t.tableDefaultFontSize,n=e.color??t.tableDefaultColor,i=e.padding??t.tableDefaultPadding??1,a=e.fontFamily??t.tableDefaultFontFamily;o&&r.push(`font-size:${o}pt`),a&&r.push(`font-family:${Es(Ss(a))}`),e.fontWeight&&r.push(`font-weight:${e.fontWeight}`),n&&r.push(`color:${n}`),e.backgroundColor&&r.push(`background-color:${e.backgroundColor}`),r.push(`text-align:${e.align??"left"}`),e.align==="justify"&&r.push("text-align-last:justify"),r.push(`vertical-align:${e.valign??"middle"}`),r.push(`padding:${i}mm`),r.push(e.wordWrap===!1?"white-space:nowrap;overflow:hidden":"white-space:pre-wrap;word-break:normal;overflow-wrap:break-word");const s=e.borders??{},p=t.tableDefaultBorders??{};for(const l of["top","right","bottom","left"]){const d=s[l]??p[l];r.push(d?`border-${l}:${d.width}pt ${d.style} ${d.color}`:`border-${l}:none`)}return r.join(";")}function Mr(e,t,r,o,n,i,a={elementId:"",kind:"b"},s){const p=[],l=o.tableDefaultPadding??1,d=sk(e,t,r);for(let u=t;u<r;u++){const c=e[u];if(!c)continue;const f=n?` data-row-index="${u}"`:"",h=c.cells.map((b,k)=>({cell:b,ci:k})).filter(({cell:b,ci:k})=>!b.merged&&!d?.merged.has(`${u}:${k}`)).map(({cell:b,ci:k})=>{const v=d?.rowspan.get(`${u}:${k}`),w=v??(s===void 0?b.rowspan??1:Math.max(1,Math.min(b.rowspan??1,s-u))),P=v===void 0?b:{...b,rowspan:v},E=`${w>1?` rowspan="${w}"`:""}${b.colspan>1?` colspan="${b.colspan}"`:""}`,D=k;let O;if(b.cellType==="barcode"||b.cellType==="qrcode"){const A=Ds(b,i);O=`<div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden;">${tu(A,b.cellType,b,{fallback:St(A),codeRenderer:i?.codeRenderer,fit:b.fit,maxWidth:b.maxWidth,maxHeight:b.maxHeight,printerDpi:b.printerDpi,targetWidthMm:za(o.tableColWidths??[],k,b,l),targetHeightMm:Co(e,u,P,l)})}</div>`}else if(b.cellType==="image"){const A=b.fit||"contain",R=b.maxWidth?`max-width:${b.maxWidth}mm;`:"max-width:100%;",_=b.maxHeight?`max-height:${b.maxHeight}mm;`:"max-height:100%;",I=kd(A,Co(e,u,P,l)),S=I===void 0?"height:100%":`height:${I}mm`,B=I===void 0?"":"width:100%;height:100%;";O=`<div style="width:100%;${S};display:flex;align-items:center;justify-content:center;overflow:hidden;"><img src="${St(Ds(b,i))}" style="${B}object-fit:${A};${Jc(A,b.fitScale,b.objectPosition)}${R}${_}display:block;" /></div>`}else O=Ok(e,u,D,P,o,a,l,i);return`<td${E} style="${Ak(b,o)}">${O}</td>`}).join("");p.push(`<tr${f} style="height:${c.height}mm;">${h}</tr>`)}return p.join(`
235
+ </div>`}function tu(e,t,r,o){if(!e||!o.codeRenderer)return o.fallback;const{fallback:n,codeRenderer:i,fit:a,maxWidth:s,maxHeight:p}=o,l=t==="barcode";try{const d=i.render(e,t,{barcodeType:r.barcodeType,qrCodeLevel:r.qrCodeLevel!=null?String(r.qrCodeLevel):void 0,qrQuietZone:typeof r.qrQuietZone=="number"?r.qrQuietZone:void 0,barQuietZone:typeof r.barQuietZone=="number"?r.barQuietZone:void 0,barHeightMm:typeof r.barHeight=="number"?r.barHeight:void 0,showText:r.hideTitle!==void 0?!r.hideTitle:r.showBarcodeText,barWidth:typeof r.barWidth=="number"?r.barWidth:void 0,fontSize:typeof(r.barFontSize??r.fontSize)=="number"?r.barFontSize??r.fontSize:void 0,printerDpi:l?o.printerDpi:void 0,targetWidthMm:l?Kr(o.targetWidthMm,s):void 0,targetHeightMm:l?Kr(o.targetHeightMm,p):void 0});if(l&&/^<svg[\s>]/i.test(d))return Dk(d);const u=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(d)}`,c=[];c.push("width:100%","height:100%","max-width:100%","max-height:100%","display:block","margin:auto"),c.push(`object-fit:${a||"contain"}`),s&&c.push(`max-width:${s}mm`),p&&c.push(`max-height:${p}mm`);const f=c.join(";");return`<img src="${u}" style="${f}" />`}catch{return n}}function Dk(e){return`<div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden;">${e.replace(/<svg\b/,'<svg style="display:block"')}</div>`}function Ak(e,t){const r=[],o=e.fittedFontSize??e.fontSize??t.tableDefaultFontSize,n=e.color??t.tableDefaultColor,i=e.padding??t.tableDefaultPadding??1,a=e.fontFamily??t.tableDefaultFontFamily;o&&r.push(`font-size:${o}pt`),a&&r.push(`font-family:${Es(Ss(a))}`),e.fontWeight&&r.push(`font-weight:${e.fontWeight}`),n&&r.push(`color:${n}`),e.backgroundColor&&r.push(`background-color:${e.backgroundColor}`),r.push(`text-align:${e.align??"left"}`),e.align==="justify"&&r.push("text-align-last:justify"),r.push(`vertical-align:${e.valign??"middle"}`),r.push(`padding:${i}mm`),r.push(e.wordWrap===!1?"white-space:nowrap;overflow:hidden":"white-space:pre-wrap;word-break:normal;overflow-wrap:break-word");const s=e.borders??{},p=t.tableDefaultBorders??{};for(const l of["top","right","bottom","left"]){const d=s[l]??p[l];r.push(d?`border-${l}:${d.width}pt ${d.style} ${d.color}`:`border-${l}:none`)}return r.join(";")}function Mr(e,t,r,o,n,i,a={elementId:"",kind:"b"},s){const p=[],l=o.tableDefaultPadding??1,d=sk(e,t,r);for(let u=t;u<r;u++){const c=e[u];if(!c)continue;const f=n?` data-row-index="${u}"`:"",h=c.cells.map((b,k)=>({cell:b,ci:k})).filter(({cell:b,ci:k})=>!b.merged&&!d?.merged.has(`${u}:${k}`)).map(({cell:b,ci:k})=>{const v=d?.rowspan.get(`${u}:${k}`),w=v??(s===void 0?b.rowspan??1:Math.max(1,Math.min(b.rowspan??1,s-u))),P=v===void 0?b:{...b,rowspan:v},E=`${w>1?` rowspan="${w}"`:""}${b.colspan>1?` colspan="${b.colspan}"`:""}`,D=k;let O;if(b.cellType==="barcode"||b.cellType==="qrcode"){const A=Ds(b,i);O=`<div style="width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden;">${tu(A,b.cellType,b,{fallback:St(A),codeRenderer:i?.codeRenderer,fit:b.fit,maxWidth:b.maxWidth,maxHeight:b.maxHeight,printerDpi:b.printerDpi,targetWidthMm:za(o.tableColWidths??[],k,b,l),targetHeightMm:Co(e,u,P,l)})}</div>`}else if(b.cellType==="image"){const A=b.fit||"contain",R=b.maxWidth?`max-width:${b.maxWidth}mm;`:"max-width:100%;",_=b.maxHeight?`max-height:${b.maxHeight}mm;`:"max-height:100%;",I=kd(A,Co(e,u,P,l)),S=I===void 0?"height:100%":`height:${I}mm`,N=I===void 0?"":"width:100%;height:100%;";O=`<div style="width:100%;${S};display:flex;align-items:center;justify-content:center;overflow:hidden;"><img src="${St(Ds(b,i))}" style="${N}object-fit:${A};${Jc(A,b.fitScale,b.objectPosition)}${R}${_}display:block;" /></div>`}else O=Ok(e,u,D,P,o,a,l,i);return`<td${E} style="${Ak(b,o)}">${O}</td>`}).join("");p.push(`<tr${f} style="height:${c.height}mm;">${h}</tr>`)}return p.join(`
236
236
  `)}function Ok(e,t,r,o,n,i,a,s){const p=Fa(o),l=St(Ds(o,s));if(p==="autoHeight")return l;const d=Co(e,t,o,a),u=o.wordWrap===!1,c=[`max-height:${d}mm`,"overflow:hidden",...u?["white-space:nowrap","text-overflow:ellipsis"]:[]].join(";"),f=p==="shrink"&&i.elementId?` data-fit="shrink" data-fit-key="${St(Vb(i.elementId,i.kind,t,r))}" data-fit-base="${o.fontSize??n.tableDefaultFontSize??12}" data-fit-min="${Mo(o.shrinkMinFontSize)}" data-fit-mm="${d}"`:"";return`<div class="cell-fit" style="${c}"${f}>${l}</div>`}function Os(e,t){const o=e.options.tableColWidths??[],n=o.map(a=>`<col style="width:${a}mm;">`).join(""),i=o.reduce((a,s)=>a+s,0);return`<table class="print-table" data-element-id="${e.id}" style="border-collapse:collapse;table-layout:fixed;width:${i}mm;">
237
237
  <colgroup>${n}</colgroup>
238
238
  <tbody>${t}</tbody>
@@ -241,25 +241,25 @@ ${t}
241
241
  </div>`}function Ik(e,t,r){const o=e.options,n=ei(o.left??0,t.renderTop??o.top??0,o.width??100,void 0,o.zIndex,o),i=o._renderRows??[],a=t.startRow??0,s=t.endRow??i.length,p=o._repeatHeaderCount??0,l=t.repeatHeader&&p>0?Mr(i,0,p,o,!1,r,{elementId:e.id,kind:"b"},p):"",d=Mr(i,a,s,o,!1,r,{elementId:e.id,kind:"b"}),u=t.subtotal?ru(e,t,o,r):"",c=t.summary?ou(e,o,r):"";return`<div class="print-element" style="${n};overflow:visible;">
242
242
  ${Os(e,`${l}
243
243
  ${d}${u}${c}`)}
244
- </div>`}function ru(e,t,r,o){const n=r._subtotalTemplates??[];if(n.length===0)return"";const i=r._dataRowCtx??[],a=r._dataStartIdx??0,s=r._mainData??{},p=r._renderRows?.length??0,l=t.startRow??0,d=t.endRow??p,u=Math.max(l,a),c=Math.max(d,u),f=c>a?i.slice(Math.max(u-a,0),c-a):[],h=o?.pageVars?_s(o.pageVars):{},b=n.map(k=>({...k,cells:k.cells.map(v=>v.rawFormatter?{...v,content:ar(v.rawFormatter,{rows:f,...s,...h}),rawFormatter:""}:v)}));return Mr(b,0,b.length,r,!1,o,{elementId:e.id,kind:"st"})}function ou(e,t,r){const o=t._summaryRows??[];return o.length===0?"":Mr(o,0,o.length,t,!1,r,{elementId:e.id,kind:"sm"})}function Lk(e,t,r,o){const n=e.options??{},a=(e.type||e.printElementType?.type||"text")==="flowList"&&wr(n.flowLayoutMode)==="dynamic",s=n.left??0,p=n.width??100,l=t.groupTop??n.top??0,d=Lo(e)+kt(n).bottom,u=Un(n),c=u?`${u};`:"",f=typeof n.zIndex=="number"?`z-index:${n.zIndex};`:"",h=`position:absolute;left:${Q(s)};top:${Q(l)};width:${Q(p)};overflow:visible;${f}`;let b="";if(a)b=Nk(e,t);else{const E=t.startRow??0,D=t.endRow??0;if(D>E||t.subtotal||t.summary){const O=n._renderRows??[],A=n._repeatHeaderCount??0,R=t.repeatHeader&&A>0?Mr(O,0,A,n,!1,o,{elementId:e.id,kind:"b"},A):"",_=Mr(O,E,D,n,!1,o,{elementId:e.id,kind:"b"}),I=t.subtotal?ru(e,t,n,o):"",S=t.summary?ou(e,n,o):"";b=`<div class="flow-slice" style="position:relative;width:${Q(p)};overflow:visible;${c}">
244
+ </div>`}function ru(e,t,r,o){const n=r._subtotalTemplates??[];if(n.length===0)return"";const i=r._dataRowCtx??[],a=r._dataStartIdx??0,s=r._mainData??{},p=r._renderRows?.length??0,l=t.startRow??0,d=t.endRow??p,u=Math.max(l,a),c=Math.max(d,u),f=c>a?i.slice(Math.max(u-a,0),c-a):[],h=o?.pageVars?_s(o.pageVars):{},b=n.map(k=>({...k,cells:k.cells.map(v=>v.rawFormatter?{...v,content:ar(v.rawFormatter,{rows:f,...s,...h}),rawFormatter:""}:v)}));return Mr(b,0,b.length,r,!1,o,{elementId:e.id,kind:"st"})}function ou(e,t,r){const o=t._summaryRows??[];return o.length===0?"":Mr(o,0,o.length,t,!1,r,{elementId:e.id,kind:"sm"})}function Lk(e,t,r,o){const n=e.options??{},a=(e.type||e.printElementType?.type||"text")==="flowList"&&wr(n.flowLayoutMode)==="dynamic",s=n.left??0,p=n.width??100,l=t.groupTop??n.top??0,d=Lo(e)+kt(n).bottom,u=Un(n),c=u?`${u};`:"",f=typeof n.zIndex=="number"?`z-index:${n.zIndex};`:"",h=`position:absolute;left:${Q(s)};top:${Q(l)};width:${Q(p)};overflow:visible;${f}`;let b="";if(a)b=Bk(e,t);else{const E=t.startRow??0,D=t.endRow??0;if(D>E||t.subtotal||t.summary){const O=n._renderRows??[],A=n._repeatHeaderCount??0,R=t.repeatHeader&&A>0?Mr(O,0,A,n,!1,o,{elementId:e.id,kind:"b"},A):"",_=Mr(O,E,D,n,!1,o,{elementId:e.id,kind:"b"}),I=t.subtotal?ru(e,t,n,o):"",S=t.summary?ou(e,n,o):"";b=`<div class="flow-slice" style="position:relative;width:${Q(p)};overflow:visible;${c}">
245
245
  ${Os(e,`${R}
246
246
  ${_}${I}${S}`)}
247
- </div>`}}const k=t.followElementIds??[],v=k.reduce((E,D)=>{const O=Is(r,D);return O?Math.max(E,Xe({width:0,...O.options}).margin.bottom):E},d),w=k.map(E=>{const D=Is(r,E);if(!D)return"";const O=D.options?.top??0,A=D.options?.left??0,R=D.options?.width??p,_=D.options?.height??0,I=D.options?.zIndex,S=D.type||D.printElementType?.type||"text",B=S==="rect"||S==="oval"||S==="image"||S==="vline",F=Un(D.options),H=["position:absolute",`left:${Q(A-s)}`,`top:${Q(O-d)}`,`width:${Q(R)}`,...B&&_>0?[`height:${Q(_)}`]:[],...typeof I=="number"?[`z-index:${I}`]:[],"overflow:visible",...F?[F]:[]].join(";")+";";return ii(D,!1,H,void 0,o)}).join(`
247
+ </div>`}}const k=t.followElementIds??[],v=k.reduce((E,D)=>{const O=Is(r,D);return O?Math.max(E,Xe({width:0,...O.options}).margin.bottom):E},d),w=k.map(E=>{const D=Is(r,E);if(!D)return"";const O=D.options?.top??0,A=D.options?.left??0,R=D.options?.width??p,_=D.options?.height??0,I=D.options?.zIndex,S=D.type||D.printElementType?.type||"text",N=S==="rect"||S==="oval"||S==="image"||S==="vline",F=Un(D.options),H=["position:absolute",`left:${Q(A-s)}`,`top:${Q(O-d)}`,`width:${Q(R)}`,...N&&_>0?[`height:${Q(_)}`]:[],...typeof I=="number"?[`z-index:${I}`]:[],"overflow:visible",...F?[F]:[]].join(";")+";";return ii(D,!1,H,void 0,o)}).join(`
248
248
  `),P=k.length>0?`<div class="flow-follow" style="position:relative;width:${Q(p)};height:${Q(Math.max(v-d,0))};overflow:visible;">
249
249
  ${w}
250
250
  </div>`:"";return`<div class="flow-group" style="${h}">
251
251
  ${b}
252
252
  ${P}
253
- </div>`}function Nk(e,t){const r=e.options??{},o=Array.isArray(r._flowRows)?r._flowRows:[],n=t.startFlowRow??0,i=t.endFlowRow??0;if(n>=i)return"";const a=e.type||e.printElementType?.type||"flowList",s=bt(r.flowColumns),p=Et(r.flowGapX),l=or(r.flowRowHeight),d=Un(r),u=d?`${d};`:"";return`<div class="flow-slice" style="position:relative;width:${Q(r.width??100)};overflow:visible;${u}">
253
+ </div>`}function Bk(e,t){const r=e.options??{},o=Array.isArray(r._flowRows)?r._flowRows:[],n=t.startFlowRow??0,i=t.endFlowRow??0;if(n>=i)return"";const a=e.type||e.printElementType?.type||"flowList",s=bt(r.flowColumns),p=Et(r.flowGapX),l=or(r.flowRowHeight),d=Un(r),u=d?`${d};`:"";return`<div class="flow-slice" style="position:relative;width:${Q(r.width??100)};overflow:visible;${u}">
254
254
  <div class="print-flowlist-slice" style="position:relative;width:${Q(r.width??100)};${eu(a,r)}">
255
255
  ${As(o.slice(n,i),s,p,l,n)}
256
256
  </div>
257
- </div>`}function Rs(e,t,r,o,n){return e.map(i=>{let a=Bk(i,n);return r!==void 0&&(a=a.replace(/\{pageIndex\}/g,String(r))),o!==void 0&&(a=a.replace(/\{totalPages\}/g,String(o))),a}).join(`
258
- `)}function Bk(e,t){return ii(e,!1,void 0,void 0,t)}function Is(e,t){return e.elements.find(r=>r.id===t)}function Ls(e){return yt(e)}function St(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const Fk=25.4;function $k(e,t){const r=e.margins?.bottom??0,o=e.footer?.height??0,n=Math.max(t,0)+o+r;return Math.max(Fk,Math.round(n*100)/100)}const nu=3.7795275591;function Ns(e){return e/nu}function ai(e){return Math.round(e*nu)}function si(e){return typeof e=="number"&&e>0?e:void 0}function zk(e){return si(e.paperHeightMm)??si(e.override?.height)}function Hk(e){const t=si(e.override?.width)??e.paperMm.width,r=si(e.override?.height);return e.continuous?r?{paperMm:{width:t,height:r},heightSource:"config"}:{paperMm:{width:t,height:e.paperMm.height},heightSource:"derived"}:{paperMm:{width:t,height:r??e.paperMm.height},heightSource:"config"}}function iu(e){return{width:ai(e.width),height:ai(e.height)}}function Uk(e){return(e?.type??e?.printElementType?.type)!=="flowList"?!1:wr(e?.options?.flowLayoutMode)==="dynamic"}function au(e,t){const r=new Map(t.elements.map(n=>[n.id,n])),o=new Map;for(const n of e){const i=r.get(n.id),a=i?.options?._repeatHeaderCount??0,s=n.rowHeightsPx?.map(Ns),p=Uk(i);o.set(n.id,{id:n.id,measuredHeight:Ns(n.heightPx),...p?{measuredFlowRowHeights:s}:{measuredRowHeights:s},repeatHeaderHeight:s&&s.length>0&&a>0?s.slice(0,a).reduce((l,d)=>l+d,0):0})}return o}const qk={b:"_renderRows",st:"_subtotalTemplates",sm:"_summaryRows"};function su(e,t){if(!t||t.length===0)return;const r=new Map,o=n=>{for(const i of n??[])r.set(i.id,i)};o(e.elements),o(e.header?.elements),o(e.footer?.elements);for(const n of t){const i=Gb(n.key);if(!i){const l=r.get(n.key);l&&(l.options._fitFontSize=$a(n.fontSizePt));continue}const p=r.get(i.elementId)?.options?.[qk[i.kind]]?.[i.rowIndex]?.cells?.[i.colIndex];p&&(p.fittedFontSize=$a(n.fontSizePt))}}function lu(e,t,r={}){return JSON.stringify([e,t,r.barcodeType??null,r.qrCodeLevel??null,r.showText??null,r.barWidth??null,r.fontSize??null,r.qrQuietZone??null,r.barQuietZone??null,r.barHeightMm??null])}function jk(e){return{render(t,r,o){const n=e.get(lu(t,r,o));if(!n)throw new Error(`码值未渲染:${t}`);return n}}}function Wk(e){const t=new Map;return{renderer:{render(r,o,n={}){const i=lu(r,o,n),a=e?.get(i);if(a)return a;throw t.set(i,{key:i,value:r,cellType:o,opts:n}),new Error("collect")}},takeSpecs(){const r=[...t.values()];return t.clear(),r}}}function Vk(...e){const t=new Map;for(const r of e)for(const[o,n]of r)t.set(o,n);return t}const Gk={waitReady:"window",readMeasurements:"document",readContentBottom:"document",readElementRects:"document",renderCodes:"none",renderAssets:"none",applyTextFit:"document"},Kk=3e4,Yk=5e3;function Xk(e,t,r=[]){return{async withSession(o,n){const i=await e.createDriver(),a=Date.now()+(o.timeoutMs??Kk),s=o.readinessMs??Yk,p=()=>Math.max(1,a-Date.now()),l=(k,v,w)=>dk(k,v,w);let d=!1,u=!1;const c=async()=>{if(!d){if(i.requiresExecutor===!1){d=!0;return}throw new eo("INTERNAL","缺少 core DOM 执行器产物")}},f=async()=>{if(u)return;if(i.requiresExecutor===!1){u=!0;return}const k=new Set;for(const v of r)k.has(v.version)||(k.add(v.version),await i.injectExecutor(v));u=!0},h=async(k,v)=>{await i.open(v),await i.setContent(k),d=!1,u=!1,await c(),await i.evaluate("waitReady",[s])},b={async renderCodes(k){if(k.length===0)return new Map;const v=p();return Vo((async()=>{try{await c();const w=await i.evaluate("renderCodes",[k]);return new Map(Object.entries(w))}catch(w){throw l(w,"INTERNAL","码值渲染失败")}})(),v,"RENDER_TIMEOUT",`码值渲染超过 ${v}ms`)},async renderAssets(k){if(k.length===0)return new Map;const v=p();return Vo((async()=>{try{await c(),await f();const w=bk("renderAssets"),P=await i.evaluate(w,[k]);return new Map(Object.entries(P??{}))}catch(w){throw l(w,"INTERNAL","扩展元素渲染失败")}})(),v,"RENDER_TIMEOUT",`扩展元素渲染超过 ${v}ms`)},async measure(k,v){const w=p();return Vo((async()=>{try{await h(k,v);const P=await i.evaluate("applyTextFit")??[];return{measurements:await i.evaluate("readMeasurements"),fits:P}}catch(P){throw l(P,"MEASURE_FAILED","测量失败")}})(),w,"RENDER_TIMEOUT",`测量超过 ${w}ms`)},async probeContentBottom(k,v){const w=p();return Vo((async()=>{try{return await h(k,v),await i.evaluate("readContentBottom")}catch(P){throw l(P,"MEASURE_FAILED","连续纸探针失败")}})(),w,"RENDER_TIMEOUT",`连续纸探针超过 ${w}ms`)},async toPdf(k,v,w){if(!i.pdf)throw new eo("UNSUPPORTED_RUNTIME","当前宿主不支持生成 PDF");const P=p();return Vo((async()=>{try{return await h(k,w),await i.pdf(k,v)}catch(E){throw l(E,"PDF_FAILED","PDF 生成失败")}})(),P,"RENDER_TIMEOUT",`PDF 生成超过 ${P}ms`)}};try{return await n(b)}finally{try{await i.close()}catch{}}}}}const pu=500;function Zk(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function du(e){if(e===void 0)return{mode:"single",data:{}};if(!Array.isArray(e))return{mode:"single",data:e};if(e.length===0)throw new Error($("service.printData.emptyArray"));if(e.length>pu)throw new Error($("service.printData.tooMany",{max:pu,count:e.length}));for(let t=0;t<e.length;t++)if(!Zk(e[t]))throw new Error($("service.printData.itemNotObject",{index:t+1}));return{mode:"batch",dataList:e}}function Jk(e){const t=e[0].bound,r=It(t),o=e.map((a,s)=>{const p=r?`print-copy print-copy-${s}`:"print-copy",l=oi(a.bound,a.pageLayouts,a.data,{codeRenderer:a.codeRenderer,renderers:a.renderers,pageHeightMm:a.derivedHeightMm});return`<section class="${p}">
257
+ </div>`}function Rs(e,t,r,o,n){return e.map(i=>{let a=Nk(i,n);return r!==void 0&&(a=a.replace(/\{pageIndex\}/g,String(r))),o!==void 0&&(a=a.replace(/\{totalPages\}/g,String(o))),a}).join(`
258
+ `)}function Nk(e,t){return ii(e,!1,void 0,void 0,t)}function Is(e,t){return e.elements.find(r=>r.id===t)}function Ls(e){return yt(e)}function St(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}const Fk=25.4;function $k(e,t){const r=e.margins?.bottom??0,o=e.footer?.height??0,n=Math.max(t,0)+o+r;return Math.max(Fk,Math.round(n*100)/100)}const nu=3.7795275591;function Bs(e){return e/nu}function ai(e){return Math.round(e*nu)}function si(e){return typeof e=="number"&&e>0?e:void 0}function zk(e){return si(e.paperHeightMm)??si(e.override?.height)}function Hk(e){const t=si(e.override?.width)??e.paperMm.width,r=si(e.override?.height);return e.continuous?r?{paperMm:{width:t,height:r},heightSource:"config"}:{paperMm:{width:t,height:e.paperMm.height},heightSource:"derived"}:{paperMm:{width:t,height:r??e.paperMm.height},heightSource:"config"}}function iu(e){return{width:ai(e.width),height:ai(e.height)}}function Uk(e){return(e?.type??e?.printElementType?.type)!=="flowList"?!1:wr(e?.options?.flowLayoutMode)==="dynamic"}function au(e,t){const r=new Map(t.elements.map(n=>[n.id,n])),o=new Map;for(const n of e){const i=r.get(n.id),a=i?.options?._repeatHeaderCount??0,s=n.rowHeightsPx?.map(Bs),p=Uk(i);o.set(n.id,{id:n.id,measuredHeight:Bs(n.heightPx),...p?{measuredFlowRowHeights:s}:{measuredRowHeights:s},repeatHeaderHeight:s&&s.length>0&&a>0?s.slice(0,a).reduce((l,d)=>l+d,0):0})}return o}const qk={b:"_renderRows",st:"_subtotalTemplates",sm:"_summaryRows"};function su(e,t){if(!t||t.length===0)return;const r=new Map,o=n=>{for(const i of n??[])r.set(i.id,i)};o(e.elements),o(e.header?.elements),o(e.footer?.elements);for(const n of t){const i=Gb(n.key);if(!i){const l=r.get(n.key);l&&(l.options._fitFontSize=$a(n.fontSizePt));continue}const p=r.get(i.elementId)?.options?.[qk[i.kind]]?.[i.rowIndex]?.cells?.[i.colIndex];p&&(p.fittedFontSize=$a(n.fontSizePt))}}function lu(e,t,r={}){return JSON.stringify([e,t,r.barcodeType??null,r.qrCodeLevel??null,r.showText??null,r.barWidth??null,r.fontSize??null,r.qrQuietZone??null,r.barQuietZone??null,r.barHeightMm??null])}function jk(e){return{render(t,r,o){const n=e.get(lu(t,r,o));if(!n)throw new Error(`码值未渲染:${t}`);return n}}}function Wk(e){const t=new Map;return{renderer:{render(r,o,n={}){const i=lu(r,o,n),a=e?.get(i);if(a)return a;throw t.set(i,{key:i,value:r,cellType:o,opts:n}),new Error("collect")}},takeSpecs(){const r=[...t.values()];return t.clear(),r}}}function Vk(...e){const t=new Map;for(const r of e)for(const[o,n]of r)t.set(o,n);return t}const Gk={waitReady:"window",readMeasurements:"document",readContentBottom:"document",readElementRects:"document",renderCodes:"none",renderAssets:"none",applyTextFit:"document"},Kk=3e4,Yk=5e3;function Xk(e,t,r=[]){return{async withSession(o,n){const i=await e.createDriver(),a=Date.now()+(o.timeoutMs??Kk),s=o.readinessMs??Yk,p=()=>Math.max(1,a-Date.now()),l=(k,v,w)=>dk(k,v,w);let d=!1,u=!1;const c=async()=>{if(!d){if(i.requiresExecutor===!1){d=!0;return}throw new eo("INTERNAL","缺少 core DOM 执行器产物")}},f=async()=>{if(u)return;if(i.requiresExecutor===!1){u=!0;return}const k=new Set;for(const v of r)k.has(v.version)||(k.add(v.version),await i.injectExecutor(v));u=!0},h=async(k,v)=>{await i.open(v),await i.setContent(k),d=!1,u=!1,await c(),await i.evaluate("waitReady",[s])},b={async renderCodes(k){if(k.length===0)return new Map;const v=p();return Vo((async()=>{try{await c();const w=await i.evaluate("renderCodes",[k]);return new Map(Object.entries(w))}catch(w){throw l(w,"INTERNAL","码值渲染失败")}})(),v,"RENDER_TIMEOUT",`码值渲染超过 ${v}ms`)},async renderAssets(k){if(k.length===0)return new Map;const v=p();return Vo((async()=>{try{await c(),await f();const w=bk("renderAssets"),P=await i.evaluate(w,[k]);return new Map(Object.entries(P??{}))}catch(w){throw l(w,"INTERNAL","扩展元素渲染失败")}})(),v,"RENDER_TIMEOUT",`扩展元素渲染超过 ${v}ms`)},async measure(k,v){const w=p();return Vo((async()=>{try{await h(k,v);const P=await i.evaluate("applyTextFit")??[];return{measurements:await i.evaluate("readMeasurements"),fits:P}}catch(P){throw l(P,"MEASURE_FAILED","测量失败")}})(),w,"RENDER_TIMEOUT",`测量超过 ${w}ms`)},async probeContentBottom(k,v){const w=p();return Vo((async()=>{try{return await h(k,v),await i.evaluate("readContentBottom")}catch(P){throw l(P,"MEASURE_FAILED","连续纸探针失败")}})(),w,"RENDER_TIMEOUT",`连续纸探针超过 ${w}ms`)},async toPdf(k,v,w){if(!i.pdf)throw new eo("UNSUPPORTED_RUNTIME","当前宿主不支持生成 PDF");const P=p();return Vo((async()=>{try{return await h(k,w),await i.pdf(k,v)}catch(E){throw l(E,"PDF_FAILED","PDF 生成失败")}})(),P,"RENDER_TIMEOUT",`PDF 生成超过 ${P}ms`)}};try{return await n(b)}finally{try{await i.close()}catch{}}}}}const pu=500;function Zk(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function du(e){if(e===void 0)return{mode:"single",data:{}};if(!Array.isArray(e))return{mode:"single",data:e};if(e.length===0)throw new Error($("service.printData.emptyArray"));if(e.length>pu)throw new Error($("service.printData.tooMany",{max:pu,count:e.length}));for(let t=0;t<e.length;t++)if(!Zk(e[t]))throw new Error($("service.printData.itemNotObject",{index:t+1}));return{mode:"batch",dataList:e}}function Jk(e){const t=e[0].bound,r=It(t),o=e.map((a,s)=>{const p=r?`print-copy print-copy-${s}`:"print-copy",l=oi(a.bound,a.pageLayouts,a.data,{codeRenderer:a.codeRenderer,renderers:a.renderers,pageHeightMm:a.derivedHeightMm});return`<section class="${p}">
259
259
  ${l}
260
260
  </section>`}).join(`
261
261
  `),n=r?J1(t,e.map(a=>({heightMm:a.derivedHeightMm}))):`${jo(t)}
262
- .print-copy:not(:last-child){break-after:page;page-break-after:always;}`,i=Uo(t.fonts)+n;return{html:ni(i,o,r?"continuous":void 0),pageCount:e.reduce((a,s)=>a+s.pageLayouts.length,0),copyPaperMm:e.map(a=>a.paperMm)}}const Bt={enabled:!0,sheetPaperSize:"A4",sheetOrientation:"portrait",sheetMargin:{top:10,right:10,bottom:10,left:10},gapX:2,gapY:2,columns:2};class Qk extends Error{constructor(t,r){super(r),this.name="TilingError",this.code=t}}function Cr(e){return Math.round(e*10)/10}function cu(e,t){const r=e.outputRotation;return r===90||r===270?$("diagnostic.tiling.rotationNote",{angle:r,width:t.width,height:t.height}):""}function li(e){const t=e.tiling;return{...Bt,...t,sheetMargin:{...Bt.sheetMargin,...t?.sheetMargin??{}}}}function Ko(e,t){const r=li(e),o=t?.paperOverride;if(o&&typeof o.width=="number"&&o.width>0&&typeof o.height=="number"&&o.height>0)return{width:o.width,height:o.height};if(r.sheetPaperSize==="CUSTOM")return{width:r.sheetCustomWidth??Pr.A4.width,height:r.sheetCustomHeight??Pr.A4.height};const n=r.sheetPaperSize??"A4",i=Pr[n]??Pr.A4;return r.sheetOrientation==="landscape"?{width:i.height,height:i.width}:{...i}}function uu(e,t){return{w:e.width-t.left-t.right,h:e.height-t.top-t.bottom}}function Bs(e,t,r){return Math.max(0,Math.floor((e+r)/(t+r)))}function fu(e,t){const r=Fs(e,t);if(r.length)throw new Qk(r[0].code,r[0].message);const o=li(e),n=Ko(e,t),i=Er(e),a=uu(n,o.sheetMargin),s=Math.floor((a.h+o.gapY)/(i.height+o.gapY));return{tile:{width:i.width,height:i.height},sheet:n,columns:o.columns,rows:s,perSheet:o.columns*s,maxColumns:Bs(a.w,i.width,o.gapX),margin:{...o.sheetMargin},gapX:o.gapX,gapY:o.gapY}}function ey(e,t){const r=t%e.perSheet,o=r%e.columns,n=Math.floor(r/e.columns);return{left:Cr(e.margin.left+o*(e.tile.width+e.gapX)),top:Cr(e.margin.top+n*(e.tile.height+e.gapY))}}function hu(e,t){const r=li(e),o=Ko(e,t),n=Er(e),i=o.width-r.sheetMargin.left-r.sheetMargin.right;return Bs(i,n.width,r.gapX)}function Fs(e,t){const r=[],o=li(e);It(e)&&r.push({code:"CONTINUOUS_UNSUPPORTED",message:$("diagnostic.tiling.continuousUnsupported")});const n=o.sheetPaperSize,i=Yr(n??"");i&&r.push({code:"SHEET_CONTINUOUS",message:$("diagnostic.tiling.sheetContinuous")});const a=o.sheetPaperSize==="CUSTOM"&&!((o.sheetCustomWidth??0)>0&&(o.sheetCustomHeight??0)>0);if(a&&r.push({code:"SHEET_SIZE_INVALID",message:$("diagnostic.tiling.sheetSizeInvalid")}),a||i)return r;const s=Ko(e,t),p=Er(e),l=uu(s,o.sheetMargin),d=Cr(o.sheetMargin.left+o.sheetMargin.right);if(!Number.isInteger(o.columns)||o.columns<1)return r.push({code:"COLUMNS_INVALID",message:$("diagnostic.tiling.columnsInvalid")}),r;const u=Bs(l.w,p.width,o.gapX);if(o.columns>u){const c=Cr(o.columns*p.width+(o.columns-1)*o.gapX);r.push({code:"COLUMNS_OVERFLOW",message:$("diagnostic.tiling.columnsExceedWidth",{columns:o.columns,sheet:Cr(s.width),margin:d,avail:Cr(l.w),max:u,label:p.width,need:c,rotation:cu(e,p)})})}return Math.floor((l.h+o.gapY)/(p.height+o.gapY))<1&&r.push({code:"LABEL_TOO_TALL",message:$("diagnostic.tiling.labelHeightExceed",{height:p.height,avail:Cr(l.h),rotation:cu(e,p)})}),r}function ty(e){const t=[],r=new Set;for(const o of e)for(const n of o.warnings??[])r.has(n)||(r.add(n),t.push(n));return t}function ry(e){const t=Array.isArray(e.pages)?e.pages:[e],r=[];for(const o of t)try{r.push(...Qa(o,new Map))}catch{}return ty(r)}function oy(e){const{copies:t,layout:r}=e,o=t[0].bound,n=[];for(let a=0;a<t.length;a+=r.perSheet){const s=t.slice(a,a+r.perSheet).map((p,l)=>{const d=ey(r,l),u=oi(p.bound,p.pageLayouts,p.data,{codeRenderer:p.codeRenderer,renderers:p.renderers});return`<div class="print-tile" style="left:${d.left}mm;top:${d.top}mm">
262
+ .print-copy:not(:last-child){break-after:page;page-break-after:always;}`,i=Uo(t.fonts)+n;return{html:ni(i,o,r?"continuous":void 0),pageCount:e.reduce((a,s)=>a+s.pageLayouts.length,0),copyPaperMm:e.map(a=>a.paperMm)}}const Nt={enabled:!0,sheetPaperSize:"A4",sheetOrientation:"portrait",sheetMargin:{top:10,right:10,bottom:10,left:10},gapX:2,gapY:2,columns:2};class Qk extends Error{constructor(t,r){super(r),this.name="TilingError",this.code=t}}function Cr(e){return Math.round(e*10)/10}function cu(e,t){const r=e.outputRotation;return r===90||r===270?$("diagnostic.tiling.rotationNote",{angle:r,width:t.width,height:t.height}):""}function li(e){const t=e.tiling;return{...Nt,...t,sheetMargin:{...Nt.sheetMargin,...t?.sheetMargin??{}}}}function Ko(e,t){const r=li(e),o=t?.paperOverride;if(o&&typeof o.width=="number"&&o.width>0&&typeof o.height=="number"&&o.height>0)return{width:o.width,height:o.height};if(r.sheetPaperSize==="CUSTOM")return{width:r.sheetCustomWidth??Pr.A4.width,height:r.sheetCustomHeight??Pr.A4.height};const n=r.sheetPaperSize??"A4",i=Pr[n]??Pr.A4;return r.sheetOrientation==="landscape"?{width:i.height,height:i.width}:{...i}}function uu(e,t){return{w:e.width-t.left-t.right,h:e.height-t.top-t.bottom}}function Ns(e,t,r){return Math.max(0,Math.floor((e+r)/(t+r)))}function fu(e,t){const r=Fs(e,t);if(r.length)throw new Qk(r[0].code,r[0].message);const o=li(e),n=Ko(e,t),i=Er(e),a=uu(n,o.sheetMargin),s=Math.floor((a.h+o.gapY)/(i.height+o.gapY));return{tile:{width:i.width,height:i.height},sheet:n,columns:o.columns,rows:s,perSheet:o.columns*s,maxColumns:Ns(a.w,i.width,o.gapX),margin:{...o.sheetMargin},gapX:o.gapX,gapY:o.gapY}}function ey(e,t){const r=t%e.perSheet,o=r%e.columns,n=Math.floor(r/e.columns);return{left:Cr(e.margin.left+o*(e.tile.width+e.gapX)),top:Cr(e.margin.top+n*(e.tile.height+e.gapY))}}function hu(e,t){const r=li(e),o=Ko(e,t),n=Er(e),i=o.width-r.sheetMargin.left-r.sheetMargin.right;return Ns(i,n.width,r.gapX)}function Fs(e,t){const r=[],o=li(e);It(e)&&r.push({code:"CONTINUOUS_UNSUPPORTED",message:$("diagnostic.tiling.continuousUnsupported")});const n=o.sheetPaperSize,i=Yr(n??"");i&&r.push({code:"SHEET_CONTINUOUS",message:$("diagnostic.tiling.sheetContinuous")});const a=o.sheetPaperSize==="CUSTOM"&&!((o.sheetCustomWidth??0)>0&&(o.sheetCustomHeight??0)>0);if(a&&r.push({code:"SHEET_SIZE_INVALID",message:$("diagnostic.tiling.sheetSizeInvalid")}),a||i)return r;const s=Ko(e,t),p=Er(e),l=uu(s,o.sheetMargin),d=Cr(o.sheetMargin.left+o.sheetMargin.right);if(!Number.isInteger(o.columns)||o.columns<1)return r.push({code:"COLUMNS_INVALID",message:$("diagnostic.tiling.columnsInvalid")}),r;const u=Ns(l.w,p.width,o.gapX);if(o.columns>u){const c=Cr(o.columns*p.width+(o.columns-1)*o.gapX);r.push({code:"COLUMNS_OVERFLOW",message:$("diagnostic.tiling.columnsExceedWidth",{columns:o.columns,sheet:Cr(s.width),margin:d,avail:Cr(l.w),max:u,label:p.width,need:c,rotation:cu(e,p)})})}return Math.floor((l.h+o.gapY)/(p.height+o.gapY))<1&&r.push({code:"LABEL_TOO_TALL",message:$("diagnostic.tiling.labelHeightExceed",{height:p.height,avail:Cr(l.h),rotation:cu(e,p)})}),r}function ty(e){const t=[],r=new Set;for(const o of e)for(const n of o.warnings??[])r.has(n)||(r.add(n),t.push(n));return t}function ry(e){const t=Array.isArray(e.pages)?e.pages:[e],r=[];for(const o of t)try{r.push(...Qa(o,new Map))}catch{}return ty(r)}function oy(e){const{copies:t,layout:r}=e,o=t[0].bound,n=[];for(let a=0;a<t.length;a+=r.perSheet){const s=t.slice(a,a+r.perSheet).map((p,l)=>{const d=ey(r,l),u=oi(p.bound,p.pageLayouts,p.data,{codeRenderer:p.codeRenderer,renderers:p.renderers});return`<div class="print-tile" style="left:${d.left}mm;top:${d.top}mm">
263
263
  ${u}
264
264
  </div>`}).join(`
265
265
  `);n.push(`<section class="print-sheet">
@@ -272,14 +272,14 @@ ${s}
272
272
  `);return e.length>1?`<section class="print-copy">
273
273
  ${c}
274
274
  </section>`:c}).join(`
275
- `),n=e.reduce((p,l)=>p+l.layoutsPerPage.reduce((d,u)=>d+u.length,0),0),i=[],a=[];let s=0;for(const p of e)for(const[l,d]of p.layoutsPerPage.entries()){const u=Er(p.boundPages[l]);for(const c of d)i.push({...c,pageIndex:s++}),a.push({...u})}return{html:ni(r,o),pageCount:n,pagePaperMm:a,pageLayouts:i}}async function sy(e,t){return t.withSession(e,r=>ly(e,r))}async function ly(e,t){const r=zs(e.templateJson);if(r.length>1){const p=du(e.printData),l=p.mode==="batch"?p.dataList:[p.data],d=[];for(let c=0;c<l.length;c++)try{d.push(await dy(e,t,l[c]))}catch(f){const h=f instanceof Error?f.message:String(f);throw new Error(`第 ${c+1} 份渲染失败:${h}`)}const u=ay(d);return{html:u.html,pageCount:u.pageCount,paperMm:Er(r[0]),pagePaperMm:u.pagePaperMm,continuous:!1,heightSource:"config",pageLayouts:u.pageLayouts,copies:d.length}}const o=r[0]!==e.templateJson?{...e,templateJson:r[0]}:e,n=r[0],i=du(o.printData);if(i.mode==="single"){const p=await gu(o,t,i.data);return n.tiling?.enabled===!0?mu(o,[{bound:p.bound,pageLayouts:p.pageLayouts,data:i.data,codeRenderer:p.codeRenderer,renderers:p.renderers,derivedHeightMm:p.derivedHeightMm,paperMm:p.paperMm,heightSource:p.heightSource}]):py(p)}const a=[];for(let p=0;p<i.dataList.length;p++)try{const l=await gu(o,t,i.dataList[p]);a.push({bound:l.bound,pageLayouts:l.pageLayouts,data:i.dataList[p],codeRenderer:l.codeRenderer,renderers:l.renderers,derivedHeightMm:l.derivedHeightMm,paperMm:l.paperMm,heightSource:l.heightSource})}catch(l){const d=l instanceof Error?l.message:String(l);throw new Error(`第 ${p+1} 份渲染失败:${d}`)}if(n.tiling?.enabled===!0)return mu(o,a);const s=Jk(a);return{html:s.html,pageCount:s.pageCount,paperMm:a[0].paperMm,continuous:It(a[0].bound),heightSource:a[0].heightSource,pageLayouts:a.flatMap(p=>p.pageLayouts),copies:a.length,copyPaperMm:s.copyPaperMm}}function py(e){return{html:e.html,pageCount:e.pageCount,paperMm:e.paperMm,continuous:e.continuous,heightSource:e.heightSource,pageLayouts:e.pageLayouts,copies:1}}function mu(e,t){const r=t[0].bound,o=fu(r,{paperOverride:e.paperOverride});t.forEach((i,a)=>{const s=i.pageLayouts[0]?.overflow===!0;if(i.pageLayouts.length!==1||s){const p=s?"内容超出纸张高度":`渲染出 ${i.pageLayouts.length} 页`;throw new Error(`拼版要求每份标签恰好 1 页,第 ${a+1} 份${p};请缩小内容或调整标签纸张高度`)}});const n=oy({copies:t.map(i=>({bound:i.bound,pageLayouts:i.pageLayouts,data:i.data,codeRenderer:i.codeRenderer,renderers:i.renderers})),layout:o});return{html:n.html,pageCount:n.sheetCount,paperMm:{width:o.sheet.width,height:o.sheet.height},continuous:!1,heightSource:"config",pageLayouts:t.flatMap(i=>i.pageLayouts),copies:t.length}}async function gu(e,t,r){const o=Cc(e.templateJson,r,e.baseUrl,e.fontBaseUrl),n=It(o),i=yt(o),a=iu(i),s=zk({paperHeightMm:e.paperHeightMm,override:e.paperOverride}),p=await pi({bound:o,job:e,session:t,data:r,pageLayouts:[],isMeasurementPass:!0}),l=await t.measure(p.html,a);su(o,l.fits);const d=Qa(o,au(l.measurements,o)),u=await pi({bound:o,job:e,session:t,data:r,pageLayouts:d,isMeasurementPass:!1,codeBaseMap:p.codeMap,assetBaseMap:p.assetMap});let c=u.html,f;if(n){if(s&&s>0)f=s;else{const w=await t.probeContentBottom(c,a);f=$k(o,Ns(w))}c=ri(o,d,r,{codeRenderer:u.codeRenderer,renderers:u.renderers,pageHeightMm:f})}const h=n&&s?{...e.paperOverride,height:s}:e.paperOverride,b=Er(o),{paperMm:k,heightSource:v}=Hk({paperMm:{width:b.width,height:f??b.height},continuous:n,override:h});return{html:c,pageCount:d.length,paperMm:k,continuous:n,heightSource:v,pageLayouts:d,copies:1,bound:o,codeRenderer:u.codeRenderer,renderers:u.renderers,derivedHeightMm:f}}async function dy(e,t,r){const o=zs(e.templateJson),n=[],i=[],a=[],s=[];for(const p of o){const l=iu(yt(p)),d=Cc(p,r,e.baseUrl,e.fontBaseUrl),u=await pi({bound:d,job:e,session:t,data:r,pageLayouts:[],isMeasurementPass:!0}),c=await t.measure(u.html,l);su(d,c.fits);const f=Qa(d,au(c.measurements,d)),h=await pi({bound:d,job:e,session:t,data:r,pageLayouts:f,isMeasurementPass:!1,codeBaseMap:u.codeMap,assetBaseMap:u.assetMap});n.push(d),i.push(f),a.push(h.codeRenderer),s.push(h.renderers)}return{boundPages:n,layoutsPerPage:i,data:r,codeRenderers:a,renderersPerPage:s}}async function pi(e){const t=e.codeBaseMap??new Map,r=e.assetBaseMap??new Map,{job:o}=e,n=fk(),i=o.renderers;if(o.codeRenderer&&(n.length===0||i))return{html:ri(e.bound,e.pageLayouts,e.data,{isMeasurementPass:e.isMeasurementPass,codeRenderer:o.codeRenderer,renderers:i}),codeRenderer:o.codeRenderer,renderers:i,codeMap:t,assetMap:r};const a=Wk(t),s=ck(r),p=o.codeRenderer??a.renderer,l=i??(n.length>0?Yc(s.renderer,n):void 0),d=ri(e.bound,e.pageLayouts,e.data,{isMeasurementPass:e.isMeasurementPass,codeRenderer:p,renderers:l}),u=o.codeRenderer?[]:a.takeSpecs(),c=i?[]:s.takeSpecs(),[f,h]=await Promise.all([u.length>0?e.session.renderCodes(u):Promise.resolve(new Map),mk(c,e.session)]),b=Vk(t,f),k=Kc(r,h),v=o.codeRenderer??(b.size>0?jk(b):void 0),w=i??(k.size>0?Yc(uk(k),n):l);return u.length===0&&c.length===0?{html:d,codeRenderer:v,renderers:w,codeMap:b,assetMap:k}:{html:ri(e.bound,e.pageLayouts,e.data,{isMeasurementPass:e.isMeasurementPass,codeRenderer:v,renderers:w}),codeRenderer:v,renderers:w,codeMap:b,assetMap:k}}class cy{constructor(t){this.functions={},t?.functions&&(this.functions={...t.functions})}registerFunction(t,r){this.functions[t]=r}evaluate(t,r){const o=us(t),n=fs(o);return et(n,r,this.functions)}render(t,r){return fc(t,this.functions)(r)}}const bu=new cy,uy={MONEY:hc,CONCAT:(...e)=>e.filter(t=>t!=null).join(""),IF:bc,FORMAT:e=>typeof e!="number"?String(e):tr(e,er(),{minimumFractionDigits:2,maximumFractionDigits:2}),SUBSTR:(e,t,r)=>String(e).slice(t,r?t+r:void 0),LEN:e=>String(e).length,ADD:xc,SUB:Pc,MUL:Ec,DIV:Sc,ROUND:Tc,ROUNDUP:Yn,CEIL:Yn,ROUNDDOWN:Xn,FLOOR:Xn,ROUNDBANK:Mc,NOW:()=>new Date().toISOString().split("T")[0],IFEMPTY:(e,t)=>e!=null&&e!==""?String(e):t,PAD:(e,t,r)=>String(e).padStart(t,r),REPLACE:(e,t,r)=>String(e).replace(new RegExp(t,"g"),r),JSON:e=>JSON.stringify(e,null,2),DATE:mc,UPPER:gc};for(const[e,t]of Object.entries(uy))bu.registerFunction(e,t);function fy(e,t,r){switch(e.toUpperCase()){case"SUM":return ys(r,t);case"AVG":return kc(r,t);case"COUNT":return yc(r);case"MIN":return vc(r,t);case"MAX":return wc(r,t);default:return 0}}function to(e,t){if(!e)return"";if(!e.includes("{"))return e;const r=Array.isArray(t.rows)?t.rows:[];let o=e.replace(/\{([^}]+)\}/g,(n,i)=>{let a=i.trim();return a=a.replace(/\b(SUM|AVG|COUNT|MIN|MAX)\(([^)]+)\)/g,(s,p,l)=>{const d=l.trim().replace(/^['"]|['"]$/g,"");return String(fy(p,d,r))}),`{${a}}`});try{return bu.render(o,t)}catch{return e}}const vt={supplier:{name:"鑫达五金有限公司",phone:"0571-88776655",address:"杭州市萧山区经济开发区88号"},receiver:{name:"李四",phone:"13912345678",address:"杭州市余杭区文一西路998号"},order:{no:"PO20260801001",date:"2026-08-01",total:69543.75},goods:[{name:"碳钢螺丝 M8",spec:"M14×10",unit:"个",qty:100,price:.5,amount:50,remark:"A级"},{name:"不锈钢螺母 M10",spec:"M16×11",unit:"套",qty:117,price:.75,amount:87.75,remark:""},{name:"弹簧垫圈 M12",spec:"M6×12",unit:"盒",qty:134,price:1,amount:134,remark:""},{name:"六角螺栓 M14",spec:"M5×13",unit:"支",qty:151,price:1.25,amount:188.75,remark:""},{name:"内六角螺钉 M16",spec:"M20×14",unit:"袋",qty:168,price:1.5,amount:252,remark:""},{name:"平垫圈 M6",spec:"M4×15",unit:"件",qty:185,price:1.75,amount:323.75,remark:""},{name:"自攻螺钉 M5",spec:"M3×16",unit:"根",qty:202,price:2,amount:404,remark:""},{name:"双头螺柱 M20",spec:"M8×17",unit:"包",qty:219,price:2.25,amount:492.75,remark:"A级"},{name:"紧定螺钉 M4",spec:"M10×18",unit:"只",qty:236,price:2.5,amount:590,remark:""},{name:"十字盘头钉 M3",spec:"M12×19",unit:"组",qty:253,price:2.75,amount:695.75,remark:""},{name:"碳钢螺丝 M8",spec:"M14×20",unit:"个",qty:270,price:3,amount:810,remark:""},{name:"不锈钢螺母 M10",spec:"M16×21",unit:"套",qty:287,price:3.25,amount:932.75,remark:""},{name:"弹簧垫圈 M12",spec:"M6×22",unit:"盒",qty:304,price:3.5,amount:1064,remark:""},{name:"六角螺栓 M14",spec:"M5×23",unit:"支",qty:321,price:3.75,amount:1203.75,remark:""},{name:"内六角螺钉 M16",spec:"M20×24",unit:"袋",qty:338,price:4,amount:1352,remark:"A级"},{name:"平垫圈 M6",spec:"M4×25",unit:"件",qty:355,price:4.25,amount:1508.75,remark:""},{name:"自攻螺钉 M5",spec:"M3×26",unit:"根",qty:372,price:4.5,amount:1674,remark:""},{name:"双头螺柱 M20",spec:"M8×27",unit:"包",qty:389,price:4.75,amount:1847.75,remark:""},{name:"紧定螺钉 M4",spec:"M10×28",unit:"只",qty:406,price:5,amount:2030,remark:""},{name:"十字盘头钉 M3",spec:"M12×29",unit:"组",qty:423,price:5.25,amount:2220.75,remark:""},{name:"碳钢螺丝 M8",spec:"M14×30",unit:"个",qty:440,price:.5,amount:220,remark:""},{name:"不锈钢螺母 M10",spec:"M16×31",unit:"套",qty:457,price:.75,amount:342.75,remark:"A级"},{name:"弹簧垫圈 M12",spec:"M6×32",unit:"盒",qty:474,price:1,amount:474,remark:""},{name:"六角螺栓 M14",spec:"M5×33",unit:"支",qty:491,price:1.25,amount:613.75,remark:""},{name:"内六角螺钉 M16",spec:"M20×34",unit:"袋",qty:508,price:1.5,amount:762,remark:""},{name:"平垫圈 M6",spec:"M4×35",unit:"件",qty:525,price:1.75,amount:918.75,remark:""},{name:"自攻螺钉 M5",spec:"M3×36",unit:"根",qty:542,price:2,amount:1084,remark:""},{name:"双头螺柱 M20",spec:"M8×37",unit:"包",qty:559,price:2.25,amount:1257.75,remark:""},{name:"紧定螺钉 M4",spec:"M10×38",unit:"只",qty:576,price:2.5,amount:1440,remark:"A级"},{name:"十字盘头钉 M3",spec:"M12×39",unit:"组",qty:593,price:2.75,amount:1630.75,remark:""},{name:"碳钢螺丝 M8",spec:"M14×40",unit:"个",qty:610,price:3,amount:1830,remark:""},{name:"不锈钢螺母 M10",spec:"M16×41",unit:"套",qty:627,price:3.25,amount:2037.75,remark:""},{name:"弹簧垫圈 M12",spec:"M6×42",unit:"盒",qty:644,price:3.5,amount:2254,remark:""},{name:"六角螺栓 M14",spec:"M5×43",unit:"支",qty:661,price:3.75,amount:2478.75,remark:""},{name:"内六角螺钉 M16",spec:"M20×44",unit:"袋",qty:678,price:4,amount:2712,remark:""},{name:"平垫圈 M6",spec:"M4×45",unit:"件",qty:695,price:4.25,amount:2953.75,remark:"A级"},{name:"自攻螺钉 M5",spec:"M3×46",unit:"根",qty:712,price:4.5,amount:3204,remark:""},{name:"双头螺柱 M20",spec:"M8×47",unit:"包",qty:729,price:4.75,amount:3462.75,remark:""},{name:"紧定螺钉 M4",spec:"M10×48",unit:"只",qty:746,price:5,amount:3730,remark:""},{name:"十字盘头钉 M3",spec:"M12×49",unit:"组",qty:763,price:5.25,amount:4005.75,remark:""},{name:"碳钢螺丝 M8",spec:"M14×10",unit:"个",qty:780,price:.5,amount:390,remark:""},{name:"不锈钢螺母 M10",spec:"M16×11",unit:"套",qty:797,price:.75,amount:597.75,remark:""},{name:"弹簧垫圈 M12",spec:"M6×12",unit:"盒",qty:814,price:1,amount:814,remark:"A级"},{name:"六角螺栓 M14",spec:"M5×13",unit:"支",qty:831,price:1.25,amount:1038.75,remark:""},{name:"内六角螺钉 M16",spec:"M20×14",unit:"袋",qty:848,price:1.5,amount:1272,remark:""},{name:"平垫圈 M6",spec:"M4×15",unit:"件",qty:865,price:1.75,amount:1513.75,remark:""},{name:"自攻螺钉 M5",spec:"M3×16",unit:"根",qty:882,price:2,amount:1764,remark:""},{name:"双头螺柱 M20",spec:"M8×17",unit:"包",qty:899,price:2.25,amount:2022.75,remark:""},{name:"紧定螺钉 M4",spec:"M10×18",unit:"只",qty:916,price:2.5,amount:2290,remark:""},{name:"十字盘头钉 M3",spec:"M12×19",unit:"组",qty:933,price:2.75,amount:2565.75,remark:"A级"}]},di={left:0,center:50,right:100},ci={top:0,center:50,bottom:100};function ro(e){return Number.isFinite(e)?Math.round(Math.min(100,Math.max(0,e))):50}function ku(e){return Math.round(e*100)/100}function yu(e,t){const r=ro(e),o=ro(t);if(!(r===50&&o===50))return`${r}% ${o}%`}function hy(e){return/^\d+(?:\.\d+)?%$/.test(e)?parseFloat(e):void 0}function my(e){const t=(e??"").trim();if(!t)return{kind:"empty"};const r=t.toLowerCase().split(/\s+/);let o,n;for(let i=0;i<r.length;i++){const a=r[i],s=hy(a);if(i===0)if(a in di)o=di[a];else if(s!==void 0)o=s;else if(a in ci)n=ci[a];else return{kind:"custom",raw:e};else if(a in ci&&n===void 0)n=ci[a];else if(s!==void 0&&o===void 0)o=s;else if(s!==void 0&&n===void 0)n=s;else if(a in di&&o===void 0)o=di[a];else return{kind:"custom",raw:e}}return{kind:"axes",x:ro(o??50),y:ro(n??50)}}const vu=25.4/96;function wu(e){const{widthMm:t,heightMm:r,naturalWidth:o,naturalHeight:n}=e;if(!o||!n||!t||!r)return null;const i=t/o,a=r/n,s=(Dd(e.fit,e.scalePct)??Oo)/100;switch(e.fit||"contain"){case"fill":return{w:t,h:r};case"cover":{const p=Math.max(i,a)*s;return{w:o*p,h:n*p}}case"none":return{w:o*vu,h:n*vu};case"scale-down":{const p=Math.min(1,Math.min(i,a));return{w:o*p,h:n*p}}default:{const p=Math.min(i,a);return{w:o*p,h:n*p}}}}function gy(e){const t=wu(e);return t?{x:ku(Math.abs(e.widthMm-t.w)),y:ku(Math.abs(e.heightMm-t.h))}:{x:null,y:null}}function by(e,t,r){const o=wu(e);if(!o)return null;const n=Math.min(1,e.widthMm/o.w),i=Math.min(1,e.heightMm/o.h);return{leftPct:(1-n)*ro(t),topPct:(1-i)*ro(r),widthPct:n*100,heightPct:i*100}}function xu(e){const t=String(e??"");return t?t.includes("{")?String(to(t,vt)):t:""}function Pu(e){return e==="vertical"?[{value:0,label:$("crop.top")},{value:50,label:$("crop.center")},{value:100,label:$("crop.bottom")}]:[{value:0,label:$("crop.left")},{value:50,label:$("crop.center")},{value:100,label:$("crop.right")}]}function ky(){return[{x:0,y:0,label:$("crop.topLeft")},{x:50,y:0,label:$("crop.topCenter")},{x:100,y:0,label:$("crop.topRight")},{x:0,y:50,label:$("crop.middleLeft")},{x:50,y:50,label:$("crop.center")},{x:100,y:50,label:$("crop.middleRight")},{x:0,y:100,label:$("crop.bottomLeft")},{x:50,y:100,label:$("crop.bottomCenter")},{x:100,y:100,label:$("crop.bottomRight")}]}function Hs(e=$){return[{value:"contain",label:e("crop.fitContain")},{value:"cover",label:e("crop.fitCover")},{value:"fill",label:e("crop.fitFill")},{value:"none",label:e("crop.fitNone")},{value:"scale-down",label:e("crop.fitScaleDown")}]}const yy="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTIwIDEyMCI+PHJlY3Qgd2lkdGg9IjEyMCIgaGVpZ2h0PSIxMjAiIGZpbGw9IiNmZmZmZmYiLz48cGF0aCBkPSJNNDAgMFYxMjBNODAgMFYxMjBNMCA0MEgxMjBNMCA4MEgxMjAiIHN0cm9rZT0iI2VlZjFmNiIgc3Ryb2tlLXdpZHRoPSIxIi8+PGNpcmNsZSBjeD0iMjAiIGN5PSIyMCIgcj0iMy41IiBmaWxsPSIjOGI5NWE1Ii8+PGNpcmNsZSBjeD0iMTAwIiBjeT0iMjAiIHI9IjMuNSIgZmlsbD0iIzhiOTVhNSIvPjxjaXJjbGUgY3g9IjIwIiBjeT0iMTAwIiByPSIzLjUiIGZpbGw9IiM4Yjk1YTUiLz48Y2lyY2xlIGN4PSIxMDAiIGN5PSIxMDAiIHI9IjMuNSIgZmlsbD0iIzhiOTVhNSIvPjxjaXJjbGUgY3g9IjYwIiBjeT0iMjAiIHI9IjciIGZpbGw9IiNjMDM5MmIiLz48Y2lyY2xlIGN4PSI2MCIgY3k9IjEwMCIgcj0iNyIgZmlsbD0iIzFmNGZhMyIvPjxjaXJjbGUgY3g9IjIwIiBjeT0iNjAiIHI9IjciIGZpbGw9IiMyYzdhNGEiLz48Y2lyY2xlIGN4PSIxMDAiIGN5PSI2MCIgcj0iNyIgZmlsbD0iI2UwN2EyMCIvPjxjaXJjbGUgY3g9IjYwIiBjeT0iNjAiIHI9IjE0IiBmaWxsPSJub25lIiBzdHJva2U9IiMyZjNhNGEiIHN0cm9rZS13aWR0aD0iNCIvPjxjaXJjbGUgY3g9IjYwIiBjeT0iNjAiIHI9IjYiIGZpbGw9IiMyZjNhNGEiLz48L3N2Zz4=";function vy(){return $("crop.sampleNote")}function wy(e){const t=String(e??"").trim();return!t||t.includes("{")||t.includes("}")?{src:yy,isSample:!0}:{src:t,isSample:!1}}function Eu(e){return $(e==="vertical"?"crop.verticalPosition":"crop.horizontalPosition")}const xy=()=>$("crop.scaleLabel");function Py(e,t=!1){if(t)return $("crop.originalValue");const{x:r,y:o}=e;return r===null||o===null?"":r>0&&o>0?$("crop.movableBoth",{x:r,y:o}):r>0?$("crop.movableX",{x:r}):o>0?$("crop.movableY",{y:o}):$("crop.noRoom")}function Ey(e,t,r){return[{name:"horizontal",label:Eu("horizontal"),value:t,travelMm:e.x},{name:"vertical",label:Eu("vertical"),value:r,travelMm:e.y}]}function Sy(e,t,r){const o=e.x!==null&&e.x>0,n=e.y!==null&&e.y>0;return n&&!o?Pu("vertical").map(i=>({value:`${t},${i.value}`,label:i.label})):o&&!n?Pu("horizontal").map(i=>({value:`${i.value},${r}`,label:i.label})):ky().map(i=>({value:`${i.x},${i.y}`,label:i.label}))}function Su(e){const t=[...e].sort((a,s)=>(a.sortOrder??0)-(s.sortOrder??0)),r=new Map,o=[];for(const a of t){const s=a.fieldKey.indexOf(".");if(s===-1)continue;const p=a.fieldKey.slice(0,s);let l=r.get(p);l||(l={key:p,label:p,isList:!1,fields:[]},r.set(p,l),o.push(p)),l.fields.push(a)}const n=[],i=[];for(const a of t){if(a.fieldKey.includes("."))continue;const s=r.get(a.fieldKey);s?(s.label=a.fieldLabel,s.isList=a.fieldType==="list"):i.push(a)}i.length&&n.push({key:"",label:"",isList:!1,fields:i});for(const a of o)n.push(r.get(a));return n}function Ty(e,t){const r=t.trim().toLowerCase();return r?e.map(o=>({...o,fields:o.fields.filter(n=>n.fieldLabel.toLowerCase().includes(r)||n.fieldKey.toLowerCase().includes(r))})).filter(o=>o.fields.length>0):e}async function Tu(e){if(!e)return!1;const t=typeof navigator>"u"?void 0:navigator;if(t?.clipboard?.writeText)try{return await t.clipboard.writeText(e),!0}catch{}if(typeof document>"u")return!1;const r=document.createElement("textarea");r.value=e,r.setAttribute("readonly",""),r.style.position="fixed",r.style.top="-1000px",r.style.opacity="0",document.body.appendChild(r);try{return r.select(),typeof document.execCommand=="function"&&document.execCommand("copy")}catch{return!1}finally{r.remove()}}const My=Object.fromEntries(Object.entries(So).filter(([,e])=>e.bindings!==void 0).map(([e,t])=>[e,[...t.bindings??[]]]));function Mu(e,t,r,o){return e==="data"?[{targetPath:`options.tableRows[${t}].cells[${r}].formatter`,label:"内容",labelKey:"constants.label.content",dataSource:"list",listField:o,placeholder:"{name}"}]:e==="subtotal"?[{targetPath:`options.tableRows[${t}].cells[${r}].formatter`,label:"内容",labelKey:"constants.label.content",dataSource:"subtotal",placeholder:"{MONEY(SUM(amount))}"}]:e==="summary"?[{targetPath:`options.tableRows[${t}].cells[${r}].formatter`,label:"内容",labelKey:"constants.label.content",dataSource:"summary",placeholder:"{MONEY(SUM(amount))}"}]:[{targetPath:`options.tableRows[${t}].cells[${r}].formatter`,label:"内容",labelKey:"constants.label.content",dataSource:"main",placeholder:"合计: {order.total}"}]}function Cy(e){const t=e.printElementType.type,r=gt(t).bindings??My[t]??[],o=[];if(t==="table"){const n=e.options.dataSource;for(const[i,a]of(e.options.tableRows??[]).entries())for(const[s,p]of a.cells.entries())p.merged||o.push(...Mu(a.type,i,s,n))}return[...r,...o]}function _y(e){return ts("text",{formatter:`{${e.fieldKey}}`,title:e.fieldLabel})}function Dy(e){const t=e.fieldLabel||e.fieldKey;return ts("text",{formatter:t,title:t})}function Cu(e,t){let r=e;for(const o of t.split(".")){if(r==null)return;r=Array.isArray(r)?r[0]?.[o]:r[o]}return r}function _u(e){return Cu(vt,e)}function Us(e,t,r="1234567890128"){const o=t?.[0];return(e??"").replace(/\{([^{}]+)\}/g,(i,a)=>{const s=a.trim(),p=s.includes(".")?Cu(o,s)??_u(s):o?.[s]??_u(s);return p==null?"":String(p)}).trim()||r}const ui={left:"#3b82f6",center:"#10b981",right:"#f59e0b",top:"#3b82f6",middle:"#10b981",bottom:"#f59e0b"};function Du(e){return e==="vCenter"?ui.center:e==="hCenter"?ui.middle:ui[e]??ui.left}function Ay(e,t,r,o={}){const n=o.adsorbMin??1,i=o.adsorbLineMin??2,a=o.showAdsorbLine??!0;let s=e.left,p=e.top;const l=[],d={left:e.left,right:e.left+e.width,vCenter:e.left+e.width/2,top:e.top,bottom:e.top+e.height,hCenter:e.top+e.height/2};let u=1/0;for(const f of t){if(f.id===e.id)continue;const h={left:f.left,right:f.left+f.width,vCenter:f.left+f.width/2,top:f.top,bottom:f.top+f.height,hCenter:f.top+f.height/2},b=[["left","left"],["left","vCenter"],["left","right"],["vCenter","left"],["vCenter","vCenter"],["vCenter","right"],["right","left"],["right","vCenter"],["right","right"]],k=[["top","top"],["top","hCenter"],["top","bottom"],["hCenter","top"],["hCenter","hCenter"],["hCenter","bottom"],["bottom","top"],["bottom","hCenter"],["bottom","bottom"]];for(const[v,w]of b){const P=Math.abs(d[v]-h[w]);P<=n&&P<u&&(u=P,s=e.left+(h[w]-d[v]))}for(const[v,w]of k){const P=Math.abs(d[v]-h[w]);P<=n&&P<u&&(u=P,p=e.top+(h[w]-d[v]))}}if(r){const f={left:s,right:s+e.width,vCenter:s+e.width/2,top:p,bottom:p+e.height,hCenter:p+e.height/2},h=["left","vCenter","right"];for(const k of r.vertical)for(const v of h){const w=Math.abs(f[v]-k);w<=n&&w<u&&(u=w,s=e.left+(k-f[v]))}const b=["top","hCenter","bottom"];for(const k of r.horizontal)for(const v of b){const w=Math.abs(f[v]-k);w<=n&&w<u&&(u=w,p=e.top+(k-f[v]))}}const c={left:s,right:s+e.width,vCenter:s+e.width/2,top:p,bottom:p+e.height,hCenter:p+e.height/2};if(a){const f=new Set;for(const h of t){if(h.id===e.id)continue;const b={left:h.left,right:h.left+h.width,vCenter:h.left+h.width/2,top:h.top,bottom:h.top+h.height,hCenter:h.top+h.height/2},k=[["left","left"],["left","vCenter"],["left","right"],["vCenter","left"],["vCenter","vCenter"],["vCenter","right"],["right","left"],["right","vCenter"],["right","right"]],v=[["top","top"],["top","hCenter"],["top","bottom"],["hCenter","top"],["hCenter","hCenter"],["hCenter","bottom"],["bottom","top"],["bottom","hCenter"],["bottom","bottom"]];for(const[w,P]of k)if(Math.abs(c[w]-b[P])<=i){const D=`v:${b[P]}`;f.has(D)||(f.add(D),l.push({type:"vertical",position:b[P],id:h.id,color:Du(w)}))}for(const[w,P]of v)if(Math.abs(c[w]-b[P])<=i){const D=`h:${b[P]}`;f.has(D)||(f.add(D),l.push({type:"horizontal",position:b[P],id:h.id,color:Du(w)}))}}}if(r){for(const f of r.vertical)l.some(h=>h.type==="vertical"&&h.position===f)||l.push({type:"vertical",position:f});for(const f of r.horizontal)l.some(h=>h.type==="horizontal"&&h.position===f)||l.push({type:"horizontal",position:f})}return{left:s,top:p,lines:l}}function Oy(){function e(t,r){if(t.length<2)return;const o=t.map(i=>Xe(i.options).margin),n={minLeft:Math.min(...o.map(i=>i.left)),maxRight:Math.max(...o.map(i=>i.right)),minTop:Math.min(...o.map(i=>i.top)),maxBottom:Math.max(...o.map(i=>i.bottom))};switch(r){case"left":t.forEach(i=>{i.options.left=n.minLeft});break;case"right":t.forEach((i,a)=>{i.options.left=n.maxRight-o[a].width});break;case"top":t.forEach(i=>{i.options.top=n.minTop});break;case"bottom":t.forEach((i,a)=>{i.options.top=n.maxBottom-o[a].height});break;case"vertical":{const i=n.minLeft+(n.maxRight-n.minLeft)/2;t.forEach((a,s)=>{a.options.left=i-o[s].width/2});break}case"horizontal":{const i=n.minTop+(n.maxBottom-n.minTop)/2;t.forEach((a,s)=>{a.options.top=i-o[s].height/2});break}case"distributeHor":{const i=t.map((l,d)=>({element:l,box:o[d]})).sort((l,d)=>l.box.left-d.box.left),a=i.reduce((l,d)=>l+d.box.width,0),s=(n.maxRight-n.minLeft-a)/(i.length-1);let p=n.minLeft;i.forEach(l=>{l.element.options.left=p,p+=l.box.width+s});break}case"distributeVer":{const i=t.map((l,d)=>({element:l,box:o[d]})).sort((l,d)=>l.box.top-d.box.top),a=i.reduce((l,d)=>l+d.box.height,0),s=(n.maxBottom-n.minTop-a)/(i.length-1);let p=n.minTop;i.forEach(l=>{l.element.options.top=p,p+=l.box.height+s});break}}}return{align:e}}function Au(){return`grp-${Date.now()}-${Math.random().toString(36).slice(2,6)}`}function Ry(){function e(o,n){if(o.filter(s=>n.has(s.id)).length<2)return o;const a=Au();return o.map(s=>n.has(s.id)?{...s,options:{...s.options,groupId:a}}:s)}function t(o,n){const i=o.filter(s=>n.has(s.id)),a=new Set(i.map(s=>s.options.groupId).filter(Boolean));return o.map(s=>s.options.groupId&&a.has(s.options.groupId)?{...s,options:{...s.options,groupId:void 0}}:s)}function r(o,n){const i=o.find(s=>s.id===n);if(!i?.options.groupId)return new Set([n]);const a=new Set;for(const s of o)s.options.groupId===i.options.groupId&&a.add(s.id);return a}return{group:e,ungroup:t,getGroupedIds:r}}const Iy=["nw","n","ne","e","se","s","sw","w"];function Ly(e,t,r,o,n,i){let{left:a,top:s,width:p,height:l}=t;switch(e){case"e":p=Math.max(n,t.width+r);break;case"w":p=Math.max(n,t.width-r),a=t.left+t.width-p;break;case"s":l=Math.max(i,t.height+o);break;case"n":l=Math.max(i,t.height-o),s=t.top+t.height-l;break;case"se":p=Math.max(n,t.width+r),l=Math.max(i,t.height+o);break;case"sw":p=Math.max(n,t.width-r),a=t.left+t.width-p,l=Math.max(i,t.height+o);break;case"ne":p=Math.max(n,t.width+r),l=Math.max(i,t.height-o),s=t.top+t.height-l;break;case"nw":p=Math.max(n,t.width-r),a=t.left+t.width-p,l=Math.max(i,t.height-o),s=t.top+t.height-l;break}return{left:a,top:s,width:p,height:l}}function Ou(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fi={},Yo={},hi={},Ru;function st(){if(Ru)return hi;Ru=1,Object.defineProperty(hi,"__esModule",{value:!0});function e(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}var t=function r(o,n){e(this,r),this.data=o,this.text=n.text||o,this.options=n};return hi.default=t,hi}var Iu;function Ny(){if(Iu)return Yo;Iu=1,Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.CODE39=void 0;var e=(function(){function b(k,v){for(var w=0;w<v.length;w++){var P=v[w];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(k,P.key,P)}}return function(k,v,w){return v&&b(k.prototype,v),w&&b(k,w),k}})(),t=st(),r=o(t);function o(b){return b&&b.__esModule?b:{default:b}}function n(b,k){if(!(b instanceof k))throw new TypeError("Cannot call a class as a function")}function i(b,k){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:b}function a(b,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);b.prototype=Object.create(k&&k.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(b,k):b.__proto__=k)}var s=(function(b){a(k,b);function k(v,w){return n(this,k),v=v.toUpperCase(),w.mod43&&(v+=c(h(v))),i(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,v,w))}return e(k,[{key:"encode",value:function(){for(var w=d("*"),P=0;P<this.data.length;P++)w+=d(this.data[P])+"0";return w+=d("*"),{data:w,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),k})(r.default),p=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],l=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function d(b){return u(f(b))}function u(b){return l[b].toString(2)}function c(b){return p[b]}function f(b){return p.indexOf(b)}function h(b){for(var k=0,v=0;v<b.length;v++)k+=f(b[v]);return k=k%43,k}return Yo.CODE39=s,Yo}var Tt={},mi={},gi={},Oe={},Lu;function Xo(){if(Lu)return Oe;Lu=1,Object.defineProperty(Oe,"__esModule",{value:!0});var e;function t(p,l,d){return l in p?Object.defineProperty(p,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):p[l]=d,p}var r=Oe.SET_A=0,o=Oe.SET_B=1,n=Oe.SET_C=2;Oe.SHIFT=98;var i=Oe.START_A=103,a=Oe.START_B=104,s=Oe.START_C=105;return Oe.MODULO=103,Oe.STOP=106,Oe.FNC1=207,Oe.SET_BY_CODE=(e={},t(e,i,r),t(e,a,o),t(e,s,n),e),Oe.SWAP={101:r,100:o,99:n},Oe.A_START_CHAR="Ð",Oe.B_START_CHAR="Ñ",Oe.C_START_CHAR="Ò",Oe.A_CHARS="[\0-_È-Ï]",Oe.B_CHARS="[ -È-Ï]",Oe.C_CHARS="(Ï*[0-9]{2}Ï*)",Oe.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011],Oe}var Nu;function bi(){if(Nu)return gi;Nu=1,Object.defineProperty(gi,"__esModule",{value:!0});var e=(function(){function l(d,u){for(var c=0;c<u.length;c++){var f=u[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}return function(d,u,c){return u&&l(d.prototype,u),c&&l(d,c),d}})(),t=st(),r=n(t),o=Xo();function n(l){return l&&l.__esModule?l:{default:l}}function i(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function a(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function s(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var p=(function(l){s(d,l);function d(u,c){i(this,d);var f=a(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,u.substring(1),c));return f.bytes=u.split("").map(function(h){return h.charCodeAt(0)}),f}return e(d,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var c=this.bytes,f=c.shift()-105,h=o.SET_BY_CODE[f];if(h===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&c.unshift(o.FNC1);var b=d.next(c,1,h);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:d.getBar(f)+b.result+d.getBar((b.checksum+f)%o.MODULO)+d.getBar(o.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var c=this.options.ean128||!1;return typeof c=="string"&&(c=c.toLowerCase()==="true"),c}}],[{key:"getBar",value:function(c){return o.BARS[c]?o.BARS[c].toString():""}},{key:"correctIndex",value:function(c,f){if(f===o.SET_A){var h=c.shift();return h<32?h+64:h-32}else return f===o.SET_B?c.shift()-32:(c.shift()-48)*10+c.shift()-48}},{key:"next",value:function(c,f,h){if(!c.length)return{result:"",checksum:0};var b=void 0,k=void 0;if(c[0]>=200){k=c.shift()-105;var v=o.SWAP[k];v!==void 0?b=d.next(c,f+1,v):((h===o.SET_A||h===o.SET_B)&&k===o.SHIFT&&(c[0]=h===o.SET_A?c[0]>95?c[0]-96:c[0]:c[0]<32?c[0]+96:c[0]),b=d.next(c,f+1,h))}else k=d.correctIndex(c,h),b=d.next(c,f+1,h);var w=d.getBar(k),P=k*f;return{result:w+b.result,checksum:P+b.checksum}}}]),d})(r.default);return gi.default=p,gi}var ki={},Bu;function By(){if(Bu)return ki;Bu=1,Object.defineProperty(ki,"__esModule",{value:!0});var e=Xo(),t=function(s){return s.match(new RegExp("^"+e.A_CHARS+"*"))[0].length},r=function(s){return s.match(new RegExp("^"+e.B_CHARS+"*"))[0].length},o=function(s){return s.match(new RegExp("^"+e.C_CHARS+"*"))[0]};function n(a,s){var p=s?e.A_CHARS:e.B_CHARS,l=a.match(new RegExp("^("+p+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(l)return l[1]+"Ì"+i(a.substring(l[1].length));var d=a.match(new RegExp("^"+p+"+"))[0];return d.length===a.length?a:d+String.fromCharCode(s?205:206)+n(a.substring(d.length),!s)}function i(a){var s=o(a),p=s.length;if(p===a.length)return a;a=a.substring(p);var l=t(a)>=r(a);return s+String.fromCharCode(l?206:205)+n(a,l)}return ki.default=function(a){var s=void 0,p=o(a).length;if(p>=2)s=e.C_START_CHAR+i(a);else{var l=t(a)>r(a);s=(l?e.A_START_CHAR:e.B_START_CHAR)+n(a,l)}return s.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(d,u){return"Ë"+u})},ki}var Fu;function Fy(){if(Fu)return mi;Fu=1,Object.defineProperty(mi,"__esModule",{value:!0});var e=bi(),t=n(e),r=By(),o=n(r);function n(l){return l&&l.__esModule?l:{default:l}}function i(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function a(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function s(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var p=(function(l){s(d,l);function d(u,c){if(i(this,d),/^[\x00-\x7F\xC8-\xD3]+$/.test(u))var f=a(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,(0,o.default)(u),c));else var f=a(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,u,c));return a(f)}return d})(t.default);return mi.default=p,mi}var yi={},$u;function $y(){if($u)return yi;$u=1,Object.defineProperty(yi,"__esModule",{value:!0});var e=(function(){function l(d,u){for(var c=0;c<u.length;c++){var f=u[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}return function(d,u,c){return u&&l(d.prototype,u),c&&l(d,c),d}})(),t=bi(),r=n(t),o=Xo();function n(l){return l&&l.__esModule?l:{default:l}}function i(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function a(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function s(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var p=(function(l){s(d,l);function d(u,c){return i(this,d),a(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,o.A_START_CHAR+u,c))}return e(d,[{key:"valid",value:function(){return new RegExp("^"+o.A_CHARS+"+$").test(this.data)}}]),d})(r.default);return yi.default=p,yi}var vi={},zu;function zy(){if(zu)return vi;zu=1,Object.defineProperty(vi,"__esModule",{value:!0});var e=(function(){function l(d,u){for(var c=0;c<u.length;c++){var f=u[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}return function(d,u,c){return u&&l(d.prototype,u),c&&l(d,c),d}})(),t=bi(),r=n(t),o=Xo();function n(l){return l&&l.__esModule?l:{default:l}}function i(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function a(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function s(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var p=(function(l){s(d,l);function d(u,c){return i(this,d),a(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,o.B_START_CHAR+u,c))}return e(d,[{key:"valid",value:function(){return new RegExp("^"+o.B_CHARS+"+$").test(this.data)}}]),d})(r.default);return vi.default=p,vi}var wi={},Hu;function Hy(){if(Hu)return wi;Hu=1,Object.defineProperty(wi,"__esModule",{value:!0});var e=(function(){function l(d,u){for(var c=0;c<u.length;c++){var f=u[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}return function(d,u,c){return u&&l(d.prototype,u),c&&l(d,c),d}})(),t=bi(),r=n(t),o=Xo();function n(l){return l&&l.__esModule?l:{default:l}}function i(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function a(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function s(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var p=(function(l){s(d,l);function d(u,c){return i(this,d),a(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,o.C_START_CHAR+u,c))}return e(d,[{key:"valid",value:function(){return new RegExp("^"+o.C_CHARS+"+$").test(this.data)}}]),d})(r.default);return wi.default=p,wi}var Uu;function Uy(){if(Uu)return Tt;Uu=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.CODE128C=Tt.CODE128B=Tt.CODE128A=Tt.CODE128=void 0;var e=Fy(),t=p(e),r=$y(),o=p(r),n=zy(),i=p(n),a=Hy(),s=p(a);function p(l){return l&&l.__esModule?l:{default:l}}return Tt.CODE128=t.default,Tt.CODE128A=o.default,Tt.CODE128B=i.default,Tt.CODE128C=s.default,Tt}var tt={},xi={},Wt={},qu;function Zo(){return qu||(qu=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.SIDE_BIN="101",Wt.MIDDLE_BIN="01010",Wt.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},Wt.EAN2_STRUCTURE=["LL","LG","GL","GG"],Wt.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],Wt.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]),Wt}var Pi={},Ei={},ju;function Jo(){if(ju)return Ei;ju=1,Object.defineProperty(Ei,"__esModule",{value:!0});var e=Zo(),t=function(o,n,i){var a=o.split("").map(function(p,l){return e.BINARIES[n[l]]}).map(function(p,l){return p?p[o[l]]:""});if(i){var s=o.length-1;a=a.map(function(p,l){return l<s?p+i:p})}return a.join("")};return Ei.default=t,Ei}var Wu;function Vu(){if(Wu)return Pi;Wu=1,Object.defineProperty(Pi,"__esModule",{value:!0});var e=(function(){function u(c,f){for(var h=0;h<f.length;h++){var b=f[h];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(c,b.key,b)}}return function(c,f,h){return f&&u(c.prototype,f),h&&u(c,h),c}})(),t=Zo(),r=Jo(),o=a(r),n=st(),i=a(n);function a(u){return u&&u.__esModule?u:{default:u}}function s(u,c){if(!(u instanceof c))throw new TypeError("Cannot call a class as a function")}function p(u,c){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:u}function l(u,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);u.prototype=Object.create(c&&c.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(u,c):u.__proto__=c)}var d=(function(u){l(c,u);function c(f,h){s(this,c);var b=p(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,f,h));return b.fontSize=!h.flat&&h.fontSize>h.width*10?h.width*10:h.fontSize,b.guardHeight=h.height+b.fontSize/2+h.textMargin,b}return e(c,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(h,b){return this.text.substr(h,b)}},{key:"leftEncode",value:function(h,b){return(0,o.default)(h,b)}},{key:"rightText",value:function(h,b){return this.text.substr(h,b)}},{key:"rightEncode",value:function(h,b){return(0,o.default)(h,b)}},{key:"encodeGuarded",value:function(){var h={fontSize:this.fontSize},b={height:this.guardHeight};return[{data:t.SIDE_BIN,options:b},{data:this.leftEncode(),text:this.leftText(),options:h},{data:t.MIDDLE_BIN,options:b},{data:this.rightEncode(),text:this.rightText(),options:h},{data:t.SIDE_BIN,options:b}]}},{key:"encodeFlat",value:function(){var h=[t.SIDE_BIN,this.leftEncode(),t.MIDDLE_BIN,this.rightEncode(),t.SIDE_BIN];return{data:h.join(""),text:this.text}}}]),c})(i.default);return Pi.default=d,Pi}var Gu;function qy(){if(Gu)return xi;Gu=1,Object.defineProperty(xi,"__esModule",{value:!0});var e=(function(){function u(c,f){for(var h=0;h<f.length;h++){var b=f[h];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(c,b.key,b)}}return function(c,f,h){return f&&u(c.prototype,f),h&&u(c,h),c}})(),t=function u(c,f,h){c===null&&(c=Function.prototype);var b=Object.getOwnPropertyDescriptor(c,f);if(b===void 0){var k=Object.getPrototypeOf(c);return k===null?void 0:u(k,f,h)}else{if("value"in b)return b.value;var v=b.get;return v===void 0?void 0:v.call(h)}},r=Zo(),o=Vu(),n=i(o);function i(u){return u&&u.__esModule?u:{default:u}}function a(u,c){if(!(u instanceof c))throw new TypeError("Cannot call a class as a function")}function s(u,c){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:u}function p(u,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);u.prototype=Object.create(c&&c.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(u,c):u.__proto__=c)}var l=function(c){var f=c.substr(0,12).split("").map(function(h){return+h}).reduce(function(h,b,k){return k%2?h+b*3:h+b},0);return(10-f%10)%10},d=(function(u){p(c,u);function c(f,h){a(this,c),f.search(/^[0-9]{12}$/)!==-1&&(f+=l(f));var b=s(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,f,h));return b.lastChar=h.lastChar,b}return e(c,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===l(this.data)}},{key:"leftText",value:function(){return t(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var h=this.data.substr(1,6),b=r.EAN13_STRUCTURE[this.data[0]];return t(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"leftEncode",this).call(this,h,b)}},{key:"rightText",value:function(){return t(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var h=this.data.substr(7,6);return t(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"rightEncode",this).call(this,h,"RRRRRR")}},{key:"encodeGuarded",value:function(){var h=t(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(h.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(h.push({data:"00"}),h.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),h}}]),c})(n.default);return xi.default=d,xi}var Si={},Ku;function jy(){if(Ku)return Si;Ku=1,Object.defineProperty(Si,"__esModule",{value:!0});var e=(function(){function d(u,c){for(var f=0;f<c.length;f++){var h=c[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(u,h.key,h)}}return function(u,c,f){return c&&d(u.prototype,c),f&&d(u,f),u}})(),t=function d(u,c,f){u===null&&(u=Function.prototype);var h=Object.getOwnPropertyDescriptor(u,c);if(h===void 0){var b=Object.getPrototypeOf(u);return b===null?void 0:d(b,c,f)}else{if("value"in h)return h.value;var k=h.get;return k===void 0?void 0:k.call(f)}},r=Vu(),o=n(r);function n(d){return d&&d.__esModule?d:{default:d}}function i(d,u){if(!(d instanceof u))throw new TypeError("Cannot call a class as a function")}function a(d,u){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:d}function s(d,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);d.prototype=Object.create(u&&u.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(d,u):d.__proto__=u)}var p=function(u){var c=u.substr(0,7).split("").map(function(f){return+f}).reduce(function(f,h,b){return b%2?f+h:f+h*3},0);return(10-c%10)%10},l=(function(d){s(u,d);function u(c,f){return i(this,u),c.search(/^[0-9]{7}$/)!==-1&&(c+=p(c)),a(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,c,f))}return e(u,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===p(this.data)}},{key:"leftText",value:function(){return t(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var f=this.data.substr(0,4);return t(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"leftEncode",this).call(this,f,"LLLL")}},{key:"rightText",value:function(){return t(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var f=this.data.substr(4,4);return t(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"rightEncode",this).call(this,f,"RRRR")}}]),u})(o.default);return Si.default=l,Si}var Ti={},Yu;function Wy(){if(Yu)return Ti;Yu=1,Object.defineProperty(Ti,"__esModule",{value:!0});var e=(function(){function c(f,h){for(var b=0;b<h.length;b++){var k=h[b];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(f,k.key,k)}}return function(f,h,b){return h&&c(f.prototype,h),b&&c(f,b),f}})(),t=Zo(),r=Jo(),o=a(r),n=st(),i=a(n);function a(c){return c&&c.__esModule?c:{default:c}}function s(c,f){if(!(c instanceof f))throw new TypeError("Cannot call a class as a function")}function p(c,f){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:c}function l(c,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);c.prototype=Object.create(f&&f.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(c,f):c.__proto__=f)}var d=function(f){var h=f.split("").map(function(b){return+b}).reduce(function(b,k,v){return v%2?b+k*9:b+k*3},0);return h%10},u=(function(c){l(f,c);function f(h,b){return s(this,f),p(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,h,b))}return e(f,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var b=t.EAN5_STRUCTURE[d(this.data)];return{data:"1011"+(0,o.default)(this.data,b,"01"),text:this.text}}}]),f})(i.default);return Ti.default=u,Ti}var Mi={},Xu;function Vy(){if(Xu)return Mi;Xu=1,Object.defineProperty(Mi,"__esModule",{value:!0});var e=(function(){function u(c,f){for(var h=0;h<f.length;h++){var b=f[h];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(c,b.key,b)}}return function(c,f,h){return f&&u(c.prototype,f),h&&u(c,h),c}})(),t=Zo(),r=Jo(),o=a(r),n=st(),i=a(n);function a(u){return u&&u.__esModule?u:{default:u}}function s(u,c){if(!(u instanceof c))throw new TypeError("Cannot call a class as a function")}function p(u,c){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:u}function l(u,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);u.prototype=Object.create(c&&c.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(u,c):u.__proto__=c)}var d=(function(u){l(c,u);function c(f,h){return s(this,c),p(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,f,h))}return e(c,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var h=t.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,o.default)(this.data,h,"01"),text:this.text}}}]),c})(i.default);return Mi.default=d,Mi}var Qo={},Zu;function Ju(){if(Zu)return Qo;Zu=1,Object.defineProperty(Qo,"__esModule",{value:!0});var e=(function(){function u(c,f){for(var h=0;h<f.length;h++){var b=f[h];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(c,b.key,b)}}return function(c,f,h){return f&&u(c.prototype,f),h&&u(c,h),c}})();Qo.checksum=d;var t=Jo(),r=i(t),o=st(),n=i(o);function i(u){return u&&u.__esModule?u:{default:u}}function a(u,c){if(!(u instanceof c))throw new TypeError("Cannot call a class as a function")}function s(u,c){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:u}function p(u,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);u.prototype=Object.create(c&&c.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(u,c):u.__proto__=c)}var l=(function(u){p(c,u);function c(f,h){a(this,c),f.search(/^[0-9]{11}$/)!==-1&&(f+=d(f));var b=s(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,f,h));return b.displayValue=h.displayValue,h.fontSize>h.width*10?b.fontSize=h.width*10:b.fontSize=h.fontSize,b.guardHeight=h.height+b.fontSize/2+h.textMargin,b}return e(c,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==d(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var h="";return h+="101",h+=(0,r.default)(this.data.substr(0,6),"LLLLLL"),h+="01010",h+=(0,r.default)(this.data.substr(6,6),"RRRRRR"),h+="101",{data:h,text:this.text}}},{key:"guardedEncoding",value:function(){var h=[];return this.displayValue&&h.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),h.push({data:"101"+(0,r.default)(this.data[0],"L"),options:{height:this.guardHeight}}),h.push({data:(0,r.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),h.push({data:"01010",options:{height:this.guardHeight}}),h.push({data:(0,r.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),h.push({data:(0,r.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&h.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),h}}]),c})(n.default);function d(u){var c=0,f;for(f=1;f<11;f+=2)c+=parseInt(u[f]);for(f=0;f<11;f+=2)c+=parseInt(u[f])*3;return(10-c%10)%10}return Qo.default=l,Qo}var Ci={},Qu;function Gy(){if(Qu)return Ci;Qu=1,Object.defineProperty(Ci,"__esModule",{value:!0});var e=(function(){function h(b,k){for(var v=0;v<k.length;v++){var w=k[v];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(b,w.key,w)}}return function(b,k,v){return k&&h(b.prototype,k),v&&h(b,v),b}})(),t=Jo(),r=a(t),o=st(),n=a(o),i=Ju();function a(h){return h&&h.__esModule?h:{default:h}}function s(h,b){if(!(h instanceof b))throw new TypeError("Cannot call a class as a function")}function p(h,b){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:h}function l(h,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);h.prototype=Object.create(b&&b.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(h,b):h.__proto__=b)}var d=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],u=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],c=(function(h){l(b,h);function b(k,v){s(this,b);var w=p(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,k,v));if(w.isValid=!1,k.search(/^[0-9]{6}$/)!==-1)w.middleDigits=k,w.upcA=f(k,"0"),w.text=v.text||""+w.upcA[0]+k+w.upcA[w.upcA.length-1],w.isValid=!0;else if(k.search(/^[01][0-9]{7}$/)!==-1)if(w.middleDigits=k.substring(1,k.length-1),w.upcA=f(w.middleDigits,k[0]),w.upcA[w.upcA.length-1]===k[k.length-1])w.isValid=!0;else return p(w);else return p(w);return w.displayValue=v.displayValue,v.fontSize>v.width*10?w.fontSize=v.width*10:w.fontSize=v.fontSize,w.guardHeight=v.height+w.fontSize/2+v.textMargin,w}return e(b,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var v="";return v+="101",v+=this.encodeMiddleDigits(),v+="010101",{data:v,text:this.text}}},{key:"guardedEncoding",value:function(){var v=[];return this.displayValue&&v.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),v.push({data:"101",options:{height:this.guardHeight}}),v.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),v.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&v.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),v}},{key:"encodeMiddleDigits",value:function(){var v=this.upcA[0],w=this.upcA[this.upcA.length-1],P=u[parseInt(w)][parseInt(v)];return(0,r.default)(this.middleDigits,P)}}]),b})(n.default);function f(h,b){for(var k=parseInt(h[h.length-1]),v=d[k],w="",P=0,E=0;E<v.length;E++){var D=v[E];D==="X"?w+=h[P++]:w+=D}return w=""+b+w,""+w+(0,i.checksum)(w)}return Ci.default=c,Ci}var ef;function Ky(){if(ef)return tt;ef=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.UPCE=tt.UPC=tt.EAN2=tt.EAN5=tt.EAN8=tt.EAN13=void 0;var e=qy(),t=c(e),r=jy(),o=c(r),n=Wy(),i=c(n),a=Vy(),s=c(a),p=Ju(),l=c(p),d=Gy(),u=c(d);function c(f){return f&&f.__esModule?f:{default:f}}return tt.EAN13=t.default,tt.EAN8=o.default,tt.EAN5=i.default,tt.EAN2=s.default,tt.UPC=l.default,tt.UPCE=u.default,tt}var _r={},_i={},oo={},tf;function Yy(){return tf||(tf=1,Object.defineProperty(oo,"__esModule",{value:!0}),oo.START_BIN="1010",oo.END_BIN="11101",oo.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]),oo}var rf;function of(){if(rf)return _i;rf=1,Object.defineProperty(_i,"__esModule",{value:!0});var e=(function(){function l(d,u){for(var c=0;c<u.length;c++){var f=u[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}return function(d,u,c){return u&&l(d.prototype,u),c&&l(d,c),d}})(),t=Yy(),r=st(),o=n(r);function n(l){return l&&l.__esModule?l:{default:l}}function i(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function a(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function s(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var p=(function(l){s(d,l);function d(){return i(this,d),a(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return e(d,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var c=this,f=this.data.match(/.{2}/g).map(function(h){return c.encodePair(h)}).join("");return{data:t.START_BIN+f+t.END_BIN,text:this.text}}},{key:"encodePair",value:function(c){var f=t.BINARIES[c[1]];return t.BINARIES[c[0]].split("").map(function(h,b){return(h==="1"?"111":"1")+(f[b]==="1"?"000":"0")}).join("")}}]),d})(o.default);return _i.default=p,_i}var Di={},nf;function Xy(){if(nf)return Di;nf=1,Object.defineProperty(Di,"__esModule",{value:!0});var e=(function(){function l(d,u){for(var c=0;c<u.length;c++){var f=u[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}return function(d,u,c){return u&&l(d.prototype,u),c&&l(d,c),d}})(),t=of(),r=o(t);function o(l){return l&&l.__esModule?l:{default:l}}function n(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function i(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function a(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var s=function(d){var u=d.substr(0,13).split("").map(function(c){return parseInt(c,10)}).reduce(function(c,f,h){return c+f*(3-h%2*2)},0);return Math.ceil(u/10)*10-u},p=(function(l){a(d,l);function d(u,c){return n(this,d),u.search(/^[0-9]{13}$/)!==-1&&(u+=s(u)),i(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,u,c))}return e(d,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===s(this.data)}}]),d})(r.default);return Di.default=p,Di}var af;function Zy(){if(af)return _r;af=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.ITF14=_r.ITF=void 0;var e=of(),t=n(e),r=Xy(),o=n(r);function n(i){return i&&i.__esModule?i:{default:i}}return _r.ITF=t.default,_r.ITF14=o.default,_r}var lt={},Ai={},sf;function en(){if(sf)return Ai;sf=1,Object.defineProperty(Ai,"__esModule",{value:!0});var e=(function(){function l(d,u){for(var c=0;c<u.length;c++){var f=u[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}return function(d,u,c){return u&&l(d.prototype,u),c&&l(d,c),d}})(),t=st(),r=o(t);function o(l){return l&&l.__esModule?l:{default:l}}function n(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function i(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function a(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var s=(function(l){a(d,l);function d(u,c){return n(this,d),i(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,u,c))}return e(d,[{key:"encode",value:function(){for(var c="110",f=0;f<this.data.length;f++){var h=parseInt(this.data[f]),b=h.toString(2);b=p(b,4-b.length);for(var k=0;k<b.length;k++)c+=b[k]=="0"?"100":"110"}return c+="1001",{data:c,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),d})(r.default);function p(l,d){for(var u=0;u<d;u++)l="0"+l;return l}return Ai.default=s,Ai}var Oi={},tn={},lf;function Ri(){if(lf)return tn;lf=1,Object.defineProperty(tn,"__esModule",{value:!0}),tn.mod10=e,tn.mod11=t;function e(r){for(var o=0,n=0;n<r.length;n++){var i=parseInt(r[n]);(n+r.length)%2===0?o+=i:o+=i*2%10+Math.floor(i*2/10)}return(10-o%10)%10}function t(r){for(var o=0,n=[2,3,4,5,6,7],i=0;i<r.length;i++){var a=parseInt(r[r.length-1-i]);o+=n[i%n.length]*a}return(11-o%11)%11}return tn}var pf;function Jy(){if(pf)return Oi;pf=1,Object.defineProperty(Oi,"__esModule",{value:!0});var e=en(),t=o(e),r=Ri();function o(p){return p&&p.__esModule?p:{default:p}}function n(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}function i(p,l){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:p}function a(p,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);p.prototype=Object.create(l&&l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(p,l):p.__proto__=l)}var s=(function(p){a(l,p);function l(d,u){return n(this,l),i(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d+(0,r.mod10)(d),u))}return l})(t.default);return Oi.default=s,Oi}var Ii={},df;function Qy(){if(df)return Ii;df=1,Object.defineProperty(Ii,"__esModule",{value:!0});var e=en(),t=o(e),r=Ri();function o(p){return p&&p.__esModule?p:{default:p}}function n(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}function i(p,l){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:p}function a(p,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);p.prototype=Object.create(l&&l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(p,l):p.__proto__=l)}var s=(function(p){a(l,p);function l(d,u){return n(this,l),i(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d+(0,r.mod11)(d),u))}return l})(t.default);return Ii.default=s,Ii}var Li={},cf;function ev(){if(cf)return Li;cf=1,Object.defineProperty(Li,"__esModule",{value:!0});var e=en(),t=o(e),r=Ri();function o(p){return p&&p.__esModule?p:{default:p}}function n(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}function i(p,l){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:p}function a(p,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);p.prototype=Object.create(l&&l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(p,l):p.__proto__=l)}var s=(function(p){a(l,p);function l(d,u){return n(this,l),d+=(0,r.mod10)(d),d+=(0,r.mod10)(d),i(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,u))}return l})(t.default);return Li.default=s,Li}var Ni={},uf;function tv(){if(uf)return Ni;uf=1,Object.defineProperty(Ni,"__esModule",{value:!0});var e=en(),t=o(e),r=Ri();function o(p){return p&&p.__esModule?p:{default:p}}function n(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}function i(p,l){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:p}function a(p,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);p.prototype=Object.create(l&&l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(p,l):p.__proto__=l)}var s=(function(p){a(l,p);function l(d,u){return n(this,l),d+=(0,r.mod11)(d),d+=(0,r.mod10)(d),i(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,u))}return l})(t.default);return Ni.default=s,Ni}var ff;function rv(){if(ff)return lt;ff=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.MSI1110=lt.MSI1010=lt.MSI11=lt.MSI10=lt.MSI=void 0;var e=en(),t=d(e),r=Jy(),o=d(r),n=Qy(),i=d(n),a=ev(),s=d(a),p=tv(),l=d(p);function d(u){return u&&u.__esModule?u:{default:u}}return lt.MSI=t.default,lt.MSI10=o.default,lt.MSI11=i.default,lt.MSI1010=s.default,lt.MSI1110=l.default,lt}var rn={},hf;function ov(){if(hf)return rn;hf=1,Object.defineProperty(rn,"__esModule",{value:!0}),rn.pharmacode=void 0;var e=(function(){function p(l,d){for(var u=0;u<d.length;u++){var c=d[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}return function(l,d,u){return d&&p(l.prototype,d),u&&p(l,u),l}})(),t=st(),r=o(t);function o(p){return p&&p.__esModule?p:{default:p}}function n(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}function i(p,l){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:p}function a(p,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);p.prototype=Object.create(l&&l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(p,l):p.__proto__=l)}var s=(function(p){a(l,p);function l(d,u){n(this,l);var c=i(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,u));return c.number=parseInt(d,10),c}return e(l,[{key:"encode",value:function(){for(var u=this.number,c="";!isNaN(u)&&u!=0;)u%2===0?(c="11100"+c,u=(u-2)/2):(c="100"+c,u=(u-1)/2);return c=c.slice(0,-2),{data:c,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),l})(r.default);return rn.pharmacode=s,rn}var on={},mf;function nv(){if(mf)return on;mf=1,Object.defineProperty(on,"__esModule",{value:!0}),on.codabar=void 0;var e=(function(){function p(l,d){for(var u=0;u<d.length;u++){var c=d[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}return function(l,d,u){return d&&p(l.prototype,d),u&&p(l,u),l}})(),t=st(),r=o(t);function o(p){return p&&p.__esModule?p:{default:p}}function n(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}function i(p,l){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:p}function a(p,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);p.prototype=Object.create(l&&l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(p,l):p.__proto__=l)}var s=(function(p){a(l,p);function l(d,u){n(this,l),d.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(d="A"+d+"A");var c=i(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d.toUpperCase(),u));return c.text=c.options.text||c.text.replace(/[A-D]/g,""),c}return e(l,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var u=[],c=this.getEncodings(),f=0;f<this.data.length;f++)u.push(c[this.data.charAt(f)]),f!==this.data.length-1&&u.push("0");return{text:this.text,data:u.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),l})(r.default);return on.codabar=s,on}var Dr={},Bi={},no={},gf;function iv(){return gf||(gf=1,Object.defineProperty(no,"__esModule",{value:!0}),no.SYMBOLS=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","($)","(%)","(/)","(+)","ÿ"],no.BINARIES=["100010100","101001000","101000100","101000010","100101000","100100100","100100010","101010000","100010010","100001010","110101000","110100100","110100010","110010100","110010010","110001010","101101000","101100100","101100010","100110100","100011010","101011000","101001100","101000110","100101100","100010110","110110100","110110010","110101100","110100110","110010110","110011010","101101100","101100110","100110110","100111010","100101110","111010100","111010010","111001010","101101110","101110110","110101110","100100110","111011010","111010110","100110010","101011110"],no.MULTI_SYMBOLS={"\0":["(%)","U"],"":["($)","A"],"":["($)","B"],"":["($)","C"],"":["($)","D"],"":["($)","E"],"":["($)","F"],"\x07":["($)","G"],"\b":["($)","H"]," ":["($)","I"],"\n":["($)","J"],"\v":["($)","K"],"\f":["($)","L"],"\r":["($)","M"],"":["($)","N"],"":["($)","O"],"":["($)","P"],"":["($)","Q"],"":["($)","R"],"":["($)","S"],"":["($)","T"],"":["($)","U"],"":["($)","V"],"":["($)","W"],"":["($)","X"],"":["($)","Y"],"":["($)","Z"],"\x1B":["(%)","A"],"":["(%)","B"],"":["(%)","C"],"":["(%)","D"],"":["(%)","E"],"!":["(/)","A"],'"':["(/)","B"],"#":["(/)","C"],"&":["(/)","F"],"'":["(/)","G"],"(":["(/)","H"],")":["(/)","I"],"*":["(/)","J"],",":["(/)","L"],":":["(/)","Z"],";":["(%)","F"],"<":["(%)","G"],"=":["(%)","H"],">":["(%)","I"],"?":["(%)","J"],"@":["(%)","V"],"[":["(%)","K"],"\\":["(%)","L"],"]":["(%)","M"],"^":["(%)","N"],_:["(%)","O"],"`":["(%)","W"],a:["(+)","A"],b:["(+)","B"],c:["(+)","C"],d:["(+)","D"],e:["(+)","E"],f:["(+)","F"],g:["(+)","G"],h:["(+)","H"],i:["(+)","I"],j:["(+)","J"],k:["(+)","K"],l:["(+)","L"],m:["(+)","M"],n:["(+)","N"],o:["(+)","O"],p:["(+)","P"],q:["(+)","Q"],r:["(+)","R"],s:["(+)","S"],t:["(+)","T"],u:["(+)","U"],v:["(+)","V"],w:["(+)","W"],x:["(+)","X"],y:["(+)","Y"],z:["(+)","Z"],"{":["(%)","P"],"|":["(%)","Q"],"}":["(%)","R"],"~":["(%)","S"],"":["(%)","T"]}),no}var bf;function kf(){if(bf)return Bi;bf=1,Object.defineProperty(Bi,"__esModule",{value:!0});var e=(function(){function l(d,u){for(var c=0;c<u.length;c++){var f=u[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}return function(d,u,c){return u&&l(d.prototype,u),c&&l(d,c),d}})(),t=iv(),r=st(),o=n(r);function n(l){return l&&l.__esModule?l:{default:l}}function i(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function a(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function s(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var p=(function(l){s(d,l);function d(u,c){return i(this,d),a(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,u,c))}return e(d,[{key:"valid",value:function(){return/^[0-9A-Z\-. $/+%]+$/.test(this.data)}},{key:"encode",value:function(){var c=this.data.split("").flatMap(function(k){return t.MULTI_SYMBOLS[k]||k}),f=c.map(function(k){return d.getEncoding(k)}).join(""),h=d.checksum(c,20),b=d.checksum(c.concat(h),15);return{text:this.text,data:d.getEncoding("ÿ")+f+d.getEncoding(h)+d.getEncoding(b)+d.getEncoding("ÿ")+"1"}}}],[{key:"getEncoding",value:function(c){return t.BINARIES[d.symbolValue(c)]}},{key:"getSymbol",value:function(c){return t.SYMBOLS[c]}},{key:"symbolValue",value:function(c){return t.SYMBOLS.indexOf(c)}},{key:"checksum",value:function(c,f){var h=c.slice().reverse().reduce(function(b,k,v){var w=v%f+1;return b+d.symbolValue(k)*w},0);return d.getSymbol(h%47)}}]),d})(o.default);return Bi.default=p,Bi}var Fi={},yf;function av(){if(yf)return Fi;yf=1,Object.defineProperty(Fi,"__esModule",{value:!0});var e=(function(){function p(l,d){for(var u=0;u<d.length;u++){var c=d[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}return function(l,d,u){return d&&p(l.prototype,d),u&&p(l,u),l}})(),t=kf(),r=o(t);function o(p){return p&&p.__esModule?p:{default:p}}function n(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}function i(p,l){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:p}function a(p,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);p.prototype=Object.create(l&&l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(p,l):p.__proto__=l)}var s=(function(p){a(l,p);function l(d,u){return n(this,l),i(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,u))}return e(l,[{key:"valid",value:function(){return/^[\x00-\x7f]+$/.test(this.data)}}]),l})(r.default);return Fi.default=s,Fi}var vf;function sv(){if(vf)return Dr;vf=1,Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.CODE93FullASCII=Dr.CODE93=void 0;var e=kf(),t=n(e),r=av(),o=n(r);function n(i){return i&&i.__esModule?i:{default:i}}return Dr.CODE93=t.default,Dr.CODE93FullASCII=o.default,Dr}var nn={},wf;function lv(){if(wf)return nn;wf=1,Object.defineProperty(nn,"__esModule",{value:!0}),nn.GenericBarcode=void 0;var e=(function(){function p(l,d){for(var u=0;u<d.length;u++){var c=d[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}return function(l,d,u){return d&&p(l.prototype,d),u&&p(l,u),l}})(),t=st(),r=o(t);function o(p){return p&&p.__esModule?p:{default:p}}function n(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}function i(p,l){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:p}function a(p,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);p.prototype=Object.create(l&&l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(p,l):p.__proto__=l)}var s=(function(p){a(l,p);function l(d,u){return n(this,l),i(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,u))}return e(l,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),l})(r.default);return nn.GenericBarcode=s,nn}var xf;function pv(){if(xf)return fi;xf=1,Object.defineProperty(fi,"__esModule",{value:!0});var e=Ny(),t=Uy(),r=Ky(),o=Zy(),n=rv(),i=ov(),a=nv(),s=sv(),p=lv();return fi.default={CODE39:e.CODE39,CODE128:t.CODE128,CODE128A:t.CODE128A,CODE128B:t.CODE128B,CODE128C:t.CODE128C,EAN13:r.EAN13,EAN8:r.EAN8,EAN5:r.EAN5,EAN2:r.EAN2,UPC:r.UPC,UPCE:r.UPCE,ITF14:o.ITF14,ITF:o.ITF,MSI:n.MSI,MSI10:n.MSI10,MSI11:n.MSI11,MSI1010:n.MSI1010,MSI1110:n.MSI1110,pharmacode:i.pharmacode,codabar:a.codabar,CODE93:s.CODE93,CODE93FullASCII:s.CODE93FullASCII,GenericBarcode:p.GenericBarcode},fi}var $i={},Pf;function zi(){if(Pf)return $i;Pf=1,Object.defineProperty($i,"__esModule",{value:!0});var e=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t};return $i.default=function(t,r){return e({},t,r)},$i}var Hi={},Ef;function dv(){if(Ef)return Hi;Ef=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=e;function e(t){var r=[];function o(n){if(Array.isArray(n))for(var i=0;i<n.length;i++)o(n[i]);else n.text=n.text||"",n.data=n.data||"",r.push(n)}return o(t),r}return Hi}var Ui={},Sf;function cv(){if(Sf)return Ui;Sf=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.default=e;function e(t){return t.marginTop=t.marginTop||t.margin,t.marginBottom=t.marginBottom||t.margin,t.marginRight=t.marginRight||t.margin,t.marginLeft=t.marginLeft||t.margin,t}return Ui}var qi={},ji={},Wi={},Tf;function Mf(){if(Tf)return Wi;Tf=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.default=e;function e(t){var r=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var o in r)r.hasOwnProperty(o)&&(o=r[o],typeof t[o]=="string"&&(t[o]=parseInt(t[o],10)));return typeof t.displayValue=="string"&&(t.displayValue=t.displayValue!="false"),t}return Wi}var Vi={},Cf;function _f(){if(Cf)return Vi;Cf=1,Object.defineProperty(Vi,"__esModule",{value:!0});var e={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};return Vi.default=e,Vi}var Df;function uv(){if(Df)return ji;Df=1,Object.defineProperty(ji,"__esModule",{value:!0});var e=Mf(),t=n(e),r=_f(),o=n(r);function n(a){return a&&a.__esModule?a:{default:a}}function i(a){var s={};for(var p in o.default)o.default.hasOwnProperty(p)&&(a.hasAttribute("jsbarcode-"+p.toLowerCase())&&(s[p]=a.getAttribute("jsbarcode-"+p.toLowerCase())),a.hasAttribute("data-"+p.toLowerCase())&&(s[p]=a.getAttribute("data-"+p.toLowerCase())));return s.value=a.getAttribute("jsbarcode-value")||a.getAttribute("data-value"),s=(0,t.default)(s),s}return ji.default=i,ji}var Gi={},Ki={},pt={},Af;function Of(){if(Af)return pt;Af=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.getTotalWidthOfEncodings=pt.calculateEncodingAttributes=pt.getBarcodePadding=pt.getEncodingHeight=pt.getMaximumHeightOfEncodings=void 0;var e=zi(),t=r(e);function r(l){return l&&l.__esModule?l:{default:l}}function o(l,d){return d.height+(d.displayValue&&l.text.length>0?d.fontSize+d.textMargin:0)+d.marginTop+d.marginBottom}function n(l,d,u){if(u.displayValue&&d<l){if(u.textAlign=="center")return Math.floor((l-d)/2);if(u.textAlign=="left")return 0;if(u.textAlign=="right")return Math.floor(l-d)}return 0}function i(l,d,u){for(var c=0;c<l.length;c++){var f=l[c],h=(0,t.default)(d,f.options),b;h.displayValue?b=p(f.text,h,u):b=0;var k=f.data.length*h.width;f.width=Math.ceil(Math.max(b,k)),f.height=o(f,h),f.barcodePadding=n(b,k,h)}}function a(l){for(var d=0,u=0;u<l.length;u++)d+=l[u].width;return d}function s(l){for(var d=0,u=0;u<l.length;u++)l[u].height>d&&(d=l[u].height);return d}function p(l,d,u){var c;if(u)c=u;else if(typeof document<"u")c=document.createElement("canvas").getContext("2d");else return 0;c.font=d.fontOptions+" "+d.fontSize+"px "+d.font;var f=c.measureText(l);if(!f)return 0;var h=f.width;return h}return pt.getMaximumHeightOfEncodings=s,pt.getEncodingHeight=o,pt.getBarcodePadding=n,pt.calculateEncodingAttributes=i,pt.getTotalWidthOfEncodings=a,pt}var Rf;function fv(){if(Rf)return Ki;Rf=1,Object.defineProperty(Ki,"__esModule",{value:!0});var e=(function(){function s(p,l){for(var d=0;d<l.length;d++){var u=l[d];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(p,u.key,u)}}return function(p,l,d){return l&&s(p.prototype,l),d&&s(p,d),p}})(),t=zi(),r=n(t),o=Of();function n(s){return s&&s.__esModule?s:{default:s}}function i(s,p){if(!(s instanceof p))throw new TypeError("Cannot call a class as a function")}var a=(function(){function s(p,l,d){i(this,s),this.canvas=p,this.encodings=l,this.options=d}return e(s,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var l=0;l<this.encodings.length;l++){var d=(0,r.default)(this.options,this.encodings[l].options);this.drawCanvasBarcode(d,this.encodings[l]),this.drawCanvasText(d,this.encodings[l]),this.moveCanvasDrawing(this.encodings[l])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var l=this.canvas.getContext("2d");l.save(),(0,o.calculateEncodingAttributes)(this.encodings,this.options,l);var d=(0,o.getTotalWidthOfEncodings)(this.encodings),u=(0,o.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=d+this.options.marginLeft+this.options.marginRight,this.canvas.height=u,l.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(l.fillStyle=this.options.background,l.fillRect(0,0,this.canvas.width,this.canvas.height)),l.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(l,d){var u=this.canvas.getContext("2d"),c=d.data,f;l.textPosition=="top"?f=l.marginTop+l.fontSize+l.textMargin:f=l.marginTop,u.fillStyle=l.lineColor;for(var h=0;h<c.length;h++){var b=h*l.width+d.barcodePadding;c[h]==="1"?u.fillRect(b,f,l.width,l.height):c[h]&&u.fillRect(b,f,l.width,l.height*c[h])}}},{key:"drawCanvasText",value:function(l,d){var u=this.canvas.getContext("2d"),c=l.fontOptions+" "+l.fontSize+"px "+l.font;if(l.displayValue){var f,h;l.textPosition=="top"?h=l.marginTop+l.fontSize-l.textMargin:h=l.height+l.textMargin+l.marginTop+l.fontSize,u.font=c,l.textAlign=="left"||d.barcodePadding>0?(f=0,u.textAlign="left"):l.textAlign=="right"?(f=d.width-1,u.textAlign="right"):(f=d.width/2,u.textAlign="center"),u.fillText(d.text,f,h)}}},{key:"moveCanvasDrawing",value:function(l){var d=this.canvas.getContext("2d");d.translate(l.width,0)}},{key:"restoreCanvas",value:function(){var l=this.canvas.getContext("2d");l.restore()}}]),s})();return Ki.default=a,Ki}var Yi={},If;function hv(){if(If)return Yi;If=1,Object.defineProperty(Yi,"__esModule",{value:!0});var e=(function(){function p(l,d){for(var u=0;u<d.length;u++){var c=d[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}return function(l,d,u){return d&&p(l.prototype,d),u&&p(l,u),l}})(),t=zi(),r=n(t),o=Of();function n(p){return p&&p.__esModule?p:{default:p}}function i(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}var a="http://www.w3.org/2000/svg",s=(function(){function p(l,d,u){i(this,p),this.svg=l,this.encodings=d,this.options=u,this.document=u.xmlDocument||document}return e(p,[{key:"render",value:function(){var d=this.options.marginLeft;this.prepareSVG();for(var u=0;u<this.encodings.length;u++){var c=this.encodings[u],f=(0,r.default)(this.options,c.options),h=this.createGroup(d,f.marginTop,this.svg);this.setGroupOptions(h,f),this.drawSvgBarcode(h,f,c),this.drawSVGText(h,f,c),d+=c.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,o.calculateEncodingAttributes)(this.encodings,this.options);var d=(0,o.getTotalWidthOfEncodings)(this.encodings),u=(0,o.getMaximumHeightOfEncodings)(this.encodings),c=d+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(c,u),this.options.background&&this.drawRect(0,0,c,u,this.svg).setAttribute("fill",this.options.background)}},{key:"drawSvgBarcode",value:function(d,u,c){var f=c.data,h;u.textPosition=="top"?h=u.fontSize+u.textMargin:h=0;for(var b=0,k=0,v=0;v<f.length;v++)k=v*u.width+c.barcodePadding,f[v]==="1"?b++:b>0&&(this.drawRect(k-u.width*b,h,u.width*b,u.height,d),b=0);b>0&&this.drawRect(k-u.width*(b-1),h,u.width*b,u.height,d)}},{key:"drawSVGText",value:function(d,u,c){var f=this.document.createElementNS(a,"text");if(u.displayValue){var h,b;f.setAttribute("font-family",u.font),f.setAttribute("font-size",u.fontSize),u.fontOptions.includes("bold")&&f.setAttribute("font-weight","bold"),u.fontOptions.includes("italic")&&f.setAttribute("font-style","italic"),u.textPosition=="top"?b=u.fontSize-u.textMargin:b=u.height+u.textMargin+u.fontSize,u.textAlign=="left"||c.barcodePadding>0?(h=0,f.setAttribute("text-anchor","start")):u.textAlign=="right"?(h=c.width-1,f.setAttribute("text-anchor","end")):(h=c.width/2,f.setAttribute("text-anchor","middle")),f.setAttribute("x",h),f.setAttribute("y",b),f.appendChild(this.document.createTextNode(c.text)),d.appendChild(f)}}},{key:"setSvgAttributes",value:function(d,u){var c=this.svg;c.setAttribute("width",d+"px"),c.setAttribute("height",u+"px"),c.setAttribute("x","0px"),c.setAttribute("y","0px"),c.setAttribute("viewBox","0 0 "+d+" "+u),c.setAttribute("xmlns",a),c.setAttribute("version","1.1")}},{key:"createGroup",value:function(d,u,c){var f=this.document.createElementNS(a,"g");return f.setAttribute("transform","translate("+d+", "+u+")"),c.appendChild(f),f}},{key:"setGroupOptions",value:function(d,u){d.setAttribute("fill",u.lineColor)}},{key:"drawRect",value:function(d,u,c,f,h){var b=this.document.createElementNS(a,"rect");return b.setAttribute("x",d),b.setAttribute("y",u),b.setAttribute("width",c),b.setAttribute("height",f),h.appendChild(b),b}}]),p})();return Yi.default=s,Yi}var Xi={},Lf;function mv(){if(Lf)return Xi;Lf=1,Object.defineProperty(Xi,"__esModule",{value:!0});var e=(function(){function o(n,i){for(var a=0;a<i.length;a++){var s=i[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,s.key,s)}}return function(n,i,a){return i&&o(n.prototype,i),a&&o(n,a),n}})();function t(o,n){if(!(o instanceof n))throw new TypeError("Cannot call a class as a function")}var r=(function(){function o(n,i,a){t(this,o),this.object=n,this.encodings=i,this.options=a}return e(o,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),o})();return Xi.default=r,Xi}var Nf;function gv(){if(Nf)return Gi;Nf=1,Object.defineProperty(Gi,"__esModule",{value:!0});var e=fv(),t=a(e),r=hv(),o=a(r),n=mv(),i=a(n);function a(s){return s&&s.__esModule?s:{default:s}}return Gi.default={CanvasRenderer:t.default,SVGRenderer:o.default,ObjectRenderer:i.default},Gi}var io={},Bf;function Ff(){if(Bf)return io;Bf=1,Object.defineProperty(io,"__esModule",{value:!0});function e(a,s){if(!(a instanceof s))throw new TypeError("Cannot call a class as a function")}function t(a,s){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s&&(typeof s=="object"||typeof s=="function")?s:a}function r(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof s);a.prototype=Object.create(s&&s.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(a,s):a.__proto__=s)}var o=(function(a){r(s,a);function s(p,l){e(this,s);var d=t(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return d.name="InvalidInputException",d.symbology=p,d.input=l,d.message='"'+d.input+'" is not a valid input for '+d.symbology,d}return s})(Error),n=(function(a){r(s,a);function s(){e(this,s);var p=t(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return p.name="InvalidElementException",p.message="Not supported type to render on",p}return s})(Error),i=(function(a){r(s,a);function s(){e(this,s);var p=t(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return p.name="NoElementException",p.message="No element to render on.",p}return s})(Error);return io.InvalidInputException=o,io.InvalidElementException=n,io.NoElementException=i,io}var $f;function bv(){if($f)return qi;$f=1,Object.defineProperty(qi,"__esModule",{value:!0});var e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},t=uv(),r=a(t),o=gv(),n=a(o),i=Ff();function a(d){return d&&d.__esModule?d:{default:d}}function s(d){if(typeof d=="string")return p(d);if(Array.isArray(d)){for(var u=[],c=0;c<d.length;c++)u.push(s(d[c]));return u}else{if(typeof HTMLCanvasElement<"u"&&d instanceof HTMLImageElement)return l(d);if(d&&d.nodeName&&d.nodeName.toLowerCase()==="svg"||typeof SVGElement<"u"&&d instanceof SVGElement)return{element:d,options:(0,r.default)(d),renderer:n.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&d instanceof HTMLCanvasElement)return{element:d,options:(0,r.default)(d),renderer:n.default.CanvasRenderer};if(d&&d.getContext)return{element:d,renderer:n.default.CanvasRenderer};if(d&&(typeof d>"u"?"undefined":e(d))==="object"&&!d.nodeName)return{element:d,renderer:n.default.ObjectRenderer};throw new i.InvalidElementException}}function p(d){var u=document.querySelectorAll(d);if(u.length!==0){for(var c=[],f=0;f<u.length;f++)c.push(s(u[f]));return c}}function l(d){var u=document.createElement("canvas");return{element:u,options:(0,r.default)(d),renderer:n.default.CanvasRenderer,afterRender:function(){d.setAttribute("src",u.toDataURL())}}}return qi.default=s,qi}var Zi={},zf;function kv(){if(zf)return Zi;zf=1,Object.defineProperty(Zi,"__esModule",{value:!0});var e=(function(){function o(n,i){for(var a=0;a<i.length;a++){var s=i[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,s.key,s)}}return function(n,i,a){return i&&o(n.prototype,i),a&&o(n,a),n}})();function t(o,n){if(!(o instanceof n))throw new TypeError("Cannot call a class as a function")}var r=(function(){function o(n){t(this,o),this.api=n}return e(o,[{key:"handleCatch",value:function(i){if(i.name==="InvalidInputException")if(this.api._options.valid!==this.api._defaults.valid)this.api._options.valid(!1);else throw i.message;else throw i;this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(i){try{var a=i.apply(void 0,arguments);return this.api._options.valid(!0),a}catch(s){return this.handleCatch(s),this.api}}}]),o})();return Zi.default=r,Zi}var qs,Hf;function yv(){if(Hf)return qs;Hf=1;var e=pv(),t=v(e),r=zi(),o=v(r),n=dv(),i=v(n),a=cv(),s=v(a),p=bv(),l=v(p),d=Mf(),u=v(d),c=kv(),f=v(c),h=Ff(),b=_f(),k=v(b);function v(_){return _&&_.__esModule?_:{default:_}}var w=function(){},P=function(I,S,B){var F=new w;if(typeof I>"u")throw Error("No element to render on was provided.");return F._renderProperties=(0,l.default)(I),F._encodings=[],F._options=k.default,F._errorHandler=new f.default(F),typeof S<"u"&&(B=B||{},B.format||(B.format=A()),F.options(B)[B.format](S,B).render()),F};P.getModule=function(_){return t.default[_]};for(var E in t.default)t.default.hasOwnProperty(E)&&D(t.default,E);function D(_,I){w.prototype[I]=w.prototype[I.toUpperCase()]=w.prototype[I.toLowerCase()]=function(S,B){var F=this;return F._errorHandler.wrapBarcodeCall(function(){B.text=typeof B.text>"u"?void 0:""+B.text;var H=(0,o.default)(F._options,B);H=(0,u.default)(H);var le=_[I],M=O(S,le,H);return F._encodings.push(M),F})}}function O(_,I,S){_=""+_;var B=new I(_,S);if(!B.valid())throw new h.InvalidInputException(B.constructor.name,_);var F=B.encode();F=(0,i.default)(F);for(var H=0;H<F.length;H++)F[H].options=(0,o.default)(S,F[H].options);return F}function A(){return t.default.CODE128?"CODE128":Object.keys(t.default)[0]}w.prototype.options=function(_){return this._options=(0,o.default)(this._options,_),this},w.prototype.blank=function(_){var I=new Array(_+1).join("0");return this._encodings.push({data:I}),this},w.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var _;for(var I in this._renderProperties){_=this._renderProperties[I];var S=(0,o.default)(this._options,_.options);S.format=="auto"&&(S.format=A()),this._errorHandler.wrapBarcodeCall(function(){var B=S.value,F=t.default[S.format.toUpperCase()],H=O(B,F,S);R(_,H,S)})}}},w.prototype.render=function(){if(!this._renderProperties)throw new h.NoElementException;if(Array.isArray(this._renderProperties))for(var _=0;_<this._renderProperties.length;_++)R(this._renderProperties[_],this._encodings,this._options);else R(this._renderProperties,this._encodings,this._options);return this},w.prototype._defaults=k.default;function R(_,I,S){I=(0,i.default)(I);for(var B=0;B<I.length;B++)I[B].options=(0,o.default)(S,I[B].options),(0,s.default)(I[B].options);(0,s.default)(S);var F=_.renderer,H=new F(_.element,I,S);H.render(),_.afterRender&&_.afterRender()}return typeof window<"u"&&(window.JsBarcode=P),typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(_,I){var S=[];return jQuery(this).each(function(){S.push(this)}),P(S,_,I)}),qs=P,qs}var vv=yv();const js=Ou(vv);var ao={},Ws,Uf;function wv(){return Uf||(Uf=1,Ws=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Ws}var Vs={},sr={},qf;function Ar(){if(qf)return sr;qf=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return sr.getSymbolSize=function(o){if(!o)throw new Error('"version" cannot be null or undefined');if(o<1||o>40)throw new Error('"version" should be in range from 1 to 40');return o*4+17},sr.getSymbolTotalCodewords=function(o){return t[o]},sr.getBCHDigit=function(r){let o=0;for(;r!==0;)o++,r>>>=1;return o},sr.setToSJISFunction=function(o){if(typeof o!="function")throw new Error('"toSJISFunc" is not a valid function.');e=o},sr.isKanjiModeEnabled=function(){return typeof e<"u"},sr.toSJIS=function(o){return e(o)},sr}var Gs={},jf;function Ks(){return jf||(jf=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+r)}}e.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},e.from=function(o,n){if(e.isValid(o))return o;try{return t(o)}catch{return n}}})(Gs)),Gs}var Ys,Wf;function xv(){if(Wf)return Ys;Wf=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const r=Math.floor(t/8);return(this.buffer[r]>>>7-t%8&1)===1},put:function(t,r){for(let o=0;o<r;o++)this.putBit((t>>>r-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),t&&(this.buffer[r]|=128>>>this.length%8),this.length++}},Ys=e,Ys}var Xs,Vf;function Pv(){if(Vf)return Xs;Vf=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,r,o,n){const i=t*this.size+r;this.data[i]=o,n&&(this.reservedBit[i]=!0)},e.prototype.get=function(t,r){return this.data[t*this.size+r]},e.prototype.xor=function(t,r,o){this.data[t*this.size+r]^=o},e.prototype.isReserved=function(t,r){return this.reservedBit[t*this.size+r]},Xs=e,Xs}var Zs={},Gf;function Ev(){return Gf||(Gf=1,(function(e){const t=Ar().getSymbolSize;e.getRowColCoords=function(o){if(o===1)return[];const n=Math.floor(o/7)+2,i=t(o),a=i===145?26:Math.ceil((i-13)/(2*n-2))*2,s=[i-7];for(let p=1;p<n-1;p++)s[p]=s[p-1]-a;return s.push(6),s.reverse()},e.getPositions=function(o){const n=[],i=e.getRowColCoords(o),a=i.length;for(let s=0;s<a;s++)for(let p=0;p<a;p++)s===0&&p===0||s===0&&p===a-1||s===a-1&&p===0||n.push([i[s],i[p]]);return n}})(Zs)),Zs}var Js={},Kf;function Sv(){if(Kf)return Js;Kf=1;const e=Ar().getSymbolSize,t=7;return Js.getPositions=function(o){const n=e(o);return[[0,0],[n-t,0],[0,n-t]]},Js}var Qs={},Yf;function Tv(){return Yf||(Yf=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},e.from=function(n){return e.isValid(n)?parseInt(n,10):void 0},e.getPenaltyN1=function(n){const i=n.size;let a=0,s=0,p=0,l=null,d=null;for(let u=0;u<i;u++){s=p=0,l=d=null;for(let c=0;c<i;c++){let f=n.get(u,c);f===l?s++:(s>=5&&(a+=t.N1+(s-5)),l=f,s=1),f=n.get(c,u),f===d?p++:(p>=5&&(a+=t.N1+(p-5)),d=f,p=1)}s>=5&&(a+=t.N1+(s-5)),p>=5&&(a+=t.N1+(p-5))}return a},e.getPenaltyN2=function(n){const i=n.size;let a=0;for(let s=0;s<i-1;s++)for(let p=0;p<i-1;p++){const l=n.get(s,p)+n.get(s,p+1)+n.get(s+1,p)+n.get(s+1,p+1);(l===4||l===0)&&a++}return a*t.N2},e.getPenaltyN3=function(n){const i=n.size;let a=0,s=0,p=0;for(let l=0;l<i;l++){s=p=0;for(let d=0;d<i;d++)s=s<<1&2047|n.get(l,d),d>=10&&(s===1488||s===93)&&a++,p=p<<1&2047|n.get(d,l),d>=10&&(p===1488||p===93)&&a++}return a*t.N3},e.getPenaltyN4=function(n){let i=0;const a=n.data.length;for(let p=0;p<a;p++)i+=n.data[p];return Math.abs(Math.ceil(i*100/a/5)-10)*t.N4};function r(o,n,i){switch(o){case e.Patterns.PATTERN000:return(n+i)%2===0;case e.Patterns.PATTERN001:return n%2===0;case e.Patterns.PATTERN010:return i%3===0;case e.Patterns.PATTERN011:return(n+i)%3===0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(i/3))%2===0;case e.Patterns.PATTERN101:return n*i%2+n*i%3===0;case e.Patterns.PATTERN110:return(n*i%2+n*i%3)%2===0;case e.Patterns.PATTERN111:return(n*i%3+(n+i)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}e.applyMask=function(n,i){const a=i.size;for(let s=0;s<a;s++)for(let p=0;p<a;p++)i.isReserved(p,s)||i.xor(p,s,r(n,p,s))},e.getBestMask=function(n,i){const a=Object.keys(e.Patterns).length;let s=0,p=1/0;for(let l=0;l<a;l++){i(l),e.applyMask(l,n);const d=e.getPenaltyN1(n)+e.getPenaltyN2(n)+e.getPenaltyN3(n)+e.getPenaltyN4(n);e.applyMask(l,n),d<p&&(p=d,s=l)}return s}})(Qs)),Qs}var Ji={},Xf;function Zf(){if(Xf)return Ji;Xf=1;const e=Ks(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Ji.getBlocksCount=function(n,i){switch(i){case e.L:return t[(n-1)*4+0];case e.M:return t[(n-1)*4+1];case e.Q:return t[(n-1)*4+2];case e.H:return t[(n-1)*4+3];default:return}},Ji.getTotalCodewordsCount=function(n,i){switch(i){case e.L:return r[(n-1)*4+0];case e.M:return r[(n-1)*4+1];case e.Q:return r[(n-1)*4+2];case e.H:return r[(n-1)*4+3];default:return}},Ji}var el={},an={},Jf;function Mv(){if(Jf)return an;Jf=1;const e=new Uint8Array(512),t=new Uint8Array(256);return(function(){let o=1;for(let n=0;n<255;n++)e[n]=o,t[o]=n,o<<=1,o&256&&(o^=285);for(let n=255;n<512;n++)e[n]=e[n-255]})(),an.log=function(o){if(o<1)throw new Error("log("+o+")");return t[o]},an.exp=function(o){return e[o]},an.mul=function(o,n){return o===0||n===0?0:e[t[o]+t[n]]},an}var Qf;function Cv(){return Qf||(Qf=1,(function(e){const t=Mv();e.mul=function(o,n){const i=new Uint8Array(o.length+n.length-1);for(let a=0;a<o.length;a++)for(let s=0;s<n.length;s++)i[a+s]^=t.mul(o[a],n[s]);return i},e.mod=function(o,n){let i=new Uint8Array(o);for(;i.length-n.length>=0;){const a=i[0];for(let p=0;p<n.length;p++)i[p]^=t.mul(n[p],a);let s=0;for(;s<i.length&&i[s]===0;)s++;i=i.slice(s)}return i},e.generateECPolynomial=function(o){let n=new Uint8Array([1]);for(let i=0;i<o;i++)n=e.mul(n,new Uint8Array([1,t.exp(i)]));return n}})(el)),el}var tl,eh;function _v(){if(eh)return tl;eh=1;const e=Cv();function t(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(o){this.degree=o,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(o){if(!this.genPoly)throw new Error("Encoder not initialized");const n=new Uint8Array(o.length+this.degree);n.set(o);const i=e.mod(n,this.genPoly),a=this.degree-i.length;if(a>0){const s=new Uint8Array(this.degree);return s.set(i,a),s}return i},tl=t,tl}var rl={},ol={},nl={},th;function rh(){return th||(th=1,nl.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),nl}var Ft={},oh;function nh(){if(oh)return Ft;oh=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const o="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r
275
+ `),n=e.reduce((p,l)=>p+l.layoutsPerPage.reduce((d,u)=>d+u.length,0),0),i=[],a=[];let s=0;for(const p of e)for(const[l,d]of p.layoutsPerPage.entries()){const u=Er(p.boundPages[l]);for(const c of d)i.push({...c,pageIndex:s++}),a.push({...u})}return{html:ni(r,o),pageCount:n,pagePaperMm:a,pageLayouts:i}}async function sy(e,t){return t.withSession(e,r=>ly(e,r))}async function ly(e,t){const r=zs(e.templateJson);if(r.length>1){const p=du(e.printData),l=p.mode==="batch"?p.dataList:[p.data],d=[];for(let c=0;c<l.length;c++)try{d.push(await dy(e,t,l[c]))}catch(f){const h=f instanceof Error?f.message:String(f);throw new Error(`第 ${c+1} 份渲染失败:${h}`)}const u=ay(d);return{html:u.html,pageCount:u.pageCount,paperMm:Er(r[0]),pagePaperMm:u.pagePaperMm,continuous:!1,heightSource:"config",pageLayouts:u.pageLayouts,copies:d.length}}const o=r[0]!==e.templateJson?{...e,templateJson:r[0]}:e,n=r[0],i=du(o.printData);if(i.mode==="single"){const p=await gu(o,t,i.data);return n.tiling?.enabled===!0?mu(o,[{bound:p.bound,pageLayouts:p.pageLayouts,data:i.data,codeRenderer:p.codeRenderer,renderers:p.renderers,derivedHeightMm:p.derivedHeightMm,paperMm:p.paperMm,heightSource:p.heightSource}]):py(p)}const a=[];for(let p=0;p<i.dataList.length;p++)try{const l=await gu(o,t,i.dataList[p]);a.push({bound:l.bound,pageLayouts:l.pageLayouts,data:i.dataList[p],codeRenderer:l.codeRenderer,renderers:l.renderers,derivedHeightMm:l.derivedHeightMm,paperMm:l.paperMm,heightSource:l.heightSource})}catch(l){const d=l instanceof Error?l.message:String(l);throw new Error(`第 ${p+1} 份渲染失败:${d}`)}if(n.tiling?.enabled===!0)return mu(o,a);const s=Jk(a);return{html:s.html,pageCount:s.pageCount,paperMm:a[0].paperMm,continuous:It(a[0].bound),heightSource:a[0].heightSource,pageLayouts:a.flatMap(p=>p.pageLayouts),copies:a.length,copyPaperMm:s.copyPaperMm}}function py(e){return{html:e.html,pageCount:e.pageCount,paperMm:e.paperMm,continuous:e.continuous,heightSource:e.heightSource,pageLayouts:e.pageLayouts,copies:1}}function mu(e,t){const r=t[0].bound,o=fu(r,{paperOverride:e.paperOverride});t.forEach((i,a)=>{const s=i.pageLayouts[0]?.overflow===!0;if(i.pageLayouts.length!==1||s){const p=s?"内容超出纸张高度":`渲染出 ${i.pageLayouts.length} 页`;throw new Error(`拼版要求每份标签恰好 1 页,第 ${a+1} 份${p};请缩小内容或调整标签纸张高度`)}});const n=oy({copies:t.map(i=>({bound:i.bound,pageLayouts:i.pageLayouts,data:i.data,codeRenderer:i.codeRenderer,renderers:i.renderers})),layout:o});return{html:n.html,pageCount:n.sheetCount,paperMm:{width:o.sheet.width,height:o.sheet.height},continuous:!1,heightSource:"config",pageLayouts:t.flatMap(i=>i.pageLayouts),copies:t.length}}async function gu(e,t,r){const o=Cc(e.templateJson,r,e.baseUrl,e.fontBaseUrl),n=It(o),i=yt(o),a=iu(i),s=zk({paperHeightMm:e.paperHeightMm,override:e.paperOverride}),p=await pi({bound:o,job:e,session:t,data:r,pageLayouts:[],isMeasurementPass:!0}),l=await t.measure(p.html,a);su(o,l.fits);const d=Qa(o,au(l.measurements,o)),u=await pi({bound:o,job:e,session:t,data:r,pageLayouts:d,isMeasurementPass:!1,codeBaseMap:p.codeMap,assetBaseMap:p.assetMap});let c=u.html,f;if(n){if(s&&s>0)f=s;else{const w=await t.probeContentBottom(c,a);f=$k(o,Bs(w))}c=ri(o,d,r,{codeRenderer:u.codeRenderer,renderers:u.renderers,pageHeightMm:f})}const h=n&&s?{...e.paperOverride,height:s}:e.paperOverride,b=Er(o),{paperMm:k,heightSource:v}=Hk({paperMm:{width:b.width,height:f??b.height},continuous:n,override:h});return{html:c,pageCount:d.length,paperMm:k,continuous:n,heightSource:v,pageLayouts:d,copies:1,bound:o,codeRenderer:u.codeRenderer,renderers:u.renderers,derivedHeightMm:f}}async function dy(e,t,r){const o=zs(e.templateJson),n=[],i=[],a=[],s=[];for(const p of o){const l=iu(yt(p)),d=Cc(p,r,e.baseUrl,e.fontBaseUrl),u=await pi({bound:d,job:e,session:t,data:r,pageLayouts:[],isMeasurementPass:!0}),c=await t.measure(u.html,l);su(d,c.fits);const f=Qa(d,au(c.measurements,d)),h=await pi({bound:d,job:e,session:t,data:r,pageLayouts:f,isMeasurementPass:!1,codeBaseMap:u.codeMap,assetBaseMap:u.assetMap});n.push(d),i.push(f),a.push(h.codeRenderer),s.push(h.renderers)}return{boundPages:n,layoutsPerPage:i,data:r,codeRenderers:a,renderersPerPage:s}}async function pi(e){const t=e.codeBaseMap??new Map,r=e.assetBaseMap??new Map,{job:o}=e,n=fk(),i=o.renderers;if(o.codeRenderer&&(n.length===0||i))return{html:ri(e.bound,e.pageLayouts,e.data,{isMeasurementPass:e.isMeasurementPass,codeRenderer:o.codeRenderer,renderers:i}),codeRenderer:o.codeRenderer,renderers:i,codeMap:t,assetMap:r};const a=Wk(t),s=ck(r),p=o.codeRenderer??a.renderer,l=i??(n.length>0?Yc(s.renderer,n):void 0),d=ri(e.bound,e.pageLayouts,e.data,{isMeasurementPass:e.isMeasurementPass,codeRenderer:p,renderers:l}),u=o.codeRenderer?[]:a.takeSpecs(),c=i?[]:s.takeSpecs(),[f,h]=await Promise.all([u.length>0?e.session.renderCodes(u):Promise.resolve(new Map),mk(c,e.session)]),b=Vk(t,f),k=Kc(r,h),v=o.codeRenderer??(b.size>0?jk(b):void 0),w=i??(k.size>0?Yc(uk(k),n):l);return u.length===0&&c.length===0?{html:d,codeRenderer:v,renderers:w,codeMap:b,assetMap:k}:{html:ri(e.bound,e.pageLayouts,e.data,{isMeasurementPass:e.isMeasurementPass,codeRenderer:v,renderers:w}),codeRenderer:v,renderers:w,codeMap:b,assetMap:k}}class cy{constructor(t){this.functions={},t?.functions&&(this.functions={...t.functions})}registerFunction(t,r){this.functions[t]=r}evaluate(t,r){const o=us(t),n=fs(o);return et(n,r,this.functions)}render(t,r){return fc(t,this.functions)(r)}}const bu=new cy,uy={MONEY:hc,CONCAT:(...e)=>e.filter(t=>t!=null).join(""),IF:bc,FORMAT:e=>typeof e!="number"?String(e):tr(e,er(),{minimumFractionDigits:2,maximumFractionDigits:2}),SUBSTR:(e,t,r)=>String(e).slice(t,r?t+r:void 0),LEN:e=>String(e).length,ADD:xc,SUB:Pc,MUL:Ec,DIV:Sc,ROUND:Tc,ROUNDUP:Yn,CEIL:Yn,ROUNDDOWN:Xn,FLOOR:Xn,ROUNDBANK:Mc,NOW:()=>new Date().toISOString().split("T")[0],IFEMPTY:(e,t)=>e!=null&&e!==""?String(e):t,PAD:(e,t,r)=>String(e).padStart(t,r),REPLACE:(e,t,r)=>String(e).replace(new RegExp(t,"g"),r),JSON:e=>JSON.stringify(e,null,2),DATE:mc,UPPER:gc};for(const[e,t]of Object.entries(uy))bu.registerFunction(e,t);function fy(e,t,r){switch(e.toUpperCase()){case"SUM":return ys(r,t);case"AVG":return kc(r,t);case"COUNT":return yc(r);case"MIN":return vc(r,t);case"MAX":return wc(r,t);default:return 0}}function to(e,t){if(!e)return"";if(!e.includes("{"))return e;const r=Array.isArray(t.rows)?t.rows:[];let o=e.replace(/\{([^}]+)\}/g,(n,i)=>{let a=i.trim();return a=a.replace(/\b(SUM|AVG|COUNT|MIN|MAX)\(([^)]+)\)/g,(s,p,l)=>{const d=l.trim().replace(/^['"]|['"]$/g,"");return String(fy(p,d,r))}),`{${a}}`});try{return bu.render(o,t)}catch{return e}}const vt={supplier:{name:"鑫达五金有限公司",phone:"0571-88776655",address:"杭州市萧山区经济开发区88号"},receiver:{name:"李四",phone:"13912345678",address:"杭州市余杭区文一西路998号"},order:{no:"PO20260801001",date:"2026-08-01",total:69543.75},goods:[{name:"碳钢螺丝 M8",spec:"M14×10",unit:"个",qty:100,price:.5,amount:50,remark:"A级"},{name:"不锈钢螺母 M10",spec:"M16×11",unit:"套",qty:117,price:.75,amount:87.75,remark:""},{name:"弹簧垫圈 M12",spec:"M6×12",unit:"盒",qty:134,price:1,amount:134,remark:""},{name:"六角螺栓 M14",spec:"M5×13",unit:"支",qty:151,price:1.25,amount:188.75,remark:""},{name:"内六角螺钉 M16",spec:"M20×14",unit:"袋",qty:168,price:1.5,amount:252,remark:""},{name:"平垫圈 M6",spec:"M4×15",unit:"件",qty:185,price:1.75,amount:323.75,remark:""},{name:"自攻螺钉 M5",spec:"M3×16",unit:"根",qty:202,price:2,amount:404,remark:""},{name:"双头螺柱 M20",spec:"M8×17",unit:"包",qty:219,price:2.25,amount:492.75,remark:"A级"},{name:"紧定螺钉 M4",spec:"M10×18",unit:"只",qty:236,price:2.5,amount:590,remark:""},{name:"十字盘头钉 M3",spec:"M12×19",unit:"组",qty:253,price:2.75,amount:695.75,remark:""},{name:"碳钢螺丝 M8",spec:"M14×20",unit:"个",qty:270,price:3,amount:810,remark:""},{name:"不锈钢螺母 M10",spec:"M16×21",unit:"套",qty:287,price:3.25,amount:932.75,remark:""},{name:"弹簧垫圈 M12",spec:"M6×22",unit:"盒",qty:304,price:3.5,amount:1064,remark:""},{name:"六角螺栓 M14",spec:"M5×23",unit:"支",qty:321,price:3.75,amount:1203.75,remark:""},{name:"内六角螺钉 M16",spec:"M20×24",unit:"袋",qty:338,price:4,amount:1352,remark:"A级"},{name:"平垫圈 M6",spec:"M4×25",unit:"件",qty:355,price:4.25,amount:1508.75,remark:""},{name:"自攻螺钉 M5",spec:"M3×26",unit:"根",qty:372,price:4.5,amount:1674,remark:""},{name:"双头螺柱 M20",spec:"M8×27",unit:"包",qty:389,price:4.75,amount:1847.75,remark:""},{name:"紧定螺钉 M4",spec:"M10×28",unit:"只",qty:406,price:5,amount:2030,remark:""},{name:"十字盘头钉 M3",spec:"M12×29",unit:"组",qty:423,price:5.25,amount:2220.75,remark:""},{name:"碳钢螺丝 M8",spec:"M14×30",unit:"个",qty:440,price:.5,amount:220,remark:""},{name:"不锈钢螺母 M10",spec:"M16×31",unit:"套",qty:457,price:.75,amount:342.75,remark:"A级"},{name:"弹簧垫圈 M12",spec:"M6×32",unit:"盒",qty:474,price:1,amount:474,remark:""},{name:"六角螺栓 M14",spec:"M5×33",unit:"支",qty:491,price:1.25,amount:613.75,remark:""},{name:"内六角螺钉 M16",spec:"M20×34",unit:"袋",qty:508,price:1.5,amount:762,remark:""},{name:"平垫圈 M6",spec:"M4×35",unit:"件",qty:525,price:1.75,amount:918.75,remark:""},{name:"自攻螺钉 M5",spec:"M3×36",unit:"根",qty:542,price:2,amount:1084,remark:""},{name:"双头螺柱 M20",spec:"M8×37",unit:"包",qty:559,price:2.25,amount:1257.75,remark:""},{name:"紧定螺钉 M4",spec:"M10×38",unit:"只",qty:576,price:2.5,amount:1440,remark:"A级"},{name:"十字盘头钉 M3",spec:"M12×39",unit:"组",qty:593,price:2.75,amount:1630.75,remark:""},{name:"碳钢螺丝 M8",spec:"M14×40",unit:"个",qty:610,price:3,amount:1830,remark:""},{name:"不锈钢螺母 M10",spec:"M16×41",unit:"套",qty:627,price:3.25,amount:2037.75,remark:""},{name:"弹簧垫圈 M12",spec:"M6×42",unit:"盒",qty:644,price:3.5,amount:2254,remark:""},{name:"六角螺栓 M14",spec:"M5×43",unit:"支",qty:661,price:3.75,amount:2478.75,remark:""},{name:"内六角螺钉 M16",spec:"M20×44",unit:"袋",qty:678,price:4,amount:2712,remark:""},{name:"平垫圈 M6",spec:"M4×45",unit:"件",qty:695,price:4.25,amount:2953.75,remark:"A级"},{name:"自攻螺钉 M5",spec:"M3×46",unit:"根",qty:712,price:4.5,amount:3204,remark:""},{name:"双头螺柱 M20",spec:"M8×47",unit:"包",qty:729,price:4.75,amount:3462.75,remark:""},{name:"紧定螺钉 M4",spec:"M10×48",unit:"只",qty:746,price:5,amount:3730,remark:""},{name:"十字盘头钉 M3",spec:"M12×49",unit:"组",qty:763,price:5.25,amount:4005.75,remark:""},{name:"碳钢螺丝 M8",spec:"M14×10",unit:"个",qty:780,price:.5,amount:390,remark:""},{name:"不锈钢螺母 M10",spec:"M16×11",unit:"套",qty:797,price:.75,amount:597.75,remark:""},{name:"弹簧垫圈 M12",spec:"M6×12",unit:"盒",qty:814,price:1,amount:814,remark:"A级"},{name:"六角螺栓 M14",spec:"M5×13",unit:"支",qty:831,price:1.25,amount:1038.75,remark:""},{name:"内六角螺钉 M16",spec:"M20×14",unit:"袋",qty:848,price:1.5,amount:1272,remark:""},{name:"平垫圈 M6",spec:"M4×15",unit:"件",qty:865,price:1.75,amount:1513.75,remark:""},{name:"自攻螺钉 M5",spec:"M3×16",unit:"根",qty:882,price:2,amount:1764,remark:""},{name:"双头螺柱 M20",spec:"M8×17",unit:"包",qty:899,price:2.25,amount:2022.75,remark:""},{name:"紧定螺钉 M4",spec:"M10×18",unit:"只",qty:916,price:2.5,amount:2290,remark:""},{name:"十字盘头钉 M3",spec:"M12×19",unit:"组",qty:933,price:2.75,amount:2565.75,remark:"A级"}]},di={left:0,center:50,right:100},ci={top:0,center:50,bottom:100};function ro(e){return Number.isFinite(e)?Math.round(Math.min(100,Math.max(0,e))):50}function ku(e){return Math.round(e*100)/100}function yu(e,t){const r=ro(e),o=ro(t);if(!(r===50&&o===50))return`${r}% ${o}%`}function hy(e){return/^\d+(?:\.\d+)?%$/.test(e)?parseFloat(e):void 0}function my(e){const t=(e??"").trim();if(!t)return{kind:"empty"};const r=t.toLowerCase().split(/\s+/);let o,n;for(let i=0;i<r.length;i++){const a=r[i],s=hy(a);if(i===0)if(a in di)o=di[a];else if(s!==void 0)o=s;else if(a in ci)n=ci[a];else return{kind:"custom",raw:e};else if(a in ci&&n===void 0)n=ci[a];else if(s!==void 0&&o===void 0)o=s;else if(s!==void 0&&n===void 0)n=s;else if(a in di&&o===void 0)o=di[a];else return{kind:"custom",raw:e}}return{kind:"axes",x:ro(o??50),y:ro(n??50)}}const vu=25.4/96;function wu(e){const{widthMm:t,heightMm:r,naturalWidth:o,naturalHeight:n}=e;if(!o||!n||!t||!r)return null;const i=t/o,a=r/n,s=(Dd(e.fit,e.scalePct)??Oo)/100;switch(e.fit||"contain"){case"fill":return{w:t,h:r};case"cover":{const p=Math.max(i,a)*s;return{w:o*p,h:n*p}}case"none":return{w:o*vu,h:n*vu};case"scale-down":{const p=Math.min(1,Math.min(i,a));return{w:o*p,h:n*p}}default:{const p=Math.min(i,a);return{w:o*p,h:n*p}}}}function gy(e){const t=wu(e);return t?{x:ku(Math.abs(e.widthMm-t.w)),y:ku(Math.abs(e.heightMm-t.h))}:{x:null,y:null}}function by(e,t,r){const o=wu(e);if(!o)return null;const n=Math.min(1,e.widthMm/o.w),i=Math.min(1,e.heightMm/o.h);return{leftPct:(1-n)*ro(t),topPct:(1-i)*ro(r),widthPct:n*100,heightPct:i*100}}function xu(e){const t=String(e??"");return t?t.includes("{")?String(to(t,vt)):t:""}function Pu(e){return e==="vertical"?[{value:0,label:$("crop.top")},{value:50,label:$("crop.center")},{value:100,label:$("crop.bottom")}]:[{value:0,label:$("crop.left")},{value:50,label:$("crop.center")},{value:100,label:$("crop.right")}]}function ky(){return[{x:0,y:0,label:$("crop.topLeft")},{x:50,y:0,label:$("crop.topCenter")},{x:100,y:0,label:$("crop.topRight")},{x:0,y:50,label:$("crop.middleLeft")},{x:50,y:50,label:$("crop.center")},{x:100,y:50,label:$("crop.middleRight")},{x:0,y:100,label:$("crop.bottomLeft")},{x:50,y:100,label:$("crop.bottomCenter")},{x:100,y:100,label:$("crop.bottomRight")}]}function Hs(e=$){return[{value:"contain",label:e("crop.fitContain")},{value:"cover",label:e("crop.fitCover")},{value:"fill",label:e("crop.fitFill")},{value:"none",label:e("crop.fitNone")},{value:"scale-down",label:e("crop.fitScaleDown")}]}const yy="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMjAiIGhlaWdodD0iMTIwIiB2aWV3Qm94PSIwIDAgMTIwIDEyMCI+PHJlY3Qgd2lkdGg9IjEyMCIgaGVpZ2h0PSIxMjAiIGZpbGw9IiNmZmZmZmYiLz48cGF0aCBkPSJNNDAgMFYxMjBNODAgMFYxMjBNMCA0MEgxMjBNMCA4MEgxMjAiIHN0cm9rZT0iI2VlZjFmNiIgc3Ryb2tlLXdpZHRoPSIxIi8+PGNpcmNsZSBjeD0iMjAiIGN5PSIyMCIgcj0iMy41IiBmaWxsPSIjOGI5NWE1Ii8+PGNpcmNsZSBjeD0iMTAwIiBjeT0iMjAiIHI9IjMuNSIgZmlsbD0iIzhiOTVhNSIvPjxjaXJjbGUgY3g9IjIwIiBjeT0iMTAwIiByPSIzLjUiIGZpbGw9IiM4Yjk1YTUiLz48Y2lyY2xlIGN4PSIxMDAiIGN5PSIxMDAiIHI9IjMuNSIgZmlsbD0iIzhiOTVhNSIvPjxjaXJjbGUgY3g9IjYwIiBjeT0iMjAiIHI9IjciIGZpbGw9IiNjMDM5MmIiLz48Y2lyY2xlIGN4PSI2MCIgY3k9IjEwMCIgcj0iNyIgZmlsbD0iIzFmNGZhMyIvPjxjaXJjbGUgY3g9IjIwIiBjeT0iNjAiIHI9IjciIGZpbGw9IiMyYzdhNGEiLz48Y2lyY2xlIGN4PSIxMDAiIGN5PSI2MCIgcj0iNyIgZmlsbD0iI2UwN2EyMCIvPjxjaXJjbGUgY3g9IjYwIiBjeT0iNjAiIHI9IjE0IiBmaWxsPSJub25lIiBzdHJva2U9IiMyZjNhNGEiIHN0cm9rZS13aWR0aD0iNCIvPjxjaXJjbGUgY3g9IjYwIiBjeT0iNjAiIHI9IjYiIGZpbGw9IiMyZjNhNGEiLz48L3N2Zz4=";function vy(){return $("crop.sampleNote")}function wy(e){const t=String(e??"").trim();return!t||t.includes("{")||t.includes("}")?{src:yy,isSample:!0}:{src:t,isSample:!1}}function Eu(e){return $(e==="vertical"?"crop.verticalPosition":"crop.horizontalPosition")}const xy=()=>$("crop.scaleLabel");function Py(e,t=!1){if(t)return $("crop.originalValue");const{x:r,y:o}=e;return r===null||o===null?"":r>0&&o>0?$("crop.movableBoth",{x:r,y:o}):r>0?$("crop.movableX",{x:r}):o>0?$("crop.movableY",{y:o}):$("crop.noRoom")}function Ey(e,t,r){return[{name:"horizontal",label:Eu("horizontal"),value:t,travelMm:e.x},{name:"vertical",label:Eu("vertical"),value:r,travelMm:e.y}]}function Sy(e,t,r){const o=e.x!==null&&e.x>0,n=e.y!==null&&e.y>0;return n&&!o?Pu("vertical").map(i=>({value:`${t},${i.value}`,label:i.label})):o&&!n?Pu("horizontal").map(i=>({value:`${i.value},${r}`,label:i.label})):ky().map(i=>({value:`${i.x},${i.y}`,label:i.label}))}function Su(e){const t=[...e].sort((a,s)=>(a.sortOrder??0)-(s.sortOrder??0)),r=new Map,o=[];for(const a of t){const s=a.fieldKey.indexOf(".");if(s===-1)continue;const p=a.fieldKey.slice(0,s);let l=r.get(p);l||(l={key:p,label:p,isList:!1,fields:[]},r.set(p,l),o.push(p)),l.fields.push(a)}const n=[],i=[];for(const a of t){if(a.fieldKey.includes("."))continue;const s=r.get(a.fieldKey);s?(s.label=a.fieldLabel,s.isList=a.fieldType==="list"):i.push(a)}i.length&&n.push({key:"",label:"",isList:!1,fields:i});for(const a of o)n.push(r.get(a));return n}function Ty(e,t){const r=t.trim().toLowerCase();return r?e.map(o=>({...o,fields:o.fields.filter(n=>n.fieldLabel.toLowerCase().includes(r)||n.fieldKey.toLowerCase().includes(r))})).filter(o=>o.fields.length>0):e}async function Tu(e){if(!e)return!1;const t=typeof navigator>"u"?void 0:navigator;if(t?.clipboard?.writeText)try{return await t.clipboard.writeText(e),!0}catch{}if(typeof document>"u")return!1;const r=document.createElement("textarea");r.value=e,r.setAttribute("readonly",""),r.style.position="fixed",r.style.top="-1000px",r.style.opacity="0",document.body.appendChild(r);try{return r.select(),typeof document.execCommand=="function"&&document.execCommand("copy")}catch{return!1}finally{r.remove()}}const My=Object.fromEntries(Object.entries(So).filter(([,e])=>e.bindings!==void 0).map(([e,t])=>[e,[...t.bindings??[]]]));function Mu(e,t,r,o){return e==="data"?[{targetPath:`options.tableRows[${t}].cells[${r}].formatter`,label:"内容",labelKey:"constants.label.content",dataSource:"list",listField:o,placeholder:"{name}"}]:e==="subtotal"?[{targetPath:`options.tableRows[${t}].cells[${r}].formatter`,label:"内容",labelKey:"constants.label.content",dataSource:"subtotal",placeholder:"{MONEY(SUM(amount))}"}]:e==="summary"?[{targetPath:`options.tableRows[${t}].cells[${r}].formatter`,label:"内容",labelKey:"constants.label.content",dataSource:"summary",placeholder:"{MONEY(SUM(amount))}"}]:[{targetPath:`options.tableRows[${t}].cells[${r}].formatter`,label:"内容",labelKey:"constants.label.content",dataSource:"main",placeholder:"合计: {order.total}"}]}function Cy(e){const t=e.printElementType.type,r=gt(t).bindings??My[t]??[],o=[];if(t==="table"){const n=e.options.dataSource;for(const[i,a]of(e.options.tableRows??[]).entries())for(const[s,p]of a.cells.entries())p.merged||o.push(...Mu(a.type,i,s,n))}return[...r,...o]}function _y(e){return ts("text",{formatter:`{${e.fieldKey}}`,title:e.fieldLabel})}function Dy(e){const t=e.fieldLabel||e.fieldKey;return ts("text",{formatter:t,title:t})}function Cu(e,t){let r=e;for(const o of t.split(".")){if(r==null)return;r=Array.isArray(r)?r[0]?.[o]:r[o]}return r}function _u(e){return Cu(vt,e)}function Us(e,t,r="1234567890128"){const o=t?.[0];return(e??"").replace(/\{([^{}]+)\}/g,(i,a)=>{const s=a.trim(),p=s.includes(".")?Cu(o,s)??_u(s):o?.[s]??_u(s);return p==null?"":String(p)}).trim()||r}const ui={left:"#3b82f6",center:"#10b981",right:"#f59e0b",top:"#3b82f6",middle:"#10b981",bottom:"#f59e0b"};function Du(e){return e==="vCenter"?ui.center:e==="hCenter"?ui.middle:ui[e]??ui.left}function Ay(e,t,r,o={}){const n=o.adsorbMin??1,i=o.adsorbLineMin??2,a=o.showAdsorbLine??!0;let s=e.left,p=e.top;const l=[],d={left:e.left,right:e.left+e.width,vCenter:e.left+e.width/2,top:e.top,bottom:e.top+e.height,hCenter:e.top+e.height/2};let u=1/0;for(const f of t){if(f.id===e.id)continue;const h={left:f.left,right:f.left+f.width,vCenter:f.left+f.width/2,top:f.top,bottom:f.top+f.height,hCenter:f.top+f.height/2},b=[["left","left"],["left","vCenter"],["left","right"],["vCenter","left"],["vCenter","vCenter"],["vCenter","right"],["right","left"],["right","vCenter"],["right","right"]],k=[["top","top"],["top","hCenter"],["top","bottom"],["hCenter","top"],["hCenter","hCenter"],["hCenter","bottom"],["bottom","top"],["bottom","hCenter"],["bottom","bottom"]];for(const[v,w]of b){const P=Math.abs(d[v]-h[w]);P<=n&&P<u&&(u=P,s=e.left+(h[w]-d[v]))}for(const[v,w]of k){const P=Math.abs(d[v]-h[w]);P<=n&&P<u&&(u=P,p=e.top+(h[w]-d[v]))}}if(r){const f={left:s,right:s+e.width,vCenter:s+e.width/2,top:p,bottom:p+e.height,hCenter:p+e.height/2},h=["left","vCenter","right"];for(const k of r.vertical)for(const v of h){const w=Math.abs(f[v]-k);w<=n&&w<u&&(u=w,s=e.left+(k-f[v]))}const b=["top","hCenter","bottom"];for(const k of r.horizontal)for(const v of b){const w=Math.abs(f[v]-k);w<=n&&w<u&&(u=w,p=e.top+(k-f[v]))}}const c={left:s,right:s+e.width,vCenter:s+e.width/2,top:p,bottom:p+e.height,hCenter:p+e.height/2};if(a){const f=new Set;for(const h of t){if(h.id===e.id)continue;const b={left:h.left,right:h.left+h.width,vCenter:h.left+h.width/2,top:h.top,bottom:h.top+h.height,hCenter:h.top+h.height/2},k=[["left","left"],["left","vCenter"],["left","right"],["vCenter","left"],["vCenter","vCenter"],["vCenter","right"],["right","left"],["right","vCenter"],["right","right"]],v=[["top","top"],["top","hCenter"],["top","bottom"],["hCenter","top"],["hCenter","hCenter"],["hCenter","bottom"],["bottom","top"],["bottom","hCenter"],["bottom","bottom"]];for(const[w,P]of k)if(Math.abs(c[w]-b[P])<=i){const D=`v:${b[P]}`;f.has(D)||(f.add(D),l.push({type:"vertical",position:b[P],id:h.id,color:Du(w)}))}for(const[w,P]of v)if(Math.abs(c[w]-b[P])<=i){const D=`h:${b[P]}`;f.has(D)||(f.add(D),l.push({type:"horizontal",position:b[P],id:h.id,color:Du(w)}))}}}if(r){for(const f of r.vertical)l.some(h=>h.type==="vertical"&&h.position===f)||l.push({type:"vertical",position:f});for(const f of r.horizontal)l.some(h=>h.type==="horizontal"&&h.position===f)||l.push({type:"horizontal",position:f})}return{left:s,top:p,lines:l}}function Oy(){function e(t,r){if(t.length<2)return;const o=t.map(i=>Xe(i.options).margin),n={minLeft:Math.min(...o.map(i=>i.left)),maxRight:Math.max(...o.map(i=>i.right)),minTop:Math.min(...o.map(i=>i.top)),maxBottom:Math.max(...o.map(i=>i.bottom))};switch(r){case"left":t.forEach(i=>{i.options.left=n.minLeft});break;case"right":t.forEach((i,a)=>{i.options.left=n.maxRight-o[a].width});break;case"top":t.forEach(i=>{i.options.top=n.minTop});break;case"bottom":t.forEach((i,a)=>{i.options.top=n.maxBottom-o[a].height});break;case"vertical":{const i=n.minLeft+(n.maxRight-n.minLeft)/2;t.forEach((a,s)=>{a.options.left=i-o[s].width/2});break}case"horizontal":{const i=n.minTop+(n.maxBottom-n.minTop)/2;t.forEach((a,s)=>{a.options.top=i-o[s].height/2});break}case"distributeHor":{const i=t.map((l,d)=>({element:l,box:o[d]})).sort((l,d)=>l.box.left-d.box.left),a=i.reduce((l,d)=>l+d.box.width,0),s=(n.maxRight-n.minLeft-a)/(i.length-1);let p=n.minLeft;i.forEach(l=>{l.element.options.left=p,p+=l.box.width+s});break}case"distributeVer":{const i=t.map((l,d)=>({element:l,box:o[d]})).sort((l,d)=>l.box.top-d.box.top),a=i.reduce((l,d)=>l+d.box.height,0),s=(n.maxBottom-n.minTop-a)/(i.length-1);let p=n.minTop;i.forEach(l=>{l.element.options.top=p,p+=l.box.height+s});break}}}return{align:e}}function Au(){return`grp-${Date.now()}-${Math.random().toString(36).slice(2,6)}`}function Ry(){function e(o,n){if(o.filter(s=>n.has(s.id)).length<2)return o;const a=Au();return o.map(s=>n.has(s.id)?{...s,options:{...s.options,groupId:a}}:s)}function t(o,n){const i=o.filter(s=>n.has(s.id)),a=new Set(i.map(s=>s.options.groupId).filter(Boolean));return o.map(s=>s.options.groupId&&a.has(s.options.groupId)?{...s,options:{...s.options,groupId:void 0}}:s)}function r(o,n){const i=o.find(s=>s.id===n);if(!i?.options.groupId)return new Set([n]);const a=new Set;for(const s of o)s.options.groupId===i.options.groupId&&a.add(s.id);return a}return{group:e,ungroup:t,getGroupedIds:r}}const Iy=["nw","n","ne","e","se","s","sw","w"];function Ly(e,t,r,o,n,i){let{left:a,top:s,width:p,height:l}=t;switch(e){case"e":p=Math.max(n,t.width+r);break;case"w":p=Math.max(n,t.width-r),a=t.left+t.width-p;break;case"s":l=Math.max(i,t.height+o);break;case"n":l=Math.max(i,t.height-o),s=t.top+t.height-l;break;case"se":p=Math.max(n,t.width+r),l=Math.max(i,t.height+o);break;case"sw":p=Math.max(n,t.width-r),a=t.left+t.width-p,l=Math.max(i,t.height+o);break;case"ne":p=Math.max(n,t.width+r),l=Math.max(i,t.height-o),s=t.top+t.height-l;break;case"nw":p=Math.max(n,t.width-r),a=t.left+t.width-p,l=Math.max(i,t.height-o),s=t.top+t.height-l;break}return{left:a,top:s,width:p,height:l}}function Ou(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fi={},Yo={},hi={},Ru;function st(){if(Ru)return hi;Ru=1,Object.defineProperty(hi,"__esModule",{value:!0});function e(r,o){if(!(r instanceof o))throw new TypeError("Cannot call a class as a function")}var t=function r(o,n){e(this,r),this.data=o,this.text=n.text||o,this.options=n};return hi.default=t,hi}var Iu;function By(){if(Iu)return Yo;Iu=1,Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.CODE39=void 0;var e=(function(){function b(k,v){for(var w=0;w<v.length;w++){var P=v[w];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(k,P.key,P)}}return function(k,v,w){return v&&b(k.prototype,v),w&&b(k,w),k}})(),t=st(),r=o(t);function o(b){return b&&b.__esModule?b:{default:b}}function n(b,k){if(!(b instanceof k))throw new TypeError("Cannot call a class as a function")}function i(b,k){if(!b)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k&&(typeof k=="object"||typeof k=="function")?k:b}function a(b,k){if(typeof k!="function"&&k!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof k);b.prototype=Object.create(k&&k.prototype,{constructor:{value:b,enumerable:!1,writable:!0,configurable:!0}}),k&&(Object.setPrototypeOf?Object.setPrototypeOf(b,k):b.__proto__=k)}var s=(function(b){a(k,b);function k(v,w){return n(this,k),v=v.toUpperCase(),w.mod43&&(v+=c(h(v))),i(this,(k.__proto__||Object.getPrototypeOf(k)).call(this,v,w))}return e(k,[{key:"encode",value:function(){for(var w=d("*"),P=0;P<this.data.length;P++)w+=d(this.data[P])+"0";return w+=d("*"),{data:w,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9A-Z\-\.\ \$\/\+\%]+$/)!==-1}}]),k})(r.default),p=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","*"],l=[20957,29783,23639,30485,20951,29813,23669,20855,29789,23645,29975,23831,30533,22295,30149,24005,21623,29981,23837,22301,30023,23879,30545,22343,30161,24017,21959,30065,23921,22385,29015,18263,29141,17879,29045,18293,17783,29021,18269,17477,17489,17681,20753,35770];function d(b){return u(f(b))}function u(b){return l[b].toString(2)}function c(b){return p[b]}function f(b){return p.indexOf(b)}function h(b){for(var k=0,v=0;v<b.length;v++)k+=f(b[v]);return k=k%43,k}return Yo.CODE39=s,Yo}var Tt={},mi={},gi={},Oe={},Lu;function Xo(){if(Lu)return Oe;Lu=1,Object.defineProperty(Oe,"__esModule",{value:!0});var e;function t(p,l,d){return l in p?Object.defineProperty(p,l,{value:d,enumerable:!0,configurable:!0,writable:!0}):p[l]=d,p}var r=Oe.SET_A=0,o=Oe.SET_B=1,n=Oe.SET_C=2;Oe.SHIFT=98;var i=Oe.START_A=103,a=Oe.START_B=104,s=Oe.START_C=105;return Oe.MODULO=103,Oe.STOP=106,Oe.FNC1=207,Oe.SET_BY_CODE=(e={},t(e,i,r),t(e,a,o),t(e,s,n),e),Oe.SWAP={101:r,100:o,99:n},Oe.A_START_CHAR="Ð",Oe.B_START_CHAR="Ñ",Oe.C_START_CHAR="Ò",Oe.A_CHARS="[\0-_È-Ï]",Oe.B_CHARS="[ -È-Ï]",Oe.C_CHARS="(Ï*[0-9]{2}Ï*)",Oe.BARS=[11011001100,11001101100,11001100110,10010011e3,10010001100,10001001100,10011001e3,10011000100,10001100100,11001001e3,11001000100,11000100100,10110011100,10011011100,10011001110,10111001100,10011101100,10011100110,11001110010,11001011100,11001001110,11011100100,11001110100,11101101110,11101001100,11100101100,11100100110,11101100100,11100110100,11100110010,11011011e3,11011000110,11000110110,10100011e3,10001011e3,10001000110,10110001e3,10001101e3,10001100010,11010001e3,11000101e3,11000100010,10110111e3,10110001110,10001101110,10111011e3,10111000110,10001110110,11101110110,11010001110,11000101110,11011101e3,11011100010,11011101110,11101011e3,11101000110,11100010110,11101101e3,11101100010,11100011010,11101111010,11001000010,11110001010,1010011e4,10100001100,1001011e4,10010000110,10000101100,10000100110,1011001e4,10110000100,1001101e4,10011000010,10000110100,10000110010,11000010010,1100101e4,11110111010,11000010100,10001111010,10100111100,10010111100,10010011110,10111100100,10011110100,10011110010,11110100100,11110010100,11110010010,11011011110,11011110110,11110110110,10101111e3,10100011110,10001011110,10111101e3,10111100010,11110101e3,11110100010,10111011110,10111101110,11101011110,11110101110,11010000100,1101001e4,11010011100,1100011101011],Oe}var Bu;function bi(){if(Bu)return gi;Bu=1,Object.defineProperty(gi,"__esModule",{value:!0});var e=(function(){function l(d,u){for(var c=0;c<u.length;c++){var f=u[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}return function(d,u,c){return u&&l(d.prototype,u),c&&l(d,c),d}})(),t=st(),r=n(t),o=Xo();function n(l){return l&&l.__esModule?l:{default:l}}function i(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function a(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function s(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var p=(function(l){s(d,l);function d(u,c){i(this,d);var f=a(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,u.substring(1),c));return f.bytes=u.split("").map(function(h){return h.charCodeAt(0)}),f}return e(d,[{key:"valid",value:function(){return/^[\x00-\x7F\xC8-\xD3]+$/.test(this.data)}},{key:"encode",value:function(){var c=this.bytes,f=c.shift()-105,h=o.SET_BY_CODE[f];if(h===void 0)throw new RangeError("The encoding does not start with a start character.");this.shouldEncodeAsEan128()===!0&&c.unshift(o.FNC1);var b=d.next(c,1,h);return{text:this.text===this.data?this.text.replace(/[^\x20-\x7E]/g,""):this.text,data:d.getBar(f)+b.result+d.getBar((b.checksum+f)%o.MODULO)+d.getBar(o.STOP)}}},{key:"shouldEncodeAsEan128",value:function(){var c=this.options.ean128||!1;return typeof c=="string"&&(c=c.toLowerCase()==="true"),c}}],[{key:"getBar",value:function(c){return o.BARS[c]?o.BARS[c].toString():""}},{key:"correctIndex",value:function(c,f){if(f===o.SET_A){var h=c.shift();return h<32?h+64:h-32}else return f===o.SET_B?c.shift()-32:(c.shift()-48)*10+c.shift()-48}},{key:"next",value:function(c,f,h){if(!c.length)return{result:"",checksum:0};var b=void 0,k=void 0;if(c[0]>=200){k=c.shift()-105;var v=o.SWAP[k];v!==void 0?b=d.next(c,f+1,v):((h===o.SET_A||h===o.SET_B)&&k===o.SHIFT&&(c[0]=h===o.SET_A?c[0]>95?c[0]-96:c[0]:c[0]<32?c[0]+96:c[0]),b=d.next(c,f+1,h))}else k=d.correctIndex(c,h),b=d.next(c,f+1,h);var w=d.getBar(k),P=k*f;return{result:w+b.result,checksum:P+b.checksum}}}]),d})(r.default);return gi.default=p,gi}var ki={},Nu;function Ny(){if(Nu)return ki;Nu=1,Object.defineProperty(ki,"__esModule",{value:!0});var e=Xo(),t=function(s){return s.match(new RegExp("^"+e.A_CHARS+"*"))[0].length},r=function(s){return s.match(new RegExp("^"+e.B_CHARS+"*"))[0].length},o=function(s){return s.match(new RegExp("^"+e.C_CHARS+"*"))[0]};function n(a,s){var p=s?e.A_CHARS:e.B_CHARS,l=a.match(new RegExp("^("+p+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(l)return l[1]+"Ì"+i(a.substring(l[1].length));var d=a.match(new RegExp("^"+p+"+"))[0];return d.length===a.length?a:d+String.fromCharCode(s?205:206)+n(a.substring(d.length),!s)}function i(a){var s=o(a),p=s.length;if(p===a.length)return a;a=a.substring(p);var l=t(a)>=r(a);return s+String.fromCharCode(l?206:205)+n(a,l)}return ki.default=function(a){var s=void 0,p=o(a).length;if(p>=2)s=e.C_START_CHAR+i(a);else{var l=t(a)>r(a);s=(l?e.A_START_CHAR:e.B_START_CHAR)+n(a,l)}return s.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(d,u){return"Ë"+u})},ki}var Fu;function Fy(){if(Fu)return mi;Fu=1,Object.defineProperty(mi,"__esModule",{value:!0});var e=bi(),t=n(e),r=Ny(),o=n(r);function n(l){return l&&l.__esModule?l:{default:l}}function i(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function a(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function s(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var p=(function(l){s(d,l);function d(u,c){if(i(this,d),/^[\x00-\x7F\xC8-\xD3]+$/.test(u))var f=a(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,(0,o.default)(u),c));else var f=a(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,u,c));return a(f)}return d})(t.default);return mi.default=p,mi}var yi={},$u;function $y(){if($u)return yi;$u=1,Object.defineProperty(yi,"__esModule",{value:!0});var e=(function(){function l(d,u){for(var c=0;c<u.length;c++){var f=u[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}return function(d,u,c){return u&&l(d.prototype,u),c&&l(d,c),d}})(),t=bi(),r=n(t),o=Xo();function n(l){return l&&l.__esModule?l:{default:l}}function i(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function a(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function s(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var p=(function(l){s(d,l);function d(u,c){return i(this,d),a(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,o.A_START_CHAR+u,c))}return e(d,[{key:"valid",value:function(){return new RegExp("^"+o.A_CHARS+"+$").test(this.data)}}]),d})(r.default);return yi.default=p,yi}var vi={},zu;function zy(){if(zu)return vi;zu=1,Object.defineProperty(vi,"__esModule",{value:!0});var e=(function(){function l(d,u){for(var c=0;c<u.length;c++){var f=u[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}return function(d,u,c){return u&&l(d.prototype,u),c&&l(d,c),d}})(),t=bi(),r=n(t),o=Xo();function n(l){return l&&l.__esModule?l:{default:l}}function i(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function a(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function s(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var p=(function(l){s(d,l);function d(u,c){return i(this,d),a(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,o.B_START_CHAR+u,c))}return e(d,[{key:"valid",value:function(){return new RegExp("^"+o.B_CHARS+"+$").test(this.data)}}]),d})(r.default);return vi.default=p,vi}var wi={},Hu;function Hy(){if(Hu)return wi;Hu=1,Object.defineProperty(wi,"__esModule",{value:!0});var e=(function(){function l(d,u){for(var c=0;c<u.length;c++){var f=u[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}return function(d,u,c){return u&&l(d.prototype,u),c&&l(d,c),d}})(),t=bi(),r=n(t),o=Xo();function n(l){return l&&l.__esModule?l:{default:l}}function i(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function a(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function s(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var p=(function(l){s(d,l);function d(u,c){return i(this,d),a(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,o.C_START_CHAR+u,c))}return e(d,[{key:"valid",value:function(){return new RegExp("^"+o.C_CHARS+"+$").test(this.data)}}]),d})(r.default);return wi.default=p,wi}var Uu;function Uy(){if(Uu)return Tt;Uu=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.CODE128C=Tt.CODE128B=Tt.CODE128A=Tt.CODE128=void 0;var e=Fy(),t=p(e),r=$y(),o=p(r),n=zy(),i=p(n),a=Hy(),s=p(a);function p(l){return l&&l.__esModule?l:{default:l}}return Tt.CODE128=t.default,Tt.CODE128A=o.default,Tt.CODE128B=i.default,Tt.CODE128C=s.default,Tt}var tt={},xi={},Wt={},qu;function Zo(){return qu||(qu=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.SIDE_BIN="101",Wt.MIDDLE_BIN="01010",Wt.BINARIES={L:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],G:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"],R:["1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100"],O:["0001101","0011001","0010011","0111101","0100011","0110001","0101111","0111011","0110111","0001011"],E:["0100111","0110011","0011011","0100001","0011101","0111001","0000101","0010001","0001001","0010111"]},Wt.EAN2_STRUCTURE=["LL","LG","GL","GG"],Wt.EAN5_STRUCTURE=["GGLLL","GLGLL","GLLGL","GLLLG","LGGLL","LLGGL","LLLGG","LGLGL","LGLLG","LLGLG"],Wt.EAN13_STRUCTURE=["LLLLLL","LLGLGG","LLGGLG","LLGGGL","LGLLGG","LGGLLG","LGGGLL","LGLGLG","LGLGGL","LGGLGL"]),Wt}var Pi={},Ei={},ju;function Jo(){if(ju)return Ei;ju=1,Object.defineProperty(Ei,"__esModule",{value:!0});var e=Zo(),t=function(o,n,i){var a=o.split("").map(function(p,l){return e.BINARIES[n[l]]}).map(function(p,l){return p?p[o[l]]:""});if(i){var s=o.length-1;a=a.map(function(p,l){return l<s?p+i:p})}return a.join("")};return Ei.default=t,Ei}var Wu;function Vu(){if(Wu)return Pi;Wu=1,Object.defineProperty(Pi,"__esModule",{value:!0});var e=(function(){function u(c,f){for(var h=0;h<f.length;h++){var b=f[h];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(c,b.key,b)}}return function(c,f,h){return f&&u(c.prototype,f),h&&u(c,h),c}})(),t=Zo(),r=Jo(),o=a(r),n=st(),i=a(n);function a(u){return u&&u.__esModule?u:{default:u}}function s(u,c){if(!(u instanceof c))throw new TypeError("Cannot call a class as a function")}function p(u,c){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:u}function l(u,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);u.prototype=Object.create(c&&c.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(u,c):u.__proto__=c)}var d=(function(u){l(c,u);function c(f,h){s(this,c);var b=p(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,f,h));return b.fontSize=!h.flat&&h.fontSize>h.width*10?h.width*10:h.fontSize,b.guardHeight=h.height+b.fontSize/2+h.textMargin,b}return e(c,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(h,b){return this.text.substr(h,b)}},{key:"leftEncode",value:function(h,b){return(0,o.default)(h,b)}},{key:"rightText",value:function(h,b){return this.text.substr(h,b)}},{key:"rightEncode",value:function(h,b){return(0,o.default)(h,b)}},{key:"encodeGuarded",value:function(){var h={fontSize:this.fontSize},b={height:this.guardHeight};return[{data:t.SIDE_BIN,options:b},{data:this.leftEncode(),text:this.leftText(),options:h},{data:t.MIDDLE_BIN,options:b},{data:this.rightEncode(),text:this.rightText(),options:h},{data:t.SIDE_BIN,options:b}]}},{key:"encodeFlat",value:function(){var h=[t.SIDE_BIN,this.leftEncode(),t.MIDDLE_BIN,this.rightEncode(),t.SIDE_BIN];return{data:h.join(""),text:this.text}}}]),c})(i.default);return Pi.default=d,Pi}var Gu;function qy(){if(Gu)return xi;Gu=1,Object.defineProperty(xi,"__esModule",{value:!0});var e=(function(){function u(c,f){for(var h=0;h<f.length;h++){var b=f[h];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(c,b.key,b)}}return function(c,f,h){return f&&u(c.prototype,f),h&&u(c,h),c}})(),t=function u(c,f,h){c===null&&(c=Function.prototype);var b=Object.getOwnPropertyDescriptor(c,f);if(b===void 0){var k=Object.getPrototypeOf(c);return k===null?void 0:u(k,f,h)}else{if("value"in b)return b.value;var v=b.get;return v===void 0?void 0:v.call(h)}},r=Zo(),o=Vu(),n=i(o);function i(u){return u&&u.__esModule?u:{default:u}}function a(u,c){if(!(u instanceof c))throw new TypeError("Cannot call a class as a function")}function s(u,c){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:u}function p(u,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);u.prototype=Object.create(c&&c.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(u,c):u.__proto__=c)}var l=function(c){var f=c.substr(0,12).split("").map(function(h){return+h}).reduce(function(h,b,k){return k%2?h+b*3:h+b},0);return(10-f%10)%10},d=(function(u){p(c,u);function c(f,h){a(this,c),f.search(/^[0-9]{12}$/)!==-1&&(f+=l(f));var b=s(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,f,h));return b.lastChar=h.lastChar,b}return e(c,[{key:"valid",value:function(){return this.data.search(/^[0-9]{13}$/)!==-1&&+this.data[12]===l(this.data)}},{key:"leftText",value:function(){return t(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"leftText",this).call(this,1,6)}},{key:"leftEncode",value:function(){var h=this.data.substr(1,6),b=r.EAN13_STRUCTURE[this.data[0]];return t(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"leftEncode",this).call(this,h,b)}},{key:"rightText",value:function(){return t(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"rightText",this).call(this,7,6)}},{key:"rightEncode",value:function(){var h=this.data.substr(7,6);return t(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"rightEncode",this).call(this,h,"RRRRRR")}},{key:"encodeGuarded",value:function(){var h=t(c.prototype.__proto__||Object.getPrototypeOf(c.prototype),"encodeGuarded",this).call(this);return this.options.displayValue&&(h.unshift({data:"000000000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),this.options.lastChar&&(h.push({data:"00"}),h.push({data:"00000",text:this.options.lastChar,options:{fontSize:this.fontSize}}))),h}}]),c})(n.default);return xi.default=d,xi}var Si={},Ku;function jy(){if(Ku)return Si;Ku=1,Object.defineProperty(Si,"__esModule",{value:!0});var e=(function(){function d(u,c){for(var f=0;f<c.length;f++){var h=c[f];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(u,h.key,h)}}return function(u,c,f){return c&&d(u.prototype,c),f&&d(u,f),u}})(),t=function d(u,c,f){u===null&&(u=Function.prototype);var h=Object.getOwnPropertyDescriptor(u,c);if(h===void 0){var b=Object.getPrototypeOf(u);return b===null?void 0:d(b,c,f)}else{if("value"in h)return h.value;var k=h.get;return k===void 0?void 0:k.call(f)}},r=Vu(),o=n(r);function n(d){return d&&d.__esModule?d:{default:d}}function i(d,u){if(!(d instanceof u))throw new TypeError("Cannot call a class as a function")}function a(d,u){if(!d)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return u&&(typeof u=="object"||typeof u=="function")?u:d}function s(d,u){if(typeof u!="function"&&u!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof u);d.prototype=Object.create(u&&u.prototype,{constructor:{value:d,enumerable:!1,writable:!0,configurable:!0}}),u&&(Object.setPrototypeOf?Object.setPrototypeOf(d,u):d.__proto__=u)}var p=function(u){var c=u.substr(0,7).split("").map(function(f){return+f}).reduce(function(f,h,b){return b%2?f+h:f+h*3},0);return(10-c%10)%10},l=(function(d){s(u,d);function u(c,f){return i(this,u),c.search(/^[0-9]{7}$/)!==-1&&(c+=p(c)),a(this,(u.__proto__||Object.getPrototypeOf(u)).call(this,c,f))}return e(u,[{key:"valid",value:function(){return this.data.search(/^[0-9]{8}$/)!==-1&&+this.data[7]===p(this.data)}},{key:"leftText",value:function(){return t(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"leftText",this).call(this,0,4)}},{key:"leftEncode",value:function(){var f=this.data.substr(0,4);return t(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"leftEncode",this).call(this,f,"LLLL")}},{key:"rightText",value:function(){return t(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"rightText",this).call(this,4,4)}},{key:"rightEncode",value:function(){var f=this.data.substr(4,4);return t(u.prototype.__proto__||Object.getPrototypeOf(u.prototype),"rightEncode",this).call(this,f,"RRRR")}}]),u})(o.default);return Si.default=l,Si}var Ti={},Yu;function Wy(){if(Yu)return Ti;Yu=1,Object.defineProperty(Ti,"__esModule",{value:!0});var e=(function(){function c(f,h){for(var b=0;b<h.length;b++){var k=h[b];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(f,k.key,k)}}return function(f,h,b){return h&&c(f.prototype,h),b&&c(f,b),f}})(),t=Zo(),r=Jo(),o=a(r),n=st(),i=a(n);function a(c){return c&&c.__esModule?c:{default:c}}function s(c,f){if(!(c instanceof f))throw new TypeError("Cannot call a class as a function")}function p(c,f){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return f&&(typeof f=="object"||typeof f=="function")?f:c}function l(c,f){if(typeof f!="function"&&f!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof f);c.prototype=Object.create(f&&f.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}}),f&&(Object.setPrototypeOf?Object.setPrototypeOf(c,f):c.__proto__=f)}var d=function(f){var h=f.split("").map(function(b){return+b}).reduce(function(b,k,v){return v%2?b+k*9:b+k*3},0);return h%10},u=(function(c){l(f,c);function f(h,b){return s(this,f),p(this,(f.__proto__||Object.getPrototypeOf(f)).call(this,h,b))}return e(f,[{key:"valid",value:function(){return this.data.search(/^[0-9]{5}$/)!==-1}},{key:"encode",value:function(){var b=t.EAN5_STRUCTURE[d(this.data)];return{data:"1011"+(0,o.default)(this.data,b,"01"),text:this.text}}}]),f})(i.default);return Ti.default=u,Ti}var Mi={},Xu;function Vy(){if(Xu)return Mi;Xu=1,Object.defineProperty(Mi,"__esModule",{value:!0});var e=(function(){function u(c,f){for(var h=0;h<f.length;h++){var b=f[h];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(c,b.key,b)}}return function(c,f,h){return f&&u(c.prototype,f),h&&u(c,h),c}})(),t=Zo(),r=Jo(),o=a(r),n=st(),i=a(n);function a(u){return u&&u.__esModule?u:{default:u}}function s(u,c){if(!(u instanceof c))throw new TypeError("Cannot call a class as a function")}function p(u,c){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:u}function l(u,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);u.prototype=Object.create(c&&c.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(u,c):u.__proto__=c)}var d=(function(u){l(c,u);function c(f,h){return s(this,c),p(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,f,h))}return e(c,[{key:"valid",value:function(){return this.data.search(/^[0-9]{2}$/)!==-1}},{key:"encode",value:function(){var h=t.EAN2_STRUCTURE[parseInt(this.data)%4];return{data:"1011"+(0,o.default)(this.data,h,"01"),text:this.text}}}]),c})(i.default);return Mi.default=d,Mi}var Qo={},Zu;function Ju(){if(Zu)return Qo;Zu=1,Object.defineProperty(Qo,"__esModule",{value:!0});var e=(function(){function u(c,f){for(var h=0;h<f.length;h++){var b=f[h];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(c,b.key,b)}}return function(c,f,h){return f&&u(c.prototype,f),h&&u(c,h),c}})();Qo.checksum=d;var t=Jo(),r=i(t),o=st(),n=i(o);function i(u){return u&&u.__esModule?u:{default:u}}function a(u,c){if(!(u instanceof c))throw new TypeError("Cannot call a class as a function")}function s(u,c){if(!u)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c&&(typeof c=="object"||typeof c=="function")?c:u}function p(u,c){if(typeof c!="function"&&c!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof c);u.prototype=Object.create(c&&c.prototype,{constructor:{value:u,enumerable:!1,writable:!0,configurable:!0}}),c&&(Object.setPrototypeOf?Object.setPrototypeOf(u,c):u.__proto__=c)}var l=(function(u){p(c,u);function c(f,h){a(this,c),f.search(/^[0-9]{11}$/)!==-1&&(f+=d(f));var b=s(this,(c.__proto__||Object.getPrototypeOf(c)).call(this,f,h));return b.displayValue=h.displayValue,h.fontSize>h.width*10?b.fontSize=h.width*10:b.fontSize=h.fontSize,b.guardHeight=h.height+b.fontSize/2+h.textMargin,b}return e(c,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==d(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var h="";return h+="101",h+=(0,r.default)(this.data.substr(0,6),"LLLLLL"),h+="01010",h+=(0,r.default)(this.data.substr(6,6),"RRRRRR"),h+="101",{data:h,text:this.text}}},{key:"guardedEncoding",value:function(){var h=[];return this.displayValue&&h.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),h.push({data:"101"+(0,r.default)(this.data[0],"L"),options:{height:this.guardHeight}}),h.push({data:(0,r.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),h.push({data:"01010",options:{height:this.guardHeight}}),h.push({data:(0,r.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),h.push({data:(0,r.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&h.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),h}}]),c})(n.default);function d(u){var c=0,f;for(f=1;f<11;f+=2)c+=parseInt(u[f]);for(f=0;f<11;f+=2)c+=parseInt(u[f])*3;return(10-c%10)%10}return Qo.default=l,Qo}var Ci={},Qu;function Gy(){if(Qu)return Ci;Qu=1,Object.defineProperty(Ci,"__esModule",{value:!0});var e=(function(){function h(b,k){for(var v=0;v<k.length;v++){var w=k[v];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(b,w.key,w)}}return function(b,k,v){return k&&h(b.prototype,k),v&&h(b,v),b}})(),t=Jo(),r=a(t),o=st(),n=a(o),i=Ju();function a(h){return h&&h.__esModule?h:{default:h}}function s(h,b){if(!(h instanceof b))throw new TypeError("Cannot call a class as a function")}function p(h,b){if(!h)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b&&(typeof b=="object"||typeof b=="function")?b:h}function l(h,b){if(typeof b!="function"&&b!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof b);h.prototype=Object.create(b&&b.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),b&&(Object.setPrototypeOf?Object.setPrototypeOf(h,b):h.__proto__=b)}var d=["XX00000XXX","XX10000XXX","XX20000XXX","XXX00000XX","XXXX00000X","XXXXX00005","XXXXX00006","XXXXX00007","XXXXX00008","XXXXX00009"],u=[["EEEOOO","OOOEEE"],["EEOEOO","OOEOEE"],["EEOOEO","OOEEOE"],["EEOOOE","OOEEEO"],["EOEEOO","OEOOEE"],["EOOEEO","OEEOOE"],["EOOOEE","OEEEOO"],["EOEOEO","OEOEOE"],["EOEOOE","OEOEEO"],["EOOEOE","OEEOEO"]],c=(function(h){l(b,h);function b(k,v){s(this,b);var w=p(this,(b.__proto__||Object.getPrototypeOf(b)).call(this,k,v));if(w.isValid=!1,k.search(/^[0-9]{6}$/)!==-1)w.middleDigits=k,w.upcA=f(k,"0"),w.text=v.text||""+w.upcA[0]+k+w.upcA[w.upcA.length-1],w.isValid=!0;else if(k.search(/^[01][0-9]{7}$/)!==-1)if(w.middleDigits=k.substring(1,k.length-1),w.upcA=f(w.middleDigits,k[0]),w.upcA[w.upcA.length-1]===k[k.length-1])w.isValid=!0;else return p(w);else return p(w);return w.displayValue=v.displayValue,v.fontSize>v.width*10?w.fontSize=v.width*10:w.fontSize=v.fontSize,w.guardHeight=v.height+w.fontSize/2+v.textMargin,w}return e(b,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var v="";return v+="101",v+=this.encodeMiddleDigits(),v+="010101",{data:v,text:this.text}}},{key:"guardedEncoding",value:function(){var v=[];return this.displayValue&&v.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),v.push({data:"101",options:{height:this.guardHeight}}),v.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),v.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&v.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),v}},{key:"encodeMiddleDigits",value:function(){var v=this.upcA[0],w=this.upcA[this.upcA.length-1],P=u[parseInt(w)][parseInt(v)];return(0,r.default)(this.middleDigits,P)}}]),b})(n.default);function f(h,b){for(var k=parseInt(h[h.length-1]),v=d[k],w="",P=0,E=0;E<v.length;E++){var D=v[E];D==="X"?w+=h[P++]:w+=D}return w=""+b+w,""+w+(0,i.checksum)(w)}return Ci.default=c,Ci}var ef;function Ky(){if(ef)return tt;ef=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.UPCE=tt.UPC=tt.EAN2=tt.EAN5=tt.EAN8=tt.EAN13=void 0;var e=qy(),t=c(e),r=jy(),o=c(r),n=Wy(),i=c(n),a=Vy(),s=c(a),p=Ju(),l=c(p),d=Gy(),u=c(d);function c(f){return f&&f.__esModule?f:{default:f}}return tt.EAN13=t.default,tt.EAN8=o.default,tt.EAN5=i.default,tt.EAN2=s.default,tt.UPC=l.default,tt.UPCE=u.default,tt}var _r={},_i={},oo={},tf;function Yy(){return tf||(tf=1,Object.defineProperty(oo,"__esModule",{value:!0}),oo.START_BIN="1010",oo.END_BIN="11101",oo.BINARIES=["00110","10001","01001","11000","00101","10100","01100","00011","10010","01010"]),oo}var rf;function of(){if(rf)return _i;rf=1,Object.defineProperty(_i,"__esModule",{value:!0});var e=(function(){function l(d,u){for(var c=0;c<u.length;c++){var f=u[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}return function(d,u,c){return u&&l(d.prototype,u),c&&l(d,c),d}})(),t=Yy(),r=st(),o=n(r);function n(l){return l&&l.__esModule?l:{default:l}}function i(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function a(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function s(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var p=(function(l){s(d,l);function d(){return i(this,d),a(this,(d.__proto__||Object.getPrototypeOf(d)).apply(this,arguments))}return e(d,[{key:"valid",value:function(){return this.data.search(/^([0-9]{2})+$/)!==-1}},{key:"encode",value:function(){var c=this,f=this.data.match(/.{2}/g).map(function(h){return c.encodePair(h)}).join("");return{data:t.START_BIN+f+t.END_BIN,text:this.text}}},{key:"encodePair",value:function(c){var f=t.BINARIES[c[1]];return t.BINARIES[c[0]].split("").map(function(h,b){return(h==="1"?"111":"1")+(f[b]==="1"?"000":"0")}).join("")}}]),d})(o.default);return _i.default=p,_i}var Di={},nf;function Xy(){if(nf)return Di;nf=1,Object.defineProperty(Di,"__esModule",{value:!0});var e=(function(){function l(d,u){for(var c=0;c<u.length;c++){var f=u[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}return function(d,u,c){return u&&l(d.prototype,u),c&&l(d,c),d}})(),t=of(),r=o(t);function o(l){return l&&l.__esModule?l:{default:l}}function n(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function i(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function a(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var s=function(d){var u=d.substr(0,13).split("").map(function(c){return parseInt(c,10)}).reduce(function(c,f,h){return c+f*(3-h%2*2)},0);return Math.ceil(u/10)*10-u},p=(function(l){a(d,l);function d(u,c){return n(this,d),u.search(/^[0-9]{13}$/)!==-1&&(u+=s(u)),i(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,u,c))}return e(d,[{key:"valid",value:function(){return this.data.search(/^[0-9]{14}$/)!==-1&&+this.data[13]===s(this.data)}}]),d})(r.default);return Di.default=p,Di}var af;function Zy(){if(af)return _r;af=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.ITF14=_r.ITF=void 0;var e=of(),t=n(e),r=Xy(),o=n(r);function n(i){return i&&i.__esModule?i:{default:i}}return _r.ITF=t.default,_r.ITF14=o.default,_r}var lt={},Ai={},sf;function en(){if(sf)return Ai;sf=1,Object.defineProperty(Ai,"__esModule",{value:!0});var e=(function(){function l(d,u){for(var c=0;c<u.length;c++){var f=u[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}return function(d,u,c){return u&&l(d.prototype,u),c&&l(d,c),d}})(),t=st(),r=o(t);function o(l){return l&&l.__esModule?l:{default:l}}function n(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function i(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function a(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var s=(function(l){a(d,l);function d(u,c){return n(this,d),i(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,u,c))}return e(d,[{key:"encode",value:function(){for(var c="110",f=0;f<this.data.length;f++){var h=parseInt(this.data[f]),b=h.toString(2);b=p(b,4-b.length);for(var k=0;k<b.length;k++)c+=b[k]=="0"?"100":"110"}return c+="1001",{data:c,text:this.text}}},{key:"valid",value:function(){return this.data.search(/^[0-9]+$/)!==-1}}]),d})(r.default);function p(l,d){for(var u=0;u<d;u++)l="0"+l;return l}return Ai.default=s,Ai}var Oi={},tn={},lf;function Ri(){if(lf)return tn;lf=1,Object.defineProperty(tn,"__esModule",{value:!0}),tn.mod10=e,tn.mod11=t;function e(r){for(var o=0,n=0;n<r.length;n++){var i=parseInt(r[n]);(n+r.length)%2===0?o+=i:o+=i*2%10+Math.floor(i*2/10)}return(10-o%10)%10}function t(r){for(var o=0,n=[2,3,4,5,6,7],i=0;i<r.length;i++){var a=parseInt(r[r.length-1-i]);o+=n[i%n.length]*a}return(11-o%11)%11}return tn}var pf;function Jy(){if(pf)return Oi;pf=1,Object.defineProperty(Oi,"__esModule",{value:!0});var e=en(),t=o(e),r=Ri();function o(p){return p&&p.__esModule?p:{default:p}}function n(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}function i(p,l){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:p}function a(p,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);p.prototype=Object.create(l&&l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(p,l):p.__proto__=l)}var s=(function(p){a(l,p);function l(d,u){return n(this,l),i(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d+(0,r.mod10)(d),u))}return l})(t.default);return Oi.default=s,Oi}var Ii={},df;function Qy(){if(df)return Ii;df=1,Object.defineProperty(Ii,"__esModule",{value:!0});var e=en(),t=o(e),r=Ri();function o(p){return p&&p.__esModule?p:{default:p}}function n(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}function i(p,l){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:p}function a(p,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);p.prototype=Object.create(l&&l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(p,l):p.__proto__=l)}var s=(function(p){a(l,p);function l(d,u){return n(this,l),i(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d+(0,r.mod11)(d),u))}return l})(t.default);return Ii.default=s,Ii}var Li={},cf;function ev(){if(cf)return Li;cf=1,Object.defineProperty(Li,"__esModule",{value:!0});var e=en(),t=o(e),r=Ri();function o(p){return p&&p.__esModule?p:{default:p}}function n(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}function i(p,l){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:p}function a(p,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);p.prototype=Object.create(l&&l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(p,l):p.__proto__=l)}var s=(function(p){a(l,p);function l(d,u){return n(this,l),d+=(0,r.mod10)(d),d+=(0,r.mod10)(d),i(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,u))}return l})(t.default);return Li.default=s,Li}var Bi={},uf;function tv(){if(uf)return Bi;uf=1,Object.defineProperty(Bi,"__esModule",{value:!0});var e=en(),t=o(e),r=Ri();function o(p){return p&&p.__esModule?p:{default:p}}function n(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}function i(p,l){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:p}function a(p,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);p.prototype=Object.create(l&&l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(p,l):p.__proto__=l)}var s=(function(p){a(l,p);function l(d,u){return n(this,l),d+=(0,r.mod11)(d),d+=(0,r.mod10)(d),i(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,u))}return l})(t.default);return Bi.default=s,Bi}var ff;function rv(){if(ff)return lt;ff=1,Object.defineProperty(lt,"__esModule",{value:!0}),lt.MSI1110=lt.MSI1010=lt.MSI11=lt.MSI10=lt.MSI=void 0;var e=en(),t=d(e),r=Jy(),o=d(r),n=Qy(),i=d(n),a=ev(),s=d(a),p=tv(),l=d(p);function d(u){return u&&u.__esModule?u:{default:u}}return lt.MSI=t.default,lt.MSI10=o.default,lt.MSI11=i.default,lt.MSI1010=s.default,lt.MSI1110=l.default,lt}var rn={},hf;function ov(){if(hf)return rn;hf=1,Object.defineProperty(rn,"__esModule",{value:!0}),rn.pharmacode=void 0;var e=(function(){function p(l,d){for(var u=0;u<d.length;u++){var c=d[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}return function(l,d,u){return d&&p(l.prototype,d),u&&p(l,u),l}})(),t=st(),r=o(t);function o(p){return p&&p.__esModule?p:{default:p}}function n(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}function i(p,l){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:p}function a(p,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);p.prototype=Object.create(l&&l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(p,l):p.__proto__=l)}var s=(function(p){a(l,p);function l(d,u){n(this,l);var c=i(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,u));return c.number=parseInt(d,10),c}return e(l,[{key:"encode",value:function(){for(var u=this.number,c="";!isNaN(u)&&u!=0;)u%2===0?(c="11100"+c,u=(u-2)/2):(c="100"+c,u=(u-1)/2);return c=c.slice(0,-2),{data:c,text:this.text}}},{key:"valid",value:function(){return this.number>=3&&this.number<=131070}}]),l})(r.default);return rn.pharmacode=s,rn}var on={},mf;function nv(){if(mf)return on;mf=1,Object.defineProperty(on,"__esModule",{value:!0}),on.codabar=void 0;var e=(function(){function p(l,d){for(var u=0;u<d.length;u++){var c=d[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}return function(l,d,u){return d&&p(l.prototype,d),u&&p(l,u),l}})(),t=st(),r=o(t);function o(p){return p&&p.__esModule?p:{default:p}}function n(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}function i(p,l){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:p}function a(p,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);p.prototype=Object.create(l&&l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(p,l):p.__proto__=l)}var s=(function(p){a(l,p);function l(d,u){n(this,l),d.search(/^[0-9\-\$\:\.\+\/]+$/)===0&&(d="A"+d+"A");var c=i(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d.toUpperCase(),u));return c.text=c.options.text||c.text.replace(/[A-D]/g,""),c}return e(l,[{key:"valid",value:function(){return this.data.search(/^[A-D][0-9\-\$\:\.\+\/]+[A-D]$/)!==-1}},{key:"encode",value:function(){for(var u=[],c=this.getEncodings(),f=0;f<this.data.length;f++)u.push(c[this.data.charAt(f)]),f!==this.data.length-1&&u.push("0");return{text:this.text,data:u.join("")}}},{key:"getEncodings",value:function(){return{0:"101010011",1:"101011001",2:"101001011",3:"110010101",4:"101101001",5:"110101001",6:"100101011",7:"100101101",8:"100110101",9:"110100101","-":"101001101",$:"101100101",":":"1101011011","/":"1101101011",".":"1101101101","+":"1011011011",A:"1011001001",B:"1001001011",C:"1010010011",D:"1010011001"}}}]),l})(r.default);return on.codabar=s,on}var Dr={},Ni={},no={},gf;function iv(){return gf||(gf=1,Object.defineProperty(no,"__esModule",{value:!0}),no.SYMBOLS=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","-","."," ","$","/","+","%","($)","(%)","(/)","(+)","ÿ"],no.BINARIES=["100010100","101001000","101000100","101000010","100101000","100100100","100100010","101010000","100010010","100001010","110101000","110100100","110100010","110010100","110010010","110001010","101101000","101100100","101100010","100110100","100011010","101011000","101001100","101000110","100101100","100010110","110110100","110110010","110101100","110100110","110010110","110011010","101101100","101100110","100110110","100111010","100101110","111010100","111010010","111001010","101101110","101110110","110101110","100100110","111011010","111010110","100110010","101011110"],no.MULTI_SYMBOLS={"\0":["(%)","U"],"":["($)","A"],"":["($)","B"],"":["($)","C"],"":["($)","D"],"":["($)","E"],"":["($)","F"],"\x07":["($)","G"],"\b":["($)","H"]," ":["($)","I"],"\n":["($)","J"],"\v":["($)","K"],"\f":["($)","L"],"\r":["($)","M"],"":["($)","N"],"":["($)","O"],"":["($)","P"],"":["($)","Q"],"":["($)","R"],"":["($)","S"],"":["($)","T"],"":["($)","U"],"":["($)","V"],"":["($)","W"],"":["($)","X"],"":["($)","Y"],"":["($)","Z"],"\x1B":["(%)","A"],"":["(%)","B"],"":["(%)","C"],"":["(%)","D"],"":["(%)","E"],"!":["(/)","A"],'"':["(/)","B"],"#":["(/)","C"],"&":["(/)","F"],"'":["(/)","G"],"(":["(/)","H"],")":["(/)","I"],"*":["(/)","J"],",":["(/)","L"],":":["(/)","Z"],";":["(%)","F"],"<":["(%)","G"],"=":["(%)","H"],">":["(%)","I"],"?":["(%)","J"],"@":["(%)","V"],"[":["(%)","K"],"\\":["(%)","L"],"]":["(%)","M"],"^":["(%)","N"],_:["(%)","O"],"`":["(%)","W"],a:["(+)","A"],b:["(+)","B"],c:["(+)","C"],d:["(+)","D"],e:["(+)","E"],f:["(+)","F"],g:["(+)","G"],h:["(+)","H"],i:["(+)","I"],j:["(+)","J"],k:["(+)","K"],l:["(+)","L"],m:["(+)","M"],n:["(+)","N"],o:["(+)","O"],p:["(+)","P"],q:["(+)","Q"],r:["(+)","R"],s:["(+)","S"],t:["(+)","T"],u:["(+)","U"],v:["(+)","V"],w:["(+)","W"],x:["(+)","X"],y:["(+)","Y"],z:["(+)","Z"],"{":["(%)","P"],"|":["(%)","Q"],"}":["(%)","R"],"~":["(%)","S"],"":["(%)","T"]}),no}var bf;function kf(){if(bf)return Ni;bf=1,Object.defineProperty(Ni,"__esModule",{value:!0});var e=(function(){function l(d,u){for(var c=0;c<u.length;c++){var f=u[c];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(d,f.key,f)}}return function(d,u,c){return u&&l(d.prototype,u),c&&l(d,c),d}})(),t=iv(),r=st(),o=n(r);function n(l){return l&&l.__esModule?l:{default:l}}function i(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function a(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function s(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var p=(function(l){s(d,l);function d(u,c){return i(this,d),a(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,u,c))}return e(d,[{key:"valid",value:function(){return/^[0-9A-Z\-. $/+%]+$/.test(this.data)}},{key:"encode",value:function(){var c=this.data.split("").flatMap(function(k){return t.MULTI_SYMBOLS[k]||k}),f=c.map(function(k){return d.getEncoding(k)}).join(""),h=d.checksum(c,20),b=d.checksum(c.concat(h),15);return{text:this.text,data:d.getEncoding("ÿ")+f+d.getEncoding(h)+d.getEncoding(b)+d.getEncoding("ÿ")+"1"}}}],[{key:"getEncoding",value:function(c){return t.BINARIES[d.symbolValue(c)]}},{key:"getSymbol",value:function(c){return t.SYMBOLS[c]}},{key:"symbolValue",value:function(c){return t.SYMBOLS.indexOf(c)}},{key:"checksum",value:function(c,f){var h=c.slice().reverse().reduce(function(b,k,v){var w=v%f+1;return b+d.symbolValue(k)*w},0);return d.getSymbol(h%47)}}]),d})(o.default);return Ni.default=p,Ni}var Fi={},yf;function av(){if(yf)return Fi;yf=1,Object.defineProperty(Fi,"__esModule",{value:!0});var e=(function(){function p(l,d){for(var u=0;u<d.length;u++){var c=d[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}return function(l,d,u){return d&&p(l.prototype,d),u&&p(l,u),l}})(),t=kf(),r=o(t);function o(p){return p&&p.__esModule?p:{default:p}}function n(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}function i(p,l){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:p}function a(p,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);p.prototype=Object.create(l&&l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(p,l):p.__proto__=l)}var s=(function(p){a(l,p);function l(d,u){return n(this,l),i(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,u))}return e(l,[{key:"valid",value:function(){return/^[\x00-\x7f]+$/.test(this.data)}}]),l})(r.default);return Fi.default=s,Fi}var vf;function sv(){if(vf)return Dr;vf=1,Object.defineProperty(Dr,"__esModule",{value:!0}),Dr.CODE93FullASCII=Dr.CODE93=void 0;var e=kf(),t=n(e),r=av(),o=n(r);function n(i){return i&&i.__esModule?i:{default:i}}return Dr.CODE93=t.default,Dr.CODE93FullASCII=o.default,Dr}var nn={},wf;function lv(){if(wf)return nn;wf=1,Object.defineProperty(nn,"__esModule",{value:!0}),nn.GenericBarcode=void 0;var e=(function(){function p(l,d){for(var u=0;u<d.length;u++){var c=d[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}return function(l,d,u){return d&&p(l.prototype,d),u&&p(l,u),l}})(),t=st(),r=o(t);function o(p){return p&&p.__esModule?p:{default:p}}function n(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}function i(p,l){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l&&(typeof l=="object"||typeof l=="function")?l:p}function a(p,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof l);p.prototype=Object.create(l&&l.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),l&&(Object.setPrototypeOf?Object.setPrototypeOf(p,l):p.__proto__=l)}var s=(function(p){a(l,p);function l(d,u){return n(this,l),i(this,(l.__proto__||Object.getPrototypeOf(l)).call(this,d,u))}return e(l,[{key:"encode",value:function(){return{data:"10101010101010101010101010101010101010101",text:this.text}}},{key:"valid",value:function(){return!0}}]),l})(r.default);return nn.GenericBarcode=s,nn}var xf;function pv(){if(xf)return fi;xf=1,Object.defineProperty(fi,"__esModule",{value:!0});var e=By(),t=Uy(),r=Ky(),o=Zy(),n=rv(),i=ov(),a=nv(),s=sv(),p=lv();return fi.default={CODE39:e.CODE39,CODE128:t.CODE128,CODE128A:t.CODE128A,CODE128B:t.CODE128B,CODE128C:t.CODE128C,EAN13:r.EAN13,EAN8:r.EAN8,EAN5:r.EAN5,EAN2:r.EAN2,UPC:r.UPC,UPCE:r.UPCE,ITF14:o.ITF14,ITF:o.ITF,MSI:n.MSI,MSI10:n.MSI10,MSI11:n.MSI11,MSI1010:n.MSI1010,MSI1110:n.MSI1110,pharmacode:i.pharmacode,codabar:a.codabar,CODE93:s.CODE93,CODE93FullASCII:s.CODE93FullASCII,GenericBarcode:p.GenericBarcode},fi}var $i={},Pf;function zi(){if(Pf)return $i;Pf=1,Object.defineProperty($i,"__esModule",{value:!0});var e=Object.assign||function(t){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t};return $i.default=function(t,r){return e({},t,r)},$i}var Hi={},Ef;function dv(){if(Ef)return Hi;Ef=1,Object.defineProperty(Hi,"__esModule",{value:!0}),Hi.default=e;function e(t){var r=[];function o(n){if(Array.isArray(n))for(var i=0;i<n.length;i++)o(n[i]);else n.text=n.text||"",n.data=n.data||"",r.push(n)}return o(t),r}return Hi}var Ui={},Sf;function cv(){if(Sf)return Ui;Sf=1,Object.defineProperty(Ui,"__esModule",{value:!0}),Ui.default=e;function e(t){return t.marginTop=t.marginTop||t.margin,t.marginBottom=t.marginBottom||t.margin,t.marginRight=t.marginRight||t.margin,t.marginLeft=t.marginLeft||t.margin,t}return Ui}var qi={},ji={},Wi={},Tf;function Mf(){if(Tf)return Wi;Tf=1,Object.defineProperty(Wi,"__esModule",{value:!0}),Wi.default=e;function e(t){var r=["width","height","textMargin","fontSize","margin","marginTop","marginBottom","marginLeft","marginRight"];for(var o in r)r.hasOwnProperty(o)&&(o=r[o],typeof t[o]=="string"&&(t[o]=parseInt(t[o],10)));return typeof t.displayValue=="string"&&(t.displayValue=t.displayValue!="false"),t}return Wi}var Vi={},Cf;function _f(){if(Cf)return Vi;Cf=1,Object.defineProperty(Vi,"__esModule",{value:!0});var e={width:2,height:100,format:"auto",displayValue:!0,fontOptions:"",font:"monospace",text:void 0,textAlign:"center",textPosition:"bottom",textMargin:2,fontSize:20,background:"#ffffff",lineColor:"#000000",margin:10,marginTop:void 0,marginBottom:void 0,marginLeft:void 0,marginRight:void 0,valid:function(){}};return Vi.default=e,Vi}var Df;function uv(){if(Df)return ji;Df=1,Object.defineProperty(ji,"__esModule",{value:!0});var e=Mf(),t=n(e),r=_f(),o=n(r);function n(a){return a&&a.__esModule?a:{default:a}}function i(a){var s={};for(var p in o.default)o.default.hasOwnProperty(p)&&(a.hasAttribute("jsbarcode-"+p.toLowerCase())&&(s[p]=a.getAttribute("jsbarcode-"+p.toLowerCase())),a.hasAttribute("data-"+p.toLowerCase())&&(s[p]=a.getAttribute("data-"+p.toLowerCase())));return s.value=a.getAttribute("jsbarcode-value")||a.getAttribute("data-value"),s=(0,t.default)(s),s}return ji.default=i,ji}var Gi={},Ki={},pt={},Af;function Of(){if(Af)return pt;Af=1,Object.defineProperty(pt,"__esModule",{value:!0}),pt.getTotalWidthOfEncodings=pt.calculateEncodingAttributes=pt.getBarcodePadding=pt.getEncodingHeight=pt.getMaximumHeightOfEncodings=void 0;var e=zi(),t=r(e);function r(l){return l&&l.__esModule?l:{default:l}}function o(l,d){return d.height+(d.displayValue&&l.text.length>0?d.fontSize+d.textMargin:0)+d.marginTop+d.marginBottom}function n(l,d,u){if(u.displayValue&&d<l){if(u.textAlign=="center")return Math.floor((l-d)/2);if(u.textAlign=="left")return 0;if(u.textAlign=="right")return Math.floor(l-d)}return 0}function i(l,d,u){for(var c=0;c<l.length;c++){var f=l[c],h=(0,t.default)(d,f.options),b;h.displayValue?b=p(f.text,h,u):b=0;var k=f.data.length*h.width;f.width=Math.ceil(Math.max(b,k)),f.height=o(f,h),f.barcodePadding=n(b,k,h)}}function a(l){for(var d=0,u=0;u<l.length;u++)d+=l[u].width;return d}function s(l){for(var d=0,u=0;u<l.length;u++)l[u].height>d&&(d=l[u].height);return d}function p(l,d,u){var c;if(u)c=u;else if(typeof document<"u")c=document.createElement("canvas").getContext("2d");else return 0;c.font=d.fontOptions+" "+d.fontSize+"px "+d.font;var f=c.measureText(l);if(!f)return 0;var h=f.width;return h}return pt.getMaximumHeightOfEncodings=s,pt.getEncodingHeight=o,pt.getBarcodePadding=n,pt.calculateEncodingAttributes=i,pt.getTotalWidthOfEncodings=a,pt}var Rf;function fv(){if(Rf)return Ki;Rf=1,Object.defineProperty(Ki,"__esModule",{value:!0});var e=(function(){function s(p,l){for(var d=0;d<l.length;d++){var u=l[d];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(p,u.key,u)}}return function(p,l,d){return l&&s(p.prototype,l),d&&s(p,d),p}})(),t=zi(),r=n(t),o=Of();function n(s){return s&&s.__esModule?s:{default:s}}function i(s,p){if(!(s instanceof p))throw new TypeError("Cannot call a class as a function")}var a=(function(){function s(p,l,d){i(this,s),this.canvas=p,this.encodings=l,this.options=d}return e(s,[{key:"render",value:function(){if(!this.canvas.getContext)throw new Error("The browser does not support canvas.");this.prepareCanvas();for(var l=0;l<this.encodings.length;l++){var d=(0,r.default)(this.options,this.encodings[l].options);this.drawCanvasBarcode(d,this.encodings[l]),this.drawCanvasText(d,this.encodings[l]),this.moveCanvasDrawing(this.encodings[l])}this.restoreCanvas()}},{key:"prepareCanvas",value:function(){var l=this.canvas.getContext("2d");l.save(),(0,o.calculateEncodingAttributes)(this.encodings,this.options,l);var d=(0,o.getTotalWidthOfEncodings)(this.encodings),u=(0,o.getMaximumHeightOfEncodings)(this.encodings);this.canvas.width=d+this.options.marginLeft+this.options.marginRight,this.canvas.height=u,l.clearRect(0,0,this.canvas.width,this.canvas.height),this.options.background&&(l.fillStyle=this.options.background,l.fillRect(0,0,this.canvas.width,this.canvas.height)),l.translate(this.options.marginLeft,0)}},{key:"drawCanvasBarcode",value:function(l,d){var u=this.canvas.getContext("2d"),c=d.data,f;l.textPosition=="top"?f=l.marginTop+l.fontSize+l.textMargin:f=l.marginTop,u.fillStyle=l.lineColor;for(var h=0;h<c.length;h++){var b=h*l.width+d.barcodePadding;c[h]==="1"?u.fillRect(b,f,l.width,l.height):c[h]&&u.fillRect(b,f,l.width,l.height*c[h])}}},{key:"drawCanvasText",value:function(l,d){var u=this.canvas.getContext("2d"),c=l.fontOptions+" "+l.fontSize+"px "+l.font;if(l.displayValue){var f,h;l.textPosition=="top"?h=l.marginTop+l.fontSize-l.textMargin:h=l.height+l.textMargin+l.marginTop+l.fontSize,u.font=c,l.textAlign=="left"||d.barcodePadding>0?(f=0,u.textAlign="left"):l.textAlign=="right"?(f=d.width-1,u.textAlign="right"):(f=d.width/2,u.textAlign="center"),u.fillText(d.text,f,h)}}},{key:"moveCanvasDrawing",value:function(l){var d=this.canvas.getContext("2d");d.translate(l.width,0)}},{key:"restoreCanvas",value:function(){var l=this.canvas.getContext("2d");l.restore()}}]),s})();return Ki.default=a,Ki}var Yi={},If;function hv(){if(If)return Yi;If=1,Object.defineProperty(Yi,"__esModule",{value:!0});var e=(function(){function p(l,d){for(var u=0;u<d.length;u++){var c=d[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}return function(l,d,u){return d&&p(l.prototype,d),u&&p(l,u),l}})(),t=zi(),r=n(t),o=Of();function n(p){return p&&p.__esModule?p:{default:p}}function i(p,l){if(!(p instanceof l))throw new TypeError("Cannot call a class as a function")}var a="http://www.w3.org/2000/svg",s=(function(){function p(l,d,u){i(this,p),this.svg=l,this.encodings=d,this.options=u,this.document=u.xmlDocument||document}return e(p,[{key:"render",value:function(){var d=this.options.marginLeft;this.prepareSVG();for(var u=0;u<this.encodings.length;u++){var c=this.encodings[u],f=(0,r.default)(this.options,c.options),h=this.createGroup(d,f.marginTop,this.svg);this.setGroupOptions(h,f),this.drawSvgBarcode(h,f,c),this.drawSVGText(h,f,c),d+=c.width}}},{key:"prepareSVG",value:function(){for(;this.svg.firstChild;)this.svg.removeChild(this.svg.firstChild);(0,o.calculateEncodingAttributes)(this.encodings,this.options);var d=(0,o.getTotalWidthOfEncodings)(this.encodings),u=(0,o.getMaximumHeightOfEncodings)(this.encodings),c=d+this.options.marginLeft+this.options.marginRight;this.setSvgAttributes(c,u),this.options.background&&this.drawRect(0,0,c,u,this.svg).setAttribute("fill",this.options.background)}},{key:"drawSvgBarcode",value:function(d,u,c){var f=c.data,h;u.textPosition=="top"?h=u.fontSize+u.textMargin:h=0;for(var b=0,k=0,v=0;v<f.length;v++)k=v*u.width+c.barcodePadding,f[v]==="1"?b++:b>0&&(this.drawRect(k-u.width*b,h,u.width*b,u.height,d),b=0);b>0&&this.drawRect(k-u.width*(b-1),h,u.width*b,u.height,d)}},{key:"drawSVGText",value:function(d,u,c){var f=this.document.createElementNS(a,"text");if(u.displayValue){var h,b;f.setAttribute("font-family",u.font),f.setAttribute("font-size",u.fontSize),u.fontOptions.includes("bold")&&f.setAttribute("font-weight","bold"),u.fontOptions.includes("italic")&&f.setAttribute("font-style","italic"),u.textPosition=="top"?b=u.fontSize-u.textMargin:b=u.height+u.textMargin+u.fontSize,u.textAlign=="left"||c.barcodePadding>0?(h=0,f.setAttribute("text-anchor","start")):u.textAlign=="right"?(h=c.width-1,f.setAttribute("text-anchor","end")):(h=c.width/2,f.setAttribute("text-anchor","middle")),f.setAttribute("x",h),f.setAttribute("y",b),f.appendChild(this.document.createTextNode(c.text)),d.appendChild(f)}}},{key:"setSvgAttributes",value:function(d,u){var c=this.svg;c.setAttribute("width",d+"px"),c.setAttribute("height",u+"px"),c.setAttribute("x","0px"),c.setAttribute("y","0px"),c.setAttribute("viewBox","0 0 "+d+" "+u),c.setAttribute("xmlns",a),c.setAttribute("version","1.1")}},{key:"createGroup",value:function(d,u,c){var f=this.document.createElementNS(a,"g");return f.setAttribute("transform","translate("+d+", "+u+")"),c.appendChild(f),f}},{key:"setGroupOptions",value:function(d,u){d.setAttribute("fill",u.lineColor)}},{key:"drawRect",value:function(d,u,c,f,h){var b=this.document.createElementNS(a,"rect");return b.setAttribute("x",d),b.setAttribute("y",u),b.setAttribute("width",c),b.setAttribute("height",f),h.appendChild(b),b}}]),p})();return Yi.default=s,Yi}var Xi={},Lf;function mv(){if(Lf)return Xi;Lf=1,Object.defineProperty(Xi,"__esModule",{value:!0});var e=(function(){function o(n,i){for(var a=0;a<i.length;a++){var s=i[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,s.key,s)}}return function(n,i,a){return i&&o(n.prototype,i),a&&o(n,a),n}})();function t(o,n){if(!(o instanceof n))throw new TypeError("Cannot call a class as a function")}var r=(function(){function o(n,i,a){t(this,o),this.object=n,this.encodings=i,this.options=a}return e(o,[{key:"render",value:function(){this.object.encodings=this.encodings}}]),o})();return Xi.default=r,Xi}var Bf;function gv(){if(Bf)return Gi;Bf=1,Object.defineProperty(Gi,"__esModule",{value:!0});var e=fv(),t=a(e),r=hv(),o=a(r),n=mv(),i=a(n);function a(s){return s&&s.__esModule?s:{default:s}}return Gi.default={CanvasRenderer:t.default,SVGRenderer:o.default,ObjectRenderer:i.default},Gi}var io={},Nf;function Ff(){if(Nf)return io;Nf=1,Object.defineProperty(io,"__esModule",{value:!0});function e(a,s){if(!(a instanceof s))throw new TypeError("Cannot call a class as a function")}function t(a,s){if(!a)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s&&(typeof s=="object"||typeof s=="function")?s:a}function r(a,s){if(typeof s!="function"&&s!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof s);a.prototype=Object.create(s&&s.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),s&&(Object.setPrototypeOf?Object.setPrototypeOf(a,s):a.__proto__=s)}var o=(function(a){r(s,a);function s(p,l){e(this,s);var d=t(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return d.name="InvalidInputException",d.symbology=p,d.input=l,d.message='"'+d.input+'" is not a valid input for '+d.symbology,d}return s})(Error),n=(function(a){r(s,a);function s(){e(this,s);var p=t(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return p.name="InvalidElementException",p.message="Not supported type to render on",p}return s})(Error),i=(function(a){r(s,a);function s(){e(this,s);var p=t(this,(s.__proto__||Object.getPrototypeOf(s)).call(this));return p.name="NoElementException",p.message="No element to render on.",p}return s})(Error);return io.InvalidInputException=o,io.InvalidElementException=n,io.NoElementException=i,io}var $f;function bv(){if($f)return qi;$f=1,Object.defineProperty(qi,"__esModule",{value:!0});var e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},t=uv(),r=a(t),o=gv(),n=a(o),i=Ff();function a(d){return d&&d.__esModule?d:{default:d}}function s(d){if(typeof d=="string")return p(d);if(Array.isArray(d)){for(var u=[],c=0;c<d.length;c++)u.push(s(d[c]));return u}else{if(typeof HTMLCanvasElement<"u"&&d instanceof HTMLImageElement)return l(d);if(d&&d.nodeName&&d.nodeName.toLowerCase()==="svg"||typeof SVGElement<"u"&&d instanceof SVGElement)return{element:d,options:(0,r.default)(d),renderer:n.default.SVGRenderer};if(typeof HTMLCanvasElement<"u"&&d instanceof HTMLCanvasElement)return{element:d,options:(0,r.default)(d),renderer:n.default.CanvasRenderer};if(d&&d.getContext)return{element:d,renderer:n.default.CanvasRenderer};if(d&&(typeof d>"u"?"undefined":e(d))==="object"&&!d.nodeName)return{element:d,renderer:n.default.ObjectRenderer};throw new i.InvalidElementException}}function p(d){var u=document.querySelectorAll(d);if(u.length!==0){for(var c=[],f=0;f<u.length;f++)c.push(s(u[f]));return c}}function l(d){var u=document.createElement("canvas");return{element:u,options:(0,r.default)(d),renderer:n.default.CanvasRenderer,afterRender:function(){d.setAttribute("src",u.toDataURL())}}}return qi.default=s,qi}var Zi={},zf;function kv(){if(zf)return Zi;zf=1,Object.defineProperty(Zi,"__esModule",{value:!0});var e=(function(){function o(n,i){for(var a=0;a<i.length;a++){var s=i[a];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,s.key,s)}}return function(n,i,a){return i&&o(n.prototype,i),a&&o(n,a),n}})();function t(o,n){if(!(o instanceof n))throw new TypeError("Cannot call a class as a function")}var r=(function(){function o(n){t(this,o),this.api=n}return e(o,[{key:"handleCatch",value:function(i){if(i.name==="InvalidInputException")if(this.api._options.valid!==this.api._defaults.valid)this.api._options.valid(!1);else throw i.message;else throw i;this.api.render=function(){}}},{key:"wrapBarcodeCall",value:function(i){try{var a=i.apply(void 0,arguments);return this.api._options.valid(!0),a}catch(s){return this.handleCatch(s),this.api}}}]),o})();return Zi.default=r,Zi}var qs,Hf;function yv(){if(Hf)return qs;Hf=1;var e=pv(),t=v(e),r=zi(),o=v(r),n=dv(),i=v(n),a=cv(),s=v(a),p=bv(),l=v(p),d=Mf(),u=v(d),c=kv(),f=v(c),h=Ff(),b=_f(),k=v(b);function v(_){return _&&_.__esModule?_:{default:_}}var w=function(){},P=function(I,S,N){var F=new w;if(typeof I>"u")throw Error("No element to render on was provided.");return F._renderProperties=(0,l.default)(I),F._encodings=[],F._options=k.default,F._errorHandler=new f.default(F),typeof S<"u"&&(N=N||{},N.format||(N.format=A()),F.options(N)[N.format](S,N).render()),F};P.getModule=function(_){return t.default[_]};for(var E in t.default)t.default.hasOwnProperty(E)&&D(t.default,E);function D(_,I){w.prototype[I]=w.prototype[I.toUpperCase()]=w.prototype[I.toLowerCase()]=function(S,N){var F=this;return F._errorHandler.wrapBarcodeCall(function(){N.text=typeof N.text>"u"?void 0:""+N.text;var H=(0,o.default)(F._options,N);H=(0,u.default)(H);var le=_[I],M=O(S,le,H);return F._encodings.push(M),F})}}function O(_,I,S){_=""+_;var N=new I(_,S);if(!N.valid())throw new h.InvalidInputException(N.constructor.name,_);var F=N.encode();F=(0,i.default)(F);for(var H=0;H<F.length;H++)F[H].options=(0,o.default)(S,F[H].options);return F}function A(){return t.default.CODE128?"CODE128":Object.keys(t.default)[0]}w.prototype.options=function(_){return this._options=(0,o.default)(this._options,_),this},w.prototype.blank=function(_){var I=new Array(_+1).join("0");return this._encodings.push({data:I}),this},w.prototype.init=function(){if(this._renderProperties){Array.isArray(this._renderProperties)||(this._renderProperties=[this._renderProperties]);var _;for(var I in this._renderProperties){_=this._renderProperties[I];var S=(0,o.default)(this._options,_.options);S.format=="auto"&&(S.format=A()),this._errorHandler.wrapBarcodeCall(function(){var N=S.value,F=t.default[S.format.toUpperCase()],H=O(N,F,S);R(_,H,S)})}}},w.prototype.render=function(){if(!this._renderProperties)throw new h.NoElementException;if(Array.isArray(this._renderProperties))for(var _=0;_<this._renderProperties.length;_++)R(this._renderProperties[_],this._encodings,this._options);else R(this._renderProperties,this._encodings,this._options);return this},w.prototype._defaults=k.default;function R(_,I,S){I=(0,i.default)(I);for(var N=0;N<I.length;N++)I[N].options=(0,o.default)(S,I[N].options),(0,s.default)(I[N].options);(0,s.default)(S);var F=_.renderer,H=new F(_.element,I,S);H.render(),_.afterRender&&_.afterRender()}return typeof window<"u"&&(window.JsBarcode=P),typeof jQuery<"u"&&(jQuery.fn.JsBarcode=function(_,I){var S=[];return jQuery(this).each(function(){S.push(this)}),P(S,_,I)}),qs=P,qs}var vv=yv();const js=Ou(vv);var ao={},Ws,Uf;function wv(){return Uf||(Uf=1,Ws=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Ws}var Vs={},sr={},qf;function Ar(){if(qf)return sr;qf=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return sr.getSymbolSize=function(o){if(!o)throw new Error('"version" cannot be null or undefined');if(o<1||o>40)throw new Error('"version" should be in range from 1 to 40');return o*4+17},sr.getSymbolTotalCodewords=function(o){return t[o]},sr.getBCHDigit=function(r){let o=0;for(;r!==0;)o++,r>>>=1;return o},sr.setToSJISFunction=function(o){if(typeof o!="function")throw new Error('"toSJISFunc" is not a valid function.');e=o},sr.isKanjiModeEnabled=function(){return typeof e<"u"},sr.toSJIS=function(o){return e(o)},sr}var Gs={},jf;function Ks(){return jf||(jf=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+r)}}e.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},e.from=function(o,n){if(e.isValid(o))return o;try{return t(o)}catch{return n}}})(Gs)),Gs}var Ys,Wf;function xv(){if(Wf)return Ys;Wf=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const r=Math.floor(t/8);return(this.buffer[r]>>>7-t%8&1)===1},put:function(t,r){for(let o=0;o<r;o++)this.putBit((t>>>r-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),t&&(this.buffer[r]|=128>>>this.length%8),this.length++}},Ys=e,Ys}var Xs,Vf;function Pv(){if(Vf)return Xs;Vf=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,r,o,n){const i=t*this.size+r;this.data[i]=o,n&&(this.reservedBit[i]=!0)},e.prototype.get=function(t,r){return this.data[t*this.size+r]},e.prototype.xor=function(t,r,o){this.data[t*this.size+r]^=o},e.prototype.isReserved=function(t,r){return this.reservedBit[t*this.size+r]},Xs=e,Xs}var Zs={},Gf;function Ev(){return Gf||(Gf=1,(function(e){const t=Ar().getSymbolSize;e.getRowColCoords=function(o){if(o===1)return[];const n=Math.floor(o/7)+2,i=t(o),a=i===145?26:Math.ceil((i-13)/(2*n-2))*2,s=[i-7];for(let p=1;p<n-1;p++)s[p]=s[p-1]-a;return s.push(6),s.reverse()},e.getPositions=function(o){const n=[],i=e.getRowColCoords(o),a=i.length;for(let s=0;s<a;s++)for(let p=0;p<a;p++)s===0&&p===0||s===0&&p===a-1||s===a-1&&p===0||n.push([i[s],i[p]]);return n}})(Zs)),Zs}var Js={},Kf;function Sv(){if(Kf)return Js;Kf=1;const e=Ar().getSymbolSize,t=7;return Js.getPositions=function(o){const n=e(o);return[[0,0],[n-t,0],[0,n-t]]},Js}var Qs={},Yf;function Tv(){return Yf||(Yf=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},e.from=function(n){return e.isValid(n)?parseInt(n,10):void 0},e.getPenaltyN1=function(n){const i=n.size;let a=0,s=0,p=0,l=null,d=null;for(let u=0;u<i;u++){s=p=0,l=d=null;for(let c=0;c<i;c++){let f=n.get(u,c);f===l?s++:(s>=5&&(a+=t.N1+(s-5)),l=f,s=1),f=n.get(c,u),f===d?p++:(p>=5&&(a+=t.N1+(p-5)),d=f,p=1)}s>=5&&(a+=t.N1+(s-5)),p>=5&&(a+=t.N1+(p-5))}return a},e.getPenaltyN2=function(n){const i=n.size;let a=0;for(let s=0;s<i-1;s++)for(let p=0;p<i-1;p++){const l=n.get(s,p)+n.get(s,p+1)+n.get(s+1,p)+n.get(s+1,p+1);(l===4||l===0)&&a++}return a*t.N2},e.getPenaltyN3=function(n){const i=n.size;let a=0,s=0,p=0;for(let l=0;l<i;l++){s=p=0;for(let d=0;d<i;d++)s=s<<1&2047|n.get(l,d),d>=10&&(s===1488||s===93)&&a++,p=p<<1&2047|n.get(d,l),d>=10&&(p===1488||p===93)&&a++}return a*t.N3},e.getPenaltyN4=function(n){let i=0;const a=n.data.length;for(let p=0;p<a;p++)i+=n.data[p];return Math.abs(Math.ceil(i*100/a/5)-10)*t.N4};function r(o,n,i){switch(o){case e.Patterns.PATTERN000:return(n+i)%2===0;case e.Patterns.PATTERN001:return n%2===0;case e.Patterns.PATTERN010:return i%3===0;case e.Patterns.PATTERN011:return(n+i)%3===0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(i/3))%2===0;case e.Patterns.PATTERN101:return n*i%2+n*i%3===0;case e.Patterns.PATTERN110:return(n*i%2+n*i%3)%2===0;case e.Patterns.PATTERN111:return(n*i%3+(n+i)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}e.applyMask=function(n,i){const a=i.size;for(let s=0;s<a;s++)for(let p=0;p<a;p++)i.isReserved(p,s)||i.xor(p,s,r(n,p,s))},e.getBestMask=function(n,i){const a=Object.keys(e.Patterns).length;let s=0,p=1/0;for(let l=0;l<a;l++){i(l),e.applyMask(l,n);const d=e.getPenaltyN1(n)+e.getPenaltyN2(n)+e.getPenaltyN3(n)+e.getPenaltyN4(n);e.applyMask(l,n),d<p&&(p=d,s=l)}return s}})(Qs)),Qs}var Ji={},Xf;function Zf(){if(Xf)return Ji;Xf=1;const e=Ks(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Ji.getBlocksCount=function(n,i){switch(i){case e.L:return t[(n-1)*4+0];case e.M:return t[(n-1)*4+1];case e.Q:return t[(n-1)*4+2];case e.H:return t[(n-1)*4+3];default:return}},Ji.getTotalCodewordsCount=function(n,i){switch(i){case e.L:return r[(n-1)*4+0];case e.M:return r[(n-1)*4+1];case e.Q:return r[(n-1)*4+2];case e.H:return r[(n-1)*4+3];default:return}},Ji}var el={},an={},Jf;function Mv(){if(Jf)return an;Jf=1;const e=new Uint8Array(512),t=new Uint8Array(256);return(function(){let o=1;for(let n=0;n<255;n++)e[n]=o,t[o]=n,o<<=1,o&256&&(o^=285);for(let n=255;n<512;n++)e[n]=e[n-255]})(),an.log=function(o){if(o<1)throw new Error("log("+o+")");return t[o]},an.exp=function(o){return e[o]},an.mul=function(o,n){return o===0||n===0?0:e[t[o]+t[n]]},an}var Qf;function Cv(){return Qf||(Qf=1,(function(e){const t=Mv();e.mul=function(o,n){const i=new Uint8Array(o.length+n.length-1);for(let a=0;a<o.length;a++)for(let s=0;s<n.length;s++)i[a+s]^=t.mul(o[a],n[s]);return i},e.mod=function(o,n){let i=new Uint8Array(o);for(;i.length-n.length>=0;){const a=i[0];for(let p=0;p<n.length;p++)i[p]^=t.mul(n[p],a);let s=0;for(;s<i.length&&i[s]===0;)s++;i=i.slice(s)}return i},e.generateECPolynomial=function(o){let n=new Uint8Array([1]);for(let i=0;i<o;i++)n=e.mul(n,new Uint8Array([1,t.exp(i)]));return n}})(el)),el}var tl,eh;function _v(){if(eh)return tl;eh=1;const e=Cv();function t(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(o){this.degree=o,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(o){if(!this.genPoly)throw new Error("Encoder not initialized");const n=new Uint8Array(o.length+this.degree);n.set(o);const i=e.mod(n,this.genPoly),a=this.degree-i.length;if(a>0){const s=new Uint8Array(this.degree);return s.set(i,a),s}return i},tl=t,tl}var rl={},ol={},nl={},th;function rh(){return th||(th=1,nl.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),nl}var Ft={},oh;function nh(){if(oh)return Ft;oh=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const o="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r
276
276
  ]))+`;Ft.KANJI=new RegExp(r,"g"),Ft.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Ft.BYTE=new RegExp(o,"g"),Ft.NUMERIC=new RegExp(e,"g"),Ft.ALPHANUMERIC=new RegExp(t,"g");const n=new RegExp("^"+r+"$"),i=new RegExp("^"+e+"$"),a=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Ft.testKanji=function(p){return n.test(p)},Ft.testNumeric=function(p){return i.test(p)},Ft.testAlphanumeric=function(p){return a.test(p)},Ft}var ih;function Or(){return ih||(ih=1,(function(e){const t=rh(),r=nh();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(i,a){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!t.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?i.ccBits[0]:a<27?i.ccBits[1]:i.ccBits[2]},e.getBestModeForData=function(i){return r.testNumeric(i)?e.NUMERIC:r.testAlphanumeric(i)?e.ALPHANUMERIC:r.testKanji(i)?e.KANJI:e.BYTE},e.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},e.isValid=function(i){return i&&i.bit&&i.ccBits};function o(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+n)}}e.from=function(i,a){if(e.isValid(i))return i;try{return o(i)}catch{return a}}})(ol)),ol}var ah;function Dv(){return ah||(ah=1,(function(e){const t=Ar(),r=Zf(),o=Ks(),n=Or(),i=rh(),a=7973,s=t.getBCHDigit(a);function p(c,f,h){for(let b=1;b<=40;b++)if(f<=e.getCapacity(b,h,c))return b}function l(c,f){return n.getCharCountIndicator(c,f)+4}function d(c,f){let h=0;return c.forEach(function(b){const k=l(b.mode,f);h+=k+b.getBitsLength()}),h}function u(c,f){for(let h=1;h<=40;h++)if(d(c,h)<=e.getCapacity(h,f,n.MIXED))return h}e.from=function(f,h){return i.isValid(f)?parseInt(f,10):h},e.getCapacity=function(f,h,b){if(!i.isValid(f))throw new Error("Invalid QR Code version");typeof b>"u"&&(b=n.BYTE);const k=t.getSymbolTotalCodewords(f),v=r.getTotalCodewordsCount(f,h),w=(k-v)*8;if(b===n.MIXED)return w;const P=w-l(b,f);switch(b){case n.NUMERIC:return Math.floor(P/10*3);case n.ALPHANUMERIC:return Math.floor(P/11*2);case n.KANJI:return Math.floor(P/13);case n.BYTE:default:return Math.floor(P/8)}},e.getBestVersionForData=function(f,h){let b;const k=o.from(h,o.M);if(Array.isArray(f)){if(f.length>1)return u(f,k);if(f.length===0)return 1;b=f[0]}else b=f;return p(b.mode,b.getLength(),k)},e.getEncodedBits=function(f){if(!i.isValid(f)||f<7)throw new Error("Invalid QR Code version");let h=f<<12;for(;t.getBCHDigit(h)-s>=0;)h^=a<<t.getBCHDigit(h)-s;return f<<12|h}})(rl)),rl}var il={},sh;function Av(){if(sh)return il;sh=1;const e=Ar(),t=1335,r=21522,o=e.getBCHDigit(t);return il.getEncodedBits=function(i,a){const s=i.bit<<3|a;let p=s<<10;for(;e.getBCHDigit(p)-o>=0;)p^=t<<e.getBCHDigit(p)-o;return(s<<10|p)^r},il}var al={},sl,lh;function Ov(){if(lh)return sl;lh=1;const e=Or();function t(r){this.mode=e.NUMERIC,this.data=r.toString()}return t.getBitsLength=function(o){return 10*Math.floor(o/3)+(o%3?o%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(o){let n,i,a;for(n=0;n+3<=this.data.length;n+=3)i=this.data.substr(n,3),a=parseInt(i,10),o.put(a,10);const s=this.data.length-n;s>0&&(i=this.data.substr(n),a=parseInt(i,10),o.put(a,s*3+1))},sl=t,sl}var ll,ph;function Rv(){if(ph)return ll;ph=1;const e=Or(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(o){this.mode=e.ALPHANUMERIC,this.data=o}return r.getBitsLength=function(n){return 11*Math.floor(n/2)+6*(n%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(n){let i;for(i=0;i+2<=this.data.length;i+=2){let a=t.indexOf(this.data[i])*45;a+=t.indexOf(this.data[i+1]),n.put(a,11)}this.data.length%2&&n.put(t.indexOf(this.data[i]),6)},ll=r,ll}var pl,dh;function Iv(){if(dh)return pl;dh=1;const e=Or();function t(r){this.mode=e.BYTE,typeof r=="string"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return t.getBitsLength=function(o){return o*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(r){for(let o=0,n=this.data.length;o<n;o++)r.put(this.data[o],8)},pl=t,pl}var dl,ch;function Lv(){if(ch)return dl;ch=1;const e=Or(),t=Ar();function r(o){this.mode=e.KANJI,this.data=o}return r.getBitsLength=function(n){return n*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(o){let n;for(n=0;n<this.data.length;n++){let i=t.toSJIS(this.data[n]);if(i>=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw new Error("Invalid SJIS character: "+this.data[n]+`
277
- Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),o.put(i,13)}},dl=r,dl}var cl={exports:{}},uh;function Nv(){return uh||(uh=1,(function(e){var t={single_source_shortest_paths:function(r,o,n){var i={},a={};a[o]=0;var s=t.PriorityQueue.make();s.push(o,0);for(var p,l,d,u,c,f,h,b,k;!s.empty();){p=s.pop(),l=p.value,u=p.cost,c=r[l]||{};for(d in c)c.hasOwnProperty(d)&&(f=c[d],h=u+f,b=a[d],k=typeof a[d]>"u",(k||b>h)&&(a[d]=h,s.push(d,h),i[d]=l))}if(typeof n<"u"&&typeof a[n]>"u"){var v=["Could not find a path from ",o," to ",n,"."].join("");throw new Error(v)}return i},extract_shortest_path_from_predecessor_list:function(r,o){for(var n=[],i=o;i;)n.push(i),r[i],i=r[i];return n.reverse(),n},find_path:function(r,o,n){var i=t.single_source_shortest_paths(r,o,n);return t.extract_shortest_path_from_predecessor_list(i,n)},PriorityQueue:{make:function(r){var o=t.PriorityQueue,n={},i;r=r||{};for(i in o)o.hasOwnProperty(i)&&(n[i]=o[i]);return n.queue=[],n.sorter=r.sorter||o.default_sorter,n},default_sorter:function(r,o){return r.cost-o.cost},push:function(r,o){var n={value:r,cost:o};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(cl)),cl.exports}var fh;function Bv(){return fh||(fh=1,(function(e){const t=Or(),r=Ov(),o=Rv(),n=Iv(),i=Lv(),a=nh(),s=Ar(),p=Nv();function l(v){return unescape(encodeURIComponent(v)).length}function d(v,w,P){const E=[];let D;for(;(D=v.exec(P))!==null;)E.push({data:D[0],index:D.index,mode:w,length:D[0].length});return E}function u(v){const w=d(a.NUMERIC,t.NUMERIC,v),P=d(a.ALPHANUMERIC,t.ALPHANUMERIC,v);let E,D;return s.isKanjiModeEnabled()?(E=d(a.BYTE,t.BYTE,v),D=d(a.KANJI,t.KANJI,v)):(E=d(a.BYTE_KANJI,t.BYTE,v),D=[]),w.concat(P,E,D).sort(function(A,R){return A.index-R.index}).map(function(A){return{data:A.data,mode:A.mode,length:A.length}})}function c(v,w){switch(w){case t.NUMERIC:return r.getBitsLength(v);case t.ALPHANUMERIC:return o.getBitsLength(v);case t.KANJI:return i.getBitsLength(v);case t.BYTE:return n.getBitsLength(v)}}function f(v){return v.reduce(function(w,P){const E=w.length-1>=0?w[w.length-1]:null;return E&&E.mode===P.mode?(w[w.length-1].data+=P.data,w):(w.push(P),w)},[])}function h(v){const w=[];for(let P=0;P<v.length;P++){const E=v[P];switch(E.mode){case t.NUMERIC:w.push([E,{data:E.data,mode:t.ALPHANUMERIC,length:E.length},{data:E.data,mode:t.BYTE,length:E.length}]);break;case t.ALPHANUMERIC:w.push([E,{data:E.data,mode:t.BYTE,length:E.length}]);break;case t.KANJI:w.push([E,{data:E.data,mode:t.BYTE,length:l(E.data)}]);break;case t.BYTE:w.push([{data:E.data,mode:t.BYTE,length:l(E.data)}])}}return w}function b(v,w){const P={},E={start:{}};let D=["start"];for(let O=0;O<v.length;O++){const A=v[O],R=[];for(let _=0;_<A.length;_++){const I=A[_],S=""+O+_;R.push(S),P[S]={node:I,lastCount:0},E[S]={};for(let B=0;B<D.length;B++){const F=D[B];P[F]&&P[F].node.mode===I.mode?(E[F][S]=c(P[F].lastCount+I.length,I.mode)-c(P[F].lastCount,I.mode),P[F].lastCount+=I.length):(P[F]&&(P[F].lastCount=I.length),E[F][S]=c(I.length,I.mode)+4+t.getCharCountIndicator(I.mode,w))}}D=R}for(let O=0;O<D.length;O++)E[D[O]].end=0;return{map:E,table:P}}function k(v,w){let P;const E=t.getBestModeForData(v);if(P=t.from(w,E),P!==t.BYTE&&P.bit<E.bit)throw new Error('"'+v+'" cannot be encoded with mode '+t.toString(P)+`.
278
- Suggested mode is: `+t.toString(E));switch(P===t.KANJI&&!s.isKanjiModeEnabled()&&(P=t.BYTE),P){case t.NUMERIC:return new r(v);case t.ALPHANUMERIC:return new o(v);case t.KANJI:return new i(v);case t.BYTE:return new n(v)}}e.fromArray=function(w){return w.reduce(function(P,E){return typeof E=="string"?P.push(k(E,null)):E.data&&P.push(k(E.data,E.mode)),P},[])},e.fromString=function(w,P){const E=u(w,s.isKanjiModeEnabled()),D=h(E),O=b(D,P),A=p.find_path(O.map,"start","end"),R=[];for(let _=1;_<A.length-1;_++)R.push(O.table[A[_]].node);return e.fromArray(f(R))},e.rawSplit=function(w){return e.fromArray(u(w,s.isKanjiModeEnabled()))}})(al)),al}var hh;function Fv(){if(hh)return Vs;hh=1;const e=Ar(),t=Ks(),r=xv(),o=Pv(),n=Ev(),i=Sv(),a=Tv(),s=Zf(),p=_v(),l=Dv(),d=Av(),u=Or(),c=Bv();function f(O,A){const R=O.size,_=i.getPositions(A);for(let I=0;I<_.length;I++){const S=_[I][0],B=_[I][1];for(let F=-1;F<=7;F++)if(!(S+F<=-1||R<=S+F))for(let H=-1;H<=7;H++)B+H<=-1||R<=B+H||(F>=0&&F<=6&&(H===0||H===6)||H>=0&&H<=6&&(F===0||F===6)||F>=2&&F<=4&&H>=2&&H<=4?O.set(S+F,B+H,!0,!0):O.set(S+F,B+H,!1,!0))}}function h(O){const A=O.size;for(let R=8;R<A-8;R++){const _=R%2===0;O.set(R,6,_,!0),O.set(6,R,_,!0)}}function b(O,A){const R=n.getPositions(A);for(let _=0;_<R.length;_++){const I=R[_][0],S=R[_][1];for(let B=-2;B<=2;B++)for(let F=-2;F<=2;F++)B===-2||B===2||F===-2||F===2||B===0&&F===0?O.set(I+B,S+F,!0,!0):O.set(I+B,S+F,!1,!0)}}function k(O,A){const R=O.size,_=l.getEncodedBits(A);let I,S,B;for(let F=0;F<18;F++)I=Math.floor(F/3),S=F%3+R-8-3,B=(_>>F&1)===1,O.set(I,S,B,!0),O.set(S,I,B,!0)}function v(O,A,R){const _=O.size,I=d.getEncodedBits(A,R);let S,B;for(S=0;S<15;S++)B=(I>>S&1)===1,S<6?O.set(S,8,B,!0):S<8?O.set(S+1,8,B,!0):O.set(_-15+S,8,B,!0),S<8?O.set(8,_-S-1,B,!0):S<9?O.set(8,15-S-1+1,B,!0):O.set(8,15-S-1,B,!0);O.set(_-8,8,1,!0)}function w(O,A){const R=O.size;let _=-1,I=R-1,S=7,B=0;for(let F=R-1;F>0;F-=2)for(F===6&&F--;;){for(let H=0;H<2;H++)if(!O.isReserved(I,F-H)){let le=!1;B<A.length&&(le=(A[B]>>>S&1)===1),O.set(I,F-H,le),S--,S===-1&&(B++,S=7)}if(I+=_,I<0||R<=I){I-=_,_=-_;break}}}function P(O,A,R){const _=new r;R.forEach(function(H){_.put(H.mode.bit,4),_.put(H.getLength(),u.getCharCountIndicator(H.mode,O)),H.write(_)});const I=e.getSymbolTotalCodewords(O),S=s.getTotalCodewordsCount(O,A),B=(I-S)*8;for(_.getLengthInBits()+4<=B&&_.put(0,4);_.getLengthInBits()%8!==0;)_.putBit(0);const F=(B-_.getLengthInBits())/8;for(let H=0;H<F;H++)_.put(H%2?17:236,8);return E(_,O,A)}function E(O,A,R){const _=e.getSymbolTotalCodewords(A),I=s.getTotalCodewordsCount(A,R),S=_-I,B=s.getBlocksCount(A,R),F=_%B,H=B-F,le=Math.floor(_/B),M=Math.floor(S/B),ne=M+1,Se=le-M,Pe=new p(Se);let K=0;const ue=new Array(B),me=new Array(B);let we=0;const ke=new Uint8Array(O.buffer);for(let ze=0;ze<B;ze++){const ve=ze<H?M:ne;ue[ze]=ke.slice(K,K+ve),me[ze]=Pe.encode(ue[ze]),K+=ve,we=Math.max(we,ve)}const te=new Uint8Array(_);let Me=0,se,Je;for(se=0;se<we;se++)for(Je=0;Je<B;Je++)se<ue[Je].length&&(te[Me++]=ue[Je][se]);for(se=0;se<Se;se++)for(Je=0;Je<B;Je++)te[Me++]=me[Je][se];return te}function D(O,A,R,_){let I;if(Array.isArray(O))I=c.fromArray(O);else if(typeof O=="string"){let le=A;if(!le){const M=c.rawSplit(O);le=l.getBestVersionForData(M,R)}I=c.fromString(O,le||40)}else throw new Error("Invalid data");const S=l.getBestVersionForData(I,R);if(!S)throw new Error("The amount of data is too big to be stored in a QR Code");if(!A)A=S;else if(A<S)throw new Error(`
277
+ Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),o.put(i,13)}},dl=r,dl}var cl={exports:{}},uh;function Bv(){return uh||(uh=1,(function(e){var t={single_source_shortest_paths:function(r,o,n){var i={},a={};a[o]=0;var s=t.PriorityQueue.make();s.push(o,0);for(var p,l,d,u,c,f,h,b,k;!s.empty();){p=s.pop(),l=p.value,u=p.cost,c=r[l]||{};for(d in c)c.hasOwnProperty(d)&&(f=c[d],h=u+f,b=a[d],k=typeof a[d]>"u",(k||b>h)&&(a[d]=h,s.push(d,h),i[d]=l))}if(typeof n<"u"&&typeof a[n]>"u"){var v=["Could not find a path from ",o," to ",n,"."].join("");throw new Error(v)}return i},extract_shortest_path_from_predecessor_list:function(r,o){for(var n=[],i=o;i;)n.push(i),r[i],i=r[i];return n.reverse(),n},find_path:function(r,o,n){var i=t.single_source_shortest_paths(r,o,n);return t.extract_shortest_path_from_predecessor_list(i,n)},PriorityQueue:{make:function(r){var o=t.PriorityQueue,n={},i;r=r||{};for(i in o)o.hasOwnProperty(i)&&(n[i]=o[i]);return n.queue=[],n.sorter=r.sorter||o.default_sorter,n},default_sorter:function(r,o){return r.cost-o.cost},push:function(r,o){var n={value:r,cost:o};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(cl)),cl.exports}var fh;function Nv(){return fh||(fh=1,(function(e){const t=Or(),r=Ov(),o=Rv(),n=Iv(),i=Lv(),a=nh(),s=Ar(),p=Bv();function l(v){return unescape(encodeURIComponent(v)).length}function d(v,w,P){const E=[];let D;for(;(D=v.exec(P))!==null;)E.push({data:D[0],index:D.index,mode:w,length:D[0].length});return E}function u(v){const w=d(a.NUMERIC,t.NUMERIC,v),P=d(a.ALPHANUMERIC,t.ALPHANUMERIC,v);let E,D;return s.isKanjiModeEnabled()?(E=d(a.BYTE,t.BYTE,v),D=d(a.KANJI,t.KANJI,v)):(E=d(a.BYTE_KANJI,t.BYTE,v),D=[]),w.concat(P,E,D).sort(function(A,R){return A.index-R.index}).map(function(A){return{data:A.data,mode:A.mode,length:A.length}})}function c(v,w){switch(w){case t.NUMERIC:return r.getBitsLength(v);case t.ALPHANUMERIC:return o.getBitsLength(v);case t.KANJI:return i.getBitsLength(v);case t.BYTE:return n.getBitsLength(v)}}function f(v){return v.reduce(function(w,P){const E=w.length-1>=0?w[w.length-1]:null;return E&&E.mode===P.mode?(w[w.length-1].data+=P.data,w):(w.push(P),w)},[])}function h(v){const w=[];for(let P=0;P<v.length;P++){const E=v[P];switch(E.mode){case t.NUMERIC:w.push([E,{data:E.data,mode:t.ALPHANUMERIC,length:E.length},{data:E.data,mode:t.BYTE,length:E.length}]);break;case t.ALPHANUMERIC:w.push([E,{data:E.data,mode:t.BYTE,length:E.length}]);break;case t.KANJI:w.push([E,{data:E.data,mode:t.BYTE,length:l(E.data)}]);break;case t.BYTE:w.push([{data:E.data,mode:t.BYTE,length:l(E.data)}])}}return w}function b(v,w){const P={},E={start:{}};let D=["start"];for(let O=0;O<v.length;O++){const A=v[O],R=[];for(let _=0;_<A.length;_++){const I=A[_],S=""+O+_;R.push(S),P[S]={node:I,lastCount:0},E[S]={};for(let N=0;N<D.length;N++){const F=D[N];P[F]&&P[F].node.mode===I.mode?(E[F][S]=c(P[F].lastCount+I.length,I.mode)-c(P[F].lastCount,I.mode),P[F].lastCount+=I.length):(P[F]&&(P[F].lastCount=I.length),E[F][S]=c(I.length,I.mode)+4+t.getCharCountIndicator(I.mode,w))}}D=R}for(let O=0;O<D.length;O++)E[D[O]].end=0;return{map:E,table:P}}function k(v,w){let P;const E=t.getBestModeForData(v);if(P=t.from(w,E),P!==t.BYTE&&P.bit<E.bit)throw new Error('"'+v+'" cannot be encoded with mode '+t.toString(P)+`.
278
+ Suggested mode is: `+t.toString(E));switch(P===t.KANJI&&!s.isKanjiModeEnabled()&&(P=t.BYTE),P){case t.NUMERIC:return new r(v);case t.ALPHANUMERIC:return new o(v);case t.KANJI:return new i(v);case t.BYTE:return new n(v)}}e.fromArray=function(w){return w.reduce(function(P,E){return typeof E=="string"?P.push(k(E,null)):E.data&&P.push(k(E.data,E.mode)),P},[])},e.fromString=function(w,P){const E=u(w,s.isKanjiModeEnabled()),D=h(E),O=b(D,P),A=p.find_path(O.map,"start","end"),R=[];for(let _=1;_<A.length-1;_++)R.push(O.table[A[_]].node);return e.fromArray(f(R))},e.rawSplit=function(w){return e.fromArray(u(w,s.isKanjiModeEnabled()))}})(al)),al}var hh;function Fv(){if(hh)return Vs;hh=1;const e=Ar(),t=Ks(),r=xv(),o=Pv(),n=Ev(),i=Sv(),a=Tv(),s=Zf(),p=_v(),l=Dv(),d=Av(),u=Or(),c=Nv();function f(O,A){const R=O.size,_=i.getPositions(A);for(let I=0;I<_.length;I++){const S=_[I][0],N=_[I][1];for(let F=-1;F<=7;F++)if(!(S+F<=-1||R<=S+F))for(let H=-1;H<=7;H++)N+H<=-1||R<=N+H||(F>=0&&F<=6&&(H===0||H===6)||H>=0&&H<=6&&(F===0||F===6)||F>=2&&F<=4&&H>=2&&H<=4?O.set(S+F,N+H,!0,!0):O.set(S+F,N+H,!1,!0))}}function h(O){const A=O.size;for(let R=8;R<A-8;R++){const _=R%2===0;O.set(R,6,_,!0),O.set(6,R,_,!0)}}function b(O,A){const R=n.getPositions(A);for(let _=0;_<R.length;_++){const I=R[_][0],S=R[_][1];for(let N=-2;N<=2;N++)for(let F=-2;F<=2;F++)N===-2||N===2||F===-2||F===2||N===0&&F===0?O.set(I+N,S+F,!0,!0):O.set(I+N,S+F,!1,!0)}}function k(O,A){const R=O.size,_=l.getEncodedBits(A);let I,S,N;for(let F=0;F<18;F++)I=Math.floor(F/3),S=F%3+R-8-3,N=(_>>F&1)===1,O.set(I,S,N,!0),O.set(S,I,N,!0)}function v(O,A,R){const _=O.size,I=d.getEncodedBits(A,R);let S,N;for(S=0;S<15;S++)N=(I>>S&1)===1,S<6?O.set(S,8,N,!0):S<8?O.set(S+1,8,N,!0):O.set(_-15+S,8,N,!0),S<8?O.set(8,_-S-1,N,!0):S<9?O.set(8,15-S-1+1,N,!0):O.set(8,15-S-1,N,!0);O.set(_-8,8,1,!0)}function w(O,A){const R=O.size;let _=-1,I=R-1,S=7,N=0;for(let F=R-1;F>0;F-=2)for(F===6&&F--;;){for(let H=0;H<2;H++)if(!O.isReserved(I,F-H)){let le=!1;N<A.length&&(le=(A[N]>>>S&1)===1),O.set(I,F-H,le),S--,S===-1&&(N++,S=7)}if(I+=_,I<0||R<=I){I-=_,_=-_;break}}}function P(O,A,R){const _=new r;R.forEach(function(H){_.put(H.mode.bit,4),_.put(H.getLength(),u.getCharCountIndicator(H.mode,O)),H.write(_)});const I=e.getSymbolTotalCodewords(O),S=s.getTotalCodewordsCount(O,A),N=(I-S)*8;for(_.getLengthInBits()+4<=N&&_.put(0,4);_.getLengthInBits()%8!==0;)_.putBit(0);const F=(N-_.getLengthInBits())/8;for(let H=0;H<F;H++)_.put(H%2?17:236,8);return E(_,O,A)}function E(O,A,R){const _=e.getSymbolTotalCodewords(A),I=s.getTotalCodewordsCount(A,R),S=_-I,N=s.getBlocksCount(A,R),F=_%N,H=N-F,le=Math.floor(_/N),M=Math.floor(S/N),ne=M+1,Se=le-M,Pe=new p(Se);let K=0;const ue=new Array(N),me=new Array(N);let we=0;const ke=new Uint8Array(O.buffer);for(let ze=0;ze<N;ze++){const ve=ze<H?M:ne;ue[ze]=ke.slice(K,K+ve),me[ze]=Pe.encode(ue[ze]),K+=ve,we=Math.max(we,ve)}const te=new Uint8Array(_);let Me=0,se,Je;for(se=0;se<we;se++)for(Je=0;Je<N;Je++)se<ue[Je].length&&(te[Me++]=ue[Je][se]);for(se=0;se<Se;se++)for(Je=0;Je<N;Je++)te[Me++]=me[Je][se];return te}function D(O,A,R,_){let I;if(Array.isArray(O))I=c.fromArray(O);else if(typeof O=="string"){let le=A;if(!le){const M=c.rawSplit(O);le=l.getBestVersionForData(M,R)}I=c.fromString(O,le||40)}else throw new Error("Invalid data");const S=l.getBestVersionForData(I,R);if(!S)throw new Error("The amount of data is too big to be stored in a QR Code");if(!A)A=S;else if(A<S)throw new Error(`
279
279
  The chosen QR Code version cannot contain this amount of data.
280
280
  Minimum version required to store current data is: `+S+`.
281
- `);const B=P(A,R,I),F=e.getSymbolSize(A),H=new o(F);return f(H,A),h(H),b(H,A),v(H,R,0),A>=7&&k(H,A),w(H,B),isNaN(_)&&(_=a.getBestMask(H,v.bind(null,H,R))),a.applyMask(_,H),v(H,R,_),{modules:H,version:A,errorCorrectionLevel:R,maskPattern:_,segments:I}}return Vs.create=function(A,R){if(typeof A>"u"||A==="")throw new Error("No input text");let _=t.M,I,S;return typeof R<"u"&&(_=t.from(R.errorCorrectionLevel,t.M),I=l.from(R.version),S=a.from(R.maskPattern),R.toSJISFunc&&e.setToSJISFunction(R.toSJISFunc)),D(A,I,_,S)},Vs}var ul={},fl={},mh;function gh(){return mh||(mh=1,(function(e){function t(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let o=r.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+r);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(i){return[i,i]}))),o.length===6&&o.push("F","F");const n=parseInt(o.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+o.slice(0,6).join("")}}e.getOptions=function(o){o||(o={}),o.color||(o.color={});const n=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,i=o.width&&o.width>=21?o.width:void 0,a=o.scale||4;return{width:i,scale:i?4:a,margin:n,color:{dark:t(o.color.dark||"#000000ff"),light:t(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},e.getScale=function(o,n){return n.width&&n.width>=o+n.margin*2?n.width/(o+n.margin*2):n.scale},e.getImageWidth=function(o,n){const i=e.getScale(o,n);return Math.floor((o+n.margin*2)*i)},e.qrToImageData=function(o,n,i){const a=n.modules.size,s=n.modules.data,p=e.getScale(a,i),l=Math.floor((a+i.margin*2)*p),d=i.margin*p,u=[i.color.light,i.color.dark];for(let c=0;c<l;c++)for(let f=0;f<l;f++){let h=(c*l+f)*4,b=i.color.light;if(c>=d&&f>=d&&c<l-d&&f<l-d){const k=Math.floor((c-d)/p),v=Math.floor((f-d)/p);b=u[s[k*a+v]?1:0]}o[h++]=b.r,o[h++]=b.g,o[h++]=b.b,o[h]=b.a}}})(fl)),fl}var bh;function $v(){return bh||(bh=1,(function(e){const t=gh();function r(n,i,a){n.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=a,i.width=a,i.style.height=a+"px",i.style.width=a+"px"}function o(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(i,a,s){let p=s,l=a;typeof p>"u"&&(!a||!a.getContext)&&(p=a,a=void 0),a||(l=o()),p=t.getOptions(p);const d=t.getImageWidth(i.modules.size,p),u=l.getContext("2d"),c=u.createImageData(d,d);return t.qrToImageData(c.data,i,p),r(u,l,d),u.putImageData(c,0,0),l},e.renderToDataURL=function(i,a,s){let p=s;typeof p>"u"&&(!a||!a.getContext)&&(p=a,a=void 0),p||(p={});const l=e.render(i,a,p),d=p.type||"image/png",u=p.rendererOpts||{};return l.toDataURL(d,u.quality)}})(ul)),ul}var hl={},kh;function zv(){if(kh)return hl;kh=1;const e=gh();function t(n,i){const a=n.a/255,s=i+'="'+n.hex+'"';return a<1?s+" "+i+'-opacity="'+a.toFixed(2).slice(1)+'"':s}function r(n,i,a){let s=n+i;return typeof a<"u"&&(s+=" "+a),s}function o(n,i,a){let s="",p=0,l=!1,d=0;for(let u=0;u<n.length;u++){const c=Math.floor(u%i),f=Math.floor(u/i);!c&&!l&&(l=!0),n[u]?(d++,u>0&&c>0&&n[u-1]||(s+=l?r("M",c+a,.5+f+a):r("m",p,0),p=0,l=!1),c+1<i&&n[u+1]||(s+=r("h",d),d=0)):p++}return s}return hl.render=function(i,a,s){const p=e.getOptions(a),l=i.modules.size,d=i.modules.data,u=l+p.margin*2,c=p.color.light.a?"<path "+t(p.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",f="<path "+t(p.color.dark,"stroke")+' d="'+o(d,l,p.margin)+'"/>',h='viewBox="0 0 '+u+" "+u+'"',k='<svg xmlns="http://www.w3.org/2000/svg" '+(p.width?'width="'+p.width+'" height="'+p.width+'" ':"")+h+' shape-rendering="crispEdges">'+c+f+`</svg>
282
- `;return typeof s=="function"&&s(null,k),k},hl}var yh;function Hv(){if(yh)return ao;yh=1;const e=wv(),t=Fv(),r=$v(),o=zv();function n(i,a,s,p,l){const d=[].slice.call(arguments,1),u=d.length,c=typeof d[u-1]=="function";if(!c&&!e())throw new Error("Callback required as last argument");if(c){if(u<2)throw new Error("Too few arguments provided");u===2?(l=s,s=a,a=p=void 0):u===3&&(a.getContext&&typeof l>"u"?(l=p,p=void 0):(l=p,p=s,s=a,a=void 0))}else{if(u<1)throw new Error("Too few arguments provided");return u===1?(s=a,a=p=void 0):u===2&&!a.getContext&&(p=s,s=a,a=void 0),new Promise(function(f,h){try{const b=t.create(s,p);f(i(b,a,p))}catch(b){h(b)}})}try{const f=t.create(s,p);l(null,i(f,a,p))}catch(f){l(f)}}return ao.create=t.create,ao.toCanvas=n.bind(null,r.render),ao.toDataURL=n.bind(null,r.renderToDataURL),ao.toString=n.bind(null,function(i,a,s){return o.render(i,s)}),ao}var Uv=Hv();const qv=Ou(Uv),vh="http://www.w3.org/2000/svg";function jv(e){const t=e.getAttribute("viewBox");if(!t)return null;const r=t.trim().split(/[\s,]+/).map(Number);return r.length!==4||r.some(o=>!Number.isFinite(o))?null:{width:r[2],height:r[3]}}function Wv(e,t){const r=document.createElementNS(vh,"svg"),o=Do(t.barWidth),n=qa(t.barQuietZone),i=s=>{js(r,e,{format:t.barcodeType||"CODE128",width:o,height:s*o,displayValue:t.showText!==!1,fontSize:(t.fontSize??Bn)*o,margin:0,marginLeft:n*o,marginRight:n*o,marginTop:0,marginBottom:ja*o});const p=jv(r);return p?{widthUnits:p.width,heightUnits:p.height}:null},a=Va({barHeightMm:t.barHeightMm,boxWidthMm:t.targetWidthMm??0,boxHeightMm:t.targetHeightMm??0,dpi:t.printerDpi,barWidth:t.barWidth,measure:i});return a.size&&(r.setAttribute("width",`${a.size.widthMm}mm`),r.setAttribute("height",`${a.size.heightMm}mm`)),r.setAttribute("shape-rendering","crispEdges"),r.outerHTML}function Vv(e){return typeof e=="number"&&Number.isFinite(e)?Math.max(0,Math.floor(e)):Sd}function Gv(e,t){const r=(t.qrCodeLevel??"M").toUpperCase(),n=qv.create(e,{errorCorrectionLevel:["L","M","Q","H"].includes(r)?r:"M"}).modules,i=n.size,a=4,s=Vv(t.qrQuietZone)*a,p=i*a+s*2;let l="";for(let d=0;d<i;d++)for(let u=0;u<i;u++)n.get(u,d)&&(l+=`<rect x="${s+u*a}" y="${s+d*a}" width="${a}" height="${a}" fill="#000"/>`);return`<svg xmlns="${vh}" viewBox="0 0 ${p} ${p}" width="${p}" height="${p}" shape-rendering="crispEdges">${l}</svg>`}function wh(e,t,r={}){if(!e)throw new Error("empty barcode value");return t==="qrcode"?Gv(e,r):Wv(e,r)}const ml={render(e,t,r={}){return wh(e,t,r)}},gl=.5,Kv=12;function bl(e,t){const r=e.getAttribute(t);if(r===null||r==="")return;const o=Number(r);return Number.isFinite(o)?o:void 0}function xh(e,t){if(e.scrollWidth>e.clientWidth+gl)return!0;const r=e.scrollHeight;return t!==void 0?r>t+gl:r>e.clientHeight+gl}function Ph(e){if(e.getAttribute("data-fit")!=="shrink")return;const t=Mo(bl(e,"data-fit-min")),r=Math.max(bl(e,"data-fit-base")??t,t),o=bl(e,"data-fit-mm"),n=o!==void 0&&o>0?vr(o):void 0,i=l=>{const d=Wb(l);return e.style.fontSize=`${d}pt`,e.setAttribute("data-fit-size",String(d)),d},a=i(r);if(!xh(e,n)||r<=t)return a;let s=t,p=r;for(let l=0;l<Kv;l++){const d=(s+p)/2;i(d),xh(e,n)?p=d:s=d}return i(s)}function Yv(e){const t=[];return e.querySelectorAll('[data-fit="shrink"]').forEach(r=>{const o=Ph(r),n=r.getAttribute("data-fit-key");o===void 0||!n||t.push({key:n,fontSizePt:o})}),t}const Xv="2",Zv=5e3;async function Jv(e,t=Zv){const r=e.document,o=i=>Promise.race([i,new Promise(a=>setTimeout(a,t))]),n=(async()=>{r.readyState!=="complete"&&await o(new Promise(a=>e.addEventListener("load",()=>a(),{once:!0})));const i=r.fonts;i&&(await o(Promise.all(Qv(r).map(a=>i.load(`${a.style} ${a.weight} 16px "${a.family}"`).catch(()=>{})))),i.ready&&await o(i.ready)),await o(Promise.all(Array.from(r.images??[]).map(a=>a.complete?Promise.resolve():new Promise(s=>{a.addEventListener("load",()=>s(),{once:!0}),a.addEventListener("error",()=>s(),{once:!0})}))))})();await o(n)}function Qv(e){const t=[];for(const o of Array.from(e.styleSheets??[])){let n;try{n=o.cssRules}catch{continue}for(const i of Array.from(n??[])){if(i.type!==5)continue;const a=i.style,s=(a.getPropertyValue("font-family")||"").replace(/^["']|["']$/g,"");s&&t.push({family:s,weight:a.getPropertyValue("font-weight")||"400",style:a.getPropertyValue("font-style")||"normal"})}}return t}function e2(e){const t=[];return e.querySelectorAll("[data-measure-id]").forEach(r=>{const o=r,n=o.getAttribute("data-measure-id");if(!n)return;const i=o.getBoundingClientRect().height,a=o.querySelector("table.print-table");if(!a){const p=o.querySelectorAll(".print-flow-row[data-flow-row-index]");if(p.length>0){const l=[];p.forEach(d=>l.push(d.getBoundingClientRect().height)),t.push({id:n,heightPx:i,rowHeightsPx:l});return}t.push({id:n,heightPx:i});return}const s=[];a.querySelectorAll("tbody > tr[data-row-index]").forEach(p=>{s.push(p.getBoundingClientRect().height)}),t.push({id:n,heightPx:i,rowHeightsPx:s})}),t}function t2(e){const t=e.querySelector(".print-page"),r=e.querySelector(".content-area");if(!t||!r)return 0;const o=t.getBoundingClientRect().top;let n=0;r.querySelectorAll("*").forEach(a=>{if(a.classList.contains("print-element"))return;const s=a.getBoundingClientRect();s.height>0&&(n=Math.max(n,s.bottom-o))}),r.querySelectorAll(".print-element").forEach(a=>{const s=a.getBoundingClientRect(),p=Number.parseFloat(e.defaultView?.getComputedStyle(a).marginBottom??"0")||0;s.height>0&&(n=Math.max(n,s.bottom-o+p))});const i=r.getBoundingClientRect();return i.height>0&&(n=Math.max(n,i.bottom-o)),n}function r2(e,t=0){const o=e.querySelectorAll(".print-page")[t];if(!o)return[];const n=o.getBoundingClientRect(),i=e.defaultView?.getComputedStyle(o),a=Number.parseFloat(i?.paddingLeft??"0")||0,s=Number.parseFloat(i?.paddingTop??"0")||0,p=[];return o.querySelectorAll("[data-element-id]").forEach(l=>{if(l.querySelector("[data-element-id]"))return;const d=l.getAttribute("data-element-id");if(!d)return;const u=l.getBoundingClientRect(),c=o2(l,n,a,s);p.push({id:d,left:u.left-c.left,top:u.top-c.top,width:u.width,height:u.height,zone:c.zone})}),p}function o2(e,t,r,o){const n=(p,l)=>{const d=p.getBoundingClientRect();return{left:d.left,top:d.top,zone:l}},i=e.closest(".page-header");if(i)return n(i,"header");const a=e.closest(".page-footer");if(a)return n(a,"footer");const s=e.closest(".content-area");return s?n(s,"content"):{left:t.left+r,top:t.top+o,zone:"content"}}function n2(e){const t={};for(const r of e)try{t[r.key]=wh(r.value,r.cellType,r.opts)}catch{}return t}const i2={version:Xv,waitReady:Jv,readMeasurements:e2,readContentBottom:t2,readElementRects:r2,renderCodes:n2,applyTextFit:Yv};function a2(){return{async createDriver(){const e=document.createElement("iframe");e.setAttribute("aria-hidden","true"),e.style.cssText="position:fixed;left:-10000px;top:0;border:0;visibility:hidden;pointer-events:none;",document.body.appendChild(e);let t=e.contentDocument??document;return{requiresExecutor:!1,async open(r){e.style.width=`${r.width}px`,e.style.height=`${r.height}px`,t=e.contentDocument??document},async setContent(r){t=e.contentDocument??document,t.open(),t.write(r),t.close()},async injectExecutor(r){},async evaluate(r,o){const n=i2[r];if(typeof n!="function"){const l=(e.contentWindow?.__wormDom??globalThis.__wormDom)?.[r];if(typeof l!="function")throw new Error(`执行器方法 ${r} 未注入`);return l(...o??[])}const i=o??[],a=Gk[r],s=n;return a==="window"?s(e.contentWindow,...i):a==="document"?s(t,...i):s(...i)},async close(){e.remove()}}}}}function s2(){return Xk(a2())}async function l2(e,t,r,o,n){const i=await sy({templateJson:e,printData:t,baseUrl:r,fontBaseUrl:n?.fontBaseUrl??"",paperHeightMm:n?.paperHeightMm,codeRenderer:o,renderers:n?.renderers},s2());return{html:i.html,pageCount:i.pageCount,pageLayouts:i.pageLayouts,paperMm:i.paperMm,pagePaperMm:i.pagePaperMm,continuous:i.continuous,copies:i.copies,copyPaperMm:i.copyPaperMm}}var p2={"binding.k1":"上传图片","binding.k2":"仅支持上传图片文件","binding.k3":"图片上传能力未配置","binding.k4":"上传中...","binding.k5":"图片上传失败","binding.k6":"图片上传失败","binding.k7":"上传图片","binding.k8":"支持 jpg/png/gif/bmp/webp/svg 等图片,上传后填入相对路径","binding.k9":"内容","binding.k10":"输入内容,支持 {字段} 表达式","canvas.k11":"页眉","canvas.k12":"页脚","canvas.k13":"+ 元素","canvas.k14":"+ 静态文本","canvas.k15":"+ 取值字段","canvas.k16":"复制","canvas.k17":"剪切","canvas.k18":"粘贴","canvas.k19":"删除","canvas.k20":"置顶","canvas.k21":"上移","canvas.k22":"下移","canvas.k23":"置底","canvas.k24":"粘贴","canvas.k25":"全选","canvas.k26":"取消选择","code.k27":"二维码","controls.k28":"减小","controls.k29":"减小","controls.k30":"增大","controls.k31":"增大","controls.k32":"字段说明","controls.k33":"恢复默认值","controls.k34":"恢复默认值({v0}{v1})","controls.k35":"{v0}(应用到全部选中格)","controls.k36":"颜色选择","cropAnchor.k37":"自定义(保留原值)","cropAnchor.k38":"默认 100","cropAnchor.k39":"示例图","cropAnchor.k40":"原图","elements.k41":"文本","elements.k42":"长文本内容","elements.k43":"图片","flowList.k44":"黄芪 20g","flowList.k45":"当归尾 15g","flowList.k46":"赤芍 10g","flowList.k47":"川芎 10g","flowList.k48":"地龙 10g","flowList.k49":"桃仁 10g","flowList.k50":"红花 10g","fontSelect.k51":"默认","fontSelect.k52":"{v0}(未知)","fontSelect.k53":"使用「{v0}」","formatBar.k54":"实线","formatBar.k55":"虚线","formatBar.k56":"点线","formatBar.k57":"双线","formatBar.k58":"退出格式刷(Esc)","formatBar.k59":"格式刷(表格单元格暂不支持)","formatBar.k60":"格式刷(需选中元素)","formatBar.k61":"格式刷(请仅选中一个源元素)","formatBar.k62":"格式刷:单击刷一次,双击连续刷","formatBar.k63":"{v0}(需选中文本元素)","formatBar.k64":"无边框","formatBar.k65":"所有边框","formatBar.k66":"外侧边框","formatBar.k67":"内部边框","formatBar.k68":"内部边框(仅表格单元格可用)","formatBar.k69":"上边框","formatBar.k70":"下边框","formatBar.k71":"左边框","formatBar.k72":"右边框","formatBar.k73":"{v0}(再点一次取消,线型=无)","formatBar.k74":"粗细","formatBar.k75":"混合","formatBar.k76":"颜色","formatBar.k77":"边框颜色","formatBar.k78":"当前单元格四边规格不一致:留空的项不谎报,点预设/单边时按缺省档(实线 0.75 / #333333)批写","formatBar.k79":"左对齐","formatBar.k80":"水平居中","formatBar.k81":"右对齐","formatBar.k82":"两端对齐(撑满行宽,含末行)","formatBar.k83":"顶端对齐","formatBar.k84":"垂直居中","formatBar.k85":"底端对齐","formatBar.k86":"混合","formatBar.k87":"默认","formatBar.k88":"混合","formatBar.k89":"默认","formatBar.k90":"加粗","formatBar.k91":"下划线","formatBar.k92":"删除线","formatBar.k93":"字体颜色{v0}","formatBar.fontDisabledHint":"(需选中或混选文本元素)","formatBar.k94":"背景色","formatBar.k95":"对齐","formatBar.k96":"对齐(需选中文本元素或单元格)","formatBar.k97":"对齐","formatBar.k98":"边框","formatBar.k99":"边框(需选中元素)","formatBar.k100":"边框","helpModal.k101":"帮助文档","helpModal.k102":"关闭","pageExtras.k103":"上传背景图","pageExtras.k104":"仅支持上传图片文件","pageExtras.k105":"设计背景上传能力未配置","pageExtras.k106":"上传中...","pageExtras.k107":"设计背景上传失败","pageExtras.k108":"设计背景上传失败","pageExtras.k109":"上传背景图","pageExtras.k110":"设计背景","pageExtras.k111":"仅设计器显示,用于套打定位,不会出现在预览和打印中","pageExtras.k112":"旋转({v0}°)","pageExtras.k113":"移除","pageExtras.k114":"自定义","pageExtras.k115":" 横向","pageExtras.k116":" 纵向","pageExtras.k117":"目标纸 {v0}{v1} {v2}×{v3}mm · {v4} 列 × {v5} 行 = 每张 {v6} 格 · 每格 {v7}×{v8}mm","pageExtras.k118":"拼版打印","pageExtras.k119":"把标签按「列 × 行」铺到一张大纸上批量打印","pageExtras.k120":"启用拼版","pageExtras.k121":"连续纸不支持拼版","pageExtras.k122":"目标纸张","pageExtras.k123":"自定义","pageExtras.k124":"目标纸宽高 (mm)","pageExtras.k125":"目标纸方向","pageExtras.k126":"纵向","pageExtras.k127":"横向","pageExtras.k128":"拼版留白 (mm)","pageExtras.k129":"上","pageExtras.k130":"下","pageExtras.k131":"左","pageExtras.k132":"右","pageExtras.k133":"格间距与列数","pageExtras.k134":"横向间距","pageExtras.k135":"纵向间距","pageExtras.k136":"列数","panels.k137":"展开素材台","panels.k138":"元素","panels.k139":"字段","panels.k140":"图层","panels.k141":"素材台","panels.k142":"收起素材台","panels.k143":"元素","panels.k144":"字段","panels.k145":"图层","panels.k146":"拖拽元素到画布","panels.k147":"业务字段","panels.k148":"搜索字段...","panels.k149":"搜索字段","panels.k150":"{v0} ({v1}) · 单击复制字段名 · 拖动中按住 Ctrl(Mac 为 ⌘)切换为插入字段名","panels.k151":"已复制","panels.k152":"暂无字段","panels.k153":"页眉","panels.k154":"页脚","panels.k155":"图层","panels.k156":"置顶","panels.k157":"上移","panels.k158":"下移","panels.k159":"置底","panels.k160":"组合 (Ctrl+G)","panels.k161":"取消组合 (Ctrl+Shift+G)","panels.k162":"页面 {v0}","panels.k163":"{v0}(双击重命名)","panels.k164":"双击重命名","panels.k165":"页面 {v0}","panels.k166":"拼版模板仅允许一个设计页面","panels.k167":"新增页面(在当前页后追加空白页)","panels.k168":"拼版模板仅允许一个设计页面","panels.k169":"复制当前页「{v0}」","panels.k170":"删除当前页「{v0}」","panels.k171":"仅多页面模板可删除页面","panels.k172":"前移「{v0}」","panels.k173":"后移「{v0}」","panels.k174":"横向","panels.k175":"纵向","panels.k176":"缩放 {v0}%","propertyPanel.k177":"全部","propertyPanel.k178":"外侧","propertyPanel.k179":"内部","propertyPanel.k180":"无","propertyPanel.k181":"上","propertyPanel.k182":"右","propertyPanel.k183":"下","propertyPanel.k184":"左","propertyPanel.k185":"位置与尺寸","propertyPanel.k186":"外边距 (mm)","propertyPanel.k187":"上","propertyPanel.k188":"右","propertyPanel.k189":"下","propertyPanel.k190":"左","propertyPanel.k191":"旋转 (°)","propertyPanel.k192":"逆时针 90°","propertyPanel.k193":"逆时针旋转 90 度","propertyPanel.k194":"顺时针 90°","propertyPanel.k195":"顺时针旋转 90 度","propertyPanel.k196":"外观","propertyPanel.k197":"字体","propertyPanel.k198":"默认","propertyPanel.k199":"字体大小","propertyPanel.k200":"字体粗细","propertyPanel.k201":"正常","propertyPanel.k202":"粗体","propertyPanel.k203":"更粗","propertyPanel.k204":"细体","propertyPanel.k205":"对齐","propertyPanel.k206":"左","propertyPanel.k207":"中","propertyPanel.k208":"右","propertyPanel.k209":"两端","propertyPanel.k210":"垂直对齐","propertyPanel.k211":"顶","propertyPanel.k212":"中","propertyPanel.k213":"底","propertyPanel.k214":"颜色","propertyPanel.k215":"字体颜色","propertyPanel.k216":"背景色","propertyPanel.k217":"背景颜色","propertyPanel.k218":"行高","propertyPanel.k219":"字间距","propertyPanel.k220":"文字溢出","propertyPanel.k221":"截断","propertyPanel.k222":"自动缩小","propertyPanel.k223":"自适应行高","propertyPanel.k224":"最小字号 (pt)","propertyPanel.k225":"默认 6","propertyPanel.k226":"首行缩进 (字符)","propertyPanel.k227":"默认 0","propertyPanel.k228":"自动换行","propertyPanel.k229":"保留换行符","propertyPanel.k230":"缩放模式","propertyPanel.k231":"裁剪锚点","propertyPanel.k232":"当前元素不支持外观设置","propertyPanel.k233":"条码设置","propertyPanel.k234":"码制","propertyPanel.k235":"CODE128(通用)","propertyPanel.k236":"EAN13(商品码)","propertyPanel.k237":"打印机分辨率","propertyPanel.k238":"不指定(按条宽渲染)","propertyPanel.k239":"203 dpi(8 点/mm)","propertyPanel.k240":"300 dpi(11.8 点/mm)","propertyPanel.k241":"600 dpi(23.6 点/mm)","propertyPanel.k242":"填写后条宽吸附到整数打印点(消除出纸「条宽忽宽忽窄」):条码先按条宽渲染,可用宽度够就原样落纸,不够才整体等比缩小","propertyPanel.k243":"条宽(倍率)","propertyPanel.k244":"已设置打印机分辨率:条宽会被吸附到最近的整数打印点(DPI 优先于毫米值),元素框放不下时整体等比缩小","propertyPanel.k245":"热敏/针式打印建议 3 及以上:决定条码的落纸尺寸,条越粗出纸后条宽越稳定","propertyPanel.k246":"静区 (模块)","propertyPanel.k247":"默认 10","propertyPanel.k248":"条高 (mm)","propertyPanel.k249":"默认 30 模块","propertyPanel.k250":"显示文本","propertyPanel.k251":"文本字号(相对条高,条高为 30)","propertyPanel.k252":"默认 10","propertyPanel.k253":"纠错级别","propertyPanel.k254":"L(最低,容量大)","propertyPanel.k255":"M(推荐)","propertyPanel.k256":"H(最高)","propertyPanel.k257":"静区 (模块)","propertyPanel.k258":"默认 0","propertyPanel.k259":"自定义设置","propertyPanel.k260":"条码尺寸由「条宽」与「打印机分辨率」结算:宽度足够时按条宽原样落纸,不足时整体等比缩小;拉伸会把条宽变成非整数,故条形码不提供缩放模式,可用「最大宽高」限制上限。要放大条码:先加条宽倍率,再收窄静区(左右白边会换成条宽),必要时关掉显示文本以让出文本区高度","propertyPanel.k261":"缩放模式","propertyPanel.k262":"最大宽度 (mm)","propertyPanel.k263":"默认","propertyPanel.k264":"最大高度 (mm)","propertyPanel.k265":"默认","propertyPanel.k266":"流式列表","propertyPanel.k267":"布局模式","propertyPanel.k268":"固定高度","propertyPanel.k269":"动态分页","propertyPanel.k270":"上内边距 (mm)","propertyPanel.k271":"右内边距 (mm)","propertyPanel.k272":"下内边距 (mm)","propertyPanel.k273":"左内边距 (mm)","propertyPanel.k274":"每行列数","propertyPanel.k275":"行高 (mm)","propertyPanel.k276":"单元横向间距 (mm)","propertyPanel.k277":"内容过长时跨列","propertyPanel.k278":"最多跨几列","propertyPanel.k279":"按当前字号与框宽,{v0} 列偏挤(可放约 {v1} 列)。数值保持不变,出纸按 {v2} 列排。","propertyPanel.k280":"混合","propertyPanel.k281":"边框与背景","propertyPanel.k282":"线型","propertyPanel.k283":"边框宽度","propertyPanel.k284":"混合","propertyPanel.k285":"边框颜色","propertyPanel.k286":"边框颜色","propertyPanel.k287":"背景色","propertyPanel.k288":"背景颜色","propertyPanel.k289":"高级设置","propertyPanel.k290":"锁定","propertyPanel.k291":"每页重复","propertyPanel.k292":"每页固定","propertyPanel.k293":"层级","propertyPanel.k294":"删除元素","propertyPanel.k295":"高级设置说明","propertyPanel.k296":"高级设置说明","propertyPanel.k297":"其他","propertyPanel.k298":"纸张设置","propertyPanel.k299":"纸张尺寸","propertyPanel.k300":"自定义宽高","propertyPanel.k301":"纸宽 (mm)","propertyPanel.k302":"自定义宽高 (mm)","propertyPanel.k303":"纸张方向","propertyPanel.k304":"纵向","propertyPanel.k305":"横向","propertyPanel.k306":"切换即交换纸张长宽(设计稿内容随之铺在该尺寸上)","propertyPanel.k307":"内容旋转角度","propertyPanel.k308":"拼版时每个标签的内容按该角度旋转;90°/270° 时每格占位宽高互换,列数自动铺满新档位上限,行数按互换后重算;0° 为不旋转(默认)","propertyPanel.k309":"整页内容旋转对应角度出纸;90°/270° 时纸张长宽互换以贴合内容,内容不变形不裁切;0° 为不旋转(默认)","propertyPanel.k310":"页面背景色","propertyPanel.k311":"页面背景色","propertyPanel.k312":"页边距 (mm)","propertyPanel.k313":"上","propertyPanel.k314":"下","propertyPanel.k315":"左","propertyPanel.k316":"右","propertyPanel.k317":"页眉/页脚高度 (mm)","propertyPanel.k318":"页眉高度","propertyPanel.k319":"页脚高度","propertyPanel.k320":"展开属性台","propertyPanel.k321":"元素属性","propertyPanel.k322":"页面属性","propertyPanel.k323":"属性台","propertyPanel.k324":"收起属性台","propertyPanel.k325":"元素属性","propertyPanel.k326":"页面属性","propertyPanel.k327":"请在画布中选择一个元素","propertyPanel.k328":"自定义属性","propertySearch.k328":"搜索属性...","propertySearch.k329":"搜索属性","tableProps.k330":"多级表头作为一个结构整体重复,勾选后表头区所有行都会在每页顶部重复","tableProps.k331":"标题行","tableProps.k332":"数据行","tableProps.k333":"小计行(每页小计)","tableProps.k334":"汇总行","tableProps.k335":"CODE128(通用)","tableProps.k336":"EAN13(商品码)","tableProps.k337":"L(最低,容量大)","tableProps.k338":"M(推荐)","tableProps.k339":"H(最高)","tableProps.k340":"截断","tableProps.k341":"自动缩小","tableProps.k342":"自适应行高","tableProps.k343":"多选","tableProps.k344":"行属性","tableProps.k345":"行属性","tableProps.k346":"行类型","tableProps.k347":"行高 (mm)","tableProps.k348":"表头每页重复","tableProps.k349":"表格设置","tableProps.k350":"列表数据源字段","tableProps.k351":"默认字体","tableProps.k352":"默认","tableProps.k353":"默认字号 (pt)","tableProps.k354":"默认","tableProps.k355":"默认文字颜色","tableProps.k356":"默认文字颜色","tableProps.k357":"默认内边距 (mm)","tableProps.k358":"默认","tableProps.k359":"列宽 (mm)","tableProps.k360":"列{v0}","tableProps.k361":"表格总宽不能超过打印范围宽度 {v0}mm,列{v1} 已调整为 {v2}mm","tableProps.k362":"启用分页","tableProps.k363":"参与分页","tableProps.k364":"与下元素同页","tableProps.k365":"分页配置","tableProps.k366":"上","tableProps.k367":"右","tableProps.k368":"下","tableProps.k369":"左","tableProps.k370":"单元格","tableProps.k371":"单元格","tableProps.k372":"多选","tableProps.k373":"仅数据行(明细行)支持按值合并","tableProps.k374":"恢复默认值(跟随表格默认)","tableProps.k375":"单元格","tableProps.k376":"已选 {v0} 格 · 批量设置:不显示单格配置,改动会应用到全部选中格","tableProps.k377":"单元格类型","tableProps.k378":"文本","tableProps.k379":"条形码","tableProps.k380":"二维码","tableProps.k381":"图片","tableProps.k382":"码制","tableProps.k383":"显示文本","tableProps.k384":"条宽(倍率)","tableProps.k385":"已设置打印机分辨率:条宽会被吸附到最近的整数打印点(DPI 优先于毫米值),单元格放不下时整体等比缩小","tableProps.k386":"热敏/针式打印建议 3 及以上:决定条码的落纸尺寸,条越粗出纸后条宽越稳定","tableProps.k387":"静区 (模块)","tableProps.k388":"默认 10","tableProps.k389":"条高 (mm)","tableProps.k390":"默认 30 模块","tableProps.k391":"文本字号(相对条高,条高为 30)","tableProps.k392":"默认 10","tableProps.k393":"打印机分辨率","tableProps.k394":"不指定(按条宽渲染)","tableProps.k395":"203 dpi(8 点/mm)","tableProps.k396":"300 dpi(11.8 点/mm)","tableProps.k397":"600 dpi(23.6 点/mm)","tableProps.k398":"填写后条宽吸附到整数打印点(消除出纸「条宽忽宽忽窄」):条码先按条宽渲染,可用宽度够就原样落纸,不够才整体等比缩小","tableProps.k399":"纠错级别","tableProps.k400":"静区 (模块)","tableProps.k401":"默认 0","tableProps.k402":"单元格条码尺寸由「条宽」与「打印机分辨率」结算:可用宽度足够时按条宽原样落纸,不足时整体等比缩小;拉伸会把条宽变成非整数,故条形码不提供缩放模式,可用「最大宽高」限制上限。要放大条码:先加条宽倍率,再收窄静区(左右白边会换成条宽),必要时关掉显示文本以让出文本区高度","tableProps.k403":"缩放模式","tableProps.k404":"裁剪锚点","tableProps.k405":"最大宽度 (mm)","tableProps.k406":"默认","tableProps.k407":"最大高度 (mm)","tableProps.k408":"默认","tableProps.k409":"内容","tableProps.k410":"多选(输入后覆盖全部选中格)","tableProps.k411":"输入内容,支持 {字段} 表达式","tableProps.k412":"水平对齐","tableProps.k413":"左","tableProps.k414":"中","tableProps.k415":"右","tableProps.k416":"两端","tableProps.k417":"垂直对齐","tableProps.k418":"上","tableProps.k419":"中","tableProps.k420":"下","tableProps.k421":"字体","tableProps.k422":"继承默认","tableProps.k423":"字号 (pt)","tableProps.k424":"默认","tableProps.k425":"加粗","tableProps.k426":"文字颜色","tableProps.k427":"文字颜色","tableProps.k428":"背景色","tableProps.k429":"背景颜色","tableProps.k430":"边框","tableProps.k431":"混合","tableProps.k432":"多选","tableProps.k433":"混合","tableProps.k434":"边框颜色","tableProps.k435":"全部","tableProps.k436":"外侧","tableProps.k437":"内部","tableProps.k438":"无","tableProps.k439":"内边距 (mm)","tableProps.k440":"默认","tableProps.k441":"自动换行","tableProps.k442":"文字溢出","tableProps.k443":"最小字号 (pt)","tableProps.k444":"默认 6","tableProps.k445":"单元格合并","tableProps.k446":"合并单元格","tableProps.k447":"拆分单元格","tableProps.k448":"按值合并","tableProps.k449":"明细相邻行同值时自动纵向合并;跨页时在该页内成段,续页首行重放该值","table.k450":"题","table.k451":"数","table.k452":"小","table.k453":"汇","table.k454":"标题行","table.k455":"数据行","table.k456":"小计行","table.k457":"汇总行","table.k458":"条码","table.k459":"图片","table.k460":"插入后表格总宽 {v0}mm 超过打印范围宽度 {v1}mm,请先缩小列宽","table.k461":"未指定行类型","table.k462":"未选择单元格","table.k463":"仅数据行(明细行)支持按值合并","table.k464":"未选择单元格","table.k465":"行类型仅支持单行设置","table.k466":"未选择单元格","table.k467":"在上方插入行","table.k468":"在下方插入行","table.k469":"删除行","table.k470":"在左侧插入列","table.k471":"在右侧插入列","table.k472":"删除列","table.k473":"合并单元格","table.k474":"拆分单元格","table.k475":"按值合并","table.k476":"行类型","table.k477":"列宽手柄{v0}","toolbarOverflow.k478":"剪贴板","toolbarOverflow.k479":"格式刷","toolbarOverflow.k480":"缩放","toolbarOverflow.k481":"排列 / 视图","toolbarOverflow.k482":"边框","toolbarOverflow.k483":"颜色","toolbarOverflow.k484":"对齐","toolbarOverflow.k485":"文字样式","toolbarOverflow.k486":"字体与字号","toolbarOverflow.k487":"更多","toolbarOverflow.k488":'{v0}<span class="tb-btn-text">更多</span>{v1}',"toolbar.k489":"编辑模板","toolbar.k490":"新建模板","toolbar.k491":"对齐 / 分布","toolbar.k492":"左对齐","toolbar.k493":"右对齐","toolbar.k494":"顶对齐","toolbar.k495":"底对齐","toolbar.k496":"水平居中","toolbar.k497":"垂直居中","toolbar.k498":"水平分布","toolbar.k499":"垂直分布","toolbar.k500":"层级","toolbar.k501":"置顶","toolbar.k502":"上移一层","toolbar.k503":"下移一层","toolbar.k504":"置底","toolbar.k505":"组合","toolbar.k506":"组合 (Ctrl+G)","toolbar.k507":"取消组合 (Ctrl+Shift+G)","toolbar.k508":"标尺","toolbar.k509":"显示/隐藏标尺","toolbar.k510":"网格","toolbar.k511":"显示/隐藏网格背景","toolbar.k512":"虚框","toolbar.k513":"显示/隐藏无边框表格的虚拟虚线","toolbar.k514":"吸附","toolbar.k515":"开启/关闭元素吸附到网格","toolbar.k516":"打印模板设计器","toolbar.k517":"撤销","toolbar.k518":"重做","toolbar.k519":"排列","toolbar.k520":"排列","toolbar.k521":"视图","toolbar.k522":"视图","toolbar.k523":"适应窗口","toolbar.k524":"缩小","toolbar.k525":"放大","toolbar.k526":"复制 (Ctrl+C),需选中元素","toolbar.k527":"复制 (Ctrl+C)","toolbar.k528":"粘贴 (Ctrl+V),需选中元素","toolbar.k529":"粘贴 (Ctrl+V),剪贴板为空","toolbar.k530":"粘贴 (Ctrl+V)","toolbar.k531":"删除 (Delete),需选中元素","toolbar.k532":"删除 (Delete)","toolbar.k533":"帮助文档","toolbar.k534":"预览模板打印效果","toolbar.k535":"预览","toolbar.k536":"保存模板","toolbar.k537":"保存","watermark.k538":"水印","watermark.k539":"水印表达式","watermark.k540":"直接输入文字,或用表达式:{order.no}、{printDate}","watermark.k541":"双击或点「编辑表达式」打开表达式弹框","watermark.k542":"编辑表达式","watermark.k543":"测试值","watermark.k544":"表达式取不到值时预览显示","watermark.k545":"旋转角度","watermark.k546":"颜色","watermark.k547":"水印颜色","watermark.k548":"透明度","watermark.k549":"密度","watermark.k550":"自定义","watermark.k551":"瓦片宽","watermark.k552":"瓦片高","elementDefinitions.k553":"文本","elementDefinitions.k554":"条形码","elementDefinitions.k555":"二维码","elementDefinitions.k556":"图片","elementDefinitions.k557":"表格","elementDefinitions.k558":"长文","elementDefinitions.k559":"流式列表","elementDefinitions.k560":"横线","elementDefinitions.k561":"竖线","elementDefinitions.k562":"矩形","elementDefinitions.k563":"椭圆","elementDefinitions.k564":"页码","elementDefinitions.k565":"registerElementDefinition: type 必须是非空字符串","elementDefinitions.k566":"registerElementDefinition: label 必须是非空字符串","elementDefinitions.k567":"registerElementRenderer: 需要 type 与渲染函数","panels.paperRotated":"(旋转{rot}°)","panels.statusElements":"元素 {count}{selected}","panels.statusSelected":" (选中 {n})"},d2={"expression.tabField":"📁 字段","expression.tabVariable":"🔧 变量","expression.tabFunction":"⚡ 函数","expression.placeholderField":"搜索字段...","expression.placeholderVariable":"搜索变量...","expression.placeholderFunction":"搜索函数...","expression.fnSum":"求和","expression.fnAvg":"平均值","expression.fnCount":"计数","expression.fnMin":"最小值","expression.fnMax":"最大值","expression.fnAdd":"相加","expression.fnSub":"相减","expression.fnMul":"相乘","expression.fnDiv":"相除","expression.fnRound":"四舍五入","expression.fnRoundUp":"进一法","expression.fnRoundDown":"去尾法","expression.fnRoundBank":"四舍六入五成双","expression.fnMoney":"金额格式化","expression.fnDate":"日期格式化","expression.fnUpper":"大写金额","expression.fnIf":"条件判断","expression.varPageIndex":"当前页码","expression.varTotalPages":"总页数","expression.varPrintDate":"打印日期","expression.varPrintTime":"打印时间","expression.groupAggregate":"聚合函数","expression.groupMath":"数值运算","expression.groupFormat":"格式化函数","expression.previewEmpty":"(输入表达式后预览)","expression.previewNoValue":"(无法计算)","expression.previewError":"(表达式错误)","expression.k1":"帮助信息","expression.k2":"输入方式","expression.k3":"双击左侧字段、变量、函数即可插入到表达式输入框中","expression.k4":"双击途中按住 Ctrl(Mac 为 ⌘)切换为插入字段名称,当静态文本用","expression.k5":"静态数据直接输入即可,如:供应商名称","expression.k6":"动态解析字段、变量、函数必须用 {} 包裹","expression.k7":"示例:{SUM(supplier.name)}","expression.k8":"中文 key 直接写 {字段名},如 {姓名}、{supplier.名称}","expression.k9":"注意:只能嵌套一层","expression.k10":"函数使用","expression.k11":"SUM(字段) - 求和","expression.k12":"AVG(字段) - 平均值","expression.k13":"COUNT(字段) - 计数","expression.k14":"IF(条件, 真值, 假值) - 条件判断","expression.k15":"四则运算:{qty * price}、{ADD(qty, 1)}","expression.k16":"修约:ROUND 四舍五入 / ROUNDUP 进一 / ROUNDDOWN 去尾 / ROUNDBANK 四舍六入五成双","expression.k17":"系统变量","expression.k18":"{pageIndex} - 当前页码","expression.k19":"{totalPages} - 总页数","expression.k20":"{printDate} - 打印日期","expression.k21":"示例","expression.k22":"静态文本:供应商名称","expression.k23":"动态字段:{supplier.name}","expression.k24":"函数调用:{SUM(amount)}","expression.k25":'条件判断:{IF(amount>1000, "大单", "小单")}',"expression.k26":"运算并修约:{ROUND(qty * price, 2)}","expression.k27":"暂无字段","expression.k28":"已复制","expression.k29":"类型","expression.k30":"表达式编辑","expression.k31":"双击左侧字段/变量/函数插入,双击途中按住 Ctrl(Mac 为 ⌘)切换为插入字段名,或直接输入静态内容","expression.k32":"预览结果","expression.k33":"编辑表达式","expression.k34":"关闭","expression.k35":"取消","expression.k36":"确定"},c2={"toolbar.save":"保存","toolbar.preview":"预览","diagnostic.expressionUnexpectedEnd":"表达式意外结束","diagnostic.parser.trailingContent":"表达式存在多余内容: {value}","diagnostic.parser.expected":'位置 {pos}: 期望 "{value}"',"diagnostic.parser.memberName":"位置 {pos}: 成员访问需要属性名","diagnostic.parser.invalidNumber":"非法数字: {value}","diagnostic.parser.objectKey":"位置 {pos}: 对象键必须是标识符或字符串","diagnostic.parser.unexpectedToken":"位置 {pos}: 意外的符号: {value}","diagnostic.lexer.unterminatedString":"字符串未闭合","diagnostic.lexer.keyword":"不允许使用关键字: {word}","diagnostic.lexer.forbidden":"禁止访问: {word}","diagnostic.lexer.noFunctionDef":"不允许函数定义","diagnostic.lexer.noAssignment":"不允许赋值","diagnostic.lexer.noMultipleStatements":"不允许多条语句","diagnostic.lexer.invalidChar":"非法字符: {ch}","diagnostic.evaluator.undefinedIdentifier":"未定义的标识符: {name}","diagnostic.evaluator.unknownOperator":"未知运算符: {op}","diagnostic.evaluator.unknownUnaryOperator":"未知一元运算符: {op}","diagnostic.evaluator.nullProperty":"无法访问空值的属性","diagnostic.evaluator.forbiddenProperty":"禁止访问属性: {property}","diagnostic.evaluator.mathNotMethod":"Math.{name} 不是方法","diagnostic.evaluator.noMethodCall":"不支持方法调用,请使用顶级函数","diagnostic.evaluator.notFunction":"{name} 不是函数","diagnostic.evaluator.forbiddenCall":"不允许调用: {name}","diagnostic.template.unclosedBrace":"位置 {pos}: 花括号未闭合","diagnostic.template.emptyExpression":"位置 {pos}: 空表达式","diagnostic.pagination.insufficientHeight":"页面可用高度不足: paper={paper}mm, margins={margins}mm, header={header}mm, footer={footer}mm","diagnostic.pagination.repeatHeaderOverflow":"表格 {id} 的重复表头高度 ({repeat}mm) 超过页面可用高度 ({avail}mm),请减少重复表头行","diagnostic.tiling.continuousUnsupported":"连续纸不支持拼版打印,请将模板纸张改为固定纸张或关闭拼版","diagnostic.tiling.sheetContinuous":"拼版目标纸张不能是连续纸","diagnostic.tiling.sheetSizeInvalid":"拼版自定义纸张宽高必须是大于 0 的数值(mm)","diagnostic.tiling.columnsInvalid":"拼版列数必须是大于 0 的整数","diagnostic.tiling.rotationNote":"(内容旋转 {angle}°,每格 {width}×{height}mm)","diagnostic.tiling.columnsExceedWidth":"拼版列数 {columns} 超出纸面可用宽度:{sheet}mm − 左右留白 {margin}mm = {avail}mm,最多可放 {max} 列;当前 {columns} 列 {label}mm 标签含间距需要 {need}mm{rotation}","diagnostic.tiling.labelHeightExceed":"标签高度 {height}mm 超出纸面可用高度 {avail}mm,拼版每张 0 行;请缩小标签高度或改用横向纸{rotation}","diagnostic.multiTemplate.emptyPages":"多页面模板至少需要一页","diagnostic.multiTemplate.continuous":"多页面模板不支持连续纸({page})","diagnostic.multiTemplate.tiling":"多页面模板不支持标签拼版({page})","diagnostic.multiTemplate.paperMismatch":"多页面模板各页纸张尺寸必须一致({page} {width}×{height}mm 与首页 {firstWidth}×{firstHeight}mm 不同)","diagnostic.multiTemplate.emptyData":"多页面模板至少需要一份数据","diagnostic.multiTemplate.pageLabelNamed":"第 {index} 页「{name}」","diagnostic.multiTemplate.pageLabelPlain":"第 {index} 页","client.cancelled":"连接已取消","client.invalidToken":"配对 token 无效或来源未授权","client.notRunning":"未发现运行中的打印客户端(已探测默认端口区间),请确认客户端已启动","client.notConnected":"打印客户端未连接","client.timeout":"请求 {type} 超时未响应","client.closed":"连接已关闭","client.disconnected":"与客户端的连接中断","client.unregisteredHandler":"桌面端请求未注册处理器","client.internalError":"内部错误","table.atLeastTwoCells":"至少选择 2 个单元格","table.crossRowTypes":"合并区域不能跨越不同类型的行","table.dataVerticalMerge":"数据行将按列表展开,纵向合并请使用单元格属性「按值合并」","table.partialOverlap":"选区与已有合并区域部分重叠","table.lastRow":"不能删除最后一行","table.lastColumn":"不能删除最后一列","table.dataRowExists":"数据行已存在(第 {row} 行),全表最多一行","table.headerContinuous":"标题行必须从表格顶部连续设置","table.subtotalAfterData":"请先设置数据行,小计/汇总行必须位于数据行之后","table.subtotalBeforeData":"小计/汇总行必须位于数据行之后","table.subtotalBeforeSummary":"小计行必须位于汇总行之前","table.summaryAfterSubtotal":"汇总行必须位于小计行之后","table.headerBreak":"取消该标题行会导致标题行不连续,请先调整后续标题行","table.defaultHeader":"列{index}","table.borderHint":"线型 / 宽度 / 颜色是待应用规格:选中格已有的边框规格一致时会填进这三行;四边不一致的项显示「混合」,一条边都没有时显示「无 / 0」。改完点「全部 / 外侧 / 内部」或勾选上、下、左、右某条边才会写入选中的单元格;「无」是清除边框","table.borderHintMulti":"多选时不回显单格边框:线型 / 宽度 / 颜色按当前设置作为批写规格,点「全部 / 外侧 / 内部」或勾选某条边后写入所有选中格;「无」是清除边框","table.borderHintMixed":"当前单元格四边边框规格不一致:带「混合」的项不谎报,未改项在点「全部 / 外侧 / 内部」或勾选单边时按缺省档(实线 0.75pt)写入,改任一项即按该值批写","diagnostic.pagination.overflowTop":"元素 {id} 旋转 {rot}° 后顶部超出页首 {amount}mm,打印将被裁切","diagnostic.pagination.overflowRight":"元素 {id} 超出纸面右侧 {amount}mm,打印将被裁切","diagnostic.pagination.overflowLeft":"元素 {id} 超出纸面左侧 {amount}mm,打印将被裁切","crop.sampleNote":"图片还没设置,上面按内置示例图演示取位;换上真图后档位与可挪量按真图重算","crop.verticalPosition":"垂直位置 (%)","crop.horizontalPosition":"水平位置 (%)","crop.scaleLabel":"放大比例 (%)","crop.originalValue":"已保留模板里的原值;改动下面任一项就整体替换成新的取位","crop.movableBoth":"水平可挪 {x}mm、垂直可挪 {y}mm:0 贴左/贴顶,100 贴右/贴底","crop.movableX":"水平可挪 {x}mm;垂直这一轴已贴满,挪不动","crop.movableY":"垂直可挪 {y}mm;水平这一轴已贴满,挪不动","crop.noRoom":"这个缩放下图与框正好一样大,两轴都没有可挪的余量","crop.top":"顶部","crop.center":"居中","crop.bottom":"底部","crop.left":"左侧","crop.right":"右侧","crop.topLeft":"左上","crop.topCenter":"上中","crop.topRight":"右上","crop.middleLeft":"左中","crop.middleRight":"右中","crop.bottomLeft":"左下","crop.bottomCenter":"下中","crop.bottomRight":"右下","crop.fitContain":"包含(保持比例)","crop.fitCover":"剪裁(等比铺满后裁边)","crop.fitFill":"拉伸填满","crop.fitNone":"原始尺寸","crop.fitScaleDown":"缩小(保持比例)","barcode.recommendOk":"按 {dpi}dpi 推荐条宽倍率 {rec}(每模块 {recDots} 个打印点 = {width}mm,取达到 {min}mm 下限的最小档);当前倍率 {current} 折算为 {curDots} 点 / {curWidth}mm,已达标。这里只提示,不会替你改值","barcode.recommendLow":"按 {dpi}dpi 推荐条宽倍率 {rec}(每模块 {recDots} 个打印点 = {width}mm,取达到 {min}mm 下限的最小档);当前倍率 {current} 只有 {curDots} 点 / {curWidth}mm,低于下限。这里只提示,不会替你改值","code.rotateNote":"条码与二维码仅支持 90° 步进;任意角度需 385dpi 以上打印头","colorPicker.pickColor":"颜色选择","colorPicker.hexValue":"颜色值","colorPicker.customColor":"自定义颜色","colorPicker.hue":"色相","colorPicker.commonColors":"常用颜色","colorPicker.clear":"清除选中的颜色","colorPicker.clearShort":"清除","save.geometryWarningConfirm":`出纸提示:部分内容超出纸面,打印时会被裁切。
281
+ `);const N=P(A,R,I),F=e.getSymbolSize(A),H=new o(F);return f(H,A),h(H),b(H,A),v(H,R,0),A>=7&&k(H,A),w(H,N),isNaN(_)&&(_=a.getBestMask(H,v.bind(null,H,R))),a.applyMask(_,H),v(H,R,_),{modules:H,version:A,errorCorrectionLevel:R,maskPattern:_,segments:I}}return Vs.create=function(A,R){if(typeof A>"u"||A==="")throw new Error("No input text");let _=t.M,I,S;return typeof R<"u"&&(_=t.from(R.errorCorrectionLevel,t.M),I=l.from(R.version),S=a.from(R.maskPattern),R.toSJISFunc&&e.setToSJISFunction(R.toSJISFunc)),D(A,I,_,S)},Vs}var ul={},fl={},mh;function gh(){return mh||(mh=1,(function(e){function t(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let o=r.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+r);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(i){return[i,i]}))),o.length===6&&o.push("F","F");const n=parseInt(o.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+o.slice(0,6).join("")}}e.getOptions=function(o){o||(o={}),o.color||(o.color={});const n=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,i=o.width&&o.width>=21?o.width:void 0,a=o.scale||4;return{width:i,scale:i?4:a,margin:n,color:{dark:t(o.color.dark||"#000000ff"),light:t(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},e.getScale=function(o,n){return n.width&&n.width>=o+n.margin*2?n.width/(o+n.margin*2):n.scale},e.getImageWidth=function(o,n){const i=e.getScale(o,n);return Math.floor((o+n.margin*2)*i)},e.qrToImageData=function(o,n,i){const a=n.modules.size,s=n.modules.data,p=e.getScale(a,i),l=Math.floor((a+i.margin*2)*p),d=i.margin*p,u=[i.color.light,i.color.dark];for(let c=0;c<l;c++)for(let f=0;f<l;f++){let h=(c*l+f)*4,b=i.color.light;if(c>=d&&f>=d&&c<l-d&&f<l-d){const k=Math.floor((c-d)/p),v=Math.floor((f-d)/p);b=u[s[k*a+v]?1:0]}o[h++]=b.r,o[h++]=b.g,o[h++]=b.b,o[h]=b.a}}})(fl)),fl}var bh;function $v(){return bh||(bh=1,(function(e){const t=gh();function r(n,i,a){n.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=a,i.width=a,i.style.height=a+"px",i.style.width=a+"px"}function o(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(i,a,s){let p=s,l=a;typeof p>"u"&&(!a||!a.getContext)&&(p=a,a=void 0),a||(l=o()),p=t.getOptions(p);const d=t.getImageWidth(i.modules.size,p),u=l.getContext("2d"),c=u.createImageData(d,d);return t.qrToImageData(c.data,i,p),r(u,l,d),u.putImageData(c,0,0),l},e.renderToDataURL=function(i,a,s){let p=s;typeof p>"u"&&(!a||!a.getContext)&&(p=a,a=void 0),p||(p={});const l=e.render(i,a,p),d=p.type||"image/png",u=p.rendererOpts||{};return l.toDataURL(d,u.quality)}})(ul)),ul}var hl={},kh;function zv(){if(kh)return hl;kh=1;const e=gh();function t(n,i){const a=n.a/255,s=i+'="'+n.hex+'"';return a<1?s+" "+i+'-opacity="'+a.toFixed(2).slice(1)+'"':s}function r(n,i,a){let s=n+i;return typeof a<"u"&&(s+=" "+a),s}function o(n,i,a){let s="",p=0,l=!1,d=0;for(let u=0;u<n.length;u++){const c=Math.floor(u%i),f=Math.floor(u/i);!c&&!l&&(l=!0),n[u]?(d++,u>0&&c>0&&n[u-1]||(s+=l?r("M",c+a,.5+f+a):r("m",p,0),p=0,l=!1),c+1<i&&n[u+1]||(s+=r("h",d),d=0)):p++}return s}return hl.render=function(i,a,s){const p=e.getOptions(a),l=i.modules.size,d=i.modules.data,u=l+p.margin*2,c=p.color.light.a?"<path "+t(p.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",f="<path "+t(p.color.dark,"stroke")+' d="'+o(d,l,p.margin)+'"/>',h='viewBox="0 0 '+u+" "+u+'"',k='<svg xmlns="http://www.w3.org/2000/svg" '+(p.width?'width="'+p.width+'" height="'+p.width+'" ':"")+h+' shape-rendering="crispEdges">'+c+f+`</svg>
282
+ `;return typeof s=="function"&&s(null,k),k},hl}var yh;function Hv(){if(yh)return ao;yh=1;const e=wv(),t=Fv(),r=$v(),o=zv();function n(i,a,s,p,l){const d=[].slice.call(arguments,1),u=d.length,c=typeof d[u-1]=="function";if(!c&&!e())throw new Error("Callback required as last argument");if(c){if(u<2)throw new Error("Too few arguments provided");u===2?(l=s,s=a,a=p=void 0):u===3&&(a.getContext&&typeof l>"u"?(l=p,p=void 0):(l=p,p=s,s=a,a=void 0))}else{if(u<1)throw new Error("Too few arguments provided");return u===1?(s=a,a=p=void 0):u===2&&!a.getContext&&(p=s,s=a,a=void 0),new Promise(function(f,h){try{const b=t.create(s,p);f(i(b,a,p))}catch(b){h(b)}})}try{const f=t.create(s,p);l(null,i(f,a,p))}catch(f){l(f)}}return ao.create=t.create,ao.toCanvas=n.bind(null,r.render),ao.toDataURL=n.bind(null,r.renderToDataURL),ao.toString=n.bind(null,function(i,a,s){return o.render(i,s)}),ao}var Uv=Hv();const qv=Ou(Uv),vh="http://www.w3.org/2000/svg";function jv(e){const t=e.getAttribute("viewBox");if(!t)return null;const r=t.trim().split(/[\s,]+/).map(Number);return r.length!==4||r.some(o=>!Number.isFinite(o))?null:{width:r[2],height:r[3]}}function Wv(e,t){const r=document.createElementNS(vh,"svg"),o=Do(t.barWidth),n=qa(t.barQuietZone),i=s=>{js(r,e,{format:t.barcodeType||"CODE128",width:o,height:s*o,displayValue:t.showText!==!1,fontSize:(t.fontSize??Nn)*o,margin:0,marginLeft:n*o,marginRight:n*o,marginTop:0,marginBottom:ja*o});const p=jv(r);return p?{widthUnits:p.width,heightUnits:p.height}:null},a=Va({barHeightMm:t.barHeightMm,boxWidthMm:t.targetWidthMm??0,boxHeightMm:t.targetHeightMm??0,dpi:t.printerDpi,barWidth:t.barWidth,measure:i});return a.size&&(r.setAttribute("width",`${a.size.widthMm}mm`),r.setAttribute("height",`${a.size.heightMm}mm`)),r.setAttribute("shape-rendering","crispEdges"),r.outerHTML}function Vv(e){return typeof e=="number"&&Number.isFinite(e)?Math.max(0,Math.floor(e)):Sd}function Gv(e,t){const r=(t.qrCodeLevel??"M").toUpperCase(),n=qv.create(e,{errorCorrectionLevel:["L","M","Q","H"].includes(r)?r:"M"}).modules,i=n.size,a=4,s=Vv(t.qrQuietZone)*a,p=i*a+s*2;let l="";for(let d=0;d<i;d++)for(let u=0;u<i;u++)n.get(u,d)&&(l+=`<rect x="${s+u*a}" y="${s+d*a}" width="${a}" height="${a}" fill="#000"/>`);return`<svg xmlns="${vh}" viewBox="0 0 ${p} ${p}" width="${p}" height="${p}" shape-rendering="crispEdges">${l}</svg>`}function wh(e,t,r={}){if(!e)throw new Error("empty barcode value");return t==="qrcode"?Gv(e,r):Wv(e,r)}const ml={render(e,t,r={}){return wh(e,t,r)}},gl=.5,Kv=12;function bl(e,t){const r=e.getAttribute(t);if(r===null||r==="")return;const o=Number(r);return Number.isFinite(o)?o:void 0}function xh(e,t){if(e.scrollWidth>e.clientWidth+gl)return!0;const r=e.scrollHeight;return t!==void 0?r>t+gl:r>e.clientHeight+gl}function Ph(e){if(e.getAttribute("data-fit")!=="shrink")return;const t=Mo(bl(e,"data-fit-min")),r=Math.max(bl(e,"data-fit-base")??t,t),o=bl(e,"data-fit-mm"),n=o!==void 0&&o>0?vr(o):void 0,i=l=>{const d=Wb(l);return e.style.fontSize=`${d}pt`,e.setAttribute("data-fit-size",String(d)),d},a=i(r);if(!xh(e,n)||r<=t)return a;let s=t,p=r;for(let l=0;l<Kv;l++){const d=(s+p)/2;i(d),xh(e,n)?p=d:s=d}return i(s)}function Yv(e){const t=[];return e.querySelectorAll('[data-fit="shrink"]').forEach(r=>{const o=Ph(r),n=r.getAttribute("data-fit-key");o===void 0||!n||t.push({key:n,fontSizePt:o})}),t}const Xv="2",Zv=5e3;async function Jv(e,t=Zv){const r=e.document,o=i=>Promise.race([i,new Promise(a=>setTimeout(a,t))]),n=(async()=>{r.readyState!=="complete"&&await o(new Promise(a=>e.addEventListener("load",()=>a(),{once:!0})));const i=r.fonts;i&&(await o(Promise.all(Qv(r).map(a=>i.load(`${a.style} ${a.weight} 16px "${a.family}"`).catch(()=>{})))),i.ready&&await o(i.ready)),await o(Promise.all(Array.from(r.images??[]).map(a=>a.complete?Promise.resolve():new Promise(s=>{a.addEventListener("load",()=>s(),{once:!0}),a.addEventListener("error",()=>s(),{once:!0})}))))})();await o(n)}function Qv(e){const t=[];for(const o of Array.from(e.styleSheets??[])){let n;try{n=o.cssRules}catch{continue}for(const i of Array.from(n??[])){if(i.type!==5)continue;const a=i.style,s=(a.getPropertyValue("font-family")||"").replace(/^["']|["']$/g,"");s&&t.push({family:s,weight:a.getPropertyValue("font-weight")||"400",style:a.getPropertyValue("font-style")||"normal"})}}return t}function e2(e){const t=[];return e.querySelectorAll("[data-measure-id]").forEach(r=>{const o=r,n=o.getAttribute("data-measure-id");if(!n)return;const i=o.getBoundingClientRect().height,a=o.querySelector("table.print-table");if(!a){const p=o.querySelectorAll(".print-flow-row[data-flow-row-index]");if(p.length>0){const l=[];p.forEach(d=>l.push(d.getBoundingClientRect().height)),t.push({id:n,heightPx:i,rowHeightsPx:l});return}t.push({id:n,heightPx:i});return}const s=[];a.querySelectorAll("tbody > tr[data-row-index]").forEach(p=>{s.push(p.getBoundingClientRect().height)}),t.push({id:n,heightPx:i,rowHeightsPx:s})}),t}function t2(e){const t=e.querySelector(".print-page"),r=e.querySelector(".content-area");if(!t||!r)return 0;const o=t.getBoundingClientRect().top;let n=0;r.querySelectorAll("*").forEach(a=>{if(a.classList.contains("print-element"))return;const s=a.getBoundingClientRect();s.height>0&&(n=Math.max(n,s.bottom-o))}),r.querySelectorAll(".print-element").forEach(a=>{const s=a.getBoundingClientRect(),p=Number.parseFloat(e.defaultView?.getComputedStyle(a).marginBottom??"0")||0;s.height>0&&(n=Math.max(n,s.bottom-o+p))});const i=r.getBoundingClientRect();return i.height>0&&(n=Math.max(n,i.bottom-o)),n}function r2(e,t=0){const o=e.querySelectorAll(".print-page")[t];if(!o)return[];const n=o.getBoundingClientRect(),i=e.defaultView?.getComputedStyle(o),a=Number.parseFloat(i?.paddingLeft??"0")||0,s=Number.parseFloat(i?.paddingTop??"0")||0,p=[];return o.querySelectorAll("[data-element-id]").forEach(l=>{if(l.querySelector("[data-element-id]"))return;const d=l.getAttribute("data-element-id");if(!d)return;const u=l.getBoundingClientRect(),c=o2(l,n,a,s);p.push({id:d,left:u.left-c.left,top:u.top-c.top,width:u.width,height:u.height,zone:c.zone})}),p}function o2(e,t,r,o){const n=(p,l)=>{const d=p.getBoundingClientRect();return{left:d.left,top:d.top,zone:l}},i=e.closest(".page-header");if(i)return n(i,"header");const a=e.closest(".page-footer");if(a)return n(a,"footer");const s=e.closest(".content-area");return s?n(s,"content"):{left:t.left+r,top:t.top+o,zone:"content"}}function n2(e){const t={};for(const r of e)try{t[r.key]=wh(r.value,r.cellType,r.opts)}catch{}return t}const i2={version:Xv,waitReady:Jv,readMeasurements:e2,readContentBottom:t2,readElementRects:r2,renderCodes:n2,applyTextFit:Yv};function a2(){return{async createDriver(){const e=document.createElement("iframe");e.setAttribute("aria-hidden","true"),e.style.cssText="position:fixed;left:-10000px;top:0;border:0;visibility:hidden;pointer-events:none;",document.body.appendChild(e);let t=e.contentDocument??document;return{requiresExecutor:!1,async open(r){e.style.width=`${r.width}px`,e.style.height=`${r.height}px`,t=e.contentDocument??document},async setContent(r){t=e.contentDocument??document,t.open(),t.write(r),t.close()},async injectExecutor(r){},async evaluate(r,o){const n=i2[r];if(typeof n!="function"){const l=(e.contentWindow?.__wormDom??globalThis.__wormDom)?.[r];if(typeof l!="function")throw new Error(`执行器方法 ${r} 未注入`);return l(...o??[])}const i=o??[],a=Gk[r],s=n;return a==="window"?s(e.contentWindow,...i):a==="document"?s(t,...i):s(...i)},async close(){e.remove()}}}}}function s2(){return Xk(a2())}async function l2(e,t,r,o,n){const i=await sy({templateJson:e,printData:t,baseUrl:r,fontBaseUrl:n?.fontBaseUrl??"",paperHeightMm:n?.paperHeightMm,codeRenderer:o,renderers:n?.renderers},s2());return{html:i.html,pageCount:i.pageCount,pageLayouts:i.pageLayouts,paperMm:i.paperMm,pagePaperMm:i.pagePaperMm,continuous:i.continuous,copies:i.copies,copyPaperMm:i.copyPaperMm}}var p2={"binding.k1":"上传图片","binding.k2":"仅支持上传图片文件","binding.k3":"图片上传能力未配置","binding.k4":"上传中...","binding.k5":"图片上传失败","binding.k6":"图片上传失败","binding.k7":"上传图片","binding.k8":"支持 jpg/png/gif/bmp/webp/svg 等图片,上传后填入相对路径","binding.k9":"内容","binding.k10":"输入内容,支持 {字段} 表达式","canvas.k11":"页眉","canvas.k12":"页脚","canvas.k13":"+ 元素","canvas.k14":"+ 静态文本","canvas.k15":"+ 取值字段","canvas.k16":"复制","canvas.k17":"剪切","canvas.k18":"粘贴","canvas.k19":"删除","canvas.k20":"置顶","canvas.k21":"上移","canvas.k22":"下移","canvas.k23":"置底","canvas.k24":"粘贴","canvas.k25":"全选","canvas.k26":"取消选择","code.k27":"二维码","controls.k28":"减小","controls.k29":"减小","controls.k30":"增大","controls.k31":"增大","controls.k32":"字段说明","controls.k33":"恢复默认值","controls.k34":"恢复默认值({v0}{v1})","controls.k35":"{v0}(应用到全部选中格)","controls.k36":"颜色选择","cropAnchor.k37":"自定义(保留原值)","cropAnchor.k38":"默认 100","cropAnchor.k39":"示例图","cropAnchor.k40":"原图","elements.k41":"文本","elements.k42":"长文本内容","elements.k43":"图片","flowList.k44":"黄芪 20g","flowList.k45":"当归尾 15g","flowList.k46":"赤芍 10g","flowList.k47":"川芎 10g","flowList.k48":"地龙 10g","flowList.k49":"桃仁 10g","flowList.k50":"红花 10g","fontSelect.k51":"默认","fontSelect.k52":"{v0}(未知)","fontSelect.k53":"使用「{v0}」","formatBar.k54":"实线","formatBar.k55":"虚线","formatBar.k56":"点线","formatBar.k57":"双线","formatBar.k58":"退出格式刷(Esc)","formatBar.k59":"格式刷(表格单元格暂不支持)","formatBar.k60":"格式刷(需选中元素)","formatBar.k61":"格式刷(请仅选中一个源元素)","formatBar.k62":"格式刷:单击刷一次,双击连续刷","formatBar.k63":"{v0}(需选中文本元素)","formatBar.k64":"无边框","formatBar.k65":"所有边框","formatBar.k66":"外侧边框","formatBar.k67":"内部边框","formatBar.k68":"内部边框(仅表格单元格可用)","formatBar.k69":"上边框","formatBar.k70":"下边框","formatBar.k71":"左边框","formatBar.k72":"右边框","formatBar.k73":"{v0}(再点一次取消,线型=无)","formatBar.k74":"粗细","formatBar.k75":"混合","formatBar.k76":"颜色","formatBar.k77":"边框颜色","formatBar.k78":"当前单元格四边规格不一致:留空的项不谎报,点预设/单边时按缺省档(实线 0.75 / #333333)批写","formatBar.k79":"左对齐","formatBar.k80":"水平居中","formatBar.k81":"右对齐","formatBar.k82":"两端对齐(撑满行宽,含末行)","formatBar.k83":"顶端对齐","formatBar.k84":"垂直居中","formatBar.k85":"底端对齐","formatBar.k86":"混合","formatBar.k87":"默认","formatBar.k88":"混合","formatBar.k89":"默认","formatBar.k90":"加粗","formatBar.k91":"下划线","formatBar.k92":"删除线","formatBar.k93":"字体颜色{v0}","formatBar.fontDisabledHint":"(需选中或混选文本元素)","formatBar.k94":"背景色","formatBar.k95":"对齐","formatBar.k96":"对齐(需选中文本元素或单元格)","formatBar.k97":"对齐","formatBar.k98":"边框","formatBar.k99":"边框(需选中元素)","formatBar.k100":"边框","helpModal.k101":"帮助文档","helpModal.k102":"关闭","pageExtras.k103":"上传背景图","pageExtras.k104":"仅支持上传图片文件","pageExtras.k105":"设计背景上传能力未配置","pageExtras.k106":"上传中...","pageExtras.k107":"设计背景上传失败","pageExtras.k108":"设计背景上传失败","pageExtras.k109":"上传背景图","pageExtras.k110":"设计背景","pageExtras.k111":"仅设计器显示,用于套打定位,不会出现在预览和打印中","pageExtras.k112":"旋转({v0}°)","pageExtras.k113":"移除","pageExtras.k114":"自定义","pageExtras.k115":" 横向","pageExtras.k116":" 纵向","pageExtras.k117":"目标纸 {v0}{v1} {v2}×{v3}mm · {v4} 列 × {v5} 行 = 每张 {v6} 格 · 每格 {v7}×{v8}mm","pageExtras.k118":"拼版打印","pageExtras.k119":"把标签按「列 × 行」铺到一张大纸上批量打印","pageExtras.k120":"启用拼版","pageExtras.k121":"连续纸不支持拼版","pageExtras.k122":"目标纸张","pageExtras.k123":"自定义","pageExtras.k124":"目标纸宽高 (mm)","pageExtras.k125":"目标纸方向","pageExtras.k126":"纵向","pageExtras.k127":"横向","pageExtras.k128":"拼版留白 (mm)","pageExtras.k129":"上","pageExtras.k130":"下","pageExtras.k131":"左","pageExtras.k132":"右","pageExtras.k133":"格间距与列数","pageExtras.k134":"横向间距","pageExtras.k135":"纵向间距","pageExtras.k136":"列数","panels.k137":"展开素材台","panels.k138":"元素","panels.k139":"字段","panels.k140":"图层","panels.k141":"素材台","panels.k142":"收起素材台","panels.k143":"元素","panels.k144":"字段","panels.k145":"图层","panels.k146":"拖拽元素到画布","panels.k147":"业务字段","panels.k148":"搜索字段...","panels.k149":"搜索字段","panels.k150":"{v0} ({v1}) · 单击复制字段名 · 拖动中按住 Ctrl(Mac 为 ⌘)切换为插入字段名","panels.k151":"已复制","panels.k152":"暂无字段","panels.k153":"页眉","panels.k154":"页脚","panels.k155":"图层","panels.k156":"置顶","panels.k157":"上移","panels.k158":"下移","panels.k159":"置底","panels.k160":"组合 (Ctrl+G)","panels.k161":"取消组合 (Ctrl+Shift+G)","panels.k162":"页面 {v0}","panels.k163":"{v0}(双击重命名)","panels.k164":"双击重命名","panels.k165":"页面 {v0}","panels.k166":"拼版模板仅允许一个设计页面","panels.k167":"新增页面(在当前页后追加空白页)","panels.k168":"拼版模板仅允许一个设计页面","panels.k169":"复制当前页「{v0}」","panels.k170":"删除当前页「{v0}」","panels.k171":"仅多页面模板可删除页面","panels.k172":"前移「{v0}」","panels.k173":"后移「{v0}」","panels.k174":"横向","panels.k175":"纵向","panels.k176":"缩放 {v0}%","propertyPanel.k177":"全部","propertyPanel.k178":"外侧","propertyPanel.k179":"内部","propertyPanel.k180":"无","propertyPanel.k181":"上","propertyPanel.k182":"右","propertyPanel.k183":"下","propertyPanel.k184":"左","propertyPanel.k185":"位置与尺寸","propertyPanel.k186":"外边距 (mm)","propertyPanel.k187":"上","propertyPanel.k188":"右","propertyPanel.k189":"下","propertyPanel.k190":"左","propertyPanel.k191":"旋转 (°)","propertyPanel.k192":"逆时针 90°","propertyPanel.k193":"逆时针旋转 90 度","propertyPanel.k194":"顺时针 90°","propertyPanel.k195":"顺时针旋转 90 度","propertyPanel.k196":"外观","propertyPanel.k197":"字体","propertyPanel.k198":"默认","propertyPanel.k199":"字体大小","propertyPanel.k200":"字体粗细","propertyPanel.k201":"正常","propertyPanel.k202":"粗体","propertyPanel.k203":"更粗","propertyPanel.k204":"细体","propertyPanel.k205":"对齐","propertyPanel.k206":"左","propertyPanel.k207":"中","propertyPanel.k208":"右","propertyPanel.k209":"两端","propertyPanel.k210":"垂直对齐","propertyPanel.k211":"顶","propertyPanel.k212":"中","propertyPanel.k213":"底","propertyPanel.k214":"颜色","propertyPanel.k215":"字体颜色","propertyPanel.k216":"背景色","propertyPanel.k217":"背景颜色","propertyPanel.k218":"行高","propertyPanel.k219":"字间距","propertyPanel.k220":"文字溢出","propertyPanel.k221":"截断","propertyPanel.k222":"自动缩小","propertyPanel.k223":"自适应行高","propertyPanel.k224":"最小字号 (pt)","propertyPanel.k225":"默认 6","propertyPanel.k226":"首行缩进 (字符)","propertyPanel.k227":"默认 0","propertyPanel.k228":"自动换行","propertyPanel.k229":"保留换行符","propertyPanel.k230":"缩放模式","propertyPanel.k231":"裁剪锚点","propertyPanel.k232":"当前元素不支持外观设置","propertyPanel.k233":"条码设置","propertyPanel.k234":"码制","propertyPanel.k235":"CODE128(通用)","propertyPanel.k236":"EAN13(商品码)","propertyPanel.k237":"打印机分辨率","propertyPanel.k238":"不指定(按条宽渲染)","propertyPanel.k239":"203 dpi(8 点/mm)","propertyPanel.k240":"300 dpi(11.8 点/mm)","propertyPanel.k241":"600 dpi(23.6 点/mm)","propertyPanel.k242":"填写后条宽吸附到整数打印点(消除出纸「条宽忽宽忽窄」):条码先按条宽渲染,可用宽度够就原样落纸,不够才整体等比缩小","propertyPanel.k243":"条宽(倍率)","propertyPanel.k244":"已设置打印机分辨率:条宽会被吸附到最近的整数打印点(DPI 优先于毫米值),元素框放不下时整体等比缩小","propertyPanel.k245":"热敏/针式打印建议 3 及以上:决定条码的落纸尺寸,条越粗出纸后条宽越稳定","propertyPanel.k246":"静区 (模块)","propertyPanel.k247":"默认 10","propertyPanel.k248":"条高 (mm)","propertyPanel.k249":"默认 30 模块","propertyPanel.k250":"显示文本","propertyPanel.k251":"文本字号(相对条高,条高为 30)","propertyPanel.k252":"默认 10","propertyPanel.k253":"纠错级别","propertyPanel.k254":"L(最低,容量大)","propertyPanel.k255":"M(推荐)","propertyPanel.k256":"H(最高)","propertyPanel.k257":"静区 (模块)","propertyPanel.k258":"默认 0","propertyPanel.k259":"自定义设置","propertyPanel.k260":"条码尺寸由「条宽」与「打印机分辨率」结算:宽度足够时按条宽原样落纸,不足时整体等比缩小;拉伸会把条宽变成非整数,故条形码不提供缩放模式,可用「最大宽高」限制上限。要放大条码:先加条宽倍率,再收窄静区(左右白边会换成条宽),必要时关掉显示文本以让出文本区高度","propertyPanel.k261":"缩放模式","propertyPanel.k262":"最大宽度 (mm)","propertyPanel.k263":"默认","propertyPanel.k264":"最大高度 (mm)","propertyPanel.k265":"默认","propertyPanel.k266":"流式列表","propertyPanel.k267":"布局模式","propertyPanel.k268":"固定高度","propertyPanel.k269":"动态分页","propertyPanel.k270":"上内边距 (mm)","propertyPanel.k271":"右内边距 (mm)","propertyPanel.k272":"下内边距 (mm)","propertyPanel.k273":"左内边距 (mm)","propertyPanel.k274":"每行列数","propertyPanel.k275":"行高 (mm)","propertyPanel.k276":"单元横向间距 (mm)","propertyPanel.k277":"内容过长时跨列","propertyPanel.k278":"最多跨几列","propertyPanel.k279":"按当前字号与框宽,{v0} 列偏挤(可放约 {v1} 列)。数值保持不变,出纸按 {v2} 列排。","propertyPanel.k280":"混合","propertyPanel.k281":"边框与背景","propertyPanel.k282":"线型","propertyPanel.k283":"边框宽度","propertyPanel.k284":"混合","propertyPanel.k285":"边框颜色","propertyPanel.k286":"边框颜色","propertyPanel.k287":"背景色","propertyPanel.k288":"背景颜色","propertyPanel.k289":"高级设置","propertyPanel.k290":"锁定","propertyPanel.k291":"每页重复","propertyPanel.k292":"每页固定","propertyPanel.k293":"层级","propertyPanel.k294":"删除元素","propertyPanel.k295":"高级设置说明","propertyPanel.k296":"高级设置说明","propertyPanel.k297":"其他","propertyPanel.k298":"纸张设置","propertyPanel.k299":"纸张尺寸","propertyPanel.k300":"自定义宽高","propertyPanel.k301":"纸宽 (mm)","propertyPanel.k302":"自定义宽高 (mm)","propertyPanel.k303":"纸张方向","propertyPanel.k304":"纵向","propertyPanel.k305":"横向","propertyPanel.k306":"切换即交换纸张长宽(设计稿内容随之铺在该尺寸上)","propertyPanel.k307":"内容旋转角度","propertyPanel.k308":"拼版时每个标签的内容按该角度旋转;90°/270° 时每格占位宽高互换,列数自动铺满新档位上限,行数按互换后重算;0° 为不旋转(默认)","propertyPanel.k309":"整页内容旋转对应角度出纸;90°/270° 时纸张长宽互换以贴合内容,内容不变形不裁切;0° 为不旋转(默认)","propertyPanel.k310":"页面背景色","propertyPanel.k311":"页面背景色","propertyPanel.k312":"页边距 (mm)","propertyPanel.k313":"上","propertyPanel.k314":"下","propertyPanel.k315":"左","propertyPanel.k316":"右","propertyPanel.k317":"页眉/页脚高度 (mm)","propertyPanel.k318":"页眉高度","propertyPanel.k319":"页脚高度","propertyPanel.k320":"展开属性台","propertyPanel.k321":"元素属性","propertyPanel.k322":"页面属性","propertyPanel.k323":"属性台","propertyPanel.k324":"收起属性台","propertyPanel.k325":"元素属性","propertyPanel.k326":"页面属性","propertyPanel.k327":"请在画布中选择一个元素","propertyPanel.k328":"自定义属性","propertySearch.k328":"搜索属性...","propertySearch.k329":"搜索属性","tableProps.k330":"多级表头作为一个结构整体重复,勾选后表头区所有行都会在每页顶部重复","tableProps.k331":"标题行","tableProps.k332":"数据行","tableProps.k333":"小计行(每页小计)","tableProps.k334":"汇总行","tableProps.k335":"CODE128(通用)","tableProps.k336":"EAN13(商品码)","tableProps.k337":"L(最低,容量大)","tableProps.k338":"M(推荐)","tableProps.k339":"H(最高)","tableProps.k340":"截断","tableProps.k341":"自动缩小","tableProps.k342":"自适应行高","tableProps.k343":"多选","tableProps.k344":"行属性","tableProps.k345":"行属性","tableProps.k346":"行类型","tableProps.k347":"行高 (mm)","tableProps.k348":"表头每页重复","tableProps.k349":"表格设置","tableProps.k350":"列表数据源字段","tableProps.k351":"默认字体","tableProps.k352":"默认","tableProps.k353":"默认字号 (pt)","tableProps.k354":"默认","tableProps.k355":"默认文字颜色","tableProps.k356":"默认文字颜色","tableProps.k357":"默认内边距 (mm)","tableProps.k358":"默认","tableProps.k359":"列宽 (mm)","tableProps.k360":"列{v0}","tableProps.k361":"表格总宽不能超过打印范围宽度 {v0}mm,列{v1} 已调整为 {v2}mm","tableProps.k362":"启用分页","tableProps.k363":"参与分页","tableProps.k364":"与下元素同页","tableProps.k365":"分页配置","tableProps.k366":"上","tableProps.k367":"右","tableProps.k368":"下","tableProps.k369":"左","tableProps.k370":"单元格","tableProps.k371":"单元格","tableProps.k372":"多选","tableProps.k373":"仅数据行(明细行)支持按值合并","tableProps.k374":"恢复默认值(跟随表格默认)","tableProps.k375":"单元格","tableProps.k376":"已选 {v0} 格 · 批量设置:不显示单格配置,改动会应用到全部选中格","tableProps.k377":"单元格类型","tableProps.k378":"文本","tableProps.k379":"条形码","tableProps.k380":"二维码","tableProps.k381":"图片","tableProps.k382":"码制","tableProps.k383":"显示文本","tableProps.k384":"条宽(倍率)","tableProps.k385":"已设置打印机分辨率:条宽会被吸附到最近的整数打印点(DPI 优先于毫米值),单元格放不下时整体等比缩小","tableProps.k386":"热敏/针式打印建议 3 及以上:决定条码的落纸尺寸,条越粗出纸后条宽越稳定","tableProps.k387":"静区 (模块)","tableProps.k388":"默认 10","tableProps.k389":"条高 (mm)","tableProps.k390":"默认 30 模块","tableProps.k391":"文本字号(相对条高,条高为 30)","tableProps.k392":"默认 10","tableProps.k393":"打印机分辨率","tableProps.k394":"不指定(按条宽渲染)","tableProps.k395":"203 dpi(8 点/mm)","tableProps.k396":"300 dpi(11.8 点/mm)","tableProps.k397":"600 dpi(23.6 点/mm)","tableProps.k398":"填写后条宽吸附到整数打印点(消除出纸「条宽忽宽忽窄」):条码先按条宽渲染,可用宽度够就原样落纸,不够才整体等比缩小","tableProps.k399":"纠错级别","tableProps.k400":"静区 (模块)","tableProps.k401":"默认 0","tableProps.k402":"单元格条码尺寸由「条宽」与「打印机分辨率」结算:可用宽度足够时按条宽原样落纸,不足时整体等比缩小;拉伸会把条宽变成非整数,故条形码不提供缩放模式,可用「最大宽高」限制上限。要放大条码:先加条宽倍率,再收窄静区(左右白边会换成条宽),必要时关掉显示文本以让出文本区高度","tableProps.k403":"缩放模式","tableProps.k404":"裁剪锚点","tableProps.k405":"最大宽度 (mm)","tableProps.k406":"默认","tableProps.k407":"最大高度 (mm)","tableProps.k408":"默认","tableProps.k409":"内容","tableProps.k410":"多选(输入后覆盖全部选中格)","tableProps.k411":"输入内容,支持 {字段} 表达式","tableProps.k412":"水平对齐","tableProps.k413":"左","tableProps.k414":"中","tableProps.k415":"右","tableProps.k416":"两端","tableProps.k417":"垂直对齐","tableProps.k418":"上","tableProps.k419":"中","tableProps.k420":"下","tableProps.k421":"字体","tableProps.k422":"继承默认","tableProps.k423":"字号 (pt)","tableProps.k424":"默认","tableProps.k425":"加粗","tableProps.k426":"文字颜色","tableProps.k427":"文字颜色","tableProps.k428":"背景色","tableProps.k429":"背景颜色","tableProps.k430":"边框","tableProps.k431":"混合","tableProps.k432":"多选","tableProps.k433":"混合","tableProps.k434":"边框颜色","tableProps.k435":"全部","tableProps.k436":"外侧","tableProps.k437":"内部","tableProps.k438":"无","tableProps.k439":"内边距 (mm)","tableProps.k440":"默认","tableProps.k441":"自动换行","tableProps.k442":"文字溢出","tableProps.k443":"最小字号 (pt)","tableProps.k444":"默认 6","tableProps.k445":"单元格合并","tableProps.k446":"合并单元格","tableProps.k447":"拆分单元格","tableProps.k448":"按值合并","tableProps.k449":"明细相邻行同值时自动纵向合并;跨页时在该页内成段,续页首行重放该值","table.k450":"题","table.k451":"数","table.k452":"小","table.k453":"汇","table.k454":"标题行","table.k455":"数据行","table.k456":"小计行","table.k457":"汇总行","table.k458":"条码","table.k459":"图片","table.k460":"插入后表格总宽 {v0}mm 超过打印范围宽度 {v1}mm,请先缩小列宽","table.k461":"未指定行类型","table.k462":"未选择单元格","table.k463":"仅数据行(明细行)支持按值合并","table.k464":"未选择单元格","table.k465":"行类型仅支持单行设置","table.k466":"未选择单元格","table.k467":"在上方插入行","table.k468":"在下方插入行","table.k469":"删除行","table.k470":"在左侧插入列","table.k471":"在右侧插入列","table.k472":"删除列","table.k473":"合并单元格","table.k474":"拆分单元格","table.k475":"按值合并","table.k476":"行类型","table.k477":"列宽手柄{v0}","toolbarOverflow.k478":"剪贴板","toolbarOverflow.k479":"格式刷","toolbarOverflow.k480":"缩放","toolbarOverflow.k481":"排列 / 视图","toolbarOverflow.k482":"边框","toolbarOverflow.k483":"颜色","toolbarOverflow.k484":"对齐","toolbarOverflow.k485":"文字样式","toolbarOverflow.k486":"字体与字号","toolbarOverflow.k487":"更多","toolbarOverflow.k488":'{v0}<span class="tb-btn-text">更多</span>{v1}',"toolbar.k489":"编辑模板","toolbar.k490":"新建模板","toolbar.k491":"对齐 / 分布","toolbar.k492":"左对齐","toolbar.k493":"右对齐","toolbar.k494":"顶对齐","toolbar.k495":"底对齐","toolbar.k496":"水平居中","toolbar.k497":"垂直居中","toolbar.k498":"水平分布","toolbar.k499":"垂直分布","toolbar.k500":"层级","toolbar.k501":"置顶","toolbar.k502":"上移一层","toolbar.k503":"下移一层","toolbar.k504":"置底","toolbar.k505":"组合","toolbar.k506":"组合 (Ctrl+G)","toolbar.k507":"取消组合 (Ctrl+Shift+G)","toolbar.k508":"标尺","toolbar.k509":"显示/隐藏标尺","toolbar.k510":"网格","toolbar.k511":"显示/隐藏网格背景","toolbar.k512":"虚框","toolbar.k513":"显示/隐藏无边框表格的虚拟虚线","toolbar.k514":"吸附","toolbar.k515":"开启/关闭元素吸附到网格","toolbar.k516":"打印模板设计器","toolbar.k517":"撤销","toolbar.k518":"重做","toolbar.k519":"排列","toolbar.k520":"排列","toolbar.k521":"视图","toolbar.k522":"视图","toolbar.k523":"适应窗口","toolbar.k524":"缩小","toolbar.k525":"放大","toolbar.k526":"复制 (Ctrl+C),需选中元素","toolbar.k527":"复制 (Ctrl+C)","toolbar.k528":"粘贴 (Ctrl+V),需选中元素","toolbar.k529":"粘贴 (Ctrl+V),剪贴板为空","toolbar.k530":"粘贴 (Ctrl+V)","toolbar.k531":"删除 (Delete),需选中元素","toolbar.k532":"删除 (Delete)","toolbar.k533":"帮助文档","toolbar.k534":"预览模板打印效果","toolbar.k535":"预览","toolbar.k536":"保存模板","toolbar.k537":"保存","watermark.k538":"水印","watermark.k539":"水印表达式","watermark.k540":"直接输入文字,或用表达式:{order.no}、{printDate}","watermark.k541":"双击或点「编辑表达式」打开表达式弹框","watermark.k542":"编辑表达式","watermark.k543":"测试值","watermark.k544":"表达式取不到值时预览显示","watermark.k545":"旋转角度","watermark.k546":"颜色","watermark.k547":"水印颜色","watermark.k548":"透明度","watermark.k549":"密度","watermark.k550":"自定义","watermark.k551":"瓦片宽","watermark.k552":"瓦片高","elementDefinitions.k553":"文本","elementDefinitions.k554":"条形码","elementDefinitions.k555":"二维码","elementDefinitions.k556":"图片","elementDefinitions.k557":"表格","elementDefinitions.k558":"长文","elementDefinitions.k559":"流式列表","elementDefinitions.k560":"横线","elementDefinitions.k561":"竖线","elementDefinitions.k562":"矩形","elementDefinitions.k563":"椭圆","elementDefinitions.k564":"页码","elementDefinitions.k565":"registerElementDefinition: type 必须是非空字符串","elementDefinitions.k566":"registerElementDefinition: label 必须是非空字符串","elementDefinitions.k567":"registerElementRenderer: 需要 type 与渲染函数","panels.paperRotated":"(旋转{rot}°)","panels.statusElements":"元素 {count}{selected}","panels.statusSelected":" (选中 {n})"},d2={"expression.tabField":"📁 字段","expression.tabVariable":"🔧 变量","expression.tabFunction":"⚡ 函数","expression.placeholderField":"搜索字段...","expression.placeholderVariable":"搜索变量...","expression.placeholderFunction":"搜索函数...","expression.fnSum":"求和","expression.fnAvg":"平均值","expression.fnCount":"计数","expression.fnMin":"最小值","expression.fnMax":"最大值","expression.fnAdd":"相加","expression.fnSub":"相减","expression.fnMul":"相乘","expression.fnDiv":"相除","expression.fnRound":"四舍五入","expression.fnRoundUp":"进一法","expression.fnRoundDown":"去尾法","expression.fnRoundBank":"四舍六入五成双","expression.fnMoney":"金额格式化","expression.fnDate":"日期格式化","expression.fnUpper":"大写金额","expression.fnIf":"条件判断","expression.varPageIndex":"当前页码","expression.varTotalPages":"总页数","expression.varPrintDate":"打印日期","expression.varPrintTime":"打印时间","expression.groupAggregate":"聚合函数","expression.groupMath":"数值运算","expression.groupFormat":"格式化函数","expression.previewEmpty":"(输入表达式后预览)","expression.previewNoValue":"(无法计算)","expression.previewError":"(表达式错误)","expression.k1":"帮助信息","expression.k2":"输入方式","expression.k3":"双击左侧字段、变量、函数即可插入到表达式输入框中","expression.k4":"双击途中按住 Ctrl(Mac 为 ⌘)切换为插入字段名称,当静态文本用","expression.k5":"静态数据直接输入即可,如:供应商名称","expression.k6":"动态解析字段、变量、函数必须用 {} 包裹","expression.k7":"示例:{SUM(supplier.name)}","expression.k8":"中文 key 直接写 {字段名},如 {姓名}、{supplier.名称}","expression.k9":"注意:只能嵌套一层","expression.k10":"函数使用","expression.k11":"SUM(字段) - 求和","expression.k12":"AVG(字段) - 平均值","expression.k13":"COUNT(字段) - 计数","expression.k14":"IF(条件, 真值, 假值) - 条件判断","expression.k15":"四则运算:{qty * price}、{ADD(qty, 1)}","expression.k16":"修约:ROUND 四舍五入 / ROUNDUP 进一 / ROUNDDOWN 去尾 / ROUNDBANK 四舍六入五成双","expression.k17":"系统变量","expression.k18":"{pageIndex} - 当前页码","expression.k19":"{totalPages} - 总页数","expression.k20":"{printDate} - 打印日期","expression.k21":"示例","expression.k22":"静态文本:供应商名称","expression.k23":"动态字段:{supplier.name}","expression.k24":"函数调用:{SUM(amount)}","expression.k25":'条件判断:{IF(amount>1000, "大单", "小单")}',"expression.k26":"运算并修约:{ROUND(qty * price, 2)}","expression.k27":"暂无字段","expression.k28":"已复制","expression.k29":"类型","expression.k30":"表达式编辑","expression.k31":"双击左侧字段/变量/函数插入,双击途中按住 Ctrl(Mac 为 ⌘)切换为插入字段名,或直接输入静态内容","expression.k32":"预览结果","expression.k33":"编辑表达式","expression.k34":"关闭","expression.k35":"取消","expression.k36":"确定"},c2={"toolbar.save":"保存","toolbar.preview":"预览","diagnostic.expressionUnexpectedEnd":"表达式意外结束","diagnostic.parser.trailingContent":"表达式存在多余内容: {value}","diagnostic.parser.expected":'位置 {pos}: 期望 "{value}"',"diagnostic.parser.memberName":"位置 {pos}: 成员访问需要属性名","diagnostic.parser.invalidNumber":"非法数字: {value}","diagnostic.parser.objectKey":"位置 {pos}: 对象键必须是标识符或字符串","diagnostic.parser.unexpectedToken":"位置 {pos}: 意外的符号: {value}","diagnostic.lexer.unterminatedString":"字符串未闭合","diagnostic.lexer.keyword":"不允许使用关键字: {word}","diagnostic.lexer.forbidden":"禁止访问: {word}","diagnostic.lexer.noFunctionDef":"不允许函数定义","diagnostic.lexer.noAssignment":"不允许赋值","diagnostic.lexer.noMultipleStatements":"不允许多条语句","diagnostic.lexer.invalidChar":"非法字符: {ch}","diagnostic.evaluator.undefinedIdentifier":"未定义的标识符: {name}","diagnostic.evaluator.unknownOperator":"未知运算符: {op}","diagnostic.evaluator.unknownUnaryOperator":"未知一元运算符: {op}","diagnostic.evaluator.nullProperty":"无法访问空值的属性","diagnostic.evaluator.forbiddenProperty":"禁止访问属性: {property}","diagnostic.evaluator.mathNotMethod":"Math.{name} 不是方法","diagnostic.evaluator.noMethodCall":"不支持方法调用,请使用顶级函数","diagnostic.evaluator.notFunction":"{name} 不是函数","diagnostic.evaluator.forbiddenCall":"不允许调用: {name}","diagnostic.template.unclosedBrace":"位置 {pos}: 花括号未闭合","diagnostic.template.emptyExpression":"位置 {pos}: 空表达式","diagnostic.pagination.insufficientHeight":"页面可用高度不足: paper={paper}mm, margins={margins}mm, header={header}mm, footer={footer}mm","diagnostic.pagination.repeatHeaderOverflow":"表格 {id} 的重复表头高度 ({repeat}mm) 超过页面可用高度 ({avail}mm),请减少重复表头行","diagnostic.tiling.continuousUnsupported":"连续纸不支持拼版打印,请将模板纸张改为固定纸张或关闭拼版","diagnostic.tiling.sheetContinuous":"拼版目标纸张不能是连续纸","diagnostic.tiling.sheetSizeInvalid":"拼版自定义纸张宽高必须是大于 0 的数值(mm)","diagnostic.tiling.columnsInvalid":"拼版列数必须是大于 0 的整数","diagnostic.tiling.rotationNote":"(内容旋转 {angle}°,每格 {width}×{height}mm)","diagnostic.tiling.columnsExceedWidth":"拼版列数 {columns} 超出纸面可用宽度:{sheet}mm − 左右留白 {margin}mm = {avail}mm,最多可放 {max} 列;当前 {columns} 列 {label}mm 标签含间距需要 {need}mm{rotation}","diagnostic.tiling.labelHeightExceed":"标签高度 {height}mm 超出纸面可用高度 {avail}mm,拼版每张 0 行;请缩小标签高度或改用横向纸{rotation}","diagnostic.multiTemplate.emptyPages":"多页面模板至少需要一页","diagnostic.multiTemplate.continuous":"多页面模板不支持连续纸({page})","diagnostic.multiTemplate.tiling":"多页面模板不支持标签拼版({page})","diagnostic.multiTemplate.paperMismatch":"多页面模板各页纸张尺寸必须一致({page} {width}×{height}mm 与首页 {firstWidth}×{firstHeight}mm 不同)","diagnostic.multiTemplate.emptyData":"多页面模板至少需要一份数据","diagnostic.multiTemplate.pageLabelNamed":"第 {index} 页「{name}」","diagnostic.multiTemplate.pageLabelPlain":"第 {index} 页","client.cancelled":"连接已取消","client.invalidToken":"配对 token 无效或来源未授权","client.notRunning":"未发现运行中的打印客户端(已探测默认端口区间),请确认客户端已启动","client.notConnected":"打印客户端未连接","client.timeout":"请求 {type} 超时未响应","client.closed":"连接已关闭","client.disconnected":"与客户端的连接中断","client.unregisteredHandler":"桌面端请求未注册处理器","client.internalError":"内部错误","table.atLeastTwoCells":"至少选择 2 个单元格","table.crossRowTypes":"合并区域不能跨越不同类型的行","table.dataVerticalMerge":"数据行将按列表展开,纵向合并请使用单元格属性「按值合并」","table.partialOverlap":"选区与已有合并区域部分重叠","table.lastRow":"不能删除最后一行","table.lastColumn":"不能删除最后一列","table.dataRowExists":"数据行已存在(第 {row} 行),全表最多一行","table.headerContinuous":"标题行必须从表格顶部连续设置","table.subtotalAfterData":"请先设置数据行,小计/汇总行必须位于数据行之后","table.subtotalBeforeData":"小计/汇总行必须位于数据行之后","table.subtotalBeforeSummary":"小计行必须位于汇总行之前","table.summaryAfterSubtotal":"汇总行必须位于小计行之后","table.headerBreak":"取消该标题行会导致标题行不连续,请先调整后续标题行","table.defaultHeader":"列{index}","table.borderHint":"线型 / 宽度 / 颜色是待应用规格:选中格已有的边框规格一致时会填进这三行;四边不一致的项显示「混合」,一条边都没有时显示「无 / 0」。改完点「全部 / 外侧 / 内部」或勾选上、下、左、右某条边才会写入选中的单元格;「无」是清除边框","table.borderHintMulti":"多选时不回显单格边框:线型 / 宽度 / 颜色按当前设置作为批写规格,点「全部 / 外侧 / 内部」或勾选某条边后写入所有选中格;「无」是清除边框","table.borderHintMixed":"当前单元格四边边框规格不一致:带「混合」的项不谎报,未改项在点「全部 / 外侧 / 内部」或勾选单边时按缺省档(实线 0.75pt)写入,改任一项即按该值批写","diagnostic.pagination.overflowTop":"元素 {id} 旋转 {rot}° 后顶部超出页首 {amount}mm,打印将被裁切","diagnostic.pagination.overflowRight":"元素 {id} 超出纸面右侧 {amount}mm,打印将被裁切","diagnostic.pagination.overflowLeft":"元素 {id} 超出纸面左侧 {amount}mm,打印将被裁切","crop.sampleNote":"图片还没设置,上面按内置示例图演示取位;换上真图后档位与可挪量按真图重算","crop.verticalPosition":"垂直位置 (%)","crop.horizontalPosition":"水平位置 (%)","crop.scaleLabel":"放大比例 (%)","crop.originalValue":"已保留模板里的原值;改动下面任一项就整体替换成新的取位","crop.movableBoth":"水平可挪 {x}mm、垂直可挪 {y}mm:0 贴左/贴顶,100 贴右/贴底","crop.movableX":"水平可挪 {x}mm;垂直这一轴已贴满,挪不动","crop.movableY":"垂直可挪 {y}mm;水平这一轴已贴满,挪不动","crop.noRoom":"这个缩放下图与框正好一样大,两轴都没有可挪的余量","crop.top":"顶部","crop.center":"居中","crop.bottom":"底部","crop.left":"左侧","crop.right":"右侧","crop.topLeft":"左上","crop.topCenter":"上中","crop.topRight":"右上","crop.middleLeft":"左中","crop.middleRight":"右中","crop.bottomLeft":"左下","crop.bottomCenter":"下中","crop.bottomRight":"右下","crop.fitContain":"包含(保持比例)","crop.fitCover":"剪裁(等比铺满后裁边)","crop.fitFill":"拉伸填满","crop.fitNone":"原始尺寸","crop.fitScaleDown":"缩小(保持比例)","barcode.recommendOk":"按 {dpi}dpi 推荐条宽倍率 {rec}(每模块 {recDots} 个打印点 = {width}mm,取达到 {min}mm 下限的最小档);当前倍率 {current} 折算为 {curDots} 点 / {curWidth}mm,已达标。这里只提示,不会替你改值","barcode.recommendLow":"按 {dpi}dpi 推荐条宽倍率 {rec}(每模块 {recDots} 个打印点 = {width}mm,取达到 {min}mm 下限的最小档);当前倍率 {current} 只有 {curDots} 点 / {curWidth}mm,低于下限。这里只提示,不会替你改值","code.rotateNote":"条码与二维码仅支持 90° 步进;任意角度需 385dpi 以上打印头","colorPicker.pickColor":"颜色选择","colorPicker.hexValue":"颜色值","colorPicker.customColor":"自定义颜色","colorPicker.hue":"色相","colorPicker.commonColors":"常用颜色","colorPicker.clear":"清除选中的颜色","colorPicker.clearShort":"清除","save.geometryWarningConfirm":`出纸提示:部分内容超出纸面,打印时会被裁切。
283
283
  是否接受裁切并继续保存?
284
284
  点击“确定”继续保存,点击“取消”返回修改。
285
285
 
@@ -291,9 +291,9 @@ Click OK to save, Cancel to go back and edit.
291
291
  ยอมรับการตัดและบันทึกต่อหรือไม่?
292
292
  คลิก ตกลง เพื่อบันทึก คลิก ยกเลิก เพื่อกลับไปแก้ไข
293
293
 
294
- {warnings}`,"store.tilingSinglePage":"เมื่อเปิดการจัดเรียงชิ้น อนุญาตให้มีหน้าออกแบบได้เพียงหน้าเดียว","elementGroup.chart":"แผนภูมิ","service.printData.emptyArray":"ข้อมูลการพิมพ์เป็นชุดต้องเป็นอาร์เรย์อ็อบเจกต์ที่ไม่ว่างเปล่า","service.printData.tooMany":"การพิมพ์เป็นชุดรองรับได้มากสุด {max} ชุด ได้ {count} ชุด","service.printData.itemNotObject":"รายการข้อมูลการพิมพ์ชุดที่ {index} ต้องเป็นอ็อบเจกต์","service.printData.notObjectOrArray":"printData ต้องเป็นอ็อบเจกต์หรืออาร์เรย์",...m2,...g2},k2={constants:{"constants.borderStyle.none":"无","constants.borderStyle.solid":"实线","constants.borderStyle.dashed":"虚线","constants.borderStyle.dotted":"点线","constants.borderStyle.double":"双线","constants.paper.A4.label":"A4 210×297mm","constants.paper.A3.label":"A3 297×420mm","constants.paper.A5.label":"A5 148×210mm","constants.paper.Letter.label":"Letter 216×279mm","constants.paper.Legal.label":"Legal 216×356mm","constants.paper.DOT_FULL.label":"全等分 241×279.4mm","constants.paper.DOT_HALF.label":"二等分 241×139.7mm","constants.paper.DOT_THIRD.label":"三等分 241×93.1mm","constants.paper.LABEL_80X60.label":"80×60mm","constants.paper.LABEL_60X40.label":"60×40mm","constants.paper.LABEL_40X30.label":"40×30mm","constants.paper.THERMAL_57.label":"57mm","constants.paper.THERMAL_80.label":"80mm","constants.paper.THERMAL_110.label":"110mm","constants.paper.CONTINUOUS.label":"连续纸(自定义宽度)","constants.paper.group.common":"常用纸张","constants.paper.group.dotMatrix":"针式打印纸","constants.paper.group.labels":"标签纸","constants.paper.group.receipt":"小票纸","constants.paper.group.continuous":"连续纸","constants.watermark.density.dense":"密","constants.watermark.density.medium":"中(默认)","constants.watermark.density.loose":"疏","constants.watermark.density.size":"({w}×{h})","constants.label.content":"内容","constants.hint.border.apply":"线型 / 宽度 / 颜色即时生效,这三行显示的就是当前生效规格:已有边框时任改一行都会按新规格铺满四边并清掉单边覆盖;上、下、左、右只给选中的边加框,撤掉一边会把它其余三边落成单边;「无」清除边框,「内部」仅表格单元格可用","constants.hint.border.pending":"线型 / 宽度 / 颜色是待应用规格:选中格已有的边框规格一致时会填进这三行;四边不一致的项显示「混合」,一条边都没有时显示「无 / 0」。改完点「全部 / 外侧 / 内部」或勾选上、下、左、右某条边才会写入选中的单元格;「无」是清除边框","constants.hint.border.multi":"多选时不回显单格边框:线型 / 宽度 / 颜色按当前设置作为批写规格,点「全部 / 外侧 / 内部」或勾选某条边后写入所有选中格;「无」是清除边框","constants.hint.border.mixed":"当前单元格四边边框规格不一致:带「混合」的项不谎报,未改项在点「全部 / 外侧 / 内部」或勾选单边时按缺省档(实线 0.75pt)写入,改任一项即按该值批写"}},y2={constants:{"constants.borderStyle.none":"None","constants.borderStyle.solid":"Solid","constants.borderStyle.dashed":"Dashed","constants.borderStyle.dotted":"Dotted","constants.borderStyle.double":"Double","constants.paper.A4.label":"A4 210×297mm","constants.paper.A3.label":"A3 297×420mm","constants.paper.A5.label":"A5 148×210mm","constants.paper.Letter.label":"Letter 216×279mm","constants.paper.Legal.label":"Legal 216×356mm","constants.paper.DOT_FULL.label":"Full sheet 241×279.4mm","constants.paper.DOT_HALF.label":"Half sheet 241×139.7mm","constants.paper.DOT_THIRD.label":"Third sheet 241×93.1mm","constants.paper.LABEL_80X60.label":"80×60mm","constants.paper.LABEL_60X40.label":"60×40mm","constants.paper.LABEL_40X30.label":"40×30mm","constants.paper.THERMAL_57.label":"57mm","constants.paper.THERMAL_80.label":"80mm","constants.paper.THERMAL_110.label":"110mm","constants.paper.CONTINUOUS.label":"Continuous paper (custom width)","constants.paper.group.common":"Common","constants.paper.group.dotMatrix":"Dot-matrix","constants.paper.group.labels":"Labels","constants.paper.group.receipt":"Receipt","constants.paper.group.continuous":"Continuous","constants.watermark.density.dense":"Dense","constants.watermark.density.medium":"Medium (default)","constants.watermark.density.loose":"Sparse","constants.watermark.density.size":" ({w}×{h})","constants.label.content":"Content","constants.hint.border.apply":'Line style / width / color apply immediately; these three rows show the effective spec. With an existing border, changing any row fills all four sides and clears per-side overrides. Top / right / bottom / left add a border only to the selected side; removing one turns the other three into per-side borders. "None" clears the border; "Inside" is available for table cells only.',"constants.hint.border.pending":'Line style / width / color are a pending spec: they are prefilled when the selected cells share one border spec. Mixed values show "Mixed"; no border shows "None / 0". Click All / Outside / Inside or tick a side (top / right / bottom / left) to write to the selected cells; "None" clears the border.',"constants.hint.border.multi":'Multi-select does not show a single cell border: line style / width / color act as a batch spec. Click All / Outside / Inside or tick a side to apply to all selected cells; "None" clears the border.',"constants.hint.border.mixed":'The four sides of this cell have different border specs: "Mixed" is shown instead of a false value. Untouched fields fall back to the default (Solid 0.75pt) when you click All / Outside / Inside or tick a side; changing any field writes that value to the batch.'}},v2={constants:{"constants.borderStyle.none":"ไม่มี","constants.borderStyle.solid":"เส้นทึบ","constants.borderStyle.dashed":"เส้นประ","constants.borderStyle.dotted":"เส้นจุด","constants.borderStyle.double":"เส้นคู่","constants.paper.A4.label":"A4 210×297mm","constants.paper.A3.label":"A3 297×420mm","constants.paper.A5.label":"A5 148×210mm","constants.paper.Letter.label":"Letter 216×279mm","constants.paper.Legal.label":"Legal 216×356mm","constants.paper.DOT_FULL.label":"แผ่นเต็ม 241×279.4mm","constants.paper.DOT_HALF.label":"แผ่นครึ่ง 241×139.7mm","constants.paper.DOT_THIRD.label":"แผ่นหนึ่งในสาม 241×93.1mm","constants.paper.LABEL_80X60.label":"80×60mm","constants.paper.LABEL_60X40.label":"60×40mm","constants.paper.LABEL_40X30.label":"40×30mm","constants.paper.THERMAL_57.label":"57mm","constants.paper.THERMAL_80.label":"80mm","constants.paper.THERMAL_110.label":"110mm","constants.paper.CONTINUOUS.label":"กระดาษต่อเนื่อง (ความกว้างกำหนดเอง)","constants.paper.group.common":"กระดาษทั่วไป","constants.paper.group.dotMatrix":"กระดาษดอทเมทริกซ์","constants.paper.group.labels":"ฉลาก","constants.paper.group.receipt":"ใบเสร็จ","constants.paper.group.continuous":"กระดาษต่อเนื่อง","constants.watermark.density.dense":"หนาแน่น","constants.watermark.density.medium":"กลาง (ค่าเริ่มต้น)","constants.watermark.density.loose":"ห่าง","constants.watermark.density.size":" ({w}×{h})","constants.label.content":"เนื้อหา","constants.hint.border.apply":'รูปแบบเส้น/ความกว้าง/สีมีผลทันที สามบรรทัดนี้แสดงผลที่มีผลอยู่: เมื่อมีเส้นขอบอยู่แล้ว การเปลี่ยนแถวใดจะเติมสี่ด้านและลบการเขียนทับรายด้าน; บน/ขวา/ล่าง/ซ้ายเพิ่มเส้นเฉพาะด้านที่เลือก การลบด้านหนึ่งจะทำให้สามด้านที่เหลือเป็นเส้นแยก; "ไม่มี" ลบเส้นขอบ "ด้านใน" ใช้สำหรับเซลล์ตารางเท่านั้น',"constants.hint.border.pending":'รูปแบบเส้น/ความกว้าง/สีเป็นค่าที่รอใช้งาน: จะเติมในสามบรรทัดนี้เมื่อเซลล์ที่เลือกมีเส้นขอบสอดคล้องกัน; ค่าที่ไม่ตรงกันแสดง "ผสม" ไม่มีเส้นแสดง "ไม่มี / 0" แก้แล้วคลิก ทั้งหมด/ด้านนอก/ด้านใน หรือทำเครื่องหมายด้านใดด้านหนึ่งจึงเขียนลงเซลล์ที่เลือก; "ไม่มี" ลบเส้นขอบ',"constants.hint.border.multi":'การเลือกหลายรายการไม่แสดงเส้นขอบของเซลล์เดี่ยว: รูปแบบเส้น/ความกว้าง/สีเป็นค่าเขียนเป็นชุด คลิก ทั้งหมด/ด้านนอก/ด้านใน หรือทำเครื่องหมายด้านใดด้านหนึ่งเพื่อเขียนทุกเซลล์ที่เลือก; "ไม่มี" ลบเส้นขอบ',"constants.hint.border.mixed":'เส้นขอบสี่ด้านของเซลล์นี้ไม่สอดคล้องกัน: รายการ "ผสม" ไม่รายงานค่าผิด; รายการที่ไม่เปลี่ยนใช้ค่าเริ่มต้น (เส้นทึบ 0.75pt) เมื่อคลิก ทั้งหมด/ด้านนอก/ด้านใน หรือทำเครื่องหมายด้านเดียว; เปลี่ยนรายการใดจะเขียนค่านั้นเป็นชุด'}},w2={propertyTips:{"propertyTips.ap-long-text-indent":"长文本每段首行空出的宽度,单位「字符」:填 2 即缩进两个汉字宽(中文排版惯例),按 em 落纸——字号被「自动缩小」压小时缩进同步变窄。仅长文本元素生效,写在普通文本上不生效","propertyTips.ap-img-fit":"图片在元素框内的缩放方式:包含=完整显示、可能留白;剪裁=铺满框并按「裁剪锚点」取一块;拉伸=填满框会变形;原始尺寸与缩小不放大。画布与三条出纸链路同一口径(缺省包含)","propertyTips.ap-img-object-position":"取位(仅「剪裁」档有这一行):剪裁把图等比铺满元素框,多出来的那一条边按这里选的位置取舍。先选位置档(贴边/居中/贴另一头),再按百分比微调,0 贴左/贴顶,100 挪到另一头,水平与垂直各自独立;缺省取正中间(保住证件照头顶就选顶部)。其余缩放模式图比框小或刚好铺满,没有可裁的边,所以不出本行","propertyTips.ap-img-fit-scale":"剪裁放大:等比铺满之后把画面再推大这么多,两轴才真的各多出一条边可裁——图与框同比例时不放大就什么都裁不掉。100=不放大(缺省),上限 400;超出框的部分由元素框裁掉。锚点选中的那一点既是取位的钉住点、也是放大的中心,两者共用同一个值。仅「剪裁」档生效,其余缩放模式不出本行","propertyTips.ap-rotate":"元素绕自身中心旋转的角度(度,0~359):出纸时按旋转后外接盒分页与结算,底部放不下自动移页,超出纸面左右缘或顶部会被裁切并给出纸提示。表格、流式列表与表格下方跟随区的元素不支持旋转(这三类不出本行);条码与二维码的任意角度需 385dpi 以上打印头,低分辨率打印机只按 90° 步进出纸","propertyTips.fl-columns":"一行排几个单元,必须由你指定——不随内容自动算列数。填的列数乘单元宽放不下元素框时只给提示、不改你的数,出纸按你填的排","propertyTips.fl-row-height":"每个单元行的最低高度(毫米),与表格行高同一口径:内容比它高时这一行会撑高,不会裁字","propertyTips.fl-gap-x":"相邻单元之间的横向留白(毫米);纵向不留缝,行与行的距离由行高承担","propertyTips.fl-auto-span":"单元内容比一列还宽时,让它占掉两个或更多列位;当前行剩不够放就把整个单元挪到下一行行首(绝不把词切两半)。默认关——开着时出纸栏数由字号与框宽决定","propertyTips.fl-max-span":"跨列的列数上限,最大只能等于「每行列数」:把每行列数改小时,这里会被一并顶回去","propertyTips.fl-layout-mode":"容器高度由谁决定:固定高度=维持设计高度、一框一页,超高裁切(存量模板默认值,输出不变);动态分页=容器高度由内容撑开,内容满页后按行续页,每一页都画完整边框,元素下方的跟随区与表格同一套规则","propertyTips.fl-padding-top":"动态分页模式下容器顶部与第一行内容之间的留白(毫米),仅动态模式生效;每页切片都按它留白并计入分页预算,负值与非法值按 0 处理","propertyTips.fl-padding-right":"动态分页模式下容器右侧与内容之间的留白(毫米),会压缩参与列宽估算的内容宽度,仅动态模式生效","propertyTips.fl-padding-bottom":"动态分页模式下容器底部与最后一行内容之间的留白(毫米),每页切片都按它留白并计入分页预算,仅动态模式生效","propertyTips.fl-padding-left":"动态分页模式下容器左侧与内容之间的留白(毫米),会压缩参与列宽估算的内容宽度,仅动态模式生效","propertyTips.cd-bar-quiet-zone":"条形码左右两端的空白格数(1 格 = 1 条宽):缺省 10,正是一维码码制要求的下限;数值越小白边越窄、同样的框内条越粗(可放大)。填 0 即不留白边,但静区参与「条→空→条」跳变,紧邻文字或表格线时可能扫不出,需实打验证","propertyTips.cd-bar-height":"黑白条本体的目标高度(mm,不含下方文字):折算粒度就是每模块物理宽,所以只能精确到它的整数倍。条宽优先——可用框高装不下时期望条高让位,绝不把条宽挤窄(热敏出纸清晰度靠条宽)。与「最大高度」分工不同:那条限的是整图(含文字)的上限","propertyTips.cd-quiet-zone":"二维码四周留出的空白格数:0 即不留白边、码面等比铺满元素框(此时靠框外的白纸充当静区);数值越大白边越宽、码面在框内越小(缺省 0,需 ISO/IEC 18004 推荐静区时填 4)"}},x2={propertyTips:{"propertyTips.ap-long-text-indent":'First-line indent for each paragraph of a long-text element, in characters: 2 means two Chinese characters wide (a common CJK convention), laid out in em units — it scales down when "Auto shrink" reduces the font size. Applies to long-text elements only; setting it on plain text has no effect.',"propertyTips.ap-img-fit":"How the image is scaled inside the element box. Contain: show the whole image, possibly with blank space. Crop: fill the box and take a region based on the crop anchor. Stretch: fill the box and distort. Original size / Shrink: never enlarge. The canvas and all three print pipelines use the same rule (Contain by default).","propertyTips.ap-img-object-position":"Crop anchor (only shown for Crop mode): cropping scales the image to fill the box, and this picks which extra edge to keep. Choose a position preset (edge / center / opposite edge), then fine-tune with the percentage: 0 aligns left/top, 100 aligns to the other end; horizontal and vertical are independent. The default is centered (choose Top to keep the head in ID photos). Other fit modes have no crop edge, so this row is hidden.","propertyTips.ap-img-fit-scale":"Crop zoom: after filling the box, enlarge the image by this much so both axes gain a crop margin — when image and box have the same aspect ratio, no zoom means nothing can be cropped. 100 = no zoom (default), maximum 400; anything outside the box is clipped by the element frame. The chosen anchor is both the pinning point and the zoom center. Shown for Crop mode only.","propertyTips.ap-rotate":"Rotation of the element about its own center, in degrees (0–359). During printing, pagination and layout use the rotated bounding box: content that does not fit at the bottom moves to the next page, and content beyond the left/right/top paper edges is clipped with a print warning. Tables, flow lists and elements in the follow-up zone below a table do not support rotation (this row is hidden for them); arbitrary angles for barcodes and QR codes require a 385dpi+ print head — lower-resolution printers only output in 90° steps.","propertyTips.fl-columns":"The number of cells per row must be specified by you — it is never inferred from content. If the column count times the cell width does not fit the element box, you get a hint but your value is not changed, and print output follows what you entered.","propertyTips.fl-row-height":"Minimum height of each cell row, in millimetres, using the same rule as table row height: a row grows when its content is taller, and text is never clipped.","propertyTips.fl-gap-x":"Horizontal whitespace between adjacent cells, in millimetres. No vertical gap is inserted; the distance between rows comes from the row height.","propertyTips.fl-auto-span":"When a cell is wider than one column, let it span two or more columns; if the current row has too few columns left, move the whole cell to the start of the next row (never split a word). Off by default — when on, the printed column count depends on font size and box width.","propertyTips.fl-max-span":'Upper limit for column spanning; it can never exceed "Columns per row". Lowering the column count also pushes this value down.',"propertyTips.fl-layout-mode":"What decides the container height. Fixed height: keep the designed height, one box per page, clip overflow (the default for existing templates, output unchanged). Dynamic pagination: the container grows with its content, continues row by row after a page fills, draws a complete border on every page, and follows the same rules as tables for the follow-up zone below the element.","propertyTips.fl-padding-top":"Whitespace between the top of the container and the first content row in dynamic pagination mode, in millimetres. Only applies in dynamic mode; every page slice uses this padding and counts it in the pagination budget. Negative or invalid values are treated as 0.","propertyTips.fl-padding-right":"Whitespace between the right side of the container and the content in dynamic pagination mode, in millimetres; it reduces the content width available for column-width estimation. Only applies in dynamic mode.","propertyTips.fl-padding-bottom":"Whitespace between the bottom of the container and the last content row in dynamic pagination mode, in millimetres. Only applies in dynamic mode; every page slice uses this padding and counts it in the pagination budget.","propertyTips.fl-padding-left":"Whitespace between the left side of the container and the content in dynamic pagination mode, in millimetres; it reduces the content width available for column-width estimation. Only applies in dynamic mode.","propertyTips.cd-bar-quiet-zone":"Number of blank modules on each side of a barcode (1 module = 1 bar width): the default of 10 is the minimum required by 1D symbologies. Smaller values narrow the quiet zone and make bars thicker in the same box (they can be enlarged). Setting 0 removes the white margin, but the quiet zone participates in bar-space-bar transitions, so codes next to text or table lines may fail to scan — verify with a real print.","propertyTips.cd-bar-height":'Target height of the black bars themselves, in millimetres (excluding the text below). The granularity is the physical width of one module, so only integer multiples are exact. Bar width takes priority: if the available height cannot fit the desired bar height, the height gives way — bars are never narrowed (thermal print clarity depends on bar width). This differs from "Maximum height", which limits the whole image including text.',"propertyTips.cd-quiet-zone":"Number of blank modules around a QR code: 0 means no white margin and the code scales to fill the element box (the surrounding white paper acts as the quiet zone). Larger values widen the margin and make the code smaller in the box. The default is 0; use 4 for the quiet zone recommended by ISO/IEC 18004."}},P2={propertyTips:{"propertyTips.ap-long-text-indent":'ระยะเว้นบรรทัดแรกของแต่ละย่อหน้าในข้อความยาว หน่วยเป็นอักขระ: ใส่ 2 หมายถึงเว้นสองตัวอักษรจีน (ตามธรรมเนียม CJK) คำนวณเป็นหน่วย em — จะย่อตามเมื่อ "ย่ออัตโนมัติ" ลดขนาดฟอนต์ ใช้เฉพาะองค์ประกอบข้อความยาว การตั้งค่าบนข้อความธรรมดาไม่มีผล',"propertyTips.ap-img-fit":"วิธีปรับขนาดรูปภาพภายในกรอบองค์ประกอบ พอดี: แสดงรูปทั้งหมดอาจมีช่องว่าง ครอบ: เติมกรอบแล้วตัดตามจุดยึดการครอป ดึง: เติมกรอบและบิดเบือน ขนาดต้นฉบับ/ย่อ: ไม่ขยาย พื้นที่ทำงานและทั้งสามไปป์ไลน์การพิมพ์ใช้กฎเดียวกัน (ค่าเริ่มต้นพอดี)","propertyTips.ap-img-object-position":"จุดยึดการครอป (แสดงเฉพาะโหมดครอบ): การครอปปรับรูปให้เติมกรอบ ตัวเลือกนี้เลือกขอบส่วนเกินที่ต้องการคงไว้ เลือกระดับตำแหน่ง (ชิดขอบ/กลาง/ชิดอีกด้าน) แล้วปรับด้วยเปอร์เซ็นต์: 0 ชิดซ้าย/บน 100 ชิดขวา/ล่าง แนวนอนและแนวตั้งอิสระต่อกัน ค่าเริ่มต้นอยู่กึ่งกลาง (เลือก บน เพื่อคงศีรษะในรูปบัตรประจำตัว) โหมดอื่นไม่มีขอบให้ครอปจึงซ่อนบรรทัดนี้","propertyTips.ap-img-fit-scale":"ขยายการครอป: หลังเติมกรอบแล้วขยายภาพอีกมากน้อยเพียงนี้ เพื่อให้ทั้งสองแกนมีขอบให้ครอป — เมื่อรูปและกรอบมีอัตราส่วนเท่ากัน การไม่ขยายจะครอปไม่ได้เลย 100 = ไม่ขยาย (ค่าเริ่มต้น) สูงสุด 400 ส่วนที่เกินกรอบถูกตัดโดยกรอบองค์ประกอบ จุดยึดที่เลือกเป็นทั้งจุดตรึงและศูนย์กลางการขยาย แสดงเฉพาะโหมดครอบ","propertyTips.ap-rotate":"มุมหมุนขององค์ประกอบรอบจุดศูนย์กลางตัวเอง เป็นองศา (0–359) ขณะพิมพ์ การแบ่งหน้าและการจัดวางใช้กล่องล้อมรอบที่หมุนแล้ว: เนื้อหาที่ไม่พอด้านล่างย้ายไปหน้าถัดไป และเนื้อหาที่เกินขอบกระดาษซ้าย/ขวา/บนถูกตัดพร้อมคำเตือน ตาราง รายการแบบไหล และองค์ประกอบในโซนตามหลังตารางไม่รองรับการหมุน (ซ่อนบรรทัดนี้); มุมใดๆ ของบาร์โค้ดและคิวอาร์โค้ดต้องการหัวพิมพ์ 385dpi ขึ้นไป — เครื่องพิมพ์ความละเอียดต่ำกว่าส่งออกได้เฉพาะขั้น 90°","propertyTips.fl-columns":"จำนวนเซลล์ต่อแถวต้องระบุเองเสมอ — ไม่คำนวณจากเนื้อหา หากจำนวนคอลัมน์คูณความกว้างเซลล์ไม่พอดีกับกรอบองค์ประกอบจะมีคำแนะนำแต่ค่าไม่เปลี่ยน และผลการพิมพ์เป็นไปตามที่ป้อน","propertyTips.fl-row-height":"ความสูงขั้นต่ำของแถวเซลล์แต่ละแถว เป็นมิลลิเมตร ใช้กฎเดียวกับความสูงแถวตาราง: แถวจะสูงขึ้นเมื่อเนื้อหาสูงกว่า และข้อความไม่ถูกตัด","propertyTips.fl-gap-x":"ช่องว่างแนวนอนระหว่างเซลล์ที่อยู่ติดกัน เป็นมิลลิเมตร ไม่มีการเว้นช่องแนวตั้ง ระยะระหว่างแถวมาจากความสูงแถว","propertyTips.fl-auto-span":"เมื่อเซลล์กว้างกว่าหนึ่งคอลัมน์ ให้ขยายครอบสองคอลัมน์ขึ้นไป; หากแถวปัจจุบันเหลือคอลัมน์ไม่พอ ย้ายเซลล์ทั้งหมดไปขึ้นต้นแถวถัดไป (ไม่ตัดคำ) ปิดอยู่โดยค่าเริ่มต้น — เมื่อเปิด จำนวนคอลัมน์ที่พิมพ์ขึ้นกับขนาดฟอนต์และความกว้างกรอบ","propertyTips.fl-max-span":'ขีดจำกัดบนของการขยายคอลัมน์ ห้ามเกิน "จำนวนคอลัมน์ต่อแถว" การลดจำนวนคอลัมน์จะดันค่านี้ลงด้วย',"propertyTips.fl-layout-mode":"อะไรเป็นตัวกำหนดความสูงของคอนเทนเนอร์ ความสูงคงที่: คงความสูงที่ออกแบบ หนึ่งกรอบต่อหน้า ตัดส่วนเกิน (ค่าเริ่มต้นของเทมเพลตเดิม ผลไม่เปลี่ยน) การแบ่งหน้าแบบไดนามิก: คอนเทนเนอร์ ขยายตามเนื้อหา ดำเนินต่อเป็นแถวหลังหน้าเต็ม วาดเส้นขอบครบทุกหน้า และปฏิบัติตามกฎเดียวกับตารางสำหรับโซนตามหลังองค์ประกอบ","propertyTips.fl-padding-top":"ช่องว่างระหว่างด้านบนของคอนเทนเนอร์กับแถวเนื้อหาแรกในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร ใช้เฉพาะโหมดไดนามิก ทุกชิ้นของหน้าใช้ระยะนี้และนับรวมในงบการแบ่งหน้า ค่าติดลบหรือไม่ถูกต้องถือเป็น 0","propertyTips.fl-padding-right":"ช่องว่างระหว่างด้านขวาของคอนเทนเนอร์กับเนื้อหาในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร จะลดความกว้างเนื้อหาที่ใช้คำนวณความกว้างคอลัมน์ ใช้เฉพาะโหมดไดนามิก","propertyTips.fl-padding-bottom":"ช่องว่างระหว่างด้านล่างของคอนเทนเนอร์กับแถวเนื้อหาสุดท้ายในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร ใช้เฉพาะโหมดไดนามิก ทุกชิ้นของหน้าใช้ระยะนี้และนับรวมในงบการแบ่งหน้า","propertyTips.fl-padding-left":"ช่องว่างระหว่างด้านซ้ายของคอนเทนเนอร์กับเนื้อหาในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร จะลดความกว้างเนื้อหาที่ใช้คำนวณความกว้างคอลัมน์ ใช้เฉพาะโหมดไดนามิก","propertyTips.cd-bar-quiet-zone":"จำนวนโมดูลว่างสองข้างของบาร์โค้ด (1 โมดูล = 1 ความกว้างแท่น): ค่าเริ่มต้น 10 คือค่าต่ำสุดที่รหัสแบบหนึ่งมิติต้องการ ค่าที่เล็กลงทำให้โซนเงียบแคบและแท่นหนาขึ้นในกรอบเดียวกัน (สามารถขยายได้) การตั้ง 0 ลบขอบขาว แต่โซนเงียบมีส่วนในการเปลี่ยนแท่น-ช่อง-แท่น รหัสที่อยู่ติดข้อความหรือเส้นตารางอาจสแกนไม่ได้ — ตรวจด้วยการพิมพ์จริง","propertyTips.cd-bar-height":'ความสูงเป้าหมายของแท่นดำเอง เป็นมิลลิเมตร (ไม่รวมข้อความด้านล่าง) ความละเอียดคือความกว้างทางกายภาพของหนึ่งโมดูล จึงแม่นยำเฉพาะจำนวนเต็มเท่านั้น ความกว้างแท่นมีสิทธิ์ก่อน: หากความสูงที่มีไม่พอตามที่ต้องการ ความสูงจะยอมตาม — ไม่เคยทำให้แท่นแคบลง (ความชัดของการพิมพ์ความร้อนขึ้นกับความกว้างแท่น) ต่างจาก "ความสูงสูงสุด" ที่จำกัดทั้งภาพรวมข้อความ',"propertyTips.cd-quiet-zone":"จำนวนโมดูลว่างรอบคิวอาร์โค้ด: 0 หมายถึงไม่มีขอบขาวและรหัสขยายเติมกรอบ (กระดาษขาวรอบนอกทำหน้าที่โซนเงียบ) ค่าที่ใหญ่ขึ้นทำให้ขอบกว้างและรหัสเล็กลงในกรอบ ค่าเริ่มต้น 0 ใช้ 4 สำหรับโซนเงียบตามที่ ISO/IEC 18004 แนะนำ"}};function sn(e){if(typeof e!="string")return"zh-CN";const t=e.trim();return t?/^en([-_]|$)/i.test(t)?"en-US":/^th([-_]|$)/i.test(t)?"th-TH":t:"zh-CN"}function Eh(){try{if(typeof navigator<"u"&&typeof navigator.language=="string")return sn(navigator.language)}catch{}return"zh-CN"}function E2(){const e=Da();return e.init({resources:{"zh-CN":{core:c2,constants:k2.constants,propertyTips:w2.propertyTips},"en-US":{core:h2,constants:y2.constants,propertyTips:x2.propertyTips},"th-TH":{core:b2,constants:v2.constants,propertyTips:P2.propertyTips}},lng:Eh(),fallbackLng:"zh-CN",ns:["core"],defaultNS:"core",keySeparator:!1,nsSeparator:!1,interpolation:{prefix:"{",suffix:"}",escapeValue:!1},returnNull:!1,returnEmptyString:!1,saveMissing:!0,missingKeyHandler:()=>{}}),e}var Qi=E2(),S2=new Set,Sh=new Set,T2=new Set;Qi.on("missingKey",(e,t,r)=>{Qi.exists(r,{lng:"zh-CN"})||S2.add(r)});function Th(){return Eh()}function M2(){return Th()}function ea(e,t){return typeof e=="string"?e:e==null?t:String(e)}function C2(e,t,r){const o=Qi.getFixedT(sn(e),Ch()),n=r?o(t,r):o(t);return ea(n,t)}function lr(e,t){return C2(Th(),e,t)}var Mh=new WeakMap;function _2(e){let t=Mh.get(e);return t||(t=Da(),t.init({resources:{},lng:"zh-CN",fallbackLng:!1,ns:["user"],defaultNS:"user",keySeparator:!1,nsSeparator:!1,interpolation:{prefix:"{",suffix:"}",escapeValue:!1},returnNull:!1,returnEmptyString:!1}),Mh.set(e,t)),t}function ta(e,t){const r=sn(e),o=Qi.getFixedT(r,Ch());if(!t)return(a,s)=>ea(s?o(a,s):o(a),a);const n=_2(t);n.addResourceBundle(r,"user",t,!0,!0);const i=n.getFixedT(r,"user");return(a,s)=>{const p=ea(s?i(a,s):i(a),"");return p!==""&&p!==a?p:ea(s?o(a,s):o(a),a)}}function Ch(){return["user",...T2,"constants","propertyTips","core"]}function _h(e){return Sh.add(e),()=>{Sh.delete(e)}}var Dh=Symbol.for("worm-print-platform.element-ui-registry.v1"),Ah=globalThis;function kl(){const e=Ah[Dh];if(e)return e;const t={entries:new Map,listeners:new Set,nextSeq:0};return Ah[Dh]=t,t}function D2(e){if(e)return kl().entries.get(e)?.ui}function A2(){const e=[...kl().entries.entries()];return e.sort((t,r)=>t[1].seq-r[1].seq),e.map(([t,r])=>({type:t,ui:r.ui}))}function O2(e){const t=kl();return t.listeners.add(e),()=>{t.listeners.delete(e)}}function g(e,t={},r=[]){return{tag:e,props:t,children:r}}var yl="http://www.w3.org/2000/svg",R2=new Set(["draggable","contenteditable","spellcheck"]),I2=new Set(["indeterminate"]);function L2(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="g"}function N2(e){return e instanceof Element&&e.namespaceURI===yl}function rt(e,t){if(typeof e=="string"){const a=document.createTextNode(e);return t.appendChild(a),a}if(e instanceof Node)return t.appendChild(e),e;const{tag:r,props:o,children:n}=e,i=L2(r)||N2(t)?document.createElementNS(yl,r):document.createElement(r);for(const[a,s]of Object.entries(o))if(!(s==null||s===!1))if(a==="class")i.setAttribute("class",String(s));else if(a==="style")typeof s=="string"?i.style.cssText=s:Object.assign(i.style,s);else if(a==="html")i.innerHTML=String(s);else if(a==="text")i.textContent=String(s);else if(a.startsWith("on")&&typeof s=="function")i.addEventListener(a.slice(2).toLowerCase(),s);else if(a==="dataset")for(const[p,l]of Object.entries(s))i.dataset[p]=l;else I2.has(a)?i[a]=!0:typeof s=="boolean"?s&&i.setAttribute(a,R2.has(a)?"true":""):i.setAttribute(a,String(s));for(const a of n)rt(a,i);return t.appendChild(i),i}function Oh(e){for(;e.firstChild;)e.removeChild(e.firstChild)}var B2=yl;function ln(){return{paperSize:"A4",orientation:"portrait",unit:"mm",margins:{top:10,right:10,bottom:10,left:10},header:{height:10,elements:[]},footer:{height:10,elements:[]},elements:[],watermark:{}}}const F2="开启拼版后只能有一个设计页面",Rh=()=>lr("store.tilingSinglePage");function vl(e){const t=(r,o)=>(r??[]).map(n=>{const i={...n.options};return(n.printElementType?.type??n.type)==="table"&&Eo(i),{id:n.id||Xr(),zone:o,options:i,printElementType:{...n.printElementType}}});return{...e,margins:{...e.margins},header:{height:e.header?.height??10,elements:[]},footer:{height:e.footer?.height??10,elements:[]},guides:[...e.guides??[]],elements:[...t(e.elements??[],"content"),...t(e.header?.elements??[],"header"),...t(e.footer?.elements??[],"footer")]}}function Ih(e){const t=e.elements,r=o=>t.filter(n=>(n.zone||"content")===o).map(n=>({id:n.id,type:n.printElementType.type,options:{...n.options},printElementType:{...n.printElementType}}));return{unit:"mm",...e,header:{...e.header,elements:r("header")},footer:{...e.footer,elements:r("footer")},elements:r("content"),guides:[...e.guides??[]]}}function Lh(e){const t=(o,n)=>{const i=vl(N0(o));return i.name||(i.name=`页面 ${n+1}`),i};if(!e)return[t(ln(),0)];const r=Array.isArray(e.pages)?e.pages:[e];return r.length?r.map(t):[t(ln(),0)]}const so=e=>JSON.parse(JSON.stringify(e));class Nh{scale=100;showRuler=!0;showGrid=!0;snapToGrid=!1;showTableGhostBorder=!0;dirty=!1;pages;activePageIndex=0;fields;selectedIds=new Set;previewIds=new Set;tableSelection=null;draggingIds=new Set;adsorbGuides=[];live=new Map;clipboard=[];moveSessionActive=!1;moveTimer=null;dragBefore=null;undoStack=[];redoStack=[];listeners=new Set;align=Oy();group=Ry();constructor(t={}){if(this.pages=Lh(t.initialTemplate),this.fields=t.initialFields??[],t.initialElements?.length){const r=this.pages[0];r.elements=[...r.elements,...t.initialElements]}}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}emit(t=!0){t&&(this.dirty=!0);for(const r of[...this.listeners])r()}get templateData(){return this.pages[this.activePageIndex]}set templateData(t){this.pages[this.activePageIndex]=t}get elements(){return this.templateData.elements.map(t=>this.live.get(t.id)??t)}get tilingEnabled(){return this.pages.some(t=>t.tiling?.enabled===!0)}switchPage(t){t<0||t>=this.pages.length||(this.activePageIndex=t,this.resetSelection(),this.emit(!1))}addPage(){if(this.tilingEnabled){window.alert(Rh());return}this.recordHistory();const t=this.pages[this.activePageIndex]??ln();this.pages.push(vl({...ln(),paperSize:t.paperSize,orientation:t.orientation,outputRotation:t.outputRotation,customWidth:t.customWidth,customHeight:t.customHeight,name:this.nextDefaultPageName()})),this.switchPage(this.pages.length-1),this.emit()}nextDefaultPageName(){const t=new Set(this.pages.map(o=>o.name));let r=this.pages.length+1;for(;t.has(`页面 ${r}`);)r++;return`页面 ${r}`}duplicatePage(t){if(this.tilingEnabled){window.alert(Rh());return}this.recordHistory();const r=so(this.pages[t]);r.name=`${r.name??`页面 ${t+1}`} 副本`,r.elements=r.elements.map(o=>({...o,id:Xr()})),this.pages.splice(t+1,0,r),this.switchPage(t+1),this.emit()}deletePage(t){this.pages.length<=1||(this.recordHistory(),this.pages.splice(t,1),this.activePageIndex=Math.max(0,Math.min(this.activePageIndex,this.pages.length-1)),this.resetSelection(),this.emit())}renamePage(t,r){this.recordHistory(),this.pages[t].name=r,this.emit()}movePage(t,r){if(r<0||r>=this.pages.length||t===r)return;this.recordHistory();const[o]=this.pages.splice(t,1);this.pages.splice(r,0,o),this.activePageIndex=r,this.emit()}onSelectionChanged;setSelection(t){this.selectedIds=t,this.onSelectionChanged?.(),this.emit(!1)}select(t){this.setSelection(new Set(t))}selectOne(t,r=!1){if(r){const o=new Set(this.selectedIds);o.has(t)?o.delete(t):o.add(t),this.setSelection(o)}else this.setSelection(new Set([t]))}clearSelection(){this.setSelection(new Set)}selectElement(t,r=!1){if(r){this.selectOne(t,!0);return}this.setSelection(new Set(this.group.getGroupedIds(this.elements,t)))}selectAll(){this.setSelection(new Set(this.elements.map(t=>t.id)))}get selectedElements(){return this.elements.filter(t=>this.selectedIds.has(t.id))}get selectedElement(){const t=this.selectedIds.values().next().value;return t?this.elements.find(r=>r.id===t)??null:null}resetSelection(){this.selectedIds=new Set,this.tableSelection=null,this.onSelectionChanged?.()}setTableSelection(t){this.tableSelection=t,this.emit(!1)}setPreview(t){this.previewIds=t,this.emit(!1)}commitPreview(){this.previewIds=new Set,this.emit(!1)}addGuide(t,r){const o=this.templateData.guides??[];this.templateData.guides=[...o,{id:Xr(),type:t,position:Math.round(r*10)/10}],this.emit()}moveGuide(t,r){const o=this.templateData.guides??[];this.templateData.guides=o.map(n=>n.id===t?{...n,position:Math.round(r*10)/10}:n),this.emit(!1)}removeGuide(t){this.templateData.guides=(this.templateData.guides??[]).filter(r=>r.id!==t),this.emit()}addElement(t,r={},o){const n=ts(t,r);return o&&!this.placeAtDropPoint(n,o)||(this.recordHistory(),this.templateData.elements.push(n),this.select(new Set([n.id])),this.emit()),n}addFieldElement(t,r={},o,n=!1){const i=n?Dy(t):_y(t);return Object.assign(i.options,r),o&&!this.placeAtDropPoint(i,o)||(this.recordHistory(),this.templateData.elements.push(i),this.select(new Set([i.id])),this.emit()),i}placeAtDropPoint(t,r){const o=this.templateData,n=ac(o,r.x,r.y);if(n!=="content"&&!ic(t.printElementType.type))return alert("该元素类型不能放入页眉/页脚"),!1;const i=ss(o)[n];return t.zone=n,t.options.left=r.x-i.left,t.options.top=r.y-i.top,n!=="content"&&ls(t,i),!0}deleteSelected(){this.selectedIds.size&&(this.recordHistory(),this.templateData.elements=this.templateData.elements.filter(t=>!this.selectedIds.has(t.id)),this.selectedIds=new Set,this.emit())}livePatch(t,r){const o=this.templateData.elements.find(i=>i.id===t);if(!o)return;const n=this.live.get(t)??o;this.live.set(t,{...n,options:{...n.options,...r}})}commitLive(){if(!this.live.size)return;this.recordHistory();const t=this.templateData.elements;for(const[r,o]of this.live){const n=t.find(i=>i.id===r);n&&Object.assign(n.options,o.options)}this.live.clear(),this.emit()}dragIds(t){const r=this.templateData.elements.find(o=>o.id===t);return!r||r.options.locked?[]:Array.from(this.group.getGroupedIds(this.elements,t))}discardLive(){this.live.clear()}dragStart(){this.dragBefore=new Map(this.elements.map(t=>[t.id,this.geoSig(t)]))}dragStop(){const t=this.dragBefore;if(!t)return;this.dragBefore=null;let r=!1;for(const o of this.elements){const n=t.get(o.id);!n||n===this.geoSig(o)||o1(o,this.templateData).rejected&&(r=!0)}r&&alert("该元素类型不能放入页眉/页脚"),this.emit()}geoSig(t){return`${t.zone||"content"}:${t.options.left},${t.options.top},${t.options.width},${t.options.height}`}updateElement(t,r,o=!0){o&&this.recordHistory();const n=this.templateData.elements.find(i=>i.id===t);n&&(Object.assign(n.options,r),n.printElementType.type==="table"&&Eo(n.options),this.emit())}updateTemplateData(t){this.recordHistory(),Object.assign(this.templateData,t);for(const r of["paperSize","customWidth","customHeight"])if(r in t)for(const o of this.pages)Object.assign(o,{[r]:t[r]});this.emit()}moveLayer(t){if(!this.selectedIds.size)return;this.recordHistory();const r=this.templateData.elements,o=r.filter(i=>this.selectedIds.has(i.id)),n=r.filter(i=>!this.selectedIds.has(i.id));if(t==="top")this.templateData.elements=[...n,...o];else if(t==="bottom")this.templateData.elements=[...o,...n];else{const i=r.findIndex(p=>this.selectedIds.has(p.id)),a=t==="up"?i+1:i-1;if(a<0||a>=r.length)return;const s=[...r];[s[i],s[a]]=[s[a],s[i]],this.templateData.elements=s}this.emit()}alignSelected(t){this.selectedIds.size<2||(this.recordHistory(),this.align.align(this.elements.filter(r=>this.selectedIds.has(r.id)),t),this.emit())}groupSelected(){this.selectedIds.size<2||(this.recordHistory(),this.templateData.elements=this.group.group(this.elements,this.selectedIds),this.emit())}ungroupSelected(){this.selectedIds.size&&(this.recordHistory(),this.templateData.elements=this.group.ungroup(this.elements,this.selectedIds),this.emit())}copy(){this.clipboard=so(this.selectedElements),this.emit(!1)}cutSelected(){this.copy(),this.deleteSelected()}paste(t=10){if(!this.clipboard.length)return;this.recordHistory();const r=new Map;for(const i of this.clipboard){const a=i.options.groupId;a&&r.set(a,(r.get(a)??0)+1)}const o=new Map;for(const[i,a]of r)o.set(i,a>=2?Au():void 0);const n=this.templateData.elements;for(const i of this.clipboard){const a=so(i);a.id=Xr(),a.options.left+=t,a.options.top+=t,a.options.groupId=a.options.groupId?o.get(a.options.groupId):void 0,n.push(a)}this.emit()}duplicateSelected(){if(this.copy(),!this.clipboard.length)return;this.paste(15);const t=this.templateData.elements;this.selectOne(t[t.length-this.clipboard.length].id)}get hasClipboard(){return this.clipboard.length>0}moveSelected(t,r){const o=this.selectedElements.filter(n=>!n.options.locked);if(o.length){this.moveSessionActive||(this.moveSessionActive=!0,this.recordHistory());for(const n of o)n.options.left+=t,n.options.top+=r;this.moveTimer&&clearTimeout(this.moveTimer),this.moveTimer=setTimeout(()=>{this.moveSessionActive=!1,this.moveTimer=null},300),this.emit()}}cloneElement(t){this.recordHistory(),this.templateData.elements.push(t),this.selectedIds=new Set([t.id]),this.emit()}recordHistory(){this.undoStack.push({pages:so(this.pages),activePageIndex:this.activePageIndex}),this.undoStack.length>100&&this.undoStack.shift(),this.redoStack=[]}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}undo(){const t=this.undoStack.pop();t&&(this.redoStack.push({pages:so(this.pages),activePageIndex:this.activePageIndex}),this.pages=t.pages,this.activePageIndex=Math.min(t.activePageIndex,t.pages.length-1),this.resetSelection(),this.emit())}redo(){const t=this.redoStack.pop();t&&(this.undoStack.push({pages:so(this.pages),activePageIndex:this.activePageIndex}),this.pages=t.pages,this.activePageIndex=Math.min(t.activePageIndex,t.pages.length-1),this.resetSelection(),this.emit())}resetZoom(){this.setScale(100)}setScale(t,r=Vn){this.scale=Math.max(r,Math.round(t)),this.emit(!1)}getTemplateJson(){const t=this.pages.map(Ih),r=t.length===1?t[0]:{version:1,pages:t};return JSON.stringify(r)}loadTemplate(t){this.pages=Lh(t),this.activePageIndex=0,this.resetSelection(),this.recordHistory(),this.emit()}get paperSize(){return ir(this.templateData)}}const Rr=Symbol("mixed"),wl=new Set(["text","longText"]),$2=["top","right","bottom","left"],z2={on:!0,off:!1,mixed:Rr};function Bh(e){const t=Kd(e),r={};for(const o of $2)r[o]=z2[t[o]];return r}const H2=["fontFamily","fontSize","fontWeight","color","textAlign","verticalAlign","textDecoration"];class U2{constructor(t){this.store=t}store;borderStyle="solid";borderWidth=.75;borderColor="#333333";borderMixed={style:!1,width:!1,color:!1};borderDraftKey="";get borderMixedAny(){return this.borderMixed.style||this.borderMixed.width||this.borderMixed.color}painterActive=!1;painterLocked=!1;painterSource=null;painterSnapshot=null;get selectedElements(){return this.store.elements.filter(t=>this.store.selectedIds.has(t.id)&&!t.options.locked)}get tableElement(){const t=this.store.tableSelection;return t?this.store.elements.find(r=>r.id===t.elementId)??null:null}get context(){return this.store.tableSelection&&this.tableElement?"cells":this.selectedElements.length>0||this.store.selectedIds.size>0?"elements":"none"}get targetCells(){const t=this.store.tableSelection,r=this.tableElement?.options.tableRows;if(!t||!r)return[];const o=[];for(let n=t.r1;n<=t.r2;n++)for(let i=t.c1;i<=t.c2;i++){const a=r[n]?.cells[i];a&&!a.merged&&o.push(a)}return o}get textTargets(){return this.selectedElements.filter(t=>wl.has(t.printElementType.type))}get fontEditable(){return this.context==="cells"?this.targetCells.length>0:this.context!=="elements"?!1:this.selectedElements.length>0&&this.textTargets.length===this.selectedElements.length}get styleTargets(){return this.context==="cells"?this.targetCells:this.textTargets.map(t=>t.options)}pick(t){if(!t.length)return;const r=t[0];return t.every(o=>o===r)?r:Rr}hasToken(t,r){return(t??"").split(/\s+/).includes(r)}get values(){const t=this.styleTargets;if(!t.length)return{fontFamily:void 0,fontSize:void 0,color:void 0,backgroundColor:void 0,textAlign:void 0,verticalAlign:void 0,bold:!1,underline:!1,strike:!1};const r=t.map(n=>n.fontWeight==="bold"||n.fontWeight==="bolder"),o=t.map(n=>n.textDecoration);return{fontFamily:this.pick(t.map(n=>n.fontFamily)),fontSize:this.pick(t.map(n=>n.fontSize)),color:this.pick(t.map(n=>n.color)),backgroundColor:this.pick(t.map(n=>n.backgroundColor)),textAlign:this.pick(t.map(n=>this.context==="cells"?n.align:n.textAlign)),verticalAlign:this.pick(t.map(n=>this.context==="cells"?n.valign:n.verticalAlign)),bold:r.every(Boolean)?!0:r.some(Boolean)?Rr:!1,underline:o.map(n=>this.hasToken(n,"underline")).every(Boolean)?!0:o.some(n=>this.hasToken(n,"underline"))?Rr:!1,strike:o.map(n=>this.hasToken(n,"line-through")).every(Boolean)?!0:o.some(n=>this.hasToken(n,"line-through"))?Rr:!1}}commit(){this.store.recordHistory(),this.store.emit()}writeCells(t){const r=this.targetCells;r.length&&(r.forEach(t),this.commit())}applyStyle(t){if(this.context==="cells"){this.writeCells(s=>{"fontFamily"in t&&(s.fontFamily=t.fontFamily),"fontSize"in t&&(s.fontSize=t.fontSize),"color"in t&&(s.color=t.color),"backgroundColor"in t&&(s.backgroundColor=t.backgroundColor),"textAlign"in t&&(s.align=t.textAlign),"verticalAlign"in t&&(s.valign=t.verticalAlign)});return}const r=this.textTargets,o=this.selectedElements,i=["fontFamily","fontSize","color","textAlign","verticalAlign"].some(s=>s in t),a="backgroundColor"in t;!(r.length&&i)&&!(o.length&&a)||(r.forEach(s=>{const p=s.options;"fontFamily"in t&&(p.fontFamily=t.fontFamily),"fontSize"in t&&(p.fontSize=t.fontSize),"color"in t&&(p.color=t.color),"textAlign"in t&&(p.textAlign=t.textAlign),"verticalAlign"in t&&(p.verticalAlign=t.verticalAlign)}),a&&o.forEach(s=>{s.options.backgroundColor=t.backgroundColor}),this.commit())}toggleBold(){if(this.context==="cells"){const o=this.values.bold!==!0;this.writeCells(n=>{n.fontWeight=o?"bold":void 0});return}const t=this.values.bold!==!0,r=this.textTargets;r.length&&(r.forEach(o=>{o.options.fontWeight=t?"bold":"normal"}),this.commit())}toggleDecoration(t){if(this.context==="cells")return;const r=this.textTargets;if(!r.length)return;const o=this.values[t==="underline"?"underline":"strike"]!==!0;r.forEach(n=>{const i=(n.options.textDecoration??"").split(/\s+/).filter(Boolean),a=i.indexOf(t);o&&a<0&&i.push(t),!o&&a>=0&&i.splice(a,1),n.options.textDecoration=i.length?i.join(" "):void 0}),this.commit()}toggleUnderline(){this.toggleDecoration("underline")}toggleStrike(){this.toggleDecoration("line-through")}syncBorderDraft(){if(this.context!=="cells"){this.borderDraftKey&&(this.borderDraftKey="",this.borderStyle="solid",this.borderWidth=.75,this.borderColor="#333333",this.borderMixed={style:!1,width:!1,color:!1});return}const t=this.store.tableSelection,r=this.tableElement?.options.tableRows;if(!t||!r)return;const o=`cells:${t.elementId}:${t.r1}:${t.c1}:${t.r2}:${t.c2}`;if(o===this.borderDraftKey)return;if(this.borderDraftKey=o,La(r,t).mode==="multi"){this.borderStyle="solid",this.borderWidth=.75,this.borderColor="#333333",this.borderMixed={style:!1,width:!1,color:!1};return}const n=ad(r,t);if(n.style===void 0&&n.width===void 0&&n.color===void 0){this.borderMixed={style:!1,width:!1,color:!1},this.borderStyle=null,this.borderWidth=0,this.borderColor="#333333";return}this.borderMixed={style:n.style==="mixed",width:n.width==="mixed",color:n.color==="mixed"},this.borderMixed.style?this.borderStyle=null:n.style===void 0?this.borderStyle="solid":n.style==="none"?this.borderStyle=null:this.borderStyle=n.style,this.borderWidth=this.borderMixed.width?void 0:typeof n.width=="number"?n.width:.75,this.borderColor=this.borderMixed.color?void 0:typeof n.color=="string"?n.color:"#333333"}borderSpec(){const t=this.borderStyle??(this.borderMixed.style?"solid":"none");return{width:this.borderWidth??.75,style:t,color:this.borderColor??"#333333"}}setBorderWidth(t){this.borderWidth=t,this.borderMixed.width=!1}setBorderColor(t){this.borderColor=t,this.borderMixed.color=!1}settleBorderDraft(){this.context==="cells"&&(this.borderMixed.style&&(this.borderStyle="solid",this.borderMixed.style=!1),this.borderMixed.width&&(this.borderWidth=.75,this.borderMixed.width=!1),this.borderMixed.color&&(this.borderColor="#333333",this.borderMixed.color=!1))}toggleBorderStyle(t){const r=this.borderStyle===t?null:t;this.borderMixed.style=!1,this.borderStyle=r,r===null?this.borderWidth=0:this.borderWidth===0&&(this.borderWidth=.75)}applyElementBorder(t,r){const o=this.selectedElements;o.length&&(o.forEach(n=>{Xd(n.options,t,r)}),this.commit())}applyCellBorderPreset(t,r){const o=this.store.tableSelection,n=this.tableElement?.options.tableRows;!o||!n||(nd(n,{r1:o.r1,c1:o.c1,r2:o.r2,c2:o.c2},t,r),this.commit())}applyCellBorderEdges(t,r,o){this.writeCells(n=>{for(const i of t)id(n,i,o?r:null)})}get cellEdges(){if(this.context!=="cells")return null;const t=this.targetCells;return t.length?Bh(t.map(r=>r.borders)):null}toggleCellEdge(t,r){const o=this.cellEdges?.[t]!==!0;this.applyCellBorderEdges([t],r,o)}get elementEdges(){if(this.context!=="elements")return null;const t=this.selectedElements;return t.length?Bh(t.map(r=>$0(r.options))):null}toggleElementEdge(t,r){const o=this.selectedElements;if(!o.length)return;const n=this.elementEdges?.[t]!==!0;o.forEach(i=>is(i.options,t,n,r)),this.commit()}applyBorderPreset(t){const r=this.borderStyle===null;if(this.context==="cells"){const o=r&&!this.borderMixed.style;this.applyCellBorderPreset(o?"none":t,this.borderSpec()),this.settleBorderDraft()}else this.applyElementBorder(r||t==="none"?"none":"all",this.borderSpec())}applyEdge(t){if(this.borderStyle===null&&!this.borderMixed.style){this.context==="cells"?(this.applyCellBorderEdges([t],this.borderSpec(),!1),this.settleBorderDraft()):this.clearElementEdge(t);return}this.context==="cells"?(this.toggleCellEdge(t,this.borderSpec()),this.settleBorderDraft()):this.toggleElementEdge(t,this.borderSpec())}clearElementEdge(t){const r=this.selectedElements;r.length&&(r.forEach(o=>is(o.options,t,!1)),this.commit())}edgeOn(t){return(this.context==="cells"?this.cellEdges:this.elementEdges)?.[t]===!0}get painterCapturable(){return this.selectedElements.length===1}clonePainterBorders(t){if(!t)return;const r={};for(const o of Ao){const n=t[o];n&&(r[o]={...n})}return r}pickPainterSource(t=!1){const r=this.selectedElements[0];if(!r)return!1;const o=r.options,n=r.printElementType.type;return this.painterSnapshot={text:wl.has(n)?Object.fromEntries(H2.map(i=>[i,o[i]])):null,backgroundColor:o.backgroundColor,border:$n(n)?{borderWidth:o.borderWidth,borderStyle:o.borderStyle,borderColor:o.borderColor,borders:this.clonePainterBorders(o.borders)}:null},this.painterSource=r.id,this.painterActive=!0,this.painterLocked=t,!0}cancelPainter(){this.painterActive=!1,this.painterLocked=!1,this.painterSource=null,this.painterSnapshot=null}applyPainter(t){const r=this.painterSnapshot;if(!r||t.options.locked||t.id===this.painterSource)return!1;const o=t.options,n=t.printElementType.type;return r.text&&wl.has(n)&&Object.assign(o,r.text),o.backgroundColor=r.backgroundColor,r.border&&$n(n)&&(o.borderWidth=r.border.borderWidth,o.borderStyle=r.border.borderStyle,o.borderColor=r.border.borderColor,o.borders=this.clonePainterBorders(r.border.borders)),!0}painterSyncSelection(){if(!this.painterActive||!this.painterSnapshot)return;const t=this.selectedElements;if(!t.length){this.cancelPainter();return}let r=!1;t.forEach(o=>{r=this.applyPainter(o)||r}),r&&(this.commit(),this.painterLocked||this.cancelPainter())}handlePainterKeydown(t){if(t.key!=="Escape"||!this.painterActive)return;const r=t.target?.tagName;r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||this.cancelPainter()}}const q2={AlignCenterHorizontal:'<path d="M2 12h20" /><path d="M10 16v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4" /><path d="M10 8V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4" /><path d="M20 16v1a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-1" /><path d="M14 8V7c0-1.1.9-2 2-2h2a2 2 0 0 1 2 2v1" />',AlignCenterVertical:'<path d="M12 2v20" /><path d="M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4" /><path d="M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4" /><path d="M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1" /><path d="M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1" />',AlignEndHorizontal:'<rect width="6" height="16" x="4" y="2" rx="2" /><rect width="6" height="9" x="14" y="9" rx="2" /><path d="M22 22H2" />',AlignEndVertical:'<rect width="16" height="6" x="2" y="4" rx="2" /><rect width="9" height="6" x="9" y="14" rx="2" /><path d="M22 22V2" />',AlignHorizontalSpaceBetween:'<rect width="6" height="14" x="3" y="5" rx="2" /><rect width="6" height="10" x="15" y="7" rx="2" /><path d="M3 2v20" /><path d="M21 2v20" />',AlignStartHorizontal:'<rect width="6" height="16" x="4" y="6" rx="2" /><rect width="6" height="9" x="14" y="6" rx="2" /><path d="M22 2H2" />',AlignStartVertical:'<rect width="9" height="6" x="6" y="14" rx="2" /><rect width="16" height="6" x="6" y="4" rx="2" /><path d="M2 2v20" />',AlignVerticalSpaceBetween:'<rect width="14" height="6" x="5" y="15" rx="2" /><rect width="10" height="6" x="7" y="3" rx="2" /><path d="M2 21h20" /><path d="M2 3h20" />',ArrowDown:'<path d="M12 5v14" /><path d="m19 12-7 7-7-7" />',ArrowDownToLine:'<path d="M12 17V3" /><path d="m6 11 6 6 6-6" /><path d="M19 21H5" />',ArrowUp:'<path d="m5 12 7-7 7 7" /><path d="M12 19V5" />',ArrowUpToLine:'<path d="M5 3h14" /><path d="m18 13-6-6-6 6" /><path d="M12 7v14" />',Barcode:'<path d="M3 5v14" /><path d="M8 5v14" /><path d="M12 5v14" /><path d="M17 5v14" /><path d="M21 5v14" />',Bold:'<path d="M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8" />',ChartArea:'<path d="M3 3v16a2 2 0 0 0 2 2h16" /><path d="M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z" />',ChartBar:'<path d="M3 3v16a2 2 0 0 0 2 2h16" /><path d="M7 16h8" /><path d="M7 11h12" /><path d="M7 6h3" />',ChartColumn:'<path d="M3 3v16a2 2 0 0 0 2 2h16" /><path d="M18 17V9" /><path d="M13 17V5" /><path d="M8 17v-3" />',ChartLine:'<path d="M3 3v16a2 2 0 0 0 2 2h16" /><path d="m19 9-5 5-4-4-3 3" />',ChartPie:'<path d="M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z" /><path d="M21.21 15.89A10 10 0 1 1 8 2.83" />',ChartScatter:'<circle cx="7.5" cy="7.5" r=".5" fill="currentColor" /><circle cx="18.5" cy="5.5" r=".5" fill="currentColor" /><circle cx="11.5" cy="11.5" r=".5" fill="currentColor" /><circle cx="7.5" cy="16.5" r=".5" fill="currentColor" /><circle cx="17.5" cy="14.5" r=".5" fill="currentColor" /><path d="M3 3v16a2 2 0 0 0 2 2h16" />',Check:'<path d="M20 6 9 17l-5-5" />',ChevronDown:'<path d="m6 9 6 6 6-6" />',ChevronsLeft:'<path d="m11 17-5-5 5-5" /><path d="m18 17-5-5 5-5" />',ChevronsRight:'<path d="m6 17 5-5-5-5" /><path d="m13 17 5-5-5-5" />',ChevronsUpDown:'<path d="m7 15 5 5 5-5" /><path d="m7 9 5-5 5 5" />',Circle:'<circle cx="12" cy="12" r="10" />',ClipboardPaste:'<path d="M11 14h10" /><path d="M16 4h2a2 2 0 0 1 2 2v1.344" /><path d="m17 18 4-4-4-4" /><path d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113" /><rect x="8" y="2" width="8" height="4" rx="1" />',Code:'<path d="m16 18 6-6-6-6" /><path d="m8 6-6 6 6 6" />',Copy:'<rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />',Donut:'<path d="M20.5 10a2.5 2.5 0 0 1-2.4-3H18a2.95 2.95 0 0 1-2.6-4.4 10 10 0 1 0 6.3 7.1c-.3.2-.8.3-1.2.3" /><circle cx="12" cy="12" r="3" />',Ellipsis:'<circle cx="12" cy="12" r="1" /><circle cx="19" cy="12" r="1" /><circle cx="5" cy="12" r="1" />',Eye:'<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" /><circle cx="12" cy="12" r="3" />',FileText:'<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /><path d="M14 2v5a1 1 0 0 0 1 1h5" /><path d="M10 9H8" /><path d="M16 13H8" /><path d="M16 17H8" />',Funnel:'<path d="M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z" />',Gauge:'<path d="m12 14 4-4" /><path d="M3.34 19a10 10 0 1 1 17.32 0" />',Grid3x3:'<rect width="18" height="18" x="3" y="3" rx="2" /><path d="M3 9h18" /><path d="M3 15h18" /><path d="M9 3v18" /><path d="M15 3v18" />',Group:'<path d="M3 7V5c0-1.1.9-2 2-2h2" /><path d="M17 3h2c1.1 0 2 .9 2 2v2" /><path d="M21 17v2c0 1.1-.9 2-2 2h-2" /><path d="M7 21H5c-1.1 0-2-.9-2-2v-2" /><rect width="7" height="5" x="7" y="7" rx="1" /><rect width="7" height="5" x="10" y="12" rx="1" />',Image:'<rect width="18" height="18" x="3" y="3" rx="2" ry="2" /><circle cx="9" cy="9" r="2" /><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" />',Layers:'<path d="M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z" /><path d="M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12" /><path d="M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17" />',List:'<path d="M3 5h.01" /><path d="M3 12h.01" /><path d="M3 19h.01" /><path d="M8 5h13" /><path d="M8 12h13" /><path d="M8 19h13" />',ListTree:'<path d="M8 5h13" /><path d="M13 12h8" /><path d="M13 19h8" /><path d="M3 10a2 2 0 0 0 2 2h3" /><path d="M3 5v12a2 2 0 0 0 2 2h3" />',Maximize:'<path d="M8 3H5a2 2 0 0 0-2 2v3" /><path d="M21 8V5a2 2 0 0 0-2-2h-3" /><path d="M3 16v3a2 2 0 0 0 2 2h3" /><path d="M16 21h3a2 2 0 0 0 2-2v-3" />',Minus:'<path d="M5 12h14" />',PaintBucket:'<path d="M11 7 6 2" /><path d="M18.992 12H2.041" /><path d="M21.145 18.38A3.34 3.34 0 0 1 20 16.5a3.3 3.3 0 0 1-1.145 1.88c-.575.46-.855 1.02-.855 1.595A2 2 0 0 0 20 22a2 2 0 0 0 2-2.025c0-.58-.285-1.13-.855-1.595" /><path d="m8.5 4.5 2.148-2.148a1.205 1.205 0 0 1 1.704 0l7.296 7.296a1.205 1.205 0 0 1 0 1.704l-7.592 7.592a3.615 3.615 0 0 1-5.112 0l-3.888-3.888a3.615 3.615 0 0 1 0-5.112L5.67 7.33" />',Paintbrush:'<path d="m14.622 17.897-10.68-2.913" /><path d="M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z" /><path d="M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15" />',QrCode:'<rect width="5" height="5" x="3" y="3" rx="1" /><rect width="5" height="5" x="16" y="3" rx="1" /><rect width="5" height="5" x="3" y="16" rx="1" /><path d="M21 16h-3a2 2 0 0 0-2 2v3" /><path d="M21 21v.01" /><path d="M12 7v3a2 2 0 0 1-2 2H7" /><path d="M3 12h.01" /><path d="M12 3h.01" /><path d="M12 16v.01" /><path d="M16 12h1" /><path d="M21 12v.01" /><path d="M12 21v-1" />',Radar:'<path d="M19.07 4.93A10 10 0 0 0 6.99 3.34" /><path d="M4 6h.01" /><path d="M2.29 9.62A10 10 0 1 0 21.31 8.35" /><path d="M16.24 7.76A6 6 0 1 0 8.23 16.67" /><path d="M12 18h.01" /><path d="M17.99 11.66A6 6 0 0 1 15.77 16.67" /><circle cx="12" cy="12" r="2" /><path d="m13.41 10.59 5.66-5.66" />',Redo2:'<path d="m15 14 5-5-5-5" /><path d="M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13" />',RotateCcw:'<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /><path d="M3 3v5h5" />',SeparatorVertical:'<path d="M12 3v18" /><path d="m16 16 4-4-4-4" /><path d="m8 8-4 4 4 4" />',Shapes:'<path d="M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z" /><rect x="3" y="14" width="7" height="7" rx="1" /><circle cx="17.5" cy="17.5" r="3.5" />',Square:'<rect width="18" height="18" x="3" y="3" rx="2" />',Strikethrough:'<path d="M16 4H9a3 3 0 0 0-2.83 4" /><path d="M14 12a4 4 0 0 1 0 8H6" /><line x1="4" x2="20" y1="12" y2="12" />',Table:'<path d="M12 3v18" /><rect width="18" height="18" x="3" y="3" rx="2" /><path d="M3 9h18" /><path d="M3 15h18" />',Table2:'<path d="M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18" />',TextAlignCenter:'<path d="M21 5H3" /><path d="M17 12H7" /><path d="M19 19H5" />',TextAlignEnd:'<path d="M21 5H3" /><path d="M21 12H9" /><path d="M21 19H7" />',TextAlignJustify:'<path d="M3 5h18" /><path d="M3 12h18" /><path d="M3 19h18" />',TextAlignStart:'<path d="M21 5H3" /><path d="M15 12H3" /><path d="M17 19H3" />',Trash2:'<path d="M10 11v6" /><path d="M14 11v6" /><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" /><path d="M3 6h18" /><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />',Type:'<path d="M12 4v16" /><path d="M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2" /><path d="M9 20h6" />',Underline:'<path d="M6 4v6a6 6 0 0 0 12 0V4" /><line x1="4" x2="20" y1="20" y2="20" />',Undo2:'<path d="M9 14 4 9l5-5" /><path d="M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11" />',Ungroup:'<rect width="8" height="6" x="5" y="4" rx="1" /><rect width="8" height="6" x="11" y="14" rx="1" />',ZoomIn:'<circle cx="11" cy="11" r="8" /><line x1="21" x2="16.65" y1="21" y2="16.65" /><line x1="11" x2="11" y1="8" y2="14" /><line x1="8" x2="14" y1="11" y2="11" />',ZoomOut:'<circle cx="11" cy="11" r="8" /><line x1="21" x2="16.65" y1="21" y2="16.65" /><line x1="8" x2="14" y1="11" y2="11" />'};function je(e,t=15,r){const o=q2[e];return o?`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}"${r?` class="${r}"`:""} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${o}</svg>`:""}var Ir=null;function xl(e){const t=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;const r=t[1],o=r.length===3?r.split("").map(n=>n+n).join(""):r;return{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16)}}function Pl(e){const t=xl(e);return t?Fh(t):"#000000"}function Fh({r:e,g:t,b:r}){return`#${[e,t,r].map(o=>Math.round(pn(o/255)*255).toString(16).padStart(2,"0")).join("")}`}function j2(e,t,r){const o=e/255,n=t/255,i=r/255,a=Math.max(o,n,i),s=Math.min(o,n,i),p=a-s;let l=0;return p!==0&&(a===o?l=(n-i)/p%6:a===n?l=(i-o)/p+2:l=(o-n)/p+4,l*=60,l<0&&(l+=360)),{h:l,s:a===0?0:p/a,v:a}}function W2(e,t,r){const o=r*t,n=(e%360+360)%360/60,i=o*(1-Math.abs(n%2-1)),[a,s,p]=n<1?[o,i,0]:n<2?[i,o,0]:n<3?[0,o,i]:n<4?[0,i,o]:n<5?[i,0,o]:[o,0,i],l=r-o;return{r:(a+l)*255,g:(s+l)*255,b:(p+l)*255}}function V2(e){return((Number.isFinite(e)?e:0)%360+360)%360}function pn(e){return Math.min(1,Math.max(0,Number.isFinite(e)?e:0))}function G2(e){const t=e.translator??lr,r=e.title??t("colorPicker.pickColor");return g("button",{type:"button",class:`preset-color-trigger${e.triggerClass?` ${e.triggerClass}`:""}`,"aria-expanded":"false","aria-haspopup":"dialog",title:r,onClick:o=>{const n=o.currentTarget??o.target,i=n.getRootNode();if(!!Ir&&Ir.root===i&&Ir.title===r&&Ir.trigger===n){dn();return}dn(),K2(n,e,t)}},[g("span",{class:"preset-color-swatch",style:e.value?{background:e.value}:{background:"transparent"}})])}function dn(){const e=Ir;e&&(Ir=null,e.teardowns.forEach(t=>t()),e.trigger.setAttribute("aria-expanded","false"),e.panel.remove())}function K2(e,t,r){const o=e.getRootNode(),n=o instanceof ShadowRoot?o:document.body,i={root:o,title:t.title??r("colorPicker.pickColor"),trigger:e,panel:null,clearable:t.clearable!==!1,onChange:t.onChange,model:t.value||void 0,hue:0,saturation:0,value_:0,hexText:"",dragging:!1,current:null,hex:null,area:null,handle:null,hueRange:null,clearBtn:null,translator:r,items:[],teardowns:[]};t.value&&Sl(i,t.value)?i.hexText=Pl(t.value).toUpperCase():i.hexText=t.value?String(t.value):"",i.panel=rt(J2(i),n),i.current=i.panel.querySelector(".picker-current"),i.hex=i.panel.querySelector(".picker-hex"),i.area=i.panel.querySelector(".picker-area"),i.handle=i.panel.querySelector(".picker-handle"),i.hueRange=i.panel.querySelector(".picker-hue"),i.clearBtn=i.panel.querySelector(".picker-clear"),i.items=Array.from(i.panel.querySelectorAll(".preset-color-item")).map((a,s)=>({el:a,color:sc[s]})),ra(i),Y2(i),X2(i),Ir=i,e.setAttribute("aria-expanded","true")}function Y2(e){const t=e.trigger.getBoundingClientRect(),r=190,o=e.panel.offsetHeight||216,n=8,i=Math.max(n,Math.min(t.left,window.innerWidth-r-n)),a=t.bottom+6,s=a+o>window.innerHeight-n?Math.max(n,t.top-o-6):a;e.panel.style.left=`${i}px`,e.panel.style.top=`${s}px`}function X2(e){const t=n=>{const i=Z2(n);i.includes(e.trigger)||i.includes(e.panel)||dn()},r=n=>{n.key==="Escape"&&dn()},o=()=>dn();document.addEventListener("pointerdown",t,!0),document.addEventListener("keydown",r),window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),e.root.addEventListener("scroll",o,!0),e.teardowns.push(()=>document.removeEventListener("pointerdown",t,!0),()=>document.removeEventListener("keydown",r),()=>window.removeEventListener("scroll",o,!0),()=>window.removeEventListener("resize",o),()=>e.root.removeEventListener("scroll",o,!0))}function Z2(e){const t=typeof e.composedPath=="function"?e.composedPath():[];return t.length?t:[e.target]}function J2(e){const t=e.translator;return g("div",{class:"preset-color-panel",role:"dialog","aria-label":t("colorPicker.pickColor"),style:{position:"fixed"},onPointerdown:r=>r.stopPropagation()},[g("div",{class:"picker-preview"},[g("span",{class:"picker-current"}),g("input",{class:"picker-hex",type:"text",maxlength:7,spellcheck:"false","aria-label":t("colorPicker.hexValue"),onInput:r=>ew(e,r.target.value)})]),g("div",{class:"picker-area","aria-label":t("colorPicker.customColor"),tabindex:0,onPointerdown:r=>tw(e,r),onKeydown:r=>rw(e,r)},[g("span",{class:"picker-handle"})]),g("input",{class:"picker-hue",type:"range",min:0,max:360,step:1,"aria-label":t("colorPicker.hue"),onInput:r=>ow(e,Number(r.target.value)),onChange:()=>Tl(e)}),g("div",{class:"picker-heading"},[g("span",{text:t("colorPicker.commonColors")}),e.clearable?g("button",{type:"button",class:"picker-clear",title:t("colorPicker.clear"),onClick:()=>oa(e,void 0)},[g("svg",{viewBox:"0 0 16 16",width:12,height:12,"aria-hidden":"true"},[g("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round",fill:"none"})]),t("colorPicker.clearShort")]):""].filter(Boolean)),g("div",{class:"preset-color-grid"},sc.map(r=>g("button",{type:"button",class:"preset-color-item",style:{background:r},title:r,"aria-label":r,onClick:()=>Q2(e,r)})))])}function El(e){return Fh(W2(e.hue,e.saturation,e.value_))}function ra(e){const t=El(e);e.hex.value!==e.hexText&&(e.hex.value=e.hexText),e.current.className=e.model?"picker-current":"picker-current is-empty",e.model?e.current.style.background=t:e.current.style.removeProperty("background"),e.area.style.setProperty("--picker-hue",`${Math.round(e.hue)}deg`),e.handle.style.left=`${e.saturation*100}%`,e.handle.style.top=`${(1-e.value_)*100}%`,e.handle.style.background=t;const r=String(Math.round(e.hue));e.hueRange.value!==r&&(e.hueRange.value=r),e.clearBtn&&(e.clearBtn.disabled=!e.model);for(const o of e.items)o.el.className=e.model&&o.color.toLowerCase()===e.model.toLowerCase()?"preset-color-item active":"preset-color-item"}function Sl(e,t){const r=xl(t);if(!r)return!1;const o=j2(r.r,r.g,r.b);return e.hue=o.h,e.saturation=o.s,e.value_=o.v,e.hexText=Pl(t).toUpperCase(),!0}function lo(e,t,r,o){e.hue=V2(t),e.saturation=pn(r),e.value_=pn(o),e.hexText=El(e).toUpperCase(),ra(e)}function Tl(e){const t=El(e);e.model=t,ra(e),e.onChange(t)}function oa(e,t){e.model=t,t||(e.hexText=""),ra(e),e.onChange(t)}function Q2(e,t){Sl(e,t),oa(e,t)}function ew(e,t){const r=t.trim();if(!r){e.clearable&&oa(e,void 0);return}xl(r)&&(Sl(e,r),oa(e,Pl(r)))}function tw(e,t){e.dragging=!0,$h(e,t);const r=n=>{e.dragging&&$h(e,n)},o=()=>{e.dragging&&(e.dragging=!1,document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",o),document.removeEventListener("pointercancel",o),Tl(e))};document.addEventListener("pointermove",r),document.addEventListener("pointerup",o),document.addEventListener("pointercancel",o)}function $h(e,t){const r=e.area.getBoundingClientRect();if(!r.width||!r.height)return;const o=pn((t.clientX-r.left)/r.width),n=pn(1-(t.clientY-r.top)/r.height);lo(e,e.hue,o,n)}function rw(e,t){const r=t.shiftKey?.1:.02;let o=!0;t.key==="ArrowLeft"?lo(e,e.hue,e.saturation-r,e.value_):t.key==="ArrowRight"?lo(e,e.hue,e.saturation+r,e.value_):t.key==="ArrowUp"?lo(e,e.hue,e.saturation,e.value_+r):t.key==="ArrowDown"?lo(e,e.hue,e.saturation,e.value_-r):o=!1,o&&(t.preventDefault(),Tl(e))}function ow(e,t){lo(e,t,e.saturation,e.value_)}function m(e,t,r){return e.t?e.t(t,r):lr(t,r)}let po=null;function nw(e,t){const r=po;po=e;try{t()}finally{po=r}}function oe(e,t){return po?po(e,t):lr(e,t)}function Re(e,t,r,o){return g("button",{class:`tb-btn tb-icon${o.on?" on":""}${o.danger?" danger":""}`,type:"button",disabled:!!o.disabled,dataset:{tip:o.tip,...o.test?{test:o.test}:{}},onClick:()=>e.fire(r,o.arg),html:je(t)})}function na(e,t,r,o){const n=e.state.openDd===t,i=()=>{e.state.openDd=n?null:t,e.repaint()};return g("div",{class:"tb-dd"},[g("button",{type:"button",class:`tb-dd-trigger${n?" on":""}`,disabled:!!r.disabled,dataset:{test:r.testId??t,tip:r.tip},onClick:i,html:`${r.icon?je(r.icon):""}${r.text?`<span class="${r.textClass??"tb-btn-text"}">${r.text}</span>`:""}${je("ChevronDown",12,`tb-dd-arrow${n?" up":""}`)}`}),n?g("div",{class:`tb-dd-panel${r.panelClass?` ${r.panelClass}`:""}`},o):""].filter(Boolean))}function ae(e){const t=e.step??1,r=String(t),o=r.indexOf("."),n=o===-1?0:r.length-o-1,i=u=>Number.isFinite(u)?Number(u.toFixed(n)):0,a=u=>{let c=i(u);return e.min!==void 0&&c<e.min&&(c=e.min),e.max!==void 0&&c>e.max&&(c=e.max),c},s=e.value===void 0||e.value===null||!Number.isFinite(e.value)?void 0:i(e.value),p=s??e.min??0,l=u=>{u!==s&&e.onCommit(u)},d=g("input",{class:"pd-input pd-step-input",type:"number",value:s===void 0?"":String(s),min:e.min,max:e.max,step:t,placeholder:e.placeholder,disabled:!!e.disabled,onChange:u=>{const c=u.target,f=(c.value??"").trim();if(f===""){s!==void 0&&(c.value=String(s));return}const h=Number(f);if(!Number.isFinite(h)){c.value=s===void 0?"":String(s);return}const b=a(h);c.value=String(b),l(b)}});return g("div",{class:"pd-stepper"},[g("button",{type:"button",class:"pd-step-btn pd-step-minus",disabled:!!e.disabled||p<=(e.min??-1/0),title:oe("controls.k28"),"aria-label":oe("controls.k29"),text:"−",onClick:()=>l(a(p-t))}),d,g("button",{type:"button",class:"pd-step-btn pd-step-plus",disabled:!!e.disabled||p>=(e.max??1/0),title:oe("controls.k30"),"aria-label":oe("controls.k31"),text:"+",onClick:()=>l(a(p+t))})])}function he(e,t,r,o){return g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:e}),o??""]),t,r?g("p",{class:"pd-hint",text:r}):""].filter(Boolean))}const Ml=e=>g("button",{class:"pd-help",type:"button","data-tip":e,"aria-label":oe("controls.k32")});function Ge(e,t,r,o){return g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t"},[e,Ml(r)]),o??""]),t])}function Lr(e){const t=e.base?.[e.propKey],r=e.target?.[e.propKey]!==t,o=e.force===!0||r,n=e.tipOverride??(e.tipValue===void 0?oe("controls.k33"):oe("controls.k34",{v0:e.tipValue,v1:e.tipUnit?" "+e.tipUnit:""})),i=e.force?oe("controls.k35",{v0:n}):n;return g("button",{type:"button",class:`pd-reset-btn${r&&!e.force?" is-dirty":""}`,"data-tip":i,"aria-label":i,html:je("RotateCcw",13),onClick:()=>{o&&(e.write?e.write(t):e.target[e.propKey]=t,e.onReset?.())}})}const $t=e=>g("h3",{class:"pd-divider",text:e});function dt(e,t,r=oe("controls.k36"),o){return G2({value:e,title:r,triggerClass:o,translator:po??lr,onChange:n=>t(n)})}function pr(e,t,r,o,n=!1){return g("div",{class:`pd-radio-group${n?" pd-radio-group--2col":""}`,role:"radiogroup"},t.map(i=>g("label",{class:"pd-radio"},[g("input",{type:"radio",name:e,value:i.value,checked:r===i.value,onChange:()=>o(i.value)}),g("span",{text:i.label})])))}function zh(e,t,r,o={}){const n=document.createElement("select");n.className=o.className??"pd-select",o.width&&(n.style.width=o.width);for(const i of t){const a=document.createElement("option");a.value=i.value,a.textContent=i.label,i.disabled&&(a.disabled=!0),n.appendChild(a)}return n.value=e,t.some(i=>i.value===e)||(n.selectedIndex=-1),n.addEventListener("change",()=>r(n.value)),n}const iw="propertyPanel.k328",aw=()=>oe(iw);function Hh(){const e=[];for(const{plugin:t,kind:r}of fd()){const o=D2(r.type);if(!o)continue;const i=(r.designer??t.designer)?.materialCard;e.push({type:r.type,label:r.label,icon:r.icon??i?.icon??"Shapes",group:i?.group??o.group,ui:o})}return e}function Cl(e){if(e)return Hh().find(t=>t.type===e)}function _l(e){if(!e)return;const t=Cl(e.printElementType.type);if(!t||!t.ui.renderProperty)return;const r=t.ui;if(r.hasProperties)try{if(!r.hasProperties(e))return}catch{return}const o=aw();return{ui:r,label:o,icon:t.icon,searchKeywords:r.searchKeywords?[...r.searchKeywords]:[o,t.label,t.type]}}const ia=Object.freeze([{type:"text",label:oe("elementDefinitions.k553"),icon:"Type",material:!0,propertyGroup:"text",dblEditableField:"formatter",origin:"builtin"},{type:"barcode",label:oe("elementDefinitions.k554"),icon:"Barcode",material:!0,propertyGroup:"code",dblEditableField:"formatter",origin:"builtin"},{type:"qrcode",label:oe("elementDefinitions.k555"),icon:"QrCode",material:!0,propertyGroup:"code",dblEditableField:"formatter",origin:"builtin"},{type:"image",label:oe("elementDefinitions.k556"),icon:"Image",material:!0,propertyGroup:"general",dblEditableField:"src",origin:"builtin"},{type:"table",label:oe("elementDefinitions.k557"),icon:"Table",material:!0,propertyGroup:"table",origin:"builtin"},{type:"longText",label:oe("elementDefinitions.k558"),icon:"TextAlignStart",material:!0,propertyGroup:"text",dblEditableField:"formatter",origin:"builtin"},{type:"flowList",label:oe("elementDefinitions.k559"),icon:"List",material:!0,propertyGroup:"general",dblEditableField:"formatter",origin:"builtin"},{type:"hline",label:oe("elementDefinitions.k560"),icon:"Minus",material:!0,propertyGroup:"general",origin:"builtin"},{type:"vline",label:oe("elementDefinitions.k561"),icon:"SeparatorVertical",material:!0,propertyGroup:"general",origin:"builtin"},{type:"rect",label:oe("elementDefinitions.k562"),icon:"Square",material:!0,propertyGroup:"general",origin:"builtin"},{type:"oval",label:oe("elementDefinitions.k563"),icon:"Circle",material:!0,propertyGroup:"general",origin:"builtin"},{type:"html",label:"HTML",icon:"Code",material:!1,propertyGroup:"general",origin:"builtin"},{type:"pageNumber",label:oe("elementDefinitions.k564"),icon:"Shapes",material:!1,propertyGroup:"general",origin:"builtin"}]),Uh=Symbol.for("worm-print-platform.element-definitions.v1"),qh=globalThis;function Mt(){const e=qh[Uh];if(e)return e;const t={overrides:new Map,builtinRenderers:new Map,rendererOverrides:new Map,listeners:new Set,nextSeq:0,seq:new Map};return qh[Uh]=t,t}function cn(){for(const e of[...Mt().listeners])try{e()}catch{}}function jh(e){const t=Mt();return t.listeners.add(e),()=>{t.listeners.delete(e)}}function sw(){return new Map(ia.map(e=>[e.type,e]))}function lw(e){if(!e?.type||typeof e.type!="string")throw new Error(oe("elementDefinitions.k565"));if(!e.label||typeof e.label!="string")throw new Error(oe("elementDefinitions.k566"));const t=Mt(),r={...e,origin:e.origin??"custom"};return t.overrides.set(r.type,r),t.seq.set(r.type,t.nextSeq++),cn(),()=>{const o=Mt();o.overrides.get(r.type)===r&&(o.overrides.delete(r.type),cn())}}function pw(e,t){if(!e||typeof t!="function")throw new Error(oe("elementDefinitions.k567"));return Mt().rendererOverrides.set(e,t),cn(),()=>{const o=Mt();o.rendererOverrides.get(e)===t&&(o.rendererOverrides.delete(e),cn())}}function Wh(e){const t=Mt();for(const[r,o]of Object.entries(e))t.builtinRenderers.set(r,o);return()=>{const r=Mt();for(const[o,n]of Object.entries(e))r.builtinRenderers.get(o)===n&&r.builtinRenderers.delete(o)}}function dw(e){const t=Cl(e);if(t)return{type:t.type,label:t.label,icon:t.icon,group:t.group,material:!0,propertyGroup:"general",origin:"plugin"}}function dr(e){if(!e)return;const t=Mt(),r=t.overrides.get(e)??sw().get(e)??dw(e);if(!r)return;const o=t.rendererOverrides.get(e)??t.builtinRenderers.get(e);return o?{...r,renderContent:o}:r}function Vh(){const e=Mt(),t=[],r=new Set;for(const n of ia)t.push(dr(n.type)??n),r.add(n.type);const o=[...e.overrides.entries()].filter(([n])=>!r.has(n)).sort((n,i)=>(e.seq.get(n[0])??0)-(e.seq.get(i[0])??0));for(const[n]of o){const i=dr(n);i&&t.push(i),r.add(n)}for(const n of Hh()){if(r.has(n.type))continue;const i=dr(n.type);i&&t.push(i),r.add(n.type)}return t}function Gh(){return Vh().filter(e=>e.material)}function Kh(e){return dr(e)?.propertyGroup??"general"}function Yh(e){return dr(e)?.dblEditableField}function Xh(e){return dr(e)?.icon??"Shapes"}function cw(){const e=Mt();e.overrides.clear(),e.rendererOverrides.clear(),e.seq.clear(),e.nextSeq=0,cn()}const Dl="1.4.0",Zh="print-designer",Al=["template","fields","name","fonts","design-data","theme","theme-config","field-display","lang"],Jh=["is-edit","show-help","show-preview","show-save"],uw=Object.freeze({bubbles:!0,composed:!0}),Ol=["container","toolbar","format-bar","left-panel","canvas-area","property-panel","status-bar","page-tabs"],Qh=["--pd-bg","--pd-surface","--pd-field-bg","--pd-sidebar","--pd-sidebar-hover","--pd-canvas-bg","--pd-paper","--pd-accent","--pd-accent-2","--pd-accent-soft","--pd-accent-secondary","--pd-danger-soft","--pd-ink-green","--pd-text","--pd-text-muted","--pd-text-faint","--pd-border","--pd-border-soft","--pd-input-bg","--pd-hover-tint","--pd-danger","--pd-danger-bg","--pd-danger-border","--pd-menu-text","--pd-menu-hover","--pd-menu-border","--pd-menu-divider","--pd-menu-muted","--pd-menu-disabled","--pd-scrollbar","--pd-scrollbar-thumb","--pd-scrollbar-thumb-hover","--pd-help-field-bg","--pd-help-field-line","--pd-help-field-ink","--pd-help-function-bg","--pd-help-function-line","--pd-help-function-ink","--pd-help-variable-bg","--pd-help-variable-line","--pd-help-variable-ink","--pd-help-conditional-bg","--pd-help-conditional-line","--pd-help-conditional-ink","--pd-handle","--pd-ruler","--pd-ruler-bg","--pd-ruler-cursor","--pd-radius","--pd-shadow-sm","--pd-shadow-md","--pd-shadow-paper","--pd-success","--pd-text-regular","--pd-fill-light"],em=["getTemplateJson","loadTemplate","save","validateTemplate","getGeometryWarnings","setLocale"],tm=["template","fields","fonts","designData","isEdit","showHelp","showPreview","showSave","theme","themeConfig","uploadImage","uploadDesignBackground","fieldDisplay","lang","messages"],Ct=Object.freeze({save:"save",preview:"preview",help:"help",dblclickElement:"dblclick-element",dblclickCell:"dblclick-cell"}),rm=[Ct.save,Ct.preview,Ct.help,Ct.dblclickElement,Ct.dblclickCell];function Rl(){return{version:Dl,tag:Zh,attributes:Al,booleanAttributes:Jh,events:rm,parts:Ol,themeTokens:Qh,methods:em,properties:tm}}const fw={"--pd-bg":"#181a20","--pd-surface":"#1f2229","--pd-field-bg":"#252830","--pd-sidebar":"#1f2229","--pd-sidebar-hover":"#2b2f39","--pd-accent":"#4C8DFF","--pd-accent-2":"#6C9DFF","--pd-accent-soft":"rgba(76, 141, 255, .16)","--pd-accent-secondary":"#ff7a7a","--pd-danger-soft":"rgba(255, 122, 122, .14)","--pd-ink-green":"#6cce5a","--pd-text":"#e6e8ee","--pd-text-muted":"#9aa0ad","--pd-text-faint":"#6f7683","--pd-text-regular":"#c9cdd8","--pd-border":"#3a3f4b","--pd-border-soft":"#2d323c","--pd-input-bg":"#262a33","--pd-hover-tint":"rgba(76, 141, 255, .12)","--pd-fill-light":"#2b2f39","--pd-danger":"#ff6b6b","--pd-danger-bg":"#3a2226","--pd-danger-border":"#6b3535","--pd-success":"#4ade80","--pd-menu-text":"#d6d9e0","--pd-menu-hover":"#2b2f39","--pd-menu-border":"#3a3f4b","--pd-menu-divider":"#2d323c","--pd-menu-muted":"#8b91a0","--pd-menu-disabled":"#555b68","--pd-scrollbar":"rgba(255, 255, 255, .18)","--pd-scrollbar-thumb":"rgba(255, 255, 255, .16)","--pd-scrollbar-thumb-hover":"rgba(255, 255, 255, .3)","--pd-help-field-bg":"#16283a","--pd-help-field-line":"#2c5870","--pd-help-field-ink":"#7cc4f5","--pd-help-function-bg":"#162e22","--pd-help-function-line":"#2c5b3c","--pd-help-function-ink":"#79d69a","--pd-help-variable-bg":"#302c16","--pd-help-variable-line":"#6b5d24","--pd-help-variable-ink":"#d6b25e","--pd-help-conditional-bg":"#301a28","--pd-help-conditional-line":"#6b3454","--pd-help-conditional-ink":"#e58ab5","--pd-shadow-sm":"0 1px 2px rgba(0, 0, 0, .3)","--pd-shadow-md":"0 2px 8px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .5)"};function om(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function hw(e){if(Array.isArray(e))return e}function mw(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var o,n,i,a,s=[],p=!0,l=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(p=(o=i.call(r)).done)&&(s.push(o.value),s.length!==t);p=!0);}catch(d){l=!0,n=d}finally{try{if(!p&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw n}}return s}}function gw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
295
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bw(e,t){return hw(e)||mw(e,t)||kw(e,t)||gw()}function kw(e,t){if(e){if(typeof e=="string")return om(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?om(e,t):void 0}}const nm=Object.entries,yw=Object.keys,im=Object.setPrototypeOf,vw=Object.isFrozen,am=Object.getPrototypeOf,sm=Object.getOwnPropertyDescriptor;let We=Object.freeze,Be=Object.seal,cr=Object.create,lm=typeof Reflect<"u"&&Reflect,aa=lm.apply,Il=lm.construct;We||(We=function(t){return t}),Be||(Be=function(t){return t}),aa||(aa=function(t,r){for(var o=arguments.length,n=new Array(o>2?o-2:0),i=2;i<o;i++)n[i-2]=arguments[i];return t.apply(r,n)}),Il||(Il=function(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return new t(...o)});const Vt=_e(Array.prototype.forEach),ww=_e(Array.prototype.lastIndexOf),pm=_e(Array.prototype.pop),un=_e(Array.prototype.push),xw=_e(Array.prototype.slice),Pw=_e(Array.prototype.splice),co=Array.isArray,Ll=um(Set),Nl=_e(Set.prototype.add),fn=_e(Set.prototype.has),Nr=_e(String.prototype.toLowerCase),Bl=_e(String.prototype.toString),Ew=_e(String.prototype.match),sa=_e(String.prototype.replace),Fl=_e(String.prototype.indexOf),Sw=_e(String.prototype.trim),Tw=_e(Number.prototype.toString),Mw=_e(Boolean.prototype.toString),dm=typeof BigInt>"u"?null:_e(BigInt.prototype.toString),cm=typeof Symbol>"u"?null:_e(Symbol.prototype.toString),Ze=_e(Object.prototype.hasOwnProperty),hn=_e(Object.prototype.toString),Cw=RegExp.prototype.test,Ve=function(t,r){return t instanceof RegExp&&(t.lastIndex=0),aa(Cw,t,[r])},Gt=um(TypeError);function _e(e){return function(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return aa(e,t,o)}}function um(e){return function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return Il(e,r)}}function be(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Nr;if(im&&im(e,null),!co(t))return e;let o=t.length;for(;o--;){let n=t[o];if(typeof n=="string"){const i=r(n);i!==n&&(vw(t)||(t[o]=i),n=i)}e[n]=!0}return e}function _w(e){for(let t=0;t<e.length;t++)Ze(e,t)||(e[t]=null);return e}function la(e){const t=cr(null);for(const o of nm(e)){var r=bw(o,2);const n=r[0],i=r[1];Ze(e,n)&&(co(i)?t[n]=_w(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=la(i):t[n]=i)}return t}function mn(e){const t=cr(null),r=yw(e);let o=r.length;for(;o--;)t[r[o]]=e[r[o]];return t}function Dw(e){switch(typeof e){case"string":return e;case"number":return Tw(e);case"boolean":return Mw(e);case"bigint":return dm?dm(e):"0";case"symbol":return cm?cm(e):"Symbol()";case"undefined":return hn(e);case"function":case"object":{if(e===null)return hn(e);const t=e,r=wt(t,"toString");if(typeof r=="function"){const o=r(t);return typeof o=="string"?o:hn(o)}return hn(e)}default:return hn(e)}}function wt(e,t){for(;e!==null;){const o=sm(e,t);if(o){if(o.get)return _e(o.get);if(typeof o.value=="function")return _e(o.value)}e=am(e)}function r(){return null}return r}function Aw(e,t){for(;e!==null;){const r=sm(e,t);if(r)return r.get?_e(r.get):null;e=am(e)}return null}function Ow(e){if(!e)return!1;try{return Ve(e,""),!0}catch{return!1}}const fm=We(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),$l=We(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),zl=We(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Rw=We(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Hl=We(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Iw=We(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),hm=We(["#text"]),mm=We(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Ul=We(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),gm=We(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),pa=We(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Lw=Be(/{{[\w\W]*|^[\w\W]*}}/g),Nw=Be(/<%[\w\W]*|^[\w\W]*%>/g),Bw=Be(/\${[\w\W]*/g),Fw=Be(/{{|}}|\${|<%|%>|&lt;%|%&gt;/),$w=Be(/^data-[\-\w.\u00B7-\uFFFF]+$/),zw=Be(/^aria-[\-\w]+$/),bm=Be(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hw=Be(/^(?:\w+script|data):/i),Uw=Be(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qw=Be(/^html$/i),jw=Be(/^[a-z][.\w]*(-[.\w]+)+$/i),ql=Be(/<[/\w!]/g),km=Be(/<[/\w]/g),Ww=Be(/<\/no(script|embed|frames)/i),ym=Be(/\/>/i),Vw=Be(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i),Gw=Be(/^[\r\n\t ]+/),Ie={element:1,text:3,processingInstruction:7,comment:8,document:9,documentFragment:11},Kw=We(be({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),Yw=function(){return typeof window>"u"?null:window},Xw=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let o=null;const n="data-tt-policy-suffix";r&&r.hasAttribute(n)&&(o=r.getAttribute(n));const i="dompurify"+(o?"#"+o:"");try{return t.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},vm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ur=function(t,r,o,n){return Ze(t,r)&&co(t[r])?be(n.base?mn(n.base):{},t[r],n.transform):o},jl=function(t,r,o){const n=Ze(t,r)?t[r]:void 0;return n&&typeof n=="object"?la(n):o};function wm(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Yw();const t=N=>wm(N);if(t.version="3.4.18",t.removed=[],!e||!e.document||e.document.nodeType!==Ie.document||!e.Element)return t.isSupported=!1,t;let r=e.document;const o=r,n=o.currentScript,i=e.HTMLTemplateElement,a=e.Node,s=e.Element,p=e.NodeFilter,l=e.DOMParser,d=e.trustedTypes,u=s.prototype,c=wt(u,"cloneNode"),f=wt(u,"remove"),h=wt(u,"removeAttributeNode"),b=wt(u,"nextSibling"),k=wt(u,"childNodes"),v=wt(u,"parentNode"),w=wt(u,"shadowRoot"),P=wt(u,"attributes"),E=a&&a.prototype?wt(a.prototype,"nodeType"):null,D=a&&a.prototype?wt(a.prototype,"nodeName"):null,O=a&&a.prototype?wt(a.prototype,"ownerDocument"):null,A=function(y){return E?E(y):y.nodeType},R=function(y){return D?D(y):y.nodeName},_=Aw(u,"namespaceURI"),I=function(y){return _?_(y):y.namespaceURI};if(typeof i=="function"){const N=r.createElement("template");N.content&&N.content.ownerDocument&&(r=N.content.ownerDocument)}let S,B="",F,H=!1,le=0;const M=function(){if(le>0)throw Gt('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ne=function(y){M(),le++;try{return S.createHTML(y)}finally{le--}},Se=function(y){return S&&De?ne(y):y},Pe=function(y){M(),le++;try{return S.createScriptURL(y)}finally{le--}},K=function(){return H||(F=Xw(d,n),H=!0),F},ue=r,me=ue.implementation,we=ue.createNodeIterator,ke=ue.createDocumentFragment,te=ue.getElementsByTagName,Me=o.importNode;let se=vm();t.isSupported=typeof nm=="function"&&typeof v=="function"&&me&&me.createHTMLDocument!==void 0;const Je=Lw,ze=Nw,ve=Bw,Ee=$w,ho=zw,vn=Hw,wn=Uw,xn=jw;let mo=bm,xe=null;const Dt=be({},[...fm,...$l,...zl,...Hl,...hm]);let C=null;const q=be({},[...mm,...Ul,...gm,...pa]);let U=null,V=null,j=null;const J=Object.seal(cr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let pe=!0,T=!0,X=!1,ee=!0,ie=!1,ce=!0,Te=!1,Le=!1,Ke=null,ot=null,He=!1,ct=!1,Ce=!1,De=!1,At=!0,Hr=!1;const ut="user-content-";let Ae=!0,qt=!1,xt=null,Qe=!1,Pt=null;const Jt=be({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let hr=null;const $e=be({},["audio","video","img","source","image","track"]);let Ue=null;const Ur=be({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qr="http://www.w3.org/1998/Math/MathML",fe="http://www.w3.org/2000/svg",ye="http://www.w3.org/1999/xhtml";let ft=ye,ht=!1,Pn=null;const mp=be({},[qr,fe,ye],Bl),gp=We(be({},["mi","mo","mn","ms","mtext"]));let bp=null;const dE=We(be({},["annotation-xml"]));let kp=null;const cE=We(cr(null)),uE=be({},["title","style","font","a","script"]);let En=null;const fE=["application/xhtml+xml","text/html"],hE="text/html";let Ne=null,wa=null;const mE=r.createElement("form"),Pg=function(y){return y instanceof RegExp||y instanceof Function},yp=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(!y||typeof y!="object")&&(y={}),y=la(y),En=fE.indexOf(y.PARSER_MEDIA_TYPE)===-1?hE:y.PARSER_MEDIA_TYPE,Ne=En==="application/xhtml+xml"?Bl:Nr,xe=ur(y,"ALLOWED_TAGS",Dt,{transform:Ne}),C=ur(y,"ALLOWED_ATTR",q,{transform:Ne}),Pn=ur(y,"ALLOWED_NAMESPACES",mp,{transform:Bl}),Ue=ur(y,"ADD_URI_SAFE_ATTR",Ur,{transform:Ne,base:Ur}),hr=ur(y,"ADD_DATA_URI_TAGS",$e,{transform:Ne,base:$e}),Pt=ur(y,"FORBID_CONTENTS",Jt,{transform:Ne}),V=ur(y,"FORBID_TAGS",cr(null),{transform:Ne}),j=ur(y,"FORBID_ATTR",cr(null),{transform:Ne}),Qe=Ze(y,"USE_PROFILES")?y.USE_PROFILES&&typeof y.USE_PROFILES=="object"?la(y.USE_PROFILES):y.USE_PROFILES:!1,pe=y.ALLOW_ARIA_ATTR!==!1,T=y.ALLOW_DATA_ATTR!==!1,X=y.ALLOW_UNKNOWN_PROTOCOLS||!1,ee=y.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ie=y.SAFE_FOR_TEMPLATES||!1,ce=y.SAFE_FOR_XML!==!1,Te=y.WHOLE_DOCUMENT||!1,ct=y.RETURN_DOM||!1,Ce=y.RETURN_DOM_FRAGMENT||!1,De=y.RETURN_TRUSTED_TYPE||!1,He=y.FORCE_BODY||!1,At=y.SANITIZE_DOM!==!1,Hr=y.SANITIZE_NAMED_PROPS||!1,Ae=y.KEEP_CONTENT!==!1,qt=y.IN_PLACE||!1,mo=Ow(y.ALLOWED_URI_REGEXP)?y.ALLOWED_URI_REGEXP:bm,ft=typeof y.NAMESPACE=="string"?y.NAMESPACE:ye,bp=jl(y,"MATHML_TEXT_INTEGRATION_POINTS",gp),kp=jl(y,"HTML_INTEGRATION_POINTS",dE);const x=jl(y,"CUSTOM_ELEMENT_HANDLING",cE);if(U=cr(null),Ze(x,"tagNameCheck")&&Pg(x.tagNameCheck)&&(U.tagNameCheck=x.tagNameCheck),Ze(x,"attributeNameCheck")&&Pg(x.attributeNameCheck)&&(U.attributeNameCheck=x.attributeNameCheck),Ze(x,"allowCustomizedBuiltInElements")&&typeof x.allowCustomizedBuiltInElements=="boolean"&&(U.allowCustomizedBuiltInElements=x.allowCustomizedBuiltInElements),Be(U),ie&&(T=!1),Ce&&(ct=!0),Qe&&((Ze(y,"ALLOWED_TAGS")||Ze(y,"ALLOWED_ATTR"))&&typeof console<"u"&&typeof console.warn=="function"&&console.warn("DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together."),xe=be({},hm),C=cr(null),Qe.html===!0&&(be(xe,fm),be(C,mm)),Qe.svg===!0&&(be(xe,$l),be(C,Ul),be(C,pa)),Qe.svgFilters===!0&&(be(xe,zl),be(C,Ul),be(C,pa)),Qe.mathMl===!0&&(be(xe,Hl),be(C,gm),be(C,pa))),J.tagCheck=null,J.attributeCheck=null,Ze(y,"ADD_TAGS")&&(typeof y.ADD_TAGS=="function"?J.tagCheck=y.ADD_TAGS:co(y.ADD_TAGS)&&(xe===Dt&&(xe=mn(xe)),be(xe,y.ADD_TAGS,Ne))),Ze(y,"ADD_ATTR")&&(typeof y.ADD_ATTR=="function"?J.attributeCheck=y.ADD_ATTR:co(y.ADD_ATTR)&&(C===q&&(C=mn(C)),be(C,y.ADD_ATTR,Ne))),Ze(y,"ADD_FORBID_CONTENTS")&&co(y.ADD_FORBID_CONTENTS)&&(Pt===Jt&&(Pt=mn(Pt)),be(Pt,y.ADD_FORBID_CONTENTS,Ne)),Ae&&(xe["#text"]=!0),Te&&be(xe,["html","head","body"]),xe.table&&(xe.tbody=!0,delete V.tbody),y.TRUSTED_TYPES_POLICY){if(typeof y.TRUSTED_TYPES_POLICY.createHTML!="function")throw Gt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof y.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Gt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const L=S;S=y.TRUSTED_TYPES_POLICY;try{B=ne("")}catch(z){throw S=L,z}}else y.TRUSTED_TYPES_POLICY===null?(S=void 0,B=""):(S===void 0&&(S=K()),S&&typeof B=="string"&&(B=ne("")));wa=We(y)},Eg=be({},[...$l,...zl,...Rw]),Sg=be({},[...Hl,...Iw]),gE=function(y,x,L){return x===ye?y==="svg":x===qr?y==="svg"&&(L==="annotation-xml"||bp[L]):!!Eg[y]},bE=function(y,x,L){return x===ye?y==="math":x===fe?y==="math"&&kp[L]:!!Sg[y]},kE=function(y,x,L){return x===fe&&!kp[L]||x===qr&&!bp[L]?!1:!Sg[y]&&(uE[y]||!Eg[y])},yE=function(y){const x=I(y),L=Nr(R(y)),z=v(y);let Y=ft,re="template";return z&&A(z)===Ie.element&&(Y=I(z),re=Nr(R(z))),Pn[x]?x===fe?gE(L,Y,re):x===qr?bE(L,Y,re):x===ye?kE(L,Y,re):En==="application/xhtml+xml":!1},mr=function(y){un(t.removed,{element:y});try{v(y).removeChild(y)}catch{if(f(y),!v(y))throw Gt("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Tg=function(y,x,L){try{h(y,x)}catch{try{y.removeAttribute(L)}catch{}}},vp=function(y){Pp(y);const x=k(y);x&&Vt(xw(x),L=>{try{f(L)}catch{}}),A(y)===Ie.element&&wp(y,!1)},go=function(y,x,L){if(!L)try{L=x.getAttributeNode(y)}catch{L=null}if(un(t.removed,{attribute:L||null,from:x}),L)Tg(x,L,y);else try{x.removeAttribute(y)}catch{}if(y==="is")if(ct||Ce)try{mr(x)}catch{}else try{x.setAttribute(y,"")}catch{}},wp=function(y,x){const L=P(y);if(L)for(let z=L.length-1;z>=0;--z){const Y=L[z],re=Y&&Y.name;typeof re=="string"&&!(x&&C[Ne(re)])&&Tg(y,Y,re)}},xp=function(y,x){let L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const z=[y];for(;z.length>0;){const Y=z.pop();if(x(Y)===!1)continue;if(L&&A(Y)===Ie.element){const de=w(Y);bo(de)&&z.push(de)}const re=k(Y);if(re)for(let de=re.length-1;de>=0;--de)z.push(re[de])}},Pp=function(y){xp(y,x=>{A(x)===Ie.element&&wp(x,!0)})},Ep=function(y){const x=[];return xp(y,L=>{x.push(L)},!0),x},vE=function(y,x){const L=Ll();Vt(Ep(y),z=>{A(z)===Ie.element&&Nl(L,z)}),Vt(x,z=>{A(z)===Ie.element&&!fn(L,z)&&wp(z,!0)})},Mg=function(y,x){let L=!1;return Vt(t.removed,z=>{z.element&&(L=L||z.element===y,Pp(z.element))}),vE(y,x),L},wE=8,xE=function(y,x){const L=xt;let z=null;const Y=()=>(z||(z=Ll(),Vt(x,re=>{Nl(z,re)})),z);for(let re=0;;re++){const de=Ep(y),qe=[y];let Qt=!1;if(Vt(de,Rt=>{A(Rt)===Ie.documentFragment?un(qe,Rt):!Qt&&!fn(L,Rt)&&(Qt=fn(Y(),Rt))}),!Qt)return;if(re>=wE)throw Gt("the tree kept changing during in-place sanitization; refusing to return it");Vt(qe,(Rt,mt)=>{PE(Rt,mt>0,y,Y())})}},PE=function(y,x,L,z){const Y=xa(y);let re;for(;re=Y.nextNode();)!fn(z,re)||fn(xt,re)||(x&&Ot(se.uponSanitizeShadowNode,re,null),Cp(re,L))},EE=function(y){xt&&Nl(xt,y)},Cg=function(y,x){return ce?y==="patchsrc"?!0:y==="for"&&x!=="label"&&x!=="output":!1},SE=function(y){ce&&xp(y,x=>{const L=A(x);if(L===Ie.processingInstruction||L===Ie.comment&&Ve(km,x.data)){try{f(x)}catch{}return!1}if(L===Ie.element){const z=x,Y=Ne(R(x));try{z.hasAttribute&&z.hasAttribute("patchsrc")&&z.removeAttribute("patchsrc"),z.hasAttribute&&z.hasAttribute("for")&&Cg("for",Y)&&z.removeAttribute("for")}catch{}}return!0})},_g=function(y){let x=null,L=null;if(He)y="<remove></remove>"+y;else{const re=Ew(y,Gw);L=re&&re[0]}En==="application/xhtml+xml"&&ft===ye&&(y='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+y+"</body></html>");const z=S?ne(y):y;if(ft===ye)try{x=new l().parseFromString(z,En)}catch{}if(!x||!x.documentElement){x=me.createDocument(ft,"template",null);try{x.documentElement.innerHTML=ht?B:z}catch{}}const Y=x.body||x.documentElement;return y&&L&&Y.insertBefore(r.createTextNode(L),Y.childNodes[0]||null),ft===ye?te.call(x,Te?"html":"body")[0]:Te?x.documentElement:Y},xa=function(y){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const L=O?O(y):y.ownerDocument;return we.call(L||y,y,(x?0:p.SHOW_ELEMENT)|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Sp=function(y){return y=sa(y,Je," "),y=sa(y,ze," "),y=sa(y,ve," "),y},Tp=function(y){var x;Mp(y);const L=(x=y.querySelectorAll)===null||x===void 0?void 0:x.call(y,"template");L&&Vt(L,z=>{bo(z.content)&&Tp(z.content)})},Mp=function(y){y.normalize();const x=xa(y,!0);let L=x.nextNode();for(;L;)L.data=Sp(L.data),L=x.nextNode()},Pa=function(y){const x=D?D(y):null;return typeof x!="string"||Ne(x)!=="form"?!1:typeof y.nodeName!="string"||typeof y.textContent!="string"||typeof y.removeChild!="function"||y.attributes!==P(y)||typeof y.removeAttribute!="function"||typeof y.removeAttributeNode!="function"||typeof y.getAttributeNode!="function"||typeof y.setAttribute!="function"||typeof y.namespaceURI!="string"||typeof y.insertBefore!="function"||typeof y.hasChildNodes!="function"||y.nodeType!==E(y)||y.childNodes!==k(y)},Dg=function(y){if(!E||typeof y!="object"||y===null)return null;try{const x=E(y);return typeof x=="number"?x:null}catch{return null}},bo=function(y){return Dg(y)===Ie.documentFragment},Sn=function(y){return Dg(y)!==null};function Ot(N,y,x){N.length!==0&&Vt(N,L=>{L.call(t,y,x,wa)})}const TE=function(y,x,L){return!!(ce&&L===Ie.element&&y.hasChildNodes()&&!Sn(y.firstElementChild)&&Ve(ql,y.textContent)&&Ve(ql,y.innerHTML)||ce&&Kw[x]&&L===Ie.element&&I(y)===ye&&(Sn(y.firstElementChild)||typeof y.textContent=="string"&&Ve(ql,y.textContent))||L===Ie.processingInstruction||ce&&L===Ie.comment&&Ve(km,y.data))},Ea=function(y,x){if(y instanceof RegExp)return Ve(y,x);if(y instanceof Function){for(var L=arguments.length,z=new Array(L>2?L-2:0),Y=2;Y<L;Y++)z[Y-2]=arguments[Y];return!!y(x,...z)}return!1},ME=function(y,x,L){if(!V[x]&&Rg(x)&&Ea(U.tagNameCheck,x))return!1;if(Ae&&!Pt[x]&&!Pt[Nr(x)]){const z=v(y),Y=k(y);if(Y&&z){const re=Y.length;for(let de=re-1;de>=0;--de){const qe=y===L?c(Y[de],!0):Y[de];z.insertBefore(qe,b(y))}}}return mr(y),!0},Ag=function(y,x,L,z){return y.length===0?x:x===L||x===z?mn(x):x},ko=function(y,x){return y===x||v(y)!==null?!1:(qt&&Pp(y),!0)},CE=function(y,x){if(EE(y),Ot(se.beforeSanitizeElements,y,null),ko(y,x))return!0;if(Pa(y))return mr(y),!0;const L=Ne(R(y)),z=A(y);if(xe=Ag(se.uponSanitizeElement,xe,Dt,Ke),Ot(se.uponSanitizeElement,y,{tagName:L,allowedTags:xe}),ko(y,x))return!0;if(TE(y,L,z))return mr(y),!0;if(V[L]||!(J.tagCheck instanceof Function&&J.tagCheck(L))&&!xe[L]){const Y=ME(y,L,x);return Y===!1&&(Ot(se.afterSanitizeElements,y,null),ko(y,x))?!0:Y}if(z===Ie.element&&!yE(y)||(L==="noscript"||L==="noembed"||L==="noframes")&&Ve(Ww,y.innerHTML))return mr(y),!0;if(ie&&z===Ie.text){const Y=y.textContent,re=Sp(Y);Y!==re&&(un(t.removed,{element:y.cloneNode()}),y.textContent=re)}return Ot(se.afterSanitizeElements,y,null),ko(y,x)},Og=function(y,x,L){if(j[x]||Cg(x,y)||At&&(x==="id"||x==="name")&&(L in r||L in mE))return!1;const z=C[x]||J.attributeCheck instanceof Function&&J.attributeCheck(x,y);if(T&&Ve(Ee,x)||pe&&Ve(ho,x))return!0;if(!z)return Rg(y)&&Ea(U.tagNameCheck,y)&&Ea(U.attributeNameCheck,x,y)||x==="is"&&U.allowCustomizedBuiltInElements&&Ea(U.tagNameCheck,L);if(Ue[x])return!0;const Y=sa(L,wn,"");return Ve(mo,Y)||(x==="src"||x==="xlink:href"||x==="href")&&y!=="script"&&Fl(L,"data:")===0&&hr[y]||X&&!Ve(vn,Y)?!0:!L},_E=be({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Rg=function(y){return!_E[Nr(y)]&&Ve(xn,y)},DE=function(y,x,L,z){if(S&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!L)switch(d.getAttributeType(y,x)){case"TrustedHTML":return ne(z);case"TrustedScriptURL":return Pe(z)}return z},AE=function(y,x,L,z){try{return L?y.setAttributeNS(L,x,z):y.setAttribute(x,z),Pa(y)?(mr(y),!1):!0}catch{return go(x,y),!1}},Ig=function(y,x){return ce&&Ve(Vw,x)?!0:Nr(y)==="attributename"&&Fl(x,"href")!==-1},OE=function(y,x){if(Ot(se.beforeSanitizeAttributes,y,null),ko(y,x))return;const L=y.attributes;if(!L||Pa(y))return;C=Ag(se.uponSanitizeAttribute,C,q,ot);const z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:C,forceKeepAttr:void 0};let Y=L.length;const re=Ne(R(y));for(;Y--;){const de=L[Y],qe=de.name,Qt=de.namespaceURI,Rt=de.value,mt=Ne(qe),jt=Rt;let Ye=qe==="value"?jt:Sw(jt),Lg=!1;if(z.attrName=mt,z.attrValue=Ye,z.keepAttr=!0,z.forceKeepAttr=void 0,Ot(se.uponSanitizeAttribute,y,z),Ye=z.attrValue,Hr&&(mt==="id"||mt==="name")&&Fl(Ye,ut)!==0&&(go(qe,y,de),Ye=ut+Ye,Lg=!0),Ig(qe,Ye)){go(qe,y,de);continue}if(!z.forceKeepAttr){if(!z.keepAttr){go(qe,y,de);continue}if(!ee&&Ve(ym,Ye)){go(qe,y,de);continue}if(ie&&(Ye=Sp(Ye)),!Og(re,mt,Ye)){go(qe,y,de);continue}Ye=DE(re,mt,Qt,Ye),Ye!==jt&&AE(y,qe,Qt,Ye)&&Lg&&pm(t.removed)}}Ot(se.afterSanitizeAttributes,y,null),ko(y,x)},Cp=function(y,x){CE(y,x),OE(y,x),bo(y.content)&&_p(y.content)},_p=function(y){let x=null;const L=xa(y);for(Ot(se.beforeSanitizeShadowDOM,y,null);x=L.nextNode();)if(Ot(se.uponSanitizeShadowNode,x,null),Cp(x,y),A(x)===Ie.element){const z=w(x);bo(z)&&(Dp(z),_p(z))}ie&&Mp(y),Ot(se.afterSanitizeShadowDOM,y,null)},Dp=function(y){const x=[{node:y,shadow:null}];for(;x.length>0;){const L=x.pop();if(L.shadow){_p(L.shadow);continue}const z=L.node,Y=A(z)===Ie.element,re=k(z);if(re)for(let de=re.length-1;de>=0;--de)x.push({node:re[de],shadow:null});if(Y){const de=D?D(z):null;if(typeof de=="string"&&Ne(de)==="template"){const qe=z.content;bo(qe)&&x.push({node:qe,shadow:null})}}if(Y){const de=w(z);bo(de)&&x.push({node:null,shadow:de},{node:de,shadow:null})}}};return t.sanitize=function(N){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=null,L=null,z=null,Y=null;if(ht=!N,ht&&(N="<!-->"),typeof N!="string"&&!Sn(N)&&(N=Dw(N),typeof N!="string"))throw Gt("dirty is not a string, aborting");if(!t.isSupported)return N;Le?(xe=Ke,C=ot):yp(y),t.removed=[];const re=qt&&typeof N!="string"&&Sn(N);let de=[];const qe=xt;if(re){SE(N);const jt=R(N);if(typeof jt=="string"){const Ye=Ne(jt);if(!xe[Ye]||V[Ye])throw vp(N),Gt("root node is forbidden and cannot be sanitized in-place")}if(Pa(N))throw vp(N),Gt("root node is clobbered and cannot be sanitized in-place");de=Ep(N),xt=Ll()}else if(Sn(N))x=_g("<!---->"),L=x.ownerDocument.importNode(N,!0),L.nodeType===Ie.element&&L.nodeName==="BODY"||L.nodeName==="HTML"?x=L:x.appendChild(L),Dp(x);else{if(!ct&&!ie&&!Te&&N.indexOf("<")===-1)return Se(N);if(x=_g(N),!x)return ct?null:De?B:""}x&&He&&mr(x.firstChild);const Qt=re?N:x;try{re&&Dp(N);const jt=xa(Qt);for(;z=jt.nextNode();)Cp(z,Qt);re&&xE(N,de)}catch(jt){throw re&&(vp(N),Mg(N,de)),jt}finally{xt=qe}if(re){if(Mg(N,de))throw Gt("a node selected for removal could not be safely returned; refusing to sanitize in place");return ie&&Tp(N),N}if(ct){if(ie&&Tp(x),Ce)for(Y=ke.call(x.ownerDocument);x.firstChild;)Y.appendChild(x.firstChild);else Y=x;return(C.shadowroot||C.shadowrootmode)&&(Y=Me.call(o,Y,!0)),Y}const Rt=()=>Te?x.outerHTML:x.innerHTML;let mt=Rt();return ie&&Ve(Fw,mt)&&(Mp(x),mt=Rt()),Te&&xe["!doctype"]&&x.ownerDocument&&x.ownerDocument.doctype&&x.ownerDocument.doctype.name&&Ve(qw,x.ownerDocument.doctype.name)&&(mt="<!DOCTYPE "+x.ownerDocument.doctype.name+`>
296
- `+mt),Se(mt)},t.setConfig=function(){let N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};yp(N),Le=!0,Ke=xe,ot=C},t.clearConfig=function(){wa=null,Le=!1,Ke=null,ot=null,S=F,B=""},t.isValidAttribute=function(N,y,x){wa||yp({});const L=Ne(N),z=Ne(y);return typeof x=="string"&&(Ig(y,x)||!ee&&Ve(ym,x))?!1:Og(L,z,x)},t.addHook=function(N,y){typeof y=="function"&&Ze(se,N)&&un(se[N],y)},t.removeHook=function(N,y){if(Ze(se,N)){if(y!==void 0){const x=ww(se[N],y);return x===-1?void 0:Pw(se[N],x,1)[0]}return pm(se[N])}},t.removeHooks=function(N){Ze(se,N)&&(se[N]=[])},t.removeAllHooks=function(){se=vm()},t}var Zw=wm();const Jw={contain:"xMidYMid meet",cover:"xMidYMid slice",fill:"none",none:"xMidYMid meet","scale-down":"xMidYMid meet"};function Qw(e,t){const r=e.options;return Us(r.formatter,t,String(r.testData||r.title||""))||"1234567890128"}function ex(e){return g("div",{class:"print-qrcode",dataset:{codeId:e.id,codeKind:"qrcode"}})}function tx(e){const t=e.options;return g("div",{class:"print-barcode",dataset:{codeId:e.id,codeKind:"barcode"}},[g("svg",{preserveAspectRatio:Jw[String(t.fit||"contain")]??"xMidYMid meet",style:{maxWidth:"100%",maxHeight:"100%"}})])}function rx(e){const t=(e.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number);return t.length!==4||t.some(r=>!Number.isFinite(r))?null:{width:t[2],height:t[3]}}function ox(e,t,r){const o=e.options,n=Do(o.barWidth),i=qa(o.barQuietZone),a=s=>{js(t,Qw(e,r),{format:String(o.barcodeType||"CODE128"),width:n,height:s*n,displayValue:!o.hideTitle,fontSize:(o.fontSize??Bn)*n,margin:0,marginLeft:i*n,marginRight:i*n,marginTop:0,marginBottom:ja*n});const p=rx(t);return p?{widthUnits:p.width,heightUnits:p.height}:null};try{const s=Va({barHeightMm:o.barHeight,boxWidthMm:Kr(o.width,o.maxWidth),boxHeightMm:Kr(o.height,o.maxHeight),dpi:o.printerDpi,barWidth:o.barWidth,measure:a});t.style.width=s.size?`${s.size.widthMm}mm`:"",t.style.height=s.size?`${s.size.heightMm}mm`:""}catch{t.replaceChildren();return}t.setAttribute("shape-rendering","crispEdges")}function nx(e,t,r){const o=e.options,n=Us(o.formatter,r,String(o.testData||o.title||""))||oe("code.k27");t.replaceChildren();try{const i=ml.render(n,"qrcode",{qrCodeLevel:String(o.qrCodeLevel??"M"),qrQuietZone:typeof o.qrQuietZone=="number"?o.qrQuietZone:void 0}),a=document.createElement("img");a.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`,a.alt="qrcode",a.style.width="100%",a.style.height="100%",a.style.objectFit=String(o.fit||"contain"),a.style.maxWidth=o.maxWidth?`${o.maxWidth}mm`:"100%",a.style.maxHeight=o.maxHeight?`${o.maxHeight}mm`:"100%",t.appendChild(a)}catch{}}function ix(e,t,r){for(const o of Array.from(e.querySelectorAll("[data-code-kind]"))){const n=o.dataset.codeId,i=t.find(a=>a.id===n);if(i)if(o.dataset.codeKind==="barcode"){const a=o.querySelector("svg");a&&ox(i,a,r)}else nx(i,o,r)}}const da=new Map;function ax(e){return typeof Node<"u"&&e instanceof Node}function xm(e,t,r){if(Pm(e),typeof t=="string"){r.innerHTML=t;return}if(ax(t)){r.appendChild(t);return}typeof t.node=="string"?r.innerHTML=t.node:r.appendChild(t.node),typeof t.dispose=="function"&&da.set(e,t.dispose)}function Pm(e){const t=da.get(e);if(t){da.delete(e);try{t()}catch{}}}function Em(){for(const e of[...da.keys()])Pm(e)}const sx={header:"table.k450",data:"table.k451",subtotal:"table.k452",summary:"table.k453"},lx=[{value:"header",labelKey:"table.k454"},{value:"data",labelKey:"table.k455"},{value:"subtotal",labelKey:"table.k456"},{value:"summary",labelKey:"table.k457"}],ca=3.7795275591,px=.1,Wl=e=>JSON.parse(JSON.stringify(e)),Sm=new WeakMap;function Kt(e){let t=Sm.get(e);return t||(t={menu:null,menuElId:null,anchor:null,layouts:new Map},Sm.set(e,t)),t}function gn(e,t){return e.templateData.elements.find(r=>r.id===t)??null}function dx(e,t){const r=e.tableSelection;return!r||r.elementId!==t.id?null:e.selectedElement?.id!==t.id?(e.tableSelection=null,null):r}function Tm(e,t,r,o){const n=gn(e,r.id);if(!n)return null;const i=r.options;return{store:e,fire:t,el:r,real:n,options:i,rows:i.tableRows??[],colWidths:i.tableColWidths??[],isSelected:e.selectedIds.has(r.id),selection:dx(e,r),maxTableWidth:Mm(e),designData:o}}function Mm(e){return e.paperSize.width-e.templateData.margins.left-e.templateData.margins.right}function Vl(e){return e.options.tableDefaultFontSize??10}function Cm(e){return e.options.tableDefaultColor??"#333333"}function cx(e,t){let r=0;for(let o=0;o<t;o++)r+=e.rows[o].height;return r}function ux(e,t){return Kt(e.store).layouts.get(e.el.id)?.[t]?.top??cx(e,t)}function fx(e,t){return Kt(e.store).layouts.get(e.el.id)?.[t]?.height??e.rows[t]?.height??0}function hx(e){const t=e.options.dataSource;if(t&&Array.isArray(vt[t]))return vt[t];for(const r of Object.values(vt))if(Array.isArray(r))return r}function _m(e){return e.cellType==="barcode"||e.cellType==="qrcode"}function Dm(e,t){return _m(t)?Us(t.formatter,hx(e)):t.formatter||""}function mx(e,t){const r={designMode:!0,showGhostBorder:e.store.showTableGhostBorder};return{fontFamily:Ts(t.fontFamily??e.options.tableDefaultFontFamily),textAlign:t.align??"left",...t.align==="justify"?{textAlignLast:"justify"}:{},verticalAlign:t.valign??"middle",fontSize:(t.fontSize??Vl(e))+"pt",fontWeight:t.fontWeight??"normal",color:t.color??Cm(e),backgroundColor:t.backgroundColor??"transparent",borderTop:Rn(t.borders?.top,r),borderRight:Rn(t.borders?.right,r),borderBottom:Rn(t.borders?.bottom,r),borderLeft:Rn(t.borders?.left,r),padding:(t.padding??e.options.tableDefaultPadding??1)+"mm",whiteSpace:t.wordWrap??!0?"pre-wrap":"nowrap",overflow:t.wordWrap??!0?"visible":"hidden"}}function gx(e,t,r){const o=e.selection;return[!!o&&t>=o.r1&&t<=o.r2&&r>=o.c1&&r<=o.c2?"cell-selected":"",e.rows[t]?.type==="data"?"row-data-bg":""].filter(Boolean).join(" ")}function Am(e){return Fa(e)}function bx(e){return Am(e)!=="autoHeight"}function kx(e,t){return t.fontSize??Vl(e)}function ua(e,t,r){return Co(e.rows,t,r,e.options.tableDefaultPadding??1)}function yx(e,t,r){return za(e.colWidths,t,r,e.options.tableDefaultPadding??1)}function vx(e,t,r){return{maxHeight:ua(e,r,t)+"mm",overflow:"hidden",...t.wordWrap===!1?{whiteSpace:"nowrap",textOverflow:"ellipsis"}:{}}}function wx(e,t,r){const o={fitBase:String(kx(e,t)),fitMin:String(Mo(t.shrinkMinFontSize)),fitMm:String(ua(e,r,t))};return Am(t)==="shrink"&&(o.fit="shrink"),o}function xx(e){const t=(e.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number);return t.length!==4||t.some(r=>!Number.isFinite(r))?null:{width:t[2],height:t[3]}}const Px={contain:"xMidYMid meet",cover:"xMidYMid slice",fill:"none",none:"xMidYMid meet","scale-down":"xMidYMid meet"};function Ex(e,t,r,o){const n=document.createElement("div");n.className="cell-barcode";const i=document.createElementNS(B2,"svg");n.appendChild(i);const a=Dm(e,o);if(o.cellType==="barcode"){i.setAttribute("preserveAspectRatio",Px[o.fit||"contain"]??"xMidYMid meet");const s=Do(o.barWidth),p=qa(o.barQuietZone),l=c=>{js(i,a,{format:o.barcodeType||"CODE128",width:s,height:c*s,displayValue:o.showBarcodeText!==!1,fontSize:(o.barFontSize??Bn)*s,margin:0,marginLeft:p*s,marginRight:p*s,marginTop:0,marginBottom:ja*s});const f=xx(i);return f?{widthUnits:f.width,heightUnits:f.height}:null};let d=null;try{d=Va({barHeightMm:o.barHeight,boxWidthMm:Kr(yx(e,r,o),o.maxWidth),boxHeightMm:Kr(ua(e,t,o),o.maxHeight),dpi:o.printerDpi,barWidth:o.barWidth,measure:l})}catch{d=null}if(!d){i.style.display="none";const c=document.createElement("span");return c.className="cell-barcode-fallback",c.textContent=a||m(e,"table.k458"),n.appendChild(c),n}const u=d.size;return u?(i.style.width=`${u.widthMm}mm`,i.style.height=`${u.heightMm}mm`):(i.style.maxWidth=o.maxWidth?`${o.maxWidth}mm`:"100%",i.style.maxHeight=o.maxHeight?`${o.maxHeight}mm`:"100%"),i.setAttribute("shape-rendering","crispEdges"),n}if(i.style.display="none",!a)return n;try{const s=ml.render(a,"qrcode",{qrCodeLevel:String(o.qrCodeLevel||"M"),qrQuietZone:typeof o.qrQuietZone=="number"?o.qrQuietZone:void 0}),p=document.createElement("img");p.setAttribute("src",`data:image/svg+xml;charset=utf-8,${encodeURIComponent(s)}`),p.setAttribute("alt","qrcode"),p.style.width="100%",p.style.height="100%",p.style.objectFit=o.fit||"contain",o.objectPosition&&(p.style.objectPosition=o.objectPosition),p.style.maxWidth=o.maxWidth?`${o.maxWidth}mm`:"100%",p.style.maxHeight=o.maxHeight?`${o.maxHeight}mm`:"100%",n.appendChild(p)}catch{}return n}function Om(){const e=document.createElement("div");return e.className="image-placeholder",e.textContent=oe("table.k459"),e}function Sx(e,t){const r=e.formatter||"";if(!r)return"";if(!r.includes("{"))return r;const o=t.designData?.length?t.designData[0]:vt;return to(r,o)}function Tx(e,t,r){const o=document.createElement("div");o.className="cell-image";const n=kd(r.fit,ua(e,t,r));n!==void 0&&(o.style.height=`${n}mm`);const i=Sx(r,e);if(!i)return o.appendChild(Om()),o;const a=document.createElement("img");a.setAttribute("src",i),n!==void 0&&(a.style.width="100%",a.style.height="100%"),a.style.objectFit=r.fit||"contain";for(const[s,p]of Object.entries(Ga(r.fit,r.fitScale,r.objectPosition)))a.style[s]=p;return a.style.maxWidth=r.maxWidth?`${r.maxWidth}mm`:"100%",a.style.maxHeight=r.maxHeight?`${r.maxHeight}mm`:"100%",a.addEventListener("error",()=>{a.remove(),o.appendChild(Om())},{once:!0}),o.appendChild(a),o}function Mx(e,t,r,o,n){if(_m(n))return Ex(e,r,o,n);if(n.cellType==="image")return Tx(e,r,n);const i=Dm(e,n),a=()=>t.type==="data"?g("span",{class:"data-placeholder",text:i}):i;return bx(n)?g("div",{class:"cell-fit",style:vx(e,n,r),dataset:wx(e,n,r)},[a()]):a()}function fa(e,t,r){const o={elementId:e.el.id,...Jp(e.rows,t,r)};e.store.setTableSelection(o),e.fire("table-selection-change",{elementId:e.el.id,selection:o})}function Cx(e,t,r,o,n){if(n.button!==0||(e.fire("table-cell-mousedown",{elementId:e.el.id,r:t,c:r,cellId:o,event:n}),!e.isSelected))return;n.stopPropagation();const i=Kt(e.store);n.shiftKey&&e.selection?fa(e,{r:e.selection.r1,c:e.selection.c1},{r:t,c:r}):(i.anchor={r:t,c:r},fa(e,{r:t,c:r},{r:t,c:r})),document.addEventListener("mouseup",()=>{Kt(e.store).anchor=null},{once:!0})}function _x(e,t,r){const o=Kt(e.store).anchor;o&&fa(e,o,{r:t,c:r})}function Gl(e,t){const r=Kt(e);r.menu?.visible&&(r.menu.visible=!1,t("table-menu-close",{elementId:r.menuElId}),e.emit(!1))}function Dx(e,t,r,o){o.preventDefault(),o.stopPropagation(),e.isSelected||e.store.selectOne(e.el.id);const n=e.selection;n&&t>=n.r1&&t<=n.r2&&r>=n.c1&&r<=n.c2||fa(e,{r:t,c:r},{r:t,c:r});const a=Kt(e.store);a.menuElId=e.el.id,a.menu&&(a.menu.x=o.clientX,a.menu.y=o.clientY,a.menu.visible=!0),e.fire("table-cell-contextmenu",{elementId:e.el.id,r:t,c:r,clientX:o.clientX,clientY:o.clientY}),e.store.emit(!1),document.addEventListener("mousedown",()=>Gl(e.store,e.fire),{once:!0})}function Rm(e,t,r){const o=e.reduce((n,i)=>n+i,0)+(e[t]??0);return o>r?oe("table.k460",{v0:Math.round(o*10)/10,v1:r}):null}function Ax(e,t){const r=e.real.options.tableRows??[],o=e.real.options.tableColWidths??[],n=t(Wl(r),Wl(o));return n?(window.alert(n),!1):(e.store.recordHistory(),t(r,o),e.store.setTableSelection(null),Eo(e.real.options),e.store.emit(),!0)}function Yt(e,t,r){Gl(e.store,e.fire);const o=e.selection;if(!o)return;let n=null;switch(t){case"insert-row-above":n=i=>(rd(i,o.r1,"above"),null);break;case"insert-row-below":n=i=>(rd(i,o.r2,"below"),null);break;case"delete-row":n=i=>Sb(i,o.r1);break;case"insert-col-left":n=(i,a)=>{const s=Rm(a,o.c1,e.maxTableWidth);return s||(od(i,a,o.c1,"left"),null)};break;case"insert-col-right":n=(i,a)=>{const s=Rm(a,o.c2,e.maxTableWidth);return s||(od(i,a,o.c2,"right"),null)};break;case"delete-col":n=(i,a)=>Tb(i,a,o.c1);break;case"merge":n=i=>(ed(i,o),null);break;case"split":n=i=>(td(i,o),null);break;case"set-row-type":n=i=>r?Ia(i,o.r1,r):m(e,"table.k461");break}n&&Ax(e,n)&&e.fire(`table-${t}`,{elementId:e.el.id,...r?{type:r}:{}})}function Ox(e){const t=e.selection;if(!t)return!1;for(let r=t.r1;r<=t.r2;r++)for(let o=t.c1;o<=t.c2;o++){const n=e.rows[r]?.cells[o];if(n&&!n.merged&&((n.rowspan??1)>1||(n.colspan??1)>1))return!0}return!1}function Rx(e){const t=e.selection;if(!t)return;const r=Po(e.rows,t.r1,t.c1),o=!e.rows[r.r]?.cells[r.c]?.mergeSameValue;for(let n=t.r1;n<=t.r2;n++)for(let i=t.c1;i<=t.c2;i++){const a=e.rows[n]?.cells[i];a&&!a.merged&&(a.mergeSameValue=o)}e.store.updateElement(e.el.id,{tableRows:e.rows}),Gl(e.store,e.fire)}function Im(e){const t=e.selection;if(!t)return m(e,"table.k462");for(let r=t.r1;r<=t.r2;r++)if(e.rows[r]?.type!=="data")return m(e,"table.k463");return null}function Lm(e,t){const r=e.selection;return r?r.r1!==r.r2?m(e,"table.k465"):Ia(Wl(e.rows),r.r1,t):m(e,"table.k464")}function zt(e,t,r={}){return g("div",{class:`menu-item${r.disabled?" disabled":""}${r.active?" active":""}`,title:r.title||"",text:e,onClick:()=>{r.disabled||t()}})}const Kl=()=>g("div",{class:"menu-divider"});function Ix(e,t,r){const o=Kt(e);if(o.menu=r,!r.visible||!o.menuElId)return"";const n=gn(e,o.menuElId);if(!n||n.printElementType.type!=="table")return"";const i=Tm(e,t,n);if(!i)return"";const a=i.selection?Qp(i.rows,i.selection):m(i,"table.k466"),s=i.selection?i.rows[i.selection.r1]?.type??null:null;return g("div",{class:"table-ctx-menu",style:{left:r.x+"px",top:r.y+"px"},onMousedown:p=>p.stopPropagation()},[zt(m(i,"table.k467"),()=>Yt(i,"insert-row-above")),zt(m(i,"table.k468"),()=>Yt(i,"insert-row-below")),zt(m(i,"table.k469"),()=>Yt(i,"delete-row"),{disabled:i.rows.length<=1}),Kl(),zt(m(i,"table.k470"),()=>Yt(i,"insert-col-left")),zt(m(i,"table.k471"),()=>Yt(i,"insert-col-right")),zt(m(i,"table.k472"),()=>Yt(i,"delete-col"),{disabled:i.colWidths.length<=1}),Kl(),zt(m(i,"table.k473"),()=>Yt(i,"merge"),{disabled:!!a,title:a||""}),zt(m(i,"table.k474"),()=>Yt(i,"split"),{disabled:!Ox(i)}),zt(m(i,"table.k475"),()=>Rx(i),{disabled:!!Im(i),title:Im(i)||"",active:(()=>{const p=i.selection;if(!p)return!1;const l=Po(i.rows,p.r1,p.c1);return i.rows[l.r]?.cells[l.c]?.mergeSameValue===!0})()}),Kl(),g("div",{class:"menu-group-title",text:m(i,"table.k476")}),...lx.map(p=>zt(oe(p.labelKey),()=>Yt(i,"set-row-type",p.value),{disabled:!!Lm(i,p.value),title:Lm(i,p.value)||"",active:s===p.value}))])}let Br=null;function Nm(){Br&&(document.removeEventListener("mousemove",Yl),document.removeEventListener("mouseup",Xl),Br.handle.classList.remove("dragging"),Br=null)}function Lx(e,t){const r=e.closest(".hiprint-printPaper");return(r&&r.offsetWidth>0?r.getBoundingClientRect().width/r.offsetWidth:0)||(t.scale||100)/100}function Nx(e,t,r){if(r.button!==0)return;const o=r.currentTarget,n=o.closest(".print-table");if(!n)return;Nm();const i=e.real.options.tableColWidths??[];Br={store:e.store,fire:e.fire,elId:e.real.id,boundary:t,startX:r.clientX,startWidth:i[t-1]??0,scale:Lx(n,e.store),root:n,wrapper:o.closest(".print-element"),handle:o},o.classList.add("dragging"),e.store.recordHistory(),document.addEventListener("mousemove",Yl),document.addEventListener("mouseup",Xl)}function Yl(e){const t=Br;if(!t)return;const r=gn(t.store,t.elId),o=r?.options.tableColWidths;if(!r||!o)return;const n=(e.clientX-t.startX)/(t.scale*ca),i=t.boundary-1;o[i]=Rb(o,i,t.startWidth+n,Mm(t.store)),Eo(r.options),o.forEach((a,s)=>{const p=t.root.querySelector(`colgroup col:nth-child(${s+1})`);p&&(p.style.width=`${a}mm`)}),t.root.querySelectorAll(".col-resize-handle").forEach((a,s)=>{a.style.left=`${o.slice(0,s+1).reduce((p,l)=>p+l,0)}mm`}),t.wrapper&&(t.wrapper.style.width=`${r.options.width}mm`,t.wrapper.style.height=`${r.options.height}mm`)}function Xl(){document.removeEventListener("mousemove",Yl),document.removeEventListener("mouseup",Xl);const e=Br;if(!e)return;Br=null,e.handle.classList.remove("dragging");const t=gn(e.store,e.elId);t&&Eo(t.options),e.store.emit(),e.fire("table-col-resize-end",{elementId:e.elId})}function Bx(e,t,r){const o=r.querySelector("table");if(!o)return;const n=o.offsetHeight;if(n<=0)return;const i=gn(e,t);if(!i)return;let a=!1;const s=n/ca;Math.abs(s-(i.options.height??0))>px&&(i.options.height=Math.round(s*100)/100,a=!0);const p=o.offsetTop,l=Array.from(o.rows).map(u=>({top:(u.offsetTop-p)/ca,height:u.offsetHeight/ca})),d=Kt(e);Fx(d.layouts.get(t),l)||(d.layouts.set(t,l),a=!0),a&&e.emit(!1)}function Fx(e,t){return!e||e.length!==t.length?!1:t.every((r,o)=>{const n=e[o];return Math.round(r.top*10)===Math.round(n.top*10)&&Math.round(r.height*10)===Math.round(n.height*10)})}function $x(e,t){const r=document.createComment("pd-table-measure");return requestAnimationFrame(()=>{if(!r.isConnected)return;const o=r.parentElement;o&&Bx(e,t,o)}),r}function zx(e){return e.isSelected&&!e.real.options.locked&&e.colWidths.length>=1}function Hx(e){return Array.from({length:e.colWidths.length},(t,r)=>r+1)}function Ux(e,t){return e.colWidths.slice(0,t).reduce((r,o)=>r+o,0)}function qx(e,t,r,o){const n=Tm(t,r,e,o);if(!n)return g("div",{class:"print-table"});const i=[g("table",{style:{fontSize:`${Vl(n)}pt`,color:Cm(n)}},[g("colgroup",{},n.colWidths.map(a=>g("col",{style:{width:a+"mm"}}))),g("tbody",{},n.rows.map((a,s)=>g("tr",{style:{height:a.height+"mm"}},a.cells.map((p,l)=>p.merged?"":g("td",{rowspan:p.rowspan||1,colspan:p.colspan||1,class:gx(n,s,l),style:mx(n,p),onMousedown:d=>Cx(n,s,l,p.id,d),onMouseenter:()=>_x(n,s,l),onContextmenu:d=>Dx(n,s,l,d)},[Mx(n,a,s,l,p)])).filter(Boolean))))])];return zx(n)&&i.push(g("div",{class:"col-resize-layer"},Hx(n).map(a=>g("div",{class:"col-resize-handle",role:"separator","aria-label":m(n,"table.k477",{v0:a}),style:{left:Ux(n,a)+"mm"},onMousedown:s=>{s.stopPropagation(),s.preventDefault(),Nx(n,a,s)}})))),n.isSelected&&i.push(g("div",{class:"row-badges"},n.rows.map((a,s)=>g("span",{class:"row-badge",style:{top:ux(n,s)+"mm",height:fx(n,s)+"mm"},text:oe(sx[a.type])})))),i.push($x(t,e.id)),g("div",{class:"print-table design-mode",dataset:{tableId:e.id},onContextmenu:a=>a.preventDefault()},i)}const jx=["flowList.k44","flowList.k45","flowList.k46","flowList.k47","flowList.k48","flowList.k49","flowList.k50"];function Wx(){return jx.map(e=>oe(e))}function Zl(e){return Array.isArray(e)&&e.length>0?e:[]}function Vx(e,t){const r=Nn(e,t)??(t?Object.keys(t).find(n=>Array.isArray(t[n])):void 0);if(r)return Zl(t?.[r]);const o=Nn(e,vt);return o?Zl(vt[o]):[]}function Gx(e,t){const r=e.options,o=typeof r.formatter=="string"?r.formatter:"",n=Zl(t)[0],i=Vx(o,n);if(i.length===0)return Wx();if(!o)return i.map(p=>String(p?.name??JSON.stringify(p)));const a=n??{},s=Nn(o,a)??Object.keys(a).find(p=>Array.isArray(a[p]));return i.map(p=>{try{return to(o,{...a,...p,...s?{[s]:p}:{}})}catch{return o}})}const Kx=3.7795275591,Yx=.1;function Xx(e,t){return e.templateData.elements.find(r=>r.id===t)??null}function Zx(e){const t=e.parentElement;if(!t?.classList.contains("print-element"))return 0;const r=getComputedStyle(t);return(parseFloat(r.borderTopWidth)||0)+(parseFloat(r.borderBottomWidth)||0)}function Jx(e,t,r){const o=r.offsetHeight+Zx(r);if(o<=0)return;const n=Xx(e,t);if(!n)return;const i=o/Kx;Math.abs(i-(n.options.height??0))>Yx&&(n.options.height=Math.round(i*100)/100,e.emit(!1))}function Qx(e,t){const r=document.createComment("pd-flowlist-measure");return requestAnimationFrame(()=>{if(!r.isConnected)return;const o=r.parentElement;o&&Jx(e,t,o)}),r}function eP(e,t,r){const o=e.options,n=bt(o.flowColumns),i=Et(o.flowGapX),a=or(o.flowRowHeight),s=wr(o.flowLayoutMode)==="dynamic",p=Gr(o),l={display:"grid",gridTemplateColumns:`repeat(${n},minmax(0,1fr))`,columnGap:`${i}mm`,gridAutoRows:`minmax(${a}mm,auto)`,width:"100%",...s?{padding:`${p.top}mm ${p.right}mm ${p.bottom}mm ${p.left}mm`,height:"auto",overflow:"visible"}:{height:"100%",overflow:"hidden"},fontSize:`${o.fontSize||12}pt`,fontWeight:o.fontWeight||"normal",color:o.color||"#333",boxSizing:"border-box"};o.fontFamily&&(l.fontFamily=String(o.fontFamily)),o.backgroundColor&&(l.backgroundColor=String(o.backgroundColor));const d=Gx(e,t).map(u=>g("div",{class:"print-flow-cell",text:u}));return s&&r&&d.push(Qx(r,e.id)),g("div",{class:"print-flowlist",style:l},d)}const Bm={top:"flex-start",middle:"center",bottom:"flex-end"},tP={left:"flex-start",center:"center",right:"flex-end"};function rP(e,t){const r=e.options,o=kt(r),n=zn(e.printElementType.type,r),i={};if(n?.all&&(i.border=`${n.all.borderWidth} ${n.all.borderStyle} ${n.all.borderColor}`),n)for(const a of Ao){const s=n.edges[a];s&&(i[`border${a.charAt(0).toUpperCase()}${a.slice(1)}`]=`${s.borderWidth} ${s.borderStyle} ${s.borderColor}`)}return{position:"absolute",left:`${r.left}mm`,top:`${r.top}mm`,width:`${r.width}mm`,height:`${r.height}mm`,...o.top!==0?{marginTop:`${o.top}mm`}:{},...o.right!==0?{marginRight:`${o.right}mm`}:{},...o.bottom!==0?{marginBottom:`${o.bottom}mm`}:{},...o.left!==0?{marginLeft:`${o.left}mm`}:{},zIndex:String(r.zIndex||"auto"),...i,...oP(e,t)}}function oP(e,t){if(t?.has(e.id))return{};const r=Ka(e.printElementType.type,e.options);return r===void 0?{}:{rotate:`${r}deg`}}function Fm(e){const t=e.options,r=e.printElementType.type==="longText",o=Ln(e.printElementType.type,t),n=t.fontSize||12,i=o==="autoHeight",a={fontSize:`${n}pt`,fontWeight:t.fontWeight||"normal",fontFamily:Ts(t.fontFamily),color:t.color||"#333",backgroundColor:t.backgroundColor||"transparent",textAlign:t.textAlign||"left",...t.textAlign==="justify"?{textAlignLast:"justify"}:{},lineHeight:t.lineHeight?`${t.lineHeight}pt`:r?"1.5":"normal",letterSpacing:t.letterSpacing?`${t.letterSpacing}pt`:"normal",width:"100%",height:i?"auto":"100%",boxSizing:"border-box",overflow:i?"visible":"hidden",...r?{wordBreak:"break-all",textIndent:t.longTextIndent?`${t.longTextIndent}em`:"0"}:{textDecoration:t.textDecoration||"none",padding:`${t.contentPaddingTop||0}pt ${t.contentPaddingRight||0}pt ${t.contentPaddingBottom||0}pt ${t.contentPaddingLeft||0}pt`}};bd(t)&&(a.whiteSpace="nowrap",a.textOverflow="ellipsis");const s=gd(t);return s&&(a.whiteSpace=s),t.verticalAlign&&(a.display="flex",t.textAlign==="justify"?(a.flexDirection="column",a.justifyContent=Bm[t.verticalAlign]??"flex-start"):(a.alignItems=Bm[t.verticalAlign]??"flex-start",a.justifyContent=tP[t.textAlign||"left"]??"flex-start")),{style:a,fit:o}}function $m(e){const t=e.options,r=`${t.borderWidth||.75}pt`,o=t.borderStyle||"solid",n=t.borderColor||"#333";return e.printElementType.type==="hline"?{width:"100%",height:"0",borderTop:`${r} ${o} ${n}`,boxSizing:"border-box"}:{width:"0",height:"100%",borderLeft:`${r} ${o} ${n}`,boxSizing:"border-box"}}function zm(e){const t=e.options;return{width:"100%",height:"100%",borderWidth:`${t.borderWidth||1}pt`,borderStyle:t.borderStyle||"solid",borderColor:t.borderColor||"#333",backgroundColor:t.backgroundColor||"transparent",borderRadius:e.printElementType.type==="oval"?"50%":"0",boxSizing:"border-box"}}function nP(e){const t=e.options;return{objectFit:t.fit||"contain",...Ga(t.fit,t.fitScale,t.objectPosition),maxWidth:t.maxWidth?`${t.maxWidth}mm`:"100%",maxHeight:t.maxHeight?`${t.maxHeight}mm`:"100%"}}function Hm(e){const t=e.options,r={fitBase:String(t.fontSize||12),fitMin:String(Mo(t.shrinkMinFontSize))};return Ln(e.printElementType.type,t)==="shrink"&&(r.fit="shrink"),r}Wh({text:e=>{const{style:t}=Fm(e),r=e.options;return g("div",{class:"print-text",style:t,dataset:Hm(e),text:String(r.testData||r.formatter||"")||oe("elements.k41")})},longText:e=>{const{style:t}=Fm(e),r=e.options;return g("div",{class:"print-longtext",style:t,dataset:Hm(e),text:String(r.formatter||"")||oe("elements.k42")})},hline:e=>g("div",{class:"print-line",style:$m(e)}),vline:e=>g("div",{class:"print-line",style:$m(e)}),rect:e=>g("div",{class:"print-shape",style:zm(e)}),oval:e=>g("div",{class:"print-shape",style:zm(e)}),image:(e,t,r)=>{const o=e.options,n=String(o.src??""),i=r?.designData?.length?r.designData[0]:vt,a=n.includes("{")?to(n,i):n;return g("div",{class:"print-image"},[a?g("img",{src:a,style:nP(e)}):g("div",{class:"image-placeholder",text:oe("elements.k43")})])},qrcode:e=>ex(e),barcode:e=>tx(e),html:e=>{const t=e.options,r=String(t.formatter??""),o=r?Zw.sanitize(to(r,{})):'<div style="background:#e0e0e0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:10pt;color:#999">HTML</div>';return g("div",{class:"print-html",html:o})},pageNumber:(e,t)=>{const r=e.options;return g("div",{class:"page-number-element",style:{fontSize:`${r.fontSize||12}pt`,fontWeight:r.fontWeight||"normal",fontFamily:Ts(r.fontFamily),color:r.color||"#333",textAlign:r.textAlign||"left",...r.textAlign==="justify"?{textAlignLast:"justify"}:{}},text:t?r.title||"{pageIndex}/{totalPages}":String(r.title||"")})},table:(e,t,r)=>r?qx(e,r.store,r.fire,r.designData):g("div",{class:"print-table"}),flowList:(e,t,r)=>eP(e,void 0,r?.store)});function iP(e,t,r){const o=e.printElementType.type,n=dr(o)?.renderContent;if(n)return n(e,t,r);const i=Cl(o);if(!i)return g("div",{text:o});const a=document.createElement("div");a.className="plugin-kit-canvas",a.style.width="100%",a.style.height="100%";try{xm(`canvas:${e.id}`,i.ui.renderCanvas({element:e,data:r?.designData?.length?r.designData:[vt],designMode:!0}),a)}catch{a.textContent=String(o)}return a}function Um(e){return`x:${Math.round(e.left)} y:${Math.round(e.top)} ${Math.round(e.width)}×${Math.round(e.height)}mm`}function aP(e,t,r){const o=e.store,n=o.selectedIds.has(t.id),i=o.previewIds.has(t.id),a=t.options,s=t.zone||"content",p=[iP(t,!0,{store:o,fire:e.fire,designData:e.host.designData})];return o.draggingIds.has(t.id)&&p.push(g("div",{class:"drag-preview"})),n&&(p.push(g("div",{class:"resize-handles"},Iy.map(l=>g("div",{class:`resize-handle handle-${l}`,dataset:{point:l,elId:t.id},onMousedown:d=>e.fire("resize-start",{event:d,id:t.id,point:l})})))),p.push(g("div",{class:"selected-indicator"},[g("div",{class:"position-label",text:Um(a)})]))),g("div",{class:["print-element",`type-${t.printElementType.type}`,`zone-${s}`,n?"selected":"",i?"previewed":"",o.draggingIds.has(t.id)?"drag-ghost":"","design-mode",a.locked?"locked":"",a.visible===!1?"hidden":""].filter(Boolean).join(" "),style:rP(t,r),dataset:{elId:t.id},onMousedown:l=>e.fire("element-mousedown",{event:l,id:t.id}),onContextmenu:l=>{l.preventDefault(),l.stopPropagation(),e.fire("contextmenu",{event:l,id:t.id})}},p)}function Jl(e,t){const r=e.margins,o=e.header?.height??10,n=e.footer?.height??10,i=t.width-r.left-r.right;return{header:{left:r.left,top:r.top,width:i,height:o},content:{left:r.left,top:r.top+o,width:i,height:t.height-r.top-r.bottom-o-n},footer:{left:r.left,top:t.height-r.bottom-n,width:i,height:n}}}const sP='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M0 .5H20M.5 0V20" fill="none" stroke="rgba(0,0,0,0.08)" stroke-width="1" stroke-dasharray="4 4"/></svg>';function qm(e,t){return e.type==="vertical"?{left:`${e.position}mm`,top:"0",height:`${t.height}mm`,borderLeftColor:e.color||"var(--pd-accent-secondary, #f56c6c)"}:{top:`${e.position}mm`,left:"0",width:`${t.width}mm`,borderTopColor:e.color||"var(--pd-accent-secondary, #f56c6c)"}}function lP(e,t){const r=qc(e.watermark,[],t);return r?g("div",{class:"watermark-layer",style:{opacity:String(r.opacity)}},r.tiles.map(o=>g("svg",{class:"watermark-tile",width:`${o.widthMm}mm`,height:`${o.heightMm}mm`,viewBox:`0 0 ${r.tileWidthPx} ${r.tileHeightPx}`,style:{left:`${o.leftMm}mm`,top:`${o.topMm}mm`}},[g("text",{x:String(r.tileWidthPx/2),y:String(r.tileHeightPx/2),"font-size":String(r.fontSizePx),fill:r.color,"text-anchor":"middle","dominant-baseline":"middle",transform:`rotate(${r.rotate},${r.tileWidthPx/2},${r.tileHeightPx/2})`,text:r.text})]))):""}function Ql(e,t,r,o,n,i){const a=e.store,s=[];r!=="content"&&s.push(g("span",{class:"zone-label",text:r==="header"?m(e,"canvas.k11"):m(e,"canvas.k12")}));const p=r==="content"?Fd(n):void 0;if(s.push(...n.map(l=>aP(e,l,p))),r!=="content"){const l=r==="header"?"bottom":"top";s.push(g("div",{class:`zone-resize-handle handle-${l}`,dataset:{zone:r},onMousedown:d=>e.fire("zone-resize",{event:d,zone:r})},[t.zoneResizing===r?g("div",{class:"zone-height-tip",text:`${(r==="header"?a.templateData.header.height:a.templateData.footer.height).toFixed(1)}mm`}):""]))}return g("div",{class:`zone-layer zone-${r} design-mode`,style:{position:"absolute",left:`${o.left}mm`,top:`${o.top}mm`,width:`${o.width}mm`,height:`${o.height}mm`},dataset:{zone:r,paperWidth:String(i.width),paperHeight:String(i.height)}},s.filter(Boolean))}function pP(e){const t=e.currentTarget,r=e.dataTransfer?.types??[],o=r.includes("fieldkey"),n=r.includes("elementtype");if(!o&&!n){t.querySelector(".drop-hint")?.remove();return}o&&(e.ctrlKey||e.metaKey)&&(t.dataset.dropLabelIntent="1");const i=n?oe("canvas.k13"):t.dataset.dropLabelIntent?oe("canvas.k14"):oe("canvas.k15");let a=t.querySelector(".drop-hint");a||(a=document.createElement("div"),a.className="drop-hint",t.appendChild(a)),a.textContent=i,a.style.left=`${e.clientX+14}px`,a.style.top=`${e.clientY+18}px`}function jm(e){e&&(e.querySelector(".drop-hint")?.remove(),delete e.dataset.dropLabelIntent)}function dP(e,t){const r=e.store,o=r.templateData,n=yt(o),i=(r.scale||100)/100,a=Jl(o,n),s=u=>r.elements.filter(c=>(c.zone||"content")===u),p=g("div",{class:"hiprint-printPaper-content",dataset:{content:""},style:{padding:`${o.margins.top}mm ${o.margins.right}mm ${o.margins.bottom}mm ${o.margins.left}mm`,position:"relative",boxSizing:"border-box",minHeight:`${n.height}mm`}},[r.showGrid?g("div",{class:"grid-bg",style:{backgroundImage:`url("data:image/svg+xml,${encodeURIComponent(sP)}")`,backgroundSize:"5mm 5mm",backgroundPosition:"0 0"}}):"",...o.watermark&&Object.keys(o.watermark).length?[lP(o,n)]:[],Ql(e,t,"header",a.header,s("header"),n),Ql(e,t,"content",a.content,s("content"),n),Ql(e,t,"footer",a.footer,s("footer"),n),...r.adsorbGuides.map(u=>g("div",{class:`adsorb-guide guide-${u.type}`,style:qm(u,n)})),...(o.guides??[]).map(u=>g("div",{class:`manual-guide guide-${u.type}`,style:{...qm(u,n),"--guide-hit":`${8/i}px`},dataset:{guideId:String(u.id??"")},onMousedown:c=>e.fire("guide-mousedown",{event:c,id:u.id}),onDblclick:c=>{c.preventDefault(),e.fire("guide-remove",u.id)}}))].filter(Boolean)),l=g("div",{class:"hiprint-printPaper",dataset:{test:"paper"},style:{width:`${n.width}mm`,minHeight:`${n.height}mm`,background:o.pageBackground||"var(--pd-paper, #fff)",boxShadow:"var(--pd-shadow-paper, 0 1px 2px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08))",overflow:"hidden",position:"relative",transform:`scale(${i})`,transformOrigin:"0 0"}},[...o.designBackground?.src?[g("div",{class:"design-background",style:{width:`${n.width}mm`,height:`${n.height}mm`,left:"0",top:"0",transform:o.designBackground.rotation?`rotate(${o.designBackground.rotation}deg)`:""}},[g("img",{src:o.designBackground.src,draggable:!1,alt:""})])]:[],p]),d=[g("div",{class:"canvas-scroll"},[g("div",{class:"paper-wrapper",style:{width:`${ai(n.width)*i}px`,height:`${ai(n.height)*i}px`,position:"relative"}},[l])])];if(r.showRuler&&d.push(g("div",{class:"ruler-overlay",style:{transform:`translate(${t.scrollX}px, ${t.scrollY}px)`}},[g("div",{class:"ruler-corner"}),g("canvas",{class:"pd-ruler is-horizontal",dataset:{ruler:"horizontal"},style:{width:`${t.geom.viewW}px`,height:"20px"},onMousedown:u=>e.fire("ruler-mousedown",{event:u,orientation:"horizontal"})}),g("canvas",{class:"pd-ruler is-vertical",dataset:{ruler:"vertical"},style:{width:"20px",height:`${t.geom.viewH}px`},onMousedown:u=>e.fire("ruler-mousedown",{event:u,orientation:"vertical"})})])),t.guidePreview&&d.push(g("div",{class:`ruler-guide-preview guide-${t.guidePreview.type}`,style:t.guidePreview.type==="vertical"?{left:`${t.guidePreview.position}px`,top:"0",height:"100%"}:{top:`${t.guidePreview.position}px`,left:"0",width:"100%"}})),t.marquee.visible&&d.push(g("div",{class:"marquee-selection",style:{left:`${t.marquee.x}px`,top:`${t.marquee.y}px`,width:`${t.marquee.w}px`,height:`${t.marquee.h}px`}})),t.contextMenu.visible){const u=t.contextMenu;d.push(g("div",{class:"context-menu",style:{left:`${t.contextMenu.x+t.contextMenu.flipX}px`,top:`${t.contextMenu.y+t.contextMenu.flipY}px`}},t.contextMenu.targetId?[_t(e,u,m(e,"canvas.k16"),"copy"),_t(e,u,m(e,"canvas.k17"),"cut"),_t(e,u,m(e,"canvas.k18"),"paste",!r.hasClipboard),_t(e,u,m(e,"canvas.k19"),"delete"),g("div",{class:"context-menu-sep"}),_t(e,u,m(e,"canvas.k20"),"move-layer",!1,"top"),_t(e,u,m(e,"canvas.k21"),"move-layer",!1,"up"),_t(e,u,m(e,"canvas.k22"),"move-layer",!1,"down"),_t(e,u,m(e,"canvas.k23"),"move-layer",!1,"bottom")]:[_t(e,u,m(e,"canvas.k24"),"paste-at",!r.hasClipboard),_t(e,u,m(e,"canvas.k25"),"select-all"),_t(e,u,m(e,"canvas.k26"),"clear-selection")]))}return g("div",{class:"canvas-area",dataset:{test:"canvas-area"},onDragover:u=>{const c=u;c.preventDefault(),c.dataTransfer&&(c.dataTransfer.dropEffect="copy"),pP(c)},onDragleave:u=>{const c=u.currentTarget,f=u.relatedTarget;(!f||!c.contains(f))&&c.querySelector(".drop-hint")?.remove()},onDrop:u=>{const c=u,f=u.currentTarget,h=f.dataset.dropLabelIntent==="1";jm(f),h&&(c.labelIntent=!0),e.fire("drop",c)},onMousedown:u=>e.fire("canvas-mousedown",u),onMousemove:u=>e.fire("canvas-mousemove",u),onMouseleave:()=>e.fire("canvas-mouseleave"),onWheel:u=>e.fire("wheel",u),onScroll:u=>e.fire("scroll",u),onContextmenu:u=>{u.preventDefault(),e.fire("canvas-contextmenu",u)}},d.filter(Boolean))}function _t(e,t,r,o,n=!1,i){return g("div",{class:`context-menu-item${n?" disabled":""}`,text:r,onClick:()=>{t.visible=!1,n||e.fire(o,i),e.repaint()}})}function cP(e){const t=window.innerHeight;for(let r=e.parentElement;r&&r!==document.body;r=r.parentElement){const o=getComputedStyle(r).overflowY;if(o==="auto"||o==="scroll"||o==="hidden"||o==="clip"){const n=r.getBoundingClientRect();return{top:Math.max(0,n.top),bottom:Math.min(t,n.bottom)}}}return{top:0,bottom:t}}function ha(e){const t=V1(e.fonts),r=e.placeholder??oe("fontSelect.k51"),o=`font-select-list-${e.id}`,n=R=>{const _=R?.trim();return _?Dc(t,_)?.label??_:""},i=R=>{const _=qo(R);return t.find(S=>S.label&&qo(S.label)===_)?.family??R},a=()=>{const R=e.value?.trim();return R?Dc(t,R)?"":R:""},s=R=>{const _=(e.value??"").trim(),I=(F,H,le,M)=>({kind:F,key:H,label:le,value:M,selected:(M??"")===_}),S=R.trim();if(!S){const F=[I("clear","__clear__",r)],H=a();H&&F.push(I("unknown","__unknown__",oe("fontSelect.k52",{v0:H}),H));for(const le of t)F.push(I("font",le.family,Ac(le),le.family));return F}const B=K1(t,S).map(F=>I("font",F.family,Ac(F),F.family));if(!B.length){const F=i(S);B.push(I("free","__free__",oe("fontSelect.k53",{v0:F}),F))}return B},p=document.createElement("div");p.className="font-select";const l=document.createElement("input");l.className="pd-input font-select-input",l.type="text",l.setAttribute("role","combobox"),l.setAttribute("aria-autocomplete","list"),l.setAttribute("aria-controls",o),l.autocomplete="off",l.placeholder=r,l.disabled=!!e.disabled,l.value=n(e.value);const d=document.createElement("ul");d.id=o,d.className="font-select-list",d.setAttribute("role","listbox");const u=e.state.fontOpen?.id===e.id?e.state.fontOpen:null,c={open:!!u&&!e.disabled,query:u?.query??"",highlighted:u?.highlighted??-1};c.open&&(l.value=c.query);const f=()=>{e.state.fontOpen=c.open?{id:e.id,query:c.query,highlighted:c.highlighted}:null};f();const h=()=>{const R=(e.value??"").trim();return s(c.query).findIndex(_=>(_.value??"")===R)},b=()=>{const R=l.getBoundingClientRect(),_=cP(l);d.classList.toggle("is-up",C0({triggerTop:R.top,triggerBottom:R.bottom,overlayHeight:d.getBoundingClientRect().height,boundaryTop:_.top,boundaryBottom:_.bottom})==="up")},k=()=>{if(!c.open){d.isConnected&&d.remove(),l.setAttribute("aria-expanded","false"),l.setAttribute("aria-activedescendant","");return}d.isConnected||p.appendChild(d);const R=s(c.query);d.replaceChildren(...R.map((_,I)=>{const S=document.createElement("li");return S.id=`${o}-${I}`,S.className="font-select-option"+(I===c.highlighted?" is-active":"")+(_.kind==="unknown"||_.kind==="free"?" is-muted":""),S.setAttribute("role","option"),S.setAttribute("aria-selected",String(_.selected)),S.textContent=_.label,S.addEventListener("mousedown",B=>{B.preventDefault(),O(_)}),S})),l.setAttribute("aria-expanded","true"),l.setAttribute("aria-activedescendant",c.highlighted>=0?`${o}-${c.highlighted}`:""),b()},v=()=>{c.open||e.disabled||(c.open=!0,c.query="",c.highlighted=h(),f(),k())},w=()=>{c.open||v()},P=()=>{c.open=!0,c.query=l.value,c.highlighted=s(c.query).length?0:-1,f(),k()},E=R=>{if(!c.open){v();return}const _=s(c.query).length-1;if(_<0)return;c.highlighted=Math.min(Math.max(c.highlighted+R,0),_),f(),k(),d.children[c.highlighted]?.scrollIntoView?.({block:"nearest"})},D=()=>{if(!c.open)return;const R=s(c.query)[c.highlighted];if(R){O(R);return}const _=c.query.trim();if(_){const I=i(_);O({value:I})}},O=R=>{c.open=!1,c.query="",c.highlighted=-1,f(),l.value=n(R.value),k(),e.onChange(R.value)},A=()=>{c.open&&(c.open=!1,c.query="",c.highlighted=-1,f(),l.value=n(e.value),k())};return l.addEventListener("focus",v),l.addEventListener("click",w),l.addEventListener("input",P),l.addEventListener("blur",A),l.addEventListener("keydown",R=>{const _=R;_.key==="ArrowDown"?(_.preventDefault(),E(1)):_.key==="ArrowUp"?(_.preventDefault(),E(-1)):_.key==="Enter"?(_.preventDefault(),D()):_.key==="Escape"&&(_.preventDefault(),A())}),p.append(l),k(),c.open&&(l.focus(),l.setSelectionRange(c.query.length,c.query.length)),p}const uP=[{key:"solid",labelKey:"formatBar.k54",preview:"1.5px solid currentColor"},{key:"dashed",labelKey:"formatBar.k55",preview:"1.5px dashed currentColor"},{key:"dotted",labelKey:"formatBar.k56",preview:"1.5px dotted currentColor"},{key:"double",labelKey:"formatBar.k57",preview:"3px double currentColor"}],fP={left:"TextAlignStart",center:"TextAlignCenter",right:"TextAlignEnd",justify:"TextAlignJustify"};function fr(e,t,r,o,n={}){return g("button",{type:"button",class:`ft-cell-btn${n.on?" on":""}`,dataset:{test:e,tip:t},disabled:!!n.disabled,onClick:o,html:`<svg viewBox="0 0 18 18" width="18" height="18" aria-hidden="true">${r}</svg>`})}const uo='<rect class="g-faint" x="2.5" y="2.5" width="13" height="13" />',Wm='<rect class="g-solid" x="2.5" y="2.5" width="13" height="13" fill="none" />';function hP(e){const t=e.format;t.syncBorderDraft();const r=t.values,o=!t.fontEditable,n=o||t.context==="cells",i=t.context==="none",a=t.context==="cells",s=!t.painterActive&&(t.context==="none"||t.context==="cells"||!t.painterCapturable),p=t.painterActive?m(e,"formatBar.k58"):t.context==="cells"?m(e,"formatBar.k59"):t.context==="none"?m(e,"formatBar.k60"):t.painterCapturable?m(e,"formatBar.k62"):m(e,"formatBar.k61"),l=c=>o?m(e,"formatBar.k63",{v0:c}):c,d=[g("div",{class:"ft-border-panel",dataset:{test:"border-panel"}},[g("div",{class:"ft-border-grid"},[fr("preset-none",m(e,"formatBar.k64"),`${uo}<line class="g-solid" x1="4" y1="14" x2="14" y2="4" />`,()=>t.applyBorderPreset("none")),fr("preset-all",m(e,"formatBar.k65"),`${Wm}<line class="g-solid" x1="9" y1="3" x2="9" y2="15" /><line class="g-solid" x1="3" y1="9" x2="15" y2="9" />`,()=>t.applyBorderPreset("all")),fr("preset-outer",m(e,"formatBar.k66"),Wm,()=>t.applyBorderPreset("outer")),fr("preset-inner",a?m(e,"formatBar.k67"):m(e,"formatBar.k68"),`${uo}<line class="g-solid" x1="9" y1="3" x2="9" y2="15" /><line class="g-solid" x1="3" y1="9" x2="15" y2="9" />`,()=>t.applyBorderPreset("inner"),{disabled:!a}),fr("edge-top",m(e,"formatBar.k69"),`${uo}<line class="g-solid" x1="2" y1="3" x2="16" y2="3" />`,()=>t.applyEdge("top"),{on:t.edgeOn("top")}),fr("edge-bottom",m(e,"formatBar.k70"),`${uo}<line class="g-solid" x1="2" y1="15" x2="16" y2="15" />`,()=>t.applyEdge("bottom"),{on:t.edgeOn("bottom")}),fr("edge-left",m(e,"formatBar.k71"),`${uo}<line class="g-solid" x1="3" y1="2" x2="3" y2="16" />`,()=>t.applyEdge("left"),{on:t.edgeOn("left")}),fr("edge-right",m(e,"formatBar.k72"),`${uo}<line class="g-solid" x1="15" y1="2" x2="15" y2="16" />`,()=>t.applyEdge("right"),{on:t.edgeOn("right")})]),g("div",{class:"ft-style-row"},uP.map(c=>g("button",{type:"button",class:`ft-style-btn${t.borderStyle===c.key?" on":""}`,dataset:{test:`style-${c.key}`,tip:t.borderStyle===c.key?m(e,"formatBar.k73",{v0:m(e,c.labelKey)}):m(e,c.labelKey)},onClick:()=>{t.toggleBorderStyle(c.key),e.repaint()}},[g("span",{class:"ft-style-line",style:{borderTop:c.preview}})]))),g("div",{class:"ft-border-style-row"},[g("span",{class:"ft-edge-label",text:m(e,"formatBar.k74")}),g("div",{class:"ft-line-width"},[ae({value:t.borderWidth,min:.25,max:5,step:.25,placeholder:t.borderMixed.width?m(e,"formatBar.k75"):void 0,onCommit:c=>{t.setBorderWidth(c),e.repaint()}})])]),g("div",{class:"ft-border-style-row"},[g("span",{class:"ft-edge-label",text:m(e,"formatBar.k76")}),dt(t.borderColor,c=>{t.setBorderColor(c),e.repaint()},m(e,"formatBar.k77"))]),t.borderMixedAny?g("p",{class:"pd-hint",text:m(e,"formatBar.k78")}):""].filter(Boolean))],u=[g("div",{class:"ft-align-panel",dataset:{test:"align-panel"}},[g("div",{class:"ft-align-row"},[["left",m(e,"formatBar.k79"),"TextAlignStart"],["center",m(e,"formatBar.k80"),"TextAlignCenter"],["right",m(e,"formatBar.k81"),"TextAlignEnd"],["justify",m(e,"formatBar.k82"),"TextAlignJustify"]].map(([c,f,h])=>g("button",{type:"button",class:`ft-cell-btn${r.textAlign===c?" on":""}`,dataset:{test:`align-${c}`,tip:f},disabled:o,onClick:()=>t.applyStyle({textAlign:c}),html:je(h)}))),g("div",{class:"ft-align-row"},[["top",m(e,"formatBar.k83"),"ArrowUpToLine"],["middle",m(e,"formatBar.k84"),"ChevronsUpDown"],["bottom",m(e,"formatBar.k85"),"ArrowDownToLine"]].map(([c,f,h])=>g("button",{type:"button",class:`ft-cell-btn${r.verticalAlign===c?" on":""}`,dataset:{test:`valign-${c}`,tip:f},disabled:o,onClick:()=>t.applyStyle({verticalAlign:c}),html:je(h)})))])];return g("div",{class:"format-toolbar"},[g("div",{class:"tb-ou ft-group",dataset:{unit:"painter"}},[g("button",{type:"button",class:`ft-btn${t.painterActive?" on":""}`,dataset:{test:"format-painter",tip:p},disabled:s,onClick:()=>{t.painterActive?t.cancelPainter():t.pickPainterSource(!1),e.repaint()},onDblclick:()=>{t.pickPainterSource(!0),e.repaint()},html:je("Paintbrush")})]),g("div",{class:"tb-ou ft-group",dataset:{unit:"font"}},[g("div",{class:"ft-font"},[ha({id:"ft-font",state:e.state,fonts:e.host.fonts,value:typeof r.fontFamily=="string"?r.fontFamily:void 0,placeholder:r.fontFamily===Rr?m(e,"formatBar.k86"):m(e,"formatBar.k87"),disabled:o,onChange:c=>t.applyStyle({fontFamily:c})})]),g("div",{class:"ft-size",dataset:{test:"font-size"}},[ae({value:typeof r.fontSize=="number"?r.fontSize:void 0,min:5,max:72,disabled:o,placeholder:r.fontSize===Rr?m(e,"formatBar.k88"):m(e,"formatBar.k89"),onCommit:c=>t.applyStyle({fontSize:c})})])]),g("div",{class:"tb-ou ft-group",dataset:{unit:"style"}},[...[["bold","Bold",m(e,"formatBar.k90"),()=>t.toggleBold()],["underline","Underline",m(e,"formatBar.k91"),()=>t.toggleUnderline()],["strike","Strikethrough",m(e,"formatBar.k92"),()=>t.toggleStrike()]].map(([c,f,h,b])=>g("button",{type:"button",class:`ft-btn${r[c]===!0?" on":""}`,dataset:{test:c,tip:l(h)},disabled:c==="bold"?o:n,onClick:b,html:je(f)}))]),g("div",{class:"tb-ou ft-group",dataset:{unit:"color"}},[g("span",{class:`ft-color-btn${o?" dim":""}`,title:m(e,"formatBar.k93",{v0:o?m(e,"formatBar.fontDisabledHint"):""})},[dt(typeof r.color=="string"?r.color:void 0,c=>t.applyStyle({color:c})),g("span",{class:"ft-glyph",text:"A"})]),g("span",{class:`ft-color-btn${i?" dim":""}`,title:m(e,"formatBar.k94")},[dt(typeof r.backgroundColor=="string"?r.backgroundColor:void 0,c=>t.applyStyle({backgroundColor:c})),g("span",{class:"ft-glyph",html:je("PaintBucket",14)})])]),g("div",{class:"tb-ou ft-group",dataset:{unit:"align"}},[na(e,"align",{icon:fP[String(r.textAlign)]??"TextAlignStart",text:m(e,"formatBar.k95"),textClass:"ft-btn-text",tip:o?m(e,"formatBar.k96"):m(e,"formatBar.k97"),disabled:o,testId:"align-dd"},u)]),g("div",{class:"tb-ou ft-group",dataset:{unit:"border"}},[na(e,"border",{icon:"Grid3x3",text:m(e,"formatBar.k98"),textClass:"ft-btn-text",tip:i?m(e,"formatBar.k99"):m(e,"formatBar.k100"),disabled:i,testId:"border"},d)])])}const mP="1.6.1";ia.filter(e=>e.material).map(e=>({type:e.type,label:e.label,icon:e.icon}));function ma(e,t){return je(e??"Shapes",t)||je("Shapes",t)}function gP(e){const t=e.state;if(t.leftCollapsed)return g("div",{class:"left-panel collapsed"},[g("div",{class:"left-collapsed"},[Vm("ChevronsRight",m(e,"panels.k137"),()=>{t.leftCollapsed=!1,e.repaint()}),...[["elements",m(e,"panels.k138"),"Table2"],["fields",m(e,"panels.k139"),"ListTree"],["layers",m(e,"panels.k140"),"Layers"]].map(([o,n,i])=>g("button",{type:"button",class:`lc-btn${t.leftTab===o?" on":""}`,title:n,html:ma(i,14),onClick:()=>{t.leftTab=o,t.leftCollapsed=!1,e.repaint()}}))])]);const r=(o,n,i="")=>g("div",{class:`pd-tab-pane${i?` ${i}`:""}`,role:"tabpanel",dataset:{pane:`left:${o}`},style:t.leftTab===o?"":{display:"none"}},n);return g("div",{class:"left-panel"},[g("div",{class:"left-head"},[g("span",{class:"left-title",text:m(e,"panels.k141")}),Vm("ChevronsLeft",m(e,"panels.k142"),()=>{t.leftCollapsed=!0,e.repaint()})]),g("div",{class:"pd-tabs left-tabs"},[g("div",{class:"pd-tab-bar",role:"tablist"},[...[["elements",m(e,"panels.k143")],["fields",m(e,"panels.k144")],["layers",m(e,"panels.k145")]].map(([o,n])=>g("button",{type:"button",class:`pd-tab${t.leftTab===o?" active":""}`,text:n,onClick:()=>{t.leftTab=o,e.repaint()}}))]),r("elements",yP(e),"material-grid"),r("fields",[vP(e)]),r("layers",[xP(e)])])])}function Vm(e,t,r){return g("button",{type:"button",class:"collapse-btn",title:t,html:ma(e,14),onClick:r})}const Gm={text:"elementDefinitions.k553",barcode:"elementDefinitions.k554",qrcode:"elementDefinitions.k555",image:"elementDefinitions.k556",table:"elementDefinitions.k557",longText:"elementDefinitions.k558",flowList:"elementDefinitions.k559",hline:"elementDefinitions.k560",vline:"elementDefinitions.k561",rect:"elementDefinitions.k562",oval:"elementDefinitions.k563",pageNumber:"elementDefinitions.k564",barChart:"echarts.series.typeNames.bar",barHChart:"echarts.series.typeNames.barH",lineChart:"echarts.series.typeNames.line",areaChart:"echarts.series.typeNames.area",pieChart:"echarts.series.typeNames.pie",doughnutChart:"echarts.series.typeNames.doughnut",scatterChart:"echarts.series.typeNames.scatter",radarChart:"echarts.series.typeNames.radar",funnelChart:"echarts.series.typeNames.funnel",gaugeChart:"echarts.series.typeNames.gauge"},bP={barChart:"elementGroup.chart"};function kP(e,t,r,o){return g("div",{class:`material-card${u1(o??t)?" material-card--wide":""}`,draggable:!0,dataset:{test:`material-${e}`},onDragstart:n=>{const i=n.dataTransfer;i?.setData("elementType",e),i&&(i.effectAllowed="all")}},[g("span",{class:"material-icon","data-icon":r,html:ma(r,14)}),g("span",{class:"material-label",text:o??t})])}function yP(e){const t=[];let r;for(const o of Gh()){const n=o.group;if(n&&n!==r){const p=bP[o.type];t.push(g("div",{class:"material-group-title",text:p?m(e,p):n}))}n&&(r=n);const i=Gm[o.type],a=i?m(e,i):void 0,s=a&&a!==i?a:void 0;t.push(kP(o.type,o.label,o.icon,s))}return[g("div",{class:"panel-title",text:m(e,"panels.k146")}),...t]}function vP(e){const t=e.state,r=t.fieldDisplay??"both",o=Su(e.store.fields),n=(t.fieldSearch??"").trim().toLowerCase(),i=n?o.map(a=>({...a,fields:a.fields.filter(s=>`${s.fieldLabel}${s.fieldKey}`.toLowerCase().includes(n))})).filter(a=>a.fields.length):o;return g("div",{class:"field-tree-panel"},[g("div",{class:"panel-title",text:m(e,"panels.k147")}),g("input",{class:"pd-input search-input",type:"search",placeholder:m(e,"panels.k148"),"aria-label":m(e,"panels.k149"),value:t.fieldSearch??"",onInput:a=>{t.fieldSearch=a.target.value},onChange:()=>e.repaint()}),g("div",{class:"tree-container"},i.flatMap(a=>{const s=t.collapsedGroups.has(a.key)&&!n,p=a.key?g("div",{class:`field-group-header${a.isList?" is-list":""}`,onClick:()=>{s?t.collapsedGroups.delete(a.key):t.collapsedGroups.add(a.key),e.repaint()}},[g("span",{class:"expand-icon",text:s?"▶":"▼"}),g("span",{class:"node-icon",text:a.isList?"📋":"📁"}),g("span",{class:"group-label",text:a.label,"data-tip":a.label})]):"",l=s?[]:a.fields.map(d=>g("div",{class:"field-row",draggable:!0,"data-tip":m(e,"panels.k150",{v0:d.fieldLabel,v1:d.fieldKey}),style:{paddingLeft:`${a.key?22:8}px`},onDragstart:u=>{const c=u.dataTransfer;c?.setData("fieldKey",d.fieldKey),c&&(c.effectAllowed="all")},onClick:()=>{Tu(d.fieldLabel||d.fieldKey).then(u=>{u&&(t.copiedFieldKey=d.fieldKey,e.repaint(),setTimeout(()=>{t.copiedFieldKey===d.fieldKey&&(t.copiedFieldKey="",e.repaint())},1200))})}},[g("span",{class:"node-icon",text:"📄"}),g("span",{class:"node-meta"},[r!=="key"?g("span",{class:"node-label",text:d.fieldLabel||d.fieldKey}):"",r!=="label"?g("span",{class:`node-key${r==="key"?" is-primary":""}`,text:r==="key"?d.fieldKey:`(${d.fieldKey})`}):""].filter(Boolean)),t.copiedFieldKey===d.fieldKey?g("span",{class:"copy-hint",text:m(e,"panels.k151")}):""].filter(Boolean)));return[p,g("div",{},l.filter(Boolean))].filter(Boolean)})),i.length===0?g("p",{class:"pd-empty",text:m(e,"panels.k152")}):""].filter(Boolean))}function wP(e,t){if(e.options.title)return e.options.title;const r=Gm[e.printElementType.type];return r?m(t,r):e.printElementType.title||e.printElementType.type}function xP(e){const t=e.store,r=[...t.elements].sort((s,p)=>(p.options.zIndex??0)-(s.options.zIndex??0)),o=t.elements.filter(s=>t.selectedIds.has(s.id)),n=o.length>=2,i=o.some(s=>!!s.options.groupId),a=s=>s.zone==="header"?m(e,"panels.k153"):s.zone==="footer"?m(e,"panels.k154"):"";return g("div",{class:"layer-panel"},[g("div",{class:"panel-title",text:m(e,"panels.k155")}),...r.map(s=>{const p=Xh(s.printElementType.type);return g("div",{class:`layer-item${t.selectedIds.has(s.id)?" active":""}`,onClick:l=>t.selectElement(s.id,l.ctrlKey||l.metaKey)},[g("span",{class:"layer-icon","data-icon":p??"Shapes",html:ma(p,12)}),g("span",{class:"layer-name",text:wP(s,e)}),a(s)?g("span",{class:"layer-zone",text:a(s)}):"",g("span",{class:"layer-zindex",text:`z:${s.options.zIndex??0}`})].filter(Boolean))}),r.length?g("div",{class:"layer-actions"},[...[["top",m(e,"panels.k156"),"ArrowUpToLine"],["up",m(e,"panels.k157"),"ArrowUp"],["down",m(e,"panels.k158"),"ArrowDown"],["bottom",m(e,"panels.k159"),"ArrowDownToLine"]].map(([s,p,l])=>g("button",{type:"button",class:"pd-button small",title:p,html:je(l,14),onClick:()=>e.fire("move-layer",s)}))]):"",n||i?g("div",{class:"layer-actions"},[n?g("button",{type:"button",class:"pd-button small",title:m(e,"panels.k160"),html:je("Group",14),onClick:()=>e.fire("group")}):"",i?g("button",{type:"button",class:"pd-button small",title:m(e,"panels.k161"),html:je("Ungroup",14),onClick:()=>e.fire("ungroup")}):""].filter(Boolean)):""].filter(Boolean))}function PP(e){const t=e.store,r=e.state,o=t.pages.length>1,n=t.pages[t.activePageIndex]?.name||m(e,"panels.k162",{v0:t.activePageIndex+1}),i=t.tilingEnabled;return g("div",{class:"page-tabs"},[g("div",{class:"page-tabs-list"},t.pages.map((s,p)=>r.renamingPage===p?g("input",{class:"page-tab-rename",dataset:{test:"page-rename-input"},value:r.renameText??"",onInput:l=>{r.renameText=l.target.value},onBlur:()=>a(),onKeydown:l=>{const d=l;if(d.key==="Enter"){a();return}d.key==="Escape"&&(r.renamingPage=null,e.repaint())}}):g("button",{type:"button",class:`page-tab${p===t.activePageIndex?" active":""}`,dataset:{tip:s.name?m(e,"panels.k163",{v0:s.name}):m(e,"panels.k164")},text:s.name||m(e,"panels.k165",{v0:p+1}),onClick:()=>t.switchPage(p),onDblclick:()=>{r.renamingPage=p,r.renameText=s.name??"",e.repaint()}}))),g("div",{class:"page-tabs-actions"},[g("button",{type:"button",dataset:{test:"add-page",tip:i?m(e,"panels.k166"):m(e,"panels.k167")},disabled:i,text:"+",onClick:()=>e.fire("add-page")}),g("button",{type:"button",dataset:{test:"duplicate-page",tip:i?m(e,"panels.k168"):m(e,"panels.k169",{v0:n})},disabled:i,text:"⧉",onClick:()=>e.fire("duplicate-page")}),g("button",{type:"button",dataset:{test:"delete-page",tip:o?m(e,"panels.k170",{v0:n}):m(e,"panels.k171")},disabled:!o,text:"✕",onClick:()=>e.fire("delete-page")}),g("button",{type:"button",dataset:{test:"move-left",tip:m(e,"panels.k172",{v0:n})},disabled:t.activePageIndex<=0,text:"←",onClick:()=>e.fire("move-page",-1)}),g("button",{type:"button",dataset:{test:"move-right",tip:m(e,"panels.k173",{v0:n})},disabled:t.activePageIndex>=t.pages.length-1,text:"→",onClick:()=>e.fire("move-page",1)})])]);function a(){const s=(r.renameText??"").trim();r.renamingPage!==null&&s&&t.renamePage(r.renamingPage,s),r.renamingPage=null,e.repaint()}}function EP(e){const t=e.store,r=t.templateData,o=ir(r),n=r.orientation==="landscape"?m(e,"panels.k174"):m(e,"panels.k175"),i=Lt[r.paperSize],a=i?m(e,i.labelKey):r.paperSize,s=r.outputRotation,p=`${a} ${n} ${Math.round(o.width)}×${Math.round(o.height)}mm${s?m(e,"panels.paperRotated",{rot:s}):""}`;return g("div",{class:"status-bar"},[g("span",{class:"status-item coord",dataset:{coord:""},style:{display:"none"}}),g("span",{class:"status-item",text:m(e,"panels.k176",{v0:t.scale})}),g("span",{class:"status-item",text:m(e,"panels.statusElements",{count:t.elements.length,selected:t.selectedIds.size?m(e,"panels.statusSelected",{n:t.selectedIds.size}):""})}),g("span",{class:"status-item status-version",text:`v${mP}`}),g("span",{class:"status-item status-paper",text:p})])}const SP=Object.keys(Lt).filter(e=>e!=="CUSTOM"&&!Lt[e]?.continuous);function TP(e){const t=document.createElement("label");t.className="pd-button small upload-label";const r=document.createTextNode(m(e,"pageExtras.k103")),o=document.createElement("input");o.className="visually-hidden",o.type="file",o.accept="image/*",t.append(r,o);const n=i=>{t.className=`pd-button small upload-label${i?" disabled":""}`,o.disabled=i};return o.addEventListener("change",async()=>{const i=o.files?.[0];if(!i)return;if(!i.type.startsWith("image/")){alert(m(e,"pageExtras.k104")),o.value="";return}const a=e.host.uploadDesignBackground;if(!a){alert(m(e,"pageExtras.k105")),o.value="";return}n(!0),r.textContent=m(e,"pageExtras.k106");try{const s=await a(i);s?e.store.updateTemplateData({designBackground:{src:s,rotation:0}}):alert(m(e,"pageExtras.k107"))}catch(s){alert(s instanceof Error?s.message:m(e,"pageExtras.k108"))}finally{r.textContent=m(e,"pageExtras.k109"),n(!e.host.uploadDesignBackground),o.value=""}}),e.host.uploadDesignBackground||n(!0),t}function MP(e){const r=e.store.templateData.designBackground,o=r?.rotation??0;return g("div",{class:"design-background-config"},[$t(m(e,"pageExtras.k110")),g("p",{class:"design-background-tip",text:m(e,"pageExtras.k111")}),r?.src?[g("div",{class:"design-background-path",title:r.src,text:r.src}),g("div",{class:"design-background-actions"},[g("button",{type:"button",class:"pd-button small rotate-btn",text:m(e,"pageExtras.k112",{v0:(o+90)%360}),onClick:()=>e.store.updateTemplateData({designBackground:{...r,rotation:(o+90)%360}})}),g("button",{type:"button",class:"pd-button small remove-btn",text:m(e,"pageExtras.k113"),onClick:()=>e.store.updateTemplateData({designBackground:void 0})})])]:TP(e)].flat())}function CP(e){const t=e.store,r=t.templateData,o=r.tiling,n={...Bt,...o??{},enabled:o?.enabled??!1,sheetMargin:{...Bt.sheetMargin,...o?.sheetMargin??{}}},i=Gn(r.paperSize),a=h=>t.updateTemplateData({tiling:{...n,...h}}),s=h=>Lr({target:n,base:Bt,propKey:h,write:()=>a({[h]:Bt[h]})}),p=h=>Lr({target:n.sheetMargin,base:Bt.sheetMargin,propKey:h,write:()=>l(h,Bt.sheetMargin[h])}),l=(h,b)=>a({sheetMargin:{...n.sheetMargin,[h]:b??0}}),d={...r,tiling:n},u=Fs(d),c=Math.max(hu(d),1);let f="";if(!u.length)try{const h=fu(d),b=Ko(d),k=n.sheetPaperSize==="CUSTOM"?m(e,"pageExtras.k114"):n.sheetPaperSize??"A4",v=n.sheetPaperSize==="CUSTOM"?"":n.sheetOrientation==="landscape"?m(e,"pageExtras.k115"):m(e,"pageExtras.k116");f=m(e,"pageExtras.k117",{v0:k,v1:v,v2:b.width,v3:b.height,v4:h.columns,v5:h.rows,v6:h.perSheet,v7:h.tile.width,v8:h.tile.height})}catch{f=""}return g("div",{class:"tiling-config",dataset:{test:"tiling-config"}},[$t(m(e,"pageExtras.k118")),g("p",{class:"pd-hint",text:m(e,"pageExtras.k119")}),g("div",{class:"pd-field"},[g("label",{class:"tiling-switch"},[g("input",{type:"checkbox",checked:n.enabled===!0,disabled:i,onChange:h=>{if(!h.target.checked){a({enabled:!1});return}a({...Bt,columns:Math.min(Bt.columns,Math.max(c,1))})}}),g("span",{text:m(e,"pageExtras.k120")})]),i?g("p",{class:"pd-hint tiling-error",text:m(e,"pageExtras.k121")}):""].filter(Boolean)),n.enabled&&!i?[he(m(e,"pageExtras.k122"),g("select",{class:"pd-select",style:{width:"100%"},onChange:h=>{const b=h.target.value;if(b!=="CUSTOM"){a({sheetPaperSize:b});return}const k=Ko(d);a({sheetPaperSize:"CUSTOM",sheetCustomWidth:n.sheetCustomWidth??k.width,sheetCustomHeight:n.sheetCustomHeight??k.height})}},[...SP.map(h=>g("option",{value:h,text:m(e,Lt[h]?.labelKey??h),selected:(n.sheetPaperSize??"A4")===h})),g("option",{value:"CUSTOM",text:m(e,"pageExtras.k123"),selected:n.sheetPaperSize==="CUSTOM"})]),void 0,s("sheetPaperSize")),n.sheetPaperSize==="CUSTOM"?he(m(e,"pageExtras.k124"),g("div",{class:"custom-size-grid"},[ae({value:Number(n.sheetCustomWidth??0),min:25,max:2e3,onCommit:h=>a({sheetCustomWidth:h})}),g("span",{class:"custom-size-x",text:"×"}),ae({value:Number(n.sheetCustomHeight??0),min:25,max:2e3,onCommit:h=>a({sheetCustomHeight:h})})])):he(m(e,"pageExtras.k125"),pr("tiling-ori",[{value:"portrait",label:m(e,"pageExtras.k126")},{value:"landscape",label:m(e,"pageExtras.k127")}],n.sheetOrientation==="landscape"?"landscape":"portrait",h=>a({sheetOrientation:h})),void 0,s("sheetOrientation")),$t(m(e,"pageExtras.k128")),g("div",{class:"margin-grid"},[he(m(e,"pageExtras.k129"),ae({value:n.sheetMargin.top??0,min:0,max:100,onCommit:h=>l("top",h)}),void 0,p("top")),he(m(e,"pageExtras.k130"),ae({value:n.sheetMargin.bottom??0,min:0,max:100,onCommit:h=>l("bottom",h)}),void 0,p("bottom")),he(m(e,"pageExtras.k131"),ae({value:n.sheetMargin.left??0,min:0,max:100,onCommit:h=>l("left",h)}),void 0,p("left")),he(m(e,"pageExtras.k132"),ae({value:n.sheetMargin.right??0,min:0,max:100,onCommit:h=>l("right",h)}),void 0,p("right"))]),$t(m(e,"pageExtras.k133")),he(m(e,"pageExtras.k134"),ae({value:n.gapX??0,min:0,max:50,onCommit:h=>a({gapX:h??0})}),void 0,s("gapX")),he(m(e,"pageExtras.k135"),ae({value:n.gapY??0,min:0,max:50,onCommit:h=>a({gapY:h??0})}),void 0,s("gapY")),he(m(e,"pageExtras.k136"),ae({value:n.columns??1,min:1,max:c,onCommit:h=>a({columns:h||1})})),...u.map(h=>g("p",{class:"pd-hint tiling-error",text:h.message})),!u.length&&f?g("p",{class:"pd-hint tiling-summary",text:f}):""]:""].flat().filter(Boolean))}const _P=new Set(cs.map(e=>e.group)),DP={"table-settings":"content"},Km=new Map;function ep(e){const t=e??"";let r=Km.get(t);if(!r){const{groups:o,itemKeys:n}=l1(t);r={groups:o,keys:n,searching:!!t.trim()},Km.set(t,r)}return r}function tp(e){const t=DP[e]??e;return _P.has(t)?t:""}function AP(e,t){const r=ep(e.state.propSearch);if(!r.searching)return!0;const o=tp(t);return!o||r.groups.includes(o)}function OP(e,t){const r=ep(e.state.propSearch);return!r.searching||r.keys.has(t)}function Ym(e,t){const r=e.props.style??{};return e.props.style={...r,display:t?"":"none"},e}function G(e,t,r){const o=r.props.dataset??{};return r.props.dataset={...o,propKey:t},Ym(r,OP(e,t))}function RP(e,t,r){const o=tp(t);if(!o)return r;const n=r.props.dataset??{};return r.props.dataset={...n,propGroup:o},Ym(r,AP(e,t))}function Xm(e,t){const r=ep(t);for(const o of Array.from(e.querySelectorAll("[data-prop-group]"))){const n=tp(o.dataset.propGroup??"");o.style.display=!r.searching||!n||r.groups.includes(n)?"":"none"}for(const o of Array.from(e.querySelectorAll("[data-prop-key]")))o.style.display=!r.searching||r.keys.has(o.dataset.propKey??"")?"":"none"}function IP(e){return g("div",{class:"property-search"},[g("input",{class:"pd-input",type:"search",placeholder:m(e,"propertySearch.k328"),"aria-label":m(e,"propertySearch.k329"),value:e.state.propSearch??"",onInput:t=>{const r=t.target,o=r.value;e.state.propSearch=o,Xm(r.getRootNode(),o)}})])}const LP={Document:"≡",Brush:"◧",Setting:"⚙"};function NP(e,t){try{const r=window.localStorage.getItem(`property-group-${e}`);return r===null?t:r==="true"}catch{return t}}function BP(e,t){try{window.localStorage.setItem(`property-group-${e}`,String(t))}catch{}}function it(e,t,r,o,n,i=!0,a=[]){const s=NP(t,i);return RP(e,t,g("div",{class:`property-group${s?" is-expanded":""}`},[g("div",{class:"group-header",onClick:()=>{BP(t,!s),e.repaint()}},[g("span",{class:"group-icon",text:LP[o]||"•"}),g("span",{class:"group-title",text:r}),...a,g("span",{class:"expand-icon",text:s?"▾":"▸"})]),g("div",{class:"group-content",style:s?"":{display:"none"}},n.filter(Boolean))]))}function ga(e){return g("form",{class:"pd-form",onSubmit:t=>t.preventDefault()},e.filter(Boolean))}function Zm(e){return e.split(".").flatMap(t=>{const r=t.match(/^([^\[]+)((?:\[\d+\])*)$/);if(!r)return[t];const o=r[1],n=[...r[2].matchAll(/\[(\d+)\]/g)].map(i=>Number(i[1]));return[o,...n]})}function Jm(e,t){return Zm(t).reduce((n,i)=>n==null?"":n[i],e)??""}function rp(e,t,r,o){const n=Zm(r),i=n.pop(),a=n.reduce((s,p)=>((s[p]===void 0||s[p]===null)&&(s[p]={}),s[p]),t);a[i]=o||void 0,e.recordHistory(),e.emit()}function FP(e,t){const r=e.store;if(t.printElementType.type==="table"&&r.tableSelection?.elementId===t.id){const{r1:o,c1:n}=r.tableSelection,i=(t.options.tableRows??[])[o];if(i)return Mu(i.type,o,n,t.options.fields?.[0]?.dataSource)}return Cy(t)}function $P(e,t){const r=document.createElement("label");r.className="pd-button small upload-label",rt(g("svg",{class:"pd-icon",viewBox:"0 0 24 24","aria-hidden":"true"},[g("path",{fill:"currentColor",d:"M12 3l4 4h-3v7h-2V7H8zm-7 12h14v5H5Z"})]),r);const o=document.createTextNode(m(e,"binding.k1")),n=document.createElement("input");n.className="visually-hidden",n.type="file",n.accept="image/*",r.append(o,n);const i=p=>{r.className=`pd-button small upload-label${p?" disabled":""}`,n.disabled=p};n.addEventListener("change",async()=>{const p=n.files?.[0];if(!p)return;if(!p.type.startsWith("image/")){alert(m(e,"binding.k2")),n.value="";return}const l=e.host.uploadImage;if(!l){alert(m(e,"binding.k3")),n.value="";return}i(!0),o.textContent=m(e,"binding.k4");try{const d=await l(p);d?rp(e.store,t,"options.src",d):alert(m(e,"binding.k5"))}catch(d){alert(d instanceof Error?d.message:m(e,"binding.k6"))}finally{o.textContent=m(e,"binding.k7"),i(!e.host.uploadImage),n.value=""}}),e.host.uploadImage||i(!0);const a=document.createElement("div");a.className="image-content-upload";const s=document.createElement("p");return s.className="upload-tip",s.textContent=m(e,"binding.k8"),a.append(r,s),a}function zP(e,t){const r=o=>e.fire("open-expression",{elementId:t.id,targetPath:o.targetPath,value:Jm(t,o.targetPath)});return it(e,"binding",m(e,"binding.k9"),"Document",[...FP(e,t).map(o=>he(o.labelKey?m(e,o.labelKey):o.label,g("input",{class:"pd-input",type:"text",value:Jm(t,o.targetPath),placeholder:o.placeholder||m(e,"binding.k10"),onChange:n=>rp(e.store,t,o.targetPath,n.target.value),onDblclick:()=>r(o)}))),t.printElementType.type==="image"?$P(e,t):""].filter(Boolean))}const bn=new Map;function ba(e){return`${Math.round(e*1e4)/1e4}%`}function Qm(e,t){const r=my(t.value),o=r.kind==="custom",n=r.kind==="axes"?r.x:50,i=r.kind==="axes"?r.y:50,a=wy(t.src),s=bn.get(a.src),p={widthMm:t.widthMm,heightMm:t.heightMm,naturalWidth:s?.width,naturalHeight:s?.height,fit:t.fit,scalePct:t.scale},l=gy(p),d=by(p,n,i),u=document.createElement("select");u.className="pd-select",u.style.width="100%";for(const b of Sy(l,n,i)){const k=document.createElement("option");k.value=b.value,k.textContent=b.label,u.appendChild(k)}if(o){const b=document.createElement("option");b.value="custom",b.textContent=m(e,"cropAnchor.k37"),u.appendChild(b)}u.value=o?"custom":`${n},${i}`,u.selectedIndex<0&&(u.selectedIndex=o?u.options.length-1:0),u.addEventListener("change",()=>{if(u.value==="custom")return;const[b,k]=u.value.split(",").map(Number);t.onCommit(yu(b,k))});const c=m(e,`propertyTips.${t.fieldKey}`),f=[g("div",{class:"pd-field",dataset:{field:t.fieldKey}},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t"},[t.label,Ml(c)]),t.resetAnchor??""].filter(Boolean)),u])];f.push(g("div",{class:"pd-field",dataset:{field:"ap-img-fit-scale"}},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t"},[xy(),Ml(m(e,"propertyTips.ap-img-fit-scale"))]),t.resetScale??""].filter(Boolean)),ae({value:t.scale,min:Oo,max:_d,step:5,placeholder:m(e,"cropAnchor.k38"),onCommit:b=>t.onScaleCommit(b>Oo?b:void 0)})]));for(const b of Ey(l,n,i))f.push(g("div",{class:"pd-field",dataset:{field:t.fieldKey}},[g("span",{class:"pd-label",text:b.label}),ae({value:b.value,min:0,max:100,step:1,onCommit:k=>t.onCommit(yu(b.name==="horizontal"?k:n,b.name==="vertical"?k:i))})]));const h=Py(l,o);return h&&f.push(g("p",{class:"pd-crop-note",text:h})),a.isSample&&f.push(g("p",{class:"pd-crop-note",text:vy()})),f.push(g("div",{class:"pd-crop-preview"},[g("img",{class:"pd-crop-thumb",src:a.src,alt:a.isSample?m(e,"cropAnchor.k39"):m(e,"cropAnchor.k40"),onLoad:b=>{const k=b.target;if(!(k.naturalWidth>0&&k.naturalHeight>0))return;const v=bn.get(a.src);v&&v.width===k.naturalWidth&&v.height===k.naturalHeight||(bn.set(a.src,{width:k.naturalWidth,height:k.naturalHeight}),e.repaint())},onError:()=>{bn.has(a.src)&&(bn.delete(a.src),e.repaint())}}),d?g("div",{class:"pd-crop-win",style:{left:ba(d.leftPct),top:ba(d.topPct),width:ba(d.widthPct),height:ba(d.heightPct)}}):""])),g("div",{class:t.containerClass??"pd-crop-anchor"},f)}const Fr=e=>Number(e??0),op=e=>e||void 0;function $r(e,t,r,o,n,i){return g("div",{class:"pd-field"},[g("span",{class:"pd-label",...o?{title:o}:{}},[g("span",{class:"pd-label-t",text:e}),n??""].filter(Boolean)),g("input",{class:"pd-switch",type:"checkbox",checked:t,...i?{disabled:!0}:{},onChange:a=>r(a.target.checked)})])}function eg(e,t,r,o,n=!1,i){return g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:e}),""].filter(Boolean)),g("select",{class:"pd-select",...n?{style:{width:"100%"}}:{},onChange:a=>o(a.target.value)},r.map(a=>g("option",{value:a.value,text:a.label,selected:a.value===t})))])}function kn(e,t,r,o,n={}){return g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:e}),n.reset??""].filter(Boolean)),zh(t,r,o,{className:"pd-select",...n.full?{width:"100%"}:{}})])}const fo=e=>g("p",{class:"pd-hint",text:e});function tg(e,t){return e.map(r=>({value:r.value,label:r.labelKey?m(t,r.labelKey):r.label??r.value,...r.disabled?{disabled:!0}:{}}))}const HP="tableProps.k330",UP=[{value:"header",labelKey:"tableProps.k331"},{value:"data",labelKey:"tableProps.k332"},{value:"subtotal",labelKey:"tableProps.k333"},{value:"summary",labelKey:"tableProps.k334"}],qP=[{value:"CODE128",labelKey:"tableProps.k335"},{value:"EAN13",labelKey:"tableProps.k336"},{value:"EAN8",label:"EAN8"},{value:"UPC",label:"UPC"},{value:"CODE39",label:"CODE39"},{value:"ITF14",label:"ITF14"}],jP=[{value:"L",labelKey:"tableProps.k337"},{value:"M",labelKey:"tableProps.k338"},{value:"Q",label:"Q"},{value:"H",labelKey:"tableProps.k339"}],WP=[{value:"clip",labelKey:"tableProps.k340"},{value:"shrink",labelKey:"tableProps.k341"},{value:"autoHeight",labelKey:"tableProps.k342"}],VP={value:"__multi__",labelKey:"tableProps.k343",disabled:!0};function GP(e,t){const r=e.store,o=r.tableSelection,n=t.options.tableRows??[],i=o?n[o.r1]:void 0;if(!o||!i)return it(e,"table-row",m(e,"tableProps.k344"),"Grid",[]);const a=s=>r.updateElement(t.id,s);return it(e,"table-row",m(e,"tableProps.k345"),"Grid",[ga([eg(m(e,"tableProps.k346"),i.type,tg(UP,e),s=>{const p=Ia(n,o.r1,s);if(p){window.alert(p);return}a({tableRows:n})},!0),g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"tableProps.k347")}),ae({value:i.height,min:3,max:100,step:.5,onCommit:s=>{i.height=s,a({tableRows:n})}})]),i.type==="header"?$r(m(e,"tableProps.k348"),i.repeatOnPage??!1,s=>{Mb(n,s),a({tableRows:n})},m(e,HP)):""])])}function KP(e,t){const r=e.store,o=t.options,n=d=>r.updateElement(t.id,d),i=o.tableColWidths??[],a=r.paperSize.width-r.templateData.margins.left-r.templateData.margins.right,s=r.fields.filter(d=>d.fieldType==="list").map(d=>({value:d.fieldKey,label:d.fieldLabel})),p=es("table"),l=d=>Lr({target:o,base:p,propKey:d,write:()=>n({[d]:p[d]})});return it(e,"table-settings",m(e,"tableProps.k349"),"Grid",[ga([eg(m(e,"tableProps.k350"),o.dataSource??"",s,d=>n({dataSource:d||void 0}),!0),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k351")}),l("tableDefaultFontFamily")]),ha({id:"table-default-font",state:e.state,fonts:e.host.fonts,value:o.tableDefaultFontFamily,placeholder:m(e,"tableProps.k352"),onChange:d=>n({tableDefaultFontFamily:d||void 0})})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k353")}),l("tableDefaultFontSize")]),ae({value:Fr(o.tableDefaultFontSize),min:0,max:72,placeholder:m(e,"tableProps.k354"),onCommit:d=>n({tableDefaultFontSize:op(d)})})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k355")}),l("tableDefaultColor")]),dt(o.tableDefaultColor,d=>n({tableDefaultColor:d}),m(e,"tableProps.k356"))]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k357")}),l("tableDefaultPadding")]),ae({value:Fr(o.tableDefaultPadding),min:0,max:10,step:.5,placeholder:m(e,"tableProps.k358"),onCommit:d=>n({tableDefaultPadding:op(d)})})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"tableProps.k359")}),...i.map((d,u)=>g("div",{class:"col-width-row"},[g("span",{style:{width:"60px"},text:m(e,"tableProps.k360",{v0:u+1})}),ae({value:d,min:5,max:200,onCommit:c=>{const f=i.reduce((h,b,k)=>k===u?h:h+b,0);if(f+c>a){const h=Math.max(5,Math.round((a-f)*10)/10);window.alert(m(e,"tableProps.k361",{v0:a,v1:u+1,v2:h})),i[u]=h}else i[u]=c;n({tableColWidths:i})}})]))])])])}function YP(e,t){const r=e.store,o=t.options,n=t.printElementType.type==="table",i=s=>r.updateElement(t.id,s),a=[];if(n)a.push(G(e,"pg-enabled",$r(m(e,"tableProps.k362"),o.tablePagination?.enabled??!0,s=>i({tablePagination:{enabled:s}}))));else{const s=o.pagination?.pageable??!0,p=o.pagination?.keepWithNext??!1;a.push(G(e,"pg-pageable",$r(m(e,"tableProps.k363"),s,l=>i({pagination:{pageable:l,keepWithNext:p}})))),a.push(G(e,"pg-keep-with-next",$r(m(e,"tableProps.k364"),p,l=>i({pagination:{pageable:s,keepWithNext:l}}))))}return it(e,"pagination",m(e,"tableProps.k365"),"Document",[ga(a)],!1)}const np=new WeakMap,rg=[{value:"top",labelKey:"tableProps.k366"},{value:"right",labelKey:"tableProps.k367"},{value:"bottom",labelKey:"tableProps.k368"},{value:"left",labelKey:"tableProps.k369"}];function XP(e,t){const r=e.store,o=r.tableSelection,n=t.options.tableRows??[];if(!o)return it(e,"table-cell",m(e,"tableProps.k370"),"Menu",[]);const i=Po(n,o.r1,o.c1),a=n[i.r]?.cells[i.c];if(!a)return it(e,"table-cell",m(e,"tableProps.k371"),"Menu",[]);const s=()=>On(n,o),p=La(n,o),l=p.count,d=p.mode==="multi",u=`${t.id}:${o.r1}:${o.c1}:${o.r2}:${o.c2}`,c=np.get(r),f=c?.key===u?c:{key:u,border:{},values:{},edges:{}};c?.key!==u&&np.set(r,f);const h=T=>{np.set(r,{key:u,border:T.border??f.border,values:T.values??f.values,edges:T.edges??f.edges})},b=(T,X)=>{h({border:{...f.border,[T]:X}}),e.repaint()},k=(T,X)=>{s().forEach(T),d&&X&&h({values:{...f.values,...X}}),r.updateElement(t.id,{tableRows:n})},v=(T,X)=>{k(ee=>{ee[T]=X},{[T]:X})},w=T=>d?f.values[T]:a[T],P=T=>d&&T in f.values,E=d?{width:void 0,style:void 0,color:void 0}:ad(n,o),D=!d&&s().some(T=>!!T.borders&&!!(T.borders.top||T.borders.right||T.borders.bottom||T.borders.left)),O=!d&&!D,A={width:O?0:typeof E.width=="number"?E.width:rr.width,style:O?"none":typeof E.style=="string"&&E.style!=="mixed"?E.style:rr.style,color:typeof E.color=="string"&&E.color!=="mixed"?E.color:rr.color,...f.border},R="__mixed__",_={style:!d&&E.style==="mixed",width:!d&&E.width==="mixed",color:!d&&E.color==="mixed"},I=_.style&&!("style"in f.border),S=_.width&&!("width"in f.border),B=_.color&&!("color"in f.border),F=I||S||B,H=I?R:A.style,le=S?void 0:A.width,M=B?void 0:A.color,ne=T=>{const X={style:T};T!=="none"&&le===0?X.width=rr.width:T==="none"&&!D&&(X.width=0),h({border:{...f.border,...X}}),e.repaint()},Se=()=>({...A}),Pe=d?rg.reduce((T,X)=>(T[X.value]=f.edges[X.value]?"on":"off",T),{}):Kd(s().map(T=>T.borders)),K=d?"cellType"in f.values?f.values.cellType??"text":Ab(n,o):a.cellType??"text",ue=K==="barcode",me=K==="qrcode",we=K==="image",ke=K==="text",te=ue&&!!w("printerDpi"),Me=Td(w("printerDpi"),w("barWidth"),e.t??oe),se=d?f.values.textFit:Fa(a),Je=d?"cellType"in f.values?f.values.cellType??"text":"":a.cellType||"text",ze=T=>tg(d?[VP,...T]:T,e),ve=T=>d?m(e,"tableProps.k372"):T,Ee=(T,X)=>d?f.values[T]:X,ho=d?w("barcodeType")??"__multi__":a.barcodeType||"CODE128",vn=d?P("printerDpi")?w("printerDpi")?String(w("printerDpi")):"":"__multi__":a.printerDpi?String(a.printerDpi):"",wn=d?w("qrCodeLevel")??"__multi__":a.qrCodeLevel||"M",xn=d?w("fit")??"__multi__":a.fit||"contain",mo=se??"__multi__",xe=Qp(n,o);let Dt=!0;for(let T=o.r1;T<=o.r2;T++)if(n[T]?.type!=="data"){Dt=!1;break}const C=Dt?"":m(e,"tableProps.k373");let q=!1;for(let T=o.r1;T<=o.r2&&!q;T++)for(let X=o.c1;X<=o.c2&&!q;X++){const ee=n[T]?.cells[X];ee&&!ee.merged&&((ee.rowspan??1)>1||(ee.colspan??1)>1)&&(q=!0)}const U=(T,X,ee,ie={},ce)=>g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:T}),ce??""].filter(Boolean)),ae({value:X,...ie,onCommit:Te=>v(ee,op(Te))})]),V=m(e,"tableProps.k374"),j=T=>Lr({target:a,base:{},propKey:T,tipOverride:V,force:d,write:()=>v(T,void 0)}),J=t.options.tableDefaultPadding??1,pe={width:za(t.options.tableColWidths??[],i.c,a,J),height:Co(n,i.r,a,J)};return it(e,"table-cell",m(e,"tableProps.k375"),"Menu",[ga([d?fo(m(e,"tableProps.k376",{v0:l})):"",g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"tableProps.k377")}),pr("cell-type",[{value:"text",label:m(e,"tableProps.k378")},{value:"barcode",label:m(e,"tableProps.k379")},{value:"qrcode",label:m(e,"tableProps.k380")},{value:"image",label:m(e,"tableProps.k381")}],Je,T=>{const X=T==="text"?void 0:T,ee={cellType:T};T!=="barcode"&&Object.assign(ee,{barcodeType:void 0,showBarcodeText:void 0,printerDpi:void 0,barQuietZone:void 0,barHeight:void 0}),T!=="qrcode"&&Object.assign(ee,{qrCodeLevel:void 0,qrQuietZone:void 0}),k(ie=>{ie.cellType=X,T!=="barcode"&&(ie.barcodeType=void 0,ie.showBarcodeText=void 0,ie.printerDpi=void 0,ie.barQuietZone=void 0,ie.barHeight=void 0),T!=="qrcode"&&(ie.qrCodeLevel=void 0,ie.qrQuietZone=void 0)},ee)})]),ue?kn(m(e,"tableProps.k382"),ho,ze(qP),T=>{T!=="__multi__"&&v("barcodeType",T||void 0)}):"",ue?$r(m(e,"tableProps.k383"),d?f.values.showBarcodeText===!0:a.showBarcodeText!==!1,T=>v("showBarcodeText",T),void 0,j("showBarcodeText")):"",ue?U(m(e,"tableProps.k384"),Ee("barWidth",a.barWidth??2),"barWidth",{min:2,max:8,step:.5,placeholder:ve("")},j("barWidth")):"",ue?fo((te?m(e,"tableProps.k385"):m(e,"tableProps.k386"))+(Me?`。${Me}`:"")):"",ue?Ge(m(e,"tableProps.k387"),ae({value:Ee("barQuietZone",a.barQuietZone),min:0,max:20,placeholder:ve(m(e,"tableProps.k388")),onCommit:T=>v("barQuietZone",T)}),m(e,"propertyTips.cd-bar-quiet-zone"),j("barQuietZone")):"",ue?Ge(m(e,"tableProps.k389"),ae({value:Ee("barHeight",a.barHeight),min:1,max:100,placeholder:ve(m(e,"tableProps.k390")),onCommit:T=>v("barHeight",T??void 0)}),m(e,"propertyTips.cd-bar-height"),j("barHeight")):"",ue?U(m(e,"tableProps.k391"),Ee("barFontSize",a.barFontSize??10),"barFontSize",{min:5,max:24,placeholder:ve(m(e,"tableProps.k392"))},j("barFontSize")):"",ue?kn(m(e,"tableProps.k393"),vn,ze([{value:"",label:m(e,"tableProps.k394")},{value:"203",label:m(e,"tableProps.k395")},{value:"300",label:m(e,"tableProps.k396")},{value:"600",label:m(e,"tableProps.k397")}]),T=>{if(T==="__multi__")return;const X=Number(T);v("printerDpi",X>0?X:void 0)},{reset:j("printerDpi")}):"",ue?fo(m(e,"tableProps.k398")):"",me?kn(m(e,"tableProps.k399"),wn,ze(jP),T=>{T!=="__multi__"&&v("qrCodeLevel",T||void 0)},{reset:j("qrCodeLevel")}):"",me?Ge(m(e,"tableProps.k400"),ae({value:Ee("qrQuietZone",a.qrQuietZone),min:0,max:8,placeholder:ve(m(e,"tableProps.k401")),onCommit:T=>v("qrQuietZone",T)}),m(e,"propertyTips.cd-quiet-zone"),j("qrQuietZone")):"",ue?fo(m(e,"tableProps.k402")):"",me||we?kn(m(e,"tableProps.k403"),xn,ze(Hs(e.t??oe)),T=>{T!=="__multi__"&&v("fit",T)},{reset:j("fit")}):"",we&&!d&&a.fit==="cover"?Qm(e,{fieldKey:"ap-img-object-position",label:m(e,"tableProps.k404"),src:xu(a.formatter),fit:a.fit,containerClass:"pd-cell-anchor",widthMm:pe.width,heightMm:pe.height,scale:a.fitScale,value:a.objectPosition,onCommit:T=>v("objectPosition",T),onScaleCommit:T=>v("fitScale",T),resetAnchor:j("objectPosition"),resetScale:j("fitScale")}):"",ue||me||we?U(m(e,"tableProps.k405"),Ee("maxWidth",Fr(a.maxWidth)),"maxWidth",{min:0,max:200,placeholder:ve(m(e,"tableProps.k406"))},j("maxWidth")):"",ue||me||we?U(m(e,"tableProps.k407"),Ee("maxHeight",Fr(a.maxHeight)),"maxHeight",{min:0,max:200,placeholder:ve(m(e,"tableProps.k408"))},j("maxHeight")):"",g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"tableProps.k409")}),g("input",{class:"pd-input",type:"text",value:d?w("formatter")??"":a.formatter||"",placeholder:d?m(e,"tableProps.k410"):m(e,"tableProps.k411"),onChange:T=>v("formatter",T.target.value||void 0),onDblclick:()=>e.fire("table-cell-dblclick",{elementId:t.id,r:i.r,c:i.c,cellId:a.id})})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k412")}),j("align")]),pr("cell-align",[{value:"left",label:m(e,"tableProps.k413")},{value:"center",label:m(e,"tableProps.k414")},{value:"right",label:m(e,"tableProps.k415")},{value:"justify",label:m(e,"tableProps.k416")}],d?f.values.align??"":a.align||"left",T=>v("align",T))]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k417")}),j("valign")]),pr("cell-valign",[{value:"top",label:m(e,"tableProps.k418")},{value:"middle",label:m(e,"tableProps.k419")},{value:"bottom",label:m(e,"tableProps.k420")}],d?f.values.valign??"":a.valign||"top",T=>v("valign",T))]),g("div",{class:"cell-style-grid"},[g("div",{class:"pd-field cell-font-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k421")}),j("fontFamily")]),ha({id:"cell-font",state:e.state,fonts:e.host.fonts,value:d?w("fontFamily"):a.fontFamily,placeholder:ve(m(e,"tableProps.k422")),onChange:T=>v("fontFamily",T)})]),U(m(e,"tableProps.k423"),Ee("fontSize",Fr(a.fontSize)),"fontSize",{min:0,max:72,placeholder:ve(m(e,"tableProps.k424"))},j("fontSize")),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k425")}),j("fontWeight")]),g("input",{class:"pd-switch",type:"checkbox",checked:d?f.values.fontWeight==="bold":a.fontWeight==="bold",onChange:T=>v("fontWeight",T.target.checked?"bold":void 0)})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k426")}),j("color")]),dt(d?w("color"):a.color,T=>v("color",T),m(e,"tableProps.k427"))]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k428")}),j("backgroundColor")]),dt(d?w("backgroundColor"):a.backgroundColor,T=>v("backgroundColor",T),m(e,"tableProps.k429"))])]),$t(m(e,"tableProps.k430")),g("div",{class:"border-style-row"},[zh(H,[...I?[{value:R,label:m(e,"tableProps.k431"),disabled:!0}]:[],...Yd.map(T=>({...T,label:m(e,T.labelKey)}))],T=>{T!==R&&ne(T)},{width:"90px"}),g("div",{style:{width:"112px",flexShrink:"0"}},[ae({value:le,min:.25,max:5,step:.25,placeholder:d?m(e,"tableProps.k432"):S?m(e,"tableProps.k433"):void 0,onCommit:T=>b("width",T)})]),dt(M,T=>b("color",T),m(e,"tableProps.k434"))]),g("div",{class:"pd-button-group border-presets"},[["all",m(e,"tableProps.k435")],["outer",m(e,"tableProps.k436")],["inner",m(e,"tableProps.k437")],["none",m(e,"tableProps.k438")]].map(([T,X])=>g("button",{type:"button",class:"pd-button small",text:X,onClick:()=>{nd(n,o,A.style==="none"?"none":T,Se()),r.updateElement(t.id,{tableRows:n})}}))),g("div",{class:"pd-checkbox-group"},rg.map(T=>g("label",{class:"pd-checkbox"},[g("input",{type:"checkbox",value:T.value,checked:Pe[T.value]==="on",indeterminate:Pe[T.value]==="mixed",onChange:X=>{const ie=X.target.checked&&A.style!=="none";d&&h({edges:{...f.edges,[T.value]:ie}}),k(ce=>{id(ce,T.value,ie?Se():null)})}}),g("span",{text:m(e,T.labelKey)})]))),fo(m(e,d?_b:F?Db:Cb)),U(m(e,"tableProps.k439"),Ee("padding",Fr(a.padding)),"padding",{min:0,max:10,step:.5,placeholder:ve(m(e,"tableProps.k440"))},j("padding")),$r(m(e,"tableProps.k441"),d?f.values.wordWrap===!0:a.wordWrap??!0,T=>v("wordWrap",T),void 0,j("wordWrap")),ke?kn(m(e,"tableProps.k442"),mo,ze(WP),T=>{T!=="__multi__"&&v("textFit",T)},{full:!0,reset:j("textFit")}):"",ke&&se==="shrink"?U(m(e,"tableProps.k443"),Ee("shrinkMinFontSize",Fr(a.shrinkMinFontSize)),"shrinkMinFontSize",{min:0,max:72,step:.5,placeholder:ve(m(e,"tableProps.k444"))},j("shrinkMinFontSize")):"",g("div",{class:"merge-card"},[g("div",{class:"merge-card-title",text:m(e,"tableProps.k445")}),g("div",{class:"merge-btns"},[g("button",{type:"button",class:"pd-button small",text:m(e,"tableProps.k446"),disabled:!!xe,title:xe||"",onClick:()=>{ed(n,o),r.updateElement(t.id,{tableRows:n})}}),g("button",{type:"button",class:"pd-button small",text:m(e,"tableProps.k447"),disabled:!q,onClick:()=>{td(n,o),r.updateElement(t.id,{tableRows:n})}})]),g("div",{class:"merge-card-divider"}),$r(m(e,"tableProps.k448"),d?f.values.mergeSameValue===!0:a.mergeSameValue===!0,T=>v("mergeSameValue",T),C||void 0,Dt?j("mergeSameValue"):void 0,!Dt),fo(m(e,"tableProps.k449"))])])])}const ip=ek;function ap(e){const t=e.trim();return t?/[{}]/.test(t)||/^[A-Za-z_$][\w$]*\s*\(/.test(t)?!0:/^[A-Za-z_$][\w$]*(\.[\w$]+)+$/.test(t):!1}function ZP(e){return e?e.mode==="binding"?e.binding??"":e.content??"":""}function JP(e){const t=e.store.templateData.watermark,r=ZP(t),o=t?.mode==="binding"||r!==""&&ap(r),n=(()=>{const l=t?.tileWidth??ge.tileWidth,d=t?.tileHeight??ge.tileHeight;for(const[u,c]of Object.entries(ip))if(c.width===l&&c.height===d)return u;return"custom"})(),i=l=>{const d={...t,testData:t?.testData??"",rotate:t?.rotate??ge.rotate,color:t?.color||ge.color,opacity:t?.opacity??ge.opacity,tileWidth:t?.tileWidth??ge.tileWidth,tileHeight:t?.tileHeight??ge.tileHeight};e.store.updateTemplateData({watermark:{...d,...l}})},a=()=>e.fire("open-expression",{elementId:"",targetPath:"watermark.content",value:r}),s={rotate:t?.rotate??ge.rotate,color:t?.color||ge.color,opacity:t?.opacity??ge.opacity,tileWidth:t?.tileWidth??ge.tileWidth,tileHeight:t?.tileHeight??ge.tileHeight},p=l=>Lr({target:s,base:ge,propKey:l,write:()=>i({[l]:ge[l]})});return g("div",{class:"watermark-config"},[$t(m(e,"watermark.k538")),g("form",{class:"pd-form",onSubmit:l=>l.preventDefault()},[g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"watermark.k539")}),g("input",{class:"pd-input",type:"text",value:r,placeholder:m(e,"watermark.k540"),title:m(e,"watermark.k541"),onChange:l=>{const d=l.target.value;i(ap(d)?{mode:"binding",binding:d,content:""}:{mode:"fixed",content:d,binding:""})},onDblclick:a}),g("button",{type:"button",class:"pd-button small",text:m(e,"watermark.k542"),onClick:a})]),o?he(m(e,"watermark.k543"),g("input",{class:"pd-input",type:"text",value:t?.testData??"",placeholder:m(e,"watermark.k544"),onChange:l=>i({testData:l.target.value})})):"",g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"watermark.k545")}),p("rotate")]),g("input",{type:"range",class:"pd-range",min:-90,max:90,step:5,value:String(t?.rotate??ge.rotate),onChange:l=>i({rotate:Number(l.target.value)})}),g("span",{class:"pd-hint",text:`${t?.rotate??ge.rotate}°`})]),he(m(e,"watermark.k546"),dt(t?.color||ge.color,l=>i({color:l}),m(e,"watermark.k547")),void 0,p("color")),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"watermark.k548")}),p("opacity")]),g("input",{type:"range",class:"pd-range",min:.05,max:.5,step:.05,value:String(t?.opacity??ge.opacity),onChange:l=>i({opacity:Number(l.target.value)})}),g("span",{class:"pd-hint",text:(t?.opacity??ge.opacity).toFixed(2)})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"watermark.k549")}),g("select",{class:"pd-select",style:{width:"100%"},onChange:l=>{const d=l.target.value,u=ip[d];u&&i({tileWidth:u.width,tileHeight:u.height})}},[...Object.entries(ip).map(([l,d])=>g("option",{value:l,text:`${m(e,d.labelKey)}${m(e,"constants.watermark.density.size",{w:d.width,h:d.height})}`,selected:n===l})),g("option",{value:"custom",text:m(e,"watermark.k550"),selected:n==="custom"})])]),n==="custom"?g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"watermark.k551")}),p("tileWidth")]),g("input",{type:"number",class:"pd-input",min:ge.minTileWidth,step:10,value:String(t?.tileWidth??ge.tileWidth),onChange:l=>i({tileWidth:Number(l.target.value)})})]):"",n==="custom"?g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"watermark.k552")}),p("tileHeight")]),g("input",{type:"number",class:"pd-input",min:ge.minTileHeight,step:10,value:String(t?.tileHeight??ge.tileHeight),onChange:l=>i({tileHeight:Number(l.target.value)})})]):""].filter(Boolean))])}function Fe(e,t,r,o,n={},i){return he(t,ae({value:r,...n,onCommit:o}),void 0,i)}function Xt(e,t,r,o,n,i,a){const s=document.createElement("select");s.className="pd-select",s.addEventListener("change",()=>n(s.value));for(const p of o){const l=document.createElement("option");l.value=p.value,l.textContent=p.label,s.appendChild(l)}return s.value=r,o.some(p=>p.value===r)||(s.selectedIndex=-1),i?Ge(t,s,i,a):he(t,s,void 0,a)}function zr(e,t,r,o,n){return he(t,g("input",{type:"checkbox",class:"pd-switch",checked:r,onChange:i=>o(i.target.checked)}),void 0,n)}const QP=[{value:"all",labelKey:"propertyPanel.k177"},{value:"outer",labelKey:"propertyPanel.k178"},{value:"inner",labelKey:"propertyPanel.k179"},{value:"none",labelKey:"propertyPanel.k180"}],e3=[{value:"top",labelKey:"propertyPanel.k181"},{value:"right",labelKey:"propertyPanel.k182"},{value:"bottom",labelKey:"propertyPanel.k183"},{value:"left",labelKey:"propertyPanel.k184"}];function t3(e,t){const r=e.store,o=t.options,n=t.printElementType.type,i=M=>r.updateElement(t.id,M),a=Kh(n),s=a==="text",p=a==="code",l=a==="table",d=l&&r.tableSelection?.elementId===t.id,u=d&&La(t.options.tableRows??[],r.tableSelection).mode==="multi",c=[];u||c.push(zP(e,t));const f=es(n),h=(M,ne)=>{const Se=p1(ne);return Lr({target:o,base:f,propKey:M,tipValue:Se?.value,tipUnit:Se?.unit,write:()=>i({[M]:f[M]})})};d||c.push(it(e,"position-size",m(e,"propertyPanel.k185"),"Location",[g("form",{class:"pd-form",onSubmit:M=>M.preventDefault()},[g("div",{class:"position-grid"},[G(e,"ps-left",Fe(e,"X",o.left,M=>i({left:M}),{min:0})),G(e,"ps-top",Fe(e,"Y",o.top,M=>i({top:M}),{min:0})),G(e,"ps-width",Fe(e,"W",o.width,M=>i({width:M}),{min:4})),G(e,"ps-height",Fe(e,"H",o.height,M=>i({height:M}),{min:4}))]),g("h3",{class:"pd-divider",text:m(e,"propertyPanel.k186")}),g("div",{class:"margin-grid"},[G(e,"ps-margin-top",Fe(e,m(e,"propertyPanel.k187"),o.marginTop,M=>i({marginTop:M===0?void 0:M}),{},h("marginTop","ps-margin-top"))),G(e,"ps-margin-right",Fe(e,m(e,"propertyPanel.k188"),o.marginRight,M=>i({marginRight:M===0?void 0:M}),{},h("marginRight","ps-margin-right"))),G(e,"ps-margin-bottom",Fe(e,m(e,"propertyPanel.k189"),o.marginBottom,M=>i({marginBottom:M===0?void 0:M}),{},h("marginBottom","ps-margin-bottom"))),G(e,"ps-margin-left",Fe(e,m(e,"propertyPanel.k190"),o.marginLeft,M=>i({marginLeft:M===0?void 0:M}),{},h("marginLeft","ps-margin-left")))])])]));const b=typeof o.rotate=="number"&&Number.isFinite(o.rotate)&&o.rotate!==0?Ro(o.rotate):void 0,k=M=>i({rotate:M===void 0||M===0?void 0:Ro(M)}),v=g0(n,o),w=Rd(n)||Fd(r.elements).has(t.id),P=w?"":G(e,"ap-rotate",Ge(m(e,"propertyPanel.k191"),g("div",{class:"pd-rotate-row"},[g("button",{type:"button",class:"pd-rotate-btn",title:m(e,"propertyPanel.k192"),"aria-label":m(e,"propertyPanel.k193"),text:"↺",onClick:()=>k((b??0)-90)}),g("div",{class:"pd-rotate-stepper"},[ae({value:b,min:0,max:359,placeholder:"0",disabled:!v,onCommit:M=>k(M)})]),g("button",{type:"button",class:"pd-rotate-btn",title:m(e,"propertyPanel.k194"),"aria-label":m(e,"propertyPanel.k195"),text:"↻",onClick:()=>k((b??0)+90)})]),m(e,"propertyTips.ap-rotate"),h("rotate","ap-rotate"))),E=w||v?"":g("p",{class:"pd-hint pd-rotate-note",text:m0(e.t??oe)});if(c.push(it(e,"appearance",m(e,"propertyPanel.k196"),"Brush",[g("form",{class:"pd-form",onSubmit:M=>M.preventDefault()},s?[G(e,"ap-font-family",he(m(e,"propertyPanel.k197"),ha({id:"prop-font",state:e.state,fonts:e.host.fonts,value:typeof o.fontFamily=="string"?o.fontFamily:void 0,placeholder:m(e,"propertyPanel.k198"),onChange:M=>i({fontFamily:M})}),void 0,h("fontFamily","ap-font-family"))),G(e,"ap-font-size",Fe(e,m(e,"propertyPanel.k199"),o.fontSize,M=>i({fontSize:M}),{min:8,max:72},h("fontSize","ap-font-size"))),G(e,"ap-font-weight",Xt(e,m(e,"propertyPanel.k200"),String(o.fontWeight??""),[{value:"normal",label:m(e,"propertyPanel.k201")},{value:"bold",label:m(e,"propertyPanel.k202")},{value:"bolder",label:m(e,"propertyPanel.k203")},{value:"lighter",label:m(e,"propertyPanel.k204")}],M=>i({fontWeight:M}),void 0,h("fontWeight","ap-font-weight"))),G(e,"ap-align",he(m(e,"propertyPanel.k205"),pr("ta",[{value:"left",label:m(e,"propertyPanel.k206")},{value:"center",label:m(e,"propertyPanel.k207")},{value:"right",label:m(e,"propertyPanel.k208")},{value:"justify",label:m(e,"propertyPanel.k209")}],o.textAlign||"left",M=>i({textAlign:M})),void 0,h("textAlign","ap-align"))),G(e,"ap-vertical-align",he(m(e,"propertyPanel.k210"),pr("va",[{value:"top",label:m(e,"propertyPanel.k211")},{value:"middle",label:m(e,"propertyPanel.k212")},{value:"bottom",label:m(e,"propertyPanel.k213")}],o.verticalAlign||"top",M=>i({verticalAlign:M})),void 0,h("verticalAlign","ap-vertical-align"))),g("div",{class:"color-row"},[G(e,"ap-color",he(m(e,"propertyPanel.k214"),dt(o.color,M=>i({color:M}),m(e,"propertyPanel.k215")),void 0,h("color","ap-color"))),G(e,"ap-bg-color",he(m(e,"propertyPanel.k216"),dt(o.backgroundColor,M=>i({backgroundColor:M}),m(e,"propertyPanel.k217")),void 0,h("backgroundColor","ap-bg-color")))]),G(e,"ap-line-height",Fe(e,m(e,"propertyPanel.k218"),o.lineHeight,M=>i({lineHeight:M||void 0}),{min:0,max:100},h("lineHeight","ap-line-height"))),G(e,"ap-letter-spacing",Fe(e,m(e,"propertyPanel.k219"),o.letterSpacing,M=>i({letterSpacing:M||void 0}),{min:0,max:20,step:.5},h("letterSpacing","ap-letter-spacing"))),G(e,"ap-text-fit",Xt(e,m(e,"propertyPanel.k220"),Ln(n,o),[{value:"clip",label:m(e,"propertyPanel.k221")},{value:"shrink",label:m(e,"propertyPanel.k222")},{value:"autoHeight",label:m(e,"propertyPanel.k223")}],M=>i({textFit:M}),void 0,h("textFit","ap-text-fit"))),o.textFit==="shrink"?G(e,"ap-shrink-min",he(m(e,"propertyPanel.k224"),ae({value:o.shrinkMinFontSize,min:1,max:72,step:.5,placeholder:m(e,"propertyPanel.k225"),onCommit:M=>i({shrinkMinFontSize:M||void 0})}),void 0,h("shrinkMinFontSize","ap-shrink-min"))):"",n==="longText"?G(e,"ap-long-text-indent",Ge(m(e,"propertyPanel.k226"),ae({value:o.longTextIndent,min:0,max:10,placeholder:m(e,"propertyPanel.k227"),onCommit:M=>i({longTextIndent:M||void 0})}),m(e,"propertyTips.ap-long-text-indent"),h("longTextIndent","ap-long-text-indent"))):"",G(e,"ap-word-wrap",zr(e,m(e,"propertyPanel.k228"),o.wordWrap!==!1,M=>i({wordWrap:M?void 0:!1}),h("wordWrap","ap-word-wrap"))),G(e,"ap-keep-line-breaks",zr(e,m(e,"propertyPanel.k229"),o.keepLineBreaks===!0,M=>i({keepLineBreaks:M?!0:void 0}),h("keepLineBreaks","ap-keep-line-breaks"))),P,E]:[n==="image"?G(e,"ap-img-fit",Xt(e,m(e,"propertyPanel.k230"),String(o.fit??"contain"),Hs(e.t??oe),M=>i({fit:M}),m(e,"propertyTips.ap-img-fit"),h("fit","ap-img-fit"))):"",n==="image"&&o.fit==="cover"?G(e,"ap-img-object-position",Qm(e,{fieldKey:"ap-img-object-position",label:m(e,"propertyPanel.k231"),src:xu(o.src),widthMm:Number(o.width)||0,heightMm:Number(o.height)||0,fit:o.fit,scale:o.fitScale,value:o.objectPosition===void 0?void 0:String(o.objectPosition),onCommit:M=>i({objectPosition:M}),onScaleCommit:M=>i({fitScale:M}),resetAnchor:h("objectPosition","ap-img-object-position"),resetScale:h("fitScale","ap-img-fit-scale")})):"",P,E,n==="flowList"?g("p",{class:"pd-empty",text:m(e,"propertyPanel.k232")}):""].filter(Boolean))])),p){const M=n==="barcode",ne=String(o.barcodeType||"CODE128").toUpperCase(),Se=o.printerDpi?String(o.printerDpi):"",Pe=Td(o.printerDpi,o.barWidth,e.t??oe);c.push(it(e,"code",m(e,"propertyPanel.k233"),"Postcard",[g("form",{class:"pd-form",onSubmit:K=>K.preventDefault()},[M?[G(e,"cd-type",Xt(e,m(e,"propertyPanel.k234"),ne,[{value:"CODE128",label:m(e,"propertyPanel.k235")},{value:"EAN13",label:m(e,"propertyPanel.k236")},{value:"EAN8",label:"EAN8"},{value:"UPC",label:"UPC"},{value:"CODE39",label:"CODE39"},{value:"ITF14",label:"ITF14"}],K=>i({barcodeType:K==="CODE128"?void 0:K}))),G(e,"cd-dpi",Xt(e,m(e,"propertyPanel.k237"),Se,[{value:"",label:m(e,"propertyPanel.k238")},{value:"203",label:m(e,"propertyPanel.k239")},{value:"300",label:m(e,"propertyPanel.k240")},{value:"600",label:m(e,"propertyPanel.k241")}],K=>i({printerDpi:Number(K)>0?Number(K):void 0}),void 0,h("printerDpi","cd-dpi"))),G(e,"cd-dpi",g("p",{class:"pd-hint",text:m(e,"propertyPanel.k242")})),G(e,"cd-bar-width",Fe(e,m(e,"propertyPanel.k243"),o.barWidth??2,K=>i({barWidth:K}),{min:2,max:8,step:.5},h("barWidth","cd-bar-width"))),G(e,"cd-bar-width",g("p",{class:"pd-hint",text:(Se?m(e,"propertyPanel.k244"):m(e,"propertyPanel.k245"))+(Pe?`。${Pe}`:"")})),G(e,"cd-bar-quiet-zone",Ge(m(e,"propertyPanel.k246"),ae({value:o.barQuietZone,min:0,max:20,placeholder:m(e,"propertyPanel.k247"),onCommit:K=>i({barQuietZone:K})}),m(e,"propertyTips.cd-bar-quiet-zone"),h("barQuietZone","cd-bar-quiet-zone"))),G(e,"cd-bar-height",Ge(m(e,"propertyPanel.k248"),ae({value:o.barHeight,min:1,max:100,placeholder:m(e,"propertyPanel.k249"),onCommit:K=>i({barHeight:K??void 0})}),m(e,"propertyTips.cd-bar-height"),h("barHeight","cd-bar-height"))),G(e,"cd-show-text",zr(e,m(e,"propertyPanel.k250"),o.hideTitle!==!0,K=>i({hideTitle:K?void 0:!0}),h("hideTitle","cd-show-text"))),G(e,"cd-font-size",he(m(e,"propertyPanel.k251"),ae({value:o.fontSize,min:5,max:24,placeholder:m(e,"propertyPanel.k252"),onCommit:K=>i({fontSize:K||void 0})}),void 0,h("fontSize","cd-font-size")))]:[G(e,"cd-ec-level",Xt(e,m(e,"propertyPanel.k253"),String(o.qrCodeLevel??"M"),[{value:"L",label:m(e,"propertyPanel.k254")},{value:"M",label:m(e,"propertyPanel.k255")},{value:"Q",label:"Q"},{value:"H",label:m(e,"propertyPanel.k256")}],K=>i({qrCodeLevel:K}),void 0,h("qrCodeLevel","cd-ec-level"))),G(e,"cd-quiet-zone",Ge(m(e,"propertyPanel.k257"),ae({value:o.qrQuietZone,min:0,max:8,placeholder:m(e,"propertyPanel.k258"),onCommit:K=>i({qrQuietZone:K})}),m(e,"propertyTips.cd-quiet-zone"),h("qrQuietZone","cd-quiet-zone")))],$t(m(e,"propertyPanel.k259")),M?g("p",{class:"pd-hint",text:m(e,"propertyPanel.k260")}):"",M?"":G(e,"cd-fit",Xt(e,m(e,"propertyPanel.k261"),String(o.fit||"contain"),Hs(e.t??oe),K=>i({fit:K||void 0}),void 0,h("fit","cd-fit"))),G(e,"cd-max-width",he(m(e,"propertyPanel.k262"),ae({value:o.maxWidth,min:1,max:200,placeholder:m(e,"propertyPanel.k263"),onCommit:K=>i({maxWidth:K||void 0})}),void 0,h("maxWidth","cd-max-width"))),G(e,"cd-max-height",he(m(e,"propertyPanel.k264"),ae({value:o.maxHeight,min:1,max:200,placeholder:m(e,"propertyPanel.k265"),onCommit:K=>i({maxHeight:K||void 0})}),void 0,h("maxHeight","cd-max-height")))].flat().filter(Boolean))]))}if(d&&(c.push(GP(e,t)),c.push(XP(e,t))),l&&c.push(KP(e,t)),n==="flowList"){const M=bt(o.flowColumns),ne=or(o.flowRowHeight),Se=Et(o.flowGapX),Pe=xr(o.flowMaxSpan,M),K=r0(o.width??0,Se,o.fontSize??12),ue=wr(o.flowLayoutMode),me=ue==="dynamic",we=Gr(o),ke=(te,Me)=>{i({[te]:typeof Me=="number"&&Number.isFinite(Me)&&Me>0?Me:0})};c.push(it(e,"flowList",m(e,"propertyPanel.k266"),"Grid3x3",[g("form",{class:"pd-form",onSubmit:te=>te.preventDefault()},[G(e,"fl-layout-mode",Xt(e,m(e,"propertyPanel.k267"),ue,[{value:"fixed",label:m(e,"propertyPanel.k268")},{value:"dynamic",label:m(e,"propertyPanel.k269")}],te=>i({flowLayoutMode:te==="dynamic"?"dynamic":"fixed"}),m(e,"propertyTips.fl-layout-mode"))),...me?[G(e,"fl-padding-top",Ge(m(e,"propertyPanel.k270"),ae({value:we.top,min:0,max:100,step:.5,onCommit:te=>ke("flowPaddingTop",te)}),m(e,"propertyTips.fl-padding-top"))),G(e,"fl-padding-right",Ge(m(e,"propertyPanel.k271"),ae({value:we.right,min:0,max:100,step:.5,onCommit:te=>ke("flowPaddingRight",te)}),m(e,"propertyTips.fl-padding-right"))),G(e,"fl-padding-bottom",Ge(m(e,"propertyPanel.k272"),ae({value:we.bottom,min:0,max:100,step:.5,onCommit:te=>ke("flowPaddingBottom",te)}),m(e,"propertyTips.fl-padding-bottom"))),G(e,"fl-padding-left",Ge(m(e,"propertyPanel.k273"),ae({value:we.left,min:0,max:100,step:.5,onCommit:te=>ke("flowPaddingLeft",te)}),m(e,"propertyTips.fl-padding-left")))]:[],G(e,"fl-columns",Ge(m(e,"propertyPanel.k274"),ae({value:M,min:1,max:12,onCommit:te=>i({flowColumns:bt(te),flowMaxSpan:xr(o.flowMaxSpan,bt(te))})}),m(e,"propertyTips.fl-columns"))),G(e,"fl-row-height",Ge(m(e,"propertyPanel.k275"),ae({value:ne,min:3,max:100,step:.5,onCommit:te=>i({flowRowHeight:or(te)})}),m(e,"propertyTips.fl-row-height"))),G(e,"fl-gap-x",Ge(m(e,"propertyPanel.k276"),ae({value:Se,min:0,max:50,step:.5,onCommit:te=>i({flowGapX:Et(te)})}),m(e,"propertyTips.fl-gap-x"))),G(e,"fl-auto-span",zr(e,m(e,"propertyPanel.k277"),o.flowAutoSpan===!0,te=>{i(te?{flowAutoSpan:te,flowMaxSpan:Pe}:{flowAutoSpan:te})})),o.flowAutoSpan===!0?G(e,"fl-max-span",Ge(m(e,"propertyPanel.k278"),ae({value:Pe,min:1,max:M,onCommit:te=>i({flowMaxSpan:xr(te,M)})}),m(e,"propertyTips.fl-max-span"))):"",M>K?g("p",{class:"pd-hint",text:m(e,"propertyPanel.k279",{v0:M,v1:K,v2:M})}):""].flat().filter(Boolean))]))}const D=()=>({borderWidth:o.borderWidth,borderStyle:o.borderStyle,borderColor:o.borderColor,borders:o.borders}),O=M=>{const ne=D();Xd(ne,M,Qd(ne)),i(ne)},A=M=>{const ne=D();is(ne,M,!Fo(ne,M)),i(ne)},R=Jd(o),_=R.style==="mixed",I=typeof R.width=="number"?R.width:void 0,S=_||R.style===void 0?"":R.style,B=typeof R.color=="string"?R.color:void 0,F=(M,ne)=>{const Se=D();j0(Se,M,ne),i(Se)},H=Yd.map(M=>({...M,label:m(e,M.labelKey)})),le=_?[{value:"",label:m(e,"propertyPanel.k280")},...H]:H;return c.push(it(e,"border-bg",m(e,"propertyPanel.k281"),"Picture",[g("form",{class:"pd-form",onSubmit:M=>M.preventDefault()},[G(e,"bb-border-style",Xt(e,m(e,"propertyPanel.k282"),S,le,M=>F("borderStyle",M))),g("div",{class:"border-row"},[G(e,"bb-border-width",Fe(e,m(e,"propertyPanel.k283"),I,M=>F("borderWidth",M),{min:0,max:20,step:.25,placeholder:R.width==="mixed"?m(e,"propertyPanel.k284"):void 0},h("borderWidth","bb-border-width"))),G(e,"bb-border-color",he(m(e,"propertyPanel.k285"),dt(B,M=>F("borderColor",M),m(e,"propertyPanel.k286")),void 0,h("borderColor","bb-border-color")))]),...$n(n)?[g("div",{class:"pd-button-group border-presets"},QP.map(M=>g("button",{type:"button",class:"pd-button small",text:m(e,M.labelKey),disabled:M.value==="inner",onClick:()=>O(M.value)}))),g("div",{class:"pd-checkbox-group"},e3.map(M=>g("label",{class:"pd-checkbox"},[g("input",{type:"checkbox",checked:Fo(o,M.value),onChange:()=>A(M.value)}),g("span",{text:m(e,M.labelKey)})]))),g("p",{class:"pd-hint",text:m(e,B0)})]:[],G(e,"bb-bg-color",he(m(e,"propertyPanel.k287"),dt(o.backgroundColor,M=>i({backgroundColor:M}),m(e,"propertyPanel.k288")),void 0,h("backgroundColor","bb-bg-color")))])])),c.push(YP(e,t)),c.push(it(e,"advanced",m(e,"propertyPanel.k289"),"Setting",[g("form",{class:"pd-form",onSubmit:M=>M.preventDefault()},[g("div",{class:"advanced-row"},[G(e,"ad-locked",zr(e,m(e,"propertyPanel.k290"),!!o.locked,M=>i({locked:M}),h("locked","ad-locked"))),G(e,"ad-fixed",zr(e,m(e,"propertyPanel.k291"),!!o.repeatOnEveryPage,M=>i({repeatOnEveryPage:M}),h("repeatOnEveryPage","ad-fixed"))),G(e,"ad-fixed-position",zr(e,m(e,"propertyPanel.k292"),!!o.fixed,M=>i({fixed:M}),h("fixed","ad-fixed-position")))]),G(e,"ad-z-index",Fe(e,m(e,"propertyPanel.k293"),o.zIndex,M=>i({zIndex:M}),{min:0,max:999},h("zIndex","ad-z-index"))),G(e,"ad-delete",g("div",{class:"pd-field"},[g("button",{type:"button",class:"pd-button danger",text:m(e,"propertyPanel.k294"),onClick:()=>r.deleteSelected()})]))])],!1,[g("button",{type:"button",class:"group-help",title:m(e,"propertyPanel.k295"),"aria-label":m(e,"propertyPanel.k296"),text:"?",onClick:M=>{M.stopPropagation(),e.fire("help","advanced-settings")}})])),g("div",{class:"property-content"},c)}function r3(e){const t=e.store,r=t.templateData,o=p=>t.updateTemplateData(p),n=p=>{const l=r.tiling,d=u=>u===90||u===270;if(l?.enabled&&d(p)!==d(r.outputRotation)){const u=hu({...r,outputRotation:p});o({outputRotation:p,tiling:{...l,columns:Math.max(u,1)}});return}o({outputRotation:p})},i=[];for(const[p,l]of Object.entries(Lt)){const d=m(e,`constants.paper.group.${l.group}`);let u=i.find(c=>c.group===d);u||(u={group:d,items:[]},i.push(u)),u.items.push({key:p,label:m(e,l.labelKey)})}const a=!Lt[r.paperSize],s=Gn(r.paperSize);return g("form",{class:"pd-form",onSubmit:p=>p.preventDefault()},[$t(m(e,"propertyPanel.k298")),he(m(e,"propertyPanel.k299"),g("select",{class:"pd-select",style:{width:"100%"},onChange:p=>o({paperSize:p.target.value})},[...i.map(p=>g("optgroup",{label:p.group},p.items.map(l=>g("option",{value:l.key,text:l.label,selected:r.paperSize===l.key})))),g("option",{value:"CUSTOM",text:m(e,"propertyPanel.k300"),selected:a})])),s||a?he(s?m(e,"propertyPanel.k301"):m(e,"propertyPanel.k302"),g("div",{class:"custom-size-grid"},[ae({value:Number(r.customWidth??0),min:25,max:2e3,onCommit:p=>o({customWidth:p})}),...a?[g("span",{class:"custom-size-x",text:"×"}),ae({value:Number(r.customHeight??0),min:25,max:2e3,onCommit:p=>o({customHeight:p})})]:[]])):"",s?"":he(m(e,"propertyPanel.k303"),pr("ori",[{value:"portrait",label:m(e,"propertyPanel.k304")},{value:"landscape",label:m(e,"propertyPanel.k305")}],r.orientation==="landscape"?"landscape":"portrait",p=>o({orientation:p})),m(e,"propertyPanel.k306")),s?"":he(m(e,"propertyPanel.k307"),pr("rot",[{value:"0",label:"0°"},{value:"90",label:"90°"},{value:"180",label:"180°"},{value:"270",label:"270°"}],String(r.outputRotation??0),p=>n(Number(p)),!0),r.tiling?.enabled?m(e,"propertyPanel.k308"):m(e,"propertyPanel.k309")),he(m(e,"propertyPanel.k310"),g("div",{class:"page-bg-row"},[dt(r.pageBackground,p=>o({pageBackground:p}),m(e,"propertyPanel.k311"),"page-bg-picker")]),void 0,Lr({target:r,base:{pageBackground:void 0},propKey:"pageBackground",write:()=>o({pageBackground:void 0})})),MP(e),t.pages.length>1?"":CP(e),$t(m(e,"propertyPanel.k312")),g("div",{class:"margin-grid"},[Fe(e,m(e,"propertyPanel.k313"),r.margins.top,p=>o({margins:{...r.margins,top:p}}),{min:0,max:50}),Fe(e,m(e,"propertyPanel.k314"),r.margins.bottom,p=>o({margins:{...r.margins,bottom:p}}),{min:0,max:100}),Fe(e,m(e,"propertyPanel.k315"),r.margins.left,p=>o({margins:{...r.margins,left:p}}),{min:0,max:50}),Fe(e,m(e,"propertyPanel.k316"),r.margins.right,p=>o({margins:{...r.margins,right:p}}),{min:0,max:50})]),$t(m(e,"propertyPanel.k317")),Fe(e,m(e,"propertyPanel.k318"),r.header.height??10,p=>o({header:{...r.header,height:p}}),{min:0,max:100,step:.1}),Fe(e,m(e,"propertyPanel.k319"),r.footer.height??10,p=>o({footer:{...r.footer,height:p}}),{min:0,max:100,step:.1}),JP(e)].filter(Boolean))}function o3(e,t,r){const o=(e.state.propSearch??"").trim(),n=!o||lc(o,[...r.searchKeywords,r.label]),i=document.createElement("div");if(i.className="property-content",n)try{xm(`property:${t.id}`,r.ui.renderProperty({element:t,data:e.host.designData?.length?e.host.designData:[vt],fields:e.host.fields??[],update:a=>e.store.updateElement(t.id,a),repaint:()=>e.repaint(),t:e.t??oe}),i)}catch{}return g("div",{class:"pd-tab-pane",role:"tabpanel",dataset:{pane:"prop:custom"},style:e.state.propTab==="custom"?"":{display:"none"}},[i])}function n3(e){const t=e.store,r=e.state,o=t.selectedElement,n=o?_l(o):void 0;if(r.propCollapsed)return g("div",{class:"property-panel collapsed"},[g("div",{class:"prop-collapsed"},[g("button",{type:"button",class:"pc-btn",title:m(e,"propertyPanel.k320"),text:"«",onClick:()=>{r.propCollapsed=!1,e.repaint()}}),...n?[g("button",{type:"button",class:`pc-btn${r.propTab==="custom"?" on":""}`,title:n.label,html:je(n.icon,14)||je("Shapes",14),onClick:()=>{r.propTab="custom",r.propCollapsed=!1,e.repaint()}})]:[],...[["element",m(e,"propertyPanel.k321"),"▦"],["page",m(e,"propertyPanel.k322"),"▤"]].map(([a,s,p])=>g("button",{type:"button",class:`pc-btn${r.propTab===a?" on":""}`,title:s,text:p,onClick:()=>{r.propTab=a,r.propCollapsed=!1,e.repaint()}}))])]);const i=o?r.propTab==="custom"&&!n?"element":r.propTab:"page";return g("div",{class:"property-panel"},[g("div",{class:"prop-head"},[g("span",{class:"prop-title",text:m(e,"propertyPanel.k323")}),g("button",{type:"button",class:"collapse-btn",title:m(e,"propertyPanel.k324"),text:"»",onClick:()=>{r.propCollapsed=!0,e.repaint()}})]),g("div",{class:"pd-tabs prop-tabs"},[g("div",{class:"pd-tab-bar",role:"tablist"},[...n?[g("button",{type:"button",class:`pd-tab${i==="custom"?" active":""}`,text:n.label,onClick:()=>{r.propTab="custom",e.repaint()}})]:[],g("button",{type:"button",class:`pd-tab${i==="element"?" active":""}`,text:m(e,"propertyPanel.k325"),onClick:()=>{r.propTab="element",e.repaint()}}),g("button",{type:"button",class:`pd-tab${i==="page"?" active":""}`,text:m(e,"propertyPanel.k326"),onClick:()=>{r.propTab="page",e.repaint()}})]),n&&o?o3(e,o,n):"",g("div",{class:"pd-tab-pane",role:"tabpanel",dataset:{pane:"prop:element"},style:i==="element"?"":{display:"none"}},o?[IP(e),t3(e,o)]:[g("p",{class:"pd-empty",text:m(e,"propertyPanel.k327")})]),g("div",{class:"pd-tab-pane",role:"tabpanel",dataset:{pane:"prop:page"},style:i==="page"?"":{display:"none"}},[r3(e)])].filter(Boolean))])}var W=lr,i3={Check:'<path d="M20 6 9 17l-5-5" />',Copy:'<rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />'};function a3(e,t=16){return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${i3[e]??""}</svg>`}function ka(e){const t=typeof e=="string"?e.trim().toLowerCase():"";return t==="label"||t==="key"||t==="both"?t:"both"}function sp(){return[{key:"field",text:W("expression.tabField")},{key:"variable",text:W("expression.tabVariable")},{key:"function",text:W("expression.tabFunction")}]}function og(){return{field:W("expression.placeholderField"),variable:W("expression.placeholderVariable"),function:W("expression.placeholderFunction")}}function s3(){return[{name:"SUM",label:W("expression.fnSum"),template:"SUM()"},{name:"AVG",label:W("expression.fnAvg"),template:"AVG()"},{name:"COUNT",label:W("expression.fnCount"),template:"COUNT()"},{name:"MIN",label:W("expression.fnMin"),template:"MIN()"},{name:"MAX",label:W("expression.fnMax"),template:"MAX()"}]}function l3(){return[{name:"ADD",label:W("expression.fnAdd"),template:"ADD()"},{name:"SUB",label:W("expression.fnSub"),template:"SUB()"},{name:"MUL",label:W("expression.fnMul"),template:"MUL()"},{name:"DIV",label:W("expression.fnDiv"),template:"DIV()"},{name:"ROUND",label:W("expression.fnRound"),template:"ROUND()"},{name:"ROUNDUP",label:W("expression.fnRoundUp"),template:"ROUNDUP()"},{name:"ROUNDDOWN",label:W("expression.fnRoundDown"),template:"ROUNDDOWN()"},{name:"ROUNDBANK",label:W("expression.fnRoundBank"),template:"ROUNDBANK()"}]}function p3(){return[{name:"MONEY",label:W("expression.fnMoney"),template:"MONEY()"},{name:"DATE",label:W("expression.fnDate"),template:"DATE()"},{name:"UPPER",label:W("expression.fnUpper"),template:"UPPER()"},{name:"IF",label:W("expression.fnIf"),template:"IF()"}]}function d3(){return[{name:"pageIndex",label:W("expression.varPageIndex"),template:"{pageIndex}"},{name:"totalPages",label:W("expression.varTotalPages"),template:"{totalPages}"},{name:"printDate",label:W("expression.varPrintDate"),template:"{printDate}"},{name:"printTime",label:W("expression.varPrintTime"),template:"{printTime}"}]}function c3(){return[{title:W("expression.groupAggregate"),items:s3()},{title:W("expression.groupMath"),items:l3()},{title:W("expression.groupFormat"),items:p3()}]}var u3="expression.previewEmpty",f3="expression.previewNoValue",lp="expression.previewError";function ng(e,t){if(!e.trim())return W(u3);try{const r={...vt,...t??{},...Qn()},o=to(e,r);return o==null?W(f3):String(o)}catch{return W(lp)}}function ig(e,t){const r=t.trim().toLowerCase();return r?e.filter(o=>o.label.toLowerCase().includes(r)||o.name.toLowerCase().includes(r)):e}function h3(e,t){const r=e.substring(0,t),o=r.lastIndexOf("{"),n=o!==-1&&!r.slice(o+1).includes("}"),i=r.lastIndexOf("("),a=i!==-1&&!r.slice(i+1).includes(")");return{insideBlock:n,insideParens:a}}var m3=e=>/[\u4e00-\u9fff]/.test(e),g3=e=>`字段「${e}」含中文,请用 {${e}} 引用(函数参数内写 ${e});中文可直接在 {} 中使用,无需 data['...'] 方括号`;function b3(e,t){const r=/^\{\s*([^{}]+?)\s*\}$/.exec(e.trim());if(!r)return null;const o=r[1]??"";return t.find(n=>n.fieldKey===o)??null}function pp(e,t,r="both"){return r==="label"?g("div",{class:"ee-field-info"},[g("span",{class:"ee-item-label",text:e})]):r==="key"?g("div",{class:"ee-field-info"},[g("span",{class:"ee-item-key is-primary",text:t})]):g("div",{class:"ee-field-info"},[g("span",{class:"ee-item-label",text:e}),g("span",{class:"ee-item-key",text:t})])}function Ht(e){return e.currentTarget.getRootNode()}function ya(e,t,r){const o=[];return r.forEach((n,i)=>{o.push(n),i<r.length-1&&o.push(g("br"))}),g("div",{class:`ee-help-card ${e}`},[g("div",{class:"ee-help-card-title",text:t}),g("div",{class:"ee-help-card-content"},o)])}function k3(){return g("div",{class:"ee-help-section"},[g("div",{class:"ee-help-title",text:W("expression.k1")}),g("div",{class:"ee-help-grid"},[ya("ee-help-field",W("expression.k2"),[W("expression.k3"),W("expression.k4"),W("expression.k5"),W("expression.k6"),W("expression.k7"),W("expression.k8"),W("expression.k9")]),ya("ee-help-function",W("expression.k10"),[W("expression.k11"),W("expression.k12"),W("expression.k13"),W("expression.k14"),W("expression.k15"),W("expression.k16")]),ya("ee-help-variable",W("expression.k17"),[W("expression.k18"),W("expression.k19"),W("expression.k20")]),ya("ee-help-conditional",W("expression.k21"),[W("expression.k22"),W("expression.k23"),W("expression.k24"),W("expression.k25"),W("expression.k26")])])])}function y3(e,t){W=e.t??lr;const r=ka(e.fieldDisplay),o={activeTab:"field",searchText:"",expression:t.value||"",binding:t.binding,copiedFieldKey:"",keyHint:""},n=(v,w)=>v.querySelector(w),i=v=>{const w=n(v,".ee-preview");if(!w)return;const P=ng(o.expression,e.demoData);w.textContent=P,w.classList.toggle("ee-preview-error",P===W(lp))},a=v=>{const w=n(v,".ee-key-hint");w&&(w.textContent=o.keyHint,w.style.display=o.keyHint?"":"none")},s=()=>{if(o.activeTab==="variable")return ig(d3(),o.searchText).map(P=>g("div",{class:"ee-list-item",onDblclick:E=>{const{insideParens:D}=d(E);u(Ht(E),D?P.template.replace(/^\{|\}$/g,""):P.template,void 0,"")}},[pp(P.label,P.template)]));if(o.activeTab==="function")return c3().map(P=>g("div",{class:"ee-func-group"},[g("div",{class:"ee-func-group-title",text:P.title}),...ig(P.items,o.searchText).map(E=>g("div",{class:"ee-list-item",onDblclick:D=>{const{insideBlock:O}=d(D),A=O?E.template:`{${E.template}}`;u(Ht(D),A,A.indexOf("(")+1,"")}},[pp(E.label,`${E.name}()`)]))]));const v=Ty(Su(e.fields??[]),o.searchText);if(!v.length)return[g("p",{class:"pd-empty",text:W("expression.k27")})];const w=[];for(const P of v){P.key&&w.push(g("div",{class:`ee-field-group${P.isList?" is-list":""}`},[g("span",{class:"ee-field-group-icon",text:P.isList?"📋":"📁"}),g("span",{text:P.label})]));for(const E of P.fields)w.push(g("div",{class:"ee-list-item ee-field-item",style:{paddingLeft:P.key?"22px":"10px"},onDblclick:D=>{const{insideParens:O}=d(D),A=D;if(A.ctrlKey||A.metaKey){const R=E.fieldLabel||E.fieldKey;u(Ht(D),O?`"${R}"`:R,void 0,"");return}u(Ht(D),O?E.fieldKey:`{${E.fieldKey}}`,void 0,m3(E.fieldKey)?g3(E.fieldKey):"")}},[pp(E.fieldLabel||E.fieldKey,E.fieldKey,r),g("button",{type:"button",class:`ee-copy-btn${o.copiedFieldKey===E.fieldKey?" is-copied":""}`,"data-tip":o.copiedFieldKey===E.fieldKey?W("expression.k28"):`复制字段名「${E.fieldLabel}」`,"aria-label":`复制字段名 ${E.fieldLabel}`,html:a3(o.copiedFieldKey===E.fieldKey?"Check":"Copy",13),onClick:D=>{D.stopPropagation(),l(D,E)},onDblclick:D=>D.stopPropagation()})]))}return w},p=v=>{Array.from(v.querySelectorAll(".ee-nav-tab")).forEach((O,A)=>O.classList.toggle("active",sp()[A]?.key===o.activeTab));const P=n(v,".ee-content-search .pd-input");if(P){const O=og()[o.activeTab];P.placeholder!==O&&(P.placeholder=O),P.value!==o.searchText&&(P.value=o.searchText)}const E=n(v,".ee-textarea");E&&E.value!==o.expression&&(E.value=o.expression);const D=n(v,".ee-content-list");if(D){Oh(D);for(const O of s())rt(O,D)}i(v),a(v)};function l(v,w){const P=Ht(v);Tu(w.fieldLabel||w.fieldKey).then(E=>{E&&(o.copiedFieldKey=w.fieldKey,p(P),setTimeout(()=>{o.copiedFieldKey===w.fieldKey&&(o.copiedFieldKey="",p(P))},1200))})}const d=v=>{const P=n(Ht(v),".ee-textarea")?.selectionStart??o.expression.length;return h3(o.expression,P)},u=(v,w,P=w.length,E)=>{E!==void 0&&(o.keyHint=E);const D=n(v,".ee-textarea");if(!D){o.expression+=w,i(v),a(v);return}const O=D.selectionStart??o.expression.length,A=D.selectionEnd??O;o.expression=o.expression.substring(0,O)+w+o.expression.substring(A);const R=O+P;D.value=o.expression,D.focus(),D.selectionStart=D.selectionEnd=R,i(v),a(v)},c=()=>{const v=o.expression;if(o.binding===void 0){e.onApply({formatter:v}),e.onClose();return}const w=b3(v,e.fields??[]);e.onApply(w?{formatter:v,binding:w.fieldKey,title:w.fieldLabel}:{formatter:v}),e.onClose()},f=g("div",{class:"ee-nav"},[g("div",{class:"ee-nav-title",text:W("expression.k29")}),g("div",{class:"ee-nav-tabs"},sp().map((v,w)=>g("div",{class:`ee-nav-tab${o.activeTab===v.key?" active":""}`,text:v.text,onClick:P=>{o.activeTab=sp()[w].key,p(Ht(P))}})))]),h=g("div",{class:"ee-content"},[g("div",{class:"ee-content-search"},[g("input",{class:"pd-input",placeholder:og()[o.activeTab],onInput:v=>{o.searchText=v.target.value,p(Ht(v))}})]),g("div",{class:"ee-content-list"},s())]),b=ng(o.expression,e.demoData),k=g("div",{class:"ee-editor"},[g("div",{class:"ee-editor-section"},[g("div",{class:"ee-editor-title",text:W("expression.k30")}),g("textarea",{class:"ee-textarea",rows:6,placeholder:W("expression.k31"),text:o.expression,onInput:v=>{o.expression=v.target.value,o.keyHint="",i(Ht(v)),a(Ht(v))}}),g("div",{class:"pd-hint ee-key-hint",style:{display:"none",color:"var(--pd-accent, #165DFF)"},text:""})]),g("div",{class:"ee-editor-section"},[g("div",{class:"ee-editor-title",text:W("expression.k32")}),g("div",{class:`ee-preview${b===W(lp)?" ee-preview-error":""}`,text:b})]),k3()]);return g("div",{class:"pd-dialog-overlay",onKeydown:v=>{v.key==="Escape"&&e.onClose()}},[g("section",{class:"pd-dialog pd-dialog-large",role:"dialog","aria-modal":"true","aria-labelledby":"expression-editor-title"},[g("header",{class:"pd-dialog-header"},[g("strong",{id:"expression-editor-title",text:W("expression.k33")}),g("button",{type:"button",class:"pd-close","aria-label":W("expression.k34"),text:"×",onClick:()=>e.onClose()})]),g("div",{class:"expression-editor"},[f,h,k]),g("footer",{class:"pd-dialog-footer"},[g("button",{type:"button",class:"pd-button",text:W("expression.k35"),onClick:()=>e.onClose()}),g("button",{type:"button",class:"pd-button primary",text:W("expression.k36"),onClick:()=>c()})])])])}const v3={id:"getting-started",title:"快速入门",content:`
294
+ {warnings}`,"store.tilingSinglePage":"เมื่อเปิดการจัดเรียงชิ้น อนุญาตให้มีหน้าออกแบบได้เพียงหน้าเดียว","elementGroup.chart":"แผนภูมิ","service.printData.emptyArray":"ข้อมูลการพิมพ์เป็นชุดต้องเป็นอาร์เรย์อ็อบเจกต์ที่ไม่ว่างเปล่า","service.printData.tooMany":"การพิมพ์เป็นชุดรองรับได้มากสุด {max} ชุด ได้ {count} ชุด","service.printData.itemNotObject":"รายการข้อมูลการพิมพ์ชุดที่ {index} ต้องเป็นอ็อบเจกต์","service.printData.notObjectOrArray":"printData ต้องเป็นอ็อบเจกต์หรืออาร์เรย์",...m2,...g2},k2={constants:{"constants.borderStyle.none":"无","constants.borderStyle.solid":"实线","constants.borderStyle.dashed":"虚线","constants.borderStyle.dotted":"点线","constants.borderStyle.double":"双线","constants.paper.A4.label":"A4 210×297mm","constants.paper.A3.label":"A3 297×420mm","constants.paper.A5.label":"A5 148×210mm","constants.paper.Letter.label":"Letter 216×279mm","constants.paper.Legal.label":"Legal 216×356mm","constants.paper.DOT_FULL.label":"全等分 241×279.4mm","constants.paper.DOT_HALF.label":"二等分 241×139.7mm","constants.paper.DOT_THIRD.label":"三等分 241×93.1mm","constants.paper.LABEL_80X60.label":"80×60mm","constants.paper.LABEL_60X40.label":"60×40mm","constants.paper.LABEL_40X30.label":"40×30mm","constants.paper.THERMAL_57.label":"57mm","constants.paper.THERMAL_80.label":"80mm","constants.paper.THERMAL_110.label":"110mm","constants.paper.CONTINUOUS.label":"连续纸(自定义宽度)","constants.paper.group.common":"常用纸张","constants.paper.group.dotMatrix":"针式打印纸","constants.paper.group.labels":"标签纸","constants.paper.group.receipt":"小票纸","constants.paper.group.continuous":"连续纸","constants.watermark.density.dense":"密","constants.watermark.density.medium":"中(默认)","constants.watermark.density.loose":"疏","constants.watermark.density.size":"({w}×{h})","constants.label.content":"内容","constants.hint.border.apply":"线型 / 宽度 / 颜色即时生效,这三行显示的就是当前生效规格:已有边框时任改一行都会按新规格铺满四边并清掉单边覆盖;上、下、左、右只给选中的边加框,撤掉一边会把它其余三边落成单边;「无」清除边框,「内部」仅表格单元格可用","constants.hint.border.pending":"线型 / 宽度 / 颜色是待应用规格:选中格已有的边框规格一致时会填进这三行;四边不一致的项显示「混合」,一条边都没有时显示「无 / 0」。改完点「全部 / 外侧 / 内部」或勾选上、下、左、右某条边才会写入选中的单元格;「无」是清除边框","constants.hint.border.multi":"多选时不回显单格边框:线型 / 宽度 / 颜色按当前设置作为批写规格,点「全部 / 外侧 / 内部」或勾选某条边后写入所有选中格;「无」是清除边框","constants.hint.border.mixed":"当前单元格四边边框规格不一致:带「混合」的项不谎报,未改项在点「全部 / 外侧 / 内部」或勾选单边时按缺省档(实线 0.75pt)写入,改任一项即按该值批写"}},y2={constants:{"constants.borderStyle.none":"None","constants.borderStyle.solid":"Solid","constants.borderStyle.dashed":"Dashed","constants.borderStyle.dotted":"Dotted","constants.borderStyle.double":"Double","constants.paper.A4.label":"A4 210×297mm","constants.paper.A3.label":"A3 297×420mm","constants.paper.A5.label":"A5 148×210mm","constants.paper.Letter.label":"Letter 216×279mm","constants.paper.Legal.label":"Legal 216×356mm","constants.paper.DOT_FULL.label":"Full sheet 241×279.4mm","constants.paper.DOT_HALF.label":"Half sheet 241×139.7mm","constants.paper.DOT_THIRD.label":"Third sheet 241×93.1mm","constants.paper.LABEL_80X60.label":"80×60mm","constants.paper.LABEL_60X40.label":"60×40mm","constants.paper.LABEL_40X30.label":"40×30mm","constants.paper.THERMAL_57.label":"57mm","constants.paper.THERMAL_80.label":"80mm","constants.paper.THERMAL_110.label":"110mm","constants.paper.CONTINUOUS.label":"Continuous paper (custom width)","constants.paper.group.common":"Common","constants.paper.group.dotMatrix":"Dot-matrix","constants.paper.group.labels":"Labels","constants.paper.group.receipt":"Receipt","constants.paper.group.continuous":"Continuous","constants.watermark.density.dense":"Dense","constants.watermark.density.medium":"Medium (default)","constants.watermark.density.loose":"Sparse","constants.watermark.density.size":" ({w}×{h})","constants.label.content":"Content","constants.hint.border.apply":'Line style / width / color apply immediately; these three rows show the effective spec. With an existing border, changing any row fills all four sides and clears per-side overrides. Top / right / bottom / left add a border only to the selected side; removing one turns the other three into per-side borders. "None" clears the border; "Inside" is available for table cells only.',"constants.hint.border.pending":'Line style / width / color are a pending spec: they are prefilled when the selected cells share one border spec. Mixed values show "Mixed"; no border shows "None / 0". Click All / Outside / Inside or tick a side (top / right / bottom / left) to write to the selected cells; "None" clears the border.',"constants.hint.border.multi":'Multi-select does not show a single cell border: line style / width / color act as a batch spec. Click All / Outside / Inside or tick a side to apply to all selected cells; "None" clears the border.',"constants.hint.border.mixed":'The four sides of this cell have different border specs: "Mixed" is shown instead of a false value. Untouched fields fall back to the default (Solid 0.75pt) when you click All / Outside / Inside or tick a side; changing any field writes that value to the batch.'}},v2={constants:{"constants.borderStyle.none":"ไม่มี","constants.borderStyle.solid":"เส้นทึบ","constants.borderStyle.dashed":"เส้นประ","constants.borderStyle.dotted":"เส้นจุด","constants.borderStyle.double":"เส้นคู่","constants.paper.A4.label":"A4 210×297mm","constants.paper.A3.label":"A3 297×420mm","constants.paper.A5.label":"A5 148×210mm","constants.paper.Letter.label":"Letter 216×279mm","constants.paper.Legal.label":"Legal 216×356mm","constants.paper.DOT_FULL.label":"แผ่นเต็ม 241×279.4mm","constants.paper.DOT_HALF.label":"แผ่นครึ่ง 241×139.7mm","constants.paper.DOT_THIRD.label":"แผ่นหนึ่งในสาม 241×93.1mm","constants.paper.LABEL_80X60.label":"80×60mm","constants.paper.LABEL_60X40.label":"60×40mm","constants.paper.LABEL_40X30.label":"40×30mm","constants.paper.THERMAL_57.label":"57mm","constants.paper.THERMAL_80.label":"80mm","constants.paper.THERMAL_110.label":"110mm","constants.paper.CONTINUOUS.label":"กระดาษต่อเนื่อง (ความกว้างกำหนดเอง)","constants.paper.group.common":"กระดาษทั่วไป","constants.paper.group.dotMatrix":"กระดาษดอทเมทริกซ์","constants.paper.group.labels":"ฉลาก","constants.paper.group.receipt":"ใบเสร็จ","constants.paper.group.continuous":"กระดาษต่อเนื่อง","constants.watermark.density.dense":"หนาแน่น","constants.watermark.density.medium":"กลาง (ค่าเริ่มต้น)","constants.watermark.density.loose":"ห่าง","constants.watermark.density.size":" ({w}×{h})","constants.label.content":"เนื้อหา","constants.hint.border.apply":'รูปแบบเส้น/ความกว้าง/สีมีผลทันที สามบรรทัดนี้แสดงผลที่มีผลอยู่: เมื่อมีเส้นขอบอยู่แล้ว การเปลี่ยนแถวใดจะเติมสี่ด้านและลบการเขียนทับรายด้าน; บน/ขวา/ล่าง/ซ้ายเพิ่มเส้นเฉพาะด้านที่เลือก การลบด้านหนึ่งจะทำให้สามด้านที่เหลือเป็นเส้นแยก; "ไม่มี" ลบเส้นขอบ "ด้านใน" ใช้สำหรับเซลล์ตารางเท่านั้น',"constants.hint.border.pending":'รูปแบบเส้น/ความกว้าง/สีเป็นค่าที่รอใช้งาน: จะเติมในสามบรรทัดนี้เมื่อเซลล์ที่เลือกมีเส้นขอบสอดคล้องกัน; ค่าที่ไม่ตรงกันแสดง "ผสม" ไม่มีเส้นแสดง "ไม่มี / 0" แก้แล้วคลิก ทั้งหมด/ด้านนอก/ด้านใน หรือทำเครื่องหมายด้านใดด้านหนึ่งจึงเขียนลงเซลล์ที่เลือก; "ไม่มี" ลบเส้นขอบ',"constants.hint.border.multi":'การเลือกหลายรายการไม่แสดงเส้นขอบของเซลล์เดี่ยว: รูปแบบเส้น/ความกว้าง/สีเป็นค่าเขียนเป็นชุด คลิก ทั้งหมด/ด้านนอก/ด้านใน หรือทำเครื่องหมายด้านใดด้านหนึ่งเพื่อเขียนทุกเซลล์ที่เลือก; "ไม่มี" ลบเส้นขอบ',"constants.hint.border.mixed":'เส้นขอบสี่ด้านของเซลล์นี้ไม่สอดคล้องกัน: รายการ "ผสม" ไม่รายงานค่าผิด; รายการที่ไม่เปลี่ยนใช้ค่าเริ่มต้น (เส้นทึบ 0.75pt) เมื่อคลิก ทั้งหมด/ด้านนอก/ด้านใน หรือทำเครื่องหมายด้านเดียว; เปลี่ยนรายการใดจะเขียนค่านั้นเป็นชุด'}},w2={propertyTips:{"propertyTips.ap-long-text-indent":"长文本每段首行空出的宽度,单位「字符」:填 2 即缩进两个汉字宽(中文排版惯例),按 em 落纸——字号被「自动缩小」压小时缩进同步变窄。仅长文本元素生效,写在普通文本上不生效","propertyTips.ap-img-fit":"图片在元素框内的缩放方式:包含=完整显示、可能留白;剪裁=铺满框并按「裁剪锚点」取一块;拉伸=填满框会变形;原始尺寸与缩小不放大。画布与三条出纸链路同一口径(缺省包含)","propertyTips.ap-img-object-position":"取位(仅「剪裁」档有这一行):剪裁把图等比铺满元素框,多出来的那一条边按这里选的位置取舍。先选位置档(贴边/居中/贴另一头),再按百分比微调,0 贴左/贴顶,100 挪到另一头,水平与垂直各自独立;缺省取正中间(保住证件照头顶就选顶部)。其余缩放模式图比框小或刚好铺满,没有可裁的边,所以不出本行","propertyTips.ap-img-fit-scale":"剪裁放大:等比铺满之后把画面再推大这么多,两轴才真的各多出一条边可裁——图与框同比例时不放大就什么都裁不掉。100=不放大(缺省),上限 400;超出框的部分由元素框裁掉。锚点选中的那一点既是取位的钉住点、也是放大的中心,两者共用同一个值。仅「剪裁」档生效,其余缩放模式不出本行","propertyTips.ap-rotate":"元素绕自身中心旋转的角度(度,0~359):出纸时按旋转后外接盒分页与结算,底部放不下自动移页,超出纸面左右缘或顶部会被裁切并给出纸提示。表格、流式列表与表格下方跟随区的元素不支持旋转(这三类不出本行);条码与二维码的任意角度需 385dpi 以上打印头,低分辨率打印机只按 90° 步进出纸","propertyTips.fl-columns":"一行排几个单元,必须由你指定——不随内容自动算列数。填的列数乘单元宽放不下元素框时只给提示、不改你的数,出纸按你填的排","propertyTips.fl-row-height":"每个单元行的最低高度(毫米),与表格行高同一口径:内容比它高时这一行会撑高,不会裁字","propertyTips.fl-gap-x":"相邻单元之间的横向留白(毫米);纵向不留缝,行与行的距离由行高承担","propertyTips.fl-auto-span":"单元内容比一列还宽时,让它占掉两个或更多列位;当前行剩不够放就把整个单元挪到下一行行首(绝不把词切两半)。默认关——开着时出纸栏数由字号与框宽决定","propertyTips.fl-max-span":"跨列的列数上限,最大只能等于「每行列数」:把每行列数改小时,这里会被一并顶回去","propertyTips.fl-layout-mode":"容器高度由谁决定:固定高度=维持设计高度、一框一页,超高裁切(存量模板默认值,输出不变);动态分页=容器高度由内容撑开,内容满页后按行续页,每一页都画完整边框,元素下方的跟随区与表格同一套规则","propertyTips.fl-padding-top":"动态分页模式下容器顶部与第一行内容之间的留白(毫米),仅动态模式生效;每页切片都按它留白并计入分页预算,负值与非法值按 0 处理","propertyTips.fl-padding-right":"动态分页模式下容器右侧与内容之间的留白(毫米),会压缩参与列宽估算的内容宽度,仅动态模式生效","propertyTips.fl-padding-bottom":"动态分页模式下容器底部与最后一行内容之间的留白(毫米),每页切片都按它留白并计入分页预算,仅动态模式生效","propertyTips.fl-padding-left":"动态分页模式下容器左侧与内容之间的留白(毫米),会压缩参与列宽估算的内容宽度,仅动态模式生效","propertyTips.cd-bar-quiet-zone":"条形码左右两端的空白格数(1 格 = 1 条宽):缺省 10,正是一维码码制要求的下限;数值越小白边越窄、同样的框内条越粗(可放大)。填 0 即不留白边,但静区参与「条→空→条」跳变,紧邻文字或表格线时可能扫不出,需实打验证","propertyTips.cd-bar-height":"黑白条本体的目标高度(mm,不含下方文字):折算粒度就是每模块物理宽,所以只能精确到它的整数倍。条宽优先——可用框高装不下时期望条高让位,绝不把条宽挤窄(热敏出纸清晰度靠条宽)。与「最大高度」分工不同:那条限的是整图(含文字)的上限","propertyTips.cd-quiet-zone":"二维码四周留出的空白格数:0 即不留白边、码面等比铺满元素框(此时靠框外的白纸充当静区);数值越大白边越宽、码面在框内越小(缺省 0,需 ISO/IEC 18004 推荐静区时填 4)"}},x2={propertyTips:{"propertyTips.ap-long-text-indent":'First-line indent for each paragraph of a long-text element, in characters: 2 means two Chinese characters wide (a common CJK convention), laid out in em units — it scales down when "Auto shrink" reduces the font size. Applies to long-text elements only; setting it on plain text has no effect.',"propertyTips.ap-img-fit":"How the image is scaled inside the element box. Contain: show the whole image, possibly with blank space. Crop: fill the box and take a region based on the crop anchor. Stretch: fill the box and distort. Original size / Shrink: never enlarge. The canvas and all three print pipelines use the same rule (Contain by default).","propertyTips.ap-img-object-position":"Crop anchor (only shown for Crop mode): cropping scales the image to fill the box, and this picks which extra edge to keep. Choose a position preset (edge / center / opposite edge), then fine-tune with the percentage: 0 aligns left/top, 100 aligns to the other end; horizontal and vertical are independent. The default is centered (choose Top to keep the head in ID photos). Other fit modes have no crop edge, so this row is hidden.","propertyTips.ap-img-fit-scale":"Crop zoom: after filling the box, enlarge the image by this much so both axes gain a crop margin — when image and box have the same aspect ratio, no zoom means nothing can be cropped. 100 = no zoom (default), maximum 400; anything outside the box is clipped by the element frame. The chosen anchor is both the pinning point and the zoom center. Shown for Crop mode only.","propertyTips.ap-rotate":"Rotation of the element about its own center, in degrees (0–359). During printing, pagination and layout use the rotated bounding box: content that does not fit at the bottom moves to the next page, and content beyond the left/right/top paper edges is clipped with a print warning. Tables, flow lists and elements in the follow-up zone below a table do not support rotation (this row is hidden for them); arbitrary angles for barcodes and QR codes require a 385dpi+ print head — lower-resolution printers only output in 90° steps.","propertyTips.fl-columns":"The number of cells per row must be specified by you — it is never inferred from content. If the column count times the cell width does not fit the element box, you get a hint but your value is not changed, and print output follows what you entered.","propertyTips.fl-row-height":"Minimum height of each cell row, in millimetres, using the same rule as table row height: a row grows when its content is taller, and text is never clipped.","propertyTips.fl-gap-x":"Horizontal whitespace between adjacent cells, in millimetres. No vertical gap is inserted; the distance between rows comes from the row height.","propertyTips.fl-auto-span":"When a cell is wider than one column, let it span two or more columns; if the current row has too few columns left, move the whole cell to the start of the next row (never split a word). Off by default — when on, the printed column count depends on font size and box width.","propertyTips.fl-max-span":'Upper limit for column spanning; it can never exceed "Columns per row". Lowering the column count also pushes this value down.',"propertyTips.fl-layout-mode":"What decides the container height. Fixed height: keep the designed height, one box per page, clip overflow (the default for existing templates, output unchanged). Dynamic pagination: the container grows with its content, continues row by row after a page fills, draws a complete border on every page, and follows the same rules as tables for the follow-up zone below the element.","propertyTips.fl-padding-top":"Whitespace between the top of the container and the first content row in dynamic pagination mode, in millimetres. Only applies in dynamic mode; every page slice uses this padding and counts it in the pagination budget. Negative or invalid values are treated as 0.","propertyTips.fl-padding-right":"Whitespace between the right side of the container and the content in dynamic pagination mode, in millimetres; it reduces the content width available for column-width estimation. Only applies in dynamic mode.","propertyTips.fl-padding-bottom":"Whitespace between the bottom of the container and the last content row in dynamic pagination mode, in millimetres. Only applies in dynamic mode; every page slice uses this padding and counts it in the pagination budget.","propertyTips.fl-padding-left":"Whitespace between the left side of the container and the content in dynamic pagination mode, in millimetres; it reduces the content width available for column-width estimation. Only applies in dynamic mode.","propertyTips.cd-bar-quiet-zone":"Number of blank modules on each side of a barcode (1 module = 1 bar width): the default of 10 is the minimum required by 1D symbologies. Smaller values narrow the quiet zone and make bars thicker in the same box (they can be enlarged). Setting 0 removes the white margin, but the quiet zone participates in bar-space-bar transitions, so codes next to text or table lines may fail to scan — verify with a real print.","propertyTips.cd-bar-height":'Target height of the black bars themselves, in millimetres (excluding the text below). The granularity is the physical width of one module, so only integer multiples are exact. Bar width takes priority: if the available height cannot fit the desired bar height, the height gives way — bars are never narrowed (thermal print clarity depends on bar width). This differs from "Maximum height", which limits the whole image including text.',"propertyTips.cd-quiet-zone":"Number of blank modules around a QR code: 0 means no white margin and the code scales to fill the element box (the surrounding white paper acts as the quiet zone). Larger values widen the margin and make the code smaller in the box. The default is 0; use 4 for the quiet zone recommended by ISO/IEC 18004."}},P2={propertyTips:{"propertyTips.ap-long-text-indent":'ระยะเว้นบรรทัดแรกของแต่ละย่อหน้าในข้อความยาว หน่วยเป็นอักขระ: ใส่ 2 หมายถึงเว้นสองตัวอักษรจีน (ตามธรรมเนียม CJK) คำนวณเป็นหน่วย em — จะย่อตามเมื่อ "ย่ออัตโนมัติ" ลดขนาดฟอนต์ ใช้เฉพาะองค์ประกอบข้อความยาว การตั้งค่าบนข้อความธรรมดาไม่มีผล',"propertyTips.ap-img-fit":"วิธีปรับขนาดรูปภาพภายในกรอบองค์ประกอบ พอดี: แสดงรูปทั้งหมดอาจมีช่องว่าง ครอบ: เติมกรอบแล้วตัดตามจุดยึดการครอป ดึง: เติมกรอบและบิดเบือน ขนาดต้นฉบับ/ย่อ: ไม่ขยาย พื้นที่ทำงานและทั้งสามไปป์ไลน์การพิมพ์ใช้กฎเดียวกัน (ค่าเริ่มต้นพอดี)","propertyTips.ap-img-object-position":"จุดยึดการครอป (แสดงเฉพาะโหมดครอบ): การครอปปรับรูปให้เติมกรอบ ตัวเลือกนี้เลือกขอบส่วนเกินที่ต้องการคงไว้ เลือกระดับตำแหน่ง (ชิดขอบ/กลาง/ชิดอีกด้าน) แล้วปรับด้วยเปอร์เซ็นต์: 0 ชิดซ้าย/บน 100 ชิดขวา/ล่าง แนวนอนและแนวตั้งอิสระต่อกัน ค่าเริ่มต้นอยู่กึ่งกลาง (เลือก บน เพื่อคงศีรษะในรูปบัตรประจำตัว) โหมดอื่นไม่มีขอบให้ครอปจึงซ่อนบรรทัดนี้","propertyTips.ap-img-fit-scale":"ขยายการครอป: หลังเติมกรอบแล้วขยายภาพอีกมากน้อยเพียงนี้ เพื่อให้ทั้งสองแกนมีขอบให้ครอป — เมื่อรูปและกรอบมีอัตราส่วนเท่ากัน การไม่ขยายจะครอปไม่ได้เลย 100 = ไม่ขยาย (ค่าเริ่มต้น) สูงสุด 400 ส่วนที่เกินกรอบถูกตัดโดยกรอบองค์ประกอบ จุดยึดที่เลือกเป็นทั้งจุดตรึงและศูนย์กลางการขยาย แสดงเฉพาะโหมดครอบ","propertyTips.ap-rotate":"มุมหมุนขององค์ประกอบรอบจุดศูนย์กลางตัวเอง เป็นองศา (0–359) ขณะพิมพ์ การแบ่งหน้าและการจัดวางใช้กล่องล้อมรอบที่หมุนแล้ว: เนื้อหาที่ไม่พอด้านล่างย้ายไปหน้าถัดไป และเนื้อหาที่เกินขอบกระดาษซ้าย/ขวา/บนถูกตัดพร้อมคำเตือน ตาราง รายการแบบไหล และองค์ประกอบในโซนตามหลังตารางไม่รองรับการหมุน (ซ่อนบรรทัดนี้); มุมใดๆ ของบาร์โค้ดและคิวอาร์โค้ดต้องการหัวพิมพ์ 385dpi ขึ้นไป — เครื่องพิมพ์ความละเอียดต่ำกว่าส่งออกได้เฉพาะขั้น 90°","propertyTips.fl-columns":"จำนวนเซลล์ต่อแถวต้องระบุเองเสมอ — ไม่คำนวณจากเนื้อหา หากจำนวนคอลัมน์คูณความกว้างเซลล์ไม่พอดีกับกรอบองค์ประกอบจะมีคำแนะนำแต่ค่าไม่เปลี่ยน และผลการพิมพ์เป็นไปตามที่ป้อน","propertyTips.fl-row-height":"ความสูงขั้นต่ำของแถวเซลล์แต่ละแถว เป็นมิลลิเมตร ใช้กฎเดียวกับความสูงแถวตาราง: แถวจะสูงขึ้นเมื่อเนื้อหาสูงกว่า และข้อความไม่ถูกตัด","propertyTips.fl-gap-x":"ช่องว่างแนวนอนระหว่างเซลล์ที่อยู่ติดกัน เป็นมิลลิเมตร ไม่มีการเว้นช่องแนวตั้ง ระยะระหว่างแถวมาจากความสูงแถว","propertyTips.fl-auto-span":"เมื่อเซลล์กว้างกว่าหนึ่งคอลัมน์ ให้ขยายครอบสองคอลัมน์ขึ้นไป; หากแถวปัจจุบันเหลือคอลัมน์ไม่พอ ย้ายเซลล์ทั้งหมดไปขึ้นต้นแถวถัดไป (ไม่ตัดคำ) ปิดอยู่โดยค่าเริ่มต้น — เมื่อเปิด จำนวนคอลัมน์ที่พิมพ์ขึ้นกับขนาดฟอนต์และความกว้างกรอบ","propertyTips.fl-max-span":'ขีดจำกัดบนของการขยายคอลัมน์ ห้ามเกิน "จำนวนคอลัมน์ต่อแถว" การลดจำนวนคอลัมน์จะดันค่านี้ลงด้วย',"propertyTips.fl-layout-mode":"อะไรเป็นตัวกำหนดความสูงของคอนเทนเนอร์ ความสูงคงที่: คงความสูงที่ออกแบบ หนึ่งกรอบต่อหน้า ตัดส่วนเกิน (ค่าเริ่มต้นของเทมเพลตเดิม ผลไม่เปลี่ยน) การแบ่งหน้าแบบไดนามิก: คอนเทนเนอร์ ขยายตามเนื้อหา ดำเนินต่อเป็นแถวหลังหน้าเต็ม วาดเส้นขอบครบทุกหน้า และปฏิบัติตามกฎเดียวกับตารางสำหรับโซนตามหลังองค์ประกอบ","propertyTips.fl-padding-top":"ช่องว่างระหว่างด้านบนของคอนเทนเนอร์กับแถวเนื้อหาแรกในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร ใช้เฉพาะโหมดไดนามิก ทุกชิ้นของหน้าใช้ระยะนี้และนับรวมในงบการแบ่งหน้า ค่าติดลบหรือไม่ถูกต้องถือเป็น 0","propertyTips.fl-padding-right":"ช่องว่างระหว่างด้านขวาของคอนเทนเนอร์กับเนื้อหาในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร จะลดความกว้างเนื้อหาที่ใช้คำนวณความกว้างคอลัมน์ ใช้เฉพาะโหมดไดนามิก","propertyTips.fl-padding-bottom":"ช่องว่างระหว่างด้านล่างของคอนเทนเนอร์กับแถวเนื้อหาสุดท้ายในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร ใช้เฉพาะโหมดไดนามิก ทุกชิ้นของหน้าใช้ระยะนี้และนับรวมในงบการแบ่งหน้า","propertyTips.fl-padding-left":"ช่องว่างระหว่างด้านซ้ายของคอนเทนเนอร์กับเนื้อหาในโหมดแบ่งหน้าแบบไดนามิก เป็นมิลลิเมตร จะลดความกว้างเนื้อหาที่ใช้คำนวณความกว้างคอลัมน์ ใช้เฉพาะโหมดไดนามิก","propertyTips.cd-bar-quiet-zone":"จำนวนโมดูลว่างสองข้างของบาร์โค้ด (1 โมดูล = 1 ความกว้างแท่น): ค่าเริ่มต้น 10 คือค่าต่ำสุดที่รหัสแบบหนึ่งมิติต้องการ ค่าที่เล็กลงทำให้โซนเงียบแคบและแท่นหนาขึ้นในกรอบเดียวกัน (สามารถขยายได้) การตั้ง 0 ลบขอบขาว แต่โซนเงียบมีส่วนในการเปลี่ยนแท่น-ช่อง-แท่น รหัสที่อยู่ติดข้อความหรือเส้นตารางอาจสแกนไม่ได้ — ตรวจด้วยการพิมพ์จริง","propertyTips.cd-bar-height":'ความสูงเป้าหมายของแท่นดำเอง เป็นมิลลิเมตร (ไม่รวมข้อความด้านล่าง) ความละเอียดคือความกว้างทางกายภาพของหนึ่งโมดูล จึงแม่นยำเฉพาะจำนวนเต็มเท่านั้น ความกว้างแท่นมีสิทธิ์ก่อน: หากความสูงที่มีไม่พอตามที่ต้องการ ความสูงจะยอมตาม — ไม่เคยทำให้แท่นแคบลง (ความชัดของการพิมพ์ความร้อนขึ้นกับความกว้างแท่น) ต่างจาก "ความสูงสูงสุด" ที่จำกัดทั้งภาพรวมข้อความ',"propertyTips.cd-quiet-zone":"จำนวนโมดูลว่างรอบคิวอาร์โค้ด: 0 หมายถึงไม่มีขอบขาวและรหัสขยายเติมกรอบ (กระดาษขาวรอบนอกทำหน้าที่โซนเงียบ) ค่าที่ใหญ่ขึ้นทำให้ขอบกว้างและรหัสเล็กลงในกรอบ ค่าเริ่มต้น 0 ใช้ 4 สำหรับโซนเงียบตามที่ ISO/IEC 18004 แนะนำ"}};function sn(e){if(typeof e!="string")return"zh-CN";const t=e.trim();return t?/^en([-_]|$)/i.test(t)?"en-US":/^th([-_]|$)/i.test(t)?"th-TH":t:"zh-CN"}function Eh(){try{if(typeof navigator<"u"&&typeof navigator.language=="string")return sn(navigator.language)}catch{}return"zh-CN"}function E2(){const e=Da();return e.init({resources:{"zh-CN":{core:c2,constants:k2.constants,propertyTips:w2.propertyTips},"en-US":{core:h2,constants:y2.constants,propertyTips:x2.propertyTips},"th-TH":{core:b2,constants:v2.constants,propertyTips:P2.propertyTips}},lng:Eh(),fallbackLng:"zh-CN",ns:["core"],defaultNS:"core",keySeparator:!1,nsSeparator:!1,interpolation:{prefix:"{",suffix:"}",escapeValue:!1},returnNull:!1,returnEmptyString:!1,saveMissing:!0,missingKeyHandler:()=>{}}),e}var Qi=E2(),S2=new Set,Sh=new Set,T2=new Set;Qi.on("missingKey",(e,t,r)=>{Qi.exists(r,{lng:"zh-CN"})||S2.add(r)});function Th(){return Eh()}function M2(){return Th()}function ea(e,t){return typeof e=="string"?e:e==null?t:String(e)}function C2(e,t,r){const o=Qi.getFixedT(sn(e),Ch()),n=r?o(t,r):o(t);return ea(n,t)}function lr(e,t){return C2(Th(),e,t)}var Mh=new WeakMap;function _2(e){let t=Mh.get(e);return t||(t=Da(),t.init({resources:{},lng:"zh-CN",fallbackLng:!1,ns:["user"],defaultNS:"user",keySeparator:!1,nsSeparator:!1,interpolation:{prefix:"{",suffix:"}",escapeValue:!1},returnNull:!1,returnEmptyString:!1}),Mh.set(e,t)),t}function ta(e,t){const r=sn(e),o=Qi.getFixedT(r,Ch());if(!t)return(a,s)=>ea(s?o(a,s):o(a),a);const n=_2(t);n.addResourceBundle(r,"user",t,!0,!0);const i=n.getFixedT(r,"user");return(a,s)=>{const p=ea(s?i(a,s):i(a),"");return p!==""&&p!==a?p:ea(s?o(a,s):o(a),a)}}function Ch(){return["user",...T2,"constants","propertyTips","core"]}function _h(e){return Sh.add(e),()=>{Sh.delete(e)}}var Dh=Symbol.for("worm-print-platform.element-ui-registry.v1"),Ah=globalThis;function kl(){const e=Ah[Dh];if(e)return e;const t={entries:new Map,listeners:new Set,nextSeq:0};return Ah[Dh]=t,t}function D2(e){if(e)return kl().entries.get(e)?.ui}function A2(){const e=[...kl().entries.entries()];return e.sort((t,r)=>t[1].seq-r[1].seq),e.map(([t,r])=>({type:t,ui:r.ui}))}function O2(e){const t=kl();return t.listeners.add(e),()=>{t.listeners.delete(e)}}function g(e,t={},r=[]){return{tag:e,props:t,children:r}}var yl="http://www.w3.org/2000/svg",R2=new Set(["draggable","contenteditable","spellcheck"]),I2=new Set(["indeterminate"]);function L2(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="g"}function B2(e){return e instanceof Element&&e.namespaceURI===yl}function rt(e,t){if(typeof e=="string"){const a=document.createTextNode(e);return t.appendChild(a),a}if(e instanceof Node)return t.appendChild(e),e;const{tag:r,props:o,children:n}=e,i=L2(r)||B2(t)?document.createElementNS(yl,r):document.createElement(r);for(const[a,s]of Object.entries(o))if(!(s==null||s===!1))if(a==="class")i.setAttribute("class",String(s));else if(a==="style")typeof s=="string"?i.style.cssText=s:Object.assign(i.style,s);else if(a==="html")i.innerHTML=String(s);else if(a==="text")i.textContent=String(s);else if(a.startsWith("on")&&typeof s=="function")i.addEventListener(a.slice(2).toLowerCase(),s);else if(a==="dataset")for(const[p,l]of Object.entries(s))i.dataset[p]=l;else I2.has(a)?i[a]=!0:typeof s=="boolean"?s&&i.setAttribute(a,R2.has(a)?"true":""):i.setAttribute(a,String(s));for(const a of n)rt(a,i);return t.appendChild(i),i}function Oh(e){for(;e.firstChild;)e.removeChild(e.firstChild)}var N2=yl;function ln(){return{paperSize:"A4",orientation:"portrait",unit:"mm",margins:{top:10,right:10,bottom:10,left:10},header:{height:10,elements:[]},footer:{height:10,elements:[]},elements:[],watermark:{}}}const F2="开启拼版后只能有一个设计页面",Rh=()=>lr("store.tilingSinglePage");function vl(e){const t=(r,o)=>(r??[]).map(n=>{const i={...n.options};return(n.printElementType?.type??n.type)==="table"&&Eo(i),{id:n.id||Xr(),zone:o,options:i,printElementType:{...n.printElementType}}});return{...e,margins:{...e.margins},header:{height:e.header?.height??10,elements:[]},footer:{height:e.footer?.height??10,elements:[]},guides:[...e.guides??[]],elements:[...t(e.elements??[],"content"),...t(e.header?.elements??[],"header"),...t(e.footer?.elements??[],"footer")]}}function Ih(e){const t=e.elements,r=o=>t.filter(n=>(n.zone||"content")===o).map(n=>({id:n.id,type:n.printElementType.type,options:{...n.options},printElementType:{...n.printElementType}}));return{unit:"mm",...e,header:{...e.header,elements:r("header")},footer:{...e.footer,elements:r("footer")},elements:r("content"),guides:[...e.guides??[]]}}function Lh(e){const t=(o,n)=>{const i=vl(B0(o));return i.name||(i.name=`页面 ${n+1}`),i};if(!e)return[t(ln(),0)];const r=Array.isArray(e.pages)?e.pages:[e];return r.length?r.map(t):[t(ln(),0)]}const so=e=>JSON.parse(JSON.stringify(e));class Bh{scale=100;showRuler=!0;showGrid=!0;snapToGrid=!1;showTableGhostBorder=!0;dirty=!1;pages;activePageIndex=0;fields;selectedIds=new Set;previewIds=new Set;tableSelection=null;draggingIds=new Set;adsorbGuides=[];live=new Map;clipboard=[];moveSessionActive=!1;moveTimer=null;dragBefore=null;undoStack=[];redoStack=[];listeners=new Set;align=Oy();group=Ry();constructor(t={}){if(this.pages=Lh(t.initialTemplate),this.fields=t.initialFields??[],t.initialElements?.length){const r=this.pages[0];r.elements=[...r.elements,...t.initialElements]}}subscribe(t){return this.listeners.add(t),()=>this.listeners.delete(t)}emit(t=!0){t&&(this.dirty=!0);for(const r of[...this.listeners])r()}get templateData(){return this.pages[this.activePageIndex]}set templateData(t){this.pages[this.activePageIndex]=t}get elements(){return this.templateData.elements.map(t=>this.live.get(t.id)??t)}get tilingEnabled(){return this.pages.some(t=>t.tiling?.enabled===!0)}switchPage(t){t<0||t>=this.pages.length||(this.activePageIndex=t,this.resetSelection(),this.emit(!1))}addPage(){if(this.tilingEnabled){window.alert(Rh());return}this.recordHistory();const t=this.pages[this.activePageIndex]??ln();this.pages.push(vl({...ln(),paperSize:t.paperSize,orientation:t.orientation,outputRotation:t.outputRotation,customWidth:t.customWidth,customHeight:t.customHeight,name:this.nextDefaultPageName()})),this.switchPage(this.pages.length-1),this.emit()}nextDefaultPageName(){const t=new Set(this.pages.map(o=>o.name));let r=this.pages.length+1;for(;t.has(`页面 ${r}`);)r++;return`页面 ${r}`}duplicatePage(t){if(this.tilingEnabled){window.alert(Rh());return}this.recordHistory();const r=so(this.pages[t]);r.name=`${r.name??`页面 ${t+1}`} 副本`,r.elements=r.elements.map(o=>({...o,id:Xr()})),this.pages.splice(t+1,0,r),this.switchPage(t+1),this.emit()}deletePage(t){this.pages.length<=1||(this.recordHistory(),this.pages.splice(t,1),this.activePageIndex=Math.max(0,Math.min(this.activePageIndex,this.pages.length-1)),this.resetSelection(),this.emit())}renamePage(t,r){this.recordHistory(),this.pages[t].name=r,this.emit()}movePage(t,r){if(r<0||r>=this.pages.length||t===r)return;this.recordHistory();const[o]=this.pages.splice(t,1);this.pages.splice(r,0,o),this.activePageIndex=r,this.emit()}onSelectionChanged;setSelection(t){this.selectedIds=t,this.onSelectionChanged?.(),this.emit(!1)}select(t){this.setSelection(new Set(t))}selectOne(t,r=!1){if(r){const o=new Set(this.selectedIds);o.has(t)?o.delete(t):o.add(t),this.setSelection(o)}else this.setSelection(new Set([t]))}clearSelection(){this.setSelection(new Set)}selectElement(t,r=!1){if(r){this.selectOne(t,!0);return}this.setSelection(new Set(this.group.getGroupedIds(this.elements,t)))}selectAll(){this.setSelection(new Set(this.elements.map(t=>t.id)))}get selectedElements(){return this.elements.filter(t=>this.selectedIds.has(t.id))}get selectedElement(){const t=this.selectedIds.values().next().value;return t?this.elements.find(r=>r.id===t)??null:null}resetSelection(){this.selectedIds=new Set,this.tableSelection=null,this.onSelectionChanged?.()}setTableSelection(t){this.tableSelection=t,this.emit(!1)}setPreview(t){this.previewIds=t,this.emit(!1)}commitPreview(){this.previewIds=new Set,this.emit(!1)}addGuide(t,r){const o=this.templateData.guides??[];this.templateData.guides=[...o,{id:Xr(),type:t,position:Math.round(r*10)/10}],this.emit()}moveGuide(t,r){const o=this.templateData.guides??[];this.templateData.guides=o.map(n=>n.id===t?{...n,position:Math.round(r*10)/10}:n),this.emit(!1)}removeGuide(t){this.templateData.guides=(this.templateData.guides??[]).filter(r=>r.id!==t),this.emit()}addElement(t,r={},o){const n=ts(t,r);return o&&!this.placeAtDropPoint(n,o)||(this.recordHistory(),this.templateData.elements.push(n),this.select(new Set([n.id])),this.emit()),n}addFieldElement(t,r={},o,n=!1){const i=n?Dy(t):_y(t);return Object.assign(i.options,r),o&&!this.placeAtDropPoint(i,o)||(this.recordHistory(),this.templateData.elements.push(i),this.select(new Set([i.id])),this.emit()),i}placeAtDropPoint(t,r){const o=this.templateData,n=ac(o,r.x,r.y);if(n!=="content"&&!ic(t.printElementType.type))return alert("该元素类型不能放入页眉/页脚"),!1;const i=ss(o)[n];return t.zone=n,t.options.left=r.x-i.left,t.options.top=r.y-i.top,n!=="content"&&ls(t,i),!0}deleteSelected(){this.selectedIds.size&&(this.recordHistory(),this.templateData.elements=this.templateData.elements.filter(t=>!this.selectedIds.has(t.id)),this.selectedIds=new Set,this.emit())}livePatch(t,r){const o=this.templateData.elements.find(i=>i.id===t);if(!o)return;const n=this.live.get(t)??o;this.live.set(t,{...n,options:{...n.options,...r}})}commitLive(){if(!this.live.size)return;this.recordHistory();const t=this.templateData.elements;for(const[r,o]of this.live){const n=t.find(i=>i.id===r);n&&Object.assign(n.options,o.options)}this.live.clear(),this.emit()}dragIds(t){const r=this.templateData.elements.find(o=>o.id===t);return!r||r.options.locked?[]:Array.from(this.group.getGroupedIds(this.elements,t))}discardLive(){this.live.clear()}dragStart(){this.dragBefore=new Map(this.elements.map(t=>[t.id,this.geoSig(t)]))}dragStop(){const t=this.dragBefore;if(!t)return;this.dragBefore=null;let r=!1;for(const o of this.elements){const n=t.get(o.id);!n||n===this.geoSig(o)||o1(o,this.templateData).rejected&&(r=!0)}r&&alert("该元素类型不能放入页眉/页脚"),this.emit()}geoSig(t){return`${t.zone||"content"}:${t.options.left},${t.options.top},${t.options.width},${t.options.height}`}updateElement(t,r,o=!0){o&&this.recordHistory();const n=this.templateData.elements.find(i=>i.id===t);n&&(Object.assign(n.options,r),n.printElementType.type==="table"&&Eo(n.options),this.emit())}updateTemplateData(t){this.recordHistory(),Object.assign(this.templateData,t);for(const r of["paperSize","customWidth","customHeight"])if(r in t)for(const o of this.pages)Object.assign(o,{[r]:t[r]});this.emit()}moveLayer(t){if(!this.selectedIds.size)return;this.recordHistory();const r=this.templateData.elements,o=r.filter(i=>this.selectedIds.has(i.id)),n=r.filter(i=>!this.selectedIds.has(i.id));if(t==="top")this.templateData.elements=[...n,...o];else if(t==="bottom")this.templateData.elements=[...o,...n];else{const i=r.findIndex(p=>this.selectedIds.has(p.id)),a=t==="up"?i+1:i-1;if(a<0||a>=r.length)return;const s=[...r];[s[i],s[a]]=[s[a],s[i]],this.templateData.elements=s}this.emit()}alignSelected(t){this.selectedIds.size<2||(this.recordHistory(),this.align.align(this.elements.filter(r=>this.selectedIds.has(r.id)),t),this.emit())}groupSelected(){this.selectedIds.size<2||(this.recordHistory(),this.templateData.elements=this.group.group(this.elements,this.selectedIds),this.emit())}ungroupSelected(){this.selectedIds.size&&(this.recordHistory(),this.templateData.elements=this.group.ungroup(this.elements,this.selectedIds),this.emit())}copy(){this.clipboard=so(this.selectedElements),this.emit(!1)}cutSelected(){this.copy(),this.deleteSelected()}paste(t=10){if(!this.clipboard.length)return;this.recordHistory();const r=new Map;for(const i of this.clipboard){const a=i.options.groupId;a&&r.set(a,(r.get(a)??0)+1)}const o=new Map;for(const[i,a]of r)o.set(i,a>=2?Au():void 0);const n=this.templateData.elements;for(const i of this.clipboard){const a=so(i);a.id=Xr(),a.options.left+=t,a.options.top+=t,a.options.groupId=a.options.groupId?o.get(a.options.groupId):void 0,n.push(a)}this.emit()}duplicateSelected(){if(this.copy(),!this.clipboard.length)return;this.paste(15);const t=this.templateData.elements;this.selectOne(t[t.length-this.clipboard.length].id)}get hasClipboard(){return this.clipboard.length>0}moveSelected(t,r){const o=this.selectedElements.filter(n=>!n.options.locked);if(o.length){this.moveSessionActive||(this.moveSessionActive=!0,this.recordHistory());for(const n of o)n.options.left+=t,n.options.top+=r;this.moveTimer&&clearTimeout(this.moveTimer),this.moveTimer=setTimeout(()=>{this.moveSessionActive=!1,this.moveTimer=null},300),this.emit()}}cloneElement(t){this.recordHistory(),this.templateData.elements.push(t),this.selectedIds=new Set([t.id]),this.emit()}recordHistory(){this.undoStack.push({pages:so(this.pages),activePageIndex:this.activePageIndex}),this.undoStack.length>100&&this.undoStack.shift(),this.redoStack=[]}get canUndo(){return this.undoStack.length>0}get canRedo(){return this.redoStack.length>0}undo(){const t=this.undoStack.pop();t&&(this.redoStack.push({pages:so(this.pages),activePageIndex:this.activePageIndex}),this.pages=t.pages,this.activePageIndex=Math.min(t.activePageIndex,t.pages.length-1),this.resetSelection(),this.emit())}redo(){const t=this.redoStack.pop();t&&(this.undoStack.push({pages:so(this.pages),activePageIndex:this.activePageIndex}),this.pages=t.pages,this.activePageIndex=Math.min(t.activePageIndex,t.pages.length-1),this.resetSelection(),this.emit())}resetZoom(){this.setScale(100)}setScale(t,r=Vn){this.scale=Math.max(r,Math.round(t)),this.emit(!1)}getTemplateJson(){const t=this.pages.map(Ih),r=t.length===1?t[0]:{version:1,pages:t};return JSON.stringify(r)}loadTemplate(t){this.pages=Lh(t),this.activePageIndex=0,this.resetSelection(),this.recordHistory(),this.emit()}get paperSize(){return ir(this.templateData)}}const Rr=Symbol("mixed"),wl=new Set(["text","longText"]),$2=["top","right","bottom","left"],z2={on:!0,off:!1,mixed:Rr};function Nh(e){const t=Kd(e),r={};for(const o of $2)r[o]=z2[t[o]];return r}const H2=["fontFamily","fontSize","fontWeight","color","textAlign","verticalAlign","textDecoration"];class U2{constructor(t){this.store=t}store;borderStyle="solid";borderWidth=.75;borderColor="#333333";borderMixed={style:!1,width:!1,color:!1};borderDraftKey="";get borderMixedAny(){return this.borderMixed.style||this.borderMixed.width||this.borderMixed.color}painterActive=!1;painterLocked=!1;painterSource=null;painterSnapshot=null;get selectedElements(){return this.store.elements.filter(t=>this.store.selectedIds.has(t.id)&&!t.options.locked)}get tableElement(){const t=this.store.tableSelection;return t?this.store.elements.find(r=>r.id===t.elementId)??null:null}get context(){return this.store.tableSelection&&this.tableElement?"cells":this.selectedElements.length>0||this.store.selectedIds.size>0?"elements":"none"}get targetCells(){const t=this.store.tableSelection,r=this.tableElement?.options.tableRows;if(!t||!r)return[];const o=[];for(let n=t.r1;n<=t.r2;n++)for(let i=t.c1;i<=t.c2;i++){const a=r[n]?.cells[i];a&&!a.merged&&o.push(a)}return o}get textTargets(){return this.selectedElements.filter(t=>wl.has(t.printElementType.type))}get fontEditable(){return this.context==="cells"?this.targetCells.length>0:this.context!=="elements"?!1:this.selectedElements.length>0&&this.textTargets.length===this.selectedElements.length}get styleTargets(){return this.context==="cells"?this.targetCells:this.textTargets.map(t=>t.options)}pick(t){if(!t.length)return;const r=t[0];return t.every(o=>o===r)?r:Rr}hasToken(t,r){return(t??"").split(/\s+/).includes(r)}get values(){const t=this.styleTargets;if(!t.length)return{fontFamily:void 0,fontSize:void 0,color:void 0,backgroundColor:void 0,textAlign:void 0,verticalAlign:void 0,bold:!1,underline:!1,strike:!1};const r=t.map(n=>n.fontWeight==="bold"||n.fontWeight==="bolder"),o=t.map(n=>n.textDecoration);return{fontFamily:this.pick(t.map(n=>n.fontFamily)),fontSize:this.pick(t.map(n=>n.fontSize)),color:this.pick(t.map(n=>n.color)),backgroundColor:this.pick(t.map(n=>n.backgroundColor)),textAlign:this.pick(t.map(n=>this.context==="cells"?n.align:n.textAlign)),verticalAlign:this.pick(t.map(n=>this.context==="cells"?n.valign:n.verticalAlign)),bold:r.every(Boolean)?!0:r.some(Boolean)?Rr:!1,underline:o.map(n=>this.hasToken(n,"underline")).every(Boolean)?!0:o.some(n=>this.hasToken(n,"underline"))?Rr:!1,strike:o.map(n=>this.hasToken(n,"line-through")).every(Boolean)?!0:o.some(n=>this.hasToken(n,"line-through"))?Rr:!1}}commit(){this.store.recordHistory(),this.store.emit()}writeCells(t){const r=this.targetCells;r.length&&(r.forEach(t),this.commit())}applyStyle(t){if(this.context==="cells"){this.writeCells(s=>{"fontFamily"in t&&(s.fontFamily=t.fontFamily),"fontSize"in t&&(s.fontSize=t.fontSize),"color"in t&&(s.color=t.color),"backgroundColor"in t&&(s.backgroundColor=t.backgroundColor),"textAlign"in t&&(s.align=t.textAlign),"verticalAlign"in t&&(s.valign=t.verticalAlign)});return}const r=this.textTargets,o=this.selectedElements,i=["fontFamily","fontSize","color","textAlign","verticalAlign"].some(s=>s in t),a="backgroundColor"in t;!(r.length&&i)&&!(o.length&&a)||(r.forEach(s=>{const p=s.options;"fontFamily"in t&&(p.fontFamily=t.fontFamily),"fontSize"in t&&(p.fontSize=t.fontSize),"color"in t&&(p.color=t.color),"textAlign"in t&&(p.textAlign=t.textAlign),"verticalAlign"in t&&(p.verticalAlign=t.verticalAlign)}),a&&o.forEach(s=>{s.options.backgroundColor=t.backgroundColor}),this.commit())}toggleBold(){if(this.context==="cells"){const o=this.values.bold!==!0;this.writeCells(n=>{n.fontWeight=o?"bold":void 0});return}const t=this.values.bold!==!0,r=this.textTargets;r.length&&(r.forEach(o=>{o.options.fontWeight=t?"bold":"normal"}),this.commit())}toggleDecoration(t){if(this.context==="cells")return;const r=this.textTargets;if(!r.length)return;const o=this.values[t==="underline"?"underline":"strike"]!==!0;r.forEach(n=>{const i=(n.options.textDecoration??"").split(/\s+/).filter(Boolean),a=i.indexOf(t);o&&a<0&&i.push(t),!o&&a>=0&&i.splice(a,1),n.options.textDecoration=i.length?i.join(" "):void 0}),this.commit()}toggleUnderline(){this.toggleDecoration("underline")}toggleStrike(){this.toggleDecoration("line-through")}syncBorderDraft(){if(this.context!=="cells"){this.borderDraftKey&&(this.borderDraftKey="",this.borderStyle="solid",this.borderWidth=.75,this.borderColor="#333333",this.borderMixed={style:!1,width:!1,color:!1});return}const t=this.store.tableSelection,r=this.tableElement?.options.tableRows;if(!t||!r)return;const o=`cells:${t.elementId}:${t.r1}:${t.c1}:${t.r2}:${t.c2}`;if(o===this.borderDraftKey)return;if(this.borderDraftKey=o,La(r,t).mode==="multi"){this.borderStyle="solid",this.borderWidth=.75,this.borderColor="#333333",this.borderMixed={style:!1,width:!1,color:!1};return}const n=ad(r,t);if(n.style===void 0&&n.width===void 0&&n.color===void 0){this.borderMixed={style:!1,width:!1,color:!1},this.borderStyle=null,this.borderWidth=0,this.borderColor="#333333";return}this.borderMixed={style:n.style==="mixed",width:n.width==="mixed",color:n.color==="mixed"},this.borderMixed.style?this.borderStyle=null:n.style===void 0?this.borderStyle="solid":n.style==="none"?this.borderStyle=null:this.borderStyle=n.style,this.borderWidth=this.borderMixed.width?void 0:typeof n.width=="number"?n.width:.75,this.borderColor=this.borderMixed.color?void 0:typeof n.color=="string"?n.color:"#333333"}borderSpec(){const t=this.borderStyle??(this.borderMixed.style?"solid":"none");return{width:this.borderWidth??.75,style:t,color:this.borderColor??"#333333"}}setBorderWidth(t){this.borderWidth=t,this.borderMixed.width=!1}setBorderColor(t){this.borderColor=t,this.borderMixed.color=!1}settleBorderDraft(){this.context==="cells"&&(this.borderMixed.style&&(this.borderStyle="solid",this.borderMixed.style=!1),this.borderMixed.width&&(this.borderWidth=.75,this.borderMixed.width=!1),this.borderMixed.color&&(this.borderColor="#333333",this.borderMixed.color=!1))}toggleBorderStyle(t){const r=this.borderStyle===t?null:t;this.borderMixed.style=!1,this.borderStyle=r,r===null?this.borderWidth=0:this.borderWidth===0&&(this.borderWidth=.75)}applyElementBorder(t,r){const o=this.selectedElements;o.length&&(o.forEach(n=>{Xd(n.options,t,r)}),this.commit())}applyCellBorderPreset(t,r){const o=this.store.tableSelection,n=this.tableElement?.options.tableRows;!o||!n||(nd(n,{r1:o.r1,c1:o.c1,r2:o.r2,c2:o.c2},t,r),this.commit())}applyCellBorderEdges(t,r,o){this.writeCells(n=>{for(const i of t)id(n,i,o?r:null)})}get cellEdges(){if(this.context!=="cells")return null;const t=this.targetCells;return t.length?Nh(t.map(r=>r.borders)):null}toggleCellEdge(t,r){const o=this.cellEdges?.[t]!==!0;this.applyCellBorderEdges([t],r,o)}get elementEdges(){if(this.context!=="elements")return null;const t=this.selectedElements;return t.length?Nh(t.map(r=>$0(r.options))):null}toggleElementEdge(t,r){const o=this.selectedElements;if(!o.length)return;const n=this.elementEdges?.[t]!==!0;o.forEach(i=>is(i.options,t,n,r)),this.commit()}applyBorderPreset(t){const r=this.borderStyle===null;if(this.context==="cells"){const o=r&&!this.borderMixed.style;this.applyCellBorderPreset(o?"none":t,this.borderSpec()),this.settleBorderDraft()}else this.applyElementBorder(r||t==="none"?"none":"all",this.borderSpec())}applyEdge(t){if(this.borderStyle===null&&!this.borderMixed.style){this.context==="cells"?(this.applyCellBorderEdges([t],this.borderSpec(),!1),this.settleBorderDraft()):this.clearElementEdge(t);return}this.context==="cells"?(this.toggleCellEdge(t,this.borderSpec()),this.settleBorderDraft()):this.toggleElementEdge(t,this.borderSpec())}clearElementEdge(t){const r=this.selectedElements;r.length&&(r.forEach(o=>is(o.options,t,!1)),this.commit())}edgeOn(t){return(this.context==="cells"?this.cellEdges:this.elementEdges)?.[t]===!0}get painterCapturable(){return this.selectedElements.length===1}clonePainterBorders(t){if(!t)return;const r={};for(const o of Ao){const n=t[o];n&&(r[o]={...n})}return r}pickPainterSource(t=!1){const r=this.selectedElements[0];if(!r)return!1;const o=r.options,n=r.printElementType.type;return this.painterSnapshot={text:wl.has(n)?Object.fromEntries(H2.map(i=>[i,o[i]])):null,backgroundColor:o.backgroundColor,border:$n(n)?{borderWidth:o.borderWidth,borderStyle:o.borderStyle,borderColor:o.borderColor,borders:this.clonePainterBorders(o.borders)}:null},this.painterSource=r.id,this.painterActive=!0,this.painterLocked=t,!0}cancelPainter(){this.painterActive=!1,this.painterLocked=!1,this.painterSource=null,this.painterSnapshot=null}applyPainter(t){const r=this.painterSnapshot;if(!r||t.options.locked||t.id===this.painterSource)return!1;const o=t.options,n=t.printElementType.type;return r.text&&wl.has(n)&&Object.assign(o,r.text),o.backgroundColor=r.backgroundColor,r.border&&$n(n)&&(o.borderWidth=r.border.borderWidth,o.borderStyle=r.border.borderStyle,o.borderColor=r.border.borderColor,o.borders=this.clonePainterBorders(r.border.borders)),!0}painterSyncSelection(){if(!this.painterActive||!this.painterSnapshot)return;const t=this.selectedElements;if(!t.length){this.cancelPainter();return}let r=!1;t.forEach(o=>{r=this.applyPainter(o)||r}),r&&(this.commit(),this.painterLocked||this.cancelPainter())}handlePainterKeydown(t){if(t.key!=="Escape"||!this.painterActive)return;const r=t.target?.tagName;r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||this.cancelPainter()}}const q2={AlignCenterHorizontal:'<path d="M2 12h20" /><path d="M10 16v4a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-4" /><path d="M10 8V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4" /><path d="M20 16v1a2 2 0 0 1-2 2h-2a2 2 0 0 1-2-2v-1" /><path d="M14 8V7c0-1.1.9-2 2-2h2a2 2 0 0 1 2 2v1" />',AlignCenterVertical:'<path d="M12 2v20" /><path d="M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4" /><path d="M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4" /><path d="M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1" /><path d="M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1" />',AlignEndHorizontal:'<rect width="6" height="16" x="4" y="2" rx="2" /><rect width="6" height="9" x="14" y="9" rx="2" /><path d="M22 22H2" />',AlignEndVertical:'<rect width="16" height="6" x="2" y="4" rx="2" /><rect width="9" height="6" x="9" y="14" rx="2" /><path d="M22 22V2" />',AlignHorizontalSpaceBetween:'<rect width="6" height="14" x="3" y="5" rx="2" /><rect width="6" height="10" x="15" y="7" rx="2" /><path d="M3 2v20" /><path d="M21 2v20" />',AlignStartHorizontal:'<rect width="6" height="16" x="4" y="6" rx="2" /><rect width="6" height="9" x="14" y="6" rx="2" /><path d="M22 2H2" />',AlignStartVertical:'<rect width="9" height="6" x="6" y="14" rx="2" /><rect width="16" height="6" x="6" y="4" rx="2" /><path d="M2 2v20" />',AlignVerticalSpaceBetween:'<rect width="14" height="6" x="5" y="15" rx="2" /><rect width="10" height="6" x="7" y="3" rx="2" /><path d="M2 21h20" /><path d="M2 3h20" />',ArrowDown:'<path d="M12 5v14" /><path d="m19 12-7 7-7-7" />',ArrowDownToLine:'<path d="M12 17V3" /><path d="m6 11 6 6 6-6" /><path d="M19 21H5" />',ArrowUp:'<path d="m5 12 7-7 7 7" /><path d="M12 19V5" />',ArrowUpToLine:'<path d="M5 3h14" /><path d="m18 13-6-6-6 6" /><path d="M12 7v14" />',Barcode:'<path d="M3 5v14" /><path d="M8 5v14" /><path d="M12 5v14" /><path d="M17 5v14" /><path d="M21 5v14" />',Bold:'<path d="M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8" />',ChartArea:'<path d="M3 3v16a2 2 0 0 0 2 2h16" /><path d="M7 11.207a.5.5 0 0 1 .146-.353l2-2a.5.5 0 0 1 .708 0l3.292 3.292a.5.5 0 0 0 .708 0l4.292-4.292a.5.5 0 0 1 .854.353V16a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z" />',ChartBar:'<path d="M3 3v16a2 2 0 0 0 2 2h16" /><path d="M7 16h8" /><path d="M7 11h12" /><path d="M7 6h3" />',ChartColumn:'<path d="M3 3v16a2 2 0 0 0 2 2h16" /><path d="M18 17V9" /><path d="M13 17V5" /><path d="M8 17v-3" />',ChartLine:'<path d="M3 3v16a2 2 0 0 0 2 2h16" /><path d="m19 9-5 5-4-4-3 3" />',ChartPie:'<path d="M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z" /><path d="M21.21 15.89A10 10 0 1 1 8 2.83" />',ChartScatter:'<circle cx="7.5" cy="7.5" r=".5" fill="currentColor" /><circle cx="18.5" cy="5.5" r=".5" fill="currentColor" /><circle cx="11.5" cy="11.5" r=".5" fill="currentColor" /><circle cx="7.5" cy="16.5" r=".5" fill="currentColor" /><circle cx="17.5" cy="14.5" r=".5" fill="currentColor" /><path d="M3 3v16a2 2 0 0 0 2 2h16" />',Check:'<path d="M20 6 9 17l-5-5" />',ChevronDown:'<path d="m6 9 6 6 6-6" />',ChevronsLeft:'<path d="m11 17-5-5 5-5" /><path d="m18 17-5-5 5-5" />',ChevronsRight:'<path d="m6 17 5-5-5-5" /><path d="m13 17 5-5-5-5" />',ChevronsUpDown:'<path d="m7 15 5 5 5-5" /><path d="m7 9 5-5 5 5" />',Circle:'<circle cx="12" cy="12" r="10" />',ClipboardPaste:'<path d="M11 14h10" /><path d="M16 4h2a2 2 0 0 1 2 2v1.344" /><path d="m17 18 4-4-4-4" /><path d="M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113" /><rect x="8" y="2" width="8" height="4" rx="1" />',Code:'<path d="m16 18 6-6-6-6" /><path d="m8 6-6 6 6 6" />',Copy:'<rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />',Donut:'<path d="M20.5 10a2.5 2.5 0 0 1-2.4-3H18a2.95 2.95 0 0 1-2.6-4.4 10 10 0 1 0 6.3 7.1c-.3.2-.8.3-1.2.3" /><circle cx="12" cy="12" r="3" />',Ellipsis:'<circle cx="12" cy="12" r="1" /><circle cx="19" cy="12" r="1" /><circle cx="5" cy="12" r="1" />',Eye:'<path d="M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" /><circle cx="12" cy="12" r="3" />',FileText:'<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z" /><path d="M14 2v5a1 1 0 0 0 1 1h5" /><path d="M10 9H8" /><path d="M16 13H8" /><path d="M16 17H8" />',Funnel:'<path d="M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z" />',Gauge:'<path d="m12 14 4-4" /><path d="M3.34 19a10 10 0 1 1 17.32 0" />',Grid3x3:'<rect width="18" height="18" x="3" y="3" rx="2" /><path d="M3 9h18" /><path d="M3 15h18" /><path d="M9 3v18" /><path d="M15 3v18" />',Group:'<path d="M3 7V5c0-1.1.9-2 2-2h2" /><path d="M17 3h2c1.1 0 2 .9 2 2v2" /><path d="M21 17v2c0 1.1-.9 2-2 2h-2" /><path d="M7 21H5c-1.1 0-2-.9-2-2v-2" /><rect width="7" height="5" x="7" y="7" rx="1" /><rect width="7" height="5" x="10" y="12" rx="1" />',Image:'<rect width="18" height="18" x="3" y="3" rx="2" ry="2" /><circle cx="9" cy="9" r="2" /><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" />',Layers:'<path d="M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z" /><path d="M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12" /><path d="M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17" />',List:'<path d="M3 5h.01" /><path d="M3 12h.01" /><path d="M3 19h.01" /><path d="M8 5h13" /><path d="M8 12h13" /><path d="M8 19h13" />',ListTree:'<path d="M8 5h13" /><path d="M13 12h8" /><path d="M13 19h8" /><path d="M3 10a2 2 0 0 0 2 2h3" /><path d="M3 5v12a2 2 0 0 0 2 2h3" />',Maximize:'<path d="M8 3H5a2 2 0 0 0-2 2v3" /><path d="M21 8V5a2 2 0 0 0-2-2h-3" /><path d="M3 16v3a2 2 0 0 0 2 2h3" /><path d="M16 21h3a2 2 0 0 0 2-2v-3" />',Minus:'<path d="M5 12h14" />',PaintBucket:'<path d="M11 7 6 2" /><path d="M18.992 12H2.041" /><path d="M21.145 18.38A3.34 3.34 0 0 1 20 16.5a3.3 3.3 0 0 1-1.145 1.88c-.575.46-.855 1.02-.855 1.595A2 2 0 0 0 20 22a2 2 0 0 0 2-2.025c0-.58-.285-1.13-.855-1.595" /><path d="m8.5 4.5 2.148-2.148a1.205 1.205 0 0 1 1.704 0l7.296 7.296a1.205 1.205 0 0 1 0 1.704l-7.592 7.592a3.615 3.615 0 0 1-5.112 0l-3.888-3.888a3.615 3.615 0 0 1 0-5.112L5.67 7.33" />',Paintbrush:'<path d="m14.622 17.897-10.68-2.913" /><path d="M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z" /><path d="M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15" />',QrCode:'<rect width="5" height="5" x="3" y="3" rx="1" /><rect width="5" height="5" x="16" y="3" rx="1" /><rect width="5" height="5" x="3" y="16" rx="1" /><path d="M21 16h-3a2 2 0 0 0-2 2v3" /><path d="M21 21v.01" /><path d="M12 7v3a2 2 0 0 1-2 2H7" /><path d="M3 12h.01" /><path d="M12 3h.01" /><path d="M12 16v.01" /><path d="M16 12h1" /><path d="M21 12v.01" /><path d="M12 21v-1" />',Radar:'<path d="M19.07 4.93A10 10 0 0 0 6.99 3.34" /><path d="M4 6h.01" /><path d="M2.29 9.62A10 10 0 1 0 21.31 8.35" /><path d="M16.24 7.76A6 6 0 1 0 8.23 16.67" /><path d="M12 18h.01" /><path d="M17.99 11.66A6 6 0 0 1 15.77 16.67" /><circle cx="12" cy="12" r="2" /><path d="m13.41 10.59 5.66-5.66" />',Redo2:'<path d="m15 14 5-5-5-5" /><path d="M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13" />',RotateCcw:'<path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" /><path d="M3 3v5h5" />',SeparatorVertical:'<path d="M12 3v18" /><path d="m16 16 4-4-4-4" /><path d="m8 8-4 4 4 4" />',Shapes:'<path d="M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z" /><rect x="3" y="14" width="7" height="7" rx="1" /><circle cx="17.5" cy="17.5" r="3.5" />',Square:'<rect width="18" height="18" x="3" y="3" rx="2" />',Strikethrough:'<path d="M16 4H9a3 3 0 0 0-2.83 4" /><path d="M14 12a4 4 0 0 1 0 8H6" /><line x1="4" x2="20" y1="12" y2="12" />',Table:'<path d="M12 3v18" /><rect width="18" height="18" x="3" y="3" rx="2" /><path d="M3 9h18" /><path d="M3 15h18" />',Table2:'<path d="M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18" />',TextAlignCenter:'<path d="M21 5H3" /><path d="M17 12H7" /><path d="M19 19H5" />',TextAlignEnd:'<path d="M21 5H3" /><path d="M21 12H9" /><path d="M21 19H7" />',TextAlignJustify:'<path d="M3 5h18" /><path d="M3 12h18" /><path d="M3 19h18" />',TextAlignStart:'<path d="M21 5H3" /><path d="M15 12H3" /><path d="M17 19H3" />',Trash2:'<path d="M10 11v6" /><path d="M14 11v6" /><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6" /><path d="M3 6h18" /><path d="M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />',Type:'<path d="M12 4v16" /><path d="M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2" /><path d="M9 20h6" />',Underline:'<path d="M6 4v6a6 6 0 0 0 12 0V4" /><line x1="4" x2="20" y1="20" y2="20" />',Undo2:'<path d="M9 14 4 9l5-5" /><path d="M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11" />',Ungroup:'<rect width="8" height="6" x="5" y="4" rx="1" /><rect width="8" height="6" x="11" y="14" rx="1" />',ZoomIn:'<circle cx="11" cy="11" r="8" /><line x1="21" x2="16.65" y1="21" y2="16.65" /><line x1="11" x2="11" y1="8" y2="14" /><line x1="8" x2="14" y1="11" y2="11" />',ZoomOut:'<circle cx="11" cy="11" r="8" /><line x1="21" x2="16.65" y1="21" y2="16.65" /><line x1="8" x2="14" y1="11" y2="11" />'};function je(e,t=15,r){const o=q2[e];return o?`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}"${r?` class="${r}"`:""} viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${o}</svg>`:""}var Ir=null;function xl(e){const t=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!t)return null;const r=t[1],o=r.length===3?r.split("").map(n=>n+n).join(""):r;return{r:Number.parseInt(o.slice(0,2),16),g:Number.parseInt(o.slice(2,4),16),b:Number.parseInt(o.slice(4,6),16)}}function Pl(e){const t=xl(e);return t?Fh(t):"#000000"}function Fh({r:e,g:t,b:r}){return`#${[e,t,r].map(o=>Math.round(pn(o/255)*255).toString(16).padStart(2,"0")).join("")}`}function j2(e,t,r){const o=e/255,n=t/255,i=r/255,a=Math.max(o,n,i),s=Math.min(o,n,i),p=a-s;let l=0;return p!==0&&(a===o?l=(n-i)/p%6:a===n?l=(i-o)/p+2:l=(o-n)/p+4,l*=60,l<0&&(l+=360)),{h:l,s:a===0?0:p/a,v:a}}function W2(e,t,r){const o=r*t,n=(e%360+360)%360/60,i=o*(1-Math.abs(n%2-1)),[a,s,p]=n<1?[o,i,0]:n<2?[i,o,0]:n<3?[0,o,i]:n<4?[0,i,o]:n<5?[i,0,o]:[o,0,i],l=r-o;return{r:(a+l)*255,g:(s+l)*255,b:(p+l)*255}}function V2(e){return((Number.isFinite(e)?e:0)%360+360)%360}function pn(e){return Math.min(1,Math.max(0,Number.isFinite(e)?e:0))}function G2(e){const t=e.translator??lr,r=e.title??t("colorPicker.pickColor");return g("button",{type:"button",class:`preset-color-trigger${e.triggerClass?` ${e.triggerClass}`:""}`,"aria-expanded":"false","aria-haspopup":"dialog",title:r,onClick:o=>{const n=o.currentTarget??o.target,i=n.getRootNode();if(!!Ir&&Ir.root===i&&Ir.title===r&&Ir.trigger===n){dn();return}dn(),K2(n,e,t)}},[g("span",{class:"preset-color-swatch",style:e.value?{background:e.value}:{background:"transparent"}})])}function dn(){const e=Ir;e&&(Ir=null,e.teardowns.forEach(t=>t()),e.trigger.setAttribute("aria-expanded","false"),e.panel.remove())}function K2(e,t,r){const o=e.getRootNode(),n=o instanceof ShadowRoot?o:document.body,i={root:o,title:t.title??r("colorPicker.pickColor"),trigger:e,panel:null,clearable:t.clearable!==!1,onChange:t.onChange,model:t.value||void 0,hue:0,saturation:0,value_:0,hexText:"",dragging:!1,current:null,hex:null,area:null,handle:null,hueRange:null,clearBtn:null,translator:r,items:[],teardowns:[]};t.value&&Sl(i,t.value)?i.hexText=Pl(t.value).toUpperCase():i.hexText=t.value?String(t.value):"",i.panel=rt(J2(i),n),i.current=i.panel.querySelector(".picker-current"),i.hex=i.panel.querySelector(".picker-hex"),i.area=i.panel.querySelector(".picker-area"),i.handle=i.panel.querySelector(".picker-handle"),i.hueRange=i.panel.querySelector(".picker-hue"),i.clearBtn=i.panel.querySelector(".picker-clear"),i.items=Array.from(i.panel.querySelectorAll(".preset-color-item")).map((a,s)=>({el:a,color:sc[s]})),ra(i),Y2(i),X2(i),Ir=i,e.setAttribute("aria-expanded","true")}function Y2(e){const t=e.trigger.getBoundingClientRect(),r=190,o=e.panel.offsetHeight||216,n=8,i=Math.max(n,Math.min(t.left,window.innerWidth-r-n)),a=t.bottom+6,s=a+o>window.innerHeight-n?Math.max(n,t.top-o-6):a;e.panel.style.left=`${i}px`,e.panel.style.top=`${s}px`}function X2(e){const t=n=>{const i=Z2(n);i.includes(e.trigger)||i.includes(e.panel)||dn()},r=n=>{n.key==="Escape"&&dn()},o=()=>dn();document.addEventListener("pointerdown",t,!0),document.addEventListener("keydown",r),window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),e.root.addEventListener("scroll",o,!0),e.teardowns.push(()=>document.removeEventListener("pointerdown",t,!0),()=>document.removeEventListener("keydown",r),()=>window.removeEventListener("scroll",o,!0),()=>window.removeEventListener("resize",o),()=>e.root.removeEventListener("scroll",o,!0))}function Z2(e){const t=typeof e.composedPath=="function"?e.composedPath():[];return t.length?t:[e.target]}function J2(e){const t=e.translator;return g("div",{class:"preset-color-panel",role:"dialog","aria-label":t("colorPicker.pickColor"),style:{position:"fixed"},onPointerdown:r=>r.stopPropagation()},[g("div",{class:"picker-preview"},[g("span",{class:"picker-current"}),g("input",{class:"picker-hex",type:"text",maxlength:7,spellcheck:"false","aria-label":t("colorPicker.hexValue"),onInput:r=>ew(e,r.target.value)})]),g("div",{class:"picker-area","aria-label":t("colorPicker.customColor"),tabindex:0,onPointerdown:r=>tw(e,r),onKeydown:r=>rw(e,r)},[g("span",{class:"picker-handle"})]),g("input",{class:"picker-hue",type:"range",min:0,max:360,step:1,"aria-label":t("colorPicker.hue"),onInput:r=>ow(e,Number(r.target.value)),onChange:()=>Tl(e)}),g("div",{class:"picker-heading"},[g("span",{text:t("colorPicker.commonColors")}),e.clearable?g("button",{type:"button",class:"picker-clear",title:t("colorPicker.clear"),onClick:()=>oa(e,void 0)},[g("svg",{viewBox:"0 0 16 16",width:12,height:12,"aria-hidden":"true"},[g("path",{d:"M3 3l10 10M13 3L3 13",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round",fill:"none"})]),t("colorPicker.clearShort")]):""].filter(Boolean)),g("div",{class:"preset-color-grid"},sc.map(r=>g("button",{type:"button",class:"preset-color-item",style:{background:r},title:r,"aria-label":r,onClick:()=>Q2(e,r)})))])}function El(e){return Fh(W2(e.hue,e.saturation,e.value_))}function ra(e){const t=El(e);e.hex.value!==e.hexText&&(e.hex.value=e.hexText),e.current.className=e.model?"picker-current":"picker-current is-empty",e.model?e.current.style.background=t:e.current.style.removeProperty("background"),e.area.style.setProperty("--picker-hue",`${Math.round(e.hue)}deg`),e.handle.style.left=`${e.saturation*100}%`,e.handle.style.top=`${(1-e.value_)*100}%`,e.handle.style.background=t;const r=String(Math.round(e.hue));e.hueRange.value!==r&&(e.hueRange.value=r),e.clearBtn&&(e.clearBtn.disabled=!e.model);for(const o of e.items)o.el.className=e.model&&o.color.toLowerCase()===e.model.toLowerCase()?"preset-color-item active":"preset-color-item"}function Sl(e,t){const r=xl(t);if(!r)return!1;const o=j2(r.r,r.g,r.b);return e.hue=o.h,e.saturation=o.s,e.value_=o.v,e.hexText=Pl(t).toUpperCase(),!0}function lo(e,t,r,o){e.hue=V2(t),e.saturation=pn(r),e.value_=pn(o),e.hexText=El(e).toUpperCase(),ra(e)}function Tl(e){const t=El(e);e.model=t,ra(e),e.onChange(t)}function oa(e,t){e.model=t,t||(e.hexText=""),ra(e),e.onChange(t)}function Q2(e,t){Sl(e,t),oa(e,t)}function ew(e,t){const r=t.trim();if(!r){e.clearable&&oa(e,void 0);return}xl(r)&&(Sl(e,r),oa(e,Pl(r)))}function tw(e,t){e.dragging=!0,$h(e,t);const r=n=>{e.dragging&&$h(e,n)},o=()=>{e.dragging&&(e.dragging=!1,document.removeEventListener("pointermove",r),document.removeEventListener("pointerup",o),document.removeEventListener("pointercancel",o),Tl(e))};document.addEventListener("pointermove",r),document.addEventListener("pointerup",o),document.addEventListener("pointercancel",o)}function $h(e,t){const r=e.area.getBoundingClientRect();if(!r.width||!r.height)return;const o=pn((t.clientX-r.left)/r.width),n=pn(1-(t.clientY-r.top)/r.height);lo(e,e.hue,o,n)}function rw(e,t){const r=t.shiftKey?.1:.02;let o=!0;t.key==="ArrowLeft"?lo(e,e.hue,e.saturation-r,e.value_):t.key==="ArrowRight"?lo(e,e.hue,e.saturation+r,e.value_):t.key==="ArrowUp"?lo(e,e.hue,e.saturation,e.value_+r):t.key==="ArrowDown"?lo(e,e.hue,e.saturation,e.value_-r):o=!1,o&&(t.preventDefault(),Tl(e))}function ow(e,t){lo(e,t,e.saturation,e.value_)}function m(e,t,r){return e.t?e.t(t,r):lr(t,r)}let po=null;function nw(e,t){const r=po;po=e;try{t()}finally{po=r}}function oe(e,t){return po?po(e,t):lr(e,t)}function Re(e,t,r,o){return g("button",{class:`tb-btn tb-icon${o.on?" on":""}${o.danger?" danger":""}`,type:"button",disabled:!!o.disabled,dataset:{tip:o.tip,...o.test?{test:o.test}:{}},onClick:()=>e.fire(r,o.arg),html:je(t)})}function na(e,t,r,o){const n=e.state.openDd===t,i=()=>{e.state.openDd=n?null:t,e.repaint()};return g("div",{class:"tb-dd"},[g("button",{type:"button",class:`tb-dd-trigger${n?" on":""}`,disabled:!!r.disabled,dataset:{test:r.testId??t,tip:r.tip},onClick:i,html:`${r.icon?je(r.icon):""}${r.text?`<span class="${r.textClass??"tb-btn-text"}">${r.text}</span>`:""}${je("ChevronDown",12,`tb-dd-arrow${n?" up":""}`)}`}),n?g("div",{class:`tb-dd-panel${r.panelClass?` ${r.panelClass}`:""}`},o):""].filter(Boolean))}function ae(e){const t=e.step??1,r=String(t),o=r.indexOf("."),n=o===-1?0:r.length-o-1,i=u=>Number.isFinite(u)?Number(u.toFixed(n)):0,a=u=>{let c=i(u);return e.min!==void 0&&c<e.min&&(c=e.min),e.max!==void 0&&c>e.max&&(c=e.max),c},s=e.value===void 0||e.value===null||!Number.isFinite(e.value)?void 0:i(e.value),p=s??e.min??0,l=u=>{u!==s&&e.onCommit(u)},d=g("input",{class:"pd-input pd-step-input",type:"number",value:s===void 0?"":String(s),min:e.min,max:e.max,step:t,placeholder:e.placeholder,disabled:!!e.disabled,onChange:u=>{const c=u.target,f=(c.value??"").trim();if(f===""){s!==void 0&&(c.value=String(s));return}const h=Number(f);if(!Number.isFinite(h)){c.value=s===void 0?"":String(s);return}const b=a(h);c.value=String(b),l(b)}});return g("div",{class:"pd-stepper"},[g("button",{type:"button",class:"pd-step-btn pd-step-minus",disabled:!!e.disabled||p<=(e.min??-1/0),title:oe("controls.k28"),"aria-label":oe("controls.k29"),text:"−",onClick:()=>l(a(p-t))}),d,g("button",{type:"button",class:"pd-step-btn pd-step-plus",disabled:!!e.disabled||p>=(e.max??1/0),title:oe("controls.k30"),"aria-label":oe("controls.k31"),text:"+",onClick:()=>l(a(p+t))})])}function he(e,t,r,o){return g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:e}),o??""]),t,r?g("p",{class:"pd-hint",text:r}):""].filter(Boolean))}const Ml=e=>g("button",{class:"pd-help",type:"button","data-tip":e,"aria-label":oe("controls.k32")});function Ge(e,t,r,o){return g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t"},[e,Ml(r)]),o??""]),t])}function Lr(e){const t=e.base?.[e.propKey],r=e.target?.[e.propKey]!==t,o=e.force===!0||r,n=e.tipOverride??(e.tipValue===void 0?oe("controls.k33"):oe("controls.k34",{v0:e.tipValue,v1:e.tipUnit?" "+e.tipUnit:""})),i=e.force?oe("controls.k35",{v0:n}):n;return g("button",{type:"button",class:`pd-reset-btn${r&&!e.force?" is-dirty":""}`,"data-tip":i,"aria-label":i,html:je("RotateCcw",13),onClick:()=>{o&&(e.write?e.write(t):e.target[e.propKey]=t,e.onReset?.())}})}const $t=e=>g("h3",{class:"pd-divider",text:e});function dt(e,t,r=oe("controls.k36"),o){return G2({value:e,title:r,triggerClass:o,translator:po??lr,onChange:n=>t(n)})}function pr(e,t,r,o,n=!1){return g("div",{class:`pd-radio-group${n?" pd-radio-group--2col":""}`,role:"radiogroup"},t.map(i=>g("label",{class:"pd-radio"},[g("input",{type:"radio",name:e,value:i.value,checked:r===i.value,onChange:()=>o(i.value)}),g("span",{text:i.label})])))}function zh(e,t,r,o={}){const n=document.createElement("select");n.className=o.className??"pd-select",o.width&&(n.style.width=o.width);for(const i of t){const a=document.createElement("option");a.value=i.value,a.textContent=i.label,i.disabled&&(a.disabled=!0),n.appendChild(a)}return n.value=e,t.some(i=>i.value===e)||(n.selectedIndex=-1),n.addEventListener("change",()=>r(n.value)),n}const iw="propertyPanel.k328",aw=()=>oe(iw);function Hh(){const e=[];for(const{plugin:t,kind:r}of fd()){const o=D2(r.type);if(!o)continue;const i=(r.designer??t.designer)?.materialCard;e.push({type:r.type,label:r.label,icon:r.icon??i?.icon??"Shapes",group:i?.group??o.group,ui:o})}return e}function Cl(e){if(e)return Hh().find(t=>t.type===e)}function _l(e){if(!e)return;const t=Cl(e.printElementType.type);if(!t||!t.ui.renderProperty)return;const r=t.ui;if(r.hasProperties)try{if(!r.hasProperties(e))return}catch{return}const o=aw();return{ui:r,label:o,icon:t.icon,searchKeywords:r.searchKeywords?[...r.searchKeywords]:[o,t.label,t.type]}}const ia=Object.freeze([{type:"text",label:oe("elementDefinitions.k553"),icon:"Type",material:!0,propertyGroup:"text",dblEditableField:"formatter",origin:"builtin"},{type:"barcode",label:oe("elementDefinitions.k554"),icon:"Barcode",material:!0,propertyGroup:"code",dblEditableField:"formatter",origin:"builtin"},{type:"qrcode",label:oe("elementDefinitions.k555"),icon:"QrCode",material:!0,propertyGroup:"code",dblEditableField:"formatter",origin:"builtin"},{type:"image",label:oe("elementDefinitions.k556"),icon:"Image",material:!0,propertyGroup:"general",dblEditableField:"src",origin:"builtin"},{type:"table",label:oe("elementDefinitions.k557"),icon:"Table",material:!0,propertyGroup:"table",origin:"builtin"},{type:"longText",label:oe("elementDefinitions.k558"),icon:"TextAlignStart",material:!0,propertyGroup:"text",dblEditableField:"formatter",origin:"builtin"},{type:"flowList",label:oe("elementDefinitions.k559"),icon:"List",material:!0,propertyGroup:"general",dblEditableField:"formatter",origin:"builtin"},{type:"hline",label:oe("elementDefinitions.k560"),icon:"Minus",material:!0,propertyGroup:"general",origin:"builtin"},{type:"vline",label:oe("elementDefinitions.k561"),icon:"SeparatorVertical",material:!0,propertyGroup:"general",origin:"builtin"},{type:"rect",label:oe("elementDefinitions.k562"),icon:"Square",material:!0,propertyGroup:"general",origin:"builtin"},{type:"oval",label:oe("elementDefinitions.k563"),icon:"Circle",material:!0,propertyGroup:"general",origin:"builtin"},{type:"html",label:"HTML",icon:"Code",material:!1,propertyGroup:"general",origin:"builtin"},{type:"pageNumber",label:oe("elementDefinitions.k564"),icon:"Shapes",material:!1,propertyGroup:"general",origin:"builtin"}]),Uh=Symbol.for("worm-print-platform.element-definitions.v1"),qh=globalThis;function Mt(){const e=qh[Uh];if(e)return e;const t={overrides:new Map,builtinRenderers:new Map,rendererOverrides:new Map,listeners:new Set,nextSeq:0,seq:new Map};return qh[Uh]=t,t}function cn(){for(const e of[...Mt().listeners])try{e()}catch{}}function jh(e){const t=Mt();return t.listeners.add(e),()=>{t.listeners.delete(e)}}function sw(){return new Map(ia.map(e=>[e.type,e]))}function lw(e){if(!e?.type||typeof e.type!="string")throw new Error(oe("elementDefinitions.k565"));if(!e.label||typeof e.label!="string")throw new Error(oe("elementDefinitions.k566"));const t=Mt(),r={...e,origin:e.origin??"custom"};return t.overrides.set(r.type,r),t.seq.set(r.type,t.nextSeq++),cn(),()=>{const o=Mt();o.overrides.get(r.type)===r&&(o.overrides.delete(r.type),cn())}}function pw(e,t){if(!e||typeof t!="function")throw new Error(oe("elementDefinitions.k567"));return Mt().rendererOverrides.set(e,t),cn(),()=>{const o=Mt();o.rendererOverrides.get(e)===t&&(o.rendererOverrides.delete(e),cn())}}function Wh(e){const t=Mt();for(const[r,o]of Object.entries(e))t.builtinRenderers.set(r,o);return()=>{const r=Mt();for(const[o,n]of Object.entries(e))r.builtinRenderers.get(o)===n&&r.builtinRenderers.delete(o)}}function dw(e){const t=Cl(e);if(t)return{type:t.type,label:t.label,icon:t.icon,group:t.group,material:!0,propertyGroup:"general",origin:"plugin"}}function dr(e){if(!e)return;const t=Mt(),r=t.overrides.get(e)??sw().get(e)??dw(e);if(!r)return;const o=t.rendererOverrides.get(e)??t.builtinRenderers.get(e);return o?{...r,renderContent:o}:r}function Vh(){const e=Mt(),t=[],r=new Set;for(const n of ia)t.push(dr(n.type)??n),r.add(n.type);const o=[...e.overrides.entries()].filter(([n])=>!r.has(n)).sort((n,i)=>(e.seq.get(n[0])??0)-(e.seq.get(i[0])??0));for(const[n]of o){const i=dr(n);i&&t.push(i),r.add(n)}for(const n of Hh()){if(r.has(n.type))continue;const i=dr(n.type);i&&t.push(i),r.add(n.type)}return t}function Gh(){return Vh().filter(e=>e.material)}function Kh(e){return dr(e)?.propertyGroup??"general"}function Yh(e){return dr(e)?.dblEditableField}function Xh(e){return dr(e)?.icon??"Shapes"}function cw(){const e=Mt();e.overrides.clear(),e.rendererOverrides.clear(),e.seq.clear(),e.nextSeq=0,cn()}const Dl="1.4.0",Zh="print-designer",Al=["template","fields","name","fonts","design-data","theme","theme-config","field-display","lang"],Jh=["is-edit","show-help","show-preview","show-save"],uw=Object.freeze({bubbles:!0,composed:!0}),Ol=["container","toolbar","format-bar","left-panel","canvas-area","property-panel","status-bar","page-tabs"],Qh=["--pd-bg","--pd-surface","--pd-field-bg","--pd-sidebar","--pd-sidebar-hover","--pd-canvas-bg","--pd-paper","--pd-accent","--pd-accent-2","--pd-accent-soft","--pd-accent-secondary","--pd-danger-soft","--pd-ink-green","--pd-text","--pd-text-muted","--pd-text-faint","--pd-border","--pd-border-soft","--pd-input-bg","--pd-hover-tint","--pd-danger","--pd-danger-bg","--pd-danger-border","--pd-menu-text","--pd-menu-hover","--pd-menu-border","--pd-menu-divider","--pd-menu-muted","--pd-menu-disabled","--pd-scrollbar","--pd-scrollbar-thumb","--pd-scrollbar-thumb-hover","--pd-help-field-bg","--pd-help-field-line","--pd-help-field-ink","--pd-help-function-bg","--pd-help-function-line","--pd-help-function-ink","--pd-help-variable-bg","--pd-help-variable-line","--pd-help-variable-ink","--pd-help-conditional-bg","--pd-help-conditional-line","--pd-help-conditional-ink","--pd-handle","--pd-ruler","--pd-ruler-bg","--pd-ruler-cursor","--pd-radius","--pd-shadow-sm","--pd-shadow-md","--pd-shadow-paper","--pd-success","--pd-text-regular","--pd-fill-light"],em=["getTemplateJson","loadTemplate","save","validateTemplate","getGeometryWarnings","setLocale"],tm=["template","fields","fonts","designData","isEdit","showHelp","showPreview","showSave","theme","themeConfig","uploadImage","uploadDesignBackground","fieldDisplay","lang","messages"],Ct=Object.freeze({save:"save",preview:"preview",help:"help",dblclickElement:"dblclick-element",dblclickCell:"dblclick-cell"}),rm=[Ct.save,Ct.preview,Ct.help,Ct.dblclickElement,Ct.dblclickCell];function Rl(){return{version:Dl,tag:Zh,attributes:Al,booleanAttributes:Jh,events:rm,parts:Ol,themeTokens:Qh,methods:em,properties:tm}}const fw={"--pd-bg":"#181a20","--pd-surface":"#1f2229","--pd-field-bg":"#252830","--pd-sidebar":"#1f2229","--pd-sidebar-hover":"#2b2f39","--pd-accent":"#4C8DFF","--pd-accent-2":"#6C9DFF","--pd-accent-soft":"rgba(76, 141, 255, .16)","--pd-accent-secondary":"#ff7a7a","--pd-danger-soft":"rgba(255, 122, 122, .14)","--pd-ink-green":"#6cce5a","--pd-text":"#e6e8ee","--pd-text-muted":"#9aa0ad","--pd-text-faint":"#6f7683","--pd-text-regular":"#c9cdd8","--pd-border":"#3a3f4b","--pd-border-soft":"#2d323c","--pd-input-bg":"#262a33","--pd-hover-tint":"rgba(76, 141, 255, .12)","--pd-fill-light":"#2b2f39","--pd-danger":"#ff6b6b","--pd-danger-bg":"#3a2226","--pd-danger-border":"#6b3535","--pd-success":"#4ade80","--pd-menu-text":"#d6d9e0","--pd-menu-hover":"#2b2f39","--pd-menu-border":"#3a3f4b","--pd-menu-divider":"#2d323c","--pd-menu-muted":"#8b91a0","--pd-menu-disabled":"#555b68","--pd-scrollbar":"rgba(255, 255, 255, .18)","--pd-scrollbar-thumb":"rgba(255, 255, 255, .16)","--pd-scrollbar-thumb-hover":"rgba(255, 255, 255, .3)","--pd-help-field-bg":"#16283a","--pd-help-field-line":"#2c5870","--pd-help-field-ink":"#7cc4f5","--pd-help-function-bg":"#162e22","--pd-help-function-line":"#2c5b3c","--pd-help-function-ink":"#79d69a","--pd-help-variable-bg":"#302c16","--pd-help-variable-line":"#6b5d24","--pd-help-variable-ink":"#d6b25e","--pd-help-conditional-bg":"#301a28","--pd-help-conditional-line":"#6b3454","--pd-help-conditional-ink":"#e58ab5","--pd-shadow-sm":"0 1px 2px rgba(0, 0, 0, .3)","--pd-shadow-md":"0 2px 8px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .5)"};function om(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}function hw(e){if(Array.isArray(e))return e}function mw(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var o,n,i,a,s=[],p=!0,l=!1;try{if(i=(r=r.call(e)).next,t!==0)for(;!(p=(o=i.call(r)).done)&&(s.push(o.value),s.length!==t);p=!0);}catch(d){l=!0,n=d}finally{try{if(!p&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw n}}return s}}function gw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
295
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bw(e,t){return hw(e)||mw(e,t)||kw(e,t)||gw()}function kw(e,t){if(e){if(typeof e=="string")return om(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?om(e,t):void 0}}const nm=Object.entries,yw=Object.keys,im=Object.setPrototypeOf,vw=Object.isFrozen,am=Object.getPrototypeOf,sm=Object.getOwnPropertyDescriptor;let We=Object.freeze,Ne=Object.seal,cr=Object.create,lm=typeof Reflect<"u"&&Reflect,aa=lm.apply,Il=lm.construct;We||(We=function(t){return t}),Ne||(Ne=function(t){return t}),aa||(aa=function(t,r){for(var o=arguments.length,n=new Array(o>2?o-2:0),i=2;i<o;i++)n[i-2]=arguments[i];return t.apply(r,n)}),Il||(Il=function(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return new t(...o)});const Vt=_e(Array.prototype.forEach),ww=_e(Array.prototype.lastIndexOf),pm=_e(Array.prototype.pop),un=_e(Array.prototype.push),xw=_e(Array.prototype.slice),Pw=_e(Array.prototype.splice),co=Array.isArray,Ll=um(Set),Bl=_e(Set.prototype.add),fn=_e(Set.prototype.has),Br=_e(String.prototype.toLowerCase),Nl=_e(String.prototype.toString),Ew=_e(String.prototype.match),sa=_e(String.prototype.replace),Fl=_e(String.prototype.indexOf),Sw=_e(String.prototype.trim),Tw=_e(Number.prototype.toString),Mw=_e(Boolean.prototype.toString),dm=typeof BigInt>"u"?null:_e(BigInt.prototype.toString),cm=typeof Symbol>"u"?null:_e(Symbol.prototype.toString),Ze=_e(Object.prototype.hasOwnProperty),hn=_e(Object.prototype.toString),Cw=RegExp.prototype.test,Ve=function(t,r){return t instanceof RegExp&&(t.lastIndex=0),aa(Cw,t,[r])},Gt=um(TypeError);function _e(e){return function(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return aa(e,t,o)}}function um(e){return function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return Il(e,r)}}function be(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Br;if(im&&im(e,null),!co(t))return e;let o=t.length;for(;o--;){let n=t[o];if(typeof n=="string"){const i=r(n);i!==n&&(vw(t)||(t[o]=i),n=i)}e[n]=!0}return e}function _w(e){for(let t=0;t<e.length;t++)Ze(e,t)||(e[t]=null);return e}function la(e){const t=cr(null);for(const o of nm(e)){var r=bw(o,2);const n=r[0],i=r[1];Ze(e,n)&&(co(i)?t[n]=_w(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=la(i):t[n]=i)}return t}function mn(e){const t=cr(null),r=yw(e);let o=r.length;for(;o--;)t[r[o]]=e[r[o]];return t}function Dw(e){switch(typeof e){case"string":return e;case"number":return Tw(e);case"boolean":return Mw(e);case"bigint":return dm?dm(e):"0";case"symbol":return cm?cm(e):"Symbol()";case"undefined":return hn(e);case"function":case"object":{if(e===null)return hn(e);const t=e,r=wt(t,"toString");if(typeof r=="function"){const o=r(t);return typeof o=="string"?o:hn(o)}return hn(e)}default:return hn(e)}}function wt(e,t){for(;e!==null;){const o=sm(e,t);if(o){if(o.get)return _e(o.get);if(typeof o.value=="function")return _e(o.value)}e=am(e)}function r(){return null}return r}function Aw(e,t){for(;e!==null;){const r=sm(e,t);if(r)return r.get?_e(r.get):null;e=am(e)}return null}function Ow(e){if(!e)return!1;try{return Ve(e,""),!0}catch{return!1}}const fm=We(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),$l=We(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),zl=We(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Rw=We(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Hl=We(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Iw=We(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),hm=We(["#text"]),mm=We(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Ul=We(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),gm=We(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),pa=We(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Lw=Ne(/{{[\w\W]*|^[\w\W]*}}/g),Bw=Ne(/<%[\w\W]*|^[\w\W]*%>/g),Nw=Ne(/\${[\w\W]*/g),Fw=Ne(/{{|}}|\${|<%|%>|&lt;%|%&gt;/),$w=Ne(/^data-[\-\w.\u00B7-\uFFFF]+$/),zw=Ne(/^aria-[\-\w]+$/),bm=Ne(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hw=Ne(/^(?:\w+script|data):/i),Uw=Ne(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qw=Ne(/^html$/i),jw=Ne(/^[a-z][.\w]*(-[.\w]+)+$/i),ql=Ne(/<[/\w!]/g),km=Ne(/<[/\w]/g),Ww=Ne(/<\/no(script|embed|frames)/i),ym=Ne(/\/>/i),Vw=Ne(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i),Gw=Ne(/^[\r\n\t ]+/),Ie={element:1,text:3,processingInstruction:7,comment:8,document:9,documentFragment:11},Kw=We(be({},["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"])),Yw=function(){return typeof window>"u"?null:window},Xw=function(t,r){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let o=null;const n="data-tt-policy-suffix";r&&r.hasAttribute(n)&&(o=r.getAttribute(n));const i="dompurify"+(o?"#"+o:"");try{return t.createPolicy(i,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},vm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ur=function(t,r,o,n){return Ze(t,r)&&co(t[r])?be(n.base?mn(n.base):{},t[r],n.transform):o},jl=function(t,r,o){const n=Ze(t,r)?t[r]:void 0;return n&&typeof n=="object"?la(n):o};function wm(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Yw();const t=B=>wm(B);if(t.version="3.4.18",t.removed=[],!e||!e.document||e.document.nodeType!==Ie.document||!e.Element)return t.isSupported=!1,t;let r=e.document;const o=r,n=o.currentScript,i=e.HTMLTemplateElement,a=e.Node,s=e.Element,p=e.NodeFilter,l=e.DOMParser,d=e.trustedTypes,u=s.prototype,c=wt(u,"cloneNode"),f=wt(u,"remove"),h=wt(u,"removeAttributeNode"),b=wt(u,"nextSibling"),k=wt(u,"childNodes"),v=wt(u,"parentNode"),w=wt(u,"shadowRoot"),P=wt(u,"attributes"),E=a&&a.prototype?wt(a.prototype,"nodeType"):null,D=a&&a.prototype?wt(a.prototype,"nodeName"):null,O=a&&a.prototype?wt(a.prototype,"ownerDocument"):null,A=function(y){return E?E(y):y.nodeType},R=function(y){return D?D(y):y.nodeName},_=Aw(u,"namespaceURI"),I=function(y){return _?_(y):y.namespaceURI};if(typeof i=="function"){const B=r.createElement("template");B.content&&B.content.ownerDocument&&(r=B.content.ownerDocument)}let S,N="",F,H=!1,le=0;const M=function(){if(le>0)throw Gt('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},ne=function(y){M(),le++;try{return S.createHTML(y)}finally{le--}},Se=function(y){return S&&De?ne(y):y},Pe=function(y){M(),le++;try{return S.createScriptURL(y)}finally{le--}},K=function(){return H||(F=Xw(d,n),H=!0),F},ue=r,me=ue.implementation,we=ue.createNodeIterator,ke=ue.createDocumentFragment,te=ue.getElementsByTagName,Me=o.importNode;let se=vm();t.isSupported=typeof nm=="function"&&typeof v=="function"&&me&&me.createHTMLDocument!==void 0;const Je=Lw,ze=Bw,ve=Nw,Ee=$w,ho=zw,vn=Hw,wn=Uw,xn=jw;let mo=bm,xe=null;const Dt=be({},[...fm,...$l,...zl,...Hl,...hm]);let C=null;const q=be({},[...mm,...Ul,...gm,...pa]);let U=null,V=null,j=null;const J=Object.seal(cr(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let pe=!0,T=!0,X=!1,ee=!0,ie=!1,ce=!0,Te=!1,Le=!1,Ke=null,ot=null,He=!1,ct=!1,Ce=!1,De=!1,At=!0,Hr=!1;const ut="user-content-";let Ae=!0,qt=!1,xt=null,Qe=!1,Pt=null;const Jt=be({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let hr=null;const $e=be({},["audio","video","img","source","image","track"]);let Ue=null;const Ur=be({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),qr="http://www.w3.org/1998/Math/MathML",fe="http://www.w3.org/2000/svg",ye="http://www.w3.org/1999/xhtml";let ft=ye,ht=!1,Pn=null;const mp=be({},[qr,fe,ye],Nl),gp=We(be({},["mi","mo","mn","ms","mtext"]));let bp=null;const dE=We(be({},["annotation-xml"]));let kp=null;const cE=We(cr(null)),uE=be({},["title","style","font","a","script"]);let En=null;const fE=["application/xhtml+xml","text/html"],hE="text/html";let Be=null,wa=null;const mE=r.createElement("form"),Pg=function(y){return y instanceof RegExp||y instanceof Function},yp=function(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};(!y||typeof y!="object")&&(y={}),y=la(y),En=fE.indexOf(y.PARSER_MEDIA_TYPE)===-1?hE:y.PARSER_MEDIA_TYPE,Be=En==="application/xhtml+xml"?Nl:Br,xe=ur(y,"ALLOWED_TAGS",Dt,{transform:Be}),C=ur(y,"ALLOWED_ATTR",q,{transform:Be}),Pn=ur(y,"ALLOWED_NAMESPACES",mp,{transform:Nl}),Ue=ur(y,"ADD_URI_SAFE_ATTR",Ur,{transform:Be,base:Ur}),hr=ur(y,"ADD_DATA_URI_TAGS",$e,{transform:Be,base:$e}),Pt=ur(y,"FORBID_CONTENTS",Jt,{transform:Be}),V=ur(y,"FORBID_TAGS",cr(null),{transform:Be}),j=ur(y,"FORBID_ATTR",cr(null),{transform:Be}),Qe=Ze(y,"USE_PROFILES")?y.USE_PROFILES&&typeof y.USE_PROFILES=="object"?la(y.USE_PROFILES):y.USE_PROFILES:!1,pe=y.ALLOW_ARIA_ATTR!==!1,T=y.ALLOW_DATA_ATTR!==!1,X=y.ALLOW_UNKNOWN_PROTOCOLS||!1,ee=y.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ie=y.SAFE_FOR_TEMPLATES||!1,ce=y.SAFE_FOR_XML!==!1,Te=y.WHOLE_DOCUMENT||!1,ct=y.RETURN_DOM||!1,Ce=y.RETURN_DOM_FRAGMENT||!1,De=y.RETURN_TRUSTED_TYPE||!1,He=y.FORCE_BODY||!1,At=y.SANITIZE_DOM!==!1,Hr=y.SANITIZE_NAMED_PROPS||!1,Ae=y.KEEP_CONTENT!==!1,qt=y.IN_PLACE||!1,mo=Ow(y.ALLOWED_URI_REGEXP)?y.ALLOWED_URI_REGEXP:bm,ft=typeof y.NAMESPACE=="string"?y.NAMESPACE:ye,bp=jl(y,"MATHML_TEXT_INTEGRATION_POINTS",gp),kp=jl(y,"HTML_INTEGRATION_POINTS",dE);const x=jl(y,"CUSTOM_ELEMENT_HANDLING",cE);if(U=cr(null),Ze(x,"tagNameCheck")&&Pg(x.tagNameCheck)&&(U.tagNameCheck=x.tagNameCheck),Ze(x,"attributeNameCheck")&&Pg(x.attributeNameCheck)&&(U.attributeNameCheck=x.attributeNameCheck),Ze(x,"allowCustomizedBuiltInElements")&&typeof x.allowCustomizedBuiltInElements=="boolean"&&(U.allowCustomizedBuiltInElements=x.allowCustomizedBuiltInElements),Ne(U),ie&&(T=!1),Ce&&(ct=!0),Qe&&((Ze(y,"ALLOWED_TAGS")||Ze(y,"ALLOWED_ATTR"))&&typeof console<"u"&&typeof console.warn=="function"&&console.warn("DOMPurify: USE_PROFILES overrides ALLOWED_TAGS and ALLOWED_ATTR. Do not use these options together."),xe=be({},hm),C=cr(null),Qe.html===!0&&(be(xe,fm),be(C,mm)),Qe.svg===!0&&(be(xe,$l),be(C,Ul),be(C,pa)),Qe.svgFilters===!0&&(be(xe,zl),be(C,Ul),be(C,pa)),Qe.mathMl===!0&&(be(xe,Hl),be(C,gm),be(C,pa))),J.tagCheck=null,J.attributeCheck=null,Ze(y,"ADD_TAGS")&&(typeof y.ADD_TAGS=="function"?J.tagCheck=y.ADD_TAGS:co(y.ADD_TAGS)&&(xe===Dt&&(xe=mn(xe)),be(xe,y.ADD_TAGS,Be))),Ze(y,"ADD_ATTR")&&(typeof y.ADD_ATTR=="function"?J.attributeCheck=y.ADD_ATTR:co(y.ADD_ATTR)&&(C===q&&(C=mn(C)),be(C,y.ADD_ATTR,Be))),Ze(y,"ADD_FORBID_CONTENTS")&&co(y.ADD_FORBID_CONTENTS)&&(Pt===Jt&&(Pt=mn(Pt)),be(Pt,y.ADD_FORBID_CONTENTS,Be)),Ae&&(xe["#text"]=!0),Te&&be(xe,["html","head","body"]),xe.table&&(xe.tbody=!0,delete V.tbody),y.TRUSTED_TYPES_POLICY){if(typeof y.TRUSTED_TYPES_POLICY.createHTML!="function")throw Gt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof y.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Gt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const L=S;S=y.TRUSTED_TYPES_POLICY;try{N=ne("")}catch(z){throw S=L,z}}else y.TRUSTED_TYPES_POLICY===null?(S=void 0,N=""):(S===void 0&&(S=K()),S&&typeof N=="string"&&(N=ne("")));wa=We(y)},Eg=be({},[...$l,...zl,...Rw]),Sg=be({},[...Hl,...Iw]),gE=function(y,x,L){return x===ye?y==="svg":x===qr?y==="svg"&&(L==="annotation-xml"||bp[L]):!!Eg[y]},bE=function(y,x,L){return x===ye?y==="math":x===fe?y==="math"&&kp[L]:!!Sg[y]},kE=function(y,x,L){return x===fe&&!kp[L]||x===qr&&!bp[L]?!1:!Sg[y]&&(uE[y]||!Eg[y])},yE=function(y){const x=I(y),L=Br(R(y)),z=v(y);let Y=ft,re="template";return z&&A(z)===Ie.element&&(Y=I(z),re=Br(R(z))),Pn[x]?x===fe?gE(L,Y,re):x===qr?bE(L,Y,re):x===ye?kE(L,Y,re):En==="application/xhtml+xml":!1},mr=function(y){un(t.removed,{element:y});try{v(y).removeChild(y)}catch{if(f(y),!v(y))throw Gt("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Tg=function(y,x,L){try{h(y,x)}catch{try{y.removeAttribute(L)}catch{}}},vp=function(y){Pp(y);const x=k(y);x&&Vt(xw(x),L=>{try{f(L)}catch{}}),A(y)===Ie.element&&wp(y,!1)},go=function(y,x,L){if(!L)try{L=x.getAttributeNode(y)}catch{L=null}if(un(t.removed,{attribute:L||null,from:x}),L)Tg(x,L,y);else try{x.removeAttribute(y)}catch{}if(y==="is")if(ct||Ce)try{mr(x)}catch{}else try{x.setAttribute(y,"")}catch{}},wp=function(y,x){const L=P(y);if(L)for(let z=L.length-1;z>=0;--z){const Y=L[z],re=Y&&Y.name;typeof re=="string"&&!(x&&C[Be(re)])&&Tg(y,Y,re)}},xp=function(y,x){let L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const z=[y];for(;z.length>0;){const Y=z.pop();if(x(Y)===!1)continue;if(L&&A(Y)===Ie.element){const de=w(Y);bo(de)&&z.push(de)}const re=k(Y);if(re)for(let de=re.length-1;de>=0;--de)z.push(re[de])}},Pp=function(y){xp(y,x=>{A(x)===Ie.element&&wp(x,!0)})},Ep=function(y){const x=[];return xp(y,L=>{x.push(L)},!0),x},vE=function(y,x){const L=Ll();Vt(Ep(y),z=>{A(z)===Ie.element&&Bl(L,z)}),Vt(x,z=>{A(z)===Ie.element&&!fn(L,z)&&wp(z,!0)})},Mg=function(y,x){let L=!1;return Vt(t.removed,z=>{z.element&&(L=L||z.element===y,Pp(z.element))}),vE(y,x),L},wE=8,xE=function(y,x){const L=xt;let z=null;const Y=()=>(z||(z=Ll(),Vt(x,re=>{Bl(z,re)})),z);for(let re=0;;re++){const de=Ep(y),qe=[y];let Qt=!1;if(Vt(de,Rt=>{A(Rt)===Ie.documentFragment?un(qe,Rt):!Qt&&!fn(L,Rt)&&(Qt=fn(Y(),Rt))}),!Qt)return;if(re>=wE)throw Gt("the tree kept changing during in-place sanitization; refusing to return it");Vt(qe,(Rt,mt)=>{PE(Rt,mt>0,y,Y())})}},PE=function(y,x,L,z){const Y=xa(y);let re;for(;re=Y.nextNode();)!fn(z,re)||fn(xt,re)||(x&&Ot(se.uponSanitizeShadowNode,re,null),Cp(re,L))},EE=function(y){xt&&Bl(xt,y)},Cg=function(y,x){return ce?y==="patchsrc"?!0:y==="for"&&x!=="label"&&x!=="output":!1},SE=function(y){ce&&xp(y,x=>{const L=A(x);if(L===Ie.processingInstruction||L===Ie.comment&&Ve(km,x.data)){try{f(x)}catch{}return!1}if(L===Ie.element){const z=x,Y=Be(R(x));try{z.hasAttribute&&z.hasAttribute("patchsrc")&&z.removeAttribute("patchsrc"),z.hasAttribute&&z.hasAttribute("for")&&Cg("for",Y)&&z.removeAttribute("for")}catch{}}return!0})},_g=function(y){let x=null,L=null;if(He)y="<remove></remove>"+y;else{const re=Ew(y,Gw);L=re&&re[0]}En==="application/xhtml+xml"&&ft===ye&&(y='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+y+"</body></html>");const z=S?ne(y):y;if(ft===ye)try{x=new l().parseFromString(z,En)}catch{}if(!x||!x.documentElement){x=me.createDocument(ft,"template",null);try{x.documentElement.innerHTML=ht?N:z}catch{}}const Y=x.body||x.documentElement;return y&&L&&Y.insertBefore(r.createTextNode(L),Y.childNodes[0]||null),ft===ye?te.call(x,Te?"html":"body")[0]:Te?x.documentElement:Y},xa=function(y){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const L=O?O(y):y.ownerDocument;return we.call(L||y,y,(x?0:p.SHOW_ELEMENT)|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Sp=function(y){return y=sa(y,Je," "),y=sa(y,ze," "),y=sa(y,ve," "),y},Tp=function(y){var x;Mp(y);const L=(x=y.querySelectorAll)===null||x===void 0?void 0:x.call(y,"template");L&&Vt(L,z=>{bo(z.content)&&Tp(z.content)})},Mp=function(y){y.normalize();const x=xa(y,!0);let L=x.nextNode();for(;L;)L.data=Sp(L.data),L=x.nextNode()},Pa=function(y){const x=D?D(y):null;return typeof x!="string"||Be(x)!=="form"?!1:typeof y.nodeName!="string"||typeof y.textContent!="string"||typeof y.removeChild!="function"||y.attributes!==P(y)||typeof y.removeAttribute!="function"||typeof y.removeAttributeNode!="function"||typeof y.getAttributeNode!="function"||typeof y.setAttribute!="function"||typeof y.namespaceURI!="string"||typeof y.insertBefore!="function"||typeof y.hasChildNodes!="function"||y.nodeType!==E(y)||y.childNodes!==k(y)},Dg=function(y){if(!E||typeof y!="object"||y===null)return null;try{const x=E(y);return typeof x=="number"?x:null}catch{return null}},bo=function(y){return Dg(y)===Ie.documentFragment},Sn=function(y){return Dg(y)!==null};function Ot(B,y,x){B.length!==0&&Vt(B,L=>{L.call(t,y,x,wa)})}const TE=function(y,x,L){return!!(ce&&L===Ie.element&&y.hasChildNodes()&&!Sn(y.firstElementChild)&&Ve(ql,y.textContent)&&Ve(ql,y.innerHTML)||ce&&Kw[x]&&L===Ie.element&&I(y)===ye&&(Sn(y.firstElementChild)||typeof y.textContent=="string"&&Ve(ql,y.textContent))||L===Ie.processingInstruction||ce&&L===Ie.comment&&Ve(km,y.data))},Ea=function(y,x){if(y instanceof RegExp)return Ve(y,x);if(y instanceof Function){for(var L=arguments.length,z=new Array(L>2?L-2:0),Y=2;Y<L;Y++)z[Y-2]=arguments[Y];return!!y(x,...z)}return!1},ME=function(y,x,L){if(!V[x]&&Rg(x)&&Ea(U.tagNameCheck,x))return!1;if(Ae&&!Pt[x]&&!Pt[Br(x)]){const z=v(y),Y=k(y);if(Y&&z){const re=Y.length;for(let de=re-1;de>=0;--de){const qe=y===L?c(Y[de],!0):Y[de];z.insertBefore(qe,b(y))}}}return mr(y),!0},Ag=function(y,x,L,z){return y.length===0?x:x===L||x===z?mn(x):x},ko=function(y,x){return y===x||v(y)!==null?!1:(qt&&Pp(y),!0)},CE=function(y,x){if(EE(y),Ot(se.beforeSanitizeElements,y,null),ko(y,x))return!0;if(Pa(y))return mr(y),!0;const L=Be(R(y)),z=A(y);if(xe=Ag(se.uponSanitizeElement,xe,Dt,Ke),Ot(se.uponSanitizeElement,y,{tagName:L,allowedTags:xe}),ko(y,x))return!0;if(TE(y,L,z))return mr(y),!0;if(V[L]||!(J.tagCheck instanceof Function&&J.tagCheck(L))&&!xe[L]){const Y=ME(y,L,x);return Y===!1&&(Ot(se.afterSanitizeElements,y,null),ko(y,x))?!0:Y}if(z===Ie.element&&!yE(y)||(L==="noscript"||L==="noembed"||L==="noframes")&&Ve(Ww,y.innerHTML))return mr(y),!0;if(ie&&z===Ie.text){const Y=y.textContent,re=Sp(Y);Y!==re&&(un(t.removed,{element:y.cloneNode()}),y.textContent=re)}return Ot(se.afterSanitizeElements,y,null),ko(y,x)},Og=function(y,x,L){if(j[x]||Cg(x,y)||At&&(x==="id"||x==="name")&&(L in r||L in mE))return!1;const z=C[x]||J.attributeCheck instanceof Function&&J.attributeCheck(x,y);if(T&&Ve(Ee,x)||pe&&Ve(ho,x))return!0;if(!z)return Rg(y)&&Ea(U.tagNameCheck,y)&&Ea(U.attributeNameCheck,x,y)||x==="is"&&U.allowCustomizedBuiltInElements&&Ea(U.tagNameCheck,L);if(Ue[x])return!0;const Y=sa(L,wn,"");return Ve(mo,Y)||(x==="src"||x==="xlink:href"||x==="href")&&y!=="script"&&Fl(L,"data:")===0&&hr[y]||X&&!Ve(vn,Y)?!0:!L},_E=be({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Rg=function(y){return!_E[Br(y)]&&Ve(xn,y)},DE=function(y,x,L,z){if(S&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!L)switch(d.getAttributeType(y,x)){case"TrustedHTML":return ne(z);case"TrustedScriptURL":return Pe(z)}return z},AE=function(y,x,L,z){try{return L?y.setAttributeNS(L,x,z):y.setAttribute(x,z),Pa(y)?(mr(y),!1):!0}catch{return go(x,y),!1}},Ig=function(y,x){return ce&&Ve(Vw,x)?!0:Br(y)==="attributename"&&Fl(x,"href")!==-1},OE=function(y,x){if(Ot(se.beforeSanitizeAttributes,y,null),ko(y,x))return;const L=y.attributes;if(!L||Pa(y))return;C=Ag(se.uponSanitizeAttribute,C,q,ot);const z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:C,forceKeepAttr:void 0};let Y=L.length;const re=Be(R(y));for(;Y--;){const de=L[Y],qe=de.name,Qt=de.namespaceURI,Rt=de.value,mt=Be(qe),jt=Rt;let Ye=qe==="value"?jt:Sw(jt),Lg=!1;if(z.attrName=mt,z.attrValue=Ye,z.keepAttr=!0,z.forceKeepAttr=void 0,Ot(se.uponSanitizeAttribute,y,z),Ye=z.attrValue,Hr&&(mt==="id"||mt==="name")&&Fl(Ye,ut)!==0&&(go(qe,y,de),Ye=ut+Ye,Lg=!0),Ig(qe,Ye)){go(qe,y,de);continue}if(!z.forceKeepAttr){if(!z.keepAttr){go(qe,y,de);continue}if(!ee&&Ve(ym,Ye)){go(qe,y,de);continue}if(ie&&(Ye=Sp(Ye)),!Og(re,mt,Ye)){go(qe,y,de);continue}Ye=DE(re,mt,Qt,Ye),Ye!==jt&&AE(y,qe,Qt,Ye)&&Lg&&pm(t.removed)}}Ot(se.afterSanitizeAttributes,y,null),ko(y,x)},Cp=function(y,x){CE(y,x),OE(y,x),bo(y.content)&&_p(y.content)},_p=function(y){let x=null;const L=xa(y);for(Ot(se.beforeSanitizeShadowDOM,y,null);x=L.nextNode();)if(Ot(se.uponSanitizeShadowNode,x,null),Cp(x,y),A(x)===Ie.element){const z=w(x);bo(z)&&(Dp(z),_p(z))}ie&&Mp(y),Ot(se.afterSanitizeShadowDOM,y,null)},Dp=function(y){const x=[{node:y,shadow:null}];for(;x.length>0;){const L=x.pop();if(L.shadow){_p(L.shadow);continue}const z=L.node,Y=A(z)===Ie.element,re=k(z);if(re)for(let de=re.length-1;de>=0;--de)x.push({node:re[de],shadow:null});if(Y){const de=D?D(z):null;if(typeof de=="string"&&Be(de)==="template"){const qe=z.content;bo(qe)&&x.push({node:qe,shadow:null})}}if(Y){const de=w(z);bo(de)&&x.push({node:null,shadow:de},{node:de,shadow:null})}}};return t.sanitize=function(B){let y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},x=null,L=null,z=null,Y=null;if(ht=!B,ht&&(B="<!-->"),typeof B!="string"&&!Sn(B)&&(B=Dw(B),typeof B!="string"))throw Gt("dirty is not a string, aborting");if(!t.isSupported)return B;Le?(xe=Ke,C=ot):yp(y),t.removed=[];const re=qt&&typeof B!="string"&&Sn(B);let de=[];const qe=xt;if(re){SE(B);const jt=R(B);if(typeof jt=="string"){const Ye=Be(jt);if(!xe[Ye]||V[Ye])throw vp(B),Gt("root node is forbidden and cannot be sanitized in-place")}if(Pa(B))throw vp(B),Gt("root node is clobbered and cannot be sanitized in-place");de=Ep(B),xt=Ll()}else if(Sn(B))x=_g("<!---->"),L=x.ownerDocument.importNode(B,!0),L.nodeType===Ie.element&&L.nodeName==="BODY"||L.nodeName==="HTML"?x=L:x.appendChild(L),Dp(x);else{if(!ct&&!ie&&!Te&&B.indexOf("<")===-1)return Se(B);if(x=_g(B),!x)return ct?null:De?N:""}x&&He&&mr(x.firstChild);const Qt=re?B:x;try{re&&Dp(B);const jt=xa(Qt);for(;z=jt.nextNode();)Cp(z,Qt);re&&xE(B,de)}catch(jt){throw re&&(vp(B),Mg(B,de)),jt}finally{xt=qe}if(re){if(Mg(B,de))throw Gt("a node selected for removal could not be safely returned; refusing to sanitize in place");return ie&&Tp(B),B}if(ct){if(ie&&Tp(x),Ce)for(Y=ke.call(x.ownerDocument);x.firstChild;)Y.appendChild(x.firstChild);else Y=x;return(C.shadowroot||C.shadowrootmode)&&(Y=Me.call(o,Y,!0)),Y}const Rt=()=>Te?x.outerHTML:x.innerHTML;let mt=Rt();return ie&&Ve(Fw,mt)&&(Mp(x),mt=Rt()),Te&&xe["!doctype"]&&x.ownerDocument&&x.ownerDocument.doctype&&x.ownerDocument.doctype.name&&Ve(qw,x.ownerDocument.doctype.name)&&(mt="<!DOCTYPE "+x.ownerDocument.doctype.name+`>
296
+ `+mt),Se(mt)},t.setConfig=function(){let B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};yp(B),Le=!0,Ke=xe,ot=C},t.clearConfig=function(){wa=null,Le=!1,Ke=null,ot=null,S=F,N=""},t.isValidAttribute=function(B,y,x){wa||yp({});const L=Be(B),z=Be(y);return typeof x=="string"&&(Ig(y,x)||!ee&&Ve(ym,x))?!1:Og(L,z,x)},t.addHook=function(B,y){typeof y=="function"&&Ze(se,B)&&un(se[B],y)},t.removeHook=function(B,y){if(Ze(se,B)){if(y!==void 0){const x=ww(se[B],y);return x===-1?void 0:Pw(se[B],x,1)[0]}return pm(se[B])}},t.removeHooks=function(B){Ze(se,B)&&(se[B]=[])},t.removeAllHooks=function(){se=vm()},t}var Zw=wm();const Jw={contain:"xMidYMid meet",cover:"xMidYMid slice",fill:"none",none:"xMidYMid meet","scale-down":"xMidYMid meet"};function Qw(e,t){const r=e.options;return Us(r.formatter,t,String(r.testData||r.title||""))||"1234567890128"}function ex(e){return g("div",{class:"print-qrcode",dataset:{codeId:e.id,codeKind:"qrcode"}})}function tx(e){const t=e.options;return g("div",{class:"print-barcode",dataset:{codeId:e.id,codeKind:"barcode"}},[g("svg",{preserveAspectRatio:Jw[String(t.fit||"contain")]??"xMidYMid meet",style:{maxWidth:"100%",maxHeight:"100%"}})])}function rx(e){const t=(e.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number);return t.length!==4||t.some(r=>!Number.isFinite(r))?null:{width:t[2],height:t[3]}}function ox(e,t,r){const o=e.options,n=Do(o.barWidth),i=qa(o.barQuietZone),a=s=>{js(t,Qw(e,r),{format:String(o.barcodeType||"CODE128"),width:n,height:s*n,displayValue:!o.hideTitle,fontSize:(o.fontSize??Nn)*n,margin:0,marginLeft:i*n,marginRight:i*n,marginTop:0,marginBottom:ja*n});const p=rx(t);return p?{widthUnits:p.width,heightUnits:p.height}:null};try{const s=Va({barHeightMm:o.barHeight,boxWidthMm:Kr(o.width,o.maxWidth),boxHeightMm:Kr(o.height,o.maxHeight),dpi:o.printerDpi,barWidth:o.barWidth,measure:a});t.style.width=s.size?`${s.size.widthMm}mm`:"",t.style.height=s.size?`${s.size.heightMm}mm`:""}catch{t.replaceChildren();return}t.setAttribute("shape-rendering","crispEdges")}function nx(e,t,r){const o=e.options,n=Us(o.formatter,r,String(o.testData||o.title||""))||oe("code.k27");t.replaceChildren();try{const i=ml.render(n,"qrcode",{qrCodeLevel:String(o.qrCodeLevel??"M"),qrQuietZone:typeof o.qrQuietZone=="number"?o.qrQuietZone:void 0}),a=document.createElement("img");a.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(i)}`,a.alt="qrcode",a.style.width="100%",a.style.height="100%",a.style.objectFit=String(o.fit||"contain"),a.style.maxWidth=o.maxWidth?`${o.maxWidth}mm`:"100%",a.style.maxHeight=o.maxHeight?`${o.maxHeight}mm`:"100%",t.appendChild(a)}catch{}}function ix(e,t,r){for(const o of Array.from(e.querySelectorAll("[data-code-kind]"))){const n=o.dataset.codeId,i=t.find(a=>a.id===n);if(i)if(o.dataset.codeKind==="barcode"){const a=o.querySelector("svg");a&&ox(i,a,r)}else nx(i,o,r)}}const da=new Map;function ax(e){return typeof Node<"u"&&e instanceof Node}function xm(e,t,r){if(Pm(e),typeof t=="string"){r.innerHTML=t;return}if(ax(t)){r.appendChild(t);return}typeof t.node=="string"?r.innerHTML=t.node:r.appendChild(t.node),typeof t.dispose=="function"&&da.set(e,t.dispose)}function Pm(e){const t=da.get(e);if(t){da.delete(e);try{t()}catch{}}}function Em(){for(const e of[...da.keys()])Pm(e)}const sx={header:"table.k450",data:"table.k451",subtotal:"table.k452",summary:"table.k453"},lx=[{value:"header",labelKey:"table.k454"},{value:"data",labelKey:"table.k455"},{value:"subtotal",labelKey:"table.k456"},{value:"summary",labelKey:"table.k457"}],ca=3.7795275591,px=.1,Wl=e=>JSON.parse(JSON.stringify(e)),Sm=new WeakMap;function Kt(e){let t=Sm.get(e);return t||(t={menu:null,menuElId:null,anchor:null,layouts:new Map},Sm.set(e,t)),t}function gn(e,t){return e.templateData.elements.find(r=>r.id===t)??null}function dx(e,t){const r=e.tableSelection;return!r||r.elementId!==t.id?null:e.selectedElement?.id!==t.id?(e.tableSelection=null,null):r}function Tm(e,t,r,o){const n=gn(e,r.id);if(!n)return null;const i=r.options;return{store:e,fire:t,el:r,real:n,options:i,rows:i.tableRows??[],colWidths:i.tableColWidths??[],isSelected:e.selectedIds.has(r.id),selection:dx(e,r),maxTableWidth:Mm(e),designData:o}}function Mm(e){return e.paperSize.width-e.templateData.margins.left-e.templateData.margins.right}function Vl(e){return e.options.tableDefaultFontSize??10}function Cm(e){return e.options.tableDefaultColor??"#333333"}function cx(e,t){let r=0;for(let o=0;o<t;o++)r+=e.rows[o].height;return r}function ux(e,t){return Kt(e.store).layouts.get(e.el.id)?.[t]?.top??cx(e,t)}function fx(e,t){return Kt(e.store).layouts.get(e.el.id)?.[t]?.height??e.rows[t]?.height??0}function hx(e){const t=e.options.dataSource;if(t)return Array.isArray(vt[t])?vt[t]:void 0;for(const r of Object.values(vt))if(Array.isArray(r))return r}function _m(e){return e.cellType==="barcode"||e.cellType==="qrcode"}function Dm(e,t){return _m(t)?Us(t.formatter,hx(e)):t.formatter||""}function mx(e,t){const r={designMode:!0,showGhostBorder:e.store.showTableGhostBorder};return{fontFamily:Ts(t.fontFamily??e.options.tableDefaultFontFamily),textAlign:t.align??"left",...t.align==="justify"?{textAlignLast:"justify"}:{},verticalAlign:t.valign??"middle",fontSize:(t.fontSize??Vl(e))+"pt",fontWeight:t.fontWeight??"normal",color:t.color??Cm(e),backgroundColor:t.backgroundColor??"transparent",borderTop:Rn(t.borders?.top,r),borderRight:Rn(t.borders?.right,r),borderBottom:Rn(t.borders?.bottom,r),borderLeft:Rn(t.borders?.left,r),padding:(t.padding??e.options.tableDefaultPadding??1)+"mm",whiteSpace:t.wordWrap??!0?"pre-wrap":"nowrap",overflow:t.wordWrap??!0?"visible":"hidden"}}function gx(e,t,r){const o=e.selection;return[!!o&&t>=o.r1&&t<=o.r2&&r>=o.c1&&r<=o.c2?"cell-selected":"",e.rows[t]?.type==="data"?"row-data-bg":""].filter(Boolean).join(" ")}function Am(e){return Fa(e)}function bx(e){return Am(e)!=="autoHeight"}function kx(e,t){return t.fontSize??Vl(e)}function ua(e,t,r){return Co(e.rows,t,r,e.options.tableDefaultPadding??1)}function yx(e,t,r){return za(e.colWidths,t,r,e.options.tableDefaultPadding??1)}function vx(e,t,r){return{maxHeight:ua(e,r,t)+"mm",overflow:"hidden",...t.wordWrap===!1?{whiteSpace:"nowrap",textOverflow:"ellipsis"}:{}}}function wx(e,t,r){const o={fitBase:String(kx(e,t)),fitMin:String(Mo(t.shrinkMinFontSize)),fitMm:String(ua(e,r,t))};return Am(t)==="shrink"&&(o.fit="shrink"),o}function xx(e){const t=(e.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number);return t.length!==4||t.some(r=>!Number.isFinite(r))?null:{width:t[2],height:t[3]}}const Px={contain:"xMidYMid meet",cover:"xMidYMid slice",fill:"none",none:"xMidYMid meet","scale-down":"xMidYMid meet"};function Ex(e,t,r,o){const n=document.createElement("div");n.className="cell-barcode";const i=document.createElementNS(N2,"svg");n.appendChild(i);const a=Dm(e,o);if(o.cellType==="barcode"){i.setAttribute("preserveAspectRatio",Px[o.fit||"contain"]??"xMidYMid meet");const s=Do(o.barWidth),p=qa(o.barQuietZone),l=c=>{js(i,a,{format:o.barcodeType||"CODE128",width:s,height:c*s,displayValue:o.showBarcodeText!==!1,fontSize:(o.barFontSize??Nn)*s,margin:0,marginLeft:p*s,marginRight:p*s,marginTop:0,marginBottom:ja*s});const f=xx(i);return f?{widthUnits:f.width,heightUnits:f.height}:null};let d=null;try{d=Va({barHeightMm:o.barHeight,boxWidthMm:Kr(yx(e,r,o),o.maxWidth),boxHeightMm:Kr(ua(e,t,o),o.maxHeight),dpi:o.printerDpi,barWidth:o.barWidth,measure:l})}catch{d=null}if(!d){i.style.display="none";const c=document.createElement("span");return c.className="cell-barcode-fallback",c.textContent=a||m(e,"table.k458"),n.appendChild(c),n}const u=d.size;return u?(i.style.width=`${u.widthMm}mm`,i.style.height=`${u.heightMm}mm`):(i.style.maxWidth=o.maxWidth?`${o.maxWidth}mm`:"100%",i.style.maxHeight=o.maxHeight?`${o.maxHeight}mm`:"100%"),i.setAttribute("shape-rendering","crispEdges"),n}if(i.style.display="none",!a)return n;try{const s=ml.render(a,"qrcode",{qrCodeLevel:String(o.qrCodeLevel||"M"),qrQuietZone:typeof o.qrQuietZone=="number"?o.qrQuietZone:void 0}),p=document.createElement("img");p.setAttribute("src",`data:image/svg+xml;charset=utf-8,${encodeURIComponent(s)}`),p.setAttribute("alt","qrcode"),p.style.width="100%",p.style.height="100%",p.style.objectFit=o.fit||"contain",o.objectPosition&&(p.style.objectPosition=o.objectPosition),p.style.maxWidth=o.maxWidth?`${o.maxWidth}mm`:"100%",p.style.maxHeight=o.maxHeight?`${o.maxHeight}mm`:"100%",n.appendChild(p)}catch{}return n}function Om(){const e=document.createElement("div");return e.className="image-placeholder",e.textContent=oe("table.k459"),e}function Sx(e,t){const r=e.formatter||"";if(!r)return"";if(!r.includes("{"))return r;const o=t.designData?.length?t.designData[0]:vt;return to(r,o)}function Tx(e,t,r){const o=document.createElement("div");o.className="cell-image";const n=kd(r.fit,ua(e,t,r));n!==void 0&&(o.style.height=`${n}mm`);const i=Sx(r,e);if(!i)return o.appendChild(Om()),o;const a=document.createElement("img");a.setAttribute("src",i),n!==void 0&&(a.style.width="100%",a.style.height="100%"),a.style.objectFit=r.fit||"contain";for(const[s,p]of Object.entries(Ga(r.fit,r.fitScale,r.objectPosition)))a.style[s]=p;return a.style.maxWidth=r.maxWidth?`${r.maxWidth}mm`:"100%",a.style.maxHeight=r.maxHeight?`${r.maxHeight}mm`:"100%",a.addEventListener("error",()=>{a.remove(),o.appendChild(Om())},{once:!0}),o.appendChild(a),o}function Mx(e,t,r,o,n){if(_m(n))return Ex(e,r,o,n);if(n.cellType==="image")return Tx(e,r,n);const i=Dm(e,n),a=()=>t.type==="data"?g("span",{class:"data-placeholder",text:i}):i;return bx(n)?g("div",{class:"cell-fit",style:vx(e,n,r),dataset:wx(e,n,r)},[a()]):a()}function fa(e,t,r){const o={elementId:e.el.id,...Jp(e.rows,t,r)};e.store.setTableSelection(o),e.fire("table-selection-change",{elementId:e.el.id,selection:o})}function Cx(e,t,r,o,n){if(n.button!==0||(e.fire("table-cell-mousedown",{elementId:e.el.id,r:t,c:r,cellId:o,event:n}),!e.isSelected))return;n.stopPropagation();const i=Kt(e.store);n.shiftKey&&e.selection?fa(e,{r:e.selection.r1,c:e.selection.c1},{r:t,c:r}):(i.anchor={r:t,c:r},fa(e,{r:t,c:r},{r:t,c:r})),document.addEventListener("mouseup",()=>{Kt(e.store).anchor=null},{once:!0})}function _x(e,t,r){const o=Kt(e.store).anchor;o&&fa(e,o,{r:t,c:r})}function Gl(e,t){const r=Kt(e);r.menu?.visible&&(r.menu.visible=!1,t("table-menu-close",{elementId:r.menuElId}),e.emit(!1))}function Dx(e,t,r,o){o.preventDefault(),o.stopPropagation(),e.isSelected||e.store.selectOne(e.el.id);const n=e.selection;n&&t>=n.r1&&t<=n.r2&&r>=n.c1&&r<=n.c2||fa(e,{r:t,c:r},{r:t,c:r});const a=Kt(e.store);a.menuElId=e.el.id,a.menu&&(a.menu.x=o.clientX,a.menu.y=o.clientY,a.menu.visible=!0),e.fire("table-cell-contextmenu",{elementId:e.el.id,r:t,c:r,clientX:o.clientX,clientY:o.clientY}),e.store.emit(!1),document.addEventListener("mousedown",()=>Gl(e.store,e.fire),{once:!0})}function Rm(e,t,r){const o=e.reduce((n,i)=>n+i,0)+(e[t]??0);return o>r?oe("table.k460",{v0:Math.round(o*10)/10,v1:r}):null}function Ax(e,t){const r=e.real.options.tableRows??[],o=e.real.options.tableColWidths??[],n=t(Wl(r),Wl(o));return n?(window.alert(n),!1):(e.store.recordHistory(),t(r,o),e.store.setTableSelection(null),Eo(e.real.options),e.store.emit(),!0)}function Yt(e,t,r){Gl(e.store,e.fire);const o=e.selection;if(!o)return;let n=null;switch(t){case"insert-row-above":n=i=>(rd(i,o.r1,"above"),null);break;case"insert-row-below":n=i=>(rd(i,o.r2,"below"),null);break;case"delete-row":n=i=>Sb(i,o.r1);break;case"insert-col-left":n=(i,a)=>{const s=Rm(a,o.c1,e.maxTableWidth);return s||(od(i,a,o.c1,"left"),null)};break;case"insert-col-right":n=(i,a)=>{const s=Rm(a,o.c2,e.maxTableWidth);return s||(od(i,a,o.c2,"right"),null)};break;case"delete-col":n=(i,a)=>Tb(i,a,o.c1);break;case"merge":n=i=>(ed(i,o),null);break;case"split":n=i=>(td(i,o),null);break;case"set-row-type":n=i=>r?Ia(i,o.r1,r):m(e,"table.k461");break}n&&Ax(e,n)&&e.fire(`table-${t}`,{elementId:e.el.id,...r?{type:r}:{}})}function Ox(e){const t=e.selection;if(!t)return!1;for(let r=t.r1;r<=t.r2;r++)for(let o=t.c1;o<=t.c2;o++){const n=e.rows[r]?.cells[o];if(n&&!n.merged&&((n.rowspan??1)>1||(n.colspan??1)>1))return!0}return!1}function Rx(e){const t=e.selection;if(!t)return;const r=Po(e.rows,t.r1,t.c1),o=!e.rows[r.r]?.cells[r.c]?.mergeSameValue;for(let n=t.r1;n<=t.r2;n++)for(let i=t.c1;i<=t.c2;i++){const a=e.rows[n]?.cells[i];a&&!a.merged&&(a.mergeSameValue=o)}e.store.updateElement(e.el.id,{tableRows:e.rows}),Gl(e.store,e.fire)}function Im(e){const t=e.selection;if(!t)return m(e,"table.k462");for(let r=t.r1;r<=t.r2;r++)if(e.rows[r]?.type!=="data")return m(e,"table.k463");return null}function Lm(e,t){const r=e.selection;return r?r.r1!==r.r2?m(e,"table.k465"):Ia(Wl(e.rows),r.r1,t):m(e,"table.k464")}function zt(e,t,r={}){return g("div",{class:`menu-item${r.disabled?" disabled":""}${r.active?" active":""}`,title:r.title||"",text:e,onClick:()=>{r.disabled||t()}})}const Kl=()=>g("div",{class:"menu-divider"});function Ix(e,t,r){const o=Kt(e);if(o.menu=r,!r.visible||!o.menuElId)return"";const n=gn(e,o.menuElId);if(!n||n.printElementType.type!=="table")return"";const i=Tm(e,t,n);if(!i)return"";const a=i.selection?Qp(i.rows,i.selection):m(i,"table.k466"),s=i.selection?i.rows[i.selection.r1]?.type??null:null;return g("div",{class:"table-ctx-menu",style:{left:r.x+"px",top:r.y+"px"},onMousedown:p=>p.stopPropagation()},[zt(m(i,"table.k467"),()=>Yt(i,"insert-row-above")),zt(m(i,"table.k468"),()=>Yt(i,"insert-row-below")),zt(m(i,"table.k469"),()=>Yt(i,"delete-row"),{disabled:i.rows.length<=1}),Kl(),zt(m(i,"table.k470"),()=>Yt(i,"insert-col-left")),zt(m(i,"table.k471"),()=>Yt(i,"insert-col-right")),zt(m(i,"table.k472"),()=>Yt(i,"delete-col"),{disabled:i.colWidths.length<=1}),Kl(),zt(m(i,"table.k473"),()=>Yt(i,"merge"),{disabled:!!a,title:a||""}),zt(m(i,"table.k474"),()=>Yt(i,"split"),{disabled:!Ox(i)}),zt(m(i,"table.k475"),()=>Rx(i),{disabled:!!Im(i),title:Im(i)||"",active:(()=>{const p=i.selection;if(!p)return!1;const l=Po(i.rows,p.r1,p.c1);return i.rows[l.r]?.cells[l.c]?.mergeSameValue===!0})()}),Kl(),g("div",{class:"menu-group-title",text:m(i,"table.k476")}),...lx.map(p=>zt(oe(p.labelKey),()=>Yt(i,"set-row-type",p.value),{disabled:!!Lm(i,p.value),title:Lm(i,p.value)||"",active:s===p.value}))])}let Nr=null;function Bm(){Nr&&(document.removeEventListener("mousemove",Yl),document.removeEventListener("mouseup",Xl),Nr.handle.classList.remove("dragging"),Nr=null)}function Lx(e,t){const r=e.closest(".hiprint-printPaper");return(r&&r.offsetWidth>0?r.getBoundingClientRect().width/r.offsetWidth:0)||(t.scale||100)/100}function Bx(e,t,r){if(r.button!==0)return;const o=r.currentTarget,n=o.closest(".print-table");if(!n)return;Bm();const i=e.real.options.tableColWidths??[];Nr={store:e.store,fire:e.fire,elId:e.real.id,boundary:t,startX:r.clientX,startWidth:i[t-1]??0,scale:Lx(n,e.store),root:n,wrapper:o.closest(".print-element"),handle:o},o.classList.add("dragging"),e.store.recordHistory(),document.addEventListener("mousemove",Yl),document.addEventListener("mouseup",Xl)}function Yl(e){const t=Nr;if(!t)return;const r=gn(t.store,t.elId),o=r?.options.tableColWidths;if(!r||!o)return;const n=(e.clientX-t.startX)/(t.scale*ca),i=t.boundary-1;o[i]=Rb(o,i,t.startWidth+n,Mm(t.store)),Eo(r.options),o.forEach((a,s)=>{const p=t.root.querySelector(`colgroup col:nth-child(${s+1})`);p&&(p.style.width=`${a}mm`)}),t.root.querySelectorAll(".col-resize-handle").forEach((a,s)=>{a.style.left=`${o.slice(0,s+1).reduce((p,l)=>p+l,0)}mm`}),t.wrapper&&(t.wrapper.style.width=`${r.options.width}mm`,t.wrapper.style.height=`${r.options.height}mm`)}function Xl(){document.removeEventListener("mousemove",Yl),document.removeEventListener("mouseup",Xl);const e=Nr;if(!e)return;Nr=null,e.handle.classList.remove("dragging");const t=gn(e.store,e.elId);t&&Eo(t.options),e.store.emit(),e.fire("table-col-resize-end",{elementId:e.elId})}function Nx(e,t,r){const o=r.querySelector("table");if(!o)return;const n=o.offsetHeight;if(n<=0)return;const i=gn(e,t);if(!i)return;let a=!1;const s=n/ca;Math.abs(s-(i.options.height??0))>px&&(i.options.height=Math.round(s*100)/100,a=!0);const p=o.offsetTop,l=Array.from(o.rows).map(u=>({top:(u.offsetTop-p)/ca,height:u.offsetHeight/ca})),d=Kt(e);Fx(d.layouts.get(t),l)||(d.layouts.set(t,l),a=!0),a&&e.emit(!1)}function Fx(e,t){return!e||e.length!==t.length?!1:t.every((r,o)=>{const n=e[o];return Math.round(r.top*10)===Math.round(n.top*10)&&Math.round(r.height*10)===Math.round(n.height*10)})}function $x(e,t){const r=document.createComment("pd-table-measure");return requestAnimationFrame(()=>{if(!r.isConnected)return;const o=r.parentElement;o&&Nx(e,t,o)}),r}function zx(e){return e.isSelected&&!e.real.options.locked&&e.colWidths.length>=1}function Hx(e){return Array.from({length:e.colWidths.length},(t,r)=>r+1)}function Ux(e,t){return e.colWidths.slice(0,t).reduce((r,o)=>r+o,0)}function qx(e,t,r,o){const n=Tm(t,r,e,o);if(!n)return g("div",{class:"print-table"});const i=[g("table",{style:{fontSize:`${Vl(n)}pt`,color:Cm(n)}},[g("colgroup",{},n.colWidths.map(a=>g("col",{style:{width:a+"mm"}}))),g("tbody",{},n.rows.map((a,s)=>g("tr",{style:{height:a.height+"mm"}},a.cells.map((p,l)=>p.merged?"":g("td",{rowspan:p.rowspan||1,colspan:p.colspan||1,class:gx(n,s,l),style:mx(n,p),onMousedown:d=>Cx(n,s,l,p.id,d),onMouseenter:()=>_x(n,s,l),onContextmenu:d=>Dx(n,s,l,d)},[Mx(n,a,s,l,p)])).filter(Boolean))))])];return zx(n)&&i.push(g("div",{class:"col-resize-layer"},Hx(n).map(a=>g("div",{class:"col-resize-handle",role:"separator","aria-label":m(n,"table.k477",{v0:a}),style:{left:Ux(n,a)+"mm"},onMousedown:s=>{s.stopPropagation(),s.preventDefault(),Bx(n,a,s)}})))),n.isSelected&&i.push(g("div",{class:"row-badges"},n.rows.map((a,s)=>g("span",{class:"row-badge",style:{top:ux(n,s)+"mm",height:fx(n,s)+"mm"},text:oe(sx[a.type])})))),i.push($x(t,e.id)),g("div",{class:"print-table design-mode",dataset:{tableId:e.id},onContextmenu:a=>a.preventDefault()},i)}const jx=["flowList.k44","flowList.k45","flowList.k46","flowList.k47","flowList.k48","flowList.k49","flowList.k50"];function Wx(){return jx.map(e=>oe(e))}function Zl(e){return Array.isArray(e)&&e.length>0?e:[]}function Vx(e,t){const r=Bn(e,t)??(t?Object.keys(t).find(n=>Array.isArray(t[n])):void 0);if(r)return Zl(t?.[r]);const o=Bn(e,vt);return o?Zl(vt[o]):[]}function Gx(e,t){const r=e.options,o=typeof r.formatter=="string"?r.formatter:"",n=Zl(t)[0],i=Vx(o,n);if(i.length===0)return Wx();if(!o)return i.map(p=>String(p?.name??JSON.stringify(p)));const a=n??{},s=Bn(o,a)??Object.keys(a).find(p=>Array.isArray(a[p]));return i.map(p=>{try{return to(o,{...a,...p,...s?{[s]:p}:{}})}catch{return o}})}const Kx=3.7795275591,Yx=.1;function Xx(e,t){return e.templateData.elements.find(r=>r.id===t)??null}function Zx(e){const t=e.parentElement;if(!t?.classList.contains("print-element"))return 0;const r=getComputedStyle(t);return(parseFloat(r.borderTopWidth)||0)+(parseFloat(r.borderBottomWidth)||0)}function Jx(e,t,r){const o=r.offsetHeight+Zx(r);if(o<=0)return;const n=Xx(e,t);if(!n)return;const i=o/Kx;Math.abs(i-(n.options.height??0))>Yx&&(n.options.height=Math.round(i*100)/100,e.emit(!1))}function Qx(e,t){const r=document.createComment("pd-flowlist-measure");return requestAnimationFrame(()=>{if(!r.isConnected)return;const o=r.parentElement;o&&Jx(e,t,o)}),r}function eP(e,t,r){const o=e.options,n=bt(o.flowColumns),i=Et(o.flowGapX),a=or(o.flowRowHeight),s=wr(o.flowLayoutMode)==="dynamic",p=Gr(o),l={display:"grid",gridTemplateColumns:`repeat(${n},minmax(0,1fr))`,columnGap:`${i}mm`,gridAutoRows:`minmax(${a}mm,auto)`,width:"100%",...s?{padding:`${p.top}mm ${p.right}mm ${p.bottom}mm ${p.left}mm`,height:"auto",overflow:"visible"}:{height:"100%",overflow:"hidden"},fontSize:`${o.fontSize||12}pt`,fontWeight:o.fontWeight||"normal",color:o.color||"#333",boxSizing:"border-box"};o.fontFamily&&(l.fontFamily=String(o.fontFamily)),o.backgroundColor&&(l.backgroundColor=String(o.backgroundColor));const d=Gx(e,t).map(u=>g("div",{class:"print-flow-cell",text:u}));return s&&r&&d.push(Qx(r,e.id)),g("div",{class:"print-flowlist",style:l},d)}const Nm={top:"flex-start",middle:"center",bottom:"flex-end"},tP={left:"flex-start",center:"center",right:"flex-end"};function rP(e,t){const r=e.options,o=kt(r),n=zn(e.printElementType.type,r),i={};if(n?.all&&(i.border=`${n.all.borderWidth} ${n.all.borderStyle} ${n.all.borderColor}`),n)for(const a of Ao){const s=n.edges[a];s&&(i[`border${a.charAt(0).toUpperCase()}${a.slice(1)}`]=`${s.borderWidth} ${s.borderStyle} ${s.borderColor}`)}return{position:"absolute",left:`${r.left}mm`,top:`${r.top}mm`,width:`${r.width}mm`,height:`${r.height}mm`,...o.top!==0?{marginTop:`${o.top}mm`}:{},...o.right!==0?{marginRight:`${o.right}mm`}:{},...o.bottom!==0?{marginBottom:`${o.bottom}mm`}:{},...o.left!==0?{marginLeft:`${o.left}mm`}:{},zIndex:String(r.zIndex||"auto"),...i,...oP(e,t)}}function oP(e,t){if(t?.has(e.id))return{};const r=Ka(e.printElementType.type,e.options);return r===void 0?{}:{rotate:`${r}deg`}}function Fm(e){const t=e.options,r=e.printElementType.type==="longText",o=Ln(e.printElementType.type,t),n=t.fontSize||12,i=o==="autoHeight",a={fontSize:`${n}pt`,fontWeight:t.fontWeight||"normal",fontFamily:Ts(t.fontFamily),color:t.color||"#333",backgroundColor:t.backgroundColor||"transparent",textAlign:t.textAlign||"left",...t.textAlign==="justify"?{textAlignLast:"justify"}:{},lineHeight:t.lineHeight?`${t.lineHeight}pt`:r?"1.5":"normal",letterSpacing:t.letterSpacing?`${t.letterSpacing}pt`:"normal",width:"100%",height:i?"auto":"100%",boxSizing:"border-box",overflow:i?"visible":"hidden",...r?{wordBreak:"break-all",textIndent:t.longTextIndent?`${t.longTextIndent}em`:"0"}:{textDecoration:t.textDecoration||"none",padding:`${t.contentPaddingTop||0}pt ${t.contentPaddingRight||0}pt ${t.contentPaddingBottom||0}pt ${t.contentPaddingLeft||0}pt`}};bd(t)&&(a.whiteSpace="nowrap",a.textOverflow="ellipsis");const s=gd(t);return s&&(a.whiteSpace=s),t.verticalAlign&&(a.display="flex",t.textAlign==="justify"?(a.flexDirection="column",a.justifyContent=Nm[t.verticalAlign]??"flex-start"):(a.alignItems=Nm[t.verticalAlign]??"flex-start",a.justifyContent=tP[t.textAlign||"left"]??"flex-start")),{style:a,fit:o}}function $m(e){const t=e.options,r=`${t.borderWidth||.75}pt`,o=t.borderStyle||"solid",n=t.borderColor||"#333";return e.printElementType.type==="hline"?{width:"100%",height:"0",borderTop:`${r} ${o} ${n}`,boxSizing:"border-box"}:{width:"0",height:"100%",borderLeft:`${r} ${o} ${n}`,boxSizing:"border-box"}}function zm(e){const t=e.options;return{width:"100%",height:"100%",borderWidth:`${t.borderWidth||1}pt`,borderStyle:t.borderStyle||"solid",borderColor:t.borderColor||"#333",backgroundColor:t.backgroundColor||"transparent",borderRadius:e.printElementType.type==="oval"?"50%":"0",boxSizing:"border-box"}}function nP(e){const t=e.options;return{objectFit:t.fit||"contain",...Ga(t.fit,t.fitScale,t.objectPosition),maxWidth:t.maxWidth?`${t.maxWidth}mm`:"100%",maxHeight:t.maxHeight?`${t.maxHeight}mm`:"100%"}}function Hm(e){const t=e.options,r={fitBase:String(t.fontSize||12),fitMin:String(Mo(t.shrinkMinFontSize))};return Ln(e.printElementType.type,t)==="shrink"&&(r.fit="shrink"),r}Wh({text:e=>{const{style:t}=Fm(e),r=e.options;return g("div",{class:"print-text",style:t,dataset:Hm(e),text:String(r.testData||r.formatter||"")||oe("elements.k41")})},longText:e=>{const{style:t}=Fm(e),r=e.options;return g("div",{class:"print-longtext",style:t,dataset:Hm(e),text:String(r.formatter||"")||oe("elements.k42")})},hline:e=>g("div",{class:"print-line",style:$m(e)}),vline:e=>g("div",{class:"print-line",style:$m(e)}),rect:e=>g("div",{class:"print-shape",style:zm(e)}),oval:e=>g("div",{class:"print-shape",style:zm(e)}),image:(e,t,r)=>{const o=e.options,n=String(o.src??""),i=r?.designData?.length?r.designData[0]:vt,a=n.includes("{")?to(n,i):n;return g("div",{class:"print-image"},[a?g("img",{src:a,style:nP(e)}):g("div",{class:"image-placeholder",text:oe("elements.k43")})])},qrcode:e=>ex(e),barcode:e=>tx(e),html:e=>{const t=e.options,r=String(t.formatter??""),o=r?Zw.sanitize(to(r,{})):'<div style="background:#e0e0e0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;font-size:10pt;color:#999">HTML</div>';return g("div",{class:"print-html",html:o})},pageNumber:(e,t)=>{const r=e.options;return g("div",{class:"page-number-element",style:{fontSize:`${r.fontSize||12}pt`,fontWeight:r.fontWeight||"normal",fontFamily:Ts(r.fontFamily),color:r.color||"#333",textAlign:r.textAlign||"left",...r.textAlign==="justify"?{textAlignLast:"justify"}:{}},text:t?r.title||"{pageIndex}/{totalPages}":String(r.title||"")})},table:(e,t,r)=>r?qx(e,r.store,r.fire,r.designData):g("div",{class:"print-table"}),flowList:(e,t,r)=>eP(e,void 0,r?.store)});function iP(e,t,r){const o=e.printElementType.type,n=dr(o)?.renderContent;if(n)return n(e,t,r);const i=Cl(o);if(!i)return g("div",{text:o});const a=document.createElement("div");a.className="plugin-kit-canvas",a.style.width="100%",a.style.height="100%";try{xm(`canvas:${e.id}`,i.ui.renderCanvas({element:e,data:r?.designData?.length?r.designData:[vt],designMode:!0}),a)}catch{a.textContent=String(o)}return a}function Um(e){return`x:${Math.round(e.left)} y:${Math.round(e.top)} ${Math.round(e.width)}×${Math.round(e.height)}mm`}function aP(e,t,r){const o=e.store,n=o.selectedIds.has(t.id),i=o.previewIds.has(t.id),a=t.options,s=t.zone||"content",p=[iP(t,!0,{store:o,fire:e.fire,designData:e.host.designData})];return o.draggingIds.has(t.id)&&p.push(g("div",{class:"drag-preview"})),n&&(p.push(g("div",{class:"resize-handles"},Iy.map(l=>g("div",{class:`resize-handle handle-${l}`,dataset:{point:l,elId:t.id},onMousedown:d=>e.fire("resize-start",{event:d,id:t.id,point:l})})))),p.push(g("div",{class:"selected-indicator"},[g("div",{class:"position-label",text:Um(a)})]))),g("div",{class:["print-element",`type-${t.printElementType.type}`,`zone-${s}`,n?"selected":"",i?"previewed":"",o.draggingIds.has(t.id)?"drag-ghost":"","design-mode",a.locked?"locked":"",a.visible===!1?"hidden":""].filter(Boolean).join(" "),style:rP(t,r),dataset:{elId:t.id},onMousedown:l=>e.fire("element-mousedown",{event:l,id:t.id}),onContextmenu:l=>{l.preventDefault(),l.stopPropagation(),e.fire("contextmenu",{event:l,id:t.id})}},p)}function Jl(e,t){const r=e.margins,o=e.header?.height??10,n=e.footer?.height??10,i=t.width-r.left-r.right;return{header:{left:r.left,top:r.top,width:i,height:o},content:{left:r.left,top:r.top+o,width:i,height:t.height-r.top-r.bottom-o-n},footer:{left:r.left,top:t.height-r.bottom-n,width:i,height:n}}}const sP='<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20"><path d="M0 .5H20M.5 0V20" fill="none" stroke="rgba(0,0,0,0.08)" stroke-width="1" stroke-dasharray="4 4"/></svg>';function qm(e,t){return e.type==="vertical"?{left:`${e.position}mm`,top:"0",height:`${t.height}mm`,borderLeftColor:e.color||"var(--pd-accent-secondary, #f56c6c)"}:{top:`${e.position}mm`,left:"0",width:`${t.width}mm`,borderTopColor:e.color||"var(--pd-accent-secondary, #f56c6c)"}}function lP(e,t){const r=qc(e.watermark,[],t);return r?g("div",{class:"watermark-layer",style:{opacity:String(r.opacity)}},r.tiles.map(o=>g("svg",{class:"watermark-tile",width:`${o.widthMm}mm`,height:`${o.heightMm}mm`,viewBox:`0 0 ${r.tileWidthPx} ${r.tileHeightPx}`,style:{left:`${o.leftMm}mm`,top:`${o.topMm}mm`}},[g("text",{x:String(r.tileWidthPx/2),y:String(r.tileHeightPx/2),"font-size":String(r.fontSizePx),fill:r.color,"text-anchor":"middle","dominant-baseline":"middle",transform:`rotate(${r.rotate},${r.tileWidthPx/2},${r.tileHeightPx/2})`,text:r.text})]))):""}function Ql(e,t,r,o,n,i){const a=e.store,s=[];r!=="content"&&s.push(g("span",{class:"zone-label",text:r==="header"?m(e,"canvas.k11"):m(e,"canvas.k12")}));const p=r==="content"?Fd(n):void 0;if(s.push(...n.map(l=>aP(e,l,p))),r!=="content"){const l=r==="header"?"bottom":"top";s.push(g("div",{class:`zone-resize-handle handle-${l}`,dataset:{zone:r},onMousedown:d=>e.fire("zone-resize",{event:d,zone:r})},[t.zoneResizing===r?g("div",{class:"zone-height-tip",text:`${(r==="header"?a.templateData.header.height:a.templateData.footer.height).toFixed(1)}mm`}):""]))}return g("div",{class:`zone-layer zone-${r} design-mode`,style:{position:"absolute",left:`${o.left}mm`,top:`${o.top}mm`,width:`${o.width}mm`,height:`${o.height}mm`},dataset:{zone:r,paperWidth:String(i.width),paperHeight:String(i.height)}},s.filter(Boolean))}function pP(e){const t=e.currentTarget,r=e.dataTransfer?.types??[],o=r.includes("fieldkey"),n=r.includes("elementtype");if(!o&&!n){t.querySelector(".drop-hint")?.remove();return}o&&(e.ctrlKey||e.metaKey)&&(t.dataset.dropLabelIntent="1");const i=n?oe("canvas.k13"):t.dataset.dropLabelIntent?oe("canvas.k14"):oe("canvas.k15");let a=t.querySelector(".drop-hint");a||(a=document.createElement("div"),a.className="drop-hint",t.appendChild(a)),a.textContent=i,a.style.left=`${e.clientX+14}px`,a.style.top=`${e.clientY+18}px`}function jm(e){e&&(e.querySelector(".drop-hint")?.remove(),delete e.dataset.dropLabelIntent)}function dP(e,t){const r=e.store,o=r.templateData,n=yt(o),i=(r.scale||100)/100,a=Jl(o,n),s=u=>r.elements.filter(c=>(c.zone||"content")===u),p=g("div",{class:"hiprint-printPaper-content",dataset:{content:""},style:{padding:`${o.margins.top}mm ${o.margins.right}mm ${o.margins.bottom}mm ${o.margins.left}mm`,position:"relative",boxSizing:"border-box",minHeight:`${n.height}mm`}},[r.showGrid?g("div",{class:"grid-bg",style:{backgroundImage:`url("data:image/svg+xml,${encodeURIComponent(sP)}")`,backgroundSize:"5mm 5mm",backgroundPosition:"0 0"}}):"",...o.watermark&&Object.keys(o.watermark).length?[lP(o,n)]:[],Ql(e,t,"header",a.header,s("header"),n),Ql(e,t,"content",a.content,s("content"),n),Ql(e,t,"footer",a.footer,s("footer"),n),...r.adsorbGuides.map(u=>g("div",{class:`adsorb-guide guide-${u.type}`,style:qm(u,n)})),...(o.guides??[]).map(u=>g("div",{class:`manual-guide guide-${u.type}`,style:{...qm(u,n),"--guide-hit":`${8/i}px`},dataset:{guideId:String(u.id??"")},onMousedown:c=>e.fire("guide-mousedown",{event:c,id:u.id}),onDblclick:c=>{c.preventDefault(),e.fire("guide-remove",u.id)}}))].filter(Boolean)),l=g("div",{class:"hiprint-printPaper",dataset:{test:"paper"},style:{width:`${n.width}mm`,minHeight:`${n.height}mm`,background:o.pageBackground||"var(--pd-paper, #fff)",boxShadow:"var(--pd-shadow-paper, 0 1px 2px rgba(0,0,0,.12), 0 8px 24px rgba(0,0,0,.08))",overflow:"hidden",position:"relative",transform:`scale(${i})`,transformOrigin:"0 0"}},[...o.designBackground?.src?[g("div",{class:"design-background",style:{width:`${n.width}mm`,height:`${n.height}mm`,left:"0",top:"0",transform:o.designBackground.rotation?`rotate(${o.designBackground.rotation}deg)`:""}},[g("img",{src:o.designBackground.src,draggable:!1,alt:""})])]:[],p]),d=[g("div",{class:"canvas-scroll"},[g("div",{class:"paper-wrapper",style:{width:`${ai(n.width)*i}px`,height:`${ai(n.height)*i}px`,position:"relative"}},[l])])];if(r.showRuler&&d.push(g("div",{class:"ruler-overlay",style:{transform:`translate(${t.scrollX}px, ${t.scrollY}px)`}},[g("div",{class:"ruler-corner"}),g("canvas",{class:"pd-ruler is-horizontal",dataset:{ruler:"horizontal"},style:{width:`${t.geom.viewW}px`,height:"20px"},onMousedown:u=>e.fire("ruler-mousedown",{event:u,orientation:"horizontal"})}),g("canvas",{class:"pd-ruler is-vertical",dataset:{ruler:"vertical"},style:{width:"20px",height:`${t.geom.viewH}px`},onMousedown:u=>e.fire("ruler-mousedown",{event:u,orientation:"vertical"})})])),t.guidePreview&&d.push(g("div",{class:`ruler-guide-preview guide-${t.guidePreview.type}`,style:t.guidePreview.type==="vertical"?{left:`${t.guidePreview.position}px`,top:"0",height:"100%"}:{top:`${t.guidePreview.position}px`,left:"0",width:"100%"}})),t.marquee.visible&&d.push(g("div",{class:"marquee-selection",style:{left:`${t.marquee.x}px`,top:`${t.marquee.y}px`,width:`${t.marquee.w}px`,height:`${t.marquee.h}px`}})),t.contextMenu.visible){const u=t.contextMenu;d.push(g("div",{class:"context-menu",style:{left:`${t.contextMenu.x+t.contextMenu.flipX}px`,top:`${t.contextMenu.y+t.contextMenu.flipY}px`}},t.contextMenu.targetId?[_t(e,u,m(e,"canvas.k16"),"copy"),_t(e,u,m(e,"canvas.k17"),"cut"),_t(e,u,m(e,"canvas.k18"),"paste",!r.hasClipboard),_t(e,u,m(e,"canvas.k19"),"delete"),g("div",{class:"context-menu-sep"}),_t(e,u,m(e,"canvas.k20"),"move-layer",!1,"top"),_t(e,u,m(e,"canvas.k21"),"move-layer",!1,"up"),_t(e,u,m(e,"canvas.k22"),"move-layer",!1,"down"),_t(e,u,m(e,"canvas.k23"),"move-layer",!1,"bottom")]:[_t(e,u,m(e,"canvas.k24"),"paste-at",!r.hasClipboard),_t(e,u,m(e,"canvas.k25"),"select-all"),_t(e,u,m(e,"canvas.k26"),"clear-selection")]))}return g("div",{class:"canvas-area",dataset:{test:"canvas-area"},onDragover:u=>{const c=u;c.preventDefault(),c.dataTransfer&&(c.dataTransfer.dropEffect="copy"),pP(c)},onDragleave:u=>{const c=u.currentTarget,f=u.relatedTarget;(!f||!c.contains(f))&&c.querySelector(".drop-hint")?.remove()},onDrop:u=>{const c=u,f=u.currentTarget,h=f.dataset.dropLabelIntent==="1";jm(f),h&&(c.labelIntent=!0),e.fire("drop",c)},onMousedown:u=>e.fire("canvas-mousedown",u),onMousemove:u=>e.fire("canvas-mousemove",u),onMouseleave:()=>e.fire("canvas-mouseleave"),onWheel:u=>e.fire("wheel",u),onScroll:u=>e.fire("scroll",u),onContextmenu:u=>{u.preventDefault(),e.fire("canvas-contextmenu",u)}},d.filter(Boolean))}function _t(e,t,r,o,n=!1,i){return g("div",{class:`context-menu-item${n?" disabled":""}`,text:r,onClick:()=>{t.visible=!1,n||e.fire(o,i),e.repaint()}})}function cP(e){const t=window.innerHeight;for(let r=e.parentElement;r&&r!==document.body;r=r.parentElement){const o=getComputedStyle(r).overflowY;if(o==="auto"||o==="scroll"||o==="hidden"||o==="clip"){const n=r.getBoundingClientRect();return{top:Math.max(0,n.top),bottom:Math.min(t,n.bottom)}}}return{top:0,bottom:t}}function ha(e){const t=V1(e.fonts),r=e.placeholder??oe("fontSelect.k51"),o=`font-select-list-${e.id}`,n=R=>{const _=R?.trim();return _?Dc(t,_)?.label??_:""},i=R=>{const _=qo(R);return t.find(S=>S.label&&qo(S.label)===_)?.family??R},a=()=>{const R=e.value?.trim();return R?Dc(t,R)?"":R:""},s=R=>{const _=(e.value??"").trim(),I=(F,H,le,M)=>({kind:F,key:H,label:le,value:M,selected:(M??"")===_}),S=R.trim();if(!S){const F=[I("clear","__clear__",r)],H=a();H&&F.push(I("unknown","__unknown__",oe("fontSelect.k52",{v0:H}),H));for(const le of t)F.push(I("font",le.family,Ac(le),le.family));return F}const N=K1(t,S).map(F=>I("font",F.family,Ac(F),F.family));if(!N.length){const F=i(S);N.push(I("free","__free__",oe("fontSelect.k53",{v0:F}),F))}return N},p=document.createElement("div");p.className="font-select";const l=document.createElement("input");l.className="pd-input font-select-input",l.type="text",l.setAttribute("role","combobox"),l.setAttribute("aria-autocomplete","list"),l.setAttribute("aria-controls",o),l.autocomplete="off",l.placeholder=r,l.disabled=!!e.disabled,l.value=n(e.value);const d=document.createElement("ul");d.id=o,d.className="font-select-list",d.setAttribute("role","listbox");const u=e.state.fontOpen?.id===e.id?e.state.fontOpen:null,c={open:!!u&&!e.disabled,query:u?.query??"",highlighted:u?.highlighted??-1};c.open&&(l.value=c.query);const f=()=>{e.state.fontOpen=c.open?{id:e.id,query:c.query,highlighted:c.highlighted}:null};f();const h=()=>{const R=(e.value??"").trim();return s(c.query).findIndex(_=>(_.value??"")===R)},b=()=>{const R=l.getBoundingClientRect(),_=cP(l);d.classList.toggle("is-up",C0({triggerTop:R.top,triggerBottom:R.bottom,overlayHeight:d.getBoundingClientRect().height,boundaryTop:_.top,boundaryBottom:_.bottom})==="up")},k=()=>{if(!c.open){d.isConnected&&d.remove(),l.setAttribute("aria-expanded","false"),l.setAttribute("aria-activedescendant","");return}d.isConnected||p.appendChild(d);const R=s(c.query);d.replaceChildren(...R.map((_,I)=>{const S=document.createElement("li");return S.id=`${o}-${I}`,S.className="font-select-option"+(I===c.highlighted?" is-active":"")+(_.kind==="unknown"||_.kind==="free"?" is-muted":""),S.setAttribute("role","option"),S.setAttribute("aria-selected",String(_.selected)),S.textContent=_.label,S.addEventListener("mousedown",N=>{N.preventDefault(),O(_)}),S})),l.setAttribute("aria-expanded","true"),l.setAttribute("aria-activedescendant",c.highlighted>=0?`${o}-${c.highlighted}`:""),b()},v=()=>{c.open||e.disabled||(c.open=!0,c.query="",c.highlighted=h(),f(),k())},w=()=>{c.open||v()},P=()=>{c.open=!0,c.query=l.value,c.highlighted=s(c.query).length?0:-1,f(),k()},E=R=>{if(!c.open){v();return}const _=s(c.query).length-1;if(_<0)return;c.highlighted=Math.min(Math.max(c.highlighted+R,0),_),f(),k(),d.children[c.highlighted]?.scrollIntoView?.({block:"nearest"})},D=()=>{if(!c.open)return;const R=s(c.query)[c.highlighted];if(R){O(R);return}const _=c.query.trim();if(_){const I=i(_);O({value:I})}},O=R=>{c.open=!1,c.query="",c.highlighted=-1,f(),l.value=n(R.value),k(),e.onChange(R.value)},A=()=>{c.open&&(c.open=!1,c.query="",c.highlighted=-1,f(),l.value=n(e.value),k())};return l.addEventListener("focus",v),l.addEventListener("click",w),l.addEventListener("input",P),l.addEventListener("blur",A),l.addEventListener("keydown",R=>{const _=R;_.key==="ArrowDown"?(_.preventDefault(),E(1)):_.key==="ArrowUp"?(_.preventDefault(),E(-1)):_.key==="Enter"?(_.preventDefault(),D()):_.key==="Escape"&&(_.preventDefault(),A())}),p.append(l),k(),c.open&&(l.focus(),l.setSelectionRange(c.query.length,c.query.length)),p}const uP=[{key:"solid",labelKey:"formatBar.k54",preview:"1.5px solid currentColor"},{key:"dashed",labelKey:"formatBar.k55",preview:"1.5px dashed currentColor"},{key:"dotted",labelKey:"formatBar.k56",preview:"1.5px dotted currentColor"},{key:"double",labelKey:"formatBar.k57",preview:"3px double currentColor"}],fP={left:"TextAlignStart",center:"TextAlignCenter",right:"TextAlignEnd",justify:"TextAlignJustify"};function fr(e,t,r,o,n={}){return g("button",{type:"button",class:`ft-cell-btn${n.on?" on":""}`,dataset:{test:e,tip:t},disabled:!!n.disabled,onClick:o,html:`<svg viewBox="0 0 18 18" width="18" height="18" aria-hidden="true">${r}</svg>`})}const uo='<rect class="g-faint" x="2.5" y="2.5" width="13" height="13" />',Wm='<rect class="g-solid" x="2.5" y="2.5" width="13" height="13" fill="none" />';function hP(e){const t=e.format;t.syncBorderDraft();const r=t.values,o=!t.fontEditable,n=o||t.context==="cells",i=t.context==="none",a=t.context==="cells",s=!t.painterActive&&(t.context==="none"||t.context==="cells"||!t.painterCapturable),p=t.painterActive?m(e,"formatBar.k58"):t.context==="cells"?m(e,"formatBar.k59"):t.context==="none"?m(e,"formatBar.k60"):t.painterCapturable?m(e,"formatBar.k62"):m(e,"formatBar.k61"),l=c=>o?m(e,"formatBar.k63",{v0:c}):c,d=[g("div",{class:"ft-border-panel",dataset:{test:"border-panel"}},[g("div",{class:"ft-border-grid"},[fr("preset-none",m(e,"formatBar.k64"),`${uo}<line class="g-solid" x1="4" y1="14" x2="14" y2="4" />`,()=>t.applyBorderPreset("none")),fr("preset-all",m(e,"formatBar.k65"),`${Wm}<line class="g-solid" x1="9" y1="3" x2="9" y2="15" /><line class="g-solid" x1="3" y1="9" x2="15" y2="9" />`,()=>t.applyBorderPreset("all")),fr("preset-outer",m(e,"formatBar.k66"),Wm,()=>t.applyBorderPreset("outer")),fr("preset-inner",a?m(e,"formatBar.k67"):m(e,"formatBar.k68"),`${uo}<line class="g-solid" x1="9" y1="3" x2="9" y2="15" /><line class="g-solid" x1="3" y1="9" x2="15" y2="9" />`,()=>t.applyBorderPreset("inner"),{disabled:!a}),fr("edge-top",m(e,"formatBar.k69"),`${uo}<line class="g-solid" x1="2" y1="3" x2="16" y2="3" />`,()=>t.applyEdge("top"),{on:t.edgeOn("top")}),fr("edge-bottom",m(e,"formatBar.k70"),`${uo}<line class="g-solid" x1="2" y1="15" x2="16" y2="15" />`,()=>t.applyEdge("bottom"),{on:t.edgeOn("bottom")}),fr("edge-left",m(e,"formatBar.k71"),`${uo}<line class="g-solid" x1="3" y1="2" x2="3" y2="16" />`,()=>t.applyEdge("left"),{on:t.edgeOn("left")}),fr("edge-right",m(e,"formatBar.k72"),`${uo}<line class="g-solid" x1="15" y1="2" x2="15" y2="16" />`,()=>t.applyEdge("right"),{on:t.edgeOn("right")})]),g("div",{class:"ft-style-row"},uP.map(c=>g("button",{type:"button",class:`ft-style-btn${t.borderStyle===c.key?" on":""}`,dataset:{test:`style-${c.key}`,tip:t.borderStyle===c.key?m(e,"formatBar.k73",{v0:m(e,c.labelKey)}):m(e,c.labelKey)},onClick:()=>{t.toggleBorderStyle(c.key),e.repaint()}},[g("span",{class:"ft-style-line",style:{borderTop:c.preview}})]))),g("div",{class:"ft-border-style-row"},[g("span",{class:"ft-edge-label",text:m(e,"formatBar.k74")}),g("div",{class:"ft-line-width"},[ae({value:t.borderWidth,min:.25,max:5,step:.25,placeholder:t.borderMixed.width?m(e,"formatBar.k75"):void 0,onCommit:c=>{t.setBorderWidth(c),e.repaint()}})])]),g("div",{class:"ft-border-style-row"},[g("span",{class:"ft-edge-label",text:m(e,"formatBar.k76")}),dt(t.borderColor,c=>{t.setBorderColor(c),e.repaint()},m(e,"formatBar.k77"))]),t.borderMixedAny?g("p",{class:"pd-hint",text:m(e,"formatBar.k78")}):""].filter(Boolean))],u=[g("div",{class:"ft-align-panel",dataset:{test:"align-panel"}},[g("div",{class:"ft-align-row"},[["left",m(e,"formatBar.k79"),"TextAlignStart"],["center",m(e,"formatBar.k80"),"TextAlignCenter"],["right",m(e,"formatBar.k81"),"TextAlignEnd"],["justify",m(e,"formatBar.k82"),"TextAlignJustify"]].map(([c,f,h])=>g("button",{type:"button",class:`ft-cell-btn${r.textAlign===c?" on":""}`,dataset:{test:`align-${c}`,tip:f},disabled:o,onClick:()=>t.applyStyle({textAlign:c}),html:je(h)}))),g("div",{class:"ft-align-row"},[["top",m(e,"formatBar.k83"),"ArrowUpToLine"],["middle",m(e,"formatBar.k84"),"ChevronsUpDown"],["bottom",m(e,"formatBar.k85"),"ArrowDownToLine"]].map(([c,f,h])=>g("button",{type:"button",class:`ft-cell-btn${r.verticalAlign===c?" on":""}`,dataset:{test:`valign-${c}`,tip:f},disabled:o,onClick:()=>t.applyStyle({verticalAlign:c}),html:je(h)})))])];return g("div",{class:"format-toolbar"},[g("div",{class:"tb-ou ft-group",dataset:{unit:"painter"}},[g("button",{type:"button",class:`ft-btn${t.painterActive?" on":""}`,dataset:{test:"format-painter",tip:p},disabled:s,onClick:()=>{t.painterActive?t.cancelPainter():t.pickPainterSource(!1),e.repaint()},onDblclick:()=>{t.pickPainterSource(!0),e.repaint()},html:je("Paintbrush")})]),g("div",{class:"tb-ou ft-group",dataset:{unit:"font"}},[g("div",{class:"ft-font"},[ha({id:"ft-font",state:e.state,fonts:e.host.fonts,value:typeof r.fontFamily=="string"?r.fontFamily:void 0,placeholder:r.fontFamily===Rr?m(e,"formatBar.k86"):m(e,"formatBar.k87"),disabled:o,onChange:c=>t.applyStyle({fontFamily:c})})]),g("div",{class:"ft-size",dataset:{test:"font-size"}},[ae({value:typeof r.fontSize=="number"?r.fontSize:void 0,min:5,max:72,disabled:o,placeholder:r.fontSize===Rr?m(e,"formatBar.k88"):m(e,"formatBar.k89"),onCommit:c=>t.applyStyle({fontSize:c})})])]),g("div",{class:"tb-ou ft-group",dataset:{unit:"style"}},[...[["bold","Bold",m(e,"formatBar.k90"),()=>t.toggleBold()],["underline","Underline",m(e,"formatBar.k91"),()=>t.toggleUnderline()],["strike","Strikethrough",m(e,"formatBar.k92"),()=>t.toggleStrike()]].map(([c,f,h,b])=>g("button",{type:"button",class:`ft-btn${r[c]===!0?" on":""}`,dataset:{test:c,tip:l(h)},disabled:c==="bold"?o:n,onClick:b,html:je(f)}))]),g("div",{class:"tb-ou ft-group",dataset:{unit:"color"}},[g("span",{class:`ft-color-btn${o?" dim":""}`,title:m(e,"formatBar.k93",{v0:o?m(e,"formatBar.fontDisabledHint"):""})},[dt(typeof r.color=="string"?r.color:void 0,c=>t.applyStyle({color:c})),g("span",{class:"ft-glyph",text:"A"})]),g("span",{class:`ft-color-btn${i?" dim":""}`,title:m(e,"formatBar.k94")},[dt(typeof r.backgroundColor=="string"?r.backgroundColor:void 0,c=>t.applyStyle({backgroundColor:c})),g("span",{class:"ft-glyph",html:je("PaintBucket",14)})])]),g("div",{class:"tb-ou ft-group",dataset:{unit:"align"}},[na(e,"align",{icon:fP[String(r.textAlign)]??"TextAlignStart",text:m(e,"formatBar.k95"),textClass:"ft-btn-text",tip:o?m(e,"formatBar.k96"):m(e,"formatBar.k97"),disabled:o,testId:"align-dd"},u)]),g("div",{class:"tb-ou ft-group",dataset:{unit:"border"}},[na(e,"border",{icon:"Grid3x3",text:m(e,"formatBar.k98"),textClass:"ft-btn-text",tip:i?m(e,"formatBar.k99"):m(e,"formatBar.k100"),disabled:i,testId:"border"},d)])])}const mP="1.6.3";ia.filter(e=>e.material).map(e=>({type:e.type,label:e.label,icon:e.icon}));function ma(e,t){return je(e??"Shapes",t)||je("Shapes",t)}function gP(e){const t=e.state;if(t.leftCollapsed)return g("div",{class:"left-panel collapsed"},[g("div",{class:"left-collapsed"},[Vm("ChevronsRight",m(e,"panels.k137"),()=>{t.leftCollapsed=!1,e.repaint()}),...[["elements",m(e,"panels.k138"),"Table2"],["fields",m(e,"panels.k139"),"ListTree"],["layers",m(e,"panels.k140"),"Layers"]].map(([o,n,i])=>g("button",{type:"button",class:`lc-btn${t.leftTab===o?" on":""}`,title:n,html:ma(i,14),onClick:()=>{t.leftTab=o,t.leftCollapsed=!1,e.repaint()}}))])]);const r=(o,n,i="")=>g("div",{class:`pd-tab-pane${i?` ${i}`:""}`,role:"tabpanel",dataset:{pane:`left:${o}`},style:t.leftTab===o?"":{display:"none"}},n);return g("div",{class:"left-panel"},[g("div",{class:"left-head"},[g("span",{class:"left-title",text:m(e,"panels.k141")}),Vm("ChevronsLeft",m(e,"panels.k142"),()=>{t.leftCollapsed=!0,e.repaint()})]),g("div",{class:"pd-tabs left-tabs"},[g("div",{class:"pd-tab-bar",role:"tablist"},[...[["elements",m(e,"panels.k143")],["fields",m(e,"panels.k144")],["layers",m(e,"panels.k145")]].map(([o,n])=>g("button",{type:"button",class:`pd-tab${t.leftTab===o?" active":""}`,text:n,onClick:()=>{t.leftTab=o,e.repaint()}}))]),r("elements",yP(e),"material-grid"),r("fields",[vP(e)]),r("layers",[xP(e)])])])}function Vm(e,t,r){return g("button",{type:"button",class:"collapse-btn",title:t,html:ma(e,14),onClick:r})}const Gm={text:"elementDefinitions.k553",barcode:"elementDefinitions.k554",qrcode:"elementDefinitions.k555",image:"elementDefinitions.k556",table:"elementDefinitions.k557",longText:"elementDefinitions.k558",flowList:"elementDefinitions.k559",hline:"elementDefinitions.k560",vline:"elementDefinitions.k561",rect:"elementDefinitions.k562",oval:"elementDefinitions.k563",pageNumber:"elementDefinitions.k564",barChart:"echarts.series.typeNames.bar",barHChart:"echarts.series.typeNames.barH",lineChart:"echarts.series.typeNames.line",areaChart:"echarts.series.typeNames.area",pieChart:"echarts.series.typeNames.pie",doughnutChart:"echarts.series.typeNames.doughnut",scatterChart:"echarts.series.typeNames.scatter",radarChart:"echarts.series.typeNames.radar",funnelChart:"echarts.series.typeNames.funnel",gaugeChart:"echarts.series.typeNames.gauge"},bP={barChart:"elementGroup.chart"};function kP(e,t,r,o){return g("div",{class:`material-card${u1(o??t)?" material-card--wide":""}`,draggable:!0,dataset:{test:`material-${e}`},onDragstart:n=>{const i=n.dataTransfer;i?.setData("elementType",e),i&&(i.effectAllowed="all")}},[g("span",{class:"material-icon","data-icon":r,html:ma(r,14)}),g("span",{class:"material-label",text:o??t})])}function yP(e){const t=[];let r;for(const o of Gh()){const n=o.group;if(n&&n!==r){const p=bP[o.type];t.push(g("div",{class:"material-group-title",text:p?m(e,p):n}))}n&&(r=n);const i=Gm[o.type],a=i?m(e,i):void 0,s=a&&a!==i?a:void 0;t.push(kP(o.type,o.label,o.icon,s))}return[g("div",{class:"panel-title",text:m(e,"panels.k146")}),...t]}function vP(e){const t=e.state,r=t.fieldDisplay??"both",o=Su(e.store.fields),n=(t.fieldSearch??"").trim().toLowerCase(),i=n?o.map(a=>({...a,fields:a.fields.filter(s=>`${s.fieldLabel}${s.fieldKey}`.toLowerCase().includes(n))})).filter(a=>a.fields.length):o;return g("div",{class:"field-tree-panel"},[g("div",{class:"panel-title",text:m(e,"panels.k147")}),g("input",{class:"pd-input search-input",type:"search",placeholder:m(e,"panels.k148"),"aria-label":m(e,"panels.k149"),value:t.fieldSearch??"",onInput:a=>{t.fieldSearch=a.target.value},onChange:()=>e.repaint()}),g("div",{class:"tree-container"},i.flatMap(a=>{const s=t.collapsedGroups.has(a.key)&&!n,p=a.key?g("div",{class:`field-group-header${a.isList?" is-list":""}`,onClick:()=>{s?t.collapsedGroups.delete(a.key):t.collapsedGroups.add(a.key),e.repaint()}},[g("span",{class:"expand-icon",text:s?"▶":"▼"}),g("span",{class:"node-icon",text:a.isList?"📋":"📁"}),g("span",{class:"group-label",text:a.label,"data-tip":a.label})]):"",l=s?[]:a.fields.map(d=>g("div",{class:"field-row",draggable:!0,"data-tip":m(e,"panels.k150",{v0:d.fieldLabel,v1:d.fieldKey}),style:{paddingLeft:`${a.key?22:8}px`},onDragstart:u=>{const c=u.dataTransfer;c?.setData("fieldKey",d.fieldKey),c&&(c.effectAllowed="all")},onClick:()=>{Tu(d.fieldLabel||d.fieldKey).then(u=>{u&&(t.copiedFieldKey=d.fieldKey,e.repaint(),setTimeout(()=>{t.copiedFieldKey===d.fieldKey&&(t.copiedFieldKey="",e.repaint())},1200))})}},[g("span",{class:"node-icon",text:"📄"}),g("span",{class:"node-meta"},[r!=="key"?g("span",{class:"node-label",text:d.fieldLabel||d.fieldKey}):"",r!=="label"?g("span",{class:`node-key${r==="key"?" is-primary":""}`,text:r==="key"?d.fieldKey:`(${d.fieldKey})`}):""].filter(Boolean)),t.copiedFieldKey===d.fieldKey?g("span",{class:"copy-hint",text:m(e,"panels.k151")}):""].filter(Boolean)));return[p,g("div",{},l.filter(Boolean))].filter(Boolean)})),i.length===0?g("p",{class:"pd-empty",text:m(e,"panels.k152")}):""].filter(Boolean))}function wP(e,t){if(e.options.title)return e.options.title;const r=Gm[e.printElementType.type];return r?m(t,r):e.printElementType.title||e.printElementType.type}function xP(e){const t=e.store,r=[...t.elements].sort((s,p)=>(p.options.zIndex??0)-(s.options.zIndex??0)),o=t.elements.filter(s=>t.selectedIds.has(s.id)),n=o.length>=2,i=o.some(s=>!!s.options.groupId),a=s=>s.zone==="header"?m(e,"panels.k153"):s.zone==="footer"?m(e,"panels.k154"):"";return g("div",{class:"layer-panel"},[g("div",{class:"panel-title",text:m(e,"panels.k155")}),...r.map(s=>{const p=Xh(s.printElementType.type);return g("div",{class:`layer-item${t.selectedIds.has(s.id)?" active":""}`,onClick:l=>t.selectElement(s.id,l.ctrlKey||l.metaKey)},[g("span",{class:"layer-icon","data-icon":p??"Shapes",html:ma(p,12)}),g("span",{class:"layer-name",text:wP(s,e)}),a(s)?g("span",{class:"layer-zone",text:a(s)}):"",g("span",{class:"layer-zindex",text:`z:${s.options.zIndex??0}`})].filter(Boolean))}),r.length?g("div",{class:"layer-actions"},[...[["top",m(e,"panels.k156"),"ArrowUpToLine"],["up",m(e,"panels.k157"),"ArrowUp"],["down",m(e,"panels.k158"),"ArrowDown"],["bottom",m(e,"panels.k159"),"ArrowDownToLine"]].map(([s,p,l])=>g("button",{type:"button",class:"pd-button small",title:p,html:je(l,14),onClick:()=>e.fire("move-layer",s)}))]):"",n||i?g("div",{class:"layer-actions"},[n?g("button",{type:"button",class:"pd-button small",title:m(e,"panels.k160"),html:je("Group",14),onClick:()=>e.fire("group")}):"",i?g("button",{type:"button",class:"pd-button small",title:m(e,"panels.k161"),html:je("Ungroup",14),onClick:()=>e.fire("ungroup")}):""].filter(Boolean)):""].filter(Boolean))}function PP(e){const t=e.store,r=e.state,o=t.pages.length>1,n=t.pages[t.activePageIndex]?.name||m(e,"panels.k162",{v0:t.activePageIndex+1}),i=t.tilingEnabled;return g("div",{class:"page-tabs"},[g("div",{class:"page-tabs-list"},t.pages.map((s,p)=>r.renamingPage===p?g("input",{class:"page-tab-rename",dataset:{test:"page-rename-input"},value:r.renameText??"",onInput:l=>{r.renameText=l.target.value},onBlur:()=>a(),onKeydown:l=>{const d=l;if(d.key==="Enter"){a();return}d.key==="Escape"&&(r.renamingPage=null,e.repaint())}}):g("button",{type:"button",class:`page-tab${p===t.activePageIndex?" active":""}`,dataset:{tip:s.name?m(e,"panels.k163",{v0:s.name}):m(e,"panels.k164")},text:s.name||m(e,"panels.k165",{v0:p+1}),onClick:()=>t.switchPage(p),onDblclick:()=>{r.renamingPage=p,r.renameText=s.name??"",e.repaint()}}))),g("div",{class:"page-tabs-actions"},[g("button",{type:"button",dataset:{test:"add-page",tip:i?m(e,"panels.k166"):m(e,"panels.k167")},disabled:i,text:"+",onClick:()=>e.fire("add-page")}),g("button",{type:"button",dataset:{test:"duplicate-page",tip:i?m(e,"panels.k168"):m(e,"panels.k169",{v0:n})},disabled:i,text:"⧉",onClick:()=>e.fire("duplicate-page")}),g("button",{type:"button",dataset:{test:"delete-page",tip:o?m(e,"panels.k170",{v0:n}):m(e,"panels.k171")},disabled:!o,text:"✕",onClick:()=>e.fire("delete-page")}),g("button",{type:"button",dataset:{test:"move-left",tip:m(e,"panels.k172",{v0:n})},disabled:t.activePageIndex<=0,text:"←",onClick:()=>e.fire("move-page",-1)}),g("button",{type:"button",dataset:{test:"move-right",tip:m(e,"panels.k173",{v0:n})},disabled:t.activePageIndex>=t.pages.length-1,text:"→",onClick:()=>e.fire("move-page",1)})])]);function a(){const s=(r.renameText??"").trim();r.renamingPage!==null&&s&&t.renamePage(r.renamingPage,s),r.renamingPage=null,e.repaint()}}function EP(e){const t=e.store,r=t.templateData,o=ir(r),n=r.orientation==="landscape"?m(e,"panels.k174"):m(e,"panels.k175"),i=Lt[r.paperSize],a=i?m(e,i.labelKey):r.paperSize,s=r.outputRotation,p=`${a} ${n} ${Math.round(o.width)}×${Math.round(o.height)}mm${s?m(e,"panels.paperRotated",{rot:s}):""}`;return g("div",{class:"status-bar"},[g("span",{class:"status-item coord",dataset:{coord:""},style:{display:"none"}}),g("span",{class:"status-item",text:m(e,"panels.k176",{v0:t.scale})}),g("span",{class:"status-item",text:m(e,"panels.statusElements",{count:t.elements.length,selected:t.selectedIds.size?m(e,"panels.statusSelected",{n:t.selectedIds.size}):""})}),g("span",{class:"status-item status-version",text:`v${mP}`}),g("span",{class:"status-item status-paper",text:p})])}const SP=Object.keys(Lt).filter(e=>e!=="CUSTOM"&&!Lt[e]?.continuous);function TP(e){const t=document.createElement("label");t.className="pd-button small upload-label";const r=document.createTextNode(m(e,"pageExtras.k103")),o=document.createElement("input");o.className="visually-hidden",o.type="file",o.accept="image/*",t.append(r,o);const n=i=>{t.className=`pd-button small upload-label${i?" disabled":""}`,o.disabled=i};return o.addEventListener("change",async()=>{const i=o.files?.[0];if(!i)return;if(!i.type.startsWith("image/")){alert(m(e,"pageExtras.k104")),o.value="";return}const a=e.host.uploadDesignBackground;if(!a){alert(m(e,"pageExtras.k105")),o.value="";return}n(!0),r.textContent=m(e,"pageExtras.k106");try{const s=await a(i);s?e.store.updateTemplateData({designBackground:{src:s,rotation:0}}):alert(m(e,"pageExtras.k107"))}catch(s){alert(s instanceof Error?s.message:m(e,"pageExtras.k108"))}finally{r.textContent=m(e,"pageExtras.k109"),n(!e.host.uploadDesignBackground),o.value=""}}),e.host.uploadDesignBackground||n(!0),t}function MP(e){const r=e.store.templateData.designBackground,o=r?.rotation??0;return g("div",{class:"design-background-config"},[$t(m(e,"pageExtras.k110")),g("p",{class:"design-background-tip",text:m(e,"pageExtras.k111")}),r?.src?[g("div",{class:"design-background-path",title:r.src,text:r.src}),g("div",{class:"design-background-actions"},[g("button",{type:"button",class:"pd-button small rotate-btn",text:m(e,"pageExtras.k112",{v0:(o+90)%360}),onClick:()=>e.store.updateTemplateData({designBackground:{...r,rotation:(o+90)%360}})}),g("button",{type:"button",class:"pd-button small remove-btn",text:m(e,"pageExtras.k113"),onClick:()=>e.store.updateTemplateData({designBackground:void 0})})])]:TP(e)].flat())}function CP(e){const t=e.store,r=t.templateData,o=r.tiling,n={...Nt,...o??{},enabled:o?.enabled??!1,sheetMargin:{...Nt.sheetMargin,...o?.sheetMargin??{}}},i=Gn(r.paperSize),a=h=>t.updateTemplateData({tiling:{...n,...h}}),s=h=>Lr({target:n,base:Nt,propKey:h,write:()=>a({[h]:Nt[h]})}),p=h=>Lr({target:n.sheetMargin,base:Nt.sheetMargin,propKey:h,write:()=>l(h,Nt.sheetMargin[h])}),l=(h,b)=>a({sheetMargin:{...n.sheetMargin,[h]:b??0}}),d={...r,tiling:n},u=Fs(d),c=Math.max(hu(d),1);let f="";if(!u.length)try{const h=fu(d),b=Ko(d),k=n.sheetPaperSize==="CUSTOM"?m(e,"pageExtras.k114"):n.sheetPaperSize??"A4",v=n.sheetPaperSize==="CUSTOM"?"":n.sheetOrientation==="landscape"?m(e,"pageExtras.k115"):m(e,"pageExtras.k116");f=m(e,"pageExtras.k117",{v0:k,v1:v,v2:b.width,v3:b.height,v4:h.columns,v5:h.rows,v6:h.perSheet,v7:h.tile.width,v8:h.tile.height})}catch{f=""}return g("div",{class:"tiling-config",dataset:{test:"tiling-config"}},[$t(m(e,"pageExtras.k118")),g("p",{class:"pd-hint",text:m(e,"pageExtras.k119")}),g("div",{class:"pd-field"},[g("label",{class:"tiling-switch"},[g("input",{type:"checkbox",checked:n.enabled===!0,disabled:i,onChange:h=>{if(!h.target.checked){a({enabled:!1});return}a({...Nt,columns:Math.min(Nt.columns,Math.max(c,1))})}}),g("span",{text:m(e,"pageExtras.k120")})]),i?g("p",{class:"pd-hint tiling-error",text:m(e,"pageExtras.k121")}):""].filter(Boolean)),n.enabled&&!i?[he(m(e,"pageExtras.k122"),g("select",{class:"pd-select",style:{width:"100%"},onChange:h=>{const b=h.target.value;if(b!=="CUSTOM"){a({sheetPaperSize:b});return}const k=Ko(d);a({sheetPaperSize:"CUSTOM",sheetCustomWidth:n.sheetCustomWidth??k.width,sheetCustomHeight:n.sheetCustomHeight??k.height})}},[...SP.map(h=>g("option",{value:h,text:m(e,Lt[h]?.labelKey??h),selected:(n.sheetPaperSize??"A4")===h})),g("option",{value:"CUSTOM",text:m(e,"pageExtras.k123"),selected:n.sheetPaperSize==="CUSTOM"})]),void 0,s("sheetPaperSize")),n.sheetPaperSize==="CUSTOM"?he(m(e,"pageExtras.k124"),g("div",{class:"custom-size-grid"},[ae({value:Number(n.sheetCustomWidth??0),min:25,max:2e3,onCommit:h=>a({sheetCustomWidth:h})}),g("span",{class:"custom-size-x",text:"×"}),ae({value:Number(n.sheetCustomHeight??0),min:25,max:2e3,onCommit:h=>a({sheetCustomHeight:h})})])):he(m(e,"pageExtras.k125"),pr("tiling-ori",[{value:"portrait",label:m(e,"pageExtras.k126")},{value:"landscape",label:m(e,"pageExtras.k127")}],n.sheetOrientation==="landscape"?"landscape":"portrait",h=>a({sheetOrientation:h})),void 0,s("sheetOrientation")),$t(m(e,"pageExtras.k128")),g("div",{class:"margin-grid"},[he(m(e,"pageExtras.k129"),ae({value:n.sheetMargin.top??0,min:0,max:100,onCommit:h=>l("top",h)}),void 0,p("top")),he(m(e,"pageExtras.k130"),ae({value:n.sheetMargin.bottom??0,min:0,max:100,onCommit:h=>l("bottom",h)}),void 0,p("bottom")),he(m(e,"pageExtras.k131"),ae({value:n.sheetMargin.left??0,min:0,max:100,onCommit:h=>l("left",h)}),void 0,p("left")),he(m(e,"pageExtras.k132"),ae({value:n.sheetMargin.right??0,min:0,max:100,onCommit:h=>l("right",h)}),void 0,p("right"))]),$t(m(e,"pageExtras.k133")),he(m(e,"pageExtras.k134"),ae({value:n.gapX??0,min:0,max:50,onCommit:h=>a({gapX:h??0})}),void 0,s("gapX")),he(m(e,"pageExtras.k135"),ae({value:n.gapY??0,min:0,max:50,onCommit:h=>a({gapY:h??0})}),void 0,s("gapY")),he(m(e,"pageExtras.k136"),ae({value:n.columns??1,min:1,max:c,onCommit:h=>a({columns:h||1})})),...u.map(h=>g("p",{class:"pd-hint tiling-error",text:h.message})),!u.length&&f?g("p",{class:"pd-hint tiling-summary",text:f}):""]:""].flat().filter(Boolean))}const _P=new Set(cs.map(e=>e.group)),DP={"table-settings":"content"},Km=new Map;function ep(e){const t=e??"";let r=Km.get(t);if(!r){const{groups:o,itemKeys:n}=l1(t);r={groups:o,keys:n,searching:!!t.trim()},Km.set(t,r)}return r}function tp(e){const t=DP[e]??e;return _P.has(t)?t:""}function AP(e,t){const r=ep(e.state.propSearch);if(!r.searching)return!0;const o=tp(t);return!o||r.groups.includes(o)}function OP(e,t){const r=ep(e.state.propSearch);return!r.searching||r.keys.has(t)}function Ym(e,t){const r=e.props.style??{};return e.props.style={...r,display:t?"":"none"},e}function G(e,t,r){const o=r.props.dataset??{};return r.props.dataset={...o,propKey:t},Ym(r,OP(e,t))}function RP(e,t,r){const o=tp(t);if(!o)return r;const n=r.props.dataset??{};return r.props.dataset={...n,propGroup:o},Ym(r,AP(e,t))}function Xm(e,t){const r=ep(t);for(const o of Array.from(e.querySelectorAll("[data-prop-group]"))){const n=tp(o.dataset.propGroup??"");o.style.display=!r.searching||!n||r.groups.includes(n)?"":"none"}for(const o of Array.from(e.querySelectorAll("[data-prop-key]")))o.style.display=!r.searching||r.keys.has(o.dataset.propKey??"")?"":"none"}function IP(e){return g("div",{class:"property-search"},[g("input",{class:"pd-input",type:"search",placeholder:m(e,"propertySearch.k328"),"aria-label":m(e,"propertySearch.k329"),value:e.state.propSearch??"",onInput:t=>{const r=t.target,o=r.value;e.state.propSearch=o,Xm(r.getRootNode(),o)}})])}const LP={Document:"≡",Brush:"◧",Setting:"⚙"};function BP(e,t){try{const r=window.localStorage.getItem(`property-group-${e}`);return r===null?t:r==="true"}catch{return t}}function NP(e,t){try{window.localStorage.setItem(`property-group-${e}`,String(t))}catch{}}function it(e,t,r,o,n,i=!0,a=[]){const s=BP(t,i);return RP(e,t,g("div",{class:`property-group${s?" is-expanded":""}`},[g("div",{class:"group-header",onClick:()=>{NP(t,!s),e.repaint()}},[g("span",{class:"group-icon",text:LP[o]||"•"}),g("span",{class:"group-title",text:r}),...a,g("span",{class:"expand-icon",text:s?"▾":"▸"})]),g("div",{class:"group-content",style:s?"":{display:"none"}},n.filter(Boolean))]))}function ga(e){return g("form",{class:"pd-form",onSubmit:t=>t.preventDefault()},e.filter(Boolean))}function Zm(e){return e.split(".").flatMap(t=>{const r=t.match(/^([^\[]+)((?:\[\d+\])*)$/);if(!r)return[t];const o=r[1],n=[...r[2].matchAll(/\[(\d+)\]/g)].map(i=>Number(i[1]));return[o,...n]})}function Jm(e,t){return Zm(t).reduce((n,i)=>n==null?"":n[i],e)??""}function rp(e,t,r,o){const n=Zm(r),i=n.pop(),a=n.reduce((s,p)=>((s[p]===void 0||s[p]===null)&&(s[p]={}),s[p]),t);a[i]=o||void 0,e.recordHistory(),e.emit()}function FP(e,t){const r=e.store;if(t.printElementType.type==="table"&&r.tableSelection?.elementId===t.id){const{r1:o,c1:n}=r.tableSelection,i=(t.options.tableRows??[])[o];if(i)return Mu(i.type,o,n,t.options.fields?.[0]?.dataSource)}return Cy(t)}function $P(e,t){const r=document.createElement("label");r.className="pd-button small upload-label",rt(g("svg",{class:"pd-icon",viewBox:"0 0 24 24","aria-hidden":"true"},[g("path",{fill:"currentColor",d:"M12 3l4 4h-3v7h-2V7H8zm-7 12h14v5H5Z"})]),r);const o=document.createTextNode(m(e,"binding.k1")),n=document.createElement("input");n.className="visually-hidden",n.type="file",n.accept="image/*",r.append(o,n);const i=p=>{r.className=`pd-button small upload-label${p?" disabled":""}`,n.disabled=p};n.addEventListener("change",async()=>{const p=n.files?.[0];if(!p)return;if(!p.type.startsWith("image/")){alert(m(e,"binding.k2")),n.value="";return}const l=e.host.uploadImage;if(!l){alert(m(e,"binding.k3")),n.value="";return}i(!0),o.textContent=m(e,"binding.k4");try{const d=await l(p);d?rp(e.store,t,"options.src",d):alert(m(e,"binding.k5"))}catch(d){alert(d instanceof Error?d.message:m(e,"binding.k6"))}finally{o.textContent=m(e,"binding.k7"),i(!e.host.uploadImage),n.value=""}}),e.host.uploadImage||i(!0);const a=document.createElement("div");a.className="image-content-upload";const s=document.createElement("p");return s.className="upload-tip",s.textContent=m(e,"binding.k8"),a.append(r,s),a}function zP(e,t){const r=o=>e.fire("open-expression",{elementId:t.id,targetPath:o.targetPath,value:Jm(t,o.targetPath)});return it(e,"binding",m(e,"binding.k9"),"Document",[...FP(e,t).map(o=>he(o.labelKey?m(e,o.labelKey):o.label,g("input",{class:"pd-input",type:"text",value:Jm(t,o.targetPath),placeholder:o.placeholder||m(e,"binding.k10"),onChange:n=>rp(e.store,t,o.targetPath,n.target.value),onDblclick:()=>r(o)}))),t.printElementType.type==="image"?$P(e,t):""].filter(Boolean))}const bn=new Map;function ba(e){return`${Math.round(e*1e4)/1e4}%`}function Qm(e,t){const r=my(t.value),o=r.kind==="custom",n=r.kind==="axes"?r.x:50,i=r.kind==="axes"?r.y:50,a=wy(t.src),s=bn.get(a.src),p={widthMm:t.widthMm,heightMm:t.heightMm,naturalWidth:s?.width,naturalHeight:s?.height,fit:t.fit,scalePct:t.scale},l=gy(p),d=by(p,n,i),u=document.createElement("select");u.className="pd-select",u.style.width="100%";for(const b of Sy(l,n,i)){const k=document.createElement("option");k.value=b.value,k.textContent=b.label,u.appendChild(k)}if(o){const b=document.createElement("option");b.value="custom",b.textContent=m(e,"cropAnchor.k37"),u.appendChild(b)}u.value=o?"custom":`${n},${i}`,u.selectedIndex<0&&(u.selectedIndex=o?u.options.length-1:0),u.addEventListener("change",()=>{if(u.value==="custom")return;const[b,k]=u.value.split(",").map(Number);t.onCommit(yu(b,k))});const c=m(e,`propertyTips.${t.fieldKey}`),f=[g("div",{class:"pd-field",dataset:{field:t.fieldKey}},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t"},[t.label,Ml(c)]),t.resetAnchor??""].filter(Boolean)),u])];f.push(g("div",{class:"pd-field",dataset:{field:"ap-img-fit-scale"}},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t"},[xy(),Ml(m(e,"propertyTips.ap-img-fit-scale"))]),t.resetScale??""].filter(Boolean)),ae({value:t.scale,min:Oo,max:_d,step:5,placeholder:m(e,"cropAnchor.k38"),onCommit:b=>t.onScaleCommit(b>Oo?b:void 0)})]));for(const b of Ey(l,n,i))f.push(g("div",{class:"pd-field",dataset:{field:t.fieldKey}},[g("span",{class:"pd-label",text:b.label}),ae({value:b.value,min:0,max:100,step:1,onCommit:k=>t.onCommit(yu(b.name==="horizontal"?k:n,b.name==="vertical"?k:i))})]));const h=Py(l,o);return h&&f.push(g("p",{class:"pd-crop-note",text:h})),a.isSample&&f.push(g("p",{class:"pd-crop-note",text:vy()})),f.push(g("div",{class:"pd-crop-preview"},[g("img",{class:"pd-crop-thumb",src:a.src,alt:a.isSample?m(e,"cropAnchor.k39"):m(e,"cropAnchor.k40"),onLoad:b=>{const k=b.target;if(!(k.naturalWidth>0&&k.naturalHeight>0))return;const v=bn.get(a.src);v&&v.width===k.naturalWidth&&v.height===k.naturalHeight||(bn.set(a.src,{width:k.naturalWidth,height:k.naturalHeight}),e.repaint())},onError:()=>{bn.has(a.src)&&(bn.delete(a.src),e.repaint())}}),d?g("div",{class:"pd-crop-win",style:{left:ba(d.leftPct),top:ba(d.topPct),width:ba(d.widthPct),height:ba(d.heightPct)}}):""])),g("div",{class:t.containerClass??"pd-crop-anchor"},f)}const Fr=e=>Number(e??0),op=e=>e||void 0;function $r(e,t,r,o,n,i){return g("div",{class:"pd-field"},[g("span",{class:"pd-label",...o?{title:o}:{}},[g("span",{class:"pd-label-t",text:e}),n??""].filter(Boolean)),g("input",{class:"pd-switch",type:"checkbox",checked:t,...i?{disabled:!0}:{},onChange:a=>r(a.target.checked)})])}function eg(e,t,r,o,n=!1,i){return g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:e}),""].filter(Boolean)),g("select",{class:"pd-select",...n?{style:{width:"100%"}}:{},onChange:a=>o(a.target.value)},r.map(a=>g("option",{value:a.value,text:a.label,selected:a.value===t})))])}function kn(e,t,r,o,n={}){return g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:e}),n.reset??""].filter(Boolean)),zh(t,r,o,{className:"pd-select",...n.full?{width:"100%"}:{}})])}const fo=e=>g("p",{class:"pd-hint",text:e});function tg(e,t){return e.map(r=>({value:r.value,label:r.labelKey?m(t,r.labelKey):r.label??r.value,...r.disabled?{disabled:!0}:{}}))}const HP="tableProps.k330",UP=[{value:"header",labelKey:"tableProps.k331"},{value:"data",labelKey:"tableProps.k332"},{value:"subtotal",labelKey:"tableProps.k333"},{value:"summary",labelKey:"tableProps.k334"}],qP=[{value:"CODE128",labelKey:"tableProps.k335"},{value:"EAN13",labelKey:"tableProps.k336"},{value:"EAN8",label:"EAN8"},{value:"UPC",label:"UPC"},{value:"CODE39",label:"CODE39"},{value:"ITF14",label:"ITF14"}],jP=[{value:"L",labelKey:"tableProps.k337"},{value:"M",labelKey:"tableProps.k338"},{value:"Q",label:"Q"},{value:"H",labelKey:"tableProps.k339"}],WP=[{value:"clip",labelKey:"tableProps.k340"},{value:"shrink",labelKey:"tableProps.k341"},{value:"autoHeight",labelKey:"tableProps.k342"}],VP={value:"__multi__",labelKey:"tableProps.k343",disabled:!0};function GP(e,t){const r=e.store,o=r.tableSelection,n=t.options.tableRows??[],i=o?n[o.r1]:void 0;if(!o||!i)return it(e,"table-row",m(e,"tableProps.k344"),"Grid",[]);const a=s=>r.updateElement(t.id,s);return it(e,"table-row",m(e,"tableProps.k345"),"Grid",[ga([eg(m(e,"tableProps.k346"),i.type,tg(UP,e),s=>{const p=Ia(n,o.r1,s);if(p){window.alert(p);return}a({tableRows:n})},!0),g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"tableProps.k347")}),ae({value:i.height,min:3,max:100,step:.5,onCommit:s=>{i.height=s,a({tableRows:n})}})]),i.type==="header"?$r(m(e,"tableProps.k348"),i.repeatOnPage??!1,s=>{Mb(n,s),a({tableRows:n})},m(e,HP)):""])])}function KP(e,t){const r=e.store,o=t.options,n=d=>r.updateElement(t.id,d),i=o.tableColWidths??[],a=r.paperSize.width-r.templateData.margins.left-r.templateData.margins.right,s=r.fields.filter(d=>d.fieldType==="list").map(d=>({value:d.fieldKey,label:d.fieldLabel})),p=es("table"),l=d=>Lr({target:o,base:p,propKey:d,write:()=>n({[d]:p[d]})});return it(e,"table-settings",m(e,"tableProps.k349"),"Grid",[ga([eg(m(e,"tableProps.k350"),o.dataSource??"",s,d=>n({dataSource:d||void 0}),!0),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k351")}),l("tableDefaultFontFamily")]),ha({id:"table-default-font",state:e.state,fonts:e.host.fonts,value:o.tableDefaultFontFamily,placeholder:m(e,"tableProps.k352"),onChange:d=>n({tableDefaultFontFamily:d||void 0})})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k353")}),l("tableDefaultFontSize")]),ae({value:Fr(o.tableDefaultFontSize),min:0,max:72,placeholder:m(e,"tableProps.k354"),onCommit:d=>n({tableDefaultFontSize:op(d)})})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k355")}),l("tableDefaultColor")]),dt(o.tableDefaultColor,d=>n({tableDefaultColor:d}),m(e,"tableProps.k356"))]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k357")}),l("tableDefaultPadding")]),ae({value:Fr(o.tableDefaultPadding),min:0,max:10,step:.5,placeholder:m(e,"tableProps.k358"),onCommit:d=>n({tableDefaultPadding:op(d)})})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"tableProps.k359")}),...i.map((d,u)=>g("div",{class:"col-width-row"},[g("span",{style:{width:"60px"},text:m(e,"tableProps.k360",{v0:u+1})}),ae({value:d,min:5,max:200,onCommit:c=>{const f=i.reduce((h,b,k)=>k===u?h:h+b,0);if(f+c>a){const h=Math.max(5,Math.round((a-f)*10)/10);window.alert(m(e,"tableProps.k361",{v0:a,v1:u+1,v2:h})),i[u]=h}else i[u]=c;n({tableColWidths:i})}})]))])])])}function YP(e,t){const r=e.store,o=t.options,n=t.printElementType.type==="table",i=s=>r.updateElement(t.id,s),a=[];if(n)a.push(G(e,"pg-enabled",$r(m(e,"tableProps.k362"),o.tablePagination?.enabled??!0,s=>i({tablePagination:{enabled:s}}))));else{const s=o.pagination?.pageable??!0,p=o.pagination?.keepWithNext??!1;a.push(G(e,"pg-pageable",$r(m(e,"tableProps.k363"),s,l=>i({pagination:{pageable:l,keepWithNext:p}})))),a.push(G(e,"pg-keep-with-next",$r(m(e,"tableProps.k364"),p,l=>i({pagination:{pageable:s,keepWithNext:l}}))))}return it(e,"pagination",m(e,"tableProps.k365"),"Document",[ga(a)],!1)}const np=new WeakMap,rg=[{value:"top",labelKey:"tableProps.k366"},{value:"right",labelKey:"tableProps.k367"},{value:"bottom",labelKey:"tableProps.k368"},{value:"left",labelKey:"tableProps.k369"}];function XP(e,t){const r=e.store,o=r.tableSelection,n=t.options.tableRows??[];if(!o)return it(e,"table-cell",m(e,"tableProps.k370"),"Menu",[]);const i=Po(n,o.r1,o.c1),a=n[i.r]?.cells[i.c];if(!a)return it(e,"table-cell",m(e,"tableProps.k371"),"Menu",[]);const s=()=>On(n,o),p=La(n,o),l=p.count,d=p.mode==="multi",u=`${t.id}:${o.r1}:${o.c1}:${o.r2}:${o.c2}`,c=np.get(r),f=c?.key===u?c:{key:u,border:{},values:{},edges:{}};c?.key!==u&&np.set(r,f);const h=T=>{np.set(r,{key:u,border:T.border??f.border,values:T.values??f.values,edges:T.edges??f.edges})},b=(T,X)=>{h({border:{...f.border,[T]:X}}),e.repaint()},k=(T,X)=>{s().forEach(T),d&&X&&h({values:{...f.values,...X}}),r.updateElement(t.id,{tableRows:n})},v=(T,X)=>{k(ee=>{ee[T]=X},{[T]:X})},w=T=>d?f.values[T]:a[T],P=T=>d&&T in f.values,E=d?{width:void 0,style:void 0,color:void 0}:ad(n,o),D=!d&&s().some(T=>!!T.borders&&!!(T.borders.top||T.borders.right||T.borders.bottom||T.borders.left)),O=!d&&!D,A={width:O?0:typeof E.width=="number"?E.width:rr.width,style:O?"none":typeof E.style=="string"&&E.style!=="mixed"?E.style:rr.style,color:typeof E.color=="string"&&E.color!=="mixed"?E.color:rr.color,...f.border},R="__mixed__",_={style:!d&&E.style==="mixed",width:!d&&E.width==="mixed",color:!d&&E.color==="mixed"},I=_.style&&!("style"in f.border),S=_.width&&!("width"in f.border),N=_.color&&!("color"in f.border),F=I||S||N,H=I?R:A.style,le=S?void 0:A.width,M=N?void 0:A.color,ne=T=>{const X={style:T};T!=="none"&&le===0?X.width=rr.width:T==="none"&&!D&&(X.width=0),h({border:{...f.border,...X}}),e.repaint()},Se=()=>({...A}),Pe=d?rg.reduce((T,X)=>(T[X.value]=f.edges[X.value]?"on":"off",T),{}):Kd(s().map(T=>T.borders)),K=d?"cellType"in f.values?f.values.cellType??"text":Ab(n,o):a.cellType??"text",ue=K==="barcode",me=K==="qrcode",we=K==="image",ke=K==="text",te=ue&&!!w("printerDpi"),Me=Td(w("printerDpi"),w("barWidth"),e.t??oe),se=d?f.values.textFit:Fa(a),Je=d?"cellType"in f.values?f.values.cellType??"text":"":a.cellType||"text",ze=T=>tg(d?[VP,...T]:T,e),ve=T=>d?m(e,"tableProps.k372"):T,Ee=(T,X)=>d?f.values[T]:X,ho=d?w("barcodeType")??"__multi__":a.barcodeType||"CODE128",vn=d?P("printerDpi")?w("printerDpi")?String(w("printerDpi")):"":"__multi__":a.printerDpi?String(a.printerDpi):"",wn=d?w("qrCodeLevel")??"__multi__":a.qrCodeLevel||"M",xn=d?w("fit")??"__multi__":a.fit||"contain",mo=se??"__multi__",xe=Qp(n,o);let Dt=!0;for(let T=o.r1;T<=o.r2;T++)if(n[T]?.type!=="data"){Dt=!1;break}const C=Dt?"":m(e,"tableProps.k373");let q=!1;for(let T=o.r1;T<=o.r2&&!q;T++)for(let X=o.c1;X<=o.c2&&!q;X++){const ee=n[T]?.cells[X];ee&&!ee.merged&&((ee.rowspan??1)>1||(ee.colspan??1)>1)&&(q=!0)}const U=(T,X,ee,ie={},ce)=>g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:T}),ce??""].filter(Boolean)),ae({value:X,...ie,onCommit:Te=>v(ee,op(Te))})]),V=m(e,"tableProps.k374"),j=T=>Lr({target:a,base:{},propKey:T,tipOverride:V,force:d,write:()=>v(T,void 0)}),J=t.options.tableDefaultPadding??1,pe={width:za(t.options.tableColWidths??[],i.c,a,J),height:Co(n,i.r,a,J)};return it(e,"table-cell",m(e,"tableProps.k375"),"Menu",[ga([d?fo(m(e,"tableProps.k376",{v0:l})):"",g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"tableProps.k377")}),pr("cell-type",[{value:"text",label:m(e,"tableProps.k378")},{value:"barcode",label:m(e,"tableProps.k379")},{value:"qrcode",label:m(e,"tableProps.k380")},{value:"image",label:m(e,"tableProps.k381")}],Je,T=>{const X=T==="text"?void 0:T,ee={cellType:T};T!=="barcode"&&Object.assign(ee,{barcodeType:void 0,showBarcodeText:void 0,printerDpi:void 0,barQuietZone:void 0,barHeight:void 0}),T!=="qrcode"&&Object.assign(ee,{qrCodeLevel:void 0,qrQuietZone:void 0}),k(ie=>{ie.cellType=X,T!=="barcode"&&(ie.barcodeType=void 0,ie.showBarcodeText=void 0,ie.printerDpi=void 0,ie.barQuietZone=void 0,ie.barHeight=void 0),T!=="qrcode"&&(ie.qrCodeLevel=void 0,ie.qrQuietZone=void 0)},ee)})]),ue?kn(m(e,"tableProps.k382"),ho,ze(qP),T=>{T!=="__multi__"&&v("barcodeType",T||void 0)}):"",ue?$r(m(e,"tableProps.k383"),d?f.values.showBarcodeText===!0:a.showBarcodeText!==!1,T=>v("showBarcodeText",T),void 0,j("showBarcodeText")):"",ue?U(m(e,"tableProps.k384"),Ee("barWidth",a.barWidth??2),"barWidth",{min:2,max:8,step:.5,placeholder:ve("")},j("barWidth")):"",ue?fo((te?m(e,"tableProps.k385"):m(e,"tableProps.k386"))+(Me?`。${Me}`:"")):"",ue?Ge(m(e,"tableProps.k387"),ae({value:Ee("barQuietZone",a.barQuietZone),min:0,max:20,placeholder:ve(m(e,"tableProps.k388")),onCommit:T=>v("barQuietZone",T)}),m(e,"propertyTips.cd-bar-quiet-zone"),j("barQuietZone")):"",ue?Ge(m(e,"tableProps.k389"),ae({value:Ee("barHeight",a.barHeight),min:1,max:100,placeholder:ve(m(e,"tableProps.k390")),onCommit:T=>v("barHeight",T??void 0)}),m(e,"propertyTips.cd-bar-height"),j("barHeight")):"",ue?U(m(e,"tableProps.k391"),Ee("barFontSize",a.barFontSize??10),"barFontSize",{min:5,max:24,placeholder:ve(m(e,"tableProps.k392"))},j("barFontSize")):"",ue?kn(m(e,"tableProps.k393"),vn,ze([{value:"",label:m(e,"tableProps.k394")},{value:"203",label:m(e,"tableProps.k395")},{value:"300",label:m(e,"tableProps.k396")},{value:"600",label:m(e,"tableProps.k397")}]),T=>{if(T==="__multi__")return;const X=Number(T);v("printerDpi",X>0?X:void 0)},{reset:j("printerDpi")}):"",ue?fo(m(e,"tableProps.k398")):"",me?kn(m(e,"tableProps.k399"),wn,ze(jP),T=>{T!=="__multi__"&&v("qrCodeLevel",T||void 0)},{reset:j("qrCodeLevel")}):"",me?Ge(m(e,"tableProps.k400"),ae({value:Ee("qrQuietZone",a.qrQuietZone),min:0,max:8,placeholder:ve(m(e,"tableProps.k401")),onCommit:T=>v("qrQuietZone",T)}),m(e,"propertyTips.cd-quiet-zone"),j("qrQuietZone")):"",ue?fo(m(e,"tableProps.k402")):"",me||we?kn(m(e,"tableProps.k403"),xn,ze(Hs(e.t??oe)),T=>{T!=="__multi__"&&v("fit",T)},{reset:j("fit")}):"",we&&!d&&a.fit==="cover"?Qm(e,{fieldKey:"ap-img-object-position",label:m(e,"tableProps.k404"),src:xu(a.formatter),fit:a.fit,containerClass:"pd-cell-anchor",widthMm:pe.width,heightMm:pe.height,scale:a.fitScale,value:a.objectPosition,onCommit:T=>v("objectPosition",T),onScaleCommit:T=>v("fitScale",T),resetAnchor:j("objectPosition"),resetScale:j("fitScale")}):"",ue||me||we?U(m(e,"tableProps.k405"),Ee("maxWidth",Fr(a.maxWidth)),"maxWidth",{min:0,max:200,placeholder:ve(m(e,"tableProps.k406"))},j("maxWidth")):"",ue||me||we?U(m(e,"tableProps.k407"),Ee("maxHeight",Fr(a.maxHeight)),"maxHeight",{min:0,max:200,placeholder:ve(m(e,"tableProps.k408"))},j("maxHeight")):"",g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"tableProps.k409")}),g("input",{class:"pd-input",type:"text",value:d?w("formatter")??"":a.formatter||"",placeholder:d?m(e,"tableProps.k410"):m(e,"tableProps.k411"),onChange:T=>v("formatter",T.target.value||void 0),onDblclick:()=>e.fire("table-cell-dblclick",{elementId:t.id,r:i.r,c:i.c,cellId:a.id})})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k412")}),j("align")]),pr("cell-align",[{value:"left",label:m(e,"tableProps.k413")},{value:"center",label:m(e,"tableProps.k414")},{value:"right",label:m(e,"tableProps.k415")},{value:"justify",label:m(e,"tableProps.k416")}],d?f.values.align??"":a.align||"left",T=>v("align",T))]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k417")}),j("valign")]),pr("cell-valign",[{value:"top",label:m(e,"tableProps.k418")},{value:"middle",label:m(e,"tableProps.k419")},{value:"bottom",label:m(e,"tableProps.k420")}],d?f.values.valign??"":a.valign||"top",T=>v("valign",T))]),g("div",{class:"cell-style-grid"},[g("div",{class:"pd-field cell-font-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k421")}),j("fontFamily")]),ha({id:"cell-font",state:e.state,fonts:e.host.fonts,value:d?w("fontFamily"):a.fontFamily,placeholder:ve(m(e,"tableProps.k422")),onChange:T=>v("fontFamily",T)})]),U(m(e,"tableProps.k423"),Ee("fontSize",Fr(a.fontSize)),"fontSize",{min:0,max:72,placeholder:ve(m(e,"tableProps.k424"))},j("fontSize")),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k425")}),j("fontWeight")]),g("input",{class:"pd-switch",type:"checkbox",checked:d?f.values.fontWeight==="bold":a.fontWeight==="bold",onChange:T=>v("fontWeight",T.target.checked?"bold":void 0)})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k426")}),j("color")]),dt(d?w("color"):a.color,T=>v("color",T),m(e,"tableProps.k427"))]),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"tableProps.k428")}),j("backgroundColor")]),dt(d?w("backgroundColor"):a.backgroundColor,T=>v("backgroundColor",T),m(e,"tableProps.k429"))])]),$t(m(e,"tableProps.k430")),g("div",{class:"border-style-row"},[zh(H,[...I?[{value:R,label:m(e,"tableProps.k431"),disabled:!0}]:[],...Yd.map(T=>({...T,label:m(e,T.labelKey)}))],T=>{T!==R&&ne(T)},{width:"90px"}),g("div",{style:{width:"112px",flexShrink:"0"}},[ae({value:le,min:.25,max:5,step:.25,placeholder:d?m(e,"tableProps.k432"):S?m(e,"tableProps.k433"):void 0,onCommit:T=>b("width",T)})]),dt(M,T=>b("color",T),m(e,"tableProps.k434"))]),g("div",{class:"pd-button-group border-presets"},[["all",m(e,"tableProps.k435")],["outer",m(e,"tableProps.k436")],["inner",m(e,"tableProps.k437")],["none",m(e,"tableProps.k438")]].map(([T,X])=>g("button",{type:"button",class:"pd-button small",text:X,onClick:()=>{nd(n,o,A.style==="none"?"none":T,Se()),r.updateElement(t.id,{tableRows:n})}}))),g("div",{class:"pd-checkbox-group"},rg.map(T=>g("label",{class:"pd-checkbox"},[g("input",{type:"checkbox",value:T.value,checked:Pe[T.value]==="on",indeterminate:Pe[T.value]==="mixed",onChange:X=>{const ie=X.target.checked&&A.style!=="none";d&&h({edges:{...f.edges,[T.value]:ie}}),k(ce=>{id(ce,T.value,ie?Se():null)})}}),g("span",{text:m(e,T.labelKey)})]))),fo(m(e,d?_b:F?Db:Cb)),U(m(e,"tableProps.k439"),Ee("padding",Fr(a.padding)),"padding",{min:0,max:10,step:.5,placeholder:ve(m(e,"tableProps.k440"))},j("padding")),$r(m(e,"tableProps.k441"),d?f.values.wordWrap===!0:a.wordWrap??!0,T=>v("wordWrap",T),void 0,j("wordWrap")),ke?kn(m(e,"tableProps.k442"),mo,ze(WP),T=>{T!=="__multi__"&&v("textFit",T)},{full:!0,reset:j("textFit")}):"",ke&&se==="shrink"?U(m(e,"tableProps.k443"),Ee("shrinkMinFontSize",Fr(a.shrinkMinFontSize)),"shrinkMinFontSize",{min:0,max:72,step:.5,placeholder:ve(m(e,"tableProps.k444"))},j("shrinkMinFontSize")):"",g("div",{class:"merge-card"},[g("div",{class:"merge-card-title",text:m(e,"tableProps.k445")}),g("div",{class:"merge-btns"},[g("button",{type:"button",class:"pd-button small",text:m(e,"tableProps.k446"),disabled:!!xe,title:xe||"",onClick:()=>{ed(n,o),r.updateElement(t.id,{tableRows:n})}}),g("button",{type:"button",class:"pd-button small",text:m(e,"tableProps.k447"),disabled:!q,onClick:()=>{td(n,o),r.updateElement(t.id,{tableRows:n})}})]),g("div",{class:"merge-card-divider"}),$r(m(e,"tableProps.k448"),d?f.values.mergeSameValue===!0:a.mergeSameValue===!0,T=>v("mergeSameValue",T),C||void 0,Dt?j("mergeSameValue"):void 0,!Dt),fo(m(e,"tableProps.k449"))])])])}const ip=ek;function ap(e){const t=e.trim();return t?/[{}]/.test(t)||/^[A-Za-z_$][\w$]*\s*\(/.test(t)?!0:/^[A-Za-z_$][\w$]*(\.[\w$]+)+$/.test(t):!1}function ZP(e){return e?e.mode==="binding"?e.binding??"":e.content??"":""}function JP(e){const t=e.store.templateData.watermark,r=ZP(t),o=t?.mode==="binding"||r!==""&&ap(r),n=(()=>{const l=t?.tileWidth??ge.tileWidth,d=t?.tileHeight??ge.tileHeight;for(const[u,c]of Object.entries(ip))if(c.width===l&&c.height===d)return u;return"custom"})(),i=l=>{const d={...t,testData:t?.testData??"",rotate:t?.rotate??ge.rotate,color:t?.color||ge.color,opacity:t?.opacity??ge.opacity,tileWidth:t?.tileWidth??ge.tileWidth,tileHeight:t?.tileHeight??ge.tileHeight};e.store.updateTemplateData({watermark:{...d,...l}})},a=()=>e.fire("open-expression",{elementId:"",targetPath:"watermark.content",value:r}),s={rotate:t?.rotate??ge.rotate,color:t?.color||ge.color,opacity:t?.opacity??ge.opacity,tileWidth:t?.tileWidth??ge.tileWidth,tileHeight:t?.tileHeight??ge.tileHeight},p=l=>Lr({target:s,base:ge,propKey:l,write:()=>i({[l]:ge[l]})});return g("div",{class:"watermark-config"},[$t(m(e,"watermark.k538")),g("form",{class:"pd-form",onSubmit:l=>l.preventDefault()},[g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"watermark.k539")}),g("input",{class:"pd-input",type:"text",value:r,placeholder:m(e,"watermark.k540"),title:m(e,"watermark.k541"),onChange:l=>{const d=l.target.value;i(ap(d)?{mode:"binding",binding:d,content:""}:{mode:"fixed",content:d,binding:""})},onDblclick:a}),g("button",{type:"button",class:"pd-button small",text:m(e,"watermark.k542"),onClick:a})]),o?he(m(e,"watermark.k543"),g("input",{class:"pd-input",type:"text",value:t?.testData??"",placeholder:m(e,"watermark.k544"),onChange:l=>i({testData:l.target.value})})):"",g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"watermark.k545")}),p("rotate")]),g("input",{type:"range",class:"pd-range",min:-90,max:90,step:5,value:String(t?.rotate??ge.rotate),onChange:l=>i({rotate:Number(l.target.value)})}),g("span",{class:"pd-hint",text:`${t?.rotate??ge.rotate}°`})]),he(m(e,"watermark.k546"),dt(t?.color||ge.color,l=>i({color:l}),m(e,"watermark.k547")),void 0,p("color")),g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"watermark.k548")}),p("opacity")]),g("input",{type:"range",class:"pd-range",min:.05,max:.5,step:.05,value:String(t?.opacity??ge.opacity),onChange:l=>i({opacity:Number(l.target.value)})}),g("span",{class:"pd-hint",text:(t?.opacity??ge.opacity).toFixed(2)})]),g("div",{class:"pd-field"},[g("span",{class:"pd-label",text:m(e,"watermark.k549")}),g("select",{class:"pd-select",style:{width:"100%"},onChange:l=>{const d=l.target.value,u=ip[d];u&&i({tileWidth:u.width,tileHeight:u.height})}},[...Object.entries(ip).map(([l,d])=>g("option",{value:l,text:`${m(e,d.labelKey)}${m(e,"constants.watermark.density.size",{w:d.width,h:d.height})}`,selected:n===l})),g("option",{value:"custom",text:m(e,"watermark.k550"),selected:n==="custom"})])]),n==="custom"?g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"watermark.k551")}),p("tileWidth")]),g("input",{type:"number",class:"pd-input",min:ge.minTileWidth,step:10,value:String(t?.tileWidth??ge.tileWidth),onChange:l=>i({tileWidth:Number(l.target.value)})})]):"",n==="custom"?g("div",{class:"pd-field"},[g("span",{class:"pd-label"},[g("span",{class:"pd-label-t",text:m(e,"watermark.k552")}),p("tileHeight")]),g("input",{type:"number",class:"pd-input",min:ge.minTileHeight,step:10,value:String(t?.tileHeight??ge.tileHeight),onChange:l=>i({tileHeight:Number(l.target.value)})})]):""].filter(Boolean))])}function Fe(e,t,r,o,n={},i){return he(t,ae({value:r,...n,onCommit:o}),void 0,i)}function Xt(e,t,r,o,n,i,a){const s=document.createElement("select");s.className="pd-select",s.addEventListener("change",()=>n(s.value));for(const p of o){const l=document.createElement("option");l.value=p.value,l.textContent=p.label,s.appendChild(l)}return s.value=r,o.some(p=>p.value===r)||(s.selectedIndex=-1),i?Ge(t,s,i,a):he(t,s,void 0,a)}function zr(e,t,r,o,n){return he(t,g("input",{type:"checkbox",class:"pd-switch",checked:r,onChange:i=>o(i.target.checked)}),void 0,n)}const QP=[{value:"all",labelKey:"propertyPanel.k177"},{value:"outer",labelKey:"propertyPanel.k178"},{value:"inner",labelKey:"propertyPanel.k179"},{value:"none",labelKey:"propertyPanel.k180"}],e3=[{value:"top",labelKey:"propertyPanel.k181"},{value:"right",labelKey:"propertyPanel.k182"},{value:"bottom",labelKey:"propertyPanel.k183"},{value:"left",labelKey:"propertyPanel.k184"}];function t3(e,t){const r=e.store,o=t.options,n=t.printElementType.type,i=M=>r.updateElement(t.id,M),a=Kh(n),s=a==="text",p=a==="code",l=a==="table",d=l&&r.tableSelection?.elementId===t.id,u=d&&La(t.options.tableRows??[],r.tableSelection).mode==="multi",c=[];u||c.push(zP(e,t));const f=es(n),h=(M,ne)=>{const Se=p1(ne);return Lr({target:o,base:f,propKey:M,tipValue:Se?.value,tipUnit:Se?.unit,write:()=>i({[M]:f[M]})})};d||c.push(it(e,"position-size",m(e,"propertyPanel.k185"),"Location",[g("form",{class:"pd-form",onSubmit:M=>M.preventDefault()},[g("div",{class:"position-grid"},[G(e,"ps-left",Fe(e,"X",o.left,M=>i({left:M}),{min:0})),G(e,"ps-top",Fe(e,"Y",o.top,M=>i({top:M}),{min:0})),G(e,"ps-width",Fe(e,"W",o.width,M=>i({width:M}),{min:4})),G(e,"ps-height",Fe(e,"H",o.height,M=>i({height:M}),{min:4}))]),g("h3",{class:"pd-divider",text:m(e,"propertyPanel.k186")}),g("div",{class:"margin-grid"},[G(e,"ps-margin-top",Fe(e,m(e,"propertyPanel.k187"),o.marginTop,M=>i({marginTop:M===0?void 0:M}),{},h("marginTop","ps-margin-top"))),G(e,"ps-margin-right",Fe(e,m(e,"propertyPanel.k188"),o.marginRight,M=>i({marginRight:M===0?void 0:M}),{},h("marginRight","ps-margin-right"))),G(e,"ps-margin-bottom",Fe(e,m(e,"propertyPanel.k189"),o.marginBottom,M=>i({marginBottom:M===0?void 0:M}),{},h("marginBottom","ps-margin-bottom"))),G(e,"ps-margin-left",Fe(e,m(e,"propertyPanel.k190"),o.marginLeft,M=>i({marginLeft:M===0?void 0:M}),{},h("marginLeft","ps-margin-left")))])])]));const b=typeof o.rotate=="number"&&Number.isFinite(o.rotate)&&o.rotate!==0?Ro(o.rotate):void 0,k=M=>i({rotate:M===void 0||M===0?void 0:Ro(M)}),v=g0(n,o),w=Rd(n)||Fd(r.elements).has(t.id),P=w?"":G(e,"ap-rotate",Ge(m(e,"propertyPanel.k191"),g("div",{class:"pd-rotate-row"},[g("button",{type:"button",class:"pd-rotate-btn",title:m(e,"propertyPanel.k192"),"aria-label":m(e,"propertyPanel.k193"),text:"↺",onClick:()=>k((b??0)-90)}),g("div",{class:"pd-rotate-stepper"},[ae({value:b,min:0,max:359,placeholder:"0",disabled:!v,onCommit:M=>k(M)})]),g("button",{type:"button",class:"pd-rotate-btn",title:m(e,"propertyPanel.k194"),"aria-label":m(e,"propertyPanel.k195"),text:"↻",onClick:()=>k((b??0)+90)})]),m(e,"propertyTips.ap-rotate"),h("rotate","ap-rotate"))),E=w||v?"":g("p",{class:"pd-hint pd-rotate-note",text:m0(e.t??oe)});if(c.push(it(e,"appearance",m(e,"propertyPanel.k196"),"Brush",[g("form",{class:"pd-form",onSubmit:M=>M.preventDefault()},s?[G(e,"ap-font-family",he(m(e,"propertyPanel.k197"),ha({id:"prop-font",state:e.state,fonts:e.host.fonts,value:typeof o.fontFamily=="string"?o.fontFamily:void 0,placeholder:m(e,"propertyPanel.k198"),onChange:M=>i({fontFamily:M})}),void 0,h("fontFamily","ap-font-family"))),G(e,"ap-font-size",Fe(e,m(e,"propertyPanel.k199"),o.fontSize,M=>i({fontSize:M}),{min:8,max:72},h("fontSize","ap-font-size"))),G(e,"ap-font-weight",Xt(e,m(e,"propertyPanel.k200"),String(o.fontWeight??""),[{value:"normal",label:m(e,"propertyPanel.k201")},{value:"bold",label:m(e,"propertyPanel.k202")},{value:"bolder",label:m(e,"propertyPanel.k203")},{value:"lighter",label:m(e,"propertyPanel.k204")}],M=>i({fontWeight:M}),void 0,h("fontWeight","ap-font-weight"))),G(e,"ap-align",he(m(e,"propertyPanel.k205"),pr("ta",[{value:"left",label:m(e,"propertyPanel.k206")},{value:"center",label:m(e,"propertyPanel.k207")},{value:"right",label:m(e,"propertyPanel.k208")},{value:"justify",label:m(e,"propertyPanel.k209")}],o.textAlign||"left",M=>i({textAlign:M})),void 0,h("textAlign","ap-align"))),G(e,"ap-vertical-align",he(m(e,"propertyPanel.k210"),pr("va",[{value:"top",label:m(e,"propertyPanel.k211")},{value:"middle",label:m(e,"propertyPanel.k212")},{value:"bottom",label:m(e,"propertyPanel.k213")}],o.verticalAlign||"top",M=>i({verticalAlign:M})),void 0,h("verticalAlign","ap-vertical-align"))),g("div",{class:"color-row"},[G(e,"ap-color",he(m(e,"propertyPanel.k214"),dt(o.color,M=>i({color:M}),m(e,"propertyPanel.k215")),void 0,h("color","ap-color"))),G(e,"ap-bg-color",he(m(e,"propertyPanel.k216"),dt(o.backgroundColor,M=>i({backgroundColor:M}),m(e,"propertyPanel.k217")),void 0,h("backgroundColor","ap-bg-color")))]),G(e,"ap-line-height",Fe(e,m(e,"propertyPanel.k218"),o.lineHeight,M=>i({lineHeight:M||void 0}),{min:0,max:100},h("lineHeight","ap-line-height"))),G(e,"ap-letter-spacing",Fe(e,m(e,"propertyPanel.k219"),o.letterSpacing,M=>i({letterSpacing:M||void 0}),{min:0,max:20,step:.5},h("letterSpacing","ap-letter-spacing"))),G(e,"ap-text-fit",Xt(e,m(e,"propertyPanel.k220"),Ln(n,o),[{value:"clip",label:m(e,"propertyPanel.k221")},{value:"shrink",label:m(e,"propertyPanel.k222")},{value:"autoHeight",label:m(e,"propertyPanel.k223")}],M=>i({textFit:M}),void 0,h("textFit","ap-text-fit"))),o.textFit==="shrink"?G(e,"ap-shrink-min",he(m(e,"propertyPanel.k224"),ae({value:o.shrinkMinFontSize,min:1,max:72,step:.5,placeholder:m(e,"propertyPanel.k225"),onCommit:M=>i({shrinkMinFontSize:M||void 0})}),void 0,h("shrinkMinFontSize","ap-shrink-min"))):"",n==="longText"?G(e,"ap-long-text-indent",Ge(m(e,"propertyPanel.k226"),ae({value:o.longTextIndent,min:0,max:10,placeholder:m(e,"propertyPanel.k227"),onCommit:M=>i({longTextIndent:M||void 0})}),m(e,"propertyTips.ap-long-text-indent"),h("longTextIndent","ap-long-text-indent"))):"",G(e,"ap-word-wrap",zr(e,m(e,"propertyPanel.k228"),o.wordWrap!==!1,M=>i({wordWrap:M?void 0:!1}),h("wordWrap","ap-word-wrap"))),G(e,"ap-keep-line-breaks",zr(e,m(e,"propertyPanel.k229"),o.keepLineBreaks===!0,M=>i({keepLineBreaks:M?!0:void 0}),h("keepLineBreaks","ap-keep-line-breaks"))),P,E]:[n==="image"?G(e,"ap-img-fit",Xt(e,m(e,"propertyPanel.k230"),String(o.fit??"contain"),Hs(e.t??oe),M=>i({fit:M}),m(e,"propertyTips.ap-img-fit"),h("fit","ap-img-fit"))):"",n==="image"&&o.fit==="cover"?G(e,"ap-img-object-position",Qm(e,{fieldKey:"ap-img-object-position",label:m(e,"propertyPanel.k231"),src:xu(o.src),widthMm:Number(o.width)||0,heightMm:Number(o.height)||0,fit:o.fit,scale:o.fitScale,value:o.objectPosition===void 0?void 0:String(o.objectPosition),onCommit:M=>i({objectPosition:M}),onScaleCommit:M=>i({fitScale:M}),resetAnchor:h("objectPosition","ap-img-object-position"),resetScale:h("fitScale","ap-img-fit-scale")})):"",P,E,n==="flowList"?g("p",{class:"pd-empty",text:m(e,"propertyPanel.k232")}):""].filter(Boolean))])),p){const M=n==="barcode",ne=String(o.barcodeType||"CODE128").toUpperCase(),Se=o.printerDpi?String(o.printerDpi):"",Pe=Td(o.printerDpi,o.barWidth,e.t??oe);c.push(it(e,"code",m(e,"propertyPanel.k233"),"Postcard",[g("form",{class:"pd-form",onSubmit:K=>K.preventDefault()},[M?[G(e,"cd-type",Xt(e,m(e,"propertyPanel.k234"),ne,[{value:"CODE128",label:m(e,"propertyPanel.k235")},{value:"EAN13",label:m(e,"propertyPanel.k236")},{value:"EAN8",label:"EAN8"},{value:"UPC",label:"UPC"},{value:"CODE39",label:"CODE39"},{value:"ITF14",label:"ITF14"}],K=>i({barcodeType:K==="CODE128"?void 0:K}))),G(e,"cd-dpi",Xt(e,m(e,"propertyPanel.k237"),Se,[{value:"",label:m(e,"propertyPanel.k238")},{value:"203",label:m(e,"propertyPanel.k239")},{value:"300",label:m(e,"propertyPanel.k240")},{value:"600",label:m(e,"propertyPanel.k241")}],K=>i({printerDpi:Number(K)>0?Number(K):void 0}),void 0,h("printerDpi","cd-dpi"))),G(e,"cd-dpi",g("p",{class:"pd-hint",text:m(e,"propertyPanel.k242")})),G(e,"cd-bar-width",Fe(e,m(e,"propertyPanel.k243"),o.barWidth??2,K=>i({barWidth:K}),{min:2,max:8,step:.5},h("barWidth","cd-bar-width"))),G(e,"cd-bar-width",g("p",{class:"pd-hint",text:(Se?m(e,"propertyPanel.k244"):m(e,"propertyPanel.k245"))+(Pe?`。${Pe}`:"")})),G(e,"cd-bar-quiet-zone",Ge(m(e,"propertyPanel.k246"),ae({value:o.barQuietZone,min:0,max:20,placeholder:m(e,"propertyPanel.k247"),onCommit:K=>i({barQuietZone:K})}),m(e,"propertyTips.cd-bar-quiet-zone"),h("barQuietZone","cd-bar-quiet-zone"))),G(e,"cd-bar-height",Ge(m(e,"propertyPanel.k248"),ae({value:o.barHeight,min:1,max:100,placeholder:m(e,"propertyPanel.k249"),onCommit:K=>i({barHeight:K??void 0})}),m(e,"propertyTips.cd-bar-height"),h("barHeight","cd-bar-height"))),G(e,"cd-show-text",zr(e,m(e,"propertyPanel.k250"),o.hideTitle!==!0,K=>i({hideTitle:K?void 0:!0}),h("hideTitle","cd-show-text"))),G(e,"cd-font-size",he(m(e,"propertyPanel.k251"),ae({value:o.fontSize,min:5,max:24,placeholder:m(e,"propertyPanel.k252"),onCommit:K=>i({fontSize:K||void 0})}),void 0,h("fontSize","cd-font-size")))]:[G(e,"cd-ec-level",Xt(e,m(e,"propertyPanel.k253"),String(o.qrCodeLevel??"M"),[{value:"L",label:m(e,"propertyPanel.k254")},{value:"M",label:m(e,"propertyPanel.k255")},{value:"Q",label:"Q"},{value:"H",label:m(e,"propertyPanel.k256")}],K=>i({qrCodeLevel:K}),void 0,h("qrCodeLevel","cd-ec-level"))),G(e,"cd-quiet-zone",Ge(m(e,"propertyPanel.k257"),ae({value:o.qrQuietZone,min:0,max:8,placeholder:m(e,"propertyPanel.k258"),onCommit:K=>i({qrQuietZone:K})}),m(e,"propertyTips.cd-quiet-zone"),h("qrQuietZone","cd-quiet-zone")))],$t(m(e,"propertyPanel.k259")),M?g("p",{class:"pd-hint",text:m(e,"propertyPanel.k260")}):"",M?"":G(e,"cd-fit",Xt(e,m(e,"propertyPanel.k261"),String(o.fit||"contain"),Hs(e.t??oe),K=>i({fit:K||void 0}),void 0,h("fit","cd-fit"))),G(e,"cd-max-width",he(m(e,"propertyPanel.k262"),ae({value:o.maxWidth,min:1,max:200,placeholder:m(e,"propertyPanel.k263"),onCommit:K=>i({maxWidth:K||void 0})}),void 0,h("maxWidth","cd-max-width"))),G(e,"cd-max-height",he(m(e,"propertyPanel.k264"),ae({value:o.maxHeight,min:1,max:200,placeholder:m(e,"propertyPanel.k265"),onCommit:K=>i({maxHeight:K||void 0})}),void 0,h("maxHeight","cd-max-height")))].flat().filter(Boolean))]))}if(d&&(c.push(GP(e,t)),c.push(XP(e,t))),l&&c.push(KP(e,t)),n==="flowList"){const M=bt(o.flowColumns),ne=or(o.flowRowHeight),Se=Et(o.flowGapX),Pe=xr(o.flowMaxSpan,M),K=r0(o.width??0,Se,o.fontSize??12),ue=wr(o.flowLayoutMode),me=ue==="dynamic",we=Gr(o),ke=(te,Me)=>{i({[te]:typeof Me=="number"&&Number.isFinite(Me)&&Me>0?Me:0})};c.push(it(e,"flowList",m(e,"propertyPanel.k266"),"Grid3x3",[g("form",{class:"pd-form",onSubmit:te=>te.preventDefault()},[G(e,"fl-layout-mode",Xt(e,m(e,"propertyPanel.k267"),ue,[{value:"fixed",label:m(e,"propertyPanel.k268")},{value:"dynamic",label:m(e,"propertyPanel.k269")}],te=>i({flowLayoutMode:te==="dynamic"?"dynamic":"fixed"}),m(e,"propertyTips.fl-layout-mode"))),...me?[G(e,"fl-padding-top",Ge(m(e,"propertyPanel.k270"),ae({value:we.top,min:0,max:100,step:.5,onCommit:te=>ke("flowPaddingTop",te)}),m(e,"propertyTips.fl-padding-top"))),G(e,"fl-padding-right",Ge(m(e,"propertyPanel.k271"),ae({value:we.right,min:0,max:100,step:.5,onCommit:te=>ke("flowPaddingRight",te)}),m(e,"propertyTips.fl-padding-right"))),G(e,"fl-padding-bottom",Ge(m(e,"propertyPanel.k272"),ae({value:we.bottom,min:0,max:100,step:.5,onCommit:te=>ke("flowPaddingBottom",te)}),m(e,"propertyTips.fl-padding-bottom"))),G(e,"fl-padding-left",Ge(m(e,"propertyPanel.k273"),ae({value:we.left,min:0,max:100,step:.5,onCommit:te=>ke("flowPaddingLeft",te)}),m(e,"propertyTips.fl-padding-left")))]:[],G(e,"fl-columns",Ge(m(e,"propertyPanel.k274"),ae({value:M,min:1,max:12,onCommit:te=>i({flowColumns:bt(te),flowMaxSpan:xr(o.flowMaxSpan,bt(te))})}),m(e,"propertyTips.fl-columns"))),G(e,"fl-row-height",Ge(m(e,"propertyPanel.k275"),ae({value:ne,min:3,max:100,step:.5,onCommit:te=>i({flowRowHeight:or(te)})}),m(e,"propertyTips.fl-row-height"))),G(e,"fl-gap-x",Ge(m(e,"propertyPanel.k276"),ae({value:Se,min:0,max:50,step:.5,onCommit:te=>i({flowGapX:Et(te)})}),m(e,"propertyTips.fl-gap-x"))),G(e,"fl-auto-span",zr(e,m(e,"propertyPanel.k277"),o.flowAutoSpan===!0,te=>{i(te?{flowAutoSpan:te,flowMaxSpan:Pe}:{flowAutoSpan:te})})),o.flowAutoSpan===!0?G(e,"fl-max-span",Ge(m(e,"propertyPanel.k278"),ae({value:Pe,min:1,max:M,onCommit:te=>i({flowMaxSpan:xr(te,M)})}),m(e,"propertyTips.fl-max-span"))):"",M>K?g("p",{class:"pd-hint",text:m(e,"propertyPanel.k279",{v0:M,v1:K,v2:M})}):""].flat().filter(Boolean))]))}const D=()=>({borderWidth:o.borderWidth,borderStyle:o.borderStyle,borderColor:o.borderColor,borders:o.borders}),O=M=>{const ne=D();Xd(ne,M,Qd(ne)),i(ne)},A=M=>{const ne=D();is(ne,M,!Fo(ne,M)),i(ne)},R=Jd(o),_=R.style==="mixed",I=typeof R.width=="number"?R.width:void 0,S=_||R.style===void 0?"":R.style,N=typeof R.color=="string"?R.color:void 0,F=(M,ne)=>{const Se=D();j0(Se,M,ne),i(Se)},H=Yd.map(M=>({...M,label:m(e,M.labelKey)})),le=_?[{value:"",label:m(e,"propertyPanel.k280")},...H]:H;return c.push(it(e,"border-bg",m(e,"propertyPanel.k281"),"Picture",[g("form",{class:"pd-form",onSubmit:M=>M.preventDefault()},[G(e,"bb-border-style",Xt(e,m(e,"propertyPanel.k282"),S,le,M=>F("borderStyle",M))),g("div",{class:"border-row"},[G(e,"bb-border-width",Fe(e,m(e,"propertyPanel.k283"),I,M=>F("borderWidth",M),{min:0,max:20,step:.25,placeholder:R.width==="mixed"?m(e,"propertyPanel.k284"):void 0},h("borderWidth","bb-border-width"))),G(e,"bb-border-color",he(m(e,"propertyPanel.k285"),dt(N,M=>F("borderColor",M),m(e,"propertyPanel.k286")),void 0,h("borderColor","bb-border-color")))]),...$n(n)?[g("div",{class:"pd-button-group border-presets"},QP.map(M=>g("button",{type:"button",class:"pd-button small",text:m(e,M.labelKey),disabled:M.value==="inner",onClick:()=>O(M.value)}))),g("div",{class:"pd-checkbox-group"},e3.map(M=>g("label",{class:"pd-checkbox"},[g("input",{type:"checkbox",checked:Fo(o,M.value),onChange:()=>A(M.value)}),g("span",{text:m(e,M.labelKey)})]))),g("p",{class:"pd-hint",text:m(e,N0)})]:[],G(e,"bb-bg-color",he(m(e,"propertyPanel.k287"),dt(o.backgroundColor,M=>i({backgroundColor:M}),m(e,"propertyPanel.k288")),void 0,h("backgroundColor","bb-bg-color")))])])),c.push(YP(e,t)),c.push(it(e,"advanced",m(e,"propertyPanel.k289"),"Setting",[g("form",{class:"pd-form",onSubmit:M=>M.preventDefault()},[g("div",{class:"advanced-row"},[G(e,"ad-locked",zr(e,m(e,"propertyPanel.k290"),!!o.locked,M=>i({locked:M}),h("locked","ad-locked"))),G(e,"ad-fixed",zr(e,m(e,"propertyPanel.k291"),!!o.repeatOnEveryPage,M=>i({repeatOnEveryPage:M}),h("repeatOnEveryPage","ad-fixed"))),G(e,"ad-fixed-position",zr(e,m(e,"propertyPanel.k292"),!!o.fixed,M=>i({fixed:M}),h("fixed","ad-fixed-position")))]),G(e,"ad-z-index",Fe(e,m(e,"propertyPanel.k293"),o.zIndex,M=>i({zIndex:M}),{min:0,max:999},h("zIndex","ad-z-index"))),G(e,"ad-delete",g("div",{class:"pd-field"},[g("button",{type:"button",class:"pd-button danger",text:m(e,"propertyPanel.k294"),onClick:()=>r.deleteSelected()})]))])],!1,[g("button",{type:"button",class:"group-help",title:m(e,"propertyPanel.k295"),"aria-label":m(e,"propertyPanel.k296"),text:"?",onClick:M=>{M.stopPropagation(),e.fire("help","advanced-settings")}})])),g("div",{class:"property-content"},c)}function r3(e){const t=e.store,r=t.templateData,o=p=>t.updateTemplateData(p),n=p=>{const l=r.tiling,d=u=>u===90||u===270;if(l?.enabled&&d(p)!==d(r.outputRotation)){const u=hu({...r,outputRotation:p});o({outputRotation:p,tiling:{...l,columns:Math.max(u,1)}});return}o({outputRotation:p})},i=[];for(const[p,l]of Object.entries(Lt)){const d=m(e,`constants.paper.group.${l.group}`);let u=i.find(c=>c.group===d);u||(u={group:d,items:[]},i.push(u)),u.items.push({key:p,label:m(e,l.labelKey)})}const a=!Lt[r.paperSize],s=Gn(r.paperSize);return g("form",{class:"pd-form",onSubmit:p=>p.preventDefault()},[$t(m(e,"propertyPanel.k298")),he(m(e,"propertyPanel.k299"),g("select",{class:"pd-select",style:{width:"100%"},onChange:p=>o({paperSize:p.target.value})},[...i.map(p=>g("optgroup",{label:p.group},p.items.map(l=>g("option",{value:l.key,text:l.label,selected:r.paperSize===l.key})))),g("option",{value:"CUSTOM",text:m(e,"propertyPanel.k300"),selected:a})])),s||a?he(s?m(e,"propertyPanel.k301"):m(e,"propertyPanel.k302"),g("div",{class:"custom-size-grid"},[ae({value:Number(r.customWidth??0),min:25,max:2e3,onCommit:p=>o({customWidth:p})}),...a?[g("span",{class:"custom-size-x",text:"×"}),ae({value:Number(r.customHeight??0),min:25,max:2e3,onCommit:p=>o({customHeight:p})})]:[]])):"",s?"":he(m(e,"propertyPanel.k303"),pr("ori",[{value:"portrait",label:m(e,"propertyPanel.k304")},{value:"landscape",label:m(e,"propertyPanel.k305")}],r.orientation==="landscape"?"landscape":"portrait",p=>o({orientation:p})),m(e,"propertyPanel.k306")),s?"":he(m(e,"propertyPanel.k307"),pr("rot",[{value:"0",label:"0°"},{value:"90",label:"90°"},{value:"180",label:"180°"},{value:"270",label:"270°"}],String(r.outputRotation??0),p=>n(Number(p)),!0),r.tiling?.enabled?m(e,"propertyPanel.k308"):m(e,"propertyPanel.k309")),he(m(e,"propertyPanel.k310"),g("div",{class:"page-bg-row"},[dt(r.pageBackground,p=>o({pageBackground:p}),m(e,"propertyPanel.k311"),"page-bg-picker")]),void 0,Lr({target:r,base:{pageBackground:void 0},propKey:"pageBackground",write:()=>o({pageBackground:void 0})})),MP(e),t.pages.length>1?"":CP(e),$t(m(e,"propertyPanel.k312")),g("div",{class:"margin-grid"},[Fe(e,m(e,"propertyPanel.k313"),r.margins.top,p=>o({margins:{...r.margins,top:p}}),{min:0,max:50}),Fe(e,m(e,"propertyPanel.k314"),r.margins.bottom,p=>o({margins:{...r.margins,bottom:p}}),{min:0,max:100}),Fe(e,m(e,"propertyPanel.k315"),r.margins.left,p=>o({margins:{...r.margins,left:p}}),{min:0,max:50}),Fe(e,m(e,"propertyPanel.k316"),r.margins.right,p=>o({margins:{...r.margins,right:p}}),{min:0,max:50})]),$t(m(e,"propertyPanel.k317")),Fe(e,m(e,"propertyPanel.k318"),r.header.height??10,p=>o({header:{...r.header,height:p}}),{min:0,max:100,step:.1}),Fe(e,m(e,"propertyPanel.k319"),r.footer.height??10,p=>o({footer:{...r.footer,height:p}}),{min:0,max:100,step:.1}),JP(e)].filter(Boolean))}function o3(e,t,r){const o=(e.state.propSearch??"").trim(),n=!o||lc(o,[...r.searchKeywords,r.label]),i=document.createElement("div");if(i.className="property-content",n)try{xm(`property:${t.id}`,r.ui.renderProperty({element:t,data:e.host.designData?.length?e.host.designData:[vt],fields:e.host.fields??[],update:a=>e.store.updateElement(t.id,a),repaint:()=>e.repaint(),t:e.t??oe}),i)}catch{}return g("div",{class:"pd-tab-pane",role:"tabpanel",dataset:{pane:"prop:custom"},style:e.state.propTab==="custom"?"":{display:"none"}},[i])}function n3(e){const t=e.store,r=e.state,o=t.selectedElement,n=o?_l(o):void 0;if(r.propCollapsed)return g("div",{class:"property-panel collapsed"},[g("div",{class:"prop-collapsed"},[g("button",{type:"button",class:"pc-btn",title:m(e,"propertyPanel.k320"),text:"«",onClick:()=>{r.propCollapsed=!1,e.repaint()}}),...n?[g("button",{type:"button",class:`pc-btn${r.propTab==="custom"?" on":""}`,title:n.label,html:je(n.icon,14)||je("Shapes",14),onClick:()=>{r.propTab="custom",r.propCollapsed=!1,e.repaint()}})]:[],...[["element",m(e,"propertyPanel.k321"),"▦"],["page",m(e,"propertyPanel.k322"),"▤"]].map(([a,s,p])=>g("button",{type:"button",class:`pc-btn${r.propTab===a?" on":""}`,title:s,text:p,onClick:()=>{r.propTab=a,r.propCollapsed=!1,e.repaint()}}))])]);const i=o?r.propTab==="custom"&&!n?"element":r.propTab:"page";return g("div",{class:"property-panel"},[g("div",{class:"prop-head"},[g("span",{class:"prop-title",text:m(e,"propertyPanel.k323")}),g("button",{type:"button",class:"collapse-btn",title:m(e,"propertyPanel.k324"),text:"»",onClick:()=>{r.propCollapsed=!0,e.repaint()}})]),g("div",{class:"pd-tabs prop-tabs"},[g("div",{class:"pd-tab-bar",role:"tablist"},[...n?[g("button",{type:"button",class:`pd-tab${i==="custom"?" active":""}`,text:n.label,onClick:()=>{r.propTab="custom",e.repaint()}})]:[],g("button",{type:"button",class:`pd-tab${i==="element"?" active":""}`,text:m(e,"propertyPanel.k325"),onClick:()=>{r.propTab="element",e.repaint()}}),g("button",{type:"button",class:`pd-tab${i==="page"?" active":""}`,text:m(e,"propertyPanel.k326"),onClick:()=>{r.propTab="page",e.repaint()}})]),n&&o?o3(e,o,n):"",g("div",{class:"pd-tab-pane",role:"tabpanel",dataset:{pane:"prop:element"},style:i==="element"?"":{display:"none"}},o?[IP(e),t3(e,o)]:[g("p",{class:"pd-empty",text:m(e,"propertyPanel.k327")})]),g("div",{class:"pd-tab-pane",role:"tabpanel",dataset:{pane:"prop:page"},style:i==="page"?"":{display:"none"}},[r3(e)])].filter(Boolean))])}var W=lr,i3={Check:'<path d="M20 6 9 17l-5-5" />',Copy:'<rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />'};function a3(e,t=16){return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${t}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${i3[e]??""}</svg>`}function ka(e){const t=typeof e=="string"?e.trim().toLowerCase():"";return t==="label"||t==="key"||t==="both"?t:"both"}function sp(){return[{key:"field",text:W("expression.tabField")},{key:"variable",text:W("expression.tabVariable")},{key:"function",text:W("expression.tabFunction")}]}function og(){return{field:W("expression.placeholderField"),variable:W("expression.placeholderVariable"),function:W("expression.placeholderFunction")}}function s3(){return[{name:"SUM",label:W("expression.fnSum"),template:"SUM()"},{name:"AVG",label:W("expression.fnAvg"),template:"AVG()"},{name:"COUNT",label:W("expression.fnCount"),template:"COUNT()"},{name:"MIN",label:W("expression.fnMin"),template:"MIN()"},{name:"MAX",label:W("expression.fnMax"),template:"MAX()"}]}function l3(){return[{name:"ADD",label:W("expression.fnAdd"),template:"ADD()"},{name:"SUB",label:W("expression.fnSub"),template:"SUB()"},{name:"MUL",label:W("expression.fnMul"),template:"MUL()"},{name:"DIV",label:W("expression.fnDiv"),template:"DIV()"},{name:"ROUND",label:W("expression.fnRound"),template:"ROUND()"},{name:"ROUNDUP",label:W("expression.fnRoundUp"),template:"ROUNDUP()"},{name:"ROUNDDOWN",label:W("expression.fnRoundDown"),template:"ROUNDDOWN()"},{name:"ROUNDBANK",label:W("expression.fnRoundBank"),template:"ROUNDBANK()"}]}function p3(){return[{name:"MONEY",label:W("expression.fnMoney"),template:"MONEY()"},{name:"DATE",label:W("expression.fnDate"),template:"DATE()"},{name:"UPPER",label:W("expression.fnUpper"),template:"UPPER()"},{name:"IF",label:W("expression.fnIf"),template:"IF()"}]}function d3(){return[{name:"pageIndex",label:W("expression.varPageIndex"),template:"{pageIndex}"},{name:"totalPages",label:W("expression.varTotalPages"),template:"{totalPages}"},{name:"printDate",label:W("expression.varPrintDate"),template:"{printDate}"},{name:"printTime",label:W("expression.varPrintTime"),template:"{printTime}"}]}function c3(){return[{title:W("expression.groupAggregate"),items:s3()},{title:W("expression.groupMath"),items:l3()},{title:W("expression.groupFormat"),items:p3()}]}var u3="expression.previewEmpty",f3="expression.previewNoValue",lp="expression.previewError";function ng(e,t){if(!e.trim())return W(u3);try{const r={...vt,...t??{},...Qn()},o=to(e,r);return o==null?W(f3):String(o)}catch{return W(lp)}}function ig(e,t){const r=t.trim().toLowerCase();return r?e.filter(o=>o.label.toLowerCase().includes(r)||o.name.toLowerCase().includes(r)):e}function h3(e,t){const r=e.substring(0,t),o=r.lastIndexOf("{"),n=o!==-1&&!r.slice(o+1).includes("}"),i=r.lastIndexOf("("),a=i!==-1&&!r.slice(i+1).includes(")");return{insideBlock:n,insideParens:a}}var m3=e=>/[\u4e00-\u9fff]/.test(e),g3=e=>`字段「${e}」含中文,请用 {${e}} 引用(函数参数内写 ${e});中文可直接在 {} 中使用,无需 data['...'] 方括号`;function b3(e,t){const r=/^\{\s*([^{}]+?)\s*\}$/.exec(e.trim());if(!r)return null;const o=r[1]??"";return t.find(n=>n.fieldKey===o)??null}function pp(e,t,r="both"){return r==="label"?g("div",{class:"ee-field-info"},[g("span",{class:"ee-item-label",text:e})]):r==="key"?g("div",{class:"ee-field-info"},[g("span",{class:"ee-item-key is-primary",text:t})]):g("div",{class:"ee-field-info"},[g("span",{class:"ee-item-label",text:e}),g("span",{class:"ee-item-key",text:t})])}function Ht(e){return e.currentTarget.getRootNode()}function ya(e,t,r){const o=[];return r.forEach((n,i)=>{o.push(n),i<r.length-1&&o.push(g("br"))}),g("div",{class:`ee-help-card ${e}`},[g("div",{class:"ee-help-card-title",text:t}),g("div",{class:"ee-help-card-content"},o)])}function k3(){return g("div",{class:"ee-help-section"},[g("div",{class:"ee-help-title",text:W("expression.k1")}),g("div",{class:"ee-help-grid"},[ya("ee-help-field",W("expression.k2"),[W("expression.k3"),W("expression.k4"),W("expression.k5"),W("expression.k6"),W("expression.k7"),W("expression.k8"),W("expression.k9")]),ya("ee-help-function",W("expression.k10"),[W("expression.k11"),W("expression.k12"),W("expression.k13"),W("expression.k14"),W("expression.k15"),W("expression.k16")]),ya("ee-help-variable",W("expression.k17"),[W("expression.k18"),W("expression.k19"),W("expression.k20")]),ya("ee-help-conditional",W("expression.k21"),[W("expression.k22"),W("expression.k23"),W("expression.k24"),W("expression.k25"),W("expression.k26")])])])}function y3(e,t){W=e.t??lr;const r=ka(e.fieldDisplay),o={activeTab:"field",searchText:"",expression:t.value||"",binding:t.binding,copiedFieldKey:"",keyHint:""},n=(v,w)=>v.querySelector(w),i=v=>{const w=n(v,".ee-preview");if(!w)return;const P=ng(o.expression,e.demoData);w.textContent=P,w.classList.toggle("ee-preview-error",P===W(lp))},a=v=>{const w=n(v,".ee-key-hint");w&&(w.textContent=o.keyHint,w.style.display=o.keyHint?"":"none")},s=()=>{if(o.activeTab==="variable")return ig(d3(),o.searchText).map(P=>g("div",{class:"ee-list-item",onDblclick:E=>{const{insideParens:D}=d(E);u(Ht(E),D?P.template.replace(/^\{|\}$/g,""):P.template,void 0,"")}},[pp(P.label,P.template)]));if(o.activeTab==="function")return c3().map(P=>g("div",{class:"ee-func-group"},[g("div",{class:"ee-func-group-title",text:P.title}),...ig(P.items,o.searchText).map(E=>g("div",{class:"ee-list-item",onDblclick:D=>{const{insideBlock:O}=d(D),A=O?E.template:`{${E.template}}`;u(Ht(D),A,A.indexOf("(")+1,"")}},[pp(E.label,`${E.name}()`)]))]));const v=Ty(Su(e.fields??[]),o.searchText);if(!v.length)return[g("p",{class:"pd-empty",text:W("expression.k27")})];const w=[];for(const P of v){P.key&&w.push(g("div",{class:`ee-field-group${P.isList?" is-list":""}`},[g("span",{class:"ee-field-group-icon",text:P.isList?"📋":"📁"}),g("span",{text:P.label})]));for(const E of P.fields)w.push(g("div",{class:"ee-list-item ee-field-item",style:{paddingLeft:P.key?"22px":"10px"},onDblclick:D=>{const{insideParens:O}=d(D),A=D;if(A.ctrlKey||A.metaKey){const R=E.fieldLabel||E.fieldKey;u(Ht(D),O?`"${R}"`:R,void 0,"");return}u(Ht(D),O?E.fieldKey:`{${E.fieldKey}}`,void 0,m3(E.fieldKey)?g3(E.fieldKey):"")}},[pp(E.fieldLabel||E.fieldKey,E.fieldKey,r),g("button",{type:"button",class:`ee-copy-btn${o.copiedFieldKey===E.fieldKey?" is-copied":""}`,"data-tip":o.copiedFieldKey===E.fieldKey?W("expression.k28"):`复制字段名「${E.fieldLabel}」`,"aria-label":`复制字段名 ${E.fieldLabel}`,html:a3(o.copiedFieldKey===E.fieldKey?"Check":"Copy",13),onClick:D=>{D.stopPropagation(),l(D,E)},onDblclick:D=>D.stopPropagation()})]))}return w},p=v=>{Array.from(v.querySelectorAll(".ee-nav-tab")).forEach((O,A)=>O.classList.toggle("active",sp()[A]?.key===o.activeTab));const P=n(v,".ee-content-search .pd-input");if(P){const O=og()[o.activeTab];P.placeholder!==O&&(P.placeholder=O),P.value!==o.searchText&&(P.value=o.searchText)}const E=n(v,".ee-textarea");E&&E.value!==o.expression&&(E.value=o.expression);const D=n(v,".ee-content-list");if(D){Oh(D);for(const O of s())rt(O,D)}i(v),a(v)};function l(v,w){const P=Ht(v);Tu(w.fieldLabel||w.fieldKey).then(E=>{E&&(o.copiedFieldKey=w.fieldKey,p(P),setTimeout(()=>{o.copiedFieldKey===w.fieldKey&&(o.copiedFieldKey="",p(P))},1200))})}const d=v=>{const P=n(Ht(v),".ee-textarea")?.selectionStart??o.expression.length;return h3(o.expression,P)},u=(v,w,P=w.length,E)=>{E!==void 0&&(o.keyHint=E);const D=n(v,".ee-textarea");if(!D){o.expression+=w,i(v),a(v);return}const O=D.selectionStart??o.expression.length,A=D.selectionEnd??O;o.expression=o.expression.substring(0,O)+w+o.expression.substring(A);const R=O+P;D.value=o.expression,D.focus(),D.selectionStart=D.selectionEnd=R,i(v),a(v)},c=()=>{const v=o.expression;if(o.binding===void 0){e.onApply({formatter:v}),e.onClose();return}const w=b3(v,e.fields??[]);e.onApply(w?{formatter:v,binding:w.fieldKey,title:w.fieldLabel}:{formatter:v}),e.onClose()},f=g("div",{class:"ee-nav"},[g("div",{class:"ee-nav-title",text:W("expression.k29")}),g("div",{class:"ee-nav-tabs"},sp().map((v,w)=>g("div",{class:`ee-nav-tab${o.activeTab===v.key?" active":""}`,text:v.text,onClick:P=>{o.activeTab=sp()[w].key,p(Ht(P))}})))]),h=g("div",{class:"ee-content"},[g("div",{class:"ee-content-search"},[g("input",{class:"pd-input",placeholder:og()[o.activeTab],onInput:v=>{o.searchText=v.target.value,p(Ht(v))}})]),g("div",{class:"ee-content-list"},s())]),b=ng(o.expression,e.demoData),k=g("div",{class:"ee-editor"},[g("div",{class:"ee-editor-section"},[g("div",{class:"ee-editor-title",text:W("expression.k30")}),g("textarea",{class:"ee-textarea",rows:6,placeholder:W("expression.k31"),text:o.expression,onInput:v=>{o.expression=v.target.value,o.keyHint="",i(Ht(v)),a(Ht(v))}}),g("div",{class:"pd-hint ee-key-hint",style:{display:"none",color:"var(--pd-accent, #165DFF)"},text:""})]),g("div",{class:"ee-editor-section"},[g("div",{class:"ee-editor-title",text:W("expression.k32")}),g("div",{class:`ee-preview${b===W(lp)?" ee-preview-error":""}`,text:b})]),k3()]);return g("div",{class:"pd-dialog-overlay",onKeydown:v=>{v.key==="Escape"&&e.onClose()}},[g("section",{class:"pd-dialog pd-dialog-large",role:"dialog","aria-modal":"true","aria-labelledby":"expression-editor-title"},[g("header",{class:"pd-dialog-header"},[g("strong",{id:"expression-editor-title",text:W("expression.k33")}),g("button",{type:"button",class:"pd-close","aria-label":W("expression.k34"),text:"×",onClick:()=>e.onClose()})]),g("div",{class:"expression-editor"},[f,h,k]),g("footer",{class:"pd-dialog-footer"},[g("button",{type:"button",class:"pd-button",text:W("expression.k35"),onClick:()=>e.onClose()}),g("button",{type:"button",class:"pd-button primary",text:W("expression.k36"),onClick:()=>c()})])])])}const v3={id:"getting-started",title:"快速入门",content:`
297
297
  <h2>界面布局</h2>
298
298
  <p>打印模板设计器采用三栏布局:</p>
299
299
  <ul>
@@ -757,6 +757,20 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
757
757
  <p><strong>提示</strong>:水印配置保存在模板 JSON 的 <code>watermark</code> 字段中,仅对当前模板生效。</p>
758
758
  </blockquote>
759
759
  `},S3={id:"changelog",title:"更新记录",content:`
760
+ <h2>V1.6.3<small>(2026-11-24)</small></h2>
761
+
762
+ <h3>修复</h3>
763
+ <ul>
764
+ <li><strong>数据绑定串用</strong>:表格 demo 数据源缺失时不再回退到第一个数组;图表显式绑定数据源缺失时保持占位,字段下拉不再混入示例字段,避免条码与图表显示未绑定数据。</li>
765
+ </ul>
766
+
767
+ <h2>V1.6.2<small>(2026-11-23)</small></h2>
768
+
769
+ <h3>修复</h3>
770
+ <ul>
771
+ <li><strong>图表插件安装</strong>:修复插件市场命令行经 npx 调用静默空转、Git 源安装图表插件因缺语言资源失败的问题;经市场安装百度图表插件恢复可用。</li>
772
+ </ul>
773
+
760
774
  <h2>V1.6.1<small>(2026-11-22)</small></h2>
761
775
 
762
776
  <h3>新增</h3>
@@ -1545,6 +1559,20 @@ to keep a number of decimals use <code>ROUND</code> (half up), <code>ROUNDUP</co
1545
1559
  <h2>Can I use charts and other custom elements?</h2>
1546
1560
  <p>Yes. Optional plugins such as the ECharts chart pack register extra element types. Once installed, they appear in the asset panel and provide a "Custom Properties" tab when selected.</p>
1547
1561
  `},A3={id:"changelog",title:"Release Notes",content:`
1562
+ <h2>V1.6.3<small>(2026-11-24)</small></h2>
1563
+
1564
+ <h3>Fixed</h3>
1565
+ <ul>
1566
+ <li><strong>Data-binding fallbacks</strong>: table demo data sources no longer fall back to the first array when missing; charts keep the placeholder when an explicitly bound data source is absent, and field pickers no longer mix in sample-data fields.</li>
1567
+ </ul>
1568
+
1569
+ <h2>V1.6.2<small>(2026-11-23)</small></h2>
1570
+
1571
+ <h3>Fixed</h3>
1572
+ <ul>
1573
+ <li><strong>Chart plugin installation</strong>: fixed the marketplace CLI silently doing nothing when invoked via npx, and chart plugin installs from Git sources failing due to missing language resources; installing the Baidu chart plugin via the marketplace works again.</li>
1574
+ </ul>
1575
+
1548
1576
  <h2>V1.6.1<small>(2026-11-22)</small></h2>
1549
1577
 
1550
1578
  <h3>Added</h3>
@@ -2021,7 +2049,7 @@ to keep a number of decimals use <code>ROUND</code> (half up), <code>ROUNDUP</co
2021
2049
  <li>ค้าง <code>Ctrl</code> (<code>⌘</code> บน Mac) ขณะดับเบิลคลิกเพื่อแทรกชื่อฟิลด์แทน</li>
2022
2050
  <li>ใช้วงเล็บปีกกา <code>{}</code> สำหรับนิพจน์ฟิลด์ ข้อความคงที่พิมพ์ได้โดยตรง</li>
2023
2051
  </ul>
2024
- `},N3={id:"faq",title:"คำถามที่พบบ่อย",content:`
2052
+ `},B3={id:"faq",title:"คำถามที่พบบ่อย",content:`
2025
2053
  <h2>ฉันจะปรับขนาดกระดาษอย่างไร?</h2>
2026
2054
  <ol>
2027
2055
  <li>เลือก "การตั้งค่าหน้ากระดาษ" ในแผงด้านขวา</li>
@@ -2049,7 +2077,21 @@ to keep a number of decimals use <code>ROUND</code> (half up), <code>ROUNDUP</co
2049
2077
 
2050
2078
  <h2>ฉันสามารถใช้แผนภูมิและองค์ประกอบกำหนดเองอื่นได้หรือไม่?</h2>
2051
2079
  <p>ได้ ปลั๊กอินเสริมเช่นชุดแผนภูมิ ECharts จะลงทะเบียนประเภทองค์ประกอบเพิ่มเติม เมื่อติดตั้งแล้วจะปรากฏในแผงทรัพยากรและมีแท็บ "คุณสมบัติที่กำหนดเอง" เมื่อเลือก</p>
2052
- `},B3={id:"changelog",title:"บันทึกการเปิดตัว",content:`
2080
+ `},N3={id:"changelog",title:"บันทึกการเปิดตัว",content:`
2081
+ <h2>V1.6.3<small>(2026-11-24)</small></h2>
2082
+
2083
+ <h3>แก้ไข</h3>
2084
+ <ul>
2085
+ <li><strong>การผูกข้อมูล</strong>: ตารางเดโมไม่กลับไปใช้อาร์เรย์ตัวแรกเมื่อไม่พบแหล่งข้อมูลที่ระบุ แผนภูมิคงตัวยึดตำแหน่งเมื่อแหล่งข้อมูลที่ผูกไว้ขาดหาย และรายการฟิลด์ไม่ผสมฟิลด์จากข้อมูลตัวอย่างอีกต่อไป</li>
2086
+ </ul>
2087
+
2088
+ <h2>V1.6.2<small>(2026-11-23)</small></h2>
2089
+
2090
+ <h3>แก้ไข</h3>
2091
+ <ul>
2092
+ <li><strong>การติดตั้งปลั๊กอินแผนภูมิ</strong>: แก้ไขปัญหาเครื่องมือ CLI ของตลาดปลั๊กอินไม่ทำงานเมื่อเรียกผ่าน npx และปัญหาการติดตั้งปลั๊กอินแผนภูมิจากแหล่ง Git ล้มเหลวเนื่องจากขาดทรัพยากรภาษา ตอนนี้การติดตั้งปลั๊กอินแผนภูมิ Baidu ผ่านตลาดปลั๊กอินกลับมาใช้งานได้แล้ว</li>
2093
+ </ul>
2094
+
2053
2095
  <h2>V1.6.1<small>(2026-11-22)</small></h2>
2054
2096
 
2055
2097
  <h3>เพิ่ม</h3>
@@ -2251,5 +2293,5 @@ to keep a number of decimals use <code>ROUND</code> (half up), <code>ROUNDUP</co
2251
2293
  <ul>
2252
2294
  <li>เปิดตัวครั้งแรกของตัวออกแบบเทมเพลตการพิมพ์</li>
2253
2295
  </ul>
2254
- `},F3=[v3,w3,x3,P3,E3,S3],$3=[T3,M3,C3,_3,D3,A3],z3=[O3,R3,I3,L3,N3,B3];function H3(e){return e&&/^th([-_]|$)/i.test(e)?z3:e&&/^en([-_]|$)/i.test(e)?$3:F3}const ag="worm-print-help-tab",U3="getting-started";function sg(e,t){return e.some(r=>r.id===t)?String(t):""}function q3(e,t){let r=null;try{r=window.localStorage.getItem(ag)}catch{r=null}return sg(e,t)||sg(e,r)||U3}function j3(e){const t=H3(e.locale),r=e.t??ta(e.locale??"zh-CN"),o=q3(t,e.initialTab),n=(i,a)=>{const s=i.currentTarget,p=s.closest(".help-modal");if(!p)return;for(const d of Array.from(p.querySelectorAll(".help-tab")))d.classList.toggle("active",d===s);const l=p.querySelector(".help-content");l&&(l.innerHTML=t.find(d=>d.id===a)?.content??"");try{window.localStorage.setItem(ag,a)}catch{}};return g("div",{class:"help-modal-overlay",tabindex:"-1",onClick:i=>{i.target===i.currentTarget&&e.onClose()},onKeydown:i=>{i.key==="Escape"&&e.onClose()}},[g("div",{class:"help-modal"},[g("div",{class:"help-modal-header"},[g("div",{class:"help-modal-title-wrap"},[g("h2",{class:"help-modal-title",text:r("helpModal.k101")}),g("span",{class:"help-modal-project",text:"worm-print-platform"})]),g("button",{type:"button",class:"help-modal-close",title:r("helpModal.k102"),text:"×",onClick:()=>e.onClose()})]),g("div",{class:"help-modal-body"},[g("div",{class:"help-modal-sidebar"},t.map(i=>g("button",{type:"button",class:`help-tab${i.id===o?" active":""}`,text:i.title,onClick:a=>n(a,i.id)}))),g("div",{class:"help-modal-content"},[g("div",{class:"help-content",html:t.find(i=>i.id===o)?.content??""})])])])])}function W3(e,t){const r=rt(j3(t),e),o=n=>{n.key==="Escape"&&t.onClose()};return document.addEventListener("keydown",o),r.focus?.(),()=>{document.removeEventListener("keydown",o),r.remove()}}const V3=2,G3=74,dp=[{id:"clipboard",order:1,labelKey:"toolbarOverflow.k478"},{id:"painter",order:2,labelKey:"toolbarOverflow.k479"},{id:"zoom",order:3,labelKey:"toolbarOverflow.k480"},{id:"arrange-view",order:4,labelKey:"toolbarOverflow.k481"},{id:"border",order:5,labelKey:"toolbarOverflow.k482"},{id:"color",order:6,labelKey:"toolbarOverflow.k483"},{id:"align",order:7,labelKey:"toolbarOverflow.k484"},{id:"style",order:8,labelKey:"toolbarOverflow.k485"},{id:"font",order:9,labelKey:"toolbarOverflow.k486"}];function K3(e){const t=!!e.state.openMore,r=dp.slice().sort((o,n)=>o.order-n.order).map(o=>g("div",{class:"tb-more-item",dataset:{unit:o.id},style:{display:"none"}},[g("div",{class:"tb-menu-label",text:m(e,o.labelKey)}),g("div",{class:"tb-more-slot",id:`tb-more-slot-${o.id}`,dataset:{unit:o.id}})]));return g("div",{class:"tb-group tb-more-group",style:{display:"none"}},[g("div",{class:"tb-dd"},[g("button",{type:"button",class:`tb-dd-trigger${t?" on":""}`,dataset:{test:"more-dd",tip:m(e,"toolbarOverflow.k487")},onClick:()=>{e.state.openMore=!t,e.repaint()},html:m(e,"toolbarOverflow.k488",{v0:je("Ellipsis",15),v1:je("ChevronDown",12,"tb-dd-arrow")})}),g("div",{class:`tb-dd-panel tb-more-panel${t?"":" is-hidden"}`},[g("div",{class:"tb-menu tb-more-menu"},r)])])])}const lg=new WeakMap;function pg(e){const t=e.querySelector(".designer-toolbar");if(!t)return{movedIds:[],overflowRemains:!1};const r=getComputedStyle(t),o=Number.parseFloat(r.gap)||V3,n=Number.parseFloat(r.paddingLeft)||0,i=Number.parseFloat(r.paddingRight)||0,a=new Map;for(const b of Array.from(t.querySelectorAll(".tb-ou[data-unit]"))){const k=b.parentElement;k&&!k.classList.contains("tb-more-slot")&&lg.set(b,{parent:k,next:b.nextSibling}),a.set(b.dataset.unit,b)}for(const b of a.values()){const k=lg.get(b);!k||b.parentElement===k.parent||(k.next?.parentElement===k.parent?k.parent.insertBefore(b,k.next):k.parent.appendChild(b))}let s=0;for(const b of Array.from(t.children)){if(b.classList.contains("tb-spacer")||b.classList.contains("tb-more-group"))continue;const k=Math.max(b.offsetWidth,b.scrollWidth);k<=0||(s+=k+o)}const p=new Map;for(const[b,k]of a){const v=k.offsetWidth;v>0&&p.set(b,v)}const l=dp.map(b=>({id:b.id,order:b.order,width:p.get(b.id)??0})),d=l.reduce((b,k)=>b-k.width-o,s),u=t.clientWidth-n-i,{movedIds:c,overflowRemains:f}=Gd({available:u,pinned:d,moreTriggerWidth:G3,gap:o,units:l});for(const b of dp){const k=t.querySelector(`.tb-more-item[data-unit="${b.id}"]`),v=t.querySelector(`#tb-more-slot-${b.id}`),w=a.get(b.id);if(!k||!v||!w)continue;const P=c.includes(b.id);P&&w.parentElement!==v&&v.appendChild(w),k.style.display=P?"":"none"}const h=t.querySelector(".tb-more-group");return h&&(h.style.display=c.length>0?"":"none"),t.classList.toggle("is-tight",f),{movedIds:c,overflowRemains:f}}function Y3(e,t){const r=e.store,o=r.selectedIds.size>0,n=r.selectedIds.size>1,i=r.selectedElement,a=!o,s=e.isEdit?m(e,"toolbar.k489"):m(e,"toolbar.k490"),p=[g("div",{class:"tb-menu",dataset:{test:"arrange-panel"}},[g("div",{class:"tb-menu-label",text:m(e,"toolbar.k491")}),g("div",{class:"tb-menu-grid"},[Re(e,"AlignStartVertical","align",{arg:"left",tip:m(e,"toolbar.k492"),disabled:!n}),Re(e,"AlignEndVertical","align",{arg:"right",tip:m(e,"toolbar.k493"),disabled:!n}),Re(e,"AlignStartHorizontal","align",{arg:"top",tip:m(e,"toolbar.k494"),disabled:!n}),Re(e,"AlignEndHorizontal","align",{arg:"bottom",tip:m(e,"toolbar.k495"),disabled:!n}),Re(e,"AlignCenterVertical","align",{arg:"vertical",tip:m(e,"toolbar.k496"),disabled:!n}),Re(e,"AlignCenterHorizontal","align",{arg:"horizontal",tip:m(e,"toolbar.k497"),disabled:!n}),Re(e,"AlignHorizontalSpaceBetween","align",{arg:"distributeHor",tip:m(e,"toolbar.k498"),disabled:!n}),Re(e,"AlignVerticalSpaceBetween","align",{arg:"distributeVer",tip:m(e,"toolbar.k499"),disabled:!n})]),g("div",{class:"tb-menu-label",text:m(e,"toolbar.k500")}),g("div",{class:"tb-menu-grid"},[Re(e,"ArrowUpToLine","move-layer",{arg:"top",tip:m(e,"toolbar.k501"),disabled:!o}),Re(e,"ArrowUp","move-layer",{arg:"up",tip:m(e,"toolbar.k502"),disabled:!o}),Re(e,"ArrowDown","move-layer",{arg:"down",tip:m(e,"toolbar.k503"),disabled:!o}),Re(e,"ArrowDownToLine","move-layer",{arg:"bottom",tip:m(e,"toolbar.k504"),disabled:!o})]),g("div",{class:"tb-menu-label",text:m(e,"toolbar.k505")}),g("div",{class:"tb-menu-grid"},[Re(e,"Group","group",{tip:m(e,"toolbar.k506"),disabled:!n}),Re(e,"Ungroup","ungroup",{tip:m(e,"toolbar.k507"),disabled:!i?.options?.groupId})])])],l=[g("div",{class:"tb-menu tb-menu-rows",dataset:{test:"view-panel"}},[d(m(e,"toolbar.k508"),r.showRuler,"toggle-ruler",m(e,"toolbar.k509")),d(m(e,"toolbar.k510"),r.showGrid,"toggle-grid",m(e,"toolbar.k511")),d(m(e,"toolbar.k512"),r.showTableGhostBorder,"toggle-table-ghost-border",m(e,"toolbar.k513")),d(m(e,"toolbar.k514"),r.snapToGrid,"toggle-snap",m(e,"toolbar.k515"))])];function d(u,c,f,h){return g("button",{type:"button",class:`tb-btn tb-menu-row${c?" on":""}`,dataset:{tip:h},onClick:()=>e.fire(f)},[g("span",{class:"dot"}),u])}return g("div",{class:"designer-toolbar"},[g("div",{class:"tb-group tb-brand"},[g("span",{class:"tb-mark","aria-hidden":"true",html:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="3" width="14" height="18" rx="2.5" /><line x1="8.5" y1="8.5" x2="15.5" y2="8.5" /><line x1="8.5" y1="12.5" x2="15.5" y2="12.5" /><line x1="8.5" y1="16.5" x2="12.5" y2="16.5" /></svg>'}),g("div",{class:"tb-title"},[g("span",{class:"tb-title-name",text:s}),g("span",{class:"tb-title-sub",text:m(e,"toolbar.k516")})])]),g("div",{class:"tb-group"},[Re(e,"Undo2","undo",{tip:m(e,"toolbar.k517"),disabled:!r.canUndo}),Re(e,"Redo2","redo",{tip:m(e,"toolbar.k518"),disabled:!r.canRedo})]),t,g("div",{class:"tb-ou tb-group",dataset:{unit:"arrange-view"}},[na(e,"arrange",{icon:"Layers",text:m(e,"toolbar.k519"),tip:m(e,"toolbar.k520"),testId:"arrange-dd"},p),na(e,"view",{icon:"Eye",text:m(e,"toolbar.k521"),tip:m(e,"toolbar.k522"),testId:"view-dd"},l)]),g("div",{class:"tb-ou tb-group",dataset:{unit:"zoom"}},[Re(e,"Maximize","fit-window",{tip:m(e,"toolbar.k523")}),Re(e,"ZoomOut","zoom",{arg:-10,tip:m(e,"toolbar.k524")}),g("span",{class:"tb-zoom",text:`${r.scale}%`}),Re(e,"ZoomIn","zoom",{arg:10,tip:m(e,"toolbar.k525")})]),g("div",{class:"tb-ou tb-group",dataset:{unit:"clipboard"}},[Re(e,"Copy","copy",{tip:a?m(e,"toolbar.k526"):m(e,"toolbar.k527"),disabled:a,test:"copy"}),Re(e,"ClipboardPaste","paste",{tip:a?m(e,"toolbar.k528"):r.hasClipboard?m(e,"toolbar.k530"):m(e,"toolbar.k529"),disabled:a||!r.hasClipboard,test:"paste"}),Re(e,"Trash2","delete",{tip:a?m(e,"toolbar.k531"):m(e,"toolbar.k532"),disabled:a,danger:!0,test:"delete"})]),K3(e),g("div",{class:"tb-spacer"}),e.showHelp?g("div",{class:"tb-group"},[g("button",{type:"button",class:"help-button",title:m(e,"toolbar.k533"),onClick:()=>e.fire("help")},[g("span",{class:"help-icon",text:"?"})])]):"",(()=>{const u=[e.showPreview!==!1?g("button",{type:"button",class:"btn-secondary",dataset:{tip:m(e,"toolbar.k534")},text:m(e,"toolbar.k535"),onClick:()=>e.fire("preview")}):"",e.showSave!==!1?g("button",{type:"button",class:"btn-primary",dataset:{tip:m(e,"toolbar.k536")},text:m(e,"toolbar.k537"),onClick:()=>e.fire("save")}):""].filter(Boolean);return u.length?g("div",{class:"tb-group"},u):""})()].filter(Boolean))}function cp(e,t,r){for(const o of t){const n=e.getPropertyValue(o).trim();if(n)return n}return r}function X3(e,t){const r=t.orientation==="horizontal",o=t.geom,n=r?o.viewW:o.viewH;e.style.width=`${r?n:ps}px`,e.style.height=`${r?ps:n}px`;const i=e.getContext("2d");if(!i)return;const a=window.devicePixelRatio||1,s=Math.max(0,Math.round(n)),p=ps;e.width=(r?s:p)*a,e.height=(r?p:s)*a,i.setTransform(a,0,0,a,0,0);const l=getComputedStyle(e),d=cp(l,["--pd-ruler-bg"],"#F8F9FC"),u=cp(l,["--pd-ruler"],"#9AA1AF"),c=cp(l,["--pd-ruler-cursor","--pd-accent"],"#165DFF");i.fillStyle=d,i.fillRect(0,0,r?s:p,r?p:s);const f=t.scale>0?t.scale:o.paperScale>0?o.paperScale:1,h=vr(1)*f;if(h<=0)return;const b={ctx:i,horizontal:r,viewportPx:n,thickness:p,originPx:r?o.originX:o.originY,pxPerMM:h,paperLengthMM:t.paperLengthMM},k=-b.originPx/h,v=(s-b.originPx)/h,w=n1(f),P=s1(k,v,w);cg(b,P,u,!0),cg(b,P,u,!1),ug(b,0,c),ug(b,t.paperLengthMM,c);const E=t.cursorPx??null;if(E!==null&&E>=0&&E<=s){if(i.strokeStyle=c,i.lineWidth=1.5,i.beginPath(),r){const D=Math.round(E)+.5;i.moveTo(D,0),i.lineTo(D,p)}else{const D=Math.round(E)+.5;i.moveTo(0,D),i.lineTo(p,D)}i.stroke()}}function dg(e,t){return Math.round(e.originPx+t*e.pxPerMM)+.5}function cg(e,t,r,o){const{ctx:n,horizontal:i,paperLengthMM:a}=e;n.strokeStyle=r,n.fillStyle=r,n.globalAlpha=o?.32:1,n.lineWidth=1,n.font="9px ui-monospace, Menlo, monospace",n.textBaseline="top";for(const s of t){if((s.mm<0||s.mm>a)!==o)continue;const l=dg(e,s.mm),d=s.major?8:4;n.beginPath(),i?(n.moveTo(l,0),n.lineTo(l,d)):(n.moveTo(0,l),n.lineTo(d,l)),n.stroke(),s.major&&s.label&&(i?n.fillText(s.label,l+2,11):(n.save(),n.translate(11,l+2),n.rotate(-Math.PI/2),n.fillText(s.label,0,0),n.restore()))}n.globalAlpha=1}function ug(e,t,r){const{ctx:o,horizontal:n,thickness:i,viewportPx:a}=e,s=dg(e,t);s<=0||s>=a||(o.strokeStyle=r,o.globalAlpha=.55,o.lineWidth=1,o.beginPath(),n?(o.moveTo(s,0),o.lineTo(s,i)):(o.moveTo(0,s),o.lineTo(i,s)),o.stroke(),o.globalAlpha=1)}const Z3=':host{display:block;width:100%;height:100%}:host{--pd-bg: #f3f5f9;--pd-surface: #ffffff;--pd-field-bg: #f4f6fa;--pd-sidebar: #ffffff;--pd-sidebar-hover: #f0f3f9;--pd-canvas-bg: #e6e9f0;--pd-paper: #FFFFFF;--pd-accent: #165DFF;--pd-accent-2: #3D7BFF;--pd-accent-soft: rgba(22, 93, 255, .09);--pd-accent-secondary: #f56c6c;--pd-danger-soft: rgba(245, 108, 108, .1);--pd-ink-green: #67c23a;--pd-text: #2a2e37;--pd-text-muted: #8b909c;--pd-text-faint: #b4b9c4;--pd-border: #d9dde6;--pd-border-soft: #e9ecf2;--pd-input-bg: #ffffff;--pd-hover-tint: #ecf5ff;--pd-danger: #e53e3e;--pd-danger-bg: #fef2f2;--pd-danger-border: #fecaca;--pd-menu-text: #333;--pd-menu-hover: #f5f7fa;--pd-menu-border: #dcdfe6;--pd-menu-divider: #ebeef5;--pd-menu-muted: #909399;--pd-menu-disabled: #c0c4cc;--pd-scrollbar: rgba(23, 32, 60, .18);--pd-scrollbar-thumb: rgba(23, 32, 60, .16);--pd-scrollbar-thumb-hover: rgba(23, 32, 60, .3);--pd-help-field-bg: #f0f9ff;--pd-help-field-line: #bae6fd;--pd-help-field-ink: #0369a1;--pd-help-function-bg: #f0fdf4;--pd-help-function-line: #bbf7d0;--pd-help-function-ink: #166534;--pd-help-variable-bg: #fefce8;--pd-help-variable-line: #fde68a;--pd-help-variable-ink: #854d0e;--pd-help-conditional-bg: #fdf2f8;--pd-help-conditional-line: #fbcfe8;--pd-help-conditional-ink: #9d174d;--pd-handle: #165DFF;--pd-ruler: #9aa1af;--pd-ruler-bg: #f8f9fc;--pd-ruler-cursor: #165DFF;--pd-radius: 6px;--pd-shadow-sm: 0 1px 2px rgba(23, 32, 60, .05);--pd-shadow-md: 0 2px 8px rgba(23, 32, 60, .06), 0 10px 28px rgba(23, 32, 60, .07);--pd-shadow-paper: 0 0 0 1px rgba(23, 32, 60, .05), 0 1px 2px rgba(23, 32, 60, .06), 0 8px 20px rgba(23, 32, 60, .08), 0 26px 60px rgba(23, 32, 60, .15);--pd-success: #16a34a;--pd-text-regular: #606266;--pd-fill-light: #f5f7fa;height:100%;display:flex;flex-direction:column;background:var(--pd-bg)}.pd-form{display:flex;flex-direction:column;gap:10px;font-size:12px;color:var(--pd-text, #303133)}.pd-field{display:flex;flex-direction:column;gap:4px}.pd-label{font-size:11px;color:var(--pd-text-muted, #909399);display:inline-flex;align-items:center;position:relative;justify-content:space-between;gap:6px}.pd-label-t{display:inline-flex;align-items:center;gap:4px;min-width:0}.pd-reset-btn{flex:none;width:15px;height:15px;padding:0;border:1px solid transparent;border-radius:4px;background:transparent;color:var(--pd-text-faint, #b4b9c4);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:color .14s ease,border-color .14s ease,background .14s ease}.pd-reset-btn.is-dirty{color:var(--pd-text, #2a2e37)}.pd-reset-btn:hover{color:var(--pd-accent, #165DFF);border-color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.pd-help{position:static;display:inline-flex;align-items:center;justify-content:center;flex:none;width:13px;height:13px;margin-left:4px;padding:0;border:1px solid var(--pd-border, #d9dde6);border-radius:50%;background:transparent;color:var(--pd-text-muted, #909399);font-size:9px;line-height:1;cursor:help}.pd-help:before{content:"?";font-weight:600}.pd-help:hover,.pd-help:focus-visible{border-color:var(--pd-accent, #165DFF);color:var(--pd-accent, #165DFF)}.pd-help:after{content:attr(data-tip);position:absolute;top:calc(100% + 6px);left:0;z-index:120;width:196px;padding:5px 7px;border-radius:4px;background:#1e2330e0;color:#fff;font-size:12px;font-weight:400;line-height:1.45;text-align:left;white-space:normal;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .15s ease}.pd-help:hover:after,.pd-help:focus:after{opacity:1;visibility:visible}.pd-hover-tip{position:fixed;z-index:9999;transform:translate(-50%);padding:4px 8px;border-radius:4px;background:#2a2e37eb;color:#fff;font-size:12px;line-height:1.4;width:max-content;max-width:calc(100vw - 16px);box-sizing:border-box;overflow-wrap:anywhere;pointer-events:none}.pd-input,.pd-select,textarea.pd-input{width:100%;height:26px;min-height:26px;padding:3px 6px;border:1px solid var(--pd-border, #d9dde6);border-radius:6px;background:var(--pd-input-bg, #fff);color:inherit;font:inherit;box-sizing:border-box;transition:border-color .14s ease,box-shadow .14s ease}.pd-input:hover,.pd-select:hover{border-color:var(--pd-text-faint, #b4b9c4)}textarea.pd-input{height:auto;min-height:48px;resize:vertical}.pd-input:focus,.pd-select:focus{outline:none;border-color:var(--pd-accent, #165DFF);box-shadow:0 0 0 2px #165dff1f}.pd-select{appearance:auto}.pd-switch{appearance:none;width:32px;height:18px;margin:0;border:1px solid var(--pd-border, #dcdfe6);border-radius:999px;background:#dcdfe6;position:relative;cursor:pointer;transition:background .2s,border-color .2s}.pd-switch:checked{background:var(--pd-accent, #165DFF);border-color:var(--pd-accent, #165DFF)}.pd-switch:after{content:"";position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:#fff;transition:transform .2s}.pd-switch:checked:after{transform:translate(14px)}.pd-range{width:100%;accent-color:var(--pd-accent, #165DFF)}.pd-radio-group,.pd-checkbox-group{display:flex;flex-wrap:wrap;gap:6px}.pd-radio-group--2col{display:grid;grid-template-columns:1fr 1fr}.pd-radio-group--2col>.pd-radio{width:60%;justify-content:flex-start}.pd-radio,.pd-checkbox{display:inline-flex;align-items:center;gap:4px;min-height:24px;padding:0 7px;border:1px solid var(--pd-border, #d9dde6);border-radius:6px;background:var(--pd-input-bg, #fff);cursor:pointer;transition:border-color .14s ease,background .14s ease,color .14s ease}.pd-radio:has(input:checked),.pd-checkbox:has(input:checked){color:var(--pd-accent, #165DFF);border-color:var(--pd-accent, #165DFF);background:#165dff0f}.pd-button-group{display:inline-flex;gap:4px}.pd-button,.pd-tab{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:26px;padding:3px 8px;border:1px solid var(--pd-border, #d9dde6);border-radius:6px;background:var(--pd-bg, #f4f6fa);color:var(--pd-text, #2a2e37);font:inherit;cursor:pointer;transition:background .14s ease,border-color .14s ease,color .14s ease}.pd-button:hover{background:var(--pd-sidebar-hover, #f0f3f9);border-color:var(--pd-text-faint, #b4b9c4)}.pd-button.primary{background:var(--pd-accent, #165DFF);border-color:var(--pd-accent, #165DFF);color:#fff}.pd-button.danger{background:#f56c6c;border-color:#f56c6c;color:#fff}.pd-button.small{min-height:22px;padding:1px 6px;font-size:11px}.pd-button:disabled{opacity:.55;cursor:not-allowed}.pd-tabs{display:flex;flex-direction:column;min-height:0}.pd-tab-bar{display:flex;gap:4px;padding:8px 12px 0;border-bottom:1px solid var(--pd-border-soft, #ebeef5)}.pd-tab{border:0;border-bottom:2px solid transparent;border-radius:5px 5px 0 0;background:transparent;transition:color .14s ease,background .14s ease}.pd-tab-bar .pd-tab:hover{color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.pd-tab.active{color:var(--pd-accent, #165DFF);border-bottom-color:var(--pd-accent, #165DFF);background:transparent;font-weight:600}.pd-tab-pane{min-height:0;overflow:auto}.pd-divider{margin:6px 0;font-size:11px;color:var(--pd-text-muted, #909399)}.pd-empty{margin:16px 0;color:var(--pd-text-muted, #909399);text-align:center}.pd-dialog-overlay{position:fixed;inset:0;z-index:2000;display:grid;place-items:center;padding:16px;background:#00000073}.pd-dialog{display:flex;flex-direction:column;width:min(950px,90vw);max-height:90vh;overflow:hidden;background:var(--pd-surface, #fff);border-radius:12px;box-shadow:var(--pd-shadow-md, 0 12px 40px rgba(23, 32, 60, .18))}.pd-dialog-large{width:min(950px,90vw)}.pd-dialog-header,.pd-dialog-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 16px}.pd-dialog-header{border-bottom:1px solid var(--pd-border-soft, #ebeef5)}.pd-dialog-footer{justify-content:flex-end;border-top:1px solid var(--pd-border-soft, #ebeef5)}.pd-close{width:22px;height:22px;border:0;background:transparent;color:var(--pd-text-muted, #909399);font-size:16px;cursor:pointer}.pd-icon{display:inline-flex;width:14px;height:14px}.tb-more-panel{min-width:244px}.designer-container{scrollbar-width:thin;scrollbar-color:var(--pd-scrollbar, rgba(23, 32, 60, .18)) transparent}.designer-container ::-webkit-scrollbar{width:9px;height:9px}.designer-container ::-webkit-scrollbar-track{background:transparent}.designer-container ::-webkit-scrollbar-thumb{background:var(--pd-scrollbar-thumb, rgba(23, 32, 60, .16));border-radius:999px;border:2px solid transparent;background-clip:content-box}.designer-container ::-webkit-scrollbar-thumb:hover{background:var(--pd-scrollbar-thumb-hover, rgba(23, 32, 60, .3));border:2px solid transparent;background-clip:content-box}.designer-container ::-webkit-scrollbar-corner{background:transparent}.designer-container button:focus-visible,.designer-container [tabindex]:focus-visible,.designer-container .pd-tab:focus-visible{outline:2px solid var(--pd-accent, #165DFF);outline-offset:1px}@media(prefers-reduced-motion:reduce){.designer-container *,.designer-container *:before,.designer-container *:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}.help-button{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:4px;background:transparent;cursor:pointer;transition:background-color .15s}.help-button:hover{background:var(--pd-sidebar-hover, #f0f3f9)}.help-icon{display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:var(--pd-accent, #165DFF);color:#fff;font-size:12px;font-weight:600;line-height:1}.tb-dd{position:relative;display:inline-flex}.tb-dd-trigger{height:28px;min-width:28px;padding:0 5px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--pd-text-muted, #8b909c);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:3px;font-size:12px;transition:background .14s ease,color .14s ease}.tb-dd-trigger:hover:not(:disabled){color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.tb-dd-trigger:disabled{opacity:.32;cursor:default}.tb-dd-trigger.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.tb-dd-arrow{opacity:.6;transition:transform .14s ease}.tb-dd-arrow.up{transform:rotate(180deg)}.tb-dd-trigger[data-tip]{position:relative}.tb-dd-trigger[data-tip]:after{content:attr(data-tip);position:absolute;top:34px;left:50%;transform:translate(-50%);padding:4px 8px;font-size:12px;color:#fff;background:#1e2330e0;border-radius:4px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s ease;z-index:100}.tb-dd-trigger[data-tip]:hover:after{opacity:1}.tb-dd-panel{position:absolute;top:34px;left:0;background:var(--pd-surface, #fff);border:1px solid var(--pd-border, #d9dde6);border-radius:8px;box-shadow:var(--pd-shadow-md, 0 2px 8px rgba(23, 32, 60, .06), 0 10px 28px rgba(23, 32, 60, .07));z-index:200}.tb-dd-panel.is-hidden{display:none}.tb-more-group{flex-shrink:0}.tb-more-menu{display:flex;flex-direction:column;gap:8px;padding:8px;max-height:min(70vh,520px)}.tb-more-item{display:flex;flex-direction:column;gap:4px}.tb-menu-label{font-size:11px;color:var(--pd-text-muted, #8b909c);padding-left:2px}.tb-more-slot{display:flex;align-items:center}.designer-toolbar{display:flex;align-items:center;gap:2px;padding:0 12px;height:50px;background:var(--pd-surface, #ffffff);border-bottom:1px solid var(--pd-border-soft, #e9ecf2);box-shadow:0 1px 2px #17203c0a,0 6px 16px -12px #17203c40;flex-shrink:0;position:relative;z-index:100}.tb-ou{flex-shrink:0}.designer-toolbar>*{flex-shrink:0}.designer-toolbar>.tb-brand{flex-shrink:1;min-width:0}.tb-title,.tb-title-name,.tb-title-sub,.tb-btn-text,.tb-zoom{white-space:nowrap}.designer-toolbar.is-tight .tb-title{min-width:0;overflow:hidden}.designer-toolbar.is-tight .tb-title-name,.designer-toolbar.is-tight .tb-title-sub{overflow:hidden;text-overflow:ellipsis}.tb-group{display:flex;align-items:center;gap:2px;padding:0 8px}.tb-group+.tb-group{border-left:1px solid var(--pd-border-soft, #e9ecf2)}.tb-btn{height:30px;min-width:30px;padding:0 8px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--pd-text-muted, #8b909c);font-size:12px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:5px;transition:background .14s ease,color .14s ease,border-color .14s ease,box-shadow .14s ease}.tb-btn:hover{color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.tb-btn:active{background:var(--pd-border-soft, #e9ecf2)}.tb-btn:disabled{opacity:.32;cursor:default;background:transparent;color:var(--pd-text-faint, #b4b9c4)}.tb-btn.danger:hover:not(:disabled){color:var(--pd-accent-secondary, #f56c6c);background:var(--pd-danger-soft, rgba(245, 108, 108, .1))}.tb-btn.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09));font-weight:600}.tb-btn .dot{width:6px;height:6px;border-radius:50%;background:var(--pd-text-faint, #b4b9c4);display:inline-block;transition:background .14s ease,box-shadow .14s ease}.tb-btn.on .dot{background:var(--pd-accent, #165DFF);box-shadow:0 0 0 3px #165dff1f}.tb-icon{font-size:15px;line-height:1}[data-tip]{position:relative}[data-tip]:after{content:attr(data-tip);position:absolute;bottom:-32px;left:50%;transform:translate(-50%);padding:4px 8px;font-size:12px;color:#fff;background:#1e2330e0;border-radius:4px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s ease;z-index:100}[data-tip]:hover:after{opacity:1}.tb-mark{width:28px;height:28px;margin-right:2px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;color:#fff;background:linear-gradient(150deg,var(--pd-accent-2, #3D7BFF),var(--pd-accent, #165DFF));box-shadow:0 3px 8px #165dff47,inset 0 1px #ffffff38;flex-shrink:0}.tb-mark svg{width:16px;height:16px}.tb-title{display:flex;flex-direction:column;line-height:1.2;padding-left:6px}.tb-title-name{font-size:13px;font-weight:600;color:var(--pd-text, #2a2e37);letter-spacing:.2px}.tb-title-sub{font-size:10px;color:var(--pd-text-muted, #8b909c);letter-spacing:.8px}.tb-zoom{font-size:12px;color:var(--pd-text, #2a2e37);font-variant-numeric:tabular-nums;min-width:46px;text-align:center}.tb-spacer{flex:1}.tb-group .tb-dd-trigger{height:30px;min-width:30px;padding:0 8px}.tb-btn-text{font-size:12px}.tb-menu{padding:8px;display:flex;flex-direction:column;gap:4px}.tb-menu-rows{width:148px}.tb-menu-label{padding:2px 4px;font-size:11px;color:var(--pd-text-muted, #8b909c)}.tb-menu-grid{display:grid;grid-template-columns:repeat(4,32px);gap:2px;margin-bottom:4px}.tb-menu-row{justify-content:flex-start;width:100%}.btn-primary,.btn-secondary{height:32px;padding:0 16px;border-radius:7px;font-size:13px;font-weight:600;cursor:pointer;transition:filter .14s ease,background .14s ease,border-color .14s ease,box-shadow .14s ease}.btn-secondary{background:var(--pd-field-bg, #f4f6fa);color:var(--pd-text-muted, #606266);border:1px solid var(--pd-border, #d9dde6)}.btn-secondary:hover{border-color:var(--pd-accent, #165DFF);color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .06))}.btn-primary{background:linear-gradient(180deg,var(--pd-accent-2, #3D7BFF),var(--pd-accent, #165DFF));color:#fff;border:none;box-shadow:0 3px 10px #165dff47,inset 0 1px #ffffff2e}.btn-primary:hover{filter:brightness(1.07);box-shadow:0 5px 14px #165dff57,inset 0 1px #ffffff2e}.btn-primary:active{filter:brightness(.97)}.font-select{position:relative}.font-select-input{display:block;width:100%}.font-select-list{position:absolute;top:calc(100% + 4px);left:0;width:100%;min-width:150px;z-index:200;margin:0;max-height:200px;overflow-y:auto;padding:2px;border:1px solid var(--pd-border, #d9dde6);border-radius:6px;background:var(--pd-surface, #ffffff);box-shadow:var(--pd-shadow-md, 0 2px 8px rgba(23, 32, 60, .06), 0 10px 28px rgba(23, 32, 60, .07));list-style:none}.font-select-list.is-up{top:auto;bottom:calc(100% + 4px)}.font-select-option{padding:4px 6px;border-radius:4px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.font-select-option.is-active{background:var(--pd-sidebar-hover, #f0f3f9)}.font-select-option.is-muted{color:var(--pd-text-muted, #8b909c)}.pd-stepper{display:flex;align-items:center;width:100%}.pd-step-btn{width:26px;height:26px;flex-shrink:0;border:1px solid var(--pd-border, #d9dde6);background:var(--pd-field-bg, #f4f6fa);color:var(--pd-text, #2a2e37);font-size:14px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .14s ease,border-color .14s ease,color .14s ease}.pd-step-btn:hover:not(:disabled){background:var(--pd-sidebar-hover, #f0f3f9);border-color:var(--pd-text-faint, #b4b9c4)}.pd-step-btn:disabled{opacity:.45;cursor:not-allowed}.pd-step-minus{border-radius:6px 0 0 6px;border-right:none}.pd-step-plus{border-radius:0 6px 6px 0;border-left:none}.pd-step-input.pd-input{border-radius:0;min-width:0;flex:1;text-align:center;-moz-appearance:textfield}.pd-step-input.pd-input::-webkit-outer-spin-button,.pd-step-input.pd-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.preset-color-trigger{display:flex;align-items:center;width:100%;min-height:26px;padding:1px;border:1px solid var(--pd-border, #d9dde6);border-radius:6px;background:var(--pd-surface, #fff);cursor:pointer;transition:border-color .14s ease,box-shadow .14s ease}.preset-color-trigger:hover,.preset-color-trigger[aria-expanded=true]{border-color:var(--pd-accent, #165DFF)}.preset-color-trigger:focus-visible{outline:none;border-color:var(--pd-accent, #165DFF);box-shadow:0 0 0 2px #165dff1f}.preset-color-swatch{width:100%;height:22px;border-radius:4px;background-image:linear-gradient(45deg,#e9ecef 25%,transparent 25%,transparent 75%,#e9ecef 75%);background-size:8px 8px;background-position:0 0,4px 4px}.preset-color-panel{position:fixed;z-index:3000;width:190px;padding:10px;border:1px solid var(--pd-border, #d9dde6);border-radius:8px;background:var(--pd-surface, #fff);box-shadow:0 8px 24px #17203c29}.picker-preview{display:flex;align-items:center;gap:8px;margin-bottom:8px}.picker-current{flex:0 0 26px;height:24px;border:1px solid rgb(0 0 0 / 12%);border-radius:5px;background-image:linear-gradient(45deg,#e9ecef 25%,transparent 25%,transparent 75%,#e9ecef 75%);background-size:8px 8px;background-position:0 0,4px 4px}.picker-current.is-empty{position:relative;background-color:#fff}.picker-current.is-empty:after{content:"";position:absolute;inset:3px;background:linear-gradient(to top right,transparent calc(50% - .7px),#f53f3f calc(50% - .7px),#f53f3f calc(50% + .7px),transparent calc(50% + .7px));border-radius:3px}.picker-hex{flex:1;min-width:0;height:24px;padding:0 6px;border:1px solid var(--pd-border, #d9dde6);border-radius:5px;color:var(--pd-text, #303133);font:inherit;font-size:11px;text-transform:uppercase}.picker-hex:focus{outline:none;border-color:var(--pd-accent, #165DFF);box-shadow:0 0 0 2px #165dff1f}.picker-area{position:relative;height:100px;border:1px solid rgb(0 0 0 / 12%);border-radius:6px;overflow:hidden;cursor:crosshair;touch-action:none;background:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,hsl(var(--picker-hue) 100% 50%))}.picker-handle{position:absolute;width:12px;height:12px;border:2px solid #fff;border-radius:50%;transform:translate(-50%,-50%);box-shadow:0 0 3px #00000073;pointer-events:none}.picker-hue{width:100%;height:14px;margin:10px 0 0;appearance:none;border:1px solid rgb(0 0 0 / 12%);border-radius:999px;background:linear-gradient(to right,red,#ff0,#0f0,#0ff,#00f,#f0f,red);cursor:pointer}.picker-hue::-webkit-slider-thumb{appearance:none;width:12px;height:12px;border:2px solid #fff;border-radius:50%;background:transparent;box-shadow:0 0 3px #00000073}.picker-hue::-moz-range-thumb{width:8px;height:8px;border:2px solid #fff;border-radius:50%;background:transparent;box-shadow:0 0 3px #00000073}.picker-heading{display:flex;align-items:center;justify-content:space-between;margin-top:10px;margin-bottom:6px;font-size:11px;color:var(--pd-text-muted, #909399)}.picker-clear{display:inline-flex;align-items:center;gap:3px;padding:2px 6px;border:none;border-radius:4px;background:transparent;font-size:11px;line-height:1;color:var(--pd-text-muted, #909399);cursor:pointer}.picker-clear:hover:not(:disabled){background:#0000000f;color:var(--pd-danger, #f53f3f)}.picker-clear:disabled{opacity:.45;cursor:not-allowed}.preset-color-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:5px}.preset-color-item{width:22px;height:22px;padding:0;border:1px solid rgb(0 0 0 / 12%);border-radius:5px;cursor:pointer}.preset-color-item.active{box-shadow:0 0 0 2px #fff,0 0 0 3px var(--pd-accent, #165DFF)}.format-toolbar{display:flex;align-items:center;gap:2px;flex-shrink:0;min-width:0}.ft-group{display:flex;align-items:center;gap:2px;padding:0 8px;flex-shrink:0}.ft-group+.ft-group{border-left:1px solid var(--pd-border-soft, #e9ecf2)}.ft-btn{height:28px;min-width:28px;padding:0 5px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--pd-text-muted, #8b909c);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:4px;transition:background .14s ease,color .14s ease}.ft-btn:hover:not(:disabled){color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.ft-btn:disabled{opacity:.32;cursor:default}.ft-btn.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.ft-btn-text{font-size:12px}.ft-btn[data-tip]{position:relative}.ft-btn[data-tip]:after{content:attr(data-tip);position:absolute;top:34px;left:50%;transform:translate(-50%);padding:4px 8px;font-size:12px;color:#fff;background:#1e2330e0;border-radius:4px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s ease;z-index:100}.ft-btn[data-tip]:hover:after{opacity:1}.ft-font{width:150px}.ft-size{width:96px}.ft-font .font-select-input,.ft-size .pd-input,.ft-size .pd-step-btn{font-size:12px}.ft-color-btn{position:relative;width:28px;height:28px;display:inline-flex;margin-left:2px}.ft-color-btn.dim{opacity:.35}.ft-color-btn .preset-color-trigger{width:100%;height:100%;min-height:0;padding:0;border:1px solid transparent;border-radius:6px;background:transparent;align-items:flex-end;justify-content:center}.ft-color-btn .preset-color-trigger:hover,.ft-color-btn .preset-color-trigger[aria-expanded=true]{background:var(--pd-sidebar-hover, #f0f3f9);border-color:var(--pd-border-soft, #e9ecf2)}.ft-color-btn .preset-color-swatch{width:16px;height:4px;margin-bottom:3px;border-radius:1px;background-image:none;border-bottom:1px solid var(--pd-text-faint, #b4b9c4)}.ft-glyph{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding-bottom:7px;font-size:13px;font-weight:700;color:var(--pd-text, #2a2e37);pointer-events:none}.ft-border-panel{width:196px;padding:10px;display:flex;flex-direction:column;gap:8px}.ft-align-panel{padding:6px;display:flex;flex-direction:column;gap:4px}.ft-align-row{display:grid;grid-template-columns:repeat(3,36px);gap:4px}.ft-border-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.ft-cell-btn{height:30px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--pd-text, #2a2e37);cursor:pointer}.ft-cell-btn:hover:not(:disabled){background:var(--pd-sidebar-hover, #f0f3f9);border-color:var(--pd-border-soft, #e9ecf2)}.ft-cell-btn.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09));border-color:#165dff59}.ft-cell-btn:disabled{opacity:.32;cursor:default}.ft-cell-btn .g-faint{fill:none;stroke:var(--pd-text-faint, #b4b9c4);stroke-width:1;stroke-dasharray:2 2}.ft-cell-btn .g-solid{stroke:currentColor;stroke-width:1.6}.ft-cell-btn[data-tip],.ft-style-btn[data-tip]{position:relative}.ft-cell-btn[data-tip]:after,.ft-style-btn[data-tip]:after{content:attr(data-tip);position:absolute;top:calc(100% + 4px);left:50%;transform:translate(-50%);padding:4px 8px;font-size:12px;font-weight:400;color:#fff;background:#1e2330e0;border-radius:4px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s ease;z-index:210}.ft-cell-btn[data-tip]:hover:after,.ft-style-btn[data-tip]:hover:after{opacity:1}.ft-style-row{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.ft-style-btn{height:22px;display:inline-flex;align-items:center;justify-content:center;padding:0 4px;border:1px solid transparent;border-radius:5px;background:transparent;color:var(--pd-text, #2a2e37);cursor:pointer}.ft-style-btn:hover{background:var(--pd-sidebar-hover, #f0f3f9)}.ft-style-btn.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09));border-color:#165dff59}.ft-style-line{width:100%;height:0}.ft-border-style-row{display:flex;align-items:center;gap:6px}.ft-line-width{width:96px}.ft-edge-label{font-size:12px;color:var(--pd-text-muted, #8b909c);white-space:nowrap;flex-shrink:0}.layer-panel{border-top:1px solid var(--pd-border);padding:8px 12px;height:100%;box-sizing:border-box;overflow-y:auto}.panel-title{font-size:11px;color:var(--pd-text-muted);text-transform:uppercase;letter-spacing:.5px;margin-bottom:8px}.layer-item{display:flex;align-items:center;gap:6px;padding:4px 6px;margin-bottom:2px;border-radius:4px;cursor:pointer;font-size:12px;transition:background .1s}.layer-item:hover{background:var(--pd-sidebar-hover, #f0f2f5)}.layer-item.active{background:#165dff1a;color:var(--pd-accent, #165DFF);box-shadow:inset 2px 0 0 var(--pd-accent, #165DFF)}.layer-icon{width:18px;text-align:center;font-size:12px;color:var(--pd-text-muted, #909399)}.layer-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pd-text, #303133)}.layer-zone{flex-shrink:0;padding:0 4px;font-size:10px;line-height:14px;color:var(--pd-ink-green, #67c23a);background:#67c23a1a;border-radius:3px}.layer-zindex{font-size:10px;color:var(--pd-text-muted, #909399);font-variant-numeric:tabular-nums}.layer-actions{display:flex;gap:4px;margin-top:8px}.field-tree-panel{padding:0}.panel-title{font-size:11px;color:var(--pd-text-muted);text-transform:uppercase;letter-spacing:.5px;padding:4px 0 8px;margin-bottom:8px;border-bottom:1px solid var(--pd-border)}.search-input{margin-bottom:8px}.tree-container{overflow-y:auto;min-height:0}.field-group-header{display:flex;align-items:center;gap:4px;padding:5px 8px;border-radius:4px;font-size:13px;color:var(--pd-text, #303133);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background .1s}.field-group-header:hover{background:var(--pd-sidebar-hover, #f0f2f5)}.field-group-header.is-list{color:var(--pd-accent, #165DFF);font-weight:500}.expand-icon{width:12px;font-size:8px;flex-shrink:0;color:var(--pd-text-muted, #909399)}.field-row{display:flex;align-items:center;gap:4px;padding:5px 8px;border-radius:4px;font-size:13px;color:var(--pd-text, #303133);cursor:grab;-webkit-user-select:none;user-select:none;transition:background .1s}.field-row:hover{background:var(--pd-sidebar-hover, #f0f2f5)}.node-icon{font-size:14px;flex-shrink:0;filter:saturate(.6);opacity:.9}.node-meta{flex:1;min-width:0;display:flex;flex-wrap:wrap;align-items:center;column-gap:4px;row-gap:1px}.node-label{flex:1 1 auto;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.node-key{flex:0 1 auto;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:var(--pd-text-muted, #909399)}.field-row .node-key.is-primary{font-size:13px;color:var(--pd-text, #303133)}.group-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.copy-hint{flex-shrink:0;margin-left:auto;font-size:11px;color:var(--pd-accent, #165DFF);white-space:nowrap}.left-panel{width:248px;min-width:248px;background:var(--pd-sidebar, #ffffff);border-right:1px solid var(--pd-border-soft, #e9ecf2);display:flex;flex-direction:column;overflow:hidden;transition:width .18s ease}.left-panel.collapsed{width:36px;min-width:36px;border-right:1px solid var(--pd-border-soft, #e9ecf2)}.left-collapsed{display:flex;flex-direction:column;align-items:center;gap:8px;padding-top:12px;flex:1}.lc-btn{width:26px;height:26px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--pd-text-muted, #8b909c);font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .14s ease}.lc-btn:hover{color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.lc-btn.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.left-head{display:flex;align-items:center;justify-content:space-between;height:42px;padding:0 12px;flex-shrink:0;border-bottom:1px solid var(--pd-border-soft, #e9ecf2)}.left-title{font-size:12px;font-weight:600;color:var(--pd-text, #2a2e37);letter-spacing:1.2px;display:inline-flex;align-items:center;gap:7px}.left-title:before{content:"";width:3px;height:12px;border-radius:2px;background:linear-gradient(180deg,var(--pd-accent-2, #3D7BFF),var(--pd-accent, #165DFF))}.left-tabs{flex:1;display:flex;flex-direction:column;overflow:hidden}.left-tabs .pd-tab-pane{flex:1;min-height:0;overflow-y:auto;padding:12px}.material-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-content:start}.material-grid>.panel-title,.material-grid>.material-group-title,.material-grid>.material-card--wide{grid-column:1 / -1}.material-grid>.panel-title,.material-grid>.material-group-title{margin-bottom:0}.material-grid>.material-card{margin-bottom:0;min-width:0}.panel-title{font-size:11px;color:var(--pd-text-muted, #8b909c);letter-spacing:.6px;padding:2px 2px 8px;margin-bottom:10px;border-bottom:1px solid var(--pd-border-soft, #e9ecf2)}.material-group-title{font-size:11px;color:var(--pd-text-muted, #8b909c);letter-spacing:.6px;padding:4px 2px 6px;margin:2px 0 8px;border-bottom:1px solid var(--pd-border-soft, #e9ecf2)}.material-card{position:relative;display:flex;align-items:center;gap:9px;padding:7px 8px;border:1px solid var(--pd-border-soft, #e9ecf2);border-radius:7px;background:transparent;cursor:grab;-webkit-user-select:none;user-select:none;transition:background .16s ease,border-color .16s ease,transform .16s ease,box-shadow .16s ease}.material-card:before{content:"";position:absolute;left:0;top:50%;width:2px;height:0;border-radius:2px;background:var(--pd-accent, #165DFF);transform:translateY(-50%);transition:height .16s ease}.material-card:hover{background:var(--pd-hover-tint, #ecf5ff);border-color:#165dff73;transform:translate(2px)}.material-card:hover:before{height:56%}.material-card:active{cursor:grabbing;transform:translate(2px) scale(.985)}.material-icon{width:30px;height:30px;border:0;border-radius:7px;display:flex;align-items:center;justify-content:center;color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09));box-shadow:inset 0 0 0 1px #165dff1f;flex-shrink:0;transition:background .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease}.material-card:hover .material-icon{background:var(--pd-accent, #165DFF);color:#fff;box-shadow:0 2px 6px #165dff47}.material-card:active .material-icon{transform:scale(.92)}.material-label{min-width:0;flex:1;font-size:12.5px;font-weight:500;line-height:1.3;color:var(--pd-text, #2a2e37);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .16s ease}.material-card:hover .material-label{color:var(--pd-accent, #165DFF)}.print-image{width:100%;height:100%;overflow:hidden}.print-image img{width:100%;height:100%;display:block}.table-ctx-menu{position:fixed;z-index:3000;min-width:140px;padding:4px 0;background:var(--pd-surface, #fff);border:1px solid var(--pd-menu-border, #dcdfe6);border-radius:4px;box-shadow:0 2px 12px #00000026;font-size:13px}.menu-item{padding:5px 14px;cursor:pointer;color:var(--pd-menu-text, #333)}.menu-item:hover{background:var(--pd-menu-hover, #f5f7fa)}.menu-item.disabled{color:var(--pd-menu-disabled, #c0c4cc);cursor:not-allowed}.menu-item.active{color:var(--pd-accent, #165DFF)}.menu-divider{height:1px;margin:4px 0;background:var(--pd-menu-divider, #ebeef5)}.menu-group-title{padding:4px 14px;font-size:12px;color:var(--pd-menu-muted, #909399)}.cell-barcode{width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden}.cell-barcode svg{max-width:100%;max-height:100%}.cell-barcode img{max-width:100%;max-height:100%}.cell-barcode-fallback{font-style:italic;opacity:.6}.cell-image{width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden}.cell-image img{max-width:100%;max-height:100%;display:block}.image-placeholder{width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:#bbb;font-size:12px;border:1px dashed #ddd;box-sizing:border-box}.print-table{position:relative;width:100%;height:100%}.print-table table{border-collapse:collapse;table-layout:fixed;width:100%}.print-table td{box-sizing:border-box;word-break:normal;overflow-wrap:break-word}.cell-selected{outline:2px solid #165DFF;outline-offset:-2px;background-color:#165dff14}.row-data-bg{background-image:repeating-linear-gradient(45deg,rgba(22,93,255,.04) 0 6px,transparent 6px 12px)}.data-placeholder{color:#909399;font-style:italic}.row-badges{position:absolute;left:-16px;top:0;width:14px}.row-badge{position:absolute;width:14px;display:flex;align-items:center;justify-content:center;font-size:10px;color:#909399;background:#f5f7fa;border-radius:2px}.col-resize-layer{position:absolute;inset:0;pointer-events:none;z-index:3}.col-resize-handle{position:absolute;top:0;bottom:0;width:6px;transform:translate(-50%);cursor:col-resize;pointer-events:auto}.col-resize-handle:after{content:"";position:absolute;top:0;bottom:0;left:50%;border-left:1px solid transparent}.col-resize-handle:hover:after,.col-resize-handle.dragging:after{border-left-color:var(--pd-accent, #165DFF)}.print-barcode{width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden}.print-barcode svg{max-width:100%;max-height:100%}.print-qrcode{width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden}.print-qrcode img{max-width:100%;max-height:100%}.print-html,.page-number-element{width:100%;height:100%;overflow:hidden}.print-element{box-sizing:border-box;cursor:pointer;-webkit-user-select:none;user-select:none}.extension-placeholder{display:flex;align-items:center;justify-content:center;width:100%;height:100%;box-sizing:border-box;padding:2px;font-size:11px;line-height:1.4;text-align:center;color:var(--pd-text-muted, #8b909c);background:repeating-linear-gradient(45deg,#f4f6fa,#f4f6fa 6px,#fff 6px 12px);overflow:hidden}.element-margin-guide{position:absolute;box-sizing:border-box;pointer-events:none}.print-element.design-mode{outline:1px dashed #C3C9D6}.print-element.design-mode.zone-header,.print-element.design-mode.zone-footer{outline:1px dashed var(--pd-ink-green, #67c23a)}.print-element.selected{outline:1.5px solid var(--pd-accent, #165DFF);background:#165dff0a}.print-element.previewed{outline:1.5px solid rgba(22,93,255,.5);background:#165dff1a}.print-element.design-mode:hover{outline:1px dashed var(--pd-accent, #165DFF)}.print-element.locked{cursor:not-allowed}.print-element.locked:not(.selected){outline:1.5px dashed #999}.print-element.hidden{opacity:.3;pointer-events:none}.print-element.drag-ghost{opacity:.4}.drag-preview{position:absolute;inset:0;border:2px dashed var(--pd-accent, #165DFF);pointer-events:none;z-index:1000;box-sizing:border-box}.selected-indicator{position:absolute;top:-18px;left:0;font-size:10px;white-space:nowrap;pointer-events:none;z-index:20}.position-label{background:var(--pd-accent, #165DFF);color:#fff;padding:1px 6px;border-radius:3px;font-family:ui-monospace,SF Mono,Menlo,monospace;font-size:10px;font-variant-numeric:tabular-nums;letter-spacing:0;box-shadow:0 2px 6px #00000026}.resize-handles{position:absolute;inset:0;pointer-events:none}.resize-handle{position:absolute;width:7px;height:7px;background:var(--pd-handle, #165DFF);border:1.5px solid #fff;border-radius:2px;box-sizing:border-box;transform:translate(-50%,-50%);box-shadow:0 1px 3px #0000002e;z-index:10;pointer-events:auto}.handle-nw{top:0;left:0;cursor:nw-resize}.handle-n{top:0;left:50%;cursor:n-resize}.handle-ne{top:0;left:100%;cursor:ne-resize}.handle-e{top:50%;left:100%;cursor:e-resize}.handle-se{top:100%;left:100%;cursor:se-resize}.handle-s{top:100%;left:50%;cursor:s-resize}.handle-sw{top:100%;left:0;cursor:sw-resize}.handle-w{top:50%;left:0;cursor:w-resize}.paper-wrapper{display:block}.hiprint-printPaper{transition:transform .15s ease-out}.zone-layer{box-sizing:border-box}.zone-layer.zone-header.design-mode,.zone-layer.zone-footer.design-mode{outline:1px dashed var(--pd-ink-green, #67c23a);background:#67c23a0a}.zone-layer.zone-content.design-mode{outline:1px dashed #C3C9D6}.zone-label{position:absolute;top:2px;right:4px;font-size:9px;color:#909399;pointer-events:none;-webkit-user-select:none;user-select:none}.zone-resize-handle{position:absolute;left:0;width:100%;height:6px;cursor:ns-resize;z-index:5}.zone-resize-handle.handle-bottom{bottom:-3px}.zone-resize-handle.handle-top{top:-3px}.zone-resize-handle:hover{background:#10b98140}.zone-height-tip{position:absolute;right:4px;top:-22px;padding:1px 6px;font-size:11px;color:#fff;background:#10b981;border-radius:3px;white-space:nowrap;pointer-events:none}.design-background{position:absolute;z-index:0;overflow:hidden;pointer-events:none}.design-background img{display:block;width:100%;height:100%;object-fit:fill;pointer-events:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.grid-bg{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:0}.snap-indicator{position:absolute;width:6px;height:6px;background:var(--pd-accent, #165DFF);border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;z-index:10;animation:snap-pulse-3160f418 .3s ease-out}@keyframes snap-pulse-3160f418{0%{transform:translate(-50%,-50%) scale(2);opacity:.5}to{transform:translate(-50%,-50%) scale(1);opacity:0}}.watermark-layer{position:absolute;top:0;left:0;width:100%;height:100%;z-index:0;overflow:hidden;pointer-events:none}.watermark-tile{position:absolute;pointer-events:none}.adsorb-guide{position:absolute;pointer-events:none;z-index:9999}.adsorb-guide.guide-vertical{border-left:1px dashed var(--pd-accent-secondary, #f56c6c)}.adsorb-guide.guide-horizontal{border-top:1px dashed var(--pd-accent-secondary, #f56c6c)}.manual-guide{position:absolute;pointer-events:auto;z-index:9998;cursor:move}.manual-guide.guide-vertical{border-left:1px solid #3B82F6;width:0}.manual-guide.guide-horizontal{border-top:1px solid #3B82F6;height:0}.manual-guide:before{content:"";position:absolute;pointer-events:auto}.manual-guide.guide-vertical:before{top:0;bottom:0;left:50%;width:var(--guide-hit, 8px);transform:translate(-50%)}.manual-guide.guide-horizontal:before{left:0;right:0;top:50%;height:var(--guide-hit, 8px);transform:translateY(-50%)}.manual-guide:hover{border-color:#ef4444!important}.pd-ruler{position:absolute;display:block;pointer-events:auto;cursor:crosshair;z-index:1;background:var(--pd-ruler-bg, #f8f9fc)}.pd-ruler.is-horizontal{box-shadow:0 1px 0 var(--pd-border-soft, #e9ecf2)}.pd-ruler.is-vertical{box-shadow:1px 0 0 var(--pd-border-soft, #e9ecf2)}.canvas-area{flex:1;overflow-x:scroll;overflow-y:auto;scrollbar-gutter:stable;display:flex;background-color:var(--pd-canvas-bg, #e6e9f0);background-image:radial-gradient(circle,rgba(23,32,60,.13) 1px,transparent 1.2px);background-size:20px 20px;background-position:center;padding:44px 28px 32px 44px;position:relative}.canvas-scroll{display:flex;flex-direction:column;align-items:center;gap:20px;position:relative;flex:none;margin:auto;width:fit-content}.marquee-selection{position:fixed;border:1.5px solid rgba(22,93,255,.7);background:#165dff14;border-radius:2px;pointer-events:none;z-index:10000}.drop-hint{position:fixed;z-index:10002;pointer-events:none;padding:2px 8px;border-radius:10px;background:var(--pd-accent, #165dff);color:#fff;font-size:12px;line-height:18px;white-space:nowrap;box-shadow:0 2px 8px #0000002e}.context-menu{position:fixed;background:var(--pd-surface, #ffffff);border:1px solid var(--pd-border-soft, #e9ecf2);border-radius:8px;box-shadow:var(--pd-shadow-md, 0 10px 28px rgba(23, 32, 60, .12));padding:5px;z-index:10001;min-width:132px}.context-menu-item{padding:7px 12px;border-radius:5px;font-size:12.5px;cursor:pointer;color:var(--pd-text, #2a2e37);-webkit-user-select:none;user-select:none;transition:background .12s ease,color .12s ease}.context-menu-item:hover{background:var(--pd-accent-soft, rgba(22, 93, 255, .09));color:var(--pd-accent, #165DFF)}.context-menu-item.disabled{color:var(--pd-text-faint, #b4b9c4);cursor:not-allowed}.context-menu-item.disabled:hover{background:transparent;color:var(--pd-text-faint, #b4b9c4)}.context-menu-sep{height:1px;background:var(--pd-border-soft, #e9ecf2);margin:5px 8px}.ruler-overlay{position:absolute;inset:0;pointer-events:none;z-index:60}.ruler-corner{position:absolute;top:0;left:0;width:22px;height:22px;background:var(--pd-ruler-bg, #f8f9fc);box-shadow:1px 1px 0 var(--pd-border-soft, #e9ecf2);z-index:2}.ruler-overlay .pd-ruler.is-horizontal{top:0;left:22px}.ruler-overlay .pd-ruler.is-vertical{top:22px;left:0}.ruler-guide-preview{position:fixed;pointer-events:none;z-index:9997}.ruler-guide-preview.guide-vertical{width:0;border-left:1px dashed var(--pd-accent, #165dff)}.ruler-guide-preview.guide-horizontal{height:0;border-top:1px dashed var(--pd-accent, #165dff)}.property-search{padding:0 0 10px;background:transparent}.property-group{border:1px solid var(--pd-border-soft, #e9ecf2);border-radius:8px;margin-bottom:10px;background:var(--pd-surface, #ffffff);overflow:hidden;transition:border-color .14s ease,box-shadow .14s ease}.property-group:last-child{margin-bottom:2px}.property-group.is-expanded{border-color:var(--pd-border-soft, #e9ecf2)}.group-header{display:flex;align-items:center;padding:9px 12px;cursor:pointer;-webkit-user-select:none;user-select:none;background:var(--pd-field-bg, #f4f6fa);transition:background .14s ease}.group-header:hover{background:var(--pd-sidebar-hover, #f0f3f9)}.property-group.is-expanded .group-header{border-bottom:1px solid var(--pd-border-soft, #e9ecf2)}.group-icon{margin-right:8px;color:var(--pd-accent, #165DFF)}.group-title{flex:1;font-size:12px;font-weight:600;color:var(--pd-text, #2a2e37);letter-spacing:.3px}.expand-icon{color:var(--pd-text-muted, #8b909c);font-size:10px}.group-content{padding:10px 12px 12px;background:var(--pd-surface, #ffffff)}.position-grid,.margin-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.margin-grid{margin-top:8px}.pd-crop-note{margin:0 0 8px;font-size:12px;line-height:1.5;color:var(--pd-text-faint, #6b7280)}.pd-crop-preview{position:relative;overflow:hidden;margin-bottom:8px;border:1px solid var(--pd-border, #d9dde6);border-radius:4px;line-height:0;width:fit-content;max-width:100%}.pd-crop-thumb{max-width:100%;max-height:96px;display:block}.pd-crop-win{position:absolute;border:1px solid #ff5a5a;box-shadow:0 0 0 999px #0000008c;pointer-events:none}.color-row{display:flex;gap:12px}.color-row>.pd-field{flex:1 1 0;min-width:0}.pd-rotate-row{display:flex;align-items:stretch;width:100%}.pd-rotate-btn{width:26px;flex-shrink:0;border:1px solid var(--pd-border, #d9dde6);background:var(--pd-field-bg, #f4f6fa);color:var(--pd-text, #2a2e37);font-size:14px;line-height:1;cursor:pointer;transition:background .14s ease,border-color .14s ease}.pd-rotate-btn:hover{background:var(--pd-sidebar-hover, #f0f3f9);border-color:var(--pd-text-faint, #b4b9c4)}.pd-rotate-btn:first-child{border-radius:6px 0 0 6px;border-right:none}.pd-rotate-btn:last-child{border-radius:0 6px 6px 0;border-left:none}.pd-rotate-stepper{flex:1;min-width:0}.pd-rotate-stepper .pd-step-minus,.pd-rotate-stepper .pd-step-plus{display:none}.pd-rotate-stepper .pd-step-input.pd-input{border-radius:0}.expression-editor{display:flex;height:450px;gap:0}.ee-nav{width:100px;background:var(--pd-sidebar);border-right:1px solid var(--pd-border);display:flex;flex-direction:column;flex-shrink:0}.ee-nav-title{padding:10px;border-bottom:1px solid var(--pd-border);font-weight:600;font-size:13px;color:var(--pd-text);text-align:center}.ee-nav-tabs{flex:1;display:flex;flex-direction:column;padding:6px;gap:4px}.ee-nav-tab{padding:8px 10px;border-radius:6px;cursor:pointer;font-size:12px;text-align:center;transition:all .2s}.ee-nav-tab.active{background:var(--pd-accent);color:#fff}.ee-nav-tab:not(.active){background:var(--pd-surface, white);border:1px solid var(--pd-border);color:var(--pd-text)}.ee-nav-tab:hover:not(.active){background:var(--pd-hover-tint, #ecf5ff);border-color:var(--pd-accent)}.ee-content{width:300px;display:flex;flex-direction:column;border-right:1px solid var(--pd-border);flex-shrink:0}.ee-content-search{padding:10px;border-bottom:1px solid var(--pd-border)}.ee-content-list{flex:1;padding:8px;overflow-y:auto;min-height:0}.ee-func-group{margin-bottom:12px}.ee-func-group-title{font-size:11px;font-weight:600;color:var(--pd-text-muted);padding:6px 10px;margin-bottom:2px;letter-spacing:.5px}.ee-field-group{display:flex;align-items:center;gap:4px;padding:6px 10px;font-size:12px;font-weight:600;color:var(--pd-text)}.ee-field-group.is-list{color:var(--pd-accent, #165DFF)}.ee-field-group-icon{font-size:13px;filter:saturate(.6)}.ee-list-item{padding:7px 10px;cursor:pointer;border-radius:4px;margin-bottom:2px;transition:background .15s}.ee-field-info{display:flex;flex-direction:column;gap:1px}.ee-field-info .ee-item-label{font-size:12px;color:var(--pd-text)}.ee-field-info .ee-item-key{font-size:10px;color:var(--pd-text-muted);font-family:monospace}.ee-field-info .ee-item-key.is-primary{font-size:12px;color:var(--pd-text, #303133);font-family:inherit}.ee-field-item{display:flex;align-items:center;gap:6px}.ee-field-item .ee-field-info{flex:1;min-width:0}.ee-copy-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:1px solid transparent;border-radius:4px;background:transparent;color:var(--pd-text-muted);cursor:pointer;transition:color .15s,background .15s,border-color .15s}.ee-copy-btn:hover{background:var(--pd-surface, white);border-color:var(--pd-border);color:var(--pd-accent)}.ee-copy-btn.is-copied{color:var(--pd-success, #16a34a)}.ee-list-item:hover{background:var(--pd-hover-tint, #ecf5ff)}.ee-editor{flex:1;display:flex;flex-direction:column;background:var(--pd-sidebar);min-width:0}.ee-editor-section{padding:12px;border-bottom:1px solid var(--pd-border)}.ee-editor-title{font-size:11px;color:var(--pd-text-muted);margin-bottom:6px;text-transform:uppercase;letter-spacing:.5px}.ee-textarea{width:100%;border:1px solid var(--pd-border);border-radius:6px;padding:10px;font-family:monospace;font-size:13px;resize:vertical;box-sizing:border-box;min-height:100px}.ee-textarea:focus{outline:none;border-color:var(--pd-accent)}.ee-preview{padding:10px;background:var(--pd-bg);border:1px solid var(--pd-border);border-radius:6px;min-height:30px;font-size:13px;color:var(--pd-text);line-height:1.6;white-space:pre-wrap}.ee-preview-error{color:var(--pd-danger, #e53e3e);background:var(--pd-danger-bg, #fef2f2);border-color:var(--pd-danger-border, #fecaca)}.ee-help-section{flex:1;padding:12px;overflow-y:auto;min-height:0}.ee-help-title{font-size:11px;color:var(--pd-text-muted);margin-bottom:8px;text-transform:uppercase;letter-spacing:.5px}.ee-help-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.ee-help-card{border-radius:6px;padding:10px}.ee-help-card-title{font-size:12px;font-weight:600;margin-bottom:4px}.ee-help-card-content{font-size:11px;line-height:1.5;color:var(--pd-text)}.ee-help-field{background:var(--pd-help-field-bg, #f0f9ff);border:1px solid var(--pd-help-field-line, #bae6fd)}.ee-help-field .ee-help-card-title{color:var(--pd-help-field-ink, #0369a1)}.ee-help-function{background:var(--pd-help-function-bg, #f0fdf4);border:1px solid var(--pd-help-function-line, #bbf7d0)}.ee-help-function .ee-help-card-title{color:var(--pd-help-function-ink, #166534)}.ee-help-variable{background:var(--pd-help-variable-bg, #fefce8);border:1px solid var(--pd-help-variable-line, #fde68a)}.ee-help-variable .ee-help-card-title{color:var(--pd-help-variable-ink, #854d0e)}.ee-help-conditional{background:var(--pd-help-conditional-bg, #fdf2f8);border:1px solid var(--pd-help-conditional-line, #fbcfe8)}.ee-help-conditional .ee-help-card-title{color:var(--pd-help-conditional-ink, #9d174d)}.expression-editor{max-height:min(600px,80vh);overflow-y:auto;padding:16px}.col-width-row{display:flex;align-items:center;gap:8px;margin-bottom:4px;width:100%}.border-row{display:flex;gap:10px}.border-row .pd-field{flex:1;min-width:0}.advanced-row{display:flex;gap:16px}.group-help{flex:0 0 auto;width:18px;height:18px;margin-right:6px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--pd-text-muted, #8b909c);font-size:12px;line-height:18px;cursor:pointer}.group-help:hover{background:var(--pd-accent-soft, rgba(22, 93, 255, .09));color:var(--pd-accent, #165DFF)}.group-help:focus-visible{outline:2px solid var(--pd-accent, #165DFF);outline-offset:1px}.image-content-upload{display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-top:4px}.upload-tip{margin:0;font-size:11px;color:var(--pd-text-muted, #909399)}.cell-style-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 8px}.cell-font-field{grid-column:1 / -1;padding-bottom:8px}.border-style-row{display:flex;gap:6px;margin-bottom:8px}.border-presets{margin-bottom:8px}.merge-btns{display:flex;gap:8px}.merge-card{margin-top:8px;padding:8px;border:1px solid var(--pd-border, #dcdfe6);border-radius:6px}.merge-card-title{font-size:12px;font-weight:600;color:var(--pd-text, #303133);margin-bottom:8px}.merge-card-divider{height:1px;background:var(--pd-menu-divider, #ebeef5);margin:8px 0}.merge-card-hint{margin-top:6px;font-size:11px;line-height:1.4;color:var(--pd-text-muted, #8b909c)}.watermark-config{padding:0 4px}.pd-hint{margin-left:8px;font-size:12px;color:#909399;min-width:32px}.design-background-config{padding:0 4px}.design-background-tip{margin:2px 0 6px;font-size:11px;line-height:1.4;color:var(--pd-text-muted, #909399)}.design-background-path{margin-bottom:6px;padding:4px 6px;font-size:11px;color:var(--pd-text-regular, #606266);background:var(--pd-fill-light, #f5f7fa);border-radius:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.design-background-actions{display:flex;gap:6px}.upload-label{cursor:pointer}.upload-label.disabled{opacity:.6;cursor:not-allowed}.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.tiling-config{padding:0 4px}.tiling-switch{display:flex;align-items:center;gap:6px;font-size:12px;cursor:pointer}.tiling-error{color:#f56c6c}.tiling-summary{color:var(--pd-text-regular, #606266)}.property-panel{width:304px;min-width:304px;background:var(--pd-sidebar, #ffffff);border-left:1px solid var(--pd-border-soft, #e9ecf2);display:flex;flex-direction:column;overflow:hidden;transition:width .18s ease}.property-panel.collapsed{width:36px;min-width:36px;border-left:1px solid var(--pd-border-soft, #e9ecf2)}.prop-collapsed{display:flex;flex-direction:column;align-items:center;gap:8px;padding-top:12px;flex:1}.pc-btn{width:26px;height:26px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--pd-text-muted, #8b909c);font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .14s ease}.pc-btn:hover{color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.pc-btn.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.prop-head{display:flex;align-items:center;justify-content:space-between;height:42px;padding:0 12px;flex-shrink:0;border-bottom:1px solid var(--pd-border-soft, #e9ecf2)}.prop-title{font-size:12px;font-weight:600;color:var(--pd-text, #2a2e37);letter-spacing:1.2px;display:inline-flex;align-items:center;gap:7px}.prop-title:before{content:"";width:3px;height:12px;border-radius:2px;background:linear-gradient(180deg,var(--pd-accent-2, #3D7BFF),var(--pd-accent, #165DFF))}.collapse-btn{border:none;background:transparent;color:var(--pd-text-muted, #8b909c);font-size:14px;cursor:pointer;width:24px;height:24px;border-radius:5px;transition:all .14s ease}.collapse-btn:hover{color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.prop-tabs{flex:1;display:flex;flex-direction:column;overflow:hidden}.prop-tabs .pd-tab-pane{flex:1;min-height:0;overflow-y:auto;padding:12px}.property-content{padding:0}.margin-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}.custom-size-grid{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:4px;width:100%}.custom-size-x{color:var(--pd-text-muted, #8b909c);font-size:12px}.pd-hint{margin:2px 0 6px;color:var(--pd-text-muted, #8b909c);font-size:12px;line-height:1.4}.page-bg-row{display:flex;align-items:center;gap:8px}.page-bg-picker{flex:1;min-width:0}.status-bar{position:relative;display:flex;align-items:center;gap:20px;height:30px;padding:0 16px;background:var(--pd-surface, #ffffff);border-top:1px solid var(--pd-border-soft, #e9ecf2);box-shadow:0 -1px 2px #17203c08;font-size:11.5px;color:var(--pd-text-muted, #8b909c);-webkit-user-select:none;user-select:none;flex-shrink:0}.status-item{white-space:nowrap;font-variant-numeric:tabular-nums;display:inline-flex;align-items:center}.coord{font-variant-numeric:tabular-nums;color:var(--pd-text, #2a2e37)}.status-paper{margin-left:auto;font-variant-numeric:tabular-nums;color:var(--pd-accent, #165DFF);font-weight:600}.status-version{font-variant-numeric:tabular-nums;color:var(--pd-text-muted, #8b909c)}.help-modal-overlay{position:fixed;inset:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:1000}.help-modal{width:800px;max-width:90vw;height:600px;max-height:85vh;background:var(--pd-surface, #ffffff);border-radius:8px;box-shadow:0 4px 24px #00000026;display:flex;flex-direction:column;overflow:hidden}.help-modal-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--pd-border, #d9dde6)}.help-modal-title{margin:0;font-size:16px;font-weight:600;color:var(--pd-text, #2a2e37)}.help-modal-title-wrap{display:flex;align-items:center;gap:10px}.help-modal-project{padding:2px 8px;border-radius:4px;background:var(--pd-accent-soft, rgba(22, 93, 255, .09));color:var(--pd-accent, #165DFF);font-size:12px;font-weight:500}.help-modal-close{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:4px;background:transparent;color:var(--pd-text-muted, #8b909c);font-size:20px;cursor:pointer;transition:all .15s}.help-modal-close:hover{background:var(--pd-sidebar-hover, #f0f3f9);color:var(--pd-text, #2a2e37)}.help-modal-body{flex:1;display:flex;overflow:hidden}.help-modal-sidebar{width:160px;padding:12px;border-right:1px solid var(--pd-border, #d9dde6);background:var(--pd-field-bg, #f4f6fa);overflow-y:auto}.help-tab{display:block;width:100%;padding:10px 12px;margin-bottom:4px;border:none;border-radius:4px;background:transparent;color:var(--pd-text, #2a2e37);font-size:13px;text-align:left;cursor:pointer;transition:all .15s}.help-tab:hover{background:var(--pd-sidebar-hover, #f0f3f9)}.help-tab.active{background:var(--pd-accent-soft, rgba(22, 93, 255, .09));color:var(--pd-accent, #165DFF);font-weight:500}.help-modal-content{flex:1;padding:20px;overflow-y:auto}.help-content{font-size:14px;line-height:1.6;color:var(--pd-text, #2a2e37)}.help-content h2{margin:0 0 16px;padding-bottom:8px;border-bottom:1px solid var(--pd-border-soft, #e9ecf2);font-size:18px;font-weight:600}.help-content h3{margin:20px 0 12px;font-size:15px;font-weight:600}.help-content p{margin:0 0 12px}.help-content ul,.help-content ol{margin:0 0 12px;padding-left:24px}.help-content li{margin-bottom:4px}.help-content code{padding:2px 6px;border-radius:3px;background:var(--pd-field-bg, #f4f6fa);font-family:SF Mono,Monaco,monospace;font-size:13px}.help-content pre{margin:0 0 12px;padding:12px;border-radius:4px;background:var(--pd-field-bg, #f4f6fa);overflow-x:auto}.help-content pre code{padding:0;background:transparent}.help-content table{width:100%;margin:0 0 12px;border-collapse:collapse}.help-content th,.help-content td{padding:8px 12px;border:1px solid var(--pd-border, #d9dde6);text-align:left}.help-content th{background:var(--pd-field-bg, #f4f6fa);font-weight:600}.help-content blockquote{margin:0 0 12px;padding:12px 16px;border-left:3px solid var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.help-modal-enter-active,.help-modal-leave-active{transition:opacity .2s ease}.help-modal-enter-active .help-modal,.help-modal-leave-active .help-modal{transition:transform .2s ease}.help-modal-enter-from,.help-modal-leave-to{opacity:0}.help-modal-enter-from .help-modal,.help-modal-leave-to .help-modal{transform:scale(.95)}.page-tabs{display:flex;align-items:center;gap:8px;padding:4px 12px;background:var(--pd-sidebar, #fff);border-bottom:1px solid var(--pd-border, #d9dde6);flex-shrink:0}.page-tabs-list{display:flex;gap:4px;overflow-x:auto;align-items:center}.page-tab{padding:4px 12px;border:1px solid var(--pd-border, #d9dde6);border-radius:4px;background:transparent;cursor:pointer;white-space:nowrap;color:var(--pd-text, #2a2e37);font-size:12px}.page-tab.active{background:var(--pd-accent, #165DFF);color:#fff}.page-tab-rename{padding:4px 8px;width:96px;border:1px solid var(--pd-accent, #165DFF);border-radius:4px;font-size:12px;color:var(--pd-text, #2a2e37);outline:none}.page-tabs-actions{display:flex;gap:4px;margin-left:auto}.page-tabs-actions button{padding:4px 8px;border:1px solid var(--pd-border, #d9dde6);border-radius:4px;background:transparent;cursor:pointer;color:var(--pd-text-muted, #8b909c);font-size:12px;line-height:1}.page-tabs-actions button:disabled{opacity:.4;cursor:not-allowed}.designer-container{--pd-bg: #f3f5f9;--pd-surface: #ffffff;--pd-field-bg: #f4f6fa;--pd-sidebar: #ffffff;--pd-sidebar-hover: #f0f3f9;--pd-canvas-bg: #e6e9f0;--pd-paper: #FFFFFF;--pd-accent: #165DFF;--pd-accent-2: #3D7BFF;--pd-accent-soft: rgba(22, 93, 255, .09);--pd-accent-secondary: #f56c6c;--pd-danger-soft: rgba(245, 108, 108, .1);--pd-ink-green: #67c23a;--pd-text: #2a2e37;--pd-text-muted: #8b909c;--pd-text-faint: #b4b9c4;--pd-border: #d9dde6;--pd-border-soft: #e9ecf2;--pd-input-bg: #ffffff;--pd-hover-tint: #ecf5ff;--pd-danger: #e53e3e;--pd-danger-bg: #fef2f2;--pd-danger-border: #fecaca;--pd-menu-text: #333;--pd-menu-hover: #f5f7fa;--pd-menu-border: #dcdfe6;--pd-menu-divider: #ebeef5;--pd-menu-muted: #909399;--pd-menu-disabled: #c0c4cc;--pd-scrollbar: rgba(23, 32, 60, .18);--pd-scrollbar-thumb: rgba(23, 32, 60, .16);--pd-scrollbar-thumb-hover: rgba(23, 32, 60, .3);--pd-help-field-bg: #f0f9ff;--pd-help-field-line: #bae6fd;--pd-help-field-ink: #0369a1;--pd-help-function-bg: #f0fdf4;--pd-help-function-line: #bbf7d0;--pd-help-function-ink: #166534;--pd-help-variable-bg: #fefce8;--pd-help-variable-line: #fde68a;--pd-help-variable-ink: #854d0e;--pd-help-conditional-bg: #fdf2f8;--pd-help-conditional-line: #fbcfe8;--pd-help-conditional-ink: #9d174d;--pd-handle: #165DFF;--pd-ruler: #9aa1af;--pd-ruler-bg: #f8f9fc;--pd-ruler-cursor: #165DFF;--pd-radius: 6px;--pd-shadow-sm: 0 1px 2px rgba(23, 32, 60, .05);--pd-shadow-md: 0 2px 8px rgba(23, 32, 60, .06), 0 10px 28px rgba(23, 32, 60, .07);--pd-shadow-paper: 0 0 0 1px rgba(23, 32, 60, .05), 0 1px 2px rgba(23, 32, 60, .06), 0 8px 20px rgba(23, 32, 60, .08), 0 26px 60px rgba(23, 32, 60, .15);--pd-success: #16a34a;--pd-text-regular: #606266;--pd-fill-light: #f5f7fa;height:100%;display:flex;flex-direction:column;background:var(--pd-bg)}.designer-body{flex:1;display:flex;overflow:hidden}.designer-container.format-painting .canvas-area,.designer-container.format-painting .canvas-area *{cursor:copy!important}.print-html-preview{width:100%;height:100%;position:relative;background:#e9ebee}.print-html-preview-iframe{width:100%;height:100%;border:0;background:#fff}.print-html-preview-loading,.print-html-preview-error{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#909399;font-size:14px}.print-html-preview-error{color:#f56c6c}.print-html-preview-warn{position:absolute;top:8px;left:12px;z-index:2;max-width:62%;padding:4px 8px;border:1px solid #e6a23c;border-radius:4px;background:#faecd1f0;color:#b88230;font-size:12px;line-height:1.5}.print-html-preview-zoom{position:absolute;top:8px;right:12px;z-index:2;display:flex;align-items:center;gap:4px;padding:3px 4px;border:1px solid var(--pd-border-soft, #ebeef5);border-radius:6px;background:#ffffffeb;box-shadow:0 1px 4px #00000014}.print-html-preview-zoom-btn{padding:2px 7px;border:0;border-radius:4px;background:transparent;color:var(--pd-text-muted, #909399);font-size:11px;line-height:18px;cursor:pointer;transition:color .14s ease,background .14s ease}.print-html-preview-zoom-btn:hover{background:var(--pd-sidebar-hover, #f0f3f9);color:var(--pd-text, #2a2e37)}.print-html-preview-zoom-btn.active{background:var(--pd-accent, #165DFF);color:#fff;font-weight:600}.print-html-preview-zoom-note{padding-right:4px;color:var(--pd-text-muted, #909399);font-size:11px}.print-html-preview-zoom-hint{color:#b88230;font-size:11px}.advanced-row{display:flex;flex-direction:column;gap:10px}.advanced-row .pd-label,.advanced-row .pd-label-t{white-space:nowrap}.tiling-config .margin-grid,.tiling-config .custom-size-grid{display:block;grid-template-columns:none;gap:normal}.tiling-config .custom-size-x{display:inline;min-width:0;color:inherit}.pd-hint{min-width:auto}.watermark-config .pd-hint{min-width:32px;margin-left:8px;color:#909399}.tiling-config .tiling-error{color:#f56c6c}.tiling-config .tiling-summary{color:var(--pd-text-regular, #606266)}.pd-help{position:static}.pd-help:after{top:calc(100% + 6px);bottom:auto;left:0;transform:none;padding:5px 7px;white-space:normal;z-index:120}.page-tabs [data-tip]:after,.field-tree-panel [data-tip]:after{content:none}',va=20;function fg(e){try{const t=JSON.parse(e);if(t&&typeof t=="object"&&!Array.isArray(t))return t}catch{}}const J3=".page-tabs, .field-tree-panel, .pd-dialog-overlay",Q3=new Set(["z","y","a","c","x","v","d","g","1","l","r","e","t","b","0"]),hg="print-studio:left",mg="print-studio:right";function gg(e){try{return localStorage.getItem(e)==="1"}catch{return!1}}function bg(e,t){try{localStorage.setItem(e,t?"1":"0")}catch{}}function up(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return}if(Array.isArray(t))return t.filter(r=>!!r&&typeof r=="object"&&!Array.isArray(r));if(t&&typeof t=="object")return[t]}class Zt extends HTMLElement{root;store;format;unsub=null;unsubPluginUI=null;unsubDefinitions=null;pluginStyleEls=new Map;instanceDisposers=[];_lang;_messages;unsubI18n=null;measureRaf=null;state={leftTab:"elements",leftCollapsed:!1,propTab:"page",propCollapsed:!1,openDd:null,openMore:!1,collapsedGroups:new Set,renamingPage:null,fieldDisplay:"both"};geom={originX:0,originY:0,viewW:0,viewH:0,paperScale:1};static active=null;docKeydown=null;docDragend=null;ro=null;roArea=null;toolbarRo=null;scrollPos={x:0,y:0};paneScroll=new Map;marquee={visible:!1,x:0,y:0,w:0,h:0};menu={visible:!1,x:0,y:0,flipX:0,flipY:0,targetId:null};guidePreview=null;zoneResizing=null;tableMenu={visible:!1,x:0,y:0};exprTarget=null;exprMountedFor=null;helpVisible=!1;helpInitialTab;unmountHelp=null;drag=null;snapTimer=null;hoverTipEl=null;hoverTipTimer=null;resize=null;raf=0;lastSelKey="";chromeKey="";_theme="auto";_themeConfig;systemDark=!1;themeMedia=null;onThemeMediaChange=()=>{this.systemDark=this.themeMedia?.matches??!1,this.applyTheme()};appliedThemeTokens=[];uploadImage;uploadDesignBackground;_designData;set designData(t){this._designData=up(t),this.repaint()}get designData(){return this._designData}_fonts;set fonts(t){this._fonts=t,this.applyFontFace(),this.repaint()}get fonts(){return this._fonts}fontFaceStyle=null;docFontFaceStyle=null;constructor(){super(),this.root=this.attachShadow({mode:"open"});const t=document.createElement("style");t.textContent=Z3,this.root.appendChild(t),rt(g("div",{class:"designer-container",dataset:{test:"designer-container"},part:"container"}),this.root)}set template(t){this.applyTemplate(t)}get template(){return this.store?.getTemplateJson()}set fields(t){this.store.fields=(typeof t=="string"?JSON.parse(t):t)??[],this.repaint()}set isEdit(t){this.setAttribute("is-edit",String(t)),this.repaint()}set showHelp(t){this.setAttribute("show-help",String(t)),t||this.closeHelp(),this.repaint()}set showPreview(t){this.setAttribute("show-preview",String(t)),this.repaint()}set showSave(t){this.setAttribute("show-save",String(t)),this.repaint()}set fieldDisplay(t){const r=ka(t);this.state.fieldDisplay=r,this.getAttribute("field-display")!==r&&this.setAttribute("field-display",r),this.repaint()}get fieldDisplay(){return this.state.fieldDisplay??"both"}set lang(t){this._lang=t?sn(t):void 0,t===void 0?this.hasAttribute("lang")&&this.removeAttribute("lang"):this.getAttribute("lang")!==this._lang&&this.setAttribute("lang",this._lang),this.helpVisible&&this.unmountHelp&&(this.unmountHelp(),this.unmountHelp=null),this.repaint()}get lang(){return this._lang??M2()}set messages(t){this._messages=t,this.repaint()}setLocale(t){this.lang=sn(t)}set theme(t){const r=t==="dark"||t==="light"?t:"auto";this._theme=r,this.setAttribute("theme",r),this.applyTheme()}get theme(){return this._theme}set themeConfig(t){const r=typeof t=="string"?fg(t):t;this._themeConfig=r,r===void 0?this.removeAttribute("theme-config"):this.setAttribute("theme-config",JSON.stringify(r)),this.applyTheme()}get themeConfig(){return this._themeConfig}static contractVersion=Dl;static getHostContract(){return Rl()}getHostContract(){return Rl()}static get observedAttributes(){return[...Al]}attributeChangedCallback(t,r,o){if(t==="design-data"){this._designData=o===null?void 0:up(o),this.repaint();return}if(t==="theme"){this._theme=o==="dark"||o==="light"?o:"auto",this.applyTheme();return}if(t==="theme-config"){this._themeConfig=o?fg(o):void 0,this.applyTheme();return}if(t==="field-display"){this.state.fieldDisplay=ka(o),this.repaint();return}if(t==="lang"){this.lang=o??void 0;return}if(!o)return;if(t==="name"){this.repaint();return}let n;try{n=JSON.parse(o)}catch{return}t==="template"?this.applyTemplate(n):t==="fields"?(this.store.fields=n,this.repaint()):t==="fonts"&&Array.isArray(n)&&(this.fonts=n)}connectedCallback(){if(this.attachThemeMedia(),this.applyTheme(),this.store){this.applyFontFace(),this.attachDocKeys(),this.attachPluginUI(),this.attachInstanceListeners(),this.unsubI18n=_h(()=>{this._lang||this.repaint()});return}const t={},r=this.getAttribute("template");if(r)try{t.initialTemplate=JSON.parse(r)}catch{}const o=this.getAttribute("fields");if(o)try{t.initialFields=JSON.parse(o)}catch{}const n=this.getAttribute("design-data");n&&this._designData===void 0&&(this._designData=up(n)),this.store=new Nh(t),this.format=new U2(this.store),this.store.onSelectionChanged=()=>this.format.painterSyncSelection(),this.state.fieldDisplay=ka(this.getAttribute("field-display")),this.readChrome(),this.unsub=this.store.subscribe(()=>this.repaint()),this.unsubI18n=_h(()=>{this._lang||this.repaint()}),this.attachDocKeys(),this.attachPluginUI(),this.attachInstanceListeners(),this.applyFontFace(),this.repaint(),this.measureRaf=requestAnimationFrame(()=>{this.measureRaf=null,this.measureRuler()})}attachThemeMedia(){typeof window>"u"||typeof window.matchMedia!="function"||(this.detachThemeMedia(),this.themeMedia=window.matchMedia("(prefers-color-scheme: dark)"),this.systemDark=this.themeMedia.matches,this.themeMedia.addEventListener("change",this.onThemeMediaChange))}detachThemeMedia(){this.themeMedia?.removeEventListener("change",this.onThemeMediaChange),this.themeMedia=null}applyTheme(){const t=this.root.querySelector(".designer-container");if(!t)return;for(const n of this.appliedThemeTokens)t.style.removeProperty(n);if(this.appliedThemeTokens=[],(this._theme==="dark"||this._theme==="light"?this._theme:this.systemDark?"dark":"light")==="dark")for(const[n,i]of Object.entries(fw))i!==void 0&&(t.style.setProperty(n,i),this.appliedThemeTokens.push(n));const o=this._themeConfig?.overrides;if(o)for(const[n,i]of Object.entries(o))!n.startsWith("--pd-")||typeof i!="string"||(t.style.setProperty(n,i),this.appliedThemeTokens.includes(n)||this.appliedThemeTokens.push(n))}readChrome(){this.state.leftCollapsed=gg(hg),this.state.propCollapsed=gg(mg),this.chromeKey=`${this.state.leftCollapsed?1:0}|${this.state.propCollapsed?1:0}`}persistChrome(){const t=`${this.state.leftCollapsed?1:0}|${this.state.propCollapsed?1:0}`;t!==this.chromeKey&&(this.chromeKey=t,bg(hg,this.state.leftCollapsed),bg(mg,this.state.propCollapsed))}disconnectedCallback(){this.detachThemeMedia(),this.unsub?.(),this.unsub=null,this.unsubI18n?.(),this.unsubI18n=null,this.unsubPluginUI?.(),this.unsubPluginUI=null,this.unsubDefinitions?.(),this.unsubDefinitions=null,Em(),this.detachDocKeys(),this.ro?.disconnect(),this.ro=null,this.roArea=null,this.toolbarRo?.disconnect(),this.toolbarRo=null,Zt.active===this&&(Zt.active=null),Nm(),this.unmountHelp?.(),this.unmountHelp=null,this.hideHoverTip(),this.snapTimer&&(clearTimeout(this.snapTimer),this.snapTimer=null);for(const t of this.instanceDisposers)t();this.instanceDisposers=[],this.docFontFaceStyle?.remove(),this.docFontFaceStyle=null,this.measureRaf!==null&&(cancelAnimationFrame(this.measureRaf),this.measureRaf=null)}applyFontFace(){const t=Uo(this._fonts);if(!t){this.fontFaceStyle?.remove(),this.fontFaceStyle=null,this.docFontFaceStyle?.remove(),this.docFontFaceStyle=null;return}this.fontFaceStyle||(this.fontFaceStyle=document.createElement("style"),this.root.appendChild(this.fontFaceStyle)),this.fontFaceStyle.textContent=t,this.docFontFaceStyle||(this.docFontFaceStyle=document.createElement("style"),this.ownerDocument.head.appendChild(this.docFontFaceStyle)),this.docFontFaceStyle.textContent=t}attachPluginUI(){this.unsubPluginUI||(this.unsubPluginUI=O2(()=>this.repaint())),this.unsubDefinitions||(this.unsubDefinitions=jh(()=>this.repaint()))}syncPluginUIStyles(){const t=new Map;for(const{type:r,ui:o}of A2())o.styles&&t.set(r,o.styles);for(const[r,o]of[...this.pluginStyleEls])t.has(r)||(o.remove(),this.pluginStyleEls.delete(r));for(const[r,o]of t){let n=this.pluginStyleEls.get(r);n||(n=document.createElement("style"),n.setAttribute("data-plugin-ui",r),this.root.appendChild(n),this.pluginStyleEls.set(r,n)),n.textContent!==o&&(n.textContent=o)}}templateJsonWithFonts(){const t=JSON.parse(this.store.getTemplateJson()),r=this.fonts;if(!r?.length)return t;if(Array.isArray(t.pages)){const o=t;return{...o,pages:o.pages.map(n=>({...n,fonts:[...r]}))}}return{...t,fonts:[...r]}}getTemplateJson(){return JSON.stringify(this.templateJsonWithFonts())}loadTemplate(t){this.applyTemplate(t)}save(){const t=this.validateTemplate();if(t.length){window.alert(t[0].message),this.state.propTab="page",this.repaint();return}const r=this.templateJsonWithFonts();if(Array.isArray(r.pages))try{zs(r)}catch(i){window.alert(i instanceof Error?i.message:String(i));return}const o=this.getGeometryWarnings();if(o.length&&!window.confirm((this.ctx.t??lr)("save.geometryWarningConfirm",{warnings:o.join(`
2255
- `)})))return;const n=JSON.stringify(r);this.store.dirty=!1,this.repaint(),this.dispatchEvent(new CustomEvent(Ct.save,{detail:n,bubbles:!0,composed:!0}))}validateTemplate(){const t=this.store.templateData;return t.tiling?.enabled===!0?Fs(t):[]}getGeometryWarnings(){return ry(this.store.templateData)}applyTemplate(t){if(!t)return;const r=typeof t=="string"?JSON.parse(t):t;this.store?this.store.loadTemplate(r):this.setAttribute("template",JSON.stringify(r))}openExpression(t){this.exprTarget=t,this.syncExpression()}closeExpression(){this.exprTarget=null,this.syncExpression()}syncExpression(){const t=Array.from(this.root.querySelectorAll(".pd-dialog-overlay"));if(!this.exprTarget){t.forEach(o=>o.remove()),this.exprMountedFor=null;return}if(this.exprMountedFor===this.exprTarget)return;t.forEach(o=>o.remove());const r=this.exprTarget;rt(y3({fields:this.store.fields,fieldDisplay:this.state.fieldDisplay,t:this.ctx.t,onClose:()=>this.closeExpression(),onApply:o=>this.applyExpression(r,o)},r),this.root),this.exprMountedFor=r}openHelp(t){this.helpInitialTab=t,this.helpVisible=!0,this.syncHelp()}closeHelp(){this.helpVisible&&(this.helpVisible=!1,this.syncHelp())}syncHelp(){const t=this.helpVisible&&this.getAttribute("show-help")!=="false";if(t&&!this.unmountHelp)this.unmountHelp=W3(this.root,{initialTab:this.helpInitialTab,locale:this.lang,t:ta(this.lang,this._messages),onClose:()=>this.closeHelp()});else if(!t&&this.unmountHelp){const r=this.unmountHelp;this.unmountHelp=null,r()}}applyExpression(t,r){const o=r.formatter??"",n=t.targetPath;if(n.startsWith("options.")){if(n.includes("[")){const a=this.store.elements.find(s=>s.id===t.elementId);a&&rp(this.store,a,n,o);return}const i={[n.slice(8)]:o||void 0};r.title!==void 0&&(i.title=r.title),this.store.updateElement(t.elementId,i);return}if(n==="watermark.content"){const i={...this.store.templateData.watermark};ap(o)?Object.assign(i,{mode:"binding",binding:o,content:""}):Object.assign(i,{mode:"fixed",content:o,binding:""}),this.store.updateTemplateData({watermark:i})}}dblEditElement(t){const r=this.store.elements.find(n=>n.id===t);if(!r||(this.store.selectOne(t),this.state.propTab=_l(r)?"custom":"element",r.options.locked))return;const o=Yh(r.printElementType.type);o&&this.openExpression({elementId:r.id,targetPath:`options.${o}`,value:String(r.options[o]??"")})}dblEditCell(t){const r=this.store.elements.find(s=>s.id===t.elementId);if(!r||(this.store.selectOne(r.id),this.state.propTab="element",r.options.locked))return;const o=r.options.tableRows??[],n=Po(o,t.r,t.c),a=o[n.r]?.cells[n.c];a&&this.openExpression({elementId:r.id,targetPath:`options.tableRows[${n.r}].cells[${n.c}].formatter`,value:a.formatter??""})}get ctx(){return{store:this.store,format:this.format,state:this.state,repaint:()=>this.repaint(),fire:(t,r)=>this.fire(t,r),showHelp:this.getAttribute("show-help")!=="false",showPreview:this.getAttribute("show-preview")!=="false",showSave:this.getAttribute("show-save")!=="false",isEdit:this.getAttribute("is-edit")==="true",t:ta(this.lang,this._messages),lang:this.lang,host:{uploadImage:this.uploadImage,uploadDesignBackground:this.uploadDesignBackground,fonts:this.fonts,designData:this.designData,fields:this.store.fields}}}canvasUi(){return{geom:this.geom,marquee:this.marquee,contextMenu:this.menu,guidePreview:this.guidePreview,zoneResizing:this.zoneResizing,scrollX:this.scrollPos.x,scrollY:this.scrollPos.y}}repaint(){this.raf||(this.raf=requestAnimationFrame(()=>{this.raf=0,this.paint()}))}paint(){nw(ta(this.lang,this._messages),()=>this.paintInternal())}paintInternal(){if(!this.store)return;Em(),this.syncPluginUIStyles();const t=[...this.store.selectedIds].join(",");if(t!==this.lastSelKey){this.lastSelKey=t;const a=this.store.selectedElement;this.state.propTab=a?_l(a)?"custom":"element":"page"}const r=this.root.querySelector(".designer-container");r.classList.toggle("format-painting",this.format.painterActive);for(const a of r.querySelectorAll("[data-pane]"))a.style.display!=="none"&&this.paneScroll.set(a.dataset.pane,a.scrollTop);Oh(r);const o=this.ctx;rt(Y3(o,hP(o)),r),rt(PP(o),r),rt(g("div",{class:"designer-body"},[gP(o),dP(o,this.canvasUi()),n3(o)]),r),rt(EP(o),r),pg(r),!this.toolbarRo&&typeof ResizeObserver<"u"&&(this.toolbarRo=new ResizeObserver(()=>pg(r)),this.toolbarRo.observe(r));const n=Ix(this.store,(a,s)=>this.fire(a,s),this.tableMenu);n&&rt(n,r),ix(this.root,this.store.elements,this.designData),Xm(this.root,this.state.propSearch),this.applyShrinkFit();const i=this.root.querySelector(".canvas-area");i&&(i.scrollLeft=this.scrollPos.x,i.scrollTop=this.scrollPos.y);for(const a of r.querySelectorAll("[data-pane]")){const s=this.paneScroll.get(a.dataset.pane);s!==void 0&&(a.scrollTop=s)}this.syncRulers(),this.persistChrome(),this.applyHostParts(r)}applyHostParts(t){const r={".designer-toolbar":"toolbar",".format-toolbar":"format-bar",".left-panel":"left-panel",".canvas-area":"canvas-area",".property-panel":"property-panel",".status-bar":"status-bar",".page-tabs":"page-tabs"};for(const[o,n]of Object.entries(r)){const i=t.querySelector(o);i&&Ol.includes(n)&&i.setAttribute("part",n)}}applyShrinkFit(){for(const t of Array.from(this.root.querySelectorAll('[data-fit="shrink"]')))Ph(t);for(const t of Array.from(this.root.querySelectorAll("[data-fit-size]"))){if(t.getAttribute("data-fit")==="shrink")continue;t.removeAttribute("data-fit-size");const r=t.getAttribute("data-fit-base");r?t.style.fontSize=`${r}pt`:t.style.removeProperty("font-size")}}measureRuler(){const t=this.root.querySelector(".canvas-area"),r=this.root.querySelector(".hiprint-printPaper");if(!t||!r)return;const o=t.getBoundingClientRect(),n=r.getBoundingClientRect(),i=(this.store.scale||100)/100,a=n.width/vr(this.store.paperSize.width);this.geom={paperScale:Math.abs(a-i)<.002?i:a,originX:n.left-o.left-va,originY:n.top-o.top-va,viewW:t.clientWidth-va,viewH:t.clientHeight-va},this.observeCanvasArea()}observeCanvasArea(){const t=this.root.querySelector(".canvas-area");!t||typeof ResizeObserver>"u"||this.roArea===t||(this.roArea=t,this.ro?.disconnect(),this.ro=new ResizeObserver(()=>this.syncRulers()),this.ro.observe(t))}syncRulers(){this.measureRuler();const t=this.store.templateData,r=ir(t),o=this.geom.paperScale;for(const n of Array.from(this.root.querySelectorAll(".pd-ruler"))){const i=n.dataset.ruler==="vertical"?"vertical":"horizontal";X3(n,{orientation:i,geom:this.geom,scale:o,paperLengthMM:i==="horizontal"?r.width:r.height})}}patchElementDom(){for(const o of this.store.elements){const n=this.root.querySelector(`[data-el-id="${CSS.escape(o.id)}"]`);n&&(n.style.left=`${o.options.left}mm`,n.style.top=`${o.options.top}mm`,n.style.width=`${o.options.width}mm`,n.style.height=`${o.options.height}mm`)}const t=this.root.querySelector(".position-label"),r=this.store.selectedElement;t&&r&&!this.drag&&(t.textContent=Um(r.options))}fire(t,r){const o=this.store;switch(t){case"undo":o.undo();break;case"redo":o.redo();break;case"align":o.alignSelected(r);break;case"move-layer":o.moveLayer(r);break;case"group":o.groupSelected();break;case"ungroup":o.ungroupSelected();break;case"copy":o.copy();break;case"cut":o.cutSelected();break;case"paste":o.paste();break;case"paste-at":o.paste();break;case"delete":o.deleteSelected();break;case"delete-page":o.deletePage(o.activePageIndex);break;case"add-page":o.addPage();break;case"duplicate-page":o.duplicatePage(o.activePageIndex);break;case"move-page":o.movePage(o.activePageIndex,o.activePageIndex+r);break;case"select-all":o.selectAll();break;case"clear-selection":o.clearSelection();break;case"toggle-ruler":o.showRuler=!o.showRuler,this.repaint();break;case"toggle-grid":o.showGrid=!o.showGrid,this.repaint();break;case"toggle-snap":o.snapToGrid=!o.snapToGrid,this.repaint();break;case"toggle-table-ghost-border":o.showTableGhostBorder=!o.showTableGhostBorder,this.repaint();break;case"fit-window":this.fitToWindow();break;case"zoom":this.zoomByStep(r>0?1:-1);break;case"preview":this.dispatchEvent(new CustomEvent(Ct.preview,{detail:this.getTemplateJson(),bubbles:!0,composed:!0}));break;case"save":this.save();break;case"help":this.dispatchEvent(new CustomEvent(Ct.help,{bubbles:!0,composed:!0})),this.openHelp(r);break;case"guide-remove":o.removeGuide(r);break;case"resize-start":this.beginResize(r);break;case"element-mousedown":{const n=r;n.event.button===0&&this.isDoubleTap(`el:${n.id}`,n.event)&&this.fire("element-dblclick",{event:n.event,id:n.id}),this.beginDrag(n);break}case"table-cell-mousedown":{const n=r;this.isDoubleTap(`cell:${n.elementId}:${n.r}:${n.c}`,n.event)&&(this.taps.delete(`el:${n.elementId}`),this.fire("table-cell-dblclick",{elementId:n.elementId,r:n.r,c:n.c,cellId:n.cellId}));break}case"zone-resize":this.beginZoneResize(r);break;case"guide-mousedown":this.beginGuideDrag(r);break;case"ruler-mousedown":this.beginRulerGuide(r);break;case"canvas-mousedown":this.onCanvasMouseDown(r);break;case"canvas-mousemove":this.onCanvasMouseMove(r);break;case"canvas-mouseleave":this.clearCoord();break;case"canvas-contextmenu":this.onContextMenu(r);break;case"contextmenu":this.onElementContextMenu(r);break;case"element-dblclick":{const{id:n}=r;this.dblEditElement(n),this.dispatchEvent(new CustomEvent(Ct.dblclickElement,{detail:n,bubbles:!0,composed:!0}));break}case"table-cell-dblclick":{const n=r;this.dblEditCell(n),this.dispatchEvent(new CustomEvent(Ct.dblclickCell,{detail:{elementId:n.elementId,r:n.r,c:n.c,cellId:n.cellId},bubbles:!0,composed:!0}));break}case"open-expression":this.openExpression(r);break;case"drop":this.onDrop(r);break;case"wheel":this.onWheel(r);break;case"scroll":this.onScroll();break}}onDrop(t){t.preventDefault();const r=t.dataTransfer,o=r?.getData("elementType"),n=r?.getData("fieldKey"),i=this.pointToPaperMm(t);if(!i)return;const a={x:i.left,y:i.top};if(o)this.store.addElement(o,{},a);else if(n){const s=this.store.fields.find(p=>p.fieldKey===n);s&&this.store.addFieldElement(s,{},a,t.ctrlKey||t.metaKey||t.labelIntent===!0)}}pointToPaperMm(t){const r=this.root.querySelector(".hiprint-printPaper");if(!r)return null;const o=r.getBoundingClientRect(),n=(this.store.scale||100)/100,i=In((t.clientX-o.left)/n),a=In((t.clientY-o.top)/n);return i<0||a<0?null:{left:i,top:a}}onCanvasMouseDown(t){const r=t.target;(r===this.root.querySelector(".canvas-area")||["canvas-scroll","hiprint-printPaper","hiprint-printPaper-content","zone-layer","grid-bg","watermark-layer"].some(n=>r.classList.contains(n)))&&(this.menu.visible=!1,this.state.openDd&&(this.state.openDd=null,this.repaint()),this.state.openMore&&(this.state.openMore=!1,this.repaint()),t.button===0&&(this.store.clearSelection(),this.startMarquee(t)))}onCanvasMouseMove(t){const r=this.pointToPaperMm(t),o=this.root.querySelector("[data-coord]");if(o){if(!r){o.style.display="none";return}o.style.display="",o.textContent=`x:${(r.left-this.store.templateData.margins.left).toFixed(1)} y:${(r.top-this.store.templateData.margins.top).toFixed(1)}mm`}}clearCoord(){const t=this.root.querySelector("[data-coord]");t&&(t.textContent="")}onContextMenu(t){this.openMenu(t,null)}onElementContextMenu(t){this.store.selectedIds.has(t.id)||this.store.selectOne(t.id),this.openMenu(t.event,t.id)}openMenu(t,r){this.menu.x=t.clientX,this.menu.y=t.clientY,this.menu.targetId=r,this.menu.visible=!0,this.menu.flipX=0,this.menu.flipY=0,this.repaint(),requestAnimationFrame(()=>{const o=this.root.querySelector(".context-menu");if(!o)return;const n=o.getBoundingClientRect();this.menu.flipX=n.right>window.innerWidth?window.innerWidth-n.right-8:0,this.menu.flipY=n.bottom>window.innerHeight?window.innerHeight-n.bottom-8:0,this.paint()})}startMarquee(t){const r={x:t.clientX,y:t.clientY},o=i=>{this.marquee={visible:!0,x:Math.min(r.x,i.clientX),y:Math.min(r.y,i.clientY),w:Math.abs(i.clientX-r.x),h:Math.abs(i.clientY-r.y)},this.paint()},n=()=>{window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",n);const i={...this.marquee};if(this.marquee={visible:!1,x:0,y:0,w:0,h:0},i.w>2&&i.h>2){const a=this.store.elements.filter(s=>{const p=this.root.querySelector(`[data-el-id="${CSS.escape(s.id)}"]`);if(!p)return!1;const l=p.getBoundingClientRect();return l.left<i.x+i.w&&l.right>i.x&&l.top<i.y+i.h&&l.bottom>i.y});this.store.select(new Set(a.map(s=>s.id)))}else this.repaint()};window.addEventListener("mousemove",o),window.addEventListener("mouseup",n)}taps=new Map;isDoubleTap(t,r){const o=this.taps.get(t);return this.taps.set(t,{t:r.timeStamp,x:r.clientX,y:r.clientY}),!o||r.timeStamp-o.t>=500||Math.abs(r.clientX-o.x)>6||Math.abs(r.clientY-o.y)>6?!1:(this.taps.delete(t),!0)}beginDrag(t){const r=t.event;if(r.button!==0)return;const o=this.store;r.stopPropagation();const n=o.elements.find(s=>s.id===t.id);if(!n||(o.selectElement(n.id,r.ctrlKey||r.metaKey),n.options.locked))return;const i=r.altKey?[n.id]:o.dragIds(n.id),a=new Map;for(const s of i){const p=o.elements.find(l=>l.id===s);p&&a.set(s,{left:p.options.left,top:p.options.top})}this.drag={ids:i,primary:n.id,altKey:r.altKey,movedPositions:new Map,startX:r.clientX,startY:r.clientY,origin:a,zone:n.zone||"content",moved:!1},o.draggingIds=new Set(i),o.dragStart(),this.syncDragGhost()}syncDragGhost(){const t=this.store.draggingIds;for(const r of Array.from(this.root.querySelectorAll(".print-element"))){const o=t.has(r.dataset.elId??"");r.classList.toggle("drag-ghost",o);const n=r.querySelector(":scope > .drag-preview");o&&!n?rt(g("div",{class:"drag-preview"}),r):!o&&n&&n.remove()}}finishAltClone(t){const r=this.store;r.adsorbGuides=[];const o=r.elements.find(a=>a.id===t.primary),n=t.movedPositions.get(t.primary);if(r.discardLive(),!o||!n)return;const i=JSON.parse(JSON.stringify(o));i.id=Xr(),i.options.left=n.left,i.options.top=n.top,i.options.groupId=void 0,r.cloneElement(i)}flashSnapIndicator(t,r){const o=this.root.querySelector(".hiprint-printPaper-content");o&&(o.querySelector(".snap-indicator")?.remove(),rt(g("div",{class:"snap-indicator",style:{left:`${t}mm`,top:`${r}mm`}}),o),this.snapTimer&&clearTimeout(this.snapTimer),this.snapTimer=setTimeout(()=>{o.querySelector(".snap-indicator")?.remove(),this.snapTimer=null},300))}beginResize(t){const r=t.event;r.stopPropagation();const o=this.store.elements.find(n=>n.id===t.id);!o||o.options.locked||(this.resize={id:t.id,point:t.point,startX:r.clientX,startY:r.clientY,origin:{left:o.options.left,top:o.options.top,width:o.options.width,height:o.options.height}},this.store.dragStart())}beginZoneResize(t){t.event.stopPropagation(),t.event.preventDefault(),this.zoneResizing=t.zone;const r=t.event.clientY,o=this.store.templateData,n=t.zone==="header"?o.header.height:o.footer.height,i=(this.store.scale||100)/100,a=p=>{const l=In((p.clientY-r)/i),d=Math.max(0,Math.round((n+(t.zone==="header"?l:-l))*10)/10);t.zone==="header"?this.store.updateTemplateData({header:{...o.header,height:d}}):this.store.updateTemplateData({footer:{...o.footer,height:d}}),this.paint()},s=()=>{window.removeEventListener("mousemove",a),window.removeEventListener("mouseup",s),this.zoneResizing=null,this.store.recordHistory(),this.repaint()};window.addEventListener("mousemove",a),window.addEventListener("mouseup",s)}beginGuideDrag(t){const r=(this.store.templateData.guides??[]).find(d=>d.id===t.id);if(!r)return;const o=ir(this.store.templateData),n=r.type==="vertical"?o.width:o.height,i=t.event.clientX,a=t.event.clientY,s=(this.store.scale||100)/100,p=d=>{const u=In((r.type==="vertical"?d.clientX-i:d.clientY-a)/s);this.store.moveGuide(r.id,Math.min(n,Math.max(0,r.position+u))),this.paint()},l=()=>{window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",l),this.store.recordHistory(),this.repaint()};window.addEventListener("mousemove",p),window.addEventListener("mouseup",l)}beginRulerGuide(t){const r=t.orientation==="horizontal"?"vertical":"horizontal",o=i=>{this.guidePreview={type:r,position:r==="vertical"?i.clientX:i.clientY},this.paint()},n=i=>{window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",n);const a=this.rulerPointToMM(i,r);this.guidePreview=null,a!==null?this.store.addGuide(r,a):this.repaint()};window.addEventListener("mousemove",o),window.addEventListener("mouseup",n)}rulerPointToMM(t,r){const o=this.root.querySelector(".hiprint-printPaper");if(!o)return null;const n=o.getBoundingClientRect(),i=vr(1)*(this.geom.paperScale||1),a=r==="vertical"?(t.clientX-n.left)/i:(t.clientY-n.top)/i,s=ir(this.store.templateData),p=r==="vertical"?s.width:s.height;return a<0||a>p?null:a}applyZoom(t,r,o,n){const i=this.root.querySelector(".canvas-area");if(!i)return;const a=Math.round(this.store.scale),s=Math.max(n,Math.round(t));if(s===a)return;const p=getComputedStyle(i),l=parseFloat(p.paddingLeft)||0,d=parseFloat(p.paddingTop)||0,u=i.scrollLeft+r-l,c=i.scrollTop+o-d,f=s/a;this.store.setScale(s,n),i.scrollLeft=u*f-r+l,i.scrollTop=c*f-o+d,this.scrollPos={x:i.scrollLeft,y:i.scrollTop}}zoomByStep(t){const r=this.root.querySelector(".canvas-area");r&&this.applyZoom(Vd(this.store.scale,t),r.clientWidth/2,r.clientHeight/2,Vn)}fitToWindow(){const t=this.root.querySelector(".canvas-area");if(!t)return;const r=getComputedStyle(t),o=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0),n=(parseFloat(r.paddingTop)||0)+(parseFloat(r.paddingBottom)||0),i=ir(this.store.templateData),a=T0(t.clientWidth-o,t.clientHeight-n,vr(i.width),vr(i.height));this.applyZoom(a,t.clientWidth/2,t.clientHeight/2,Wd)}onWheel(t){if(!t.ctrlKey&&!t.metaKey)return;t.preventDefault();const r=this.root.querySelector(".canvas-area");if(!r)return;const o=Math.round(this.store.scale),n=Vd(o,t.deltaY>0?-1:1);if(n===o)return;const i=r.getBoundingClientRect();this.applyZoom(n,t.clientX-i.left,t.clientY-i.top,Vn)}onScroll(){const t=this.root.querySelector(".canvas-area");if(!t)return;this.scrollPos={x:t.scrollLeft,y:t.scrollTop};const r=this.root.querySelector(".ruler-overlay");r&&(r.style.transform=`translate(${this.scrollPos.x}px, ${this.scrollPos.y}px)`),this.syncRulers()}on(t,r,o,n){t.addEventListener(r,o,n),this.instanceDisposers.push(()=>t.removeEventListener(r,o,n))}attachInstanceListeners(){this.instanceDisposers.length||(this.bindPointer(),this.bindKeys(),this.bindPaneScroll())}bindPaneScroll(){this.on(this.root,"scroll",t=>{const r=t.target;if(!(r instanceof HTMLElement))return;const o=r.dataset.pane;o&&this.paneScroll.set(o,r.scrollTop)},!0)}bindPointer(){const t=a=>{const s=this.store;if(!s)return;const l=((s.scale||100)/100||1)*vr(1),d=(u,c)=>({dx:u/l,dy:c/l});if(this.drag){const{dx:u,dy:c}=d(a.clientX-this.drag.startX,a.clientY-this.drag.startY);(Math.abs(u)>.05||Math.abs(c)>.05)&&(this.drag.moved=!0);const f=s.elements.find(E=>E.id===this.drag.primary),h=f&&Xe(f.options).margin,b=f&&h&&{id:f.id,left:(this.drag.origin.get(f.id)?.left??0)+u,top:(this.drag.origin.get(f.id)?.top??0)+c,width:h.width,height:h.height};let k=null;if(b&&s.snapToGrid!==!1){const E=s.elements.filter(A=>!this.drag.ids.includes(A.id)&&(A.zone||"content")===this.drag.zone).map(A=>({id:A.id,...Xe(A.options).margin})),D=Jl(s.templateData,s.paperSize)[this.drag.zone],O=Ay(b,E,this.manualGuides());k={left:O.left,top:O.top},s.adsorbGuides=(O.lines??[]).filter(A=>A.position>=0&&A.position<=(A.type==="vertical"?D.width:D.height)),(k.left!==b.left||k.top!==b.top)&&this.flashSnapIndicator(k.left+b.width/2,k.top+b.height/2)}else s.adsorbGuides=[];const v=f?this.drag.origin.get(f.id):void 0,w=k&&v?k.left-v.left:u,P=k&&v?k.top-v.top:c;for(const E of this.drag.ids){const D=this.drag.origin.get(E);if(!D)continue;const O={left:D.left+w,top:D.top+P};this.drag.movedPositions.set(E,O),s.livePatch(E,O)}this.patchElementDom(),s.adsorbGuides.length&&this.paintGuidesOnly()}else if(this.resize){const{dx:u,dy:c}=d(a.clientX-this.resize.startX,a.clientY-this.resize.startY),f=Ly(this.resize.point,this.resize.origin,u,c,3.5,3.5);s.livePatch(this.resize.id,f),this.patchElementDom()}},r=()=>{const a=!!this.drag,s=this.drag;if(s?.moved&&s.altKey){this.finishAltClone(s),this.store.dragStop(),this.drag=null,this.store.draggingIds=new Set,this.repaint();return}this.drag?.moved||this.resize?(this.store.adsorbGuides=[],this.store.commitLive(),this.store.dragStop(),this.drag=null,this.resize=null,this.store.draggingIds=new Set,this.repaint()):(this.drag=null,this.store.dragStop(),a&&(this.store.draggingIds=new Set,this.syncDragGhost()))},o=a=>{const s=a.composedPath(),p=s.some(d=>d.classList?.contains("tb-dd"));this.state.openDd&&!p&&(this.state.openDd=null,this.repaint()),this.state.openMore&&!p&&(this.state.openMore=!1,this.repaint());const l=s.some(d=>d.classList?.contains("context-menu"));this.menu.visible&&!l&&(this.menu.visible=!1,this.repaint())},n=a=>{const p=a.target?.closest?.("[data-tip]");!p||!p.closest(J3)||(this.hoverTipTimer&&clearTimeout(this.hoverTipTimer),this.hoverTipTimer=setTimeout(()=>this.showHoverTip(p),300))},i=a=>{const s=a,p=s.target?.closest?.("[data-tip]");p&&s.relatedTarget?.closest?.("[data-tip]")!==p&&this.hideHoverTip()};this.on(window,"mousemove",t),this.on(window,"mouseup",r),this.on(this,"pointerdown",o),this.on(this.root,"mouseover",n),this.on(this.root,"mouseout",i)}showHoverTip(t){const r=t.dataset.tip;if(!r)return;this.hideHoverTip();const o=t.getBoundingClientRect(),n=o.left+o.width/2;this.hoverTipEl=rt(g("div",{class:"pd-hover-tip",style:{left:`${n}px`,top:`${o.bottom+6}px`},text:r}),this.root);const i=this.hoverTipEl.offsetWidth/2;if(!i)return;const a=i+8,s=Math.max(window.innerWidth-i-8,a);this.hoverTipEl.style.left=`${Math.min(Math.max(n,a),s)}px`}hideHoverTip(){this.hoverTipTimer&&(clearTimeout(this.hoverTipTimer),this.hoverTipTimer=null),this.hoverTipEl?.remove(),this.hoverTipEl=null}manualGuides(){const t=[],r=[];for(const o of this.store.templateData.guides??[])o.type==="vertical"?t.push(o.position):r.push(o.position);return{vertical:t,horizontal:r}}paintGuidesOnly(){const t=this.root.querySelector(".hiprint-printPaper-content");if(!t)return;for(const o of Array.from(t.querySelectorAll(".adsorb-guide")))o.remove();const r=this.store.paperSize;Jl(this.store.templateData,r);for(const o of this.store.adsorbGuides){const n=document.createElement("div");n.className=`adsorb-guide guide-${o.type}`,o.type==="vertical"?n.style.cssText=`left:${o.position}mm;top:0;height:${r.height}mm;border-left-color:${o.color||"var(--pd-accent-secondary, #f56c6c)"}`:n.style.cssText=`top:${o.position}mm;left:0;width:${r.width}mm;border-top-color:${o.color||"var(--pd-accent-secondary, #f56c6c)"}`,t.appendChild(n)}}bindKeys(){this.setAttribute("tabindex","0");const t=()=>{Zt.active=this};this.on(this,"pointerdown",t),this.on(this,"focusin",t),Zt.active||(Zt.active=this)}attachDocKeys(){this.docKeydown||(this.docKeydown=t=>this.onGlobalKeydown(t),document.addEventListener("keydown",this.docKeydown),this.docDragend=()=>jm(this.root?.querySelector(".canvas-area")),document.addEventListener("dragend",this.docDragend,!0))}detachDocKeys(){this.docKeydown&&(document.removeEventListener("keydown",this.docKeydown),this.docKeydown=null,this.docDragend&&(document.removeEventListener("dragend",this.docDragend,!0),this.docDragend=null))}onGlobalKeydown(t){const r=this.store;if(!r||Zt.active!==this)return;const n=t.composedPath()[0]?.tagName;if(n==="INPUT"||n==="TEXTAREA"||n==="SELECT")return;if(this.format.handlePainterKeydown(t),t.key.startsWith("Arrow")){t.preventDefault();const a=t.shiftKey?10:t.ctrlKey?.5:1,s=t.key==="ArrowLeft"?-a:t.key==="ArrowRight"?a:0,p=t.key==="ArrowUp"?-a:t.key==="ArrowDown"?a:0;r.moveSelected(s,p);return}if(t.key==="Delete"||t.key==="Backspace"){t.preventDefault(),r.deleteSelected();return}if(!(t.ctrlKey||t.metaKey))return;const i=t.key.toLowerCase();Q3.has(i)&&(t.preventDefault(),i==="z"?t.shiftKey?r.redo():r.undo():i==="y"?r.redo():i==="a"?r.selectAll():i==="c"?r.copy():i==="x"?r.cutSelected():i==="v"?r.paste():i==="d"?r.duplicateSelected():i==="g"?t.shiftKey?r.ungroupSelected():r.groupSelected():i==="1"?r.resetZoom():i==="l"?r.alignSelected("left"):i==="r"?r.alignSelected("right"):i==="e"?r.alignSelected("vertical"):i==="t"?r.alignSelected("top"):i==="b"?r.alignSelected("bottom"):i==="0"&&this.fire("fit-window"))}}function kg(e="print-designer"){return customElements.get(e)||customElements.define(e,Zt),e}function eE(){return kg()}const tE=Object.freeze(Object.defineProperty({__proto__:null,BUILTIN_ELEMENT_CAPABILITIES:So,BUILTIN_ELEMENT_DEFINITIONS:ia,DesignerStore:Nh,PRINT_DESIGNER_ATTRIBUTES:Al,PRINT_DESIGNER_BOOLEAN_ATTRIBUTES:Jh,PRINT_DESIGNER_CONTRACT_VERSION:Dl,PRINT_DESIGNER_EVENT:Ct,PRINT_DESIGNER_EVENTS:rm,PRINT_DESIGNER_EVENT_OPTIONS:uw,PRINT_DESIGNER_METHODS:em,PRINT_DESIGNER_PARTS:Ol,PRINT_DESIGNER_PROPERTY_NAMES:tm,PRINT_DESIGNER_TAG:Zh,PRINT_DESIGNER_THEME_TOKENS:Qh,PrintDesignerElement:Zt,TILING_SINGLE_PAGE_TIP:F2,createDefaultTemplate:ln,definePrintDesigner:kg,getElementCapabilities:gt,getElementCapabilityTypes:Na,getElementDblEditableField:Yh,getElementDefinition:dr,getElementDefinitions:Vh,getElementLayerIcon:Xh,getElementPropertyGroup:Kh,getHostContract:Rl,getMaterialElementDefinitions:Gh,registerAll:eE,registerElementCapabilities:Bb,registerElementDefinition:lw,registerElementRenderer:pw,registerElementRenderers:Wh,resetElementCapabilities:Fb,resetElementDefinitions:cw,serializePage:Ih,subscribeElementDefinitions:jh,toRuntimePool:vl},Symbol.toStringTag,{value:"Module"})),rE=17521,oE=20,yn={PRINTERS_LIST:"printers.list",PRINT_SUBMIT:"print.submit",PRINT_SUBMIT_HTML:"print.submitHtml",TEMPLATE_ATTACH:"template.attach",TEMPLATE_DETACH:"template.detach"};let fp=0;function nE(){return fp=(fp+1)%Number.MAX_SAFE_INTEGER,`${Date.now().toString(36)}-${fp.toString(36)}`}function yg(e,t){const r={id:nE(),type:e,payload:t};return JSON.stringify(r)}function vg(e){let t;try{t=JSON.parse(e)}catch{return{malformed:!0}}if(typeof t!="object"||t===null)return{malformed:!0};const r=t;if(typeof r.id!="string"||typeof r.ok!="boolean")return{malformed:!0};if(r.ok)return{id:r.id,ok:!0,payload:r.payload??{}};const o=r.error;return!o||typeof o.code!="string"||typeof o.message!="string"?{malformed:!0}:{id:r.id,ok:!1,error:{code:o.code,message:o.message}}}function iE(e){if(typeof e!="object"||e===null)return!1;const t=e;return!("ok"in t)&&typeof t.id=="string"&&typeof t.type=="string"&&typeof t.payload=="object"&&t.payload!==null}class Ut extends Error{constructor(t,r){super(r),this.name="WormPrintError",this.code=t}}function aE(e){return e instanceof Ut||e&&typeof e=="object"&&typeof e.code=="string"?e.code:"INTERNAL"}class wg extends Error{constructor(t){super(t),this.code="UNAUTHORIZED",this.name="AuthRejectedError"}}class sE{constructor(t={}){this.ws=null,this.status_="disconnected",this.hello=null,this.pendings=new Map,this.statusCbs=new Set,this.requestHandler=null,this.manualClose=!1,this.reconnectTimer=null,this.reconnectAttempts=0,this.opts=t,this.ctor=t.WebSocketCtor??WebSocket,this.defaultTimeout=t.timeoutMs??15e3}get status(){return this.status_}onStatus(t){return this.statusCbs.add(t),()=>this.statusCbs.delete(t)}setRequestHandler(t){this.requestHandler=t}setToken(t){this.opts={...this.opts,token:t}}async connect(t){if(this.status_==="connected"&&this.hello)return this.hello;this.setStatus("connecting");const r=this.opts.ports??Array.from({length:oE},(o,n)=>rE+n);for(const o of r){if(t?.aborted)throw new Ut("CLIENT_NOT_RUNNING",$("client.cancelled"));try{return this.hello=await this.tryPort(o,t),this.manualClose=!1,this.reconnectAttempts=0,this.setStatus("connected"),this.hello}catch(n){if(n instanceof wg)throw this.setStatus("disconnected"),new Ut("UNAUTHORIZED",n.message||$("client.invalidToken"))}}throw this.setStatus("disconnected"),new Ut("CLIENT_NOT_RUNNING",$("client.notRunning"))}request(t,r,o){if(this.status_!=="connected"||!this.ws)return Promise.reject(new Ut("CLIENT_NOT_RUNNING",$("client.notConnected")));const n=yg(t,r),i=JSON.parse(n);return new Promise((a,s)=>{const p=setTimeout(()=>{this.pendings.delete(i.id),s(new Ut("CLIENT_TIMEOUT",$("client.timeout",{type:t})))},o??this.defaultTimeout);this.pendings.set(i.id,{resolve:a,reject:s,timer:p}),this.ws.send(n)})}close(){this.manualClose=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.ws?.close(),this.failAllPendings(new Ut("CLIENT_NOT_RUNNING",$("client.closed"))),this.setStatus("disconnected")}buildUrl(t){const r=new URL(`ws://127.0.0.1:${t}`);return this.opts.token&&r.searchParams.set("token",this.opts.token),r.toString().replace(/\/$/,"")}tryPort(t,r){return new Promise((o,n)=>{const i=new this.ctor(this.buildUrl(t));this.ws=i;let a=!1;const s=()=>{a||(a=!0,n(new Error("aborted")))};r?.addEventListener("abort",s,{once:!0}),i.onopen=()=>{i.send(yg("hello",{}))},i.onmessage=p=>{const l=vg(String(p.data));if(!("malformed"in l))if(l.ok&&lE(l.payload)){if(a)return;a=!0,this.bindLifecycle(i),o(l.payload)}else if(!l.ok&&l.error.code==="UNAUTHORIZED"){if(a)return;a=!0,n(new wg(l.error.message))}else a||(a=!0,n(new Error("握手失败")))},i.onerror=()=>{a||(a=!0,n(new Error("连接错误")))},i.onclose=()=>{a||(a=!0,n(new Error("连接关闭")))}})}bindLifecycle(t){t.onmessage=r=>{this.handleIncoming(t,String(r.data))},t.onclose=()=>{this.failAllPendings(new Ut("CLIENT_NOT_RUNNING",$("client.disconnected"))),this.hello=null,this.ws=null,this.manualClose||this.scheduleReconnect()},t.onerror=()=>{}}handleIncoming(t,r){let o;try{o=JSON.parse(r)}catch{return}if(iE(o)){this.dispatchServerRequest(t,o);return}const n=vg(r);if("malformed"in n)return;const i=this.pendings.get(n.id);i&&(this.pendings.delete(n.id),clearTimeout(i.timer),n.ok?i.resolve(n.payload):i.reject(new Ut(n.error.code,n.error.message)))}dispatchServerRequest(t,r){const o=this.requestHandler;if(!o){this.safeSend(t,r.id,!1,void 0,"INVALID_REQUEST",$("client.unregisteredHandler"));return}Promise.resolve().then(()=>o(r.type,r.payload)).then(n=>this.safeSend(t,r.id,!0,n??{})).catch(n=>{const i=aE(n),a=n instanceof Error?n.message:String(n);this.safeSend(t,r.id,!1,void 0,i,a)})}safeSend(t,r,o,n,i,a){t.readyState===1&&t.send(JSON.stringify(o?{id:r,ok:o,payload:n}:{id:r,ok:o,error:{code:i??"INTERNAL",message:a??$("client.internalError")}}))}scheduleReconnect(){this.setStatus("connecting");const t=Math.min(1e3*2**this.reconnectAttempts++,1e4);this.reconnectTimer=setTimeout(()=>{this.connect().catch(()=>this.scheduleReconnect())},t)}failAllPendings(t){for(const[,r]of this.pendings)clearTimeout(r.timer),r.reject(t);this.pendings.clear()}setStatus(t){if(this.status_!==t){this.status_=t;for(const r of this.statusCbs)r(t)}}}function lE(e){return typeof e=="object"&&e!==null&&e.app==="worm-print-client"}const xg="worm-print-client:token";class hp{constructor(t={}){const o={token:t.token??hp.loadStoredToken()??void 0,timeoutMs:t.timeoutMs,WebSocketCtor:t.WebSocketCtor};this.transport=new sE(o)}get status(){return this.transport.status}connect(t){return this.transport.connect(t)}onStatusChange(t){return this.transport.onStatus(t)}setRequestHandler(t){this.transport.setRequestHandler(t)}async listPrinters(){return(await this.transport.request(yn.PRINTERS_LIST,{})).printers}request(t,r,o){return this.transport.request(t,r,o)}attachTemplate(t){return this.request(yn.TEMPLATE_ATTACH,t)}detachTemplate(t){return this.request(yn.TEMPLATE_DETACH,{sessionId:t})}print(t,r,o={},n){const{baseUrl:i,fontBaseUrl:a,timeoutMs:s,...p}=o,l={templateJson:t,printData:r,baseUrl:i,fontBaseUrl:a,print:p};return typeof n=="string"&&n.trim().length>0&&(l.templateName=n),this.transport.request(yn.PRINT_SUBMIT,l,s)}printHtml(t,r={},o){const{timeoutMs:n,...i}=r,a={html:t.html,paperMm:t.paperMm,pagePaperMm:t.pagePaperMm,continuous:t.continuous,pageCount:t.pageCount,print:i};return typeof o=="string"&&o.trim().length>0&&(a.templateName=o),this.transport.request(yn.PRINT_SUBMIT_HTML,a,n)}pair(t){localStorage.setItem(xg,t),this.transport.setToken(t)}static loadStoredToken(){try{return localStorage.getItem(xg)}catch{return null}}close(){this.transport.close()}}const pE={...tE,renderHtmlPages:l2,browserCodeRenderer:ml,PrintClient:hp,WormPrintError:Ut,getPaperDimensions:yt,isContinuousPaperSize:Yr,getByPath:$o,resolvePrinterDpi:G0,paperWidthPx:K0,zoomPresets:X0,defaultZoomKey:oc,resolveZoomKey:Q0,zoomValueOf:e1,viewZoomHint:Z0,applyPreviewViewZoom:J0,resolveToolbarOverflow:Gd};globalThis.WormPrintCanvas??=pE}));
2296
+ `},F3=[v3,w3,x3,P3,E3,S3],$3=[T3,M3,C3,_3,D3,A3],z3=[O3,R3,I3,L3,B3,N3];function H3(e){return e&&/^th([-_]|$)/i.test(e)?z3:e&&/^en([-_]|$)/i.test(e)?$3:F3}const ag="worm-print-help-tab",U3="getting-started";function sg(e,t){return e.some(r=>r.id===t)?String(t):""}function q3(e,t){let r=null;try{r=window.localStorage.getItem(ag)}catch{r=null}return sg(e,t)||sg(e,r)||U3}function j3(e){const t=H3(e.locale),r=e.t??ta(e.locale??"zh-CN"),o=q3(t,e.initialTab),n=(i,a)=>{const s=i.currentTarget,p=s.closest(".help-modal");if(!p)return;for(const d of Array.from(p.querySelectorAll(".help-tab")))d.classList.toggle("active",d===s);const l=p.querySelector(".help-content");l&&(l.innerHTML=t.find(d=>d.id===a)?.content??"");try{window.localStorage.setItem(ag,a)}catch{}};return g("div",{class:"help-modal-overlay",tabindex:"-1",onClick:i=>{i.target===i.currentTarget&&e.onClose()},onKeydown:i=>{i.key==="Escape"&&e.onClose()}},[g("div",{class:"help-modal"},[g("div",{class:"help-modal-header"},[g("div",{class:"help-modal-title-wrap"},[g("h2",{class:"help-modal-title",text:r("helpModal.k101")}),g("span",{class:"help-modal-project",text:"worm-print-platform"})]),g("button",{type:"button",class:"help-modal-close",title:r("helpModal.k102"),text:"×",onClick:()=>e.onClose()})]),g("div",{class:"help-modal-body"},[g("div",{class:"help-modal-sidebar"},t.map(i=>g("button",{type:"button",class:`help-tab${i.id===o?" active":""}`,text:i.title,onClick:a=>n(a,i.id)}))),g("div",{class:"help-modal-content"},[g("div",{class:"help-content",html:t.find(i=>i.id===o)?.content??""})])])])])}function W3(e,t){const r=rt(j3(t),e),o=n=>{n.key==="Escape"&&t.onClose()};return document.addEventListener("keydown",o),r.focus?.(),()=>{document.removeEventListener("keydown",o),r.remove()}}const V3=2,G3=74,dp=[{id:"clipboard",order:1,labelKey:"toolbarOverflow.k478"},{id:"painter",order:2,labelKey:"toolbarOverflow.k479"},{id:"zoom",order:3,labelKey:"toolbarOverflow.k480"},{id:"arrange-view",order:4,labelKey:"toolbarOverflow.k481"},{id:"border",order:5,labelKey:"toolbarOverflow.k482"},{id:"color",order:6,labelKey:"toolbarOverflow.k483"},{id:"align",order:7,labelKey:"toolbarOverflow.k484"},{id:"style",order:8,labelKey:"toolbarOverflow.k485"},{id:"font",order:9,labelKey:"toolbarOverflow.k486"}];function K3(e){const t=!!e.state.openMore,r=dp.slice().sort((o,n)=>o.order-n.order).map(o=>g("div",{class:"tb-more-item",dataset:{unit:o.id},style:{display:"none"}},[g("div",{class:"tb-menu-label",text:m(e,o.labelKey)}),g("div",{class:"tb-more-slot",id:`tb-more-slot-${o.id}`,dataset:{unit:o.id}})]));return g("div",{class:"tb-group tb-more-group",style:{display:"none"}},[g("div",{class:"tb-dd"},[g("button",{type:"button",class:`tb-dd-trigger${t?" on":""}`,dataset:{test:"more-dd",tip:m(e,"toolbarOverflow.k487")},onClick:()=>{e.state.openMore=!t,e.repaint()},html:m(e,"toolbarOverflow.k488",{v0:je("Ellipsis",15),v1:je("ChevronDown",12,"tb-dd-arrow")})}),g("div",{class:`tb-dd-panel tb-more-panel${t?"":" is-hidden"}`},[g("div",{class:"tb-menu tb-more-menu"},r)])])])}const lg=new WeakMap;function pg(e){const t=e.querySelector(".designer-toolbar");if(!t)return{movedIds:[],overflowRemains:!1};const r=getComputedStyle(t),o=Number.parseFloat(r.gap)||V3,n=Number.parseFloat(r.paddingLeft)||0,i=Number.parseFloat(r.paddingRight)||0,a=new Map;for(const b of Array.from(t.querySelectorAll(".tb-ou[data-unit]"))){const k=b.parentElement;k&&!k.classList.contains("tb-more-slot")&&lg.set(b,{parent:k,next:b.nextSibling}),a.set(b.dataset.unit,b)}for(const b of a.values()){const k=lg.get(b);!k||b.parentElement===k.parent||(k.next?.parentElement===k.parent?k.parent.insertBefore(b,k.next):k.parent.appendChild(b))}let s=0;for(const b of Array.from(t.children)){if(b.classList.contains("tb-spacer")||b.classList.contains("tb-more-group"))continue;const k=Math.max(b.offsetWidth,b.scrollWidth);k<=0||(s+=k+o)}const p=new Map;for(const[b,k]of a){const v=k.offsetWidth;v>0&&p.set(b,v)}const l=dp.map(b=>({id:b.id,order:b.order,width:p.get(b.id)??0})),d=l.reduce((b,k)=>b-k.width-o,s),u=t.clientWidth-n-i,{movedIds:c,overflowRemains:f}=Gd({available:u,pinned:d,moreTriggerWidth:G3,gap:o,units:l});for(const b of dp){const k=t.querySelector(`.tb-more-item[data-unit="${b.id}"]`),v=t.querySelector(`#tb-more-slot-${b.id}`),w=a.get(b.id);if(!k||!v||!w)continue;const P=c.includes(b.id);P&&w.parentElement!==v&&v.appendChild(w),k.style.display=P?"":"none"}const h=t.querySelector(".tb-more-group");return h&&(h.style.display=c.length>0?"":"none"),t.classList.toggle("is-tight",f),{movedIds:c,overflowRemains:f}}function Y3(e,t){const r=e.store,o=r.selectedIds.size>0,n=r.selectedIds.size>1,i=r.selectedElement,a=!o,s=e.isEdit?m(e,"toolbar.k489"):m(e,"toolbar.k490"),p=[g("div",{class:"tb-menu",dataset:{test:"arrange-panel"}},[g("div",{class:"tb-menu-label",text:m(e,"toolbar.k491")}),g("div",{class:"tb-menu-grid"},[Re(e,"AlignStartVertical","align",{arg:"left",tip:m(e,"toolbar.k492"),disabled:!n}),Re(e,"AlignEndVertical","align",{arg:"right",tip:m(e,"toolbar.k493"),disabled:!n}),Re(e,"AlignStartHorizontal","align",{arg:"top",tip:m(e,"toolbar.k494"),disabled:!n}),Re(e,"AlignEndHorizontal","align",{arg:"bottom",tip:m(e,"toolbar.k495"),disabled:!n}),Re(e,"AlignCenterVertical","align",{arg:"vertical",tip:m(e,"toolbar.k496"),disabled:!n}),Re(e,"AlignCenterHorizontal","align",{arg:"horizontal",tip:m(e,"toolbar.k497"),disabled:!n}),Re(e,"AlignHorizontalSpaceBetween","align",{arg:"distributeHor",tip:m(e,"toolbar.k498"),disabled:!n}),Re(e,"AlignVerticalSpaceBetween","align",{arg:"distributeVer",tip:m(e,"toolbar.k499"),disabled:!n})]),g("div",{class:"tb-menu-label",text:m(e,"toolbar.k500")}),g("div",{class:"tb-menu-grid"},[Re(e,"ArrowUpToLine","move-layer",{arg:"top",tip:m(e,"toolbar.k501"),disabled:!o}),Re(e,"ArrowUp","move-layer",{arg:"up",tip:m(e,"toolbar.k502"),disabled:!o}),Re(e,"ArrowDown","move-layer",{arg:"down",tip:m(e,"toolbar.k503"),disabled:!o}),Re(e,"ArrowDownToLine","move-layer",{arg:"bottom",tip:m(e,"toolbar.k504"),disabled:!o})]),g("div",{class:"tb-menu-label",text:m(e,"toolbar.k505")}),g("div",{class:"tb-menu-grid"},[Re(e,"Group","group",{tip:m(e,"toolbar.k506"),disabled:!n}),Re(e,"Ungroup","ungroup",{tip:m(e,"toolbar.k507"),disabled:!i?.options?.groupId})])])],l=[g("div",{class:"tb-menu tb-menu-rows",dataset:{test:"view-panel"}},[d(m(e,"toolbar.k508"),r.showRuler,"toggle-ruler",m(e,"toolbar.k509")),d(m(e,"toolbar.k510"),r.showGrid,"toggle-grid",m(e,"toolbar.k511")),d(m(e,"toolbar.k512"),r.showTableGhostBorder,"toggle-table-ghost-border",m(e,"toolbar.k513")),d(m(e,"toolbar.k514"),r.snapToGrid,"toggle-snap",m(e,"toolbar.k515"))])];function d(u,c,f,h){return g("button",{type:"button",class:`tb-btn tb-menu-row${c?" on":""}`,dataset:{tip:h},onClick:()=>e.fire(f)},[g("span",{class:"dot"}),u])}return g("div",{class:"designer-toolbar"},[g("div",{class:"tb-group tb-brand"},[g("span",{class:"tb-mark","aria-hidden":"true",html:'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="5" y="3" width="14" height="18" rx="2.5" /><line x1="8.5" y1="8.5" x2="15.5" y2="8.5" /><line x1="8.5" y1="12.5" x2="15.5" y2="12.5" /><line x1="8.5" y1="16.5" x2="12.5" y2="16.5" /></svg>'}),g("div",{class:"tb-title"},[g("span",{class:"tb-title-name",text:s}),g("span",{class:"tb-title-sub",text:m(e,"toolbar.k516")})])]),g("div",{class:"tb-group"},[Re(e,"Undo2","undo",{tip:m(e,"toolbar.k517"),disabled:!r.canUndo}),Re(e,"Redo2","redo",{tip:m(e,"toolbar.k518"),disabled:!r.canRedo})]),t,g("div",{class:"tb-ou tb-group",dataset:{unit:"arrange-view"}},[na(e,"arrange",{icon:"Layers",text:m(e,"toolbar.k519"),tip:m(e,"toolbar.k520"),testId:"arrange-dd"},p),na(e,"view",{icon:"Eye",text:m(e,"toolbar.k521"),tip:m(e,"toolbar.k522"),testId:"view-dd"},l)]),g("div",{class:"tb-ou tb-group",dataset:{unit:"zoom"}},[Re(e,"Maximize","fit-window",{tip:m(e,"toolbar.k523")}),Re(e,"ZoomOut","zoom",{arg:-10,tip:m(e,"toolbar.k524")}),g("span",{class:"tb-zoom",text:`${r.scale}%`}),Re(e,"ZoomIn","zoom",{arg:10,tip:m(e,"toolbar.k525")})]),g("div",{class:"tb-ou tb-group",dataset:{unit:"clipboard"}},[Re(e,"Copy","copy",{tip:a?m(e,"toolbar.k526"):m(e,"toolbar.k527"),disabled:a,test:"copy"}),Re(e,"ClipboardPaste","paste",{tip:a?m(e,"toolbar.k528"):r.hasClipboard?m(e,"toolbar.k530"):m(e,"toolbar.k529"),disabled:a||!r.hasClipboard,test:"paste"}),Re(e,"Trash2","delete",{tip:a?m(e,"toolbar.k531"):m(e,"toolbar.k532"),disabled:a,danger:!0,test:"delete"})]),K3(e),g("div",{class:"tb-spacer"}),e.showHelp?g("div",{class:"tb-group"},[g("button",{type:"button",class:"help-button",title:m(e,"toolbar.k533"),onClick:()=>e.fire("help")},[g("span",{class:"help-icon",text:"?"})])]):"",(()=>{const u=[e.showPreview!==!1?g("button",{type:"button",class:"btn-secondary",dataset:{tip:m(e,"toolbar.k534")},text:m(e,"toolbar.k535"),onClick:()=>e.fire("preview")}):"",e.showSave!==!1?g("button",{type:"button",class:"btn-primary",dataset:{tip:m(e,"toolbar.k536")},text:m(e,"toolbar.k537"),onClick:()=>e.fire("save")}):""].filter(Boolean);return u.length?g("div",{class:"tb-group"},u):""})()].filter(Boolean))}function cp(e,t,r){for(const o of t){const n=e.getPropertyValue(o).trim();if(n)return n}return r}function X3(e,t){const r=t.orientation==="horizontal",o=t.geom,n=r?o.viewW:o.viewH;e.style.width=`${r?n:ps}px`,e.style.height=`${r?ps:n}px`;const i=e.getContext("2d");if(!i)return;const a=window.devicePixelRatio||1,s=Math.max(0,Math.round(n)),p=ps;e.width=(r?s:p)*a,e.height=(r?p:s)*a,i.setTransform(a,0,0,a,0,0);const l=getComputedStyle(e),d=cp(l,["--pd-ruler-bg"],"#F8F9FC"),u=cp(l,["--pd-ruler"],"#9AA1AF"),c=cp(l,["--pd-ruler-cursor","--pd-accent"],"#165DFF");i.fillStyle=d,i.fillRect(0,0,r?s:p,r?p:s);const f=t.scale>0?t.scale:o.paperScale>0?o.paperScale:1,h=vr(1)*f;if(h<=0)return;const b={ctx:i,horizontal:r,viewportPx:n,thickness:p,originPx:r?o.originX:o.originY,pxPerMM:h,paperLengthMM:t.paperLengthMM},k=-b.originPx/h,v=(s-b.originPx)/h,w=n1(f),P=s1(k,v,w);cg(b,P,u,!0),cg(b,P,u,!1),ug(b,0,c),ug(b,t.paperLengthMM,c);const E=t.cursorPx??null;if(E!==null&&E>=0&&E<=s){if(i.strokeStyle=c,i.lineWidth=1.5,i.beginPath(),r){const D=Math.round(E)+.5;i.moveTo(D,0),i.lineTo(D,p)}else{const D=Math.round(E)+.5;i.moveTo(0,D),i.lineTo(p,D)}i.stroke()}}function dg(e,t){return Math.round(e.originPx+t*e.pxPerMM)+.5}function cg(e,t,r,o){const{ctx:n,horizontal:i,paperLengthMM:a}=e;n.strokeStyle=r,n.fillStyle=r,n.globalAlpha=o?.32:1,n.lineWidth=1,n.font="9px ui-monospace, Menlo, monospace",n.textBaseline="top";for(const s of t){if((s.mm<0||s.mm>a)!==o)continue;const l=dg(e,s.mm),d=s.major?8:4;n.beginPath(),i?(n.moveTo(l,0),n.lineTo(l,d)):(n.moveTo(0,l),n.lineTo(d,l)),n.stroke(),s.major&&s.label&&(i?n.fillText(s.label,l+2,11):(n.save(),n.translate(11,l+2),n.rotate(-Math.PI/2),n.fillText(s.label,0,0),n.restore()))}n.globalAlpha=1}function ug(e,t,r){const{ctx:o,horizontal:n,thickness:i,viewportPx:a}=e,s=dg(e,t);s<=0||s>=a||(o.strokeStyle=r,o.globalAlpha=.55,o.lineWidth=1,o.beginPath(),n?(o.moveTo(s,0),o.lineTo(s,i)):(o.moveTo(0,s),o.lineTo(i,s)),o.stroke(),o.globalAlpha=1)}const Z3=':host{display:block;width:100%;height:100%}:host{--pd-bg: #f3f5f9;--pd-surface: #ffffff;--pd-field-bg: #f4f6fa;--pd-sidebar: #ffffff;--pd-sidebar-hover: #f0f3f9;--pd-canvas-bg: #e6e9f0;--pd-paper: #FFFFFF;--pd-accent: #165DFF;--pd-accent-2: #3D7BFF;--pd-accent-soft: rgba(22, 93, 255, .09);--pd-accent-secondary: #f56c6c;--pd-danger-soft: rgba(245, 108, 108, .1);--pd-ink-green: #67c23a;--pd-text: #2a2e37;--pd-text-muted: #8b909c;--pd-text-faint: #b4b9c4;--pd-border: #d9dde6;--pd-border-soft: #e9ecf2;--pd-input-bg: #ffffff;--pd-hover-tint: #ecf5ff;--pd-danger: #e53e3e;--pd-danger-bg: #fef2f2;--pd-danger-border: #fecaca;--pd-menu-text: #333;--pd-menu-hover: #f5f7fa;--pd-menu-border: #dcdfe6;--pd-menu-divider: #ebeef5;--pd-menu-muted: #909399;--pd-menu-disabled: #c0c4cc;--pd-scrollbar: rgba(23, 32, 60, .18);--pd-scrollbar-thumb: rgba(23, 32, 60, .16);--pd-scrollbar-thumb-hover: rgba(23, 32, 60, .3);--pd-help-field-bg: #f0f9ff;--pd-help-field-line: #bae6fd;--pd-help-field-ink: #0369a1;--pd-help-function-bg: #f0fdf4;--pd-help-function-line: #bbf7d0;--pd-help-function-ink: #166534;--pd-help-variable-bg: #fefce8;--pd-help-variable-line: #fde68a;--pd-help-variable-ink: #854d0e;--pd-help-conditional-bg: #fdf2f8;--pd-help-conditional-line: #fbcfe8;--pd-help-conditional-ink: #9d174d;--pd-handle: #165DFF;--pd-ruler: #9aa1af;--pd-ruler-bg: #f8f9fc;--pd-ruler-cursor: #165DFF;--pd-radius: 6px;--pd-shadow-sm: 0 1px 2px rgba(23, 32, 60, .05);--pd-shadow-md: 0 2px 8px rgba(23, 32, 60, .06), 0 10px 28px rgba(23, 32, 60, .07);--pd-shadow-paper: 0 0 0 1px rgba(23, 32, 60, .05), 0 1px 2px rgba(23, 32, 60, .06), 0 8px 20px rgba(23, 32, 60, .08), 0 26px 60px rgba(23, 32, 60, .15);--pd-success: #16a34a;--pd-text-regular: #606266;--pd-fill-light: #f5f7fa;height:100%;display:flex;flex-direction:column;background:var(--pd-bg)}.pd-form{display:flex;flex-direction:column;gap:10px;font-size:12px;color:var(--pd-text, #303133)}.pd-field{display:flex;flex-direction:column;gap:4px}.pd-label{font-size:11px;color:var(--pd-text-muted, #909399);display:inline-flex;align-items:center;position:relative;justify-content:space-between;gap:6px}.pd-label-t{display:inline-flex;align-items:center;gap:4px;min-width:0}.pd-reset-btn{flex:none;width:15px;height:15px;padding:0;border:1px solid transparent;border-radius:4px;background:transparent;color:var(--pd-text-faint, #b4b9c4);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;transition:color .14s ease,border-color .14s ease,background .14s ease}.pd-reset-btn.is-dirty{color:var(--pd-text, #2a2e37)}.pd-reset-btn:hover{color:var(--pd-accent, #165DFF);border-color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.pd-help{position:static;display:inline-flex;align-items:center;justify-content:center;flex:none;width:13px;height:13px;margin-left:4px;padding:0;border:1px solid var(--pd-border, #d9dde6);border-radius:50%;background:transparent;color:var(--pd-text-muted, #909399);font-size:9px;line-height:1;cursor:help}.pd-help:before{content:"?";font-weight:600}.pd-help:hover,.pd-help:focus-visible{border-color:var(--pd-accent, #165DFF);color:var(--pd-accent, #165DFF)}.pd-help:after{content:attr(data-tip);position:absolute;top:calc(100% + 6px);left:0;z-index:120;width:196px;padding:5px 7px;border-radius:4px;background:#1e2330e0;color:#fff;font-size:12px;font-weight:400;line-height:1.45;text-align:left;white-space:normal;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .15s ease}.pd-help:hover:after,.pd-help:focus:after{opacity:1;visibility:visible}.pd-hover-tip{position:fixed;z-index:9999;transform:translate(-50%);padding:4px 8px;border-radius:4px;background:#2a2e37eb;color:#fff;font-size:12px;line-height:1.4;width:max-content;max-width:calc(100vw - 16px);box-sizing:border-box;overflow-wrap:anywhere;pointer-events:none}.pd-input,.pd-select,textarea.pd-input{width:100%;height:26px;min-height:26px;padding:3px 6px;border:1px solid var(--pd-border, #d9dde6);border-radius:6px;background:var(--pd-input-bg, #fff);color:inherit;font:inherit;box-sizing:border-box;transition:border-color .14s ease,box-shadow .14s ease}.pd-input:hover,.pd-select:hover{border-color:var(--pd-text-faint, #b4b9c4)}textarea.pd-input{height:auto;min-height:48px;resize:vertical}.pd-input:focus,.pd-select:focus{outline:none;border-color:var(--pd-accent, #165DFF);box-shadow:0 0 0 2px #165dff1f}.pd-select{appearance:auto}.pd-switch{appearance:none;width:32px;height:18px;margin:0;border:1px solid var(--pd-border, #dcdfe6);border-radius:999px;background:#dcdfe6;position:relative;cursor:pointer;transition:background .2s,border-color .2s}.pd-switch:checked{background:var(--pd-accent, #165DFF);border-color:var(--pd-accent, #165DFF)}.pd-switch:after{content:"";position:absolute;top:2px;left:2px;width:12px;height:12px;border-radius:50%;background:#fff;transition:transform .2s}.pd-switch:checked:after{transform:translate(14px)}.pd-range{width:100%;accent-color:var(--pd-accent, #165DFF)}.pd-radio-group,.pd-checkbox-group{display:flex;flex-wrap:wrap;gap:6px}.pd-radio-group--2col{display:grid;grid-template-columns:1fr 1fr}.pd-radio-group--2col>.pd-radio{width:60%;justify-content:flex-start}.pd-radio,.pd-checkbox{display:inline-flex;align-items:center;gap:4px;min-height:24px;padding:0 7px;border:1px solid var(--pd-border, #d9dde6);border-radius:6px;background:var(--pd-input-bg, #fff);cursor:pointer;transition:border-color .14s ease,background .14s ease,color .14s ease}.pd-radio:has(input:checked),.pd-checkbox:has(input:checked){color:var(--pd-accent, #165DFF);border-color:var(--pd-accent, #165DFF);background:#165dff0f}.pd-button-group{display:inline-flex;gap:4px}.pd-button,.pd-tab{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-height:26px;padding:3px 8px;border:1px solid var(--pd-border, #d9dde6);border-radius:6px;background:var(--pd-bg, #f4f6fa);color:var(--pd-text, #2a2e37);font:inherit;cursor:pointer;transition:background .14s ease,border-color .14s ease,color .14s ease}.pd-button:hover{background:var(--pd-sidebar-hover, #f0f3f9);border-color:var(--pd-text-faint, #b4b9c4)}.pd-button.primary{background:var(--pd-accent, #165DFF);border-color:var(--pd-accent, #165DFF);color:#fff}.pd-button.danger{background:#f56c6c;border-color:#f56c6c;color:#fff}.pd-button.small{min-height:22px;padding:1px 6px;font-size:11px}.pd-button:disabled{opacity:.55;cursor:not-allowed}.pd-tabs{display:flex;flex-direction:column;min-height:0}.pd-tab-bar{display:flex;gap:4px;padding:8px 12px 0;border-bottom:1px solid var(--pd-border-soft, #ebeef5)}.pd-tab{border:0;border-bottom:2px solid transparent;border-radius:5px 5px 0 0;background:transparent;transition:color .14s ease,background .14s ease}.pd-tab-bar .pd-tab:hover{color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.pd-tab.active{color:var(--pd-accent, #165DFF);border-bottom-color:var(--pd-accent, #165DFF);background:transparent;font-weight:600}.pd-tab-pane{min-height:0;overflow:auto}.pd-divider{margin:6px 0;font-size:11px;color:var(--pd-text-muted, #909399)}.pd-empty{margin:16px 0;color:var(--pd-text-muted, #909399);text-align:center}.pd-dialog-overlay{position:fixed;inset:0;z-index:2000;display:grid;place-items:center;padding:16px;background:#00000073}.pd-dialog{display:flex;flex-direction:column;width:min(950px,90vw);max-height:90vh;overflow:hidden;background:var(--pd-surface, #fff);border-radius:12px;box-shadow:var(--pd-shadow-md, 0 12px 40px rgba(23, 32, 60, .18))}.pd-dialog-large{width:min(950px,90vw)}.pd-dialog-header,.pd-dialog-footer{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:12px 16px}.pd-dialog-header{border-bottom:1px solid var(--pd-border-soft, #ebeef5)}.pd-dialog-footer{justify-content:flex-end;border-top:1px solid var(--pd-border-soft, #ebeef5)}.pd-close{width:22px;height:22px;border:0;background:transparent;color:var(--pd-text-muted, #909399);font-size:16px;cursor:pointer}.pd-icon{display:inline-flex;width:14px;height:14px}.tb-more-panel{min-width:244px}.designer-container{scrollbar-width:thin;scrollbar-color:var(--pd-scrollbar, rgba(23, 32, 60, .18)) transparent}.designer-container ::-webkit-scrollbar{width:9px;height:9px}.designer-container ::-webkit-scrollbar-track{background:transparent}.designer-container ::-webkit-scrollbar-thumb{background:var(--pd-scrollbar-thumb, rgba(23, 32, 60, .16));border-radius:999px;border:2px solid transparent;background-clip:content-box}.designer-container ::-webkit-scrollbar-thumb:hover{background:var(--pd-scrollbar-thumb-hover, rgba(23, 32, 60, .3));border:2px solid transparent;background-clip:content-box}.designer-container ::-webkit-scrollbar-corner{background:transparent}.designer-container button:focus-visible,.designer-container [tabindex]:focus-visible,.designer-container .pd-tab:focus-visible{outline:2px solid var(--pd-accent, #165DFF);outline-offset:1px}@media(prefers-reduced-motion:reduce){.designer-container *,.designer-container *:before,.designer-container *:after{transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}.help-button{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:4px;background:transparent;cursor:pointer;transition:background-color .15s}.help-button:hover{background:var(--pd-sidebar-hover, #f0f3f9)}.help-icon{display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background:var(--pd-accent, #165DFF);color:#fff;font-size:12px;font-weight:600;line-height:1}.tb-dd{position:relative;display:inline-flex}.tb-dd-trigger{height:28px;min-width:28px;padding:0 5px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--pd-text-muted, #8b909c);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:3px;font-size:12px;transition:background .14s ease,color .14s ease}.tb-dd-trigger:hover:not(:disabled){color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.tb-dd-trigger:disabled{opacity:.32;cursor:default}.tb-dd-trigger.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.tb-dd-arrow{opacity:.6;transition:transform .14s ease}.tb-dd-arrow.up{transform:rotate(180deg)}.tb-dd-trigger[data-tip]{position:relative}.tb-dd-trigger[data-tip]:after{content:attr(data-tip);position:absolute;top:34px;left:50%;transform:translate(-50%);padding:4px 8px;font-size:12px;color:#fff;background:#1e2330e0;border-radius:4px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s ease;z-index:100}.tb-dd-trigger[data-tip]:hover:after{opacity:1}.tb-dd-panel{position:absolute;top:34px;left:0;background:var(--pd-surface, #fff);border:1px solid var(--pd-border, #d9dde6);border-radius:8px;box-shadow:var(--pd-shadow-md, 0 2px 8px rgba(23, 32, 60, .06), 0 10px 28px rgba(23, 32, 60, .07));z-index:200}.tb-dd-panel.is-hidden{display:none}.tb-more-group{flex-shrink:0}.tb-more-menu{display:flex;flex-direction:column;gap:8px;padding:8px;max-height:min(70vh,520px)}.tb-more-item{display:flex;flex-direction:column;gap:4px}.tb-menu-label{font-size:11px;color:var(--pd-text-muted, #8b909c);padding-left:2px}.tb-more-slot{display:flex;align-items:center}.designer-toolbar{display:flex;align-items:center;gap:2px;padding:0 12px;height:50px;background:var(--pd-surface, #ffffff);border-bottom:1px solid var(--pd-border-soft, #e9ecf2);box-shadow:0 1px 2px #17203c0a,0 6px 16px -12px #17203c40;flex-shrink:0;position:relative;z-index:100}.tb-ou{flex-shrink:0}.designer-toolbar>*{flex-shrink:0}.designer-toolbar>.tb-brand{flex-shrink:1;min-width:0}.tb-title,.tb-title-name,.tb-title-sub,.tb-btn-text,.tb-zoom{white-space:nowrap}.designer-toolbar.is-tight .tb-title{min-width:0;overflow:hidden}.designer-toolbar.is-tight .tb-title-name,.designer-toolbar.is-tight .tb-title-sub{overflow:hidden;text-overflow:ellipsis}.tb-group{display:flex;align-items:center;gap:2px;padding:0 8px}.tb-group+.tb-group{border-left:1px solid var(--pd-border-soft, #e9ecf2)}.tb-btn{height:30px;min-width:30px;padding:0 8px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--pd-text-muted, #8b909c);font-size:12px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:5px;transition:background .14s ease,color .14s ease,border-color .14s ease,box-shadow .14s ease}.tb-btn:hover{color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.tb-btn:active{background:var(--pd-border-soft, #e9ecf2)}.tb-btn:disabled{opacity:.32;cursor:default;background:transparent;color:var(--pd-text-faint, #b4b9c4)}.tb-btn.danger:hover:not(:disabled){color:var(--pd-accent-secondary, #f56c6c);background:var(--pd-danger-soft, rgba(245, 108, 108, .1))}.tb-btn.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09));font-weight:600}.tb-btn .dot{width:6px;height:6px;border-radius:50%;background:var(--pd-text-faint, #b4b9c4);display:inline-block;transition:background .14s ease,box-shadow .14s ease}.tb-btn.on .dot{background:var(--pd-accent, #165DFF);box-shadow:0 0 0 3px #165dff1f}.tb-icon{font-size:15px;line-height:1}[data-tip]{position:relative}[data-tip]:after{content:attr(data-tip);position:absolute;bottom:-32px;left:50%;transform:translate(-50%);padding:4px 8px;font-size:12px;color:#fff;background:#1e2330e0;border-radius:4px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s ease;z-index:100}[data-tip]:hover:after{opacity:1}.tb-mark{width:28px;height:28px;margin-right:2px;border-radius:8px;display:inline-flex;align-items:center;justify-content:center;color:#fff;background:linear-gradient(150deg,var(--pd-accent-2, #3D7BFF),var(--pd-accent, #165DFF));box-shadow:0 3px 8px #165dff47,inset 0 1px #ffffff38;flex-shrink:0}.tb-mark svg{width:16px;height:16px}.tb-title{display:flex;flex-direction:column;line-height:1.2;padding-left:6px}.tb-title-name{font-size:13px;font-weight:600;color:var(--pd-text, #2a2e37);letter-spacing:.2px}.tb-title-sub{font-size:10px;color:var(--pd-text-muted, #8b909c);letter-spacing:.8px}.tb-zoom{font-size:12px;color:var(--pd-text, #2a2e37);font-variant-numeric:tabular-nums;min-width:46px;text-align:center}.tb-spacer{flex:1}.tb-group .tb-dd-trigger{height:30px;min-width:30px;padding:0 8px}.tb-btn-text{font-size:12px}.tb-menu{padding:8px;display:flex;flex-direction:column;gap:4px}.tb-menu-rows{width:148px}.tb-menu-label{padding:2px 4px;font-size:11px;color:var(--pd-text-muted, #8b909c)}.tb-menu-grid{display:grid;grid-template-columns:repeat(4,32px);gap:2px;margin-bottom:4px}.tb-menu-row{justify-content:flex-start;width:100%}.btn-primary,.btn-secondary{height:32px;padding:0 16px;border-radius:7px;font-size:13px;font-weight:600;cursor:pointer;transition:filter .14s ease,background .14s ease,border-color .14s ease,box-shadow .14s ease}.btn-secondary{background:var(--pd-field-bg, #f4f6fa);color:var(--pd-text-muted, #606266);border:1px solid var(--pd-border, #d9dde6)}.btn-secondary:hover{border-color:var(--pd-accent, #165DFF);color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .06))}.btn-primary{background:linear-gradient(180deg,var(--pd-accent-2, #3D7BFF),var(--pd-accent, #165DFF));color:#fff;border:none;box-shadow:0 3px 10px #165dff47,inset 0 1px #ffffff2e}.btn-primary:hover{filter:brightness(1.07);box-shadow:0 5px 14px #165dff57,inset 0 1px #ffffff2e}.btn-primary:active{filter:brightness(.97)}.font-select{position:relative}.font-select-input{display:block;width:100%}.font-select-list{position:absolute;top:calc(100% + 4px);left:0;width:100%;min-width:150px;z-index:200;margin:0;max-height:200px;overflow-y:auto;padding:2px;border:1px solid var(--pd-border, #d9dde6);border-radius:6px;background:var(--pd-surface, #ffffff);box-shadow:var(--pd-shadow-md, 0 2px 8px rgba(23, 32, 60, .06), 0 10px 28px rgba(23, 32, 60, .07));list-style:none}.font-select-list.is-up{top:auto;bottom:calc(100% + 4px)}.font-select-option{padding:4px 6px;border-radius:4px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;cursor:pointer}.font-select-option.is-active{background:var(--pd-sidebar-hover, #f0f3f9)}.font-select-option.is-muted{color:var(--pd-text-muted, #8b909c)}.pd-stepper{display:flex;align-items:center;width:100%}.pd-step-btn{width:26px;height:26px;flex-shrink:0;border:1px solid var(--pd-border, #d9dde6);background:var(--pd-field-bg, #f4f6fa);color:var(--pd-text, #2a2e37);font-size:14px;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:background .14s ease,border-color .14s ease,color .14s ease}.pd-step-btn:hover:not(:disabled){background:var(--pd-sidebar-hover, #f0f3f9);border-color:var(--pd-text-faint, #b4b9c4)}.pd-step-btn:disabled{opacity:.45;cursor:not-allowed}.pd-step-minus{border-radius:6px 0 0 6px;border-right:none}.pd-step-plus{border-radius:0 6px 6px 0;border-left:none}.pd-step-input.pd-input{border-radius:0;min-width:0;flex:1;text-align:center;-moz-appearance:textfield}.pd-step-input.pd-input::-webkit-outer-spin-button,.pd-step-input.pd-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.preset-color-trigger{display:flex;align-items:center;width:100%;min-height:26px;padding:1px;border:1px solid var(--pd-border, #d9dde6);border-radius:6px;background:var(--pd-surface, #fff);cursor:pointer;transition:border-color .14s ease,box-shadow .14s ease}.preset-color-trigger:hover,.preset-color-trigger[aria-expanded=true]{border-color:var(--pd-accent, #165DFF)}.preset-color-trigger:focus-visible{outline:none;border-color:var(--pd-accent, #165DFF);box-shadow:0 0 0 2px #165dff1f}.preset-color-swatch{width:100%;height:22px;border-radius:4px;background-image:linear-gradient(45deg,#e9ecef 25%,transparent 25%,transparent 75%,#e9ecef 75%);background-size:8px 8px;background-position:0 0,4px 4px}.preset-color-panel{position:fixed;z-index:3000;width:190px;padding:10px;border:1px solid var(--pd-border, #d9dde6);border-radius:8px;background:var(--pd-surface, #fff);box-shadow:0 8px 24px #17203c29}.picker-preview{display:flex;align-items:center;gap:8px;margin-bottom:8px}.picker-current{flex:0 0 26px;height:24px;border:1px solid rgb(0 0 0 / 12%);border-radius:5px;background-image:linear-gradient(45deg,#e9ecef 25%,transparent 25%,transparent 75%,#e9ecef 75%);background-size:8px 8px;background-position:0 0,4px 4px}.picker-current.is-empty{position:relative;background-color:#fff}.picker-current.is-empty:after{content:"";position:absolute;inset:3px;background:linear-gradient(to top right,transparent calc(50% - .7px),#f53f3f calc(50% - .7px),#f53f3f calc(50% + .7px),transparent calc(50% + .7px));border-radius:3px}.picker-hex{flex:1;min-width:0;height:24px;padding:0 6px;border:1px solid var(--pd-border, #d9dde6);border-radius:5px;color:var(--pd-text, #303133);font:inherit;font-size:11px;text-transform:uppercase}.picker-hex:focus{outline:none;border-color:var(--pd-accent, #165DFF);box-shadow:0 0 0 2px #165dff1f}.picker-area{position:relative;height:100px;border:1px solid rgb(0 0 0 / 12%);border-radius:6px;overflow:hidden;cursor:crosshair;touch-action:none;background:linear-gradient(to top,#000,transparent),linear-gradient(to right,#fff,hsl(var(--picker-hue) 100% 50%))}.picker-handle{position:absolute;width:12px;height:12px;border:2px solid #fff;border-radius:50%;transform:translate(-50%,-50%);box-shadow:0 0 3px #00000073;pointer-events:none}.picker-hue{width:100%;height:14px;margin:10px 0 0;appearance:none;border:1px solid rgb(0 0 0 / 12%);border-radius:999px;background:linear-gradient(to right,red,#ff0,#0f0,#0ff,#00f,#f0f,red);cursor:pointer}.picker-hue::-webkit-slider-thumb{appearance:none;width:12px;height:12px;border:2px solid #fff;border-radius:50%;background:transparent;box-shadow:0 0 3px #00000073}.picker-hue::-moz-range-thumb{width:8px;height:8px;border:2px solid #fff;border-radius:50%;background:transparent;box-shadow:0 0 3px #00000073}.picker-heading{display:flex;align-items:center;justify-content:space-between;margin-top:10px;margin-bottom:6px;font-size:11px;color:var(--pd-text-muted, #909399)}.picker-clear{display:inline-flex;align-items:center;gap:3px;padding:2px 6px;border:none;border-radius:4px;background:transparent;font-size:11px;line-height:1;color:var(--pd-text-muted, #909399);cursor:pointer}.picker-clear:hover:not(:disabled){background:#0000000f;color:var(--pd-danger, #f53f3f)}.picker-clear:disabled{opacity:.45;cursor:not-allowed}.preset-color-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:5px}.preset-color-item{width:22px;height:22px;padding:0;border:1px solid rgb(0 0 0 / 12%);border-radius:5px;cursor:pointer}.preset-color-item.active{box-shadow:0 0 0 2px #fff,0 0 0 3px var(--pd-accent, #165DFF)}.format-toolbar{display:flex;align-items:center;gap:2px;flex-shrink:0;min-width:0}.ft-group{display:flex;align-items:center;gap:2px;padding:0 8px;flex-shrink:0}.ft-group+.ft-group{border-left:1px solid var(--pd-border-soft, #e9ecf2)}.ft-btn{height:28px;min-width:28px;padding:0 5px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--pd-text-muted, #8b909c);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:4px;transition:background .14s ease,color .14s ease}.ft-btn:hover:not(:disabled){color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.ft-btn:disabled{opacity:.32;cursor:default}.ft-btn.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.ft-btn-text{font-size:12px}.ft-btn[data-tip]{position:relative}.ft-btn[data-tip]:after{content:attr(data-tip);position:absolute;top:34px;left:50%;transform:translate(-50%);padding:4px 8px;font-size:12px;color:#fff;background:#1e2330e0;border-radius:4px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s ease;z-index:100}.ft-btn[data-tip]:hover:after{opacity:1}.ft-font{width:150px}.ft-size{width:96px}.ft-font .font-select-input,.ft-size .pd-input,.ft-size .pd-step-btn{font-size:12px}.ft-color-btn{position:relative;width:28px;height:28px;display:inline-flex;margin-left:2px}.ft-color-btn.dim{opacity:.35}.ft-color-btn .preset-color-trigger{width:100%;height:100%;min-height:0;padding:0;border:1px solid transparent;border-radius:6px;background:transparent;align-items:flex-end;justify-content:center}.ft-color-btn .preset-color-trigger:hover,.ft-color-btn .preset-color-trigger[aria-expanded=true]{background:var(--pd-sidebar-hover, #f0f3f9);border-color:var(--pd-border-soft, #e9ecf2)}.ft-color-btn .preset-color-swatch{width:16px;height:4px;margin-bottom:3px;border-radius:1px;background-image:none;border-bottom:1px solid var(--pd-text-faint, #b4b9c4)}.ft-glyph{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding-bottom:7px;font-size:13px;font-weight:700;color:var(--pd-text, #2a2e37);pointer-events:none}.ft-border-panel{width:196px;padding:10px;display:flex;flex-direction:column;gap:8px}.ft-align-panel{padding:6px;display:flex;flex-direction:column;gap:4px}.ft-align-row{display:grid;grid-template-columns:repeat(3,36px);gap:4px}.ft-border-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.ft-cell-btn{height:30px;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:6px;background:transparent;color:var(--pd-text, #2a2e37);cursor:pointer}.ft-cell-btn:hover:not(:disabled){background:var(--pd-sidebar-hover, #f0f3f9);border-color:var(--pd-border-soft, #e9ecf2)}.ft-cell-btn.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09));border-color:#165dff59}.ft-cell-btn:disabled{opacity:.32;cursor:default}.ft-cell-btn .g-faint{fill:none;stroke:var(--pd-text-faint, #b4b9c4);stroke-width:1;stroke-dasharray:2 2}.ft-cell-btn .g-solid{stroke:currentColor;stroke-width:1.6}.ft-cell-btn[data-tip],.ft-style-btn[data-tip]{position:relative}.ft-cell-btn[data-tip]:after,.ft-style-btn[data-tip]:after{content:attr(data-tip);position:absolute;top:calc(100% + 4px);left:50%;transform:translate(-50%);padding:4px 8px;font-size:12px;font-weight:400;color:#fff;background:#1e2330e0;border-radius:4px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s ease;z-index:210}.ft-cell-btn[data-tip]:hover:after,.ft-style-btn[data-tip]:hover:after{opacity:1}.ft-style-row{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.ft-style-btn{height:22px;display:inline-flex;align-items:center;justify-content:center;padding:0 4px;border:1px solid transparent;border-radius:5px;background:transparent;color:var(--pd-text, #2a2e37);cursor:pointer}.ft-style-btn:hover{background:var(--pd-sidebar-hover, #f0f3f9)}.ft-style-btn.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09));border-color:#165dff59}.ft-style-line{width:100%;height:0}.ft-border-style-row{display:flex;align-items:center;gap:6px}.ft-line-width{width:96px}.ft-edge-label{font-size:12px;color:var(--pd-text-muted, #8b909c);white-space:nowrap;flex-shrink:0}.layer-panel{border-top:1px solid var(--pd-border);padding:8px 12px;height:100%;box-sizing:border-box;overflow-y:auto}.panel-title{font-size:11px;color:var(--pd-text-muted);text-transform:uppercase;letter-spacing:.5px;margin-bottom:8px}.layer-item{display:flex;align-items:center;gap:6px;padding:4px 6px;margin-bottom:2px;border-radius:4px;cursor:pointer;font-size:12px;transition:background .1s}.layer-item:hover{background:var(--pd-sidebar-hover, #f0f2f5)}.layer-item.active{background:#165dff1a;color:var(--pd-accent, #165DFF);box-shadow:inset 2px 0 0 var(--pd-accent, #165DFF)}.layer-icon{width:18px;text-align:center;font-size:12px;color:var(--pd-text-muted, #909399)}.layer-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--pd-text, #303133)}.layer-zone{flex-shrink:0;padding:0 4px;font-size:10px;line-height:14px;color:var(--pd-ink-green, #67c23a);background:#67c23a1a;border-radius:3px}.layer-zindex{font-size:10px;color:var(--pd-text-muted, #909399);font-variant-numeric:tabular-nums}.layer-actions{display:flex;gap:4px;margin-top:8px}.field-tree-panel{padding:0}.panel-title{font-size:11px;color:var(--pd-text-muted);text-transform:uppercase;letter-spacing:.5px;padding:4px 0 8px;margin-bottom:8px;border-bottom:1px solid var(--pd-border)}.search-input{margin-bottom:8px}.tree-container{overflow-y:auto;min-height:0}.field-group-header{display:flex;align-items:center;gap:4px;padding:5px 8px;border-radius:4px;font-size:13px;color:var(--pd-text, #303133);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background .1s}.field-group-header:hover{background:var(--pd-sidebar-hover, #f0f2f5)}.field-group-header.is-list{color:var(--pd-accent, #165DFF);font-weight:500}.expand-icon{width:12px;font-size:8px;flex-shrink:0;color:var(--pd-text-muted, #909399)}.field-row{display:flex;align-items:center;gap:4px;padding:5px 8px;border-radius:4px;font-size:13px;color:var(--pd-text, #303133);cursor:grab;-webkit-user-select:none;user-select:none;transition:background .1s}.field-row:hover{background:var(--pd-sidebar-hover, #f0f2f5)}.node-icon{font-size:14px;flex-shrink:0;filter:saturate(.6);opacity:.9}.node-meta{flex:1;min-width:0;display:flex;flex-wrap:wrap;align-items:center;column-gap:4px;row-gap:1px}.node-label{flex:1 1 auto;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.node-key{flex:0 1 auto;min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:var(--pd-text-muted, #909399)}.field-row .node-key.is-primary{font-size:13px;color:var(--pd-text, #303133)}.group-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.copy-hint{flex-shrink:0;margin-left:auto;font-size:11px;color:var(--pd-accent, #165DFF);white-space:nowrap}.left-panel{width:248px;min-width:248px;background:var(--pd-sidebar, #ffffff);border-right:1px solid var(--pd-border-soft, #e9ecf2);display:flex;flex-direction:column;overflow:hidden;transition:width .18s ease}.left-panel.collapsed{width:36px;min-width:36px;border-right:1px solid var(--pd-border-soft, #e9ecf2)}.left-collapsed{display:flex;flex-direction:column;align-items:center;gap:8px;padding-top:12px;flex:1}.lc-btn{width:26px;height:26px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--pd-text-muted, #8b909c);font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .14s ease}.lc-btn:hover{color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.lc-btn.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.left-head{display:flex;align-items:center;justify-content:space-between;height:42px;padding:0 12px;flex-shrink:0;border-bottom:1px solid var(--pd-border-soft, #e9ecf2)}.left-title{font-size:12px;font-weight:600;color:var(--pd-text, #2a2e37);letter-spacing:1.2px;display:inline-flex;align-items:center;gap:7px}.left-title:before{content:"";width:3px;height:12px;border-radius:2px;background:linear-gradient(180deg,var(--pd-accent-2, #3D7BFF),var(--pd-accent, #165DFF))}.left-tabs{flex:1;display:flex;flex-direction:column;overflow:hidden}.left-tabs .pd-tab-pane{flex:1;min-height:0;overflow-y:auto;padding:12px}.material-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-content:start}.material-grid>.panel-title,.material-grid>.material-group-title,.material-grid>.material-card--wide{grid-column:1 / -1}.material-grid>.panel-title,.material-grid>.material-group-title{margin-bottom:0}.material-grid>.material-card{margin-bottom:0;min-width:0}.panel-title{font-size:11px;color:var(--pd-text-muted, #8b909c);letter-spacing:.6px;padding:2px 2px 8px;margin-bottom:10px;border-bottom:1px solid var(--pd-border-soft, #e9ecf2)}.material-group-title{font-size:11px;color:var(--pd-text-muted, #8b909c);letter-spacing:.6px;padding:4px 2px 6px;margin:2px 0 8px;border-bottom:1px solid var(--pd-border-soft, #e9ecf2)}.material-card{position:relative;display:flex;align-items:center;gap:9px;padding:7px 8px;border:1px solid var(--pd-border-soft, #e9ecf2);border-radius:7px;background:transparent;cursor:grab;-webkit-user-select:none;user-select:none;transition:background .16s ease,border-color .16s ease,transform .16s ease,box-shadow .16s ease}.material-card:before{content:"";position:absolute;left:0;top:50%;width:2px;height:0;border-radius:2px;background:var(--pd-accent, #165DFF);transform:translateY(-50%);transition:height .16s ease}.material-card:hover{background:var(--pd-hover-tint, #ecf5ff);border-color:#165dff73;transform:translate(2px)}.material-card:hover:before{height:56%}.material-card:active{cursor:grabbing;transform:translate(2px) scale(.985)}.material-icon{width:30px;height:30px;border:0;border-radius:7px;display:flex;align-items:center;justify-content:center;color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09));box-shadow:inset 0 0 0 1px #165dff1f;flex-shrink:0;transition:background .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease}.material-card:hover .material-icon{background:var(--pd-accent, #165DFF);color:#fff;box-shadow:0 2px 6px #165dff47}.material-card:active .material-icon{transform:scale(.92)}.material-label{min-width:0;flex:1;font-size:12.5px;font-weight:500;line-height:1.3;color:var(--pd-text, #2a2e37);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:color .16s ease}.material-card:hover .material-label{color:var(--pd-accent, #165DFF)}.print-image{width:100%;height:100%;overflow:hidden}.print-image img{width:100%;height:100%;display:block}.table-ctx-menu{position:fixed;z-index:3000;min-width:140px;padding:4px 0;background:var(--pd-surface, #fff);border:1px solid var(--pd-menu-border, #dcdfe6);border-radius:4px;box-shadow:0 2px 12px #00000026;font-size:13px}.menu-item{padding:5px 14px;cursor:pointer;color:var(--pd-menu-text, #333)}.menu-item:hover{background:var(--pd-menu-hover, #f5f7fa)}.menu-item.disabled{color:var(--pd-menu-disabled, #c0c4cc);cursor:not-allowed}.menu-item.active{color:var(--pd-accent, #165DFF)}.menu-divider{height:1px;margin:4px 0;background:var(--pd-menu-divider, #ebeef5)}.menu-group-title{padding:4px 14px;font-size:12px;color:var(--pd-menu-muted, #909399)}.cell-barcode{width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden}.cell-barcode svg{max-width:100%;max-height:100%}.cell-barcode img{max-width:100%;max-height:100%}.cell-barcode-fallback{font-style:italic;opacity:.6}.cell-image{width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden}.cell-image img{max-width:100%;max-height:100%;display:block}.image-placeholder{width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:#bbb;font-size:12px;border:1px dashed #ddd;box-sizing:border-box}.print-table{position:relative;width:100%;height:100%}.print-table table{border-collapse:collapse;table-layout:fixed;width:100%}.print-table td{box-sizing:border-box;word-break:normal;overflow-wrap:break-word}.cell-selected{outline:2px solid #165DFF;outline-offset:-2px;background-color:#165dff14}.row-data-bg{background-image:repeating-linear-gradient(45deg,rgba(22,93,255,.04) 0 6px,transparent 6px 12px)}.data-placeholder{color:#909399;font-style:italic}.row-badges{position:absolute;left:-16px;top:0;width:14px}.row-badge{position:absolute;width:14px;display:flex;align-items:center;justify-content:center;font-size:10px;color:#909399;background:#f5f7fa;border-radius:2px}.col-resize-layer{position:absolute;inset:0;pointer-events:none;z-index:3}.col-resize-handle{position:absolute;top:0;bottom:0;width:6px;transform:translate(-50%);cursor:col-resize;pointer-events:auto}.col-resize-handle:after{content:"";position:absolute;top:0;bottom:0;left:50%;border-left:1px solid transparent}.col-resize-handle:hover:after,.col-resize-handle.dragging:after{border-left-color:var(--pd-accent, #165DFF)}.print-barcode{width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden}.print-barcode svg{max-width:100%;max-height:100%}.print-qrcode{width:100%;height:100%;display:flex;align-items:center;justify-content:center;overflow:hidden}.print-qrcode img{max-width:100%;max-height:100%}.print-html,.page-number-element{width:100%;height:100%;overflow:hidden}.print-element{box-sizing:border-box;cursor:pointer;-webkit-user-select:none;user-select:none}.extension-placeholder{display:flex;align-items:center;justify-content:center;width:100%;height:100%;box-sizing:border-box;padding:2px;font-size:11px;line-height:1.4;text-align:center;color:var(--pd-text-muted, #8b909c);background:repeating-linear-gradient(45deg,#f4f6fa,#f4f6fa 6px,#fff 6px 12px);overflow:hidden}.element-margin-guide{position:absolute;box-sizing:border-box;pointer-events:none}.print-element.design-mode{outline:1px dashed #C3C9D6}.print-element.design-mode.zone-header,.print-element.design-mode.zone-footer{outline:1px dashed var(--pd-ink-green, #67c23a)}.print-element.selected{outline:1.5px solid var(--pd-accent, #165DFF);background:#165dff0a}.print-element.previewed{outline:1.5px solid rgba(22,93,255,.5);background:#165dff1a}.print-element.design-mode:hover{outline:1px dashed var(--pd-accent, #165DFF)}.print-element.locked{cursor:not-allowed}.print-element.locked:not(.selected){outline:1.5px dashed #999}.print-element.hidden{opacity:.3;pointer-events:none}.print-element.drag-ghost{opacity:.4}.drag-preview{position:absolute;inset:0;border:2px dashed var(--pd-accent, #165DFF);pointer-events:none;z-index:1000;box-sizing:border-box}.selected-indicator{position:absolute;top:-18px;left:0;font-size:10px;white-space:nowrap;pointer-events:none;z-index:20}.position-label{background:var(--pd-accent, #165DFF);color:#fff;padding:1px 6px;border-radius:3px;font-family:ui-monospace,SF Mono,Menlo,monospace;font-size:10px;font-variant-numeric:tabular-nums;letter-spacing:0;box-shadow:0 2px 6px #00000026}.resize-handles{position:absolute;inset:0;pointer-events:none}.resize-handle{position:absolute;width:7px;height:7px;background:var(--pd-handle, #165DFF);border:1.5px solid #fff;border-radius:2px;box-sizing:border-box;transform:translate(-50%,-50%);box-shadow:0 1px 3px #0000002e;z-index:10;pointer-events:auto}.handle-nw{top:0;left:0;cursor:nw-resize}.handle-n{top:0;left:50%;cursor:n-resize}.handle-ne{top:0;left:100%;cursor:ne-resize}.handle-e{top:50%;left:100%;cursor:e-resize}.handle-se{top:100%;left:100%;cursor:se-resize}.handle-s{top:100%;left:50%;cursor:s-resize}.handle-sw{top:100%;left:0;cursor:sw-resize}.handle-w{top:50%;left:0;cursor:w-resize}.paper-wrapper{display:block}.hiprint-printPaper{transition:transform .15s ease-out}.zone-layer{box-sizing:border-box}.zone-layer.zone-header.design-mode,.zone-layer.zone-footer.design-mode{outline:1px dashed var(--pd-ink-green, #67c23a);background:#67c23a0a}.zone-layer.zone-content.design-mode{outline:1px dashed #C3C9D6}.zone-label{position:absolute;top:2px;right:4px;font-size:9px;color:#909399;pointer-events:none;-webkit-user-select:none;user-select:none}.zone-resize-handle{position:absolute;left:0;width:100%;height:6px;cursor:ns-resize;z-index:5}.zone-resize-handle.handle-bottom{bottom:-3px}.zone-resize-handle.handle-top{top:-3px}.zone-resize-handle:hover{background:#10b98140}.zone-height-tip{position:absolute;right:4px;top:-22px;padding:1px 6px;font-size:11px;color:#fff;background:#10b981;border-radius:3px;white-space:nowrap;pointer-events:none}.design-background{position:absolute;z-index:0;overflow:hidden;pointer-events:none}.design-background img{display:block;width:100%;height:100%;object-fit:fill;pointer-events:none;-webkit-user-select:none;user-select:none;-webkit-user-drag:none}.grid-bg{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:0}.snap-indicator{position:absolute;width:6px;height:6px;background:var(--pd-accent, #165DFF);border-radius:50%;transform:translate(-50%,-50%);pointer-events:none;z-index:10;animation:snap-pulse-3160f418 .3s ease-out}@keyframes snap-pulse-3160f418{0%{transform:translate(-50%,-50%) scale(2);opacity:.5}to{transform:translate(-50%,-50%) scale(1);opacity:0}}.watermark-layer{position:absolute;top:0;left:0;width:100%;height:100%;z-index:0;overflow:hidden;pointer-events:none}.watermark-tile{position:absolute;pointer-events:none}.adsorb-guide{position:absolute;pointer-events:none;z-index:9999}.adsorb-guide.guide-vertical{border-left:1px dashed var(--pd-accent-secondary, #f56c6c)}.adsorb-guide.guide-horizontal{border-top:1px dashed var(--pd-accent-secondary, #f56c6c)}.manual-guide{position:absolute;pointer-events:auto;z-index:9998;cursor:move}.manual-guide.guide-vertical{border-left:1px solid #3B82F6;width:0}.manual-guide.guide-horizontal{border-top:1px solid #3B82F6;height:0}.manual-guide:before{content:"";position:absolute;pointer-events:auto}.manual-guide.guide-vertical:before{top:0;bottom:0;left:50%;width:var(--guide-hit, 8px);transform:translate(-50%)}.manual-guide.guide-horizontal:before{left:0;right:0;top:50%;height:var(--guide-hit, 8px);transform:translateY(-50%)}.manual-guide:hover{border-color:#ef4444!important}.pd-ruler{position:absolute;display:block;pointer-events:auto;cursor:crosshair;z-index:1;background:var(--pd-ruler-bg, #f8f9fc)}.pd-ruler.is-horizontal{box-shadow:0 1px 0 var(--pd-border-soft, #e9ecf2)}.pd-ruler.is-vertical{box-shadow:1px 0 0 var(--pd-border-soft, #e9ecf2)}.canvas-area{flex:1;overflow-x:scroll;overflow-y:auto;scrollbar-gutter:stable;display:flex;background-color:var(--pd-canvas-bg, #e6e9f0);background-image:radial-gradient(circle,rgba(23,32,60,.13) 1px,transparent 1.2px);background-size:20px 20px;background-position:center;padding:44px 28px 32px 44px;position:relative}.canvas-scroll{display:flex;flex-direction:column;align-items:center;gap:20px;position:relative;flex:none;margin:auto;width:fit-content}.marquee-selection{position:fixed;border:1.5px solid rgba(22,93,255,.7);background:#165dff14;border-radius:2px;pointer-events:none;z-index:10000}.drop-hint{position:fixed;z-index:10002;pointer-events:none;padding:2px 8px;border-radius:10px;background:var(--pd-accent, #165dff);color:#fff;font-size:12px;line-height:18px;white-space:nowrap;box-shadow:0 2px 8px #0000002e}.context-menu{position:fixed;background:var(--pd-surface, #ffffff);border:1px solid var(--pd-border-soft, #e9ecf2);border-radius:8px;box-shadow:var(--pd-shadow-md, 0 10px 28px rgba(23, 32, 60, .12));padding:5px;z-index:10001;min-width:132px}.context-menu-item{padding:7px 12px;border-radius:5px;font-size:12.5px;cursor:pointer;color:var(--pd-text, #2a2e37);-webkit-user-select:none;user-select:none;transition:background .12s ease,color .12s ease}.context-menu-item:hover{background:var(--pd-accent-soft, rgba(22, 93, 255, .09));color:var(--pd-accent, #165DFF)}.context-menu-item.disabled{color:var(--pd-text-faint, #b4b9c4);cursor:not-allowed}.context-menu-item.disabled:hover{background:transparent;color:var(--pd-text-faint, #b4b9c4)}.context-menu-sep{height:1px;background:var(--pd-border-soft, #e9ecf2);margin:5px 8px}.ruler-overlay{position:absolute;inset:0;pointer-events:none;z-index:60}.ruler-corner{position:absolute;top:0;left:0;width:22px;height:22px;background:var(--pd-ruler-bg, #f8f9fc);box-shadow:1px 1px 0 var(--pd-border-soft, #e9ecf2);z-index:2}.ruler-overlay .pd-ruler.is-horizontal{top:0;left:22px}.ruler-overlay .pd-ruler.is-vertical{top:22px;left:0}.ruler-guide-preview{position:fixed;pointer-events:none;z-index:9997}.ruler-guide-preview.guide-vertical{width:0;border-left:1px dashed var(--pd-accent, #165dff)}.ruler-guide-preview.guide-horizontal{height:0;border-top:1px dashed var(--pd-accent, #165dff)}.property-search{padding:0 0 10px;background:transparent}.property-group{border:1px solid var(--pd-border-soft, #e9ecf2);border-radius:8px;margin-bottom:10px;background:var(--pd-surface, #ffffff);overflow:hidden;transition:border-color .14s ease,box-shadow .14s ease}.property-group:last-child{margin-bottom:2px}.property-group.is-expanded{border-color:var(--pd-border-soft, #e9ecf2)}.group-header{display:flex;align-items:center;padding:9px 12px;cursor:pointer;-webkit-user-select:none;user-select:none;background:var(--pd-field-bg, #f4f6fa);transition:background .14s ease}.group-header:hover{background:var(--pd-sidebar-hover, #f0f3f9)}.property-group.is-expanded .group-header{border-bottom:1px solid var(--pd-border-soft, #e9ecf2)}.group-icon{margin-right:8px;color:var(--pd-accent, #165DFF)}.group-title{flex:1;font-size:12px;font-weight:600;color:var(--pd-text, #2a2e37);letter-spacing:.3px}.expand-icon{color:var(--pd-text-muted, #8b909c);font-size:10px}.group-content{padding:10px 12px 12px;background:var(--pd-surface, #ffffff)}.position-grid,.margin-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.margin-grid{margin-top:8px}.pd-crop-note{margin:0 0 8px;font-size:12px;line-height:1.5;color:var(--pd-text-faint, #6b7280)}.pd-crop-preview{position:relative;overflow:hidden;margin-bottom:8px;border:1px solid var(--pd-border, #d9dde6);border-radius:4px;line-height:0;width:fit-content;max-width:100%}.pd-crop-thumb{max-width:100%;max-height:96px;display:block}.pd-crop-win{position:absolute;border:1px solid #ff5a5a;box-shadow:0 0 0 999px #0000008c;pointer-events:none}.color-row{display:flex;gap:12px}.color-row>.pd-field{flex:1 1 0;min-width:0}.pd-rotate-row{display:flex;align-items:stretch;width:100%}.pd-rotate-btn{width:26px;flex-shrink:0;border:1px solid var(--pd-border, #d9dde6);background:var(--pd-field-bg, #f4f6fa);color:var(--pd-text, #2a2e37);font-size:14px;line-height:1;cursor:pointer;transition:background .14s ease,border-color .14s ease}.pd-rotate-btn:hover{background:var(--pd-sidebar-hover, #f0f3f9);border-color:var(--pd-text-faint, #b4b9c4)}.pd-rotate-btn:first-child{border-radius:6px 0 0 6px;border-right:none}.pd-rotate-btn:last-child{border-radius:0 6px 6px 0;border-left:none}.pd-rotate-stepper{flex:1;min-width:0}.pd-rotate-stepper .pd-step-minus,.pd-rotate-stepper .pd-step-plus{display:none}.pd-rotate-stepper .pd-step-input.pd-input{border-radius:0}.expression-editor{display:flex;height:450px;gap:0}.ee-nav{width:100px;background:var(--pd-sidebar);border-right:1px solid var(--pd-border);display:flex;flex-direction:column;flex-shrink:0}.ee-nav-title{padding:10px;border-bottom:1px solid var(--pd-border);font-weight:600;font-size:13px;color:var(--pd-text);text-align:center}.ee-nav-tabs{flex:1;display:flex;flex-direction:column;padding:6px;gap:4px}.ee-nav-tab{padding:8px 10px;border-radius:6px;cursor:pointer;font-size:12px;text-align:center;transition:all .2s}.ee-nav-tab.active{background:var(--pd-accent);color:#fff}.ee-nav-tab:not(.active){background:var(--pd-surface, white);border:1px solid var(--pd-border);color:var(--pd-text)}.ee-nav-tab:hover:not(.active){background:var(--pd-hover-tint, #ecf5ff);border-color:var(--pd-accent)}.ee-content{width:300px;display:flex;flex-direction:column;border-right:1px solid var(--pd-border);flex-shrink:0}.ee-content-search{padding:10px;border-bottom:1px solid var(--pd-border)}.ee-content-list{flex:1;padding:8px;overflow-y:auto;min-height:0}.ee-func-group{margin-bottom:12px}.ee-func-group-title{font-size:11px;font-weight:600;color:var(--pd-text-muted);padding:6px 10px;margin-bottom:2px;letter-spacing:.5px}.ee-field-group{display:flex;align-items:center;gap:4px;padding:6px 10px;font-size:12px;font-weight:600;color:var(--pd-text)}.ee-field-group.is-list{color:var(--pd-accent, #165DFF)}.ee-field-group-icon{font-size:13px;filter:saturate(.6)}.ee-list-item{padding:7px 10px;cursor:pointer;border-radius:4px;margin-bottom:2px;transition:background .15s}.ee-field-info{display:flex;flex-direction:column;gap:1px}.ee-field-info .ee-item-label{font-size:12px;color:var(--pd-text)}.ee-field-info .ee-item-key{font-size:10px;color:var(--pd-text-muted);font-family:monospace}.ee-field-info .ee-item-key.is-primary{font-size:12px;color:var(--pd-text, #303133);font-family:inherit}.ee-field-item{display:flex;align-items:center;gap:6px}.ee-field-item .ee-field-info{flex:1;min-width:0}.ee-copy-btn{flex-shrink:0;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;border:1px solid transparent;border-radius:4px;background:transparent;color:var(--pd-text-muted);cursor:pointer;transition:color .15s,background .15s,border-color .15s}.ee-copy-btn:hover{background:var(--pd-surface, white);border-color:var(--pd-border);color:var(--pd-accent)}.ee-copy-btn.is-copied{color:var(--pd-success, #16a34a)}.ee-list-item:hover{background:var(--pd-hover-tint, #ecf5ff)}.ee-editor{flex:1;display:flex;flex-direction:column;background:var(--pd-sidebar);min-width:0}.ee-editor-section{padding:12px;border-bottom:1px solid var(--pd-border)}.ee-editor-title{font-size:11px;color:var(--pd-text-muted);margin-bottom:6px;text-transform:uppercase;letter-spacing:.5px}.ee-textarea{width:100%;border:1px solid var(--pd-border);border-radius:6px;padding:10px;font-family:monospace;font-size:13px;resize:vertical;box-sizing:border-box;min-height:100px}.ee-textarea:focus{outline:none;border-color:var(--pd-accent)}.ee-preview{padding:10px;background:var(--pd-bg);border:1px solid var(--pd-border);border-radius:6px;min-height:30px;font-size:13px;color:var(--pd-text);line-height:1.6;white-space:pre-wrap}.ee-preview-error{color:var(--pd-danger, #e53e3e);background:var(--pd-danger-bg, #fef2f2);border-color:var(--pd-danger-border, #fecaca)}.ee-help-section{flex:1;padding:12px;overflow-y:auto;min-height:0}.ee-help-title{font-size:11px;color:var(--pd-text-muted);margin-bottom:8px;text-transform:uppercase;letter-spacing:.5px}.ee-help-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px}.ee-help-card{border-radius:6px;padding:10px}.ee-help-card-title{font-size:12px;font-weight:600;margin-bottom:4px}.ee-help-card-content{font-size:11px;line-height:1.5;color:var(--pd-text)}.ee-help-field{background:var(--pd-help-field-bg, #f0f9ff);border:1px solid var(--pd-help-field-line, #bae6fd)}.ee-help-field .ee-help-card-title{color:var(--pd-help-field-ink, #0369a1)}.ee-help-function{background:var(--pd-help-function-bg, #f0fdf4);border:1px solid var(--pd-help-function-line, #bbf7d0)}.ee-help-function .ee-help-card-title{color:var(--pd-help-function-ink, #166534)}.ee-help-variable{background:var(--pd-help-variable-bg, #fefce8);border:1px solid var(--pd-help-variable-line, #fde68a)}.ee-help-variable .ee-help-card-title{color:var(--pd-help-variable-ink, #854d0e)}.ee-help-conditional{background:var(--pd-help-conditional-bg, #fdf2f8);border:1px solid var(--pd-help-conditional-line, #fbcfe8)}.ee-help-conditional .ee-help-card-title{color:var(--pd-help-conditional-ink, #9d174d)}.expression-editor{max-height:min(600px,80vh);overflow-y:auto;padding:16px}.col-width-row{display:flex;align-items:center;gap:8px;margin-bottom:4px;width:100%}.border-row{display:flex;gap:10px}.border-row .pd-field{flex:1;min-width:0}.advanced-row{display:flex;gap:16px}.group-help{flex:0 0 auto;width:18px;height:18px;margin-right:6px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--pd-text-muted, #8b909c);font-size:12px;line-height:18px;cursor:pointer}.group-help:hover{background:var(--pd-accent-soft, rgba(22, 93, 255, .09));color:var(--pd-accent, #165DFF)}.group-help:focus-visible{outline:2px solid var(--pd-accent, #165DFF);outline-offset:1px}.image-content-upload{display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin-top:4px}.upload-tip{margin:0;font-size:11px;color:var(--pd-text-muted, #909399)}.cell-style-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 8px}.cell-font-field{grid-column:1 / -1;padding-bottom:8px}.border-style-row{display:flex;gap:6px;margin-bottom:8px}.border-presets{margin-bottom:8px}.merge-btns{display:flex;gap:8px}.merge-card{margin-top:8px;padding:8px;border:1px solid var(--pd-border, #dcdfe6);border-radius:6px}.merge-card-title{font-size:12px;font-weight:600;color:var(--pd-text, #303133);margin-bottom:8px}.merge-card-divider{height:1px;background:var(--pd-menu-divider, #ebeef5);margin:8px 0}.merge-card-hint{margin-top:6px;font-size:11px;line-height:1.4;color:var(--pd-text-muted, #8b909c)}.watermark-config{padding:0 4px}.pd-hint{margin-left:8px;font-size:12px;color:#909399;min-width:32px}.design-background-config{padding:0 4px}.design-background-tip{margin:2px 0 6px;font-size:11px;line-height:1.4;color:var(--pd-text-muted, #909399)}.design-background-path{margin-bottom:6px;padding:4px 6px;font-size:11px;color:var(--pd-text-regular, #606266);background:var(--pd-fill-light, #f5f7fa);border-radius:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.design-background-actions{display:flex;gap:6px}.upload-label{cursor:pointer}.upload-label.disabled{opacity:.6;cursor:not-allowed}.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}.tiling-config{padding:0 4px}.tiling-switch{display:flex;align-items:center;gap:6px;font-size:12px;cursor:pointer}.tiling-error{color:#f56c6c}.tiling-summary{color:var(--pd-text-regular, #606266)}.property-panel{width:304px;min-width:304px;background:var(--pd-sidebar, #ffffff);border-left:1px solid var(--pd-border-soft, #e9ecf2);display:flex;flex-direction:column;overflow:hidden;transition:width .18s ease}.property-panel.collapsed{width:36px;min-width:36px;border-left:1px solid var(--pd-border-soft, #e9ecf2)}.prop-collapsed{display:flex;flex-direction:column;align-items:center;gap:8px;padding-top:12px;flex:1}.pc-btn{width:26px;height:26px;border-radius:6px;border:1px solid transparent;background:transparent;color:var(--pd-text-muted, #8b909c);font-size:12px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .14s ease}.pc-btn:hover{color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.pc-btn.on{color:var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.prop-head{display:flex;align-items:center;justify-content:space-between;height:42px;padding:0 12px;flex-shrink:0;border-bottom:1px solid var(--pd-border-soft, #e9ecf2)}.prop-title{font-size:12px;font-weight:600;color:var(--pd-text, #2a2e37);letter-spacing:1.2px;display:inline-flex;align-items:center;gap:7px}.prop-title:before{content:"";width:3px;height:12px;border-radius:2px;background:linear-gradient(180deg,var(--pd-accent-2, #3D7BFF),var(--pd-accent, #165DFF))}.collapse-btn{border:none;background:transparent;color:var(--pd-text-muted, #8b909c);font-size:14px;cursor:pointer;width:24px;height:24px;border-radius:5px;transition:all .14s ease}.collapse-btn:hover{color:var(--pd-text, #2a2e37);background:var(--pd-sidebar-hover, #f0f3f9)}.prop-tabs{flex:1;display:flex;flex-direction:column;overflow:hidden}.prop-tabs .pd-tab-pane{flex:1;min-height:0;overflow-y:auto;padding:12px}.property-content{padding:0}.margin-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}.custom-size-grid{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:4px;width:100%}.custom-size-x{color:var(--pd-text-muted, #8b909c);font-size:12px}.pd-hint{margin:2px 0 6px;color:var(--pd-text-muted, #8b909c);font-size:12px;line-height:1.4}.page-bg-row{display:flex;align-items:center;gap:8px}.page-bg-picker{flex:1;min-width:0}.status-bar{position:relative;display:flex;align-items:center;gap:20px;height:30px;padding:0 16px;background:var(--pd-surface, #ffffff);border-top:1px solid var(--pd-border-soft, #e9ecf2);box-shadow:0 -1px 2px #17203c08;font-size:11.5px;color:var(--pd-text-muted, #8b909c);-webkit-user-select:none;user-select:none;flex-shrink:0}.status-item{white-space:nowrap;font-variant-numeric:tabular-nums;display:inline-flex;align-items:center}.coord{font-variant-numeric:tabular-nums;color:var(--pd-text, #2a2e37)}.status-paper{margin-left:auto;font-variant-numeric:tabular-nums;color:var(--pd-accent, #165DFF);font-weight:600}.status-version{font-variant-numeric:tabular-nums;color:var(--pd-text-muted, #8b909c)}.help-modal-overlay{position:fixed;inset:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:1000}.help-modal{width:800px;max-width:90vw;height:600px;max-height:85vh;background:var(--pd-surface, #ffffff);border-radius:8px;box-shadow:0 4px 24px #00000026;display:flex;flex-direction:column;overflow:hidden}.help-modal-header{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--pd-border, #d9dde6)}.help-modal-title{margin:0;font-size:16px;font-weight:600;color:var(--pd-text, #2a2e37)}.help-modal-title-wrap{display:flex;align-items:center;gap:10px}.help-modal-project{padding:2px 8px;border-radius:4px;background:var(--pd-accent-soft, rgba(22, 93, 255, .09));color:var(--pd-accent, #165DFF);font-size:12px;font-weight:500}.help-modal-close{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:4px;background:transparent;color:var(--pd-text-muted, #8b909c);font-size:20px;cursor:pointer;transition:all .15s}.help-modal-close:hover{background:var(--pd-sidebar-hover, #f0f3f9);color:var(--pd-text, #2a2e37)}.help-modal-body{flex:1;display:flex;overflow:hidden}.help-modal-sidebar{width:160px;padding:12px;border-right:1px solid var(--pd-border, #d9dde6);background:var(--pd-field-bg, #f4f6fa);overflow-y:auto}.help-tab{display:block;width:100%;padding:10px 12px;margin-bottom:4px;border:none;border-radius:4px;background:transparent;color:var(--pd-text, #2a2e37);font-size:13px;text-align:left;cursor:pointer;transition:all .15s}.help-tab:hover{background:var(--pd-sidebar-hover, #f0f3f9)}.help-tab.active{background:var(--pd-accent-soft, rgba(22, 93, 255, .09));color:var(--pd-accent, #165DFF);font-weight:500}.help-modal-content{flex:1;padding:20px;overflow-y:auto}.help-content{font-size:14px;line-height:1.6;color:var(--pd-text, #2a2e37)}.help-content h2{margin:0 0 16px;padding-bottom:8px;border-bottom:1px solid var(--pd-border-soft, #e9ecf2);font-size:18px;font-weight:600}.help-content h3{margin:20px 0 12px;font-size:15px;font-weight:600}.help-content p{margin:0 0 12px}.help-content ul,.help-content ol{margin:0 0 12px;padding-left:24px}.help-content li{margin-bottom:4px}.help-content code{padding:2px 6px;border-radius:3px;background:var(--pd-field-bg, #f4f6fa);font-family:SF Mono,Monaco,monospace;font-size:13px}.help-content pre{margin:0 0 12px;padding:12px;border-radius:4px;background:var(--pd-field-bg, #f4f6fa);overflow-x:auto}.help-content pre code{padding:0;background:transparent}.help-content table{width:100%;margin:0 0 12px;border-collapse:collapse}.help-content th,.help-content td{padding:8px 12px;border:1px solid var(--pd-border, #d9dde6);text-align:left}.help-content th{background:var(--pd-field-bg, #f4f6fa);font-weight:600}.help-content blockquote{margin:0 0 12px;padding:12px 16px;border-left:3px solid var(--pd-accent, #165DFF);background:var(--pd-accent-soft, rgba(22, 93, 255, .09))}.help-modal-enter-active,.help-modal-leave-active{transition:opacity .2s ease}.help-modal-enter-active .help-modal,.help-modal-leave-active .help-modal{transition:transform .2s ease}.help-modal-enter-from,.help-modal-leave-to{opacity:0}.help-modal-enter-from .help-modal,.help-modal-leave-to .help-modal{transform:scale(.95)}.page-tabs{display:flex;align-items:center;gap:8px;padding:4px 12px;background:var(--pd-sidebar, #fff);border-bottom:1px solid var(--pd-border, #d9dde6);flex-shrink:0}.page-tabs-list{display:flex;gap:4px;overflow-x:auto;align-items:center}.page-tab{padding:4px 12px;border:1px solid var(--pd-border, #d9dde6);border-radius:4px;background:transparent;cursor:pointer;white-space:nowrap;color:var(--pd-text, #2a2e37);font-size:12px}.page-tab.active{background:var(--pd-accent, #165DFF);color:#fff}.page-tab-rename{padding:4px 8px;width:96px;border:1px solid var(--pd-accent, #165DFF);border-radius:4px;font-size:12px;color:var(--pd-text, #2a2e37);outline:none}.page-tabs-actions{display:flex;gap:4px;margin-left:auto}.page-tabs-actions button{padding:4px 8px;border:1px solid var(--pd-border, #d9dde6);border-radius:4px;background:transparent;cursor:pointer;color:var(--pd-text-muted, #8b909c);font-size:12px;line-height:1}.page-tabs-actions button:disabled{opacity:.4;cursor:not-allowed}.designer-container{--pd-bg: #f3f5f9;--pd-surface: #ffffff;--pd-field-bg: #f4f6fa;--pd-sidebar: #ffffff;--pd-sidebar-hover: #f0f3f9;--pd-canvas-bg: #e6e9f0;--pd-paper: #FFFFFF;--pd-accent: #165DFF;--pd-accent-2: #3D7BFF;--pd-accent-soft: rgba(22, 93, 255, .09);--pd-accent-secondary: #f56c6c;--pd-danger-soft: rgba(245, 108, 108, .1);--pd-ink-green: #67c23a;--pd-text: #2a2e37;--pd-text-muted: #8b909c;--pd-text-faint: #b4b9c4;--pd-border: #d9dde6;--pd-border-soft: #e9ecf2;--pd-input-bg: #ffffff;--pd-hover-tint: #ecf5ff;--pd-danger: #e53e3e;--pd-danger-bg: #fef2f2;--pd-danger-border: #fecaca;--pd-menu-text: #333;--pd-menu-hover: #f5f7fa;--pd-menu-border: #dcdfe6;--pd-menu-divider: #ebeef5;--pd-menu-muted: #909399;--pd-menu-disabled: #c0c4cc;--pd-scrollbar: rgba(23, 32, 60, .18);--pd-scrollbar-thumb: rgba(23, 32, 60, .16);--pd-scrollbar-thumb-hover: rgba(23, 32, 60, .3);--pd-help-field-bg: #f0f9ff;--pd-help-field-line: #bae6fd;--pd-help-field-ink: #0369a1;--pd-help-function-bg: #f0fdf4;--pd-help-function-line: #bbf7d0;--pd-help-function-ink: #166534;--pd-help-variable-bg: #fefce8;--pd-help-variable-line: #fde68a;--pd-help-variable-ink: #854d0e;--pd-help-conditional-bg: #fdf2f8;--pd-help-conditional-line: #fbcfe8;--pd-help-conditional-ink: #9d174d;--pd-handle: #165DFF;--pd-ruler: #9aa1af;--pd-ruler-bg: #f8f9fc;--pd-ruler-cursor: #165DFF;--pd-radius: 6px;--pd-shadow-sm: 0 1px 2px rgba(23, 32, 60, .05);--pd-shadow-md: 0 2px 8px rgba(23, 32, 60, .06), 0 10px 28px rgba(23, 32, 60, .07);--pd-shadow-paper: 0 0 0 1px rgba(23, 32, 60, .05), 0 1px 2px rgba(23, 32, 60, .06), 0 8px 20px rgba(23, 32, 60, .08), 0 26px 60px rgba(23, 32, 60, .15);--pd-success: #16a34a;--pd-text-regular: #606266;--pd-fill-light: #f5f7fa;height:100%;display:flex;flex-direction:column;background:var(--pd-bg)}.designer-body{flex:1;display:flex;overflow:hidden}.designer-container.format-painting .canvas-area,.designer-container.format-painting .canvas-area *{cursor:copy!important}.print-html-preview{width:100%;height:100%;position:relative;background:#e9ebee}.print-html-preview-iframe{width:100%;height:100%;border:0;background:#fff}.print-html-preview-loading,.print-html-preview-error{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;color:#909399;font-size:14px}.print-html-preview-error{color:#f56c6c}.print-html-preview-warn{position:absolute;top:8px;left:12px;z-index:2;max-width:62%;padding:4px 8px;border:1px solid #e6a23c;border-radius:4px;background:#faecd1f0;color:#b88230;font-size:12px;line-height:1.5}.print-html-preview-zoom{position:absolute;top:8px;right:12px;z-index:2;display:flex;align-items:center;gap:4px;padding:3px 4px;border:1px solid var(--pd-border-soft, #ebeef5);border-radius:6px;background:#ffffffeb;box-shadow:0 1px 4px #00000014}.print-html-preview-zoom-btn{padding:2px 7px;border:0;border-radius:4px;background:transparent;color:var(--pd-text-muted, #909399);font-size:11px;line-height:18px;cursor:pointer;transition:color .14s ease,background .14s ease}.print-html-preview-zoom-btn:hover{background:var(--pd-sidebar-hover, #f0f3f9);color:var(--pd-text, #2a2e37)}.print-html-preview-zoom-btn.active{background:var(--pd-accent, #165DFF);color:#fff;font-weight:600}.print-html-preview-zoom-note{padding-right:4px;color:var(--pd-text-muted, #909399);font-size:11px}.print-html-preview-zoom-hint{color:#b88230;font-size:11px}.advanced-row{display:flex;flex-direction:column;gap:10px}.advanced-row .pd-label,.advanced-row .pd-label-t{white-space:nowrap}.tiling-config .margin-grid,.tiling-config .custom-size-grid{display:block;grid-template-columns:none;gap:normal}.tiling-config .custom-size-x{display:inline;min-width:0;color:inherit}.pd-hint{min-width:auto}.watermark-config .pd-hint{min-width:32px;margin-left:8px;color:#909399}.tiling-config .tiling-error{color:#f56c6c}.tiling-config .tiling-summary{color:var(--pd-text-regular, #606266)}.pd-help{position:static}.pd-help:after{top:calc(100% + 6px);bottom:auto;left:0;transform:none;padding:5px 7px;white-space:normal;z-index:120}.page-tabs [data-tip]:after,.field-tree-panel [data-tip]:after{content:none}',va=20;function fg(e){try{const t=JSON.parse(e);if(t&&typeof t=="object"&&!Array.isArray(t))return t}catch{}}const J3=".page-tabs, .field-tree-panel, .pd-dialog-overlay",Q3=new Set(["z","y","a","c","x","v","d","g","1","l","r","e","t","b","0"]),hg="print-studio:left",mg="print-studio:right";function gg(e){try{return localStorage.getItem(e)==="1"}catch{return!1}}function bg(e,t){try{localStorage.setItem(e,t?"1":"0")}catch{}}function up(e){let t=e;if(typeof t=="string")try{t=JSON.parse(t)}catch{return}if(Array.isArray(t))return t.filter(r=>!!r&&typeof r=="object"&&!Array.isArray(r));if(t&&typeof t=="object")return[t]}class Zt extends HTMLElement{root;store;format;unsub=null;unsubPluginUI=null;unsubDefinitions=null;pluginStyleEls=new Map;instanceDisposers=[];_lang;_messages;unsubI18n=null;measureRaf=null;state={leftTab:"elements",leftCollapsed:!1,propTab:"page",propCollapsed:!1,openDd:null,openMore:!1,collapsedGroups:new Set,renamingPage:null,fieldDisplay:"both"};geom={originX:0,originY:0,viewW:0,viewH:0,paperScale:1};static active=null;docKeydown=null;docDragend=null;ro=null;roArea=null;toolbarRo=null;scrollPos={x:0,y:0};paneScroll=new Map;marquee={visible:!1,x:0,y:0,w:0,h:0};menu={visible:!1,x:0,y:0,flipX:0,flipY:0,targetId:null};guidePreview=null;zoneResizing=null;tableMenu={visible:!1,x:0,y:0};exprTarget=null;exprMountedFor=null;helpVisible=!1;helpInitialTab;unmountHelp=null;drag=null;snapTimer=null;hoverTipEl=null;hoverTipTimer=null;resize=null;raf=0;lastSelKey="";chromeKey="";_theme="auto";_themeConfig;systemDark=!1;themeMedia=null;onThemeMediaChange=()=>{this.systemDark=this.themeMedia?.matches??!1,this.applyTheme()};appliedThemeTokens=[];uploadImage;uploadDesignBackground;_designData;set designData(t){this._designData=up(t),this.repaint()}get designData(){return this._designData}_fonts;set fonts(t){this._fonts=t,this.applyFontFace(),this.repaint()}get fonts(){return this._fonts}fontFaceStyle=null;docFontFaceStyle=null;constructor(){super(),this.root=this.attachShadow({mode:"open"});const t=document.createElement("style");t.textContent=Z3,this.root.appendChild(t),rt(g("div",{class:"designer-container",dataset:{test:"designer-container"},part:"container"}),this.root)}set template(t){this.applyTemplate(t)}get template(){return this.store?.getTemplateJson()}set fields(t){this.store.fields=(typeof t=="string"?JSON.parse(t):t)??[],this.repaint()}set isEdit(t){this.setAttribute("is-edit",String(t)),this.repaint()}set showHelp(t){this.setAttribute("show-help",String(t)),t||this.closeHelp(),this.repaint()}set showPreview(t){this.setAttribute("show-preview",String(t)),this.repaint()}set showSave(t){this.setAttribute("show-save",String(t)),this.repaint()}set fieldDisplay(t){const r=ka(t);this.state.fieldDisplay=r,this.getAttribute("field-display")!==r&&this.setAttribute("field-display",r),this.repaint()}get fieldDisplay(){return this.state.fieldDisplay??"both"}set lang(t){this._lang=t?sn(t):void 0,t===void 0?this.hasAttribute("lang")&&this.removeAttribute("lang"):this.getAttribute("lang")!==this._lang&&this.setAttribute("lang",this._lang),this.helpVisible&&this.unmountHelp&&(this.unmountHelp(),this.unmountHelp=null),this.repaint()}get lang(){return this._lang??M2()}set messages(t){this._messages=t,this.repaint()}setLocale(t){this.lang=sn(t)}set theme(t){const r=t==="dark"||t==="light"?t:"auto";this._theme=r,this.setAttribute("theme",r),this.applyTheme()}get theme(){return this._theme}set themeConfig(t){const r=typeof t=="string"?fg(t):t;this._themeConfig=r,r===void 0?this.removeAttribute("theme-config"):this.setAttribute("theme-config",JSON.stringify(r)),this.applyTheme()}get themeConfig(){return this._themeConfig}static contractVersion=Dl;static getHostContract(){return Rl()}getHostContract(){return Rl()}static get observedAttributes(){return[...Al]}attributeChangedCallback(t,r,o){if(t==="design-data"){this._designData=o===null?void 0:up(o),this.repaint();return}if(t==="theme"){this._theme=o==="dark"||o==="light"?o:"auto",this.applyTheme();return}if(t==="theme-config"){this._themeConfig=o?fg(o):void 0,this.applyTheme();return}if(t==="field-display"){this.state.fieldDisplay=ka(o),this.repaint();return}if(t==="lang"){this.lang=o??void 0;return}if(!o)return;if(t==="name"){this.repaint();return}let n;try{n=JSON.parse(o)}catch{return}t==="template"?this.applyTemplate(n):t==="fields"?(this.store.fields=n,this.repaint()):t==="fonts"&&Array.isArray(n)&&(this.fonts=n)}connectedCallback(){if(this.attachThemeMedia(),this.applyTheme(),this.store){this.applyFontFace(),this.attachDocKeys(),this.attachPluginUI(),this.attachInstanceListeners(),this.unsubI18n=_h(()=>{this._lang||this.repaint()});return}const t={},r=this.getAttribute("template");if(r)try{t.initialTemplate=JSON.parse(r)}catch{}const o=this.getAttribute("fields");if(o)try{t.initialFields=JSON.parse(o)}catch{}const n=this.getAttribute("design-data");n&&this._designData===void 0&&(this._designData=up(n)),this.store=new Bh(t),this.format=new U2(this.store),this.store.onSelectionChanged=()=>this.format.painterSyncSelection(),this.state.fieldDisplay=ka(this.getAttribute("field-display")),this.readChrome(),this.unsub=this.store.subscribe(()=>this.repaint()),this.unsubI18n=_h(()=>{this._lang||this.repaint()}),this.attachDocKeys(),this.attachPluginUI(),this.attachInstanceListeners(),this.applyFontFace(),this.repaint(),this.measureRaf=requestAnimationFrame(()=>{this.measureRaf=null,this.measureRuler()})}attachThemeMedia(){typeof window>"u"||typeof window.matchMedia!="function"||(this.detachThemeMedia(),this.themeMedia=window.matchMedia("(prefers-color-scheme: dark)"),this.systemDark=this.themeMedia.matches,this.themeMedia.addEventListener("change",this.onThemeMediaChange))}detachThemeMedia(){this.themeMedia?.removeEventListener("change",this.onThemeMediaChange),this.themeMedia=null}applyTheme(){const t=this.root.querySelector(".designer-container");if(!t)return;for(const n of this.appliedThemeTokens)t.style.removeProperty(n);if(this.appliedThemeTokens=[],(this._theme==="dark"||this._theme==="light"?this._theme:this.systemDark?"dark":"light")==="dark")for(const[n,i]of Object.entries(fw))i!==void 0&&(t.style.setProperty(n,i),this.appliedThemeTokens.push(n));const o=this._themeConfig?.overrides;if(o)for(const[n,i]of Object.entries(o))!n.startsWith("--pd-")||typeof i!="string"||(t.style.setProperty(n,i),this.appliedThemeTokens.includes(n)||this.appliedThemeTokens.push(n))}readChrome(){this.state.leftCollapsed=gg(hg),this.state.propCollapsed=gg(mg),this.chromeKey=`${this.state.leftCollapsed?1:0}|${this.state.propCollapsed?1:0}`}persistChrome(){const t=`${this.state.leftCollapsed?1:0}|${this.state.propCollapsed?1:0}`;t!==this.chromeKey&&(this.chromeKey=t,bg(hg,this.state.leftCollapsed),bg(mg,this.state.propCollapsed))}disconnectedCallback(){this.detachThemeMedia(),this.unsub?.(),this.unsub=null,this.unsubI18n?.(),this.unsubI18n=null,this.unsubPluginUI?.(),this.unsubPluginUI=null,this.unsubDefinitions?.(),this.unsubDefinitions=null,Em(),this.detachDocKeys(),this.ro?.disconnect(),this.ro=null,this.roArea=null,this.toolbarRo?.disconnect(),this.toolbarRo=null,Zt.active===this&&(Zt.active=null),Bm(),this.unmountHelp?.(),this.unmountHelp=null,this.hideHoverTip(),this.snapTimer&&(clearTimeout(this.snapTimer),this.snapTimer=null);for(const t of this.instanceDisposers)t();this.instanceDisposers=[],this.docFontFaceStyle?.remove(),this.docFontFaceStyle=null,this.measureRaf!==null&&(cancelAnimationFrame(this.measureRaf),this.measureRaf=null)}applyFontFace(){const t=Uo(this._fonts);if(!t){this.fontFaceStyle?.remove(),this.fontFaceStyle=null,this.docFontFaceStyle?.remove(),this.docFontFaceStyle=null;return}this.fontFaceStyle||(this.fontFaceStyle=document.createElement("style"),this.root.appendChild(this.fontFaceStyle)),this.fontFaceStyle.textContent=t,this.docFontFaceStyle||(this.docFontFaceStyle=document.createElement("style"),this.ownerDocument.head.appendChild(this.docFontFaceStyle)),this.docFontFaceStyle.textContent=t}attachPluginUI(){this.unsubPluginUI||(this.unsubPluginUI=O2(()=>this.repaint())),this.unsubDefinitions||(this.unsubDefinitions=jh(()=>this.repaint()))}syncPluginUIStyles(){const t=new Map;for(const{type:r,ui:o}of A2())o.styles&&t.set(r,o.styles);for(const[r,o]of[...this.pluginStyleEls])t.has(r)||(o.remove(),this.pluginStyleEls.delete(r));for(const[r,o]of t){let n=this.pluginStyleEls.get(r);n||(n=document.createElement("style"),n.setAttribute("data-plugin-ui",r),this.root.appendChild(n),this.pluginStyleEls.set(r,n)),n.textContent!==o&&(n.textContent=o)}}templateJsonWithFonts(){const t=JSON.parse(this.store.getTemplateJson()),r=this.fonts;if(!r?.length)return t;if(Array.isArray(t.pages)){const o=t;return{...o,pages:o.pages.map(n=>({...n,fonts:[...r]}))}}return{...t,fonts:[...r]}}getTemplateJson(){return JSON.stringify(this.templateJsonWithFonts())}loadTemplate(t){this.applyTemplate(t)}save(){const t=this.validateTemplate();if(t.length){window.alert(t[0].message),this.state.propTab="page",this.repaint();return}const r=this.templateJsonWithFonts();if(Array.isArray(r.pages))try{zs(r)}catch(i){window.alert(i instanceof Error?i.message:String(i));return}const o=this.getGeometryWarnings();if(o.length&&!window.confirm((this.ctx.t??lr)("save.geometryWarningConfirm",{warnings:o.join(`
2297
+ `)})))return;const n=JSON.stringify(r);this.store.dirty=!1,this.repaint(),this.dispatchEvent(new CustomEvent(Ct.save,{detail:n,bubbles:!0,composed:!0}))}validateTemplate(){const t=this.store.templateData;return t.tiling?.enabled===!0?Fs(t):[]}getGeometryWarnings(){return ry(this.store.templateData)}applyTemplate(t){if(!t)return;const r=typeof t=="string"?JSON.parse(t):t;this.store?this.store.loadTemplate(r):this.setAttribute("template",JSON.stringify(r))}openExpression(t){this.exprTarget=t,this.syncExpression()}closeExpression(){this.exprTarget=null,this.syncExpression()}syncExpression(){const t=Array.from(this.root.querySelectorAll(".pd-dialog-overlay"));if(!this.exprTarget){t.forEach(o=>o.remove()),this.exprMountedFor=null;return}if(this.exprMountedFor===this.exprTarget)return;t.forEach(o=>o.remove());const r=this.exprTarget;rt(y3({fields:this.store.fields,fieldDisplay:this.state.fieldDisplay,t:this.ctx.t,onClose:()=>this.closeExpression(),onApply:o=>this.applyExpression(r,o)},r),this.root),this.exprMountedFor=r}openHelp(t){this.helpInitialTab=t,this.helpVisible=!0,this.syncHelp()}closeHelp(){this.helpVisible&&(this.helpVisible=!1,this.syncHelp())}syncHelp(){const t=this.helpVisible&&this.getAttribute("show-help")!=="false";if(t&&!this.unmountHelp)this.unmountHelp=W3(this.root,{initialTab:this.helpInitialTab,locale:this.lang,t:ta(this.lang,this._messages),onClose:()=>this.closeHelp()});else if(!t&&this.unmountHelp){const r=this.unmountHelp;this.unmountHelp=null,r()}}applyExpression(t,r){const o=r.formatter??"",n=t.targetPath;if(n.startsWith("options.")){if(n.includes("[")){const a=this.store.elements.find(s=>s.id===t.elementId);a&&rp(this.store,a,n,o);return}const i={[n.slice(8)]:o||void 0};r.title!==void 0&&(i.title=r.title),this.store.updateElement(t.elementId,i);return}if(n==="watermark.content"){const i={...this.store.templateData.watermark};ap(o)?Object.assign(i,{mode:"binding",binding:o,content:""}):Object.assign(i,{mode:"fixed",content:o,binding:""}),this.store.updateTemplateData({watermark:i})}}dblEditElement(t){const r=this.store.elements.find(n=>n.id===t);if(!r||(this.store.selectOne(t),this.state.propTab=_l(r)?"custom":"element",r.options.locked))return;const o=Yh(r.printElementType.type);o&&this.openExpression({elementId:r.id,targetPath:`options.${o}`,value:String(r.options[o]??"")})}dblEditCell(t){const r=this.store.elements.find(s=>s.id===t.elementId);if(!r||(this.store.selectOne(r.id),this.state.propTab="element",r.options.locked))return;const o=r.options.tableRows??[],n=Po(o,t.r,t.c),a=o[n.r]?.cells[n.c];a&&this.openExpression({elementId:r.id,targetPath:`options.tableRows[${n.r}].cells[${n.c}].formatter`,value:a.formatter??""})}get ctx(){return{store:this.store,format:this.format,state:this.state,repaint:()=>this.repaint(),fire:(t,r)=>this.fire(t,r),showHelp:this.getAttribute("show-help")!=="false",showPreview:this.getAttribute("show-preview")!=="false",showSave:this.getAttribute("show-save")!=="false",isEdit:this.getAttribute("is-edit")==="true",t:ta(this.lang,this._messages),lang:this.lang,host:{uploadImage:this.uploadImage,uploadDesignBackground:this.uploadDesignBackground,fonts:this.fonts,designData:this.designData,fields:this.store.fields}}}canvasUi(){return{geom:this.geom,marquee:this.marquee,contextMenu:this.menu,guidePreview:this.guidePreview,zoneResizing:this.zoneResizing,scrollX:this.scrollPos.x,scrollY:this.scrollPos.y}}repaint(){this.raf||(this.raf=requestAnimationFrame(()=>{this.raf=0,this.paint()}))}paint(){nw(ta(this.lang,this._messages),()=>this.paintInternal())}paintInternal(){if(!this.store)return;Em(),this.syncPluginUIStyles();const t=[...this.store.selectedIds].join(",");if(t!==this.lastSelKey){this.lastSelKey=t;const a=this.store.selectedElement;this.state.propTab=a?_l(a)?"custom":"element":"page"}const r=this.root.querySelector(".designer-container");r.classList.toggle("format-painting",this.format.painterActive);for(const a of r.querySelectorAll("[data-pane]"))a.style.display!=="none"&&this.paneScroll.set(a.dataset.pane,a.scrollTop);Oh(r);const o=this.ctx;rt(Y3(o,hP(o)),r),rt(PP(o),r),rt(g("div",{class:"designer-body"},[gP(o),dP(o,this.canvasUi()),n3(o)]),r),rt(EP(o),r),pg(r),!this.toolbarRo&&typeof ResizeObserver<"u"&&(this.toolbarRo=new ResizeObserver(()=>pg(r)),this.toolbarRo.observe(r));const n=Ix(this.store,(a,s)=>this.fire(a,s),this.tableMenu);n&&rt(n,r),ix(this.root,this.store.elements,this.designData),Xm(this.root,this.state.propSearch),this.applyShrinkFit();const i=this.root.querySelector(".canvas-area");i&&(i.scrollLeft=this.scrollPos.x,i.scrollTop=this.scrollPos.y);for(const a of r.querySelectorAll("[data-pane]")){const s=this.paneScroll.get(a.dataset.pane);s!==void 0&&(a.scrollTop=s)}this.syncRulers(),this.persistChrome(),this.applyHostParts(r)}applyHostParts(t){const r={".designer-toolbar":"toolbar",".format-toolbar":"format-bar",".left-panel":"left-panel",".canvas-area":"canvas-area",".property-panel":"property-panel",".status-bar":"status-bar",".page-tabs":"page-tabs"};for(const[o,n]of Object.entries(r)){const i=t.querySelector(o);i&&Ol.includes(n)&&i.setAttribute("part",n)}}applyShrinkFit(){for(const t of Array.from(this.root.querySelectorAll('[data-fit="shrink"]')))Ph(t);for(const t of Array.from(this.root.querySelectorAll("[data-fit-size]"))){if(t.getAttribute("data-fit")==="shrink")continue;t.removeAttribute("data-fit-size");const r=t.getAttribute("data-fit-base");r?t.style.fontSize=`${r}pt`:t.style.removeProperty("font-size")}}measureRuler(){const t=this.root.querySelector(".canvas-area"),r=this.root.querySelector(".hiprint-printPaper");if(!t||!r)return;const o=t.getBoundingClientRect(),n=r.getBoundingClientRect(),i=(this.store.scale||100)/100,a=n.width/vr(this.store.paperSize.width);this.geom={paperScale:Math.abs(a-i)<.002?i:a,originX:n.left-o.left-va,originY:n.top-o.top-va,viewW:t.clientWidth-va,viewH:t.clientHeight-va},this.observeCanvasArea()}observeCanvasArea(){const t=this.root.querySelector(".canvas-area");!t||typeof ResizeObserver>"u"||this.roArea===t||(this.roArea=t,this.ro?.disconnect(),this.ro=new ResizeObserver(()=>this.syncRulers()),this.ro.observe(t))}syncRulers(){this.measureRuler();const t=this.store.templateData,r=ir(t),o=this.geom.paperScale;for(const n of Array.from(this.root.querySelectorAll(".pd-ruler"))){const i=n.dataset.ruler==="vertical"?"vertical":"horizontal";X3(n,{orientation:i,geom:this.geom,scale:o,paperLengthMM:i==="horizontal"?r.width:r.height})}}patchElementDom(){for(const o of this.store.elements){const n=this.root.querySelector(`[data-el-id="${CSS.escape(o.id)}"]`);n&&(n.style.left=`${o.options.left}mm`,n.style.top=`${o.options.top}mm`,n.style.width=`${o.options.width}mm`,n.style.height=`${o.options.height}mm`)}const t=this.root.querySelector(".position-label"),r=this.store.selectedElement;t&&r&&!this.drag&&(t.textContent=Um(r.options))}fire(t,r){const o=this.store;switch(t){case"undo":o.undo();break;case"redo":o.redo();break;case"align":o.alignSelected(r);break;case"move-layer":o.moveLayer(r);break;case"group":o.groupSelected();break;case"ungroup":o.ungroupSelected();break;case"copy":o.copy();break;case"cut":o.cutSelected();break;case"paste":o.paste();break;case"paste-at":o.paste();break;case"delete":o.deleteSelected();break;case"delete-page":o.deletePage(o.activePageIndex);break;case"add-page":o.addPage();break;case"duplicate-page":o.duplicatePage(o.activePageIndex);break;case"move-page":o.movePage(o.activePageIndex,o.activePageIndex+r);break;case"select-all":o.selectAll();break;case"clear-selection":o.clearSelection();break;case"toggle-ruler":o.showRuler=!o.showRuler,this.repaint();break;case"toggle-grid":o.showGrid=!o.showGrid,this.repaint();break;case"toggle-snap":o.snapToGrid=!o.snapToGrid,this.repaint();break;case"toggle-table-ghost-border":o.showTableGhostBorder=!o.showTableGhostBorder,this.repaint();break;case"fit-window":this.fitToWindow();break;case"zoom":this.zoomByStep(r>0?1:-1);break;case"preview":this.dispatchEvent(new CustomEvent(Ct.preview,{detail:this.getTemplateJson(),bubbles:!0,composed:!0}));break;case"save":this.save();break;case"help":this.dispatchEvent(new CustomEvent(Ct.help,{bubbles:!0,composed:!0})),this.openHelp(r);break;case"guide-remove":o.removeGuide(r);break;case"resize-start":this.beginResize(r);break;case"element-mousedown":{const n=r;n.event.button===0&&this.isDoubleTap(`el:${n.id}`,n.event)&&this.fire("element-dblclick",{event:n.event,id:n.id}),this.beginDrag(n);break}case"table-cell-mousedown":{const n=r;this.isDoubleTap(`cell:${n.elementId}:${n.r}:${n.c}`,n.event)&&(this.taps.delete(`el:${n.elementId}`),this.fire("table-cell-dblclick",{elementId:n.elementId,r:n.r,c:n.c,cellId:n.cellId}));break}case"zone-resize":this.beginZoneResize(r);break;case"guide-mousedown":this.beginGuideDrag(r);break;case"ruler-mousedown":this.beginRulerGuide(r);break;case"canvas-mousedown":this.onCanvasMouseDown(r);break;case"canvas-mousemove":this.onCanvasMouseMove(r);break;case"canvas-mouseleave":this.clearCoord();break;case"canvas-contextmenu":this.onContextMenu(r);break;case"contextmenu":this.onElementContextMenu(r);break;case"element-dblclick":{const{id:n}=r;this.dblEditElement(n),this.dispatchEvent(new CustomEvent(Ct.dblclickElement,{detail:n,bubbles:!0,composed:!0}));break}case"table-cell-dblclick":{const n=r;this.dblEditCell(n),this.dispatchEvent(new CustomEvent(Ct.dblclickCell,{detail:{elementId:n.elementId,r:n.r,c:n.c,cellId:n.cellId},bubbles:!0,composed:!0}));break}case"open-expression":this.openExpression(r);break;case"drop":this.onDrop(r);break;case"wheel":this.onWheel(r);break;case"scroll":this.onScroll();break}}onDrop(t){t.preventDefault();const r=t.dataTransfer,o=r?.getData("elementType"),n=r?.getData("fieldKey"),i=this.pointToPaperMm(t);if(!i)return;const a={x:i.left,y:i.top};if(o)this.store.addElement(o,{},a);else if(n){const s=this.store.fields.find(p=>p.fieldKey===n);s&&this.store.addFieldElement(s,{},a,t.ctrlKey||t.metaKey||t.labelIntent===!0)}}pointToPaperMm(t){const r=this.root.querySelector(".hiprint-printPaper");if(!r)return null;const o=r.getBoundingClientRect(),n=(this.store.scale||100)/100,i=In((t.clientX-o.left)/n),a=In((t.clientY-o.top)/n);return i<0||a<0?null:{left:i,top:a}}onCanvasMouseDown(t){const r=t.target;(r===this.root.querySelector(".canvas-area")||["canvas-scroll","hiprint-printPaper","hiprint-printPaper-content","zone-layer","grid-bg","watermark-layer"].some(n=>r.classList.contains(n)))&&(this.menu.visible=!1,this.state.openDd&&(this.state.openDd=null,this.repaint()),this.state.openMore&&(this.state.openMore=!1,this.repaint()),t.button===0&&(this.store.clearSelection(),this.startMarquee(t)))}onCanvasMouseMove(t){const r=this.pointToPaperMm(t),o=this.root.querySelector("[data-coord]");if(o){if(!r){o.style.display="none";return}o.style.display="",o.textContent=`x:${(r.left-this.store.templateData.margins.left).toFixed(1)} y:${(r.top-this.store.templateData.margins.top).toFixed(1)}mm`}}clearCoord(){const t=this.root.querySelector("[data-coord]");t&&(t.textContent="")}onContextMenu(t){this.openMenu(t,null)}onElementContextMenu(t){this.store.selectedIds.has(t.id)||this.store.selectOne(t.id),this.openMenu(t.event,t.id)}openMenu(t,r){this.menu.x=t.clientX,this.menu.y=t.clientY,this.menu.targetId=r,this.menu.visible=!0,this.menu.flipX=0,this.menu.flipY=0,this.repaint(),requestAnimationFrame(()=>{const o=this.root.querySelector(".context-menu");if(!o)return;const n=o.getBoundingClientRect();this.menu.flipX=n.right>window.innerWidth?window.innerWidth-n.right-8:0,this.menu.flipY=n.bottom>window.innerHeight?window.innerHeight-n.bottom-8:0,this.paint()})}startMarquee(t){const r={x:t.clientX,y:t.clientY},o=i=>{this.marquee={visible:!0,x:Math.min(r.x,i.clientX),y:Math.min(r.y,i.clientY),w:Math.abs(i.clientX-r.x),h:Math.abs(i.clientY-r.y)},this.paint()},n=()=>{window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",n);const i={...this.marquee};if(this.marquee={visible:!1,x:0,y:0,w:0,h:0},i.w>2&&i.h>2){const a=this.store.elements.filter(s=>{const p=this.root.querySelector(`[data-el-id="${CSS.escape(s.id)}"]`);if(!p)return!1;const l=p.getBoundingClientRect();return l.left<i.x+i.w&&l.right>i.x&&l.top<i.y+i.h&&l.bottom>i.y});this.store.select(new Set(a.map(s=>s.id)))}else this.repaint()};window.addEventListener("mousemove",o),window.addEventListener("mouseup",n)}taps=new Map;isDoubleTap(t,r){const o=this.taps.get(t);return this.taps.set(t,{t:r.timeStamp,x:r.clientX,y:r.clientY}),!o||r.timeStamp-o.t>=500||Math.abs(r.clientX-o.x)>6||Math.abs(r.clientY-o.y)>6?!1:(this.taps.delete(t),!0)}beginDrag(t){const r=t.event;if(r.button!==0)return;const o=this.store;r.stopPropagation();const n=o.elements.find(s=>s.id===t.id);if(!n||(o.selectElement(n.id,r.ctrlKey||r.metaKey),n.options.locked))return;const i=r.altKey?[n.id]:o.dragIds(n.id),a=new Map;for(const s of i){const p=o.elements.find(l=>l.id===s);p&&a.set(s,{left:p.options.left,top:p.options.top})}this.drag={ids:i,primary:n.id,altKey:r.altKey,movedPositions:new Map,startX:r.clientX,startY:r.clientY,origin:a,zone:n.zone||"content",moved:!1},o.draggingIds=new Set(i),o.dragStart(),this.syncDragGhost()}syncDragGhost(){const t=this.store.draggingIds;for(const r of Array.from(this.root.querySelectorAll(".print-element"))){const o=t.has(r.dataset.elId??"");r.classList.toggle("drag-ghost",o);const n=r.querySelector(":scope > .drag-preview");o&&!n?rt(g("div",{class:"drag-preview"}),r):!o&&n&&n.remove()}}finishAltClone(t){const r=this.store;r.adsorbGuides=[];const o=r.elements.find(a=>a.id===t.primary),n=t.movedPositions.get(t.primary);if(r.discardLive(),!o||!n)return;const i=JSON.parse(JSON.stringify(o));i.id=Xr(),i.options.left=n.left,i.options.top=n.top,i.options.groupId=void 0,r.cloneElement(i)}flashSnapIndicator(t,r){const o=this.root.querySelector(".hiprint-printPaper-content");o&&(o.querySelector(".snap-indicator")?.remove(),rt(g("div",{class:"snap-indicator",style:{left:`${t}mm`,top:`${r}mm`}}),o),this.snapTimer&&clearTimeout(this.snapTimer),this.snapTimer=setTimeout(()=>{o.querySelector(".snap-indicator")?.remove(),this.snapTimer=null},300))}beginResize(t){const r=t.event;r.stopPropagation();const o=this.store.elements.find(n=>n.id===t.id);!o||o.options.locked||(this.resize={id:t.id,point:t.point,startX:r.clientX,startY:r.clientY,origin:{left:o.options.left,top:o.options.top,width:o.options.width,height:o.options.height}},this.store.dragStart())}beginZoneResize(t){t.event.stopPropagation(),t.event.preventDefault(),this.zoneResizing=t.zone;const r=t.event.clientY,o=this.store.templateData,n=t.zone==="header"?o.header.height:o.footer.height,i=(this.store.scale||100)/100,a=p=>{const l=In((p.clientY-r)/i),d=Math.max(0,Math.round((n+(t.zone==="header"?l:-l))*10)/10);t.zone==="header"?this.store.updateTemplateData({header:{...o.header,height:d}}):this.store.updateTemplateData({footer:{...o.footer,height:d}}),this.paint()},s=()=>{window.removeEventListener("mousemove",a),window.removeEventListener("mouseup",s),this.zoneResizing=null,this.store.recordHistory(),this.repaint()};window.addEventListener("mousemove",a),window.addEventListener("mouseup",s)}beginGuideDrag(t){const r=(this.store.templateData.guides??[]).find(d=>d.id===t.id);if(!r)return;const o=ir(this.store.templateData),n=r.type==="vertical"?o.width:o.height,i=t.event.clientX,a=t.event.clientY,s=(this.store.scale||100)/100,p=d=>{const u=In((r.type==="vertical"?d.clientX-i:d.clientY-a)/s);this.store.moveGuide(r.id,Math.min(n,Math.max(0,r.position+u))),this.paint()},l=()=>{window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",l),this.store.recordHistory(),this.repaint()};window.addEventListener("mousemove",p),window.addEventListener("mouseup",l)}beginRulerGuide(t){const r=t.orientation==="horizontal"?"vertical":"horizontal",o=i=>{this.guidePreview={type:r,position:r==="vertical"?i.clientX:i.clientY},this.paint()},n=i=>{window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",n);const a=this.rulerPointToMM(i,r);this.guidePreview=null,a!==null?this.store.addGuide(r,a):this.repaint()};window.addEventListener("mousemove",o),window.addEventListener("mouseup",n)}rulerPointToMM(t,r){const o=this.root.querySelector(".hiprint-printPaper");if(!o)return null;const n=o.getBoundingClientRect(),i=vr(1)*(this.geom.paperScale||1),a=r==="vertical"?(t.clientX-n.left)/i:(t.clientY-n.top)/i,s=ir(this.store.templateData),p=r==="vertical"?s.width:s.height;return a<0||a>p?null:a}applyZoom(t,r,o,n){const i=this.root.querySelector(".canvas-area");if(!i)return;const a=Math.round(this.store.scale),s=Math.max(n,Math.round(t));if(s===a)return;const p=getComputedStyle(i),l=parseFloat(p.paddingLeft)||0,d=parseFloat(p.paddingTop)||0,u=i.scrollLeft+r-l,c=i.scrollTop+o-d,f=s/a;this.store.setScale(s,n),i.scrollLeft=u*f-r+l,i.scrollTop=c*f-o+d,this.scrollPos={x:i.scrollLeft,y:i.scrollTop}}zoomByStep(t){const r=this.root.querySelector(".canvas-area");r&&this.applyZoom(Vd(this.store.scale,t),r.clientWidth/2,r.clientHeight/2,Vn)}fitToWindow(){const t=this.root.querySelector(".canvas-area");if(!t)return;const r=getComputedStyle(t),o=(parseFloat(r.paddingLeft)||0)+(parseFloat(r.paddingRight)||0),n=(parseFloat(r.paddingTop)||0)+(parseFloat(r.paddingBottom)||0),i=ir(this.store.templateData),a=T0(t.clientWidth-o,t.clientHeight-n,vr(i.width),vr(i.height));this.applyZoom(a,t.clientWidth/2,t.clientHeight/2,Wd)}onWheel(t){if(!t.ctrlKey&&!t.metaKey)return;t.preventDefault();const r=this.root.querySelector(".canvas-area");if(!r)return;const o=Math.round(this.store.scale),n=Vd(o,t.deltaY>0?-1:1);if(n===o)return;const i=r.getBoundingClientRect();this.applyZoom(n,t.clientX-i.left,t.clientY-i.top,Vn)}onScroll(){const t=this.root.querySelector(".canvas-area");if(!t)return;this.scrollPos={x:t.scrollLeft,y:t.scrollTop};const r=this.root.querySelector(".ruler-overlay");r&&(r.style.transform=`translate(${this.scrollPos.x}px, ${this.scrollPos.y}px)`),this.syncRulers()}on(t,r,o,n){t.addEventListener(r,o,n),this.instanceDisposers.push(()=>t.removeEventListener(r,o,n))}attachInstanceListeners(){this.instanceDisposers.length||(this.bindPointer(),this.bindKeys(),this.bindPaneScroll())}bindPaneScroll(){this.on(this.root,"scroll",t=>{const r=t.target;if(!(r instanceof HTMLElement))return;const o=r.dataset.pane;o&&this.paneScroll.set(o,r.scrollTop)},!0)}bindPointer(){const t=a=>{const s=this.store;if(!s)return;const l=((s.scale||100)/100||1)*vr(1),d=(u,c)=>({dx:u/l,dy:c/l});if(this.drag){const{dx:u,dy:c}=d(a.clientX-this.drag.startX,a.clientY-this.drag.startY);(Math.abs(u)>.05||Math.abs(c)>.05)&&(this.drag.moved=!0);const f=s.elements.find(E=>E.id===this.drag.primary),h=f&&Xe(f.options).margin,b=f&&h&&{id:f.id,left:(this.drag.origin.get(f.id)?.left??0)+u,top:(this.drag.origin.get(f.id)?.top??0)+c,width:h.width,height:h.height};let k=null;if(b&&s.snapToGrid!==!1){const E=s.elements.filter(A=>!this.drag.ids.includes(A.id)&&(A.zone||"content")===this.drag.zone).map(A=>({id:A.id,...Xe(A.options).margin})),D=Jl(s.templateData,s.paperSize)[this.drag.zone],O=Ay(b,E,this.manualGuides());k={left:O.left,top:O.top},s.adsorbGuides=(O.lines??[]).filter(A=>A.position>=0&&A.position<=(A.type==="vertical"?D.width:D.height)),(k.left!==b.left||k.top!==b.top)&&this.flashSnapIndicator(k.left+b.width/2,k.top+b.height/2)}else s.adsorbGuides=[];const v=f?this.drag.origin.get(f.id):void 0,w=k&&v?k.left-v.left:u,P=k&&v?k.top-v.top:c;for(const E of this.drag.ids){const D=this.drag.origin.get(E);if(!D)continue;const O={left:D.left+w,top:D.top+P};this.drag.movedPositions.set(E,O),s.livePatch(E,O)}this.patchElementDom(),s.adsorbGuides.length&&this.paintGuidesOnly()}else if(this.resize){const{dx:u,dy:c}=d(a.clientX-this.resize.startX,a.clientY-this.resize.startY),f=Ly(this.resize.point,this.resize.origin,u,c,3.5,3.5);s.livePatch(this.resize.id,f),this.patchElementDom()}},r=()=>{const a=!!this.drag,s=this.drag;if(s?.moved&&s.altKey){this.finishAltClone(s),this.store.dragStop(),this.drag=null,this.store.draggingIds=new Set,this.repaint();return}this.drag?.moved||this.resize?(this.store.adsorbGuides=[],this.store.commitLive(),this.store.dragStop(),this.drag=null,this.resize=null,this.store.draggingIds=new Set,this.repaint()):(this.drag=null,this.store.dragStop(),a&&(this.store.draggingIds=new Set,this.syncDragGhost()))},o=a=>{const s=a.composedPath(),p=s.some(d=>d.classList?.contains("tb-dd"));this.state.openDd&&!p&&(this.state.openDd=null,this.repaint()),this.state.openMore&&!p&&(this.state.openMore=!1,this.repaint());const l=s.some(d=>d.classList?.contains("context-menu"));this.menu.visible&&!l&&(this.menu.visible=!1,this.repaint())},n=a=>{const p=a.target?.closest?.("[data-tip]");!p||!p.closest(J3)||(this.hoverTipTimer&&clearTimeout(this.hoverTipTimer),this.hoverTipTimer=setTimeout(()=>this.showHoverTip(p),300))},i=a=>{const s=a,p=s.target?.closest?.("[data-tip]");p&&s.relatedTarget?.closest?.("[data-tip]")!==p&&this.hideHoverTip()};this.on(window,"mousemove",t),this.on(window,"mouseup",r),this.on(this,"pointerdown",o),this.on(this.root,"mouseover",n),this.on(this.root,"mouseout",i)}showHoverTip(t){const r=t.dataset.tip;if(!r)return;this.hideHoverTip();const o=t.getBoundingClientRect(),n=o.left+o.width/2;this.hoverTipEl=rt(g("div",{class:"pd-hover-tip",style:{left:`${n}px`,top:`${o.bottom+6}px`},text:r}),this.root);const i=this.hoverTipEl.offsetWidth/2;if(!i)return;const a=i+8,s=Math.max(window.innerWidth-i-8,a);this.hoverTipEl.style.left=`${Math.min(Math.max(n,a),s)}px`}hideHoverTip(){this.hoverTipTimer&&(clearTimeout(this.hoverTipTimer),this.hoverTipTimer=null),this.hoverTipEl?.remove(),this.hoverTipEl=null}manualGuides(){const t=[],r=[];for(const o of this.store.templateData.guides??[])o.type==="vertical"?t.push(o.position):r.push(o.position);return{vertical:t,horizontal:r}}paintGuidesOnly(){const t=this.root.querySelector(".hiprint-printPaper-content");if(!t)return;for(const o of Array.from(t.querySelectorAll(".adsorb-guide")))o.remove();const r=this.store.paperSize;Jl(this.store.templateData,r);for(const o of this.store.adsorbGuides){const n=document.createElement("div");n.className=`adsorb-guide guide-${o.type}`,o.type==="vertical"?n.style.cssText=`left:${o.position}mm;top:0;height:${r.height}mm;border-left-color:${o.color||"var(--pd-accent-secondary, #f56c6c)"}`:n.style.cssText=`top:${o.position}mm;left:0;width:${r.width}mm;border-top-color:${o.color||"var(--pd-accent-secondary, #f56c6c)"}`,t.appendChild(n)}}bindKeys(){this.setAttribute("tabindex","0");const t=()=>{Zt.active=this};this.on(this,"pointerdown",t),this.on(this,"focusin",t),Zt.active||(Zt.active=this)}attachDocKeys(){this.docKeydown||(this.docKeydown=t=>this.onGlobalKeydown(t),document.addEventListener("keydown",this.docKeydown),this.docDragend=()=>jm(this.root?.querySelector(".canvas-area")),document.addEventListener("dragend",this.docDragend,!0))}detachDocKeys(){this.docKeydown&&(document.removeEventListener("keydown",this.docKeydown),this.docKeydown=null,this.docDragend&&(document.removeEventListener("dragend",this.docDragend,!0),this.docDragend=null))}onGlobalKeydown(t){const r=this.store;if(!r||Zt.active!==this)return;const n=t.composedPath()[0]?.tagName;if(n==="INPUT"||n==="TEXTAREA"||n==="SELECT")return;if(this.format.handlePainterKeydown(t),t.key.startsWith("Arrow")){t.preventDefault();const a=t.shiftKey?10:t.ctrlKey?.5:1,s=t.key==="ArrowLeft"?-a:t.key==="ArrowRight"?a:0,p=t.key==="ArrowUp"?-a:t.key==="ArrowDown"?a:0;r.moveSelected(s,p);return}if(t.key==="Delete"||t.key==="Backspace"){t.preventDefault(),r.deleteSelected();return}if(!(t.ctrlKey||t.metaKey))return;const i=t.key.toLowerCase();Q3.has(i)&&(t.preventDefault(),i==="z"?t.shiftKey?r.redo():r.undo():i==="y"?r.redo():i==="a"?r.selectAll():i==="c"?r.copy():i==="x"?r.cutSelected():i==="v"?r.paste():i==="d"?r.duplicateSelected():i==="g"?t.shiftKey?r.ungroupSelected():r.groupSelected():i==="1"?r.resetZoom():i==="l"?r.alignSelected("left"):i==="r"?r.alignSelected("right"):i==="e"?r.alignSelected("vertical"):i==="t"?r.alignSelected("top"):i==="b"?r.alignSelected("bottom"):i==="0"&&this.fire("fit-window"))}}function kg(e="print-designer"){return customElements.get(e)||customElements.define(e,Zt),e}function eE(){return kg()}const tE=Object.freeze(Object.defineProperty({__proto__:null,BUILTIN_ELEMENT_CAPABILITIES:So,BUILTIN_ELEMENT_DEFINITIONS:ia,DesignerStore:Bh,PRINT_DESIGNER_ATTRIBUTES:Al,PRINT_DESIGNER_BOOLEAN_ATTRIBUTES:Jh,PRINT_DESIGNER_CONTRACT_VERSION:Dl,PRINT_DESIGNER_EVENT:Ct,PRINT_DESIGNER_EVENTS:rm,PRINT_DESIGNER_EVENT_OPTIONS:uw,PRINT_DESIGNER_METHODS:em,PRINT_DESIGNER_PARTS:Ol,PRINT_DESIGNER_PROPERTY_NAMES:tm,PRINT_DESIGNER_TAG:Zh,PRINT_DESIGNER_THEME_TOKENS:Qh,PrintDesignerElement:Zt,TILING_SINGLE_PAGE_TIP:F2,createDefaultTemplate:ln,definePrintDesigner:kg,getElementCapabilities:gt,getElementCapabilityTypes:Ba,getElementDblEditableField:Yh,getElementDefinition:dr,getElementDefinitions:Vh,getElementLayerIcon:Xh,getElementPropertyGroup:Kh,getHostContract:Rl,getMaterialElementDefinitions:Gh,registerAll:eE,registerElementCapabilities:Nb,registerElementDefinition:lw,registerElementRenderer:pw,registerElementRenderers:Wh,resetElementCapabilities:Fb,resetElementDefinitions:cw,serializePage:Ih,subscribeElementDefinitions:jh,toRuntimePool:vl},Symbol.toStringTag,{value:"Module"})),rE=17521,oE=20,yn={PRINTERS_LIST:"printers.list",PRINT_SUBMIT:"print.submit",PRINT_SUBMIT_HTML:"print.submitHtml",TEMPLATE_ATTACH:"template.attach",TEMPLATE_DETACH:"template.detach"};let fp=0;function nE(){return fp=(fp+1)%Number.MAX_SAFE_INTEGER,`${Date.now().toString(36)}-${fp.toString(36)}`}function yg(e,t){const r={id:nE(),type:e,payload:t};return JSON.stringify(r)}function vg(e){let t;try{t=JSON.parse(e)}catch{return{malformed:!0}}if(typeof t!="object"||t===null)return{malformed:!0};const r=t;if(typeof r.id!="string"||typeof r.ok!="boolean")return{malformed:!0};if(r.ok)return{id:r.id,ok:!0,payload:r.payload??{}};const o=r.error;return!o||typeof o.code!="string"||typeof o.message!="string"?{malformed:!0}:{id:r.id,ok:!1,error:{code:o.code,message:o.message}}}function iE(e){if(typeof e!="object"||e===null)return!1;const t=e;return!("ok"in t)&&typeof t.id=="string"&&typeof t.type=="string"&&typeof t.payload=="object"&&t.payload!==null}class Ut extends Error{constructor(t,r){super(r),this.name="WormPrintError",this.code=t}}function aE(e){return e instanceof Ut||e&&typeof e=="object"&&typeof e.code=="string"?e.code:"INTERNAL"}class wg extends Error{constructor(t){super(t),this.code="UNAUTHORIZED",this.name="AuthRejectedError"}}class sE{constructor(t={}){this.ws=null,this.status_="disconnected",this.hello=null,this.pendings=new Map,this.statusCbs=new Set,this.requestHandler=null,this.manualClose=!1,this.reconnectTimer=null,this.reconnectAttempts=0,this.opts=t,this.ctor=t.WebSocketCtor??WebSocket,this.defaultTimeout=t.timeoutMs??15e3}get status(){return this.status_}onStatus(t){return this.statusCbs.add(t),()=>this.statusCbs.delete(t)}setRequestHandler(t){this.requestHandler=t}setToken(t){this.opts={...this.opts,token:t}}async connect(t){if(this.status_==="connected"&&this.hello)return this.hello;this.setStatus("connecting");const r=this.opts.ports??Array.from({length:oE},(o,n)=>rE+n);for(const o of r){if(t?.aborted)throw new Ut("CLIENT_NOT_RUNNING",$("client.cancelled"));try{return this.hello=await this.tryPort(o,t),this.manualClose=!1,this.reconnectAttempts=0,this.setStatus("connected"),this.hello}catch(n){if(n instanceof wg)throw this.setStatus("disconnected"),new Ut("UNAUTHORIZED",n.message||$("client.invalidToken"))}}throw this.setStatus("disconnected"),new Ut("CLIENT_NOT_RUNNING",$("client.notRunning"))}request(t,r,o){if(this.status_!=="connected"||!this.ws)return Promise.reject(new Ut("CLIENT_NOT_RUNNING",$("client.notConnected")));const n=yg(t,r),i=JSON.parse(n);return new Promise((a,s)=>{const p=setTimeout(()=>{this.pendings.delete(i.id),s(new Ut("CLIENT_TIMEOUT",$("client.timeout",{type:t})))},o??this.defaultTimeout);this.pendings.set(i.id,{resolve:a,reject:s,timer:p}),this.ws.send(n)})}close(){this.manualClose=!0,this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null,this.ws?.close(),this.failAllPendings(new Ut("CLIENT_NOT_RUNNING",$("client.closed"))),this.setStatus("disconnected")}buildUrl(t){const r=new URL(`ws://127.0.0.1:${t}`);return this.opts.token&&r.searchParams.set("token",this.opts.token),r.toString().replace(/\/$/,"")}tryPort(t,r){return new Promise((o,n)=>{const i=new this.ctor(this.buildUrl(t));this.ws=i;let a=!1;const s=()=>{a||(a=!0,n(new Error("aborted")))};r?.addEventListener("abort",s,{once:!0}),i.onopen=()=>{i.send(yg("hello",{}))},i.onmessage=p=>{const l=vg(String(p.data));if(!("malformed"in l))if(l.ok&&lE(l.payload)){if(a)return;a=!0,this.bindLifecycle(i),o(l.payload)}else if(!l.ok&&l.error.code==="UNAUTHORIZED"){if(a)return;a=!0,n(new wg(l.error.message))}else a||(a=!0,n(new Error("握手失败")))},i.onerror=()=>{a||(a=!0,n(new Error("连接错误")))},i.onclose=()=>{a||(a=!0,n(new Error("连接关闭")))}})}bindLifecycle(t){t.onmessage=r=>{this.handleIncoming(t,String(r.data))},t.onclose=()=>{this.failAllPendings(new Ut("CLIENT_NOT_RUNNING",$("client.disconnected"))),this.hello=null,this.ws=null,this.manualClose||this.scheduleReconnect()},t.onerror=()=>{}}handleIncoming(t,r){let o;try{o=JSON.parse(r)}catch{return}if(iE(o)){this.dispatchServerRequest(t,o);return}const n=vg(r);if("malformed"in n)return;const i=this.pendings.get(n.id);i&&(this.pendings.delete(n.id),clearTimeout(i.timer),n.ok?i.resolve(n.payload):i.reject(new Ut(n.error.code,n.error.message)))}dispatchServerRequest(t,r){const o=this.requestHandler;if(!o){this.safeSend(t,r.id,!1,void 0,"INVALID_REQUEST",$("client.unregisteredHandler"));return}Promise.resolve().then(()=>o(r.type,r.payload)).then(n=>this.safeSend(t,r.id,!0,n??{})).catch(n=>{const i=aE(n),a=n instanceof Error?n.message:String(n);this.safeSend(t,r.id,!1,void 0,i,a)})}safeSend(t,r,o,n,i,a){t.readyState===1&&t.send(JSON.stringify(o?{id:r,ok:o,payload:n}:{id:r,ok:o,error:{code:i??"INTERNAL",message:a??$("client.internalError")}}))}scheduleReconnect(){this.setStatus("connecting");const t=Math.min(1e3*2**this.reconnectAttempts++,1e4);this.reconnectTimer=setTimeout(()=>{this.connect().catch(()=>this.scheduleReconnect())},t)}failAllPendings(t){for(const[,r]of this.pendings)clearTimeout(r.timer),r.reject(t);this.pendings.clear()}setStatus(t){if(this.status_!==t){this.status_=t;for(const r of this.statusCbs)r(t)}}}function lE(e){return typeof e=="object"&&e!==null&&e.app==="worm-print-client"}const xg="worm-print-client:token";class hp{constructor(t={}){const o={token:t.token??hp.loadStoredToken()??void 0,timeoutMs:t.timeoutMs,WebSocketCtor:t.WebSocketCtor};this.transport=new sE(o)}get status(){return this.transport.status}connect(t){return this.transport.connect(t)}onStatusChange(t){return this.transport.onStatus(t)}setRequestHandler(t){this.transport.setRequestHandler(t)}async listPrinters(){return(await this.transport.request(yn.PRINTERS_LIST,{})).printers}request(t,r,o){return this.transport.request(t,r,o)}attachTemplate(t){return this.request(yn.TEMPLATE_ATTACH,t)}detachTemplate(t){return this.request(yn.TEMPLATE_DETACH,{sessionId:t})}print(t,r,o={},n){const{baseUrl:i,fontBaseUrl:a,timeoutMs:s,...p}=o,l={templateJson:t,printData:r,baseUrl:i,fontBaseUrl:a,print:p};return typeof n=="string"&&n.trim().length>0&&(l.templateName=n),this.transport.request(yn.PRINT_SUBMIT,l,s)}printHtml(t,r={},o){const{timeoutMs:n,...i}=r,a={html:t.html,paperMm:t.paperMm,pagePaperMm:t.pagePaperMm,continuous:t.continuous,pageCount:t.pageCount,print:i};return typeof o=="string"&&o.trim().length>0&&(a.templateName=o),this.transport.request(yn.PRINT_SUBMIT_HTML,a,n)}pair(t){localStorage.setItem(xg,t),this.transport.setToken(t)}static loadStoredToken(){try{return localStorage.getItem(xg)}catch{return null}}close(){this.transport.close()}}const pE={...tE,renderHtmlPages:l2,browserCodeRenderer:ml,PrintClient:hp,WormPrintError:Ut,getPaperDimensions:yt,isContinuousPaperSize:Yr,getByPath:$o,resolvePrinterDpi:G0,paperWidthPx:K0,zoomPresets:X0,defaultZoomKey:oc,resolveZoomKey:Q0,zoomValueOf:e1,viewZoomHint:Z0,applyPreviewViewZoom:J0,resolveToolbarOverflow:Gd};globalThis.WormPrintCanvas??=pE}));