@questwork/p-templates-model 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +45 -2
- package/dist/p-templates-model.cjs +67 -0
- package/dist/p-templates-model.cjs.map +1 -0
- package/dist/p-templates-model.esm.js +2265 -0
- package/dist/p-templates-model.esm.js.map +1 -0
- package/dist/p-templates-model.umd.js +67 -0
- package/dist/p-templates-model.umd.js.map +1 -0
- package/package.json +45 -4
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
(function(c,A){typeof exports=="object"&&typeof module<"u"?A(exports,require("@questwork/q-utilities"),require("liquidjs"),require("juice/client")):typeof define=="function"&&define.amd?define(["exports","@questwork/q-utilities","liquidjs","juice/client"],A):(c=typeof globalThis<"u"?globalThis:c||self,A(c.pTemplatesModel=c.pTemplatesModel||{},c.qUtilities,c.liquidjs,c.juice))})(this,function(c,A,C,Ht){"use strict";const Wt=(t=>t&&t.__esModule?t:{default:t})(Ht),se=2,Ie=Object.freeze([2]),y=Object.freeze({BLOCK_CONTEXT_MISMATCH:"BLOCK_CONTEXT_MISMATCH",BLOCK_DEPRECATED:"BLOCK_DEPRECATED",BLOCK_ELEMENT_INVALID:"BLOCK_ELEMENT_INVALID",BLOCK_NOT_ALLOWED:"BLOCK_NOT_ALLOWED",BLOCK_NOT_PUBLISHED:"BLOCK_NOT_PUBLISHED",BLOCK_PARAMS_INVALID:"BLOCK_PARAMS_INVALID",BLOCK_ROOT_NOT_IN_CONTEXT:"BLOCK_ROOT_NOT_IN_CONTEXT",FIELD_EXPRESSION_NOT_ALLOWED:"FIELD_EXPRESSION_NOT_ALLOWED",FUNCTION_ARGUMENTS_INVALID:"FUNCTION_ARGUMENTS_INVALID",FUNCTION_NOT_ALLOWED:"FUNCTION_NOT_ALLOWED",LAYOUT_EMPTY:"LAYOUT_EMPTY",LAYOUT_NOT_ALLOWED:"LAYOUT_NOT_ALLOWED",LAYOUT_NOT_FOUND:"LAYOUT_NOT_FOUND",LOOP_SOURCE_NOT_LIST:"LOOP_SOURCE_NOT_LIST",OUTPUT_NOT_SCALAR:"OUTPUT_NOT_SCALAR",PART_REQUIRED:"PART_REQUIRED",PART_UNKNOWN:"PART_UNKNOWN",PATH_UNKNOWN:"PATH_UNKNOWN",ROOT_UNKNOWN:"ROOT_UNKNOWN",SYNTAX_ERROR:"SYNTAX_ERROR",SYNTAX_VERSION_UNSUPPORTED:"SYNTAX_VERSION_UNSUPPORTED",TAG_NOT_ALLOWED:"TAG_NOT_ALLOWED",UNKNOWN_BLOCK:"UNKNOWN_BLOCK",UNKNOWN_FUNCTION:"UNKNOWN_FUNCTION",VARIABLE_INVALID:"VARIABLE_INVALID"}),K=Object.freeze({ERROR:"ERROR",WARNING:"WARNING"}),we=Object.freeze(["blank","empty","false","forloop","nil","null","params","true"]),k="params",X=/^[A-Z_]\w*$/i,P=Object.freeze({BOOLEAN:"boolean",DATE:"date",LIST:"list",NUMBER:"number",OBJECT:"object",STRING:"string"}),Xt=new Set([P.BOOLEAN,P.DATE,P.NUMBER,P.STRING]),ae=Symbol("templateProjectionNode"),Qt=10;class De{constructor({projectionCode:e,label:n,description:r,fields:i}={}){if(!e||typeof e!="string")throw new TypeError("TemplateProjection requires a projectionCode.");Object.defineProperty(this,ae,{enumerable:!1,value:ce({description:r,fields:i,label:n,type:P.OBJECT},e)}),this.projectionCode=e,Object.freeze(this)}describe(){return le(this[ae])}project(e){return ue(this[ae],e)}}function D(t){return new De(t)}function oe(t,{label:e,description:n,value:r}={}){return{description:n,item:t,label:e,type:P.LIST,value:r}}function Jt(t,e="root"){return ce(t,e)}function Zt(t){return le(t)}function en(t,e){return ue(t,e)}function ce(t,e){if(t instanceof De)return t[ae];if(!t||typeof t!="object")throw new TypeError(`Template field "${e}" must be an object definition.`);const{description:n,label:r,type:i,value:s}=t;if(s!==void 0&&typeof s!="function")throw new TypeError(`Template field "${e}" value must be a function.`);const a={description:n,label:r,type:i,value:s};if(i===P.OBJECT)a.fields=Object.entries(t.fields||{}).reduce((o,[u,l])=>(tn(u,e),o[u]=ce(l,`${e}.${u}`),o),{});else if(i===P.LIST)a.item=ce(t.item,`${e}[]`);else if(!Xt.has(i))throw new TypeError(`Template field "${e}" has unsupported type "${i}".`);return Object.freeze(a)}function tn(t,e){if(!X.test(t)||t.startsWith("__")||we.includes(t))throw new TypeError(`Template field name "${e}.${t}" is not allowed.`)}function le(t){const e={type:t.type};return t.label&&(e.label=t.label),t.description&&(e.description=t.description),t.fields&&(e.fields=Object.entries(t.fields).reduce((n,[r,i])=>(n[r]=le(i),n),{})),t.item&&(e.item=le(t.item)),e}function ue(t,e){if(t.type===P.OBJECT){if(e===null||typeof e!="object")return null;const n=ve(e,0,new WeakSet)||{};return Object.entries(t.fields).reduce((r,[i,s])=>(r[i]=ue(s,s.value?s.value(e):e[i]),r),n)}return t.type===P.LIST?Array.isArray(e)?e.map(n=>ue(t.item,n)):[]:e instanceof Date?Number.isNaN(e.getTime())?null:e.getTime():["string","number","boolean"].includes(typeof e)?typeof e=="number"&&!Number.isFinite(e)?null:e:null}function ve(t,e,n){if(t instanceof Date)return Number.isNaN(t.getTime())?null:t.getTime();if(typeof t=="number")return Number.isFinite(t)?t:null;if(typeof t=="string"||typeof t=="boolean"||t===null)return t;if(typeof t!="object"||e>=Qt||n.has(t))return null;n.add(t);try{if(Array.isArray(t))return t.map(i=>i===void 0||typeof i=="function"||typeof i=="symbol"?null:ve(i,e+1,n));const r=typeof t.toObject=="function"?t.toObject():t;return Object.entries(r).reduce((i,[s,a])=>(a!==void 0&&typeof a!="function"&&typeof a!="symbol"&&typeof a!="bigint"&&(i[s]=ve(a,e+1,n)),i),{})}finally{n.delete(t)}}class Je{constructor({contextCode:e,name:n,subjectType:r,roots:i,recipientRules:s=[],functionNames:a=[],loadData:o,sampleData:u}={}){if(!e||typeof e!="string")throw new TypeError("DataContext requires a contextCode.");if(o!==void 0&&typeof o!="function")throw new TypeError(`DataContext ${e} loadData must be a function.`);const l=Object.entries(i||{}).reduce((T,[d,p])=>{if(!X.test(d)||d.startsWith("__")||we.includes(d))throw new TypeError(`DataContext ${e} root name "${d}" is not allowed.`);return T[d]=Jt(p,d),T},{});if(!Object.keys(l).length)throw new TypeError(`DataContext ${e} requires at least one data root.`);Object.defineProperties(this,{_loadData:{enumerable:!1,value:o},_rootNodes:{enumerable:!1,value:Object.freeze(l)},_sampleData:{enumerable:!1,value:u}}),this.contextCode=e,this.functionNames=Object.freeze([...new Set(a)]),this.name=n||e,this.recipientRules=Object.freeze(s.map(({recipientType:T,name:d,description:p})=>{if(!T)throw new TypeError(`DataContext ${e} recipient rules require recipientType.`);return Object.freeze({description:p,name:d||T,recipientType:T})})),this.subjectType=r,Object.freeze(this)}get rootNames(){return Object.keys(this._rootNodes)}describe(){return{contextCode:this.contextCode,functionNames:[...this.functionNames],name:this.name,recipientRules:this.recipientRules.map(e=>({...e})),roots:Object.entries(this._rootNodes).reduce((e,[n,r])=>(e[n]=Zt(r),e),{}),subjectType:this.subjectType}}project(e={}){return Object.entries(this._rootNodes).reduce((n,[r,i])=>(n[r]=en(i,e[r]),n),{})}async load({subjectRef:e,recipientType:n,...r}={}){if(!this._loadData)throw new Error(`DataContext ${this.contextCode} has no loadData.`);if(this.recipientRules.length&&!this.recipientRules.some(s=>s.recipientType===n))throw new RangeError(`DataContext ${this.contextCode} does not support recipientType "${n}".`);const i=await this._loadData({recipientType:n,subjectRef:e,...r});if(!Array.isArray(i))throw new TypeError(`DataContext ${this.contextCode} loadData must return an array.`);return i.map(({recipientRef:s,roots:a})=>({data:this.project(a),...s!==void 0?{recipientRef:s}:{}}))}getSampleData(){return this._sampleData?structuredClone(this._sampleData):null}}function Q(t){return new Je(t)}function J(t){return t?typeof t.describe=="function"?t.describe():t:null}const U=Object.freeze({ANY:"any",ARRAY:"array",BOOLEAN:"boolean",NUMBER:"number",OBJECT:"object",STRING:"string"}),nn=new Set(Object.values(U)),rn=/^__[a-z][a-z0-9]*(?:_[a-z0-9]+)*$/,G=new Map;let je=0;function Ze({name:t,fn:e,signature:n=[],trustedHtml:r=!1,label:i,description:s}={}){if(!rn.test(t||""))throw new TypeError(`Template function name "${t}" must be "__" followed by snake_case letters and digits.`);if(typeof e!="function")throw new TypeError(`Template function ${t} requires fn.`);if(G.has(t))throw new Error(`Template function ${t} is already registered.`);if(!n.length)throw new TypeError(`Template function ${t} requires a signature with at least the piped value.`);const a=n.map((o,u)=>{const l=(o==null?void 0:o.types)||[];if(!l.length||l.some(T=>!nn.has(T)))throw new TypeError(`Template function ${t} argument #${u+1} has invalid types.`);return Object.freeze({...o.optional?{optional:!0}:{},types:Object.freeze([...l]),...o.variadic?{variadic:!0}:{}})});G.set(t,Object.freeze({descriptor:Object.freeze({...s?{description:s}:{},...i?{label:i}:{},name:t,signature:Object.freeze(a),trustedHtml:!!r}),filter:cn(t,e,a)})),je+=1}function Z(){return[...G.values()].map(({descriptor:t})=>({...t,signature:t.signature.map(e=>({...e,types:[...e.types]}))}))}function sn(t){var e;return((e=G.get(t))==null?void 0:e.descriptor)||null}function an(){return{filters:[...G.values()].map(({descriptor:t,filter:e})=>({handler:e,name:t.name,raw:t.trustedHtml})),version:je}}function on(){G.clear(),je+=1}function cn(t,e,n){return(...r)=>{const i=r.map(a=>a===void 0?null:a);i.forEach((a,o)=>{const u=n[Math.min(o,n.length-1)];if(a!==null&&u&&!u.types.some(l=>ln(a,l)))throw new TypeError(`${t} argument #${o+1} must be ${u.types.join(" or ")}.`)});const s=e(...i);return s===void 0?null:s}}function ln(t,e){switch(e){case U.ANY:return!0;case U.ARRAY:return Array.isArray(t);case U.OBJECT:return typeof t=="object"&&!Array.isArray(t);case U.BOOLEAN:return typeof t=="boolean";case U.NUMBER:return typeof t=="number";default:return typeof t=="string"}}function R({code:t,message:e,severity:n=K.ERROR,...r}={}){const i={code:t,message:e,severity:n};return["partCode","offset","line","column","source","blockRef","detail"].forEach(s=>{typeof r[s]<"u"&&(i[s]=r[s])}),i}function V(t=[]){return t.some(e=>e.severity===K.ERROR)}class Y extends Error{constructor(e=[],n){const r=e.filter(i=>i.severity===K.ERROR);super(n||un(r)),this.name="TemplateSyntaxError",this.code="TEMPLATE_SYNTAX_INVALID",this.issues=e}}class v extends Error{constructor({message:e,partCode:n,source:r,cause:i}={}){super(e||"Template rendering failed.",i?{cause:i}:void 0),this.name="TemplateRenderError",this.code="TEMPLATE_RENDER_FAILED",this.partCode=n,this.source=r}}function un(t){if(!t.length)return"Template is invalid.";const[e]=t,n=e.partCode?` (${e.partCode}${e.line?`:${e.line}:${e.column}`:""})`:"",r=t.length>1?` and ${t.length-1} more issue(s)`:"";return`${e.code}: ${e.message}${n}${r}`}const Be="data-qw-layout",dn=`<([a-z][a-z0-9-]*)\\b[^>]*\\s${Be}\\s*=\\s*"([^"]*)"[^>]*>\\s*</\\1\\s*>`,mn="PUBLISHED",et=()=>new RegExp(dn,"gi"),pn=t=>typeof(t==null?void 0:t.describe)=="function"?t.describe():t;function fn(t){return`<div ${Be}="${t}"></div>`}function de(t){return[...new Set([...String(t||"").matchAll(et())].map(([,,e])=>e))]}function Me({layouts:t=[],layoutCode:e}={}){return e&&t.map(pn).filter(n=>(n==null?void 0:n.layoutCode)===e&&n.stateCode===mn).sort((n,r)=>r.version-n.version)[0]||null}function tt({html:t,layouts:e=[]}={}){const n=new Set,r=new Set;return{html:String(t||"").replace(et(),(s,a,o)=>{const u=Me({layoutCode:o,layouts:e});return u?(n.add(`${u.layoutCode}@${u.version}`),u.html||""):(r.add(o),s)}),layoutRefs:[...n],missingLayoutCodes:[...r]}}function $e(t){return String(t||"").trim()?de(t).map(e=>R({code:y.LAYOUT_NOT_ALLOWED,layoutCode:e,message:`Layout ${e} cannot be placed inside another layout.`,partCode:"layout"})):[R({code:y.LAYOUT_EMPTY,message:"The layout is empty.",partCode:"layout"})]}const ke=Object.freeze(["#","case","comment","for","if","unless"]),me=Object.freeze(["assign","capture"]),Ue=(t=!1)=>({...t?{optional:t}:{},types:["any"]}),O=(t,e=!1)=>({...e?{optional:e}:{},types:t}),Ve=Object.freeze([{description:'Format a timestamp (milliseconds) or date text, e.g. date: "%Y-%m-%d". Dates are UTC unless a time zone is given.',label:"date",name:"date",signature:[O(["number","string"]),O(["string"],!0),O(["number","string"],!0)]},{description:"The argument when the value is nil, false or empty.",name:"default",signature:[Ue(),Ue()]},{description:"Join list items with a separator.",label:"joined",name:"join",signature:[O(["array"]),O(["string"],!0)]},{description:"The given field of every list item.",name:"map",signature:[O(["array"]),O(["string"])]},{description:"List items whose field is truthy or equals a value.",name:"where",signature:[O(["array"]),O(["string"]),Ue(!0)]},{description:'List items for which an expression is true, e.g. where_exp: "line", "line.qty > 0".',name:"where_exp",signature:[O(["array"]),O(["string"]),O(["string"])]},{description:"The first list item.",label:"first",name:"first",signature:[O(["array"])]},{description:"Number of list items or characters.",label:"count",name:"size",signature:[O(["array","string"])]},{description:"Text in upper case.",label:"upper case",name:"upcase",signature:[O(["string"])]},{description:"Text in lower case.",label:"lower case",name:"downcase",signature:[O(["string"])]},{description:"Shorten text to a length, ending with an ellipsis.",label:"shortened",name:"truncate",signature:[O(["string"]),O(["number"],!0),O(["string"],!0)]},{description:"Text without HTML tags.",name:"strip_html",signature:[O(["string"])]},{description:"Add a number.",name:"plus",signature:[O(["number"]),O(["number"])]},{description:"Subtract a number.",name:"minus",signature:[O(["number"]),O(["number"])]},{description:"Multiply by a number.",name:"times",signature:[O(["number"]),O(["number"])]},{description:"Divide by a number.",name:"divided_by",signature:[O(["number"]),O(["number"])]},{description:"Round to a number of decimals.",label:"rounded",name:"round",signature:[O(["number"]),O(["number"],!0)]}].map(t=>Object.freeze({...t,builtin:!0,signature:Object.freeze(t.signature.map(Object.freeze))}))),Tn=new Set(Ve.map(({name:t})=>t)),nt=Object.freeze({""":'"',"'":"'","<":"<",">":">","'":"'","&":"&","'":"'",">":">","<":"<"," ":" ",""":'"'}),hn=/\{\{[\s\S]*?\}\}|\{%[\s\S]*?%\}/g;function rt(t){return String(t??"").replace(hn,e=>e.replace(/&(?:#34|#39|#60|#62|#x27|amp|apos|gt|lt|nbsp|quot);/g,n=>nt[n]).replace(/[\u2018\u2019]/g,"'").replace(/[\u201C\u201D]/g,'"').replace(/\xA0/g," ").replace(/[\u200B-\u200D\uFEFF]/g,""))}function it(t){return String(t??"").replace(/&(?:#34|#39|#60|#62|#x27|amp|apos|gt|lt|nbsp|quot);/g,e=>nt[e])}function st({escape:t=!1,limits:e={},tags:n}={}){const r=new C.Liquid({cache:!1,dynamicPartials:!1,jsTruthy:!1,ownPropertyOnly:!0,strictFilters:!1,strictVariables:!1,timezoneOffset:0,...t?{outputEscape:"escape"}:{},...e});Object.keys(r.filters).forEach(s=>{Tn.has(s)||r.unregisterFilter(s)});const i=r.filters.date;if(r.registerFilter("date",function(s,...a){return i.call(this,typeof s=="number"?new Date(s):s,...a)}),n){const s=new Set(n);Object.keys(r.tags).forEach(a=>{s.has(a)||delete r.tags[a]})}return r}const z="data-qw-block",pe="data-qw-params",En=/^([A-Z][A-Z0-9_]*)@([1-9]\d*)$/,bn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","source","track","wbr"]),yn=st();function q(t,{partCode:e,allowBlocks:n=!0}={}){const r=rt(typeof t=="string"?t:""),i=Rn(r,e),s=[],a=[],o=[];let u=0,l=Te(r,u);for(;l;)o.push(l),u=l.end,l.issue?s.push(R({...l.issue,...i(l.start)})):n?a.push({...l.node,end:l.end,location:i(l.start),start:l.start}):s.push(R({blockRef:l.node.blockRef,code:y.BLOCK_NOT_ALLOWED,message:"Block instances are not allowed here.",...i(l.start)})),l=Te(r,u);let T=[];try{T=yn.parse(gn(r,o))}catch(d){s.push(_n(d,i))}return{blockRefs:[...new Set(a.map(({blockRef:d})=>d))],blocks:a,issues:s,locate:i,templates:T,text:r}}function at(t){const e=typeof t=="string"?t:"",n=new Set;let r=Te(e,0);for(;r;)r.node&&n.add(r.node.blockRef),r=Te(e,r.end);return[...n]}function _n(t,e,n=0){var i;if(!(t!=null&&t.token)&&!/^(?:Parse|Tokenization|Liquid)Error$/.test((t==null?void 0:t.name)||""))throw t;const r=String(t.message||"Template syntax error.").replace(/, line:\d+, col:\d+$/,"");return R({code:y.SYNTAX_ERROR,message:r,...e?e(n+(((i=t.token)==null?void 0:i.begin)??0)):{}})}function ot(t){const e=En.exec(typeof t=="string"?t.trim():"");return e?{blockCode:e[1],version:Number(e[2])}:null}function fe({blockCode:t,version:e}={}){return`${t}@${e}`}function On({blockCode:t,version:e,params:n={},tagName:r="div"}={}){const i=JSON.stringify(n||{}).replace(/&/g,"&").replace(/'/g,"'");return`<${r} ${z}="${fe({blockCode:t,version:e})}" ${pe}='${i}'></${r}>`}function gn(t,e){if(!e.length)return t;let n="",r=0;return e.forEach(({start:i,end:s})=>{n+=t.slice(r,i)+t.slice(i,s).replace(/[^\n]/g," "),r=s}),n+t.slice(r)}function Te(t,e){let n=e;for(;n<t.length;){const r=t.indexOf(z,n);if(r===-1)return null;const i=t.lastIndexOf("<",r),s=i>=e?An(t,i):null;if(!s||s.end<=r||!Object.hasOwn(s.attributes,z)){n=r+z.length;continue}const a=s.selfClosing||bn.has(s.name)?s.end:Cn(t,s.name,s.end);if(a===-1)return{end:t.length,issue:{code:y.BLOCK_ELEMENT_INVALID,message:`Block element <${s.name}> is not closed.`},start:i};const o=ot(it(s.attributes[z]));if(!o)return{end:a,issue:{code:y.BLOCK_ELEMENT_INVALID,message:`Block reference "${s.attributes[z]}" must look like BLOCK_CODE@1.`},start:i};let u={};const l=s.attributes[pe];if(l){try{u=JSON.parse(it(l))}catch{u=null}if(!u||typeof u!="object"||Array.isArray(u))return{end:a,issue:{blockRef:fe(o),code:y.BLOCK_PARAMS_INVALID,message:`${pe} must be a JSON object.`},start:i}}return{end:a,node:{blockCode:o.blockCode,blockRef:fe(o),params:u,type:"Block",version:o.version},start:i}}return null}function An(t,e){const n=/^<([A-Z][\w-]*)/i.exec(t.slice(e));if(!n)return null;const r={};let i=e+n[0].length;for(;i<t.length;){const s=t.slice(i),a=/^\s*(\/?)>/.exec(s);if(a)return{attributes:r,end:i+a[0].length,name:n[1].toLowerCase(),selfClosing:a[1]==="/"};const o=/^\s+([^\s"'>/=]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+)))?/.exec(s);if(!o)return null;r[o[1].toLowerCase()]=o[2]??o[3]??o[4]??"",i+=o[0].length}return null}function Cn(t,e,n){const r=new RegExp(`<(/?)${e}(?=[\\s/>])[^>]*>`,"gi");r.lastIndex=n;let i=1,s=r.exec(t);for(;s;){if(s[1]){if(i-=1,i===0)return s.index+s[0].length}else s[0].endsWith("/>")||(i+=1);s=r.exec(t)}return-1}function Rn(t,e){const n=[0];for(let r=0;r<t.length;r+=1)t[r]===`
|
|
2
|
+
`&&n.push(r+1);return r=>{let i=0;for(;i+1<n.length&&n[i+1]<=r;)i+=1;return{column:r-n[i]+1,line:i+1,offset:r,...e?{partCode:e}:{}}}}const Nn=["active","created","creator","deleted","modified","owner","revision"],Sn=["contextCode","name","templateCode","templateSyntaxVersion"],Ln=["contextCode","name","templateSyntaxVersion"];class ct extends A.TenantAwareEntity{constructor(e={}){e=e||{},super(e),this._type=e._type||"Template",this.contextCode=e.contextCode,this.name=e.name,this.partContent=lt(e.partContent),this.templateCode=e.templateCode,this.templateSyntaxVersion=Number(e.templateSyntaxVersion||se)}static get _classname(){return"Template"}static get _superclass(){return"Template"}static get kind(){return null}static get partDefinitions(){var e;return((e=this.kind)==null?void 0:e.partDefinitions)||[]}get isValid(){return super.isValid&&!!this.templateCode&&!!this.contextCode}getCode(){return this.templateCode}getId(){return this.id}getContentParts(){return this.constructor.partDefinitions.map(e=>({...e,content:this.partContent[e.partCode]??""}))}getPartContent(e){return this.partContent[e]??""}getBlockRefs(){const e=new Set;return this.getContentParts().forEach(({content:n})=>{at(n).forEach(r=>e.add(r))}),[...e]}getLayoutCodes(){return[...new Set(this.getContentParts().flatMap(({content:e})=>de(e)))]}setPartContent(e,n){if(!this.constructor.partDefinitions.some(r=>r.partCode===e))throw new RangeError(`${this.constructor._classname} has no part "${e}".`);return n===null?delete this.partContent[e]:this.partContent[e]=String(n),this}update(e={}){return Ln.forEach(n=>{Object.hasOwn(e,n)&&(this[n]=n==="templateSyntaxVersion"?Number(e[n]):e[n])}),e.partContent&&typeof e.partContent=="object"&&Object.entries(e.partContent).forEach(([n,r])=>{this.setPartContent(n,r)}),super.update(e)}toJSON(){return this.toObject()}toObject(){const e={_type:this._type,meta:A.copySerializableProperties(this.meta,Nn),metadata:A.copySerializableKeyValueObjects(this.metadata),partContent:lt(this.partContent),remarks:A.copySerializableKeyValueObjects(this.remarks),tenantCode:this.tenantCode,...A.copySerializableProperties(this,Sn)};return typeof this.id<"u"&&(e.id=this.id),e}}function lt(t){return!t||typeof t!="object"?{}:Object.entries(t).reduce((e,[n,r])=>(typeof r=="string"&&(e[n]=r),e),{})}const F=Object.freeze({DEPRECATED:"DEPRECATED",DRAFT:"DRAFT",PUBLISHED:"PUBLISHED"}),Pn=new Set(Object.values(F)),In=Object.freeze({DEPRECATED:new Set,DRAFT:new Set(["PUBLISHED"]),PUBLISHED:new Set(["DEPRECATED"])});class he extends A.Lifecycle{constructor(e={}){super(e),this._setPublicationState(e.publication)}static get _classname(){return"LifecycleTemplateBlock"}static get entityType(){return"TemplateBlock"}static create({actionRevision:e,modified:n=Date.now()}={}){return this.init({publication:{actionRevision:e,modified:n,stateCode:F.DRAFT}})}canTransition(e,n){var i,s;const r=(i=this.getState(e))==null?void 0:i.stateCode;return e==="publication"&&!!((s=In[r])!=null&&s.has(n))}transition(e,{actionRevision:n,modified:r=Date.now(),stateCode:i}={}){var s;if(!this.canTransition(e,i))throw new Error(`Invalid ${this.constructor.entityType} lifecycle transition: ${e} ${((s=this.getState(e))==null?void 0:s.stateCode)||"UNKNOWN"} -> ${i||"UNKNOWN"}`);return this._setPublicationState({actionRevision:n,modified:r,stateCode:i})}_setPublicationState(e){if(!Pn.has(e==null?void 0:e.stateCode))throw new TypeError(`Invalid ${this.constructor.entityType} lifecycle state for publication.`);return this._setState("publication",e)}}const S=Object.freeze({BOOLEAN:"boolean",MULTI_SELECT:"multiSelect",SELECT:"select",TEXT:"text"}),wn=new Set(Object.values(S)),ut=new Set([S.MULTI_SELECT,S.SELECT]);function H(t=[]){const e=[],n=new Set;return{definitions:(Array.isArray(t)?t:[]).map((i,s)=>{const{paramCode:a,type:o,label:u,description:l,required:T=!1,options:d=[]}=i||{};return!X.test(a||"")||a.startsWith("__")?e.push(`Param #${s+1} has an invalid paramCode "${a}".`):n.has(a)&&e.push(`Param "${a}" is declared twice.`),n.add(a),wn.has(o)||e.push(`Param "${a}" has unsupported type "${o}".`),ut.has(o)&&(!Array.isArray(d)||!d.length?e.push(`Param "${a}" requires options.`):d.some(p=>!X.test(String((p==null?void 0:p.value)??"")))&&e.push(`Param "${a}" option values must match [A-Za-z_]\\w*.`)),{...l?{description:l}:{},..."default"in(i||{})?{default:i.default}:{},label:u||a,...ut.has(o)?{options:d.map(({value:p,label:b})=>({label:b||p,value:p}))}:{},paramCode:a,required:!!T,type:o}}),errors:e}}function ze(t=[],e={}){const n=[],r=e&&typeof e=="object"?e:{},i=new Set(t.map(({paramCode:a})=>a));Object.keys(r).forEach(a=>{i.has(a)||n.push(`Unknown param "${a}".`)});const s=t.reduce((a,o)=>{const{paramCode:u,type:l,required:T}=o,d=Object.hasOwn(r,u)?r[u]:o.default;if(d==null||d==="")return T&&n.push(`Param "${u}" is required.`),a[u]=l===S.MULTI_SELECT?[]:l===S.BOOLEAN?!1:null,a;const p=vn(o,d);return p&&n.push(p),a[u]=d,a},{});return{errors:n,values:s}}function Dn(t=[],e={}){return t.reduce((n,{paramCode:r,type:i})=>(i===S.MULTI_SELECT?n[r]=(Array.isArray(e[r])?e[r]:[]).reduce((s,a)=>(s[a]=!0,s),{}):n[r]=e[r]??null,n),{})}function Fe(t=[]){return{fields:t.reduce((e,{paramCode:n,type:r,label:i,options:s})=>(r===S.MULTI_SELECT?e[n]={fields:s.reduce((a,o)=>(a[o.value]={label:o.label,type:"boolean"},a),{}),label:i,type:"object"}:e[n]={label:i,type:r===S.BOOLEAN?"boolean":"string"},e),{}),type:"object"}}function vn({paramCode:t,type:e,options:n=[]},r){const i=new Set(n.map(s=>s.value));switch(e){case S.BOOLEAN:return typeof r=="boolean"?null:`Param "${t}" must be a boolean.`;case S.TEXT:return typeof r=="string"?null:`Param "${t}" must be text.`;case S.SELECT:return i.has(r)?null:`Param "${t}" must be one of ${[...i].join(", ")}.`;case S.MULTI_SELECT:return Array.isArray(r)&&r.every(s=>i.has(s))?null:`Param "${t}" must be a list of ${[...i].join(", ")}.`;default:return null}}const Ee=Object.freeze({EMAIL:"EMAIL"}),B=Object.freeze({TEXT_HTML:"text/html",TEXT_PLAIN:"text/plain"}),M=Object.freeze({MAILBOX:"mailbox",MAILBOX_LIST:"mailboxList",TEXT:"text"}),be=Object.freeze({fieldDefinitions:Object.freeze([Object.freeze({emailExpression:!1,fieldCode:"from",label:"From",nameExpression:!0,type:M.MAILBOX}),Object.freeze({emailExpression:!0,fieldCode:"replyTo",label:"Reply to",nameExpression:!0,type:M.MAILBOX}),Object.freeze({emailExpression:!0,fieldCode:"cc",label:"CC",nameExpression:!0,type:M.MAILBOX_LIST}),Object.freeze({emailExpression:!0,fieldCode:"bcc",label:"BCC",nameExpression:!0,type:M.MAILBOX_LIST})]),label:"Email",partDefinitions:Object.freeze([Object.freeze({contentType:B.TEXT_PLAIN,label:"Subject",partCode:"subject",required:!0}),Object.freeze({contentType:B.TEXT_HTML,label:"HTML",partCode:"html",required:!0}),Object.freeze({contentType:B.TEXT_PLAIN,label:"Plain text",partCode:"text",required:!1})]),previewModes:Object.freeze([Object.freeze({label:"Desktop",previewModeCode:"DESKTOP",width:1024}),Object.freeze({label:"Tablet",previewModeCode:"TABLET",width:768}),Object.freeze({label:"Mobile",previewModeCode:"MOBILE",width:375})]),previewViews:Object.freeze([Object.freeze({label:"Inbox",previewViewCode:"INBOX"}),Object.freeze({label:"HTML",previewViewCode:"HTML"}),Object.freeze({label:"Plain text",previewViewCode:"TEXT"})]),templateKindCode:Ee.EMAIL}),jn=Object.freeze({[Ee.EMAIL]:be});function xe(t){return jn[t]||null}function Bn(t){return structuredClone({fieldDefinitions:t.fieldDefinitions||[],label:t.label,partDefinitions:t.partDefinitions||[],previewModes:t.previewModes||[],previewViews:t.previewViews||[],templateKindCode:t.templateKindCode})}function Mn(t,e={}){return(t.fieldDefinitions||[]).flatMap(({fieldCode:n,type:r,emailExpression:i,nameExpression:s,expressionAllowed:a=!1})=>{const o=e[n];return r===M.TEXT?typeof o=="string"&&o?[{content:o,expressionAllowed:!!a,fieldPath:n}]:[]:(r===M.MAILBOX_LIST?Array.isArray(o)?o:[]:o?[o]:[]).flatMap((l,T)=>{const d=r===M.MAILBOX_LIST?`${n}[${T}]`:n;return[{content:(l==null?void 0:l.email)||"",expressionAllowed:i,fieldPath:`${d}.email`},{content:(l==null?void 0:l.name)||"",expressionAllowed:s,fieldPath:`${d}.name`}].filter(({content:p})=>p)})})}const dt=new Map(Ve.map(t=>[t.name,t])),I=Object.freeze({type:"number"}),Ke=Object.freeze({type:"string"}),Ge=Object.freeze({type:"boolean"}),$n=Object.freeze({fields:Object.freeze({first:Ge,index:I,index0:I,last:Ge,length:I,rindex:I,rindex0:I}),label:"Loop",type:"object"}),kn=new Set([k,"forloop"]),Un=new Set(["where","where_exp"]),Vn=new Set(["date","downcase","join","strip_html","truncate","upcase"]),zn=new Set(["divided_by","minus","plus","round","size","times"]);function ye(t,{locate:e,text:n,roots:r=null,variables:i=new Map,functionsByName:s=null,allowedFunctionNames:a=null,allowAssign:o=!1}={}){const u={allowAssign:o,allowedFunctionNames:a,assigned:new Map,functionsByName:s,issues:[],locate:e,requiredRoots:new Set,roots:r,text:n};return $(t,i,u),{issues:u.issues,requiredRoots:[...u.requiredRoots].sort()}}function Fn(t,e){return dt.get(t)||(e==null?void 0:e.get(t))||null}function $(t,e,n){(t||[]).forEach(r=>{const{token:i}=r;if(C.TypeGuards.isOutputToken(i)){const s=Oe(n,i),a=ee(r.value,e,n,s);a&&(a.type==="list"||a.type==="object")&&L(n,y.OUTPUT_NOT_SCALAR,`"${s}" outputs a ${a.type}; output a field of it or use a filter such as join or size.`,i,s);return}C.TypeGuards.isTagToken(i)&&xn(r,e,n)})}function xn(t,e,n){var a;const{name:r,token:i}=t,s=Oe(n,i);if(!ke.includes(r)&&!(n.allowAssign&&me.includes(r))){const o=me.includes(r)?" outside block fragments":"";L(n,y.TAG_NOT_ALLOWED,`Tag "${r}" is not allowed${o}.`,i,s);return}switch(r){case"if":case"unless":t.branches.forEach(o=>{ee(o.value,e,n,s),$(o.templates,e,n)}),$(t.elseTemplates,e,n);break;case"case":ee(t.value,e,n,s),t.branches.forEach(o=>{o.values.forEach(u=>j(u,e,n,s)),$(o.templates,e,n)}),$(t.elseTemplates,e,n);break;case"for":{const{variable:o}=t;Ye(o,e,n,i,s);const u=j(t.collection,e,n,s);let l=null;C.TypeGuards.isRangeToken(t.collection)?l=I:u&&u.type!=="list"?L(n,y.LOOP_SOURCE_NOT_LIST,`"${Oe(n,t.collection)}" is not a list.`,t.collection,s):u&&(l=u.item||null),Object.values(((a=t.hash)==null?void 0:a.hash)||{}).forEach(T=>{T&&j(T,e,n,s)}),$(t.templates,new Map([...e,[o,l],["forloop",$n]]),n),$(t.elseTemplates,e,n);break}case"assign":{Ye(t.key,e,n,i,s),n.assigned.set(t.key,ee(t.value,e,n,s));break}case"capture":Ye(t.variable,e,n,i,s),$(t.templates,e,n),n.assigned.set(t.variable,Ke);break}}function Ye(t,e,n,r,i){!X.test(t||"")||t.startsWith("__")?L(n,y.VARIABLE_INVALID,`Variable "${t}" must match [A-Za-z_]\\w* and must not start with "__".`,r,i):(we.includes(t)||e.has(t)||n.roots&&Object.hasOwn(n.roots,t))&&L(n,y.VARIABLE_INVALID,`Variable "${t}" conflicts with a data root, a loop variable or a reserved name.`,r,i)}function ee(t,e,n,r){if(!t)return null;let i=mt(t.initial,e,n,r);return(t.filters||[]).forEach(s=>{i=Gn(s,i,e,n,r)}),i}function mt(t,e,n,r){const i=[...(t==null?void 0:t.postfix)||[]],s=i.map(a=>j(a,e,n,r));return i.length===1?s[0]:i.some(a=>C.TypeGuards.isOperatorToken(a))?Ge:null}function j(t,e,n,r){return t?C.TypeGuards.isPropertyAccessToken(t)?Kn(t,e,n,r):C.TypeGuards.isRangeToken(t)?(j(t.lhs,e,n,r),j(t.rhs,e,n,r),{item:I,type:"list"}):C.TypeGuards.isNumberToken(t)?I:C.TypeGuards.isQuotedToken(t)?Ke:t.initial?ee(t,e,n,r):null:null}function Kn(t,e,n,r){const[i,...s]=t.props||[],a=i==null?void 0:i.content;if(typeof a!="string"||!C.TypeGuards.isWordToken(i))return null;let o;if(e.has(a))o=e.get(a);else if(n.assigned.has(a))o=n.assigned.get(a);else if(n.roots)if(Object.hasOwn(n.roots,a))n.requiredRoots.add(a),o=n.roots[a];else return L(n,y.ROOT_UNKNOWN,`"${a}" is not a data root of this context (${Object.keys(n.roots).join(", ")}) or a template variable.`,t,r),null;else return a!==k&&n.requiredRoots.add(a),null;for(const u of s){if(!o)return null;if(C.TypeGuards.isPropertyAccessToken(u)||u.initial){if(j(u,e,n,r),o.type==="list"){o=o.item||null;continue}return o.type==="object"?null:_e(n,t,r,"only a list or an object can be indexed.")}if(C.TypeGuards.isNumberToken(u)){if(o.type!=="list")return _e(n,t,r,"only a list can be indexed.");o=o.item||null;continue}const l=u.content;if(o.type==="list")if(l==="size")o=I;else if(l==="first"||l==="last")o=o.item||null;else return _e(n,t,r,`a list has no field "${l}" (use size, first, last or a loop).`);else if(o.type==="string"&&l==="size")o=I;else if(o.type==="object"&&o.fields&&Object.hasOwn(o.fields,l))o=o.fields[l];else return o.type==="object"&&!kn.has(a)?null:_e(n,t,r,`field "${l}" does not exist.`)}return o}function _e(t,e,n,r){return L(t,y.PATH_UNKNOWN,`"${Oe(t,e)}": ${r}`,e,n),null}function Gn(t,e,n,r,i){var g;const{name:s,args:a=[]}=t;if(!s)return L(r,y.SYNTAX_ERROR,'A filter name is missing after "|".',t.token,i),null;const o=a.filter(f=>!Array.isArray(f)),u=a.filter(f=>Array.isArray(f));o.forEach(f=>j(f,n,r,i)),u.forEach(([,f])=>j(f,n,r,i));const l=dt.get(s),T=l||((g=r.functionsByName)==null?void 0:g.get(s));if(!T)return(r.functionsByName||!s.startsWith("__"))&&L(r,y.UNKNOWN_FUNCTION,`Filter "${s}" is not available.`,t.token,i),null;if(!l&&r.allowedFunctionNames&&!r.allowedFunctionNames.has(s))return L(r,y.FUNCTION_NOT_ALLOWED,`Filter "${s}" is not allowed in this data context.`,t.token,i),null;const d=(T.signature||[]).slice(1),p=d.filter(f=>!f.optional&&!f.variadic).length,b=d.some(f=>f.variadic);if(u.length||o.length<p||!b&&o.length>d.length){const f=b?`at least ${p}`:p===d.length?p:`${p}-${d.length}`;return L(r,y.FUNCTION_ARGUMENTS_INVALID,`Filter "${s}" expects ${f} argument(s)${u.length?" and no named arguments":""}, got ${o.length}.`,t.token,i),null}return l?Yn(s,e,o,n,r,i):null}function Yn(t,e,n,r,i,s){const a=(e==null?void 0:e.type)==="list"?e.item:null,o=l=>!a||a.type!=="object"||typeof l!="string"?null:a.fields&&Object.hasOwn(a.fields,l)?a.fields[l]:null,u=l=>l&&C.TypeGuards.isQuotedToken(l)?l.content:null;if(t==="where")return o(u(n[0])),e;if(t==="where_exp")return qn(u(n[0]),n[1],a,r,i,s),e;if(Un.has(t))return e;if(t==="map"){const l=o(u(n[0]));return(e==null?void 0:e.type)==="list"?{item:l,type:"list"}:null}return t==="first"?a:t==="default"?e:zn.has(t)?I:Vn.has(t)?Ke:null}function qn(t,e,n,r,i,s){if(!t||!e||!C.TypeGuards.isQuotedToken(e))return;let a;try{a=new C.Tokenizer(e.content).readExpression()}catch(u){L(i,y.SYNTAX_ERROR,`where_exp expression: ${u.message}`,e,s);return}const o={...i,text:e.content};o.issues=[],mt(a,new Map([...r,[t,n]]),o,s),o.issues.forEach(u=>i.issues.push({...u,...i.locate(e.begin)}))}function Oe(t,e){return t.text&&e?t.text.slice(e.begin,e.end):""}function L(t,e,n,r,i){t.issues.push(R({code:e,message:n,...t.locate((r==null?void 0:r.begin)??0),...i?{source:i}:{}}))}const Hn=/\{\{|\{%/,qe=Object.freeze({DEPRECATED:"DEPRECATED",DRAFT:"DRAFT",PUBLISHED:"PUBLISHED"});function Wn({template:t,kind:e,context:n,functions:r,blocks:i,allowedDeprecatedBlockRefs:s,layouts:a=[]}={}){var E;const o=typeof(t==null?void 0:t.toObject)=="function"?t.toObject():t||{},u=e||((E=t==null?void 0:t.constructor)==null?void 0:E.kind)||xe(o.templateKindCode),l=[],T=new Set,d=new Set;if(!u)throw new TypeError("checkTemplate requires a template kind.");const p=o.templateSyntaxVersion??se;if(!Ie.includes(p))return l.push(R({code:y.SYNTAX_VERSION_UNSUPPORTED,message:`Template syntax version ${p} is not supported.`})),{blockRefs:[],issues:l,layoutCodes:[],valid:!1};const b=ht({allowedDeprecatedBlockRefs:s,blocks:i,context:n,functions:r}),g=o.partContent||{},f=new Set(u.partDefinitions.map(({partCode:m})=>m));return u.partDefinitions.forEach(({partCode:m,required:h})=>{const _=g[m];if(typeof _!="string"||!_.trim()){h&&l.push(R({code:y.PART_REQUIRED,message:`Part "${m}" is required.`,partCode:m}));return}const N=ge(_,{allowBlocks:!0,env:b,partCode:m});l.push(...N.issues),N.blockRefs.forEach(w=>T.add(w)),de(_).forEach(w=>{d.has(w)||l.push(...Xn(w,{env:b,layouts:a,partCode:m})),d.add(w)})}),Object.keys(g).forEach(m=>{f.has(m)||l.push(R({code:y.PART_UNKNOWN,message:`Part "${m}" is not declared by template kind ${u.templateKindCode}.`,partCode:m}))}),Mn(u,o).forEach(({fieldPath:m,content:h,expressionAllowed:_})=>{if(!_){Hn.test(h)&&l.push(R({code:y.FIELD_EXPRESSION_NOT_ALLOWED,message:`Field "${m}" must be a fixed value.`,partCode:m}));return}l.push(...ge(h,{allowBlocks:!1,env:b,partCode:m}).issues)}),{blockRefs:[...T],issues:l,layoutCodes:[...d],valid:!V(l)}}function Xn(t,{env:e,layouts:n,partCode:r}){const i=Me({layoutCode:t,layouts:n});if(!i)return[R({code:y.LAYOUT_NOT_FOUND,layoutCode:t,message:`Layout ${t} has no published version.`,partCode:r})];const s=`${i.layoutCode}@${i.version}`;return[...ge(i.html||"",{allowBlocks:!1,env:e,partCode:r}).issues,...$e(i.html)].map(a=>({...a,layoutRef:s,message:`${s}: ${a.message}`,partCode:r}))}function Qn({content:t,partCode:e,allowBlocks:n=!0,context:r,functions:i,blocks:s,allowedDeprecatedBlockRefs:a}={}){const o=ht({allowedDeprecatedBlockRefs:a,blocks:s,context:r,functions:i}),u=ge(t,{allowBlocks:n,env:o,partCode:e});return{...u,valid:!V(u.issues)}}function pt({fragment:t,params:e,functions:n,context:r}={}){const{definitions:i,errors:s}=H(e),a=s.map(u=>R({code:y.BLOCK_PARAMS_INVALID,message:u})),o=Tt(t,{allowAssign:!0,context:r,functions:n,paramsRoot:Fe(i)});return a.push(...o.issues),{issues:a,requiredRoots:o.requiredRoots,valid:!V(a)}}function ft({html:t,functions:e}={}){const n=Tt(t||"",{allowAssign:!1,functions:e,paramsRoot:Fe([])}),r=[...n.issues.map(i=>({...i,partCode:"layout"})),...$e(t)];return{issues:r,requiredRoots:n.requiredRoots,valid:!V(r)}}function Tt(t,{allowAssign:e,context:n,functions:r,paramsRoot:i}){const s=J(n),a=q(t,{allowBlocks:!1}),o=r||(s?Z():null),u=ye(a.templates,{allowAssign:e,allowedFunctionNames:s?new Set(s.functionNames||[]):null,functionsByName:o?new Map(o.map(l=>[l.name,l])):null,locate:a.locate,roots:(s==null?void 0:s.roots)||null,text:a.text,variables:new Map([[k,i]])});return{issues:[...a.issues,...u.issues],requiredRoots:u.requiredRoots}}function ht({allowedDeprecatedBlockRefs:t=[],blocks:e=[],context:n,functions:r}){const i=J(n);if(!i||!i.roots)throw new TypeError("Template checks require a data context.");const s=r||Z();return{allowedDeprecatedBlockRefs:new Set(t),allowedFunctionNames:new Set(i.functionNames||[]),blocksByRef:new Map(e.map(a=>{const o=typeof a.describe=="function"?a.describe():a;return[`${o.blockCode}@${o.version}`,o]})),contextCode:i.contextCode,functionsByName:new Map(s.map(a=>[a.name,a])),roots:i.roots}}function ge(t,{allowBlocks:e,env:n,partCode:r}){const i=q(t,{allowBlocks:e,partCode:r}),s=[...i.issues];return s.push(...ye(i.templates,{allowedFunctionNames:n.allowedFunctionNames,functionsByName:n.functionsByName,locate:i.locate,roots:n.roots,text:i.text}).issues),i.blocks.forEach(a=>Jn(a,n,s)),{blockRefs:i.blockRefs,issues:s}}function Jn(t,e,n){const{blockRef:r,location:i}=t,s=(d,p,b)=>n.push(R({blockRef:r,code:d,message:p,severity:b,...i})),a=e.blocksByRef.get(r);if(!a){s(y.UNKNOWN_BLOCK,`Block ${r} does not exist.`);return}const o=a.stateCode||qe.PUBLISHED;if(o===qe.DRAFT){s(y.BLOCK_NOT_PUBLISHED,`Block ${r} is not published.`);return}if(o===qe.DEPRECATED){const d=e.allowedDeprecatedBlockRefs.has(r);s(y.BLOCK_DEPRECATED,d?`Block ${r} is deprecated; consider a newer version.`:`Block ${r} is deprecated and cannot be added.`,d?K.WARNING:K.ERROR)}if(a.contextCode!==e.contextCode){s(y.BLOCK_CONTEXT_MISMATCH,`Block ${r} is for data context ${a.contextCode||"(none)"}, not ${e.contextCode}.`);return}const u=(a.requiredRoots||[]).filter(d=>!Object.hasOwn(e.roots,d));u.length&&s(y.BLOCK_ROOT_NOT_IN_CONTEXT,`Block ${r} requires data roots not in this context: ${u.join(", ")}.`);const{definitions:l}=H(a.params),{errors:T}=ze(l,t.params);if(T.forEach(d=>s(y.BLOCK_PARAMS_INVALID,`${r}: ${d}`)),typeof a.fragment=="string"&&!u.length){const d=q(a.fragment,{allowBlocks:!1}),p=ye(d.templates,{allowAssign:!0,allowedFunctionNames:e.allowedFunctionNames,functionsByName:e.functionsByName,locate:d.locate,roots:e.roots,text:d.text,variables:new Map([[k,Fe(l)]])});[...d.issues,...p.issues].forEach(b=>n.push(R({...i,blockRef:r,code:b.code,message:`${r}: ${b.message}`,severity:b.severity})))}}const Zn=["active","created","creator","deleted","modified","owner","revision"],er=["blockCode","category","contextCode","description","fragment","name","tenantCode","version"],Et=["category","contextCode","description","fragment","name","params"],tr=/^[A-Z][A-Z0-9_]*$/,nr=Object.freeze({DEPRECATED:"TEMPLATE_BLOCK_DEPRECATED",PUBLISHED:"TEMPLATE_BLOCK_PUBLISHED"});class bt extends A.TrackedEntity{constructor(e={}){e=e||{},super(e),this._type=e._type||"TemplateBlock",this.blockCode=e.blockCode,this.category=e.category||"",this.contextCode=e.contextCode||"",this.description=e.description||"",this.fragment=typeof e.fragment=="string"?e.fragment:"",this.lifecycle=e.lifecycle?he.init(e.lifecycle):null,this.name=e.name||"",this.params=H(e.params).definitions,this.requiredRoots=Array.isArray(e.requiredRoots)?[...e.requiredRoots]:[],this.tenantCode=e.tenantCode||void 0,this.version=Number(e.version)}static get _classname(){return"TemplateBlock"}static get _superclass(){return"TemplateBlock"}static create({actionRevision:e=1,modified:n=Date.now(),...r}={}){return this.init({...r,lifecycle:he.create({actionRevision:e,modified:n}).toObject(),meta:{...r.meta,revision:e}})}get isValid(){var e;return super.isValid&&tr.test(this.blockCode||"")&&!!this.contextCode&&Number.isInteger(this.version)&&this.version>=1&&!!((e=this.lifecycle)!=null&&e.isValid)}get blockRef(){return`${this.blockCode}@${this.version}`}get stateCode(){var e,n;return((n=(e=this.lifecycle)==null?void 0:e.getState("publication"))==null?void 0:n.stateCode)||null}get isDraft(){return this.stateCode===F.DRAFT}getCode(){return this.blockRef}getId(){return this.id}check({context:e,functions:n}={}){var r;if(e&&((r=J(e))==null?void 0:r.contextCode)!==this.contextCode)throw new TypeError(`TemplateBlock ${this.blockRef} belongs to data context ${this.contextCode}.`);return pt({context:e,fragment:this.fragment,functions:n,params:this.params})}update(e={}){if(Et.some(r=>Object.hasOwn(e,r))&&!this.isDraft)throw new Error(`TemplateBlock ${this.blockRef} is ${this.stateCode}; publish changes as a new version.`);return Et.forEach(r=>{Object.hasOwn(e,r)&&(this[r]=r==="params"?H(e.params).definitions:e[r]??"")}),super.update(e)}publish({actionRevision:e=this.revision+1,context:n,modified:r=Date.now(),functions:i}={}){const s=this.check({context:n,functions:i});if(!s.valid)throw new Y(s.issues.map(a=>({...a,blockRef:this.blockRef})));return this.lifecycle.transition("publication",{actionRevision:e,modified:r,stateCode:F.PUBLISHED}),this.requiredRoots=s.requiredRoots,this.meta.revision=e,this.setModified()}deprecate({actionRevision:e=this.revision+1,modified:n=Date.now()}={}){return this.lifecycle.transition("publication",{actionRevision:e,modified:n,stateCode:F.DEPRECATED}),this.meta.revision=e,this.setModified()}createEntityAction({actionCode:e,actor:n,previousStateCode:r,timestamp:i=Date.now(),...s}={}){return A.EntityAction.init({...s,actionCode:e,actor:n,entityCode:this.blockRef,entityId:this.getId(),entityRevision:this.revision,entityType:this._type,lifecycleChange:{publication:{from:r,to:this.stateCode}},...this.tenantCode?{tenantCode:this.tenantCode}:{},timestamp:i})}describe(){return{blockCode:this.blockCode,blockRef:this.blockRef,category:this.category,contextCode:this.contextCode,description:this.description,fragment:this.fragment,name:this.name,params:A.copySerializableValue(this.params),requiredRoots:[...this.requiredRoots],stateCode:this.stateCode,...this.tenantCode?{tenantCode:this.tenantCode}:{},version:this.version}}toJSON(){return this.toObject()}toObject(){const e={_type:this._type,...this.lifecycle?{lifecycle:this.lifecycle.toObject()}:{},meta:A.copySerializableProperties(this.meta,Zn),params:A.copySerializableValue(this.params),requiredRoots:[...this.requiredRoots],...A.copySerializableProperties(this,er)};return typeof this.id<"u"&&(e.id=this.id),e}}const Ae=["email","name"],rr=["bcc","cc","from","replyTo"];class yt extends ct{constructor(e={}){if(e=e||{},Array.isArray(e.to)?e.to.length:e.to)throw new TypeError('TemplateEmail does not accept "to"; recipients come from the sending job.');super(e),this._type=e._type||"TemplateEmail",this.bcc=He(e.bcc),this.cc=He(e.cc),this.from=Ce(e.from),this.replyTo=Ce(e.replyTo)}static get _classname(){return"TemplateEmail"}static get kind(){return be}update(e={}){if(Array.isArray(e.to)?e.to.length:e.to)throw new TypeError('TemplateEmail does not accept "to"; recipients come from the sending job.');return rr.forEach(n=>{Object.hasOwn(e,n)&&(this[n]=n==="cc"||n==="bcc"?He(e[n]):Ce(e[n]))}),super.update(e)}toObject(){return{...super.toObject(),bcc:this.bcc.map(e=>A.copySerializableProperties(e,Ae)),cc:this.cc.map(e=>A.copySerializableProperties(e,Ae)),from:this.from?A.copySerializableProperties(this.from,Ae):null,replyTo:this.replyTo?A.copySerializableProperties(this.replyTo,Ae):null}}}function Ce(t){return t?typeof t=="string"?t.trim()?{email:t.trim()}:null:typeof t!="object"||!t.email?null:{email:String(t.email).trim(),...t.name?{name:String(t.name)}:{}}:null}function He(t){return(Array.isArray(t)?t:[]).map(Ce).filter(Boolean)}const Re=F;class We extends he{static get _classname(){return"LifecycleTemplateLayout"}static get entityType(){return"TemplateLayout"}}const ir=["active","created","creator","deleted","modified","owner","revision"],sr=["description","eventShortCode","html","layoutCode","name","templateKindCode","tenantCode","version"],_t=["description","html","name"],ar=/^[A-Z][A-Z0-9_]*$/,or=Object.freeze({DEPRECATED:"TEMPLATE_LAYOUT_DEPRECATED",PUBLISHED:"TEMPLATE_LAYOUT_PUBLISHED"});class cr extends A.TrackedEntity{constructor(e={}){e=e||{},super(e),this._type=e._type||"TemplateLayout",this.description=e.description||"",this.eventShortCode=e.eventShortCode||void 0,this.html=typeof e.html=="string"?e.html:"",this.layoutCode=e.layoutCode,this.lifecycle=e.lifecycle?We.init(e.lifecycle):null,this.name=e.name||"",this.requiredRoots=Array.isArray(e.requiredRoots)?[...e.requiredRoots]:[],this.templateKindCode=e.templateKindCode||Ee.EMAIL,this.tenantCode=e.tenantCode||void 0,this.version=Number(e.version)}static get _classname(){return"TemplateLayout"}static get _superclass(){return"TemplateLayout"}static create({actionRevision:e=1,modified:n=Date.now(),...r}={}){return this.init({...r,lifecycle:We.create({actionRevision:e,modified:n}).toObject(),meta:{...r.meta,revision:e}})}get isValid(){var e;return super.isValid&&ar.test(this.layoutCode||"")&&Number.isInteger(this.version)&&this.version>=1&&!!((e=this.lifecycle)!=null&&e.isValid)}get layoutRef(){return`${this.layoutCode}@${this.version}`}get stateCode(){var e,n;return((n=(e=this.lifecycle)==null?void 0:e.getState("publication"))==null?void 0:n.stateCode)||null}get isDraft(){return this.stateCode===Re.DRAFT}getCode(){return this.layoutRef}getId(){return this.id}check({functions:e}={}){return ft({functions:e,html:this.html})}update(e={}){if(_t.some(r=>Object.hasOwn(e,r))&&!this.isDraft)throw new Error(`TemplateLayout ${this.layoutRef} is ${this.stateCode}; publish changes as a new version.`);return _t.forEach(r=>{Object.hasOwn(e,r)&&(this[r]=e[r]??"")}),super.update(e)}publish({actionRevision:e=this.revision+1,modified:n=Date.now(),functions:r}={}){const i=this.check({functions:r});if(!i.valid)throw new Y(i.issues.map(s=>({...s,layoutRef:this.layoutRef})));return this.lifecycle.transition("publication",{actionRevision:e,modified:n,stateCode:Re.PUBLISHED}),this.requiredRoots=i.requiredRoots,this.meta.revision=e,this.setModified()}deprecate({actionRevision:e=this.revision+1,modified:n=Date.now()}={}){return this.lifecycle.transition("publication",{actionRevision:e,modified:n,stateCode:Re.DEPRECATED}),this.meta.revision=e,this.setModified()}createEntityAction({actionCode:e,actor:n,previousStateCode:r,timestamp:i=Date.now(),...s}={}){return A.EntityAction.init({...s,actionCode:e,actor:n,entityCode:this.layoutRef,entityId:this.getId(),entityRevision:this.revision,entityType:this._type,lifecycleChange:{publication:{from:r,to:this.stateCode}},...this.tenantCode?{tenantCode:this.tenantCode}:{},timestamp:i})}describe(){return{description:this.description,...this.eventShortCode?{eventShortCode:this.eventShortCode}:{},html:this.html,layoutCode:this.layoutCode,layoutRef:this.layoutRef,name:this.name,requiredRoots:[...this.requiredRoots],stateCode:this.stateCode,templateKindCode:this.templateKindCode,...this.tenantCode?{tenantCode:this.tenantCode}:{},version:this.version}}toJSON(){return this.toObject()}toObject(){const e={_type:this._type,...this.lifecycle?{lifecycle:this.lifecycle.toObject()}:{},meta:A.copySerializableProperties(this.meta,ir),requiredRoots:[...this.requiredRoots],...A.copySerializableProperties(this,sr)};return typeof this.id<"u"&&(e.id=this.id),e}}const Ot=Object.freeze({memoryLimit:1e7,parseLimit:1024*1024,renderLimit:1e3}),gt="qw_block";let te=null;const lr={parse(t){if(this.block=te==null?void 0:te[Number(t.args)],!this.block)throw new Error(`Unknown block instance ${t.args}.`)},*render(t,e){const n=t.spawn({...t.environments,[k]:this.block.params});yield this.liquid.renderer.renderTemplates(this.block.templates,n,e)}};function At({maxCacheEntries:t=500,limits:e={}}={}){const n=new Map,r=Object.freeze({...Ot,...e});let i=null;const s=()=>{const{filters:d,version:p}=an();if((i==null?void 0:i.version)===p)return i;n.clear();const b=g=>{const f=st({escape:g,limits:r,tags:[...ke,...me]});return d.forEach(({name:E,handler:m,raw:h})=>f.registerFilter(E,{handler:m,raw:g&&h})),f.registerTag(gt,lr),f};return i={html:b(!0),text:b(!1),version:p},i},a=({content:d,contentType:p,partCode:b,allowedFunctions:g,blocks:f,allowBlocks:E,cacheKey:m})=>{s();const h=m?`${m}\0${b}\0${p}\0${g.join(",")}`:null;if(h&&n.has(h)){const N=n.get(h);return n.delete(h),n.set(h,N),N}const _=pr({allowBlocks:E,allowedFunctions:g,blocks:f,content:d,contentType:p,engines:s(),partCode:b});return h&&(n.set(h,_),n.size>t&&n.delete(n.keys().next().value)),_},o=({content:d,contentType:p=B.TEXT_HTML,partCode:b,data:g,context:f,blocks:E,cacheKey:m,allowBlocks:h=!0}={})=>{const _=J(f);if(!_)throw new TypeError("Template rendering requires a data context.");return a({allowBlocks:h,allowedFunctions:[..._.functionNames||[]].sort(),blocks:mr(E),cacheKey:m,content:d??"",contentType:p,partCode:b}).render(g||{})};return Object.freeze({clearCache:()=>n.clear(),renderBlock:({block:d,params:p={},data:b,context:g}={})=>{const f=typeof(d==null?void 0:d.describe)=="function"?d.describe():d,E=`${f.blockCode}@${f.version}`,m=JSON.stringify(p).replace(/&/g,"&").replace(/'/g,"'");return o({blocks:[{...f,stateCode:"PUBLISHED"}],content:`<div data-qw-block="${E}" data-qw-params='${m}'></div>`,context:g,data:b,partCode:"block"})},renderContent:o,renderTemplate:({template:d,kind:p,data:b,context:g,blocks:f,cacheKey:E,draft:m=!1,layouts:h=[]}={})=>{var Yt;const _=typeof(d==null?void 0:d.toObject)=="function"?d.toObject():d||{},N=p||((Yt=d==null?void 0:d.constructor)==null?void 0:Yt.kind)||xe(_.templateKindCode);if(!N)throw new TypeError("renderTemplate requires a template kind.");ur(_.templateSyntaxVersion);const w=m?null:E??dr(_),Xe={};return N.partDefinitions.forEach(({partCode:W,contentType:Qe})=>{var qt;const Pe=(qt=_.partContent)==null?void 0:qt[W];if(typeof Pe!="string"||!Pe)return;if(Qe!==B.TEXT_HTML){Xe[W]=o({blocks:f,cacheKey:w,content:Pe,context:g,contentType:Qe,data:b,partCode:W});return}const ie=tt({html:Pe,layouts:h});if(ie.missingLayoutCodes.length)throw new v({message:`Layout ${ie.missingLayoutCodes.join(", ")} has no published version.`,partCode:W});const Ir=w&&ie.layoutRefs.length?`${w}\0${ie.layoutRefs.join(",")}`:w;Xe[W]=o({blocks:f,cacheKey:Ir,content:ie.html,context:g,contentType:Qe,data:b,partCode:W})}),{partContent:Xe}}})}function ur(t=se){if(!Ie.includes(t))throw new Y([R({code:y.SYNTAX_VERSION_UNSUPPORTED,message:`Template syntax version ${t} is not supported.`})])}function dr(t){const{templateCode:e,tenantCode:n,meta:r}=t;return!e||!(r!=null&&r.revision)?null:`${n||""}\0${e}\0${r.revision}`}function mr(t=[]){return new Map((t||[]).map(e=>{const n=typeof e.describe=="function"?e.describe():e;return[`${n.blockCode}@${n.version}`,n]}))}function pr({content:t,contentType:e,partCode:n,allowedFunctions:r,blocks:i,allowBlocks:s,engines:a}){const o=new Map(Z().map(m=>[m.name,m])),u=new Set(r),l=q(t,{allowBlocks:s,partCode:n}),T=(m,h)=>ye(m.templates,{allowedFunctionNames:u,functionsByName:o,locate:m.locate,text:m.text,...h}).issues,d=[...l.issues,...T(l,{})];if(V(d))throw new Y(d);const p=e===B.TEXT_PLAIN?a.text:a.html,b=l.blocks.map(m=>fr(m,{blocks:i,engine:p,partCode:n,policy:T}));let g="",f=0;l.blocks.forEach(({start:m,end:h},_)=>{g+=`${l.text.slice(f,m)}{% ${gt} ${_} %}`,f=h}),g+=l.text.slice(f);const E=Ct(p,g,b);return Object.freeze({render(m){try{return p.renderSync(E,{...m})}catch(h){const _=(h==null?void 0:h.originalError)||h;if(_ instanceof v)throw _;const N=String((_==null?void 0:_.message)||h.message).replace(/, line:\d+, col:\d+$/,"");throw new v({cause:h,message:`Failed to render ${n||"content"}: ${N}`,partCode:n})}}})}function fr(t,{blocks:e,engine:n,partCode:r,policy:i}){const{blockRef:s}=t,a=e.get(s);if(!a||typeof a.fragment!="string")throw new v({message:`Block ${s} is not available for rendering.`,partCode:r,source:s});if(a.stateCode==="DRAFT")throw new v({message:`Block ${s} is not published.`,partCode:r,source:s});const{definitions:o,errors:u}=H(a.params),{errors:l,values:T}=ze(o,t.params);if(u.length||l.length)throw new v({message:`Block ${s} params are invalid: ${[...u,...l].join(" ")}`,partCode:r,source:s});const d=q(a.fragment,{allowBlocks:!1}),p=[...d.issues,...i(d,{allowAssign:!0,variables:new Map([[k,null]])})];if(V(p))throw new Y(p.map(b=>({...b,blockRef:s})));return{params:Object.freeze(Dn(o,T)),templates:Ct(n,d.text,[])}}function Ct(t,e,n){te=n;try{return t.parse(e)}finally{te=null}}const Tr=/^[^\s@<>()[\]\\,;:"]+@[^\s"(),:;<>@[\\\]][^\s"(),.:;<>@[\\\]]*\.[^\s"(),:;<>@[\\\]]+$/,hr=/cid:([^\s"'<>)]+)/g,Er=At();async function br({template:t,data:e,context:n,blocks:r,layouts:i,renderer:s=Er,resolveInlineImage:a,juiceOptions:o,draft:u=!1}={}){const l=typeof(t==null?void 0:t.toObject)=="function"?t.toObject():t||{},{partContent:T}=s.renderTemplate({blocks:r,context:n,data:e,draft:u,kind:be,layouts:i,template:l}),d=(E,m)=>s.renderContent({allowBlocks:!1,content:E,context:n,contentType:B.TEXT_PLAIN,data:e,partCode:m}).trim(),p=(E,m,{fixedEmail:h=!1}={})=>{if(!(E!=null&&E.email))return null;if(h&&/\{\{|\{%/.test(E.email))throw new v({message:`${m}.email must be a fixed address.`,partCode:`${m}.email`});const _=h?E.email.trim():d(E.email,`${m}.email`);if(!_)return null;if(!Tr.test(_))throw new v({message:`${m}.email "${_}" is not a valid email address.`,partCode:`${m}.email`});const N=E.name?d(E.name,`${m}.name`):"";return{email:_,...N?{name:N}:{}}},b=(E,m)=>(Array.isArray(E)?E:[]).map((h,_)=>p(typeof h=="string"?{email:h}:h,`${m}[${_}]`)).filter(Boolean);let g=T.html?Wt.default(T.html,{preserveImportant:!0,preserveMediaQueries:!0,...o}):"";const f=[...new Set([...g.matchAll(hr)].map(E=>E[1]))];if(a&&f.length){const E=await Promise.all(f.map(m=>a({contentId:m})));f.forEach((m,h)=>{E[h]&&(g=g.split(`cid:${m}`).join(E[h]))})}return{bcc:b(l.bcc,"bcc"),cc:b(l.cc,"cc"),from:p(l.from,"from",{fixedEmail:!0}),html:g,inlineAttachments:f.map(E=>({contentId:E})),replyTo:p(l.replyTo,"replyTo"),subject:(T.subject||"").replace(/\s+/g," ").trim(),text:T.text??null}}const Rt=Object.freeze({blockCode:"INVOICE_LINES_TABLE",category:"Invoice",contextCode:"RECEIPT",fragment:`<table width="100%" cellpadding="4" cellspacing="0" role="presentation">
|
|
3
|
+
{% for line in invoice.lines %}
|
|
4
|
+
<tr>
|
|
5
|
+
<td>{{ line.name }}</td>
|
|
6
|
+
<td align="right">{{ line.qty }}</td>
|
|
7
|
+
<td align="right">{{ line.amount | __format_money: invoice.currencyCode }}</td>
|
|
8
|
+
</tr>
|
|
9
|
+
{% endfor %}
|
|
10
|
+
</table>`,name:"Invoice lines (fixed)",params:[],version:1}),Nt=Object.freeze({blockCode:"INVOICE_LINES_TABLE",category:"Invoice",contextCode:"RECEIPT",description:"Invoice lines with selectable columns and an optional total row.",fragment:`{% assign lines = invoice.lines %}
|
|
11
|
+
{% if params.onlyPositiveQty %}{% assign lines = invoice.lines | where_exp: "line", "line.qty > 0" %}{% endif %}
|
|
12
|
+
<table class="invoice-lines" width="100%" cellpadding="4" cellspacing="0" role="presentation">
|
|
13
|
+
<thead>
|
|
14
|
+
<tr>
|
|
15
|
+
{% if params.columns.name %}<th align="left">Item</th>{% endif %}
|
|
16
|
+
{% if params.columns.unitPrice %}<th align="right">Unit price</th>{% endif %}
|
|
17
|
+
{% if params.columns.qty %}<th align="right">Qty</th>{% endif %}
|
|
18
|
+
{% if params.columns.amount %}<th align="right">Amount</th>{% endif %}
|
|
19
|
+
</tr>
|
|
20
|
+
</thead>
|
|
21
|
+
<tbody>
|
|
22
|
+
{% for line in lines %}
|
|
23
|
+
<tr>
|
|
24
|
+
{% if params.columns.name %}<td>{{ line.name }}</td>{% endif %}
|
|
25
|
+
{% if params.columns.unitPrice %}<td align="right">{{ line.unitPrice | __format_money: invoice.currencyCode }}</td>{% endif %}
|
|
26
|
+
{% if params.columns.qty %}<td align="right">{{ line.qty }}</td>{% endif %}
|
|
27
|
+
{% if params.columns.amount %}<td align="right">{{ line.amount | __format_money: invoice.currencyCode }}</td>{% endif %}
|
|
28
|
+
</tr>
|
|
29
|
+
{% endfor %}
|
|
30
|
+
</tbody>
|
|
31
|
+
{% if params.showTotal %}
|
|
32
|
+
<tfoot>
|
|
33
|
+
<tr>
|
|
34
|
+
<td align="right" colspan="4"><strong>Total: {{ invoice.total | __format_money: invoice.currencyCode }}</strong></td>
|
|
35
|
+
</tr>
|
|
36
|
+
</tfoot>
|
|
37
|
+
{% endif %}
|
|
38
|
+
</table>`,name:"Invoice lines",params:[{default:["name","qty","amount"],label:"Columns",options:[{label:"Item",value:"name"},{label:"Unit price",value:"unitPrice"},{label:"Quantity",value:"qty"},{label:"Amount",value:"amount"}],paramCode:"columns",type:"multiSelect"},{default:!0,label:"Only lines with quantity > 0",paramCode:"onlyPositiveQty",type:"boolean"},{default:!0,label:"Show total",paramCode:"showTotal",type:"boolean"}],version:2}),St=Object.freeze({blockCode:"AUTHOR_LIST",category:"Abstract",contextCode:"ABSTRACT",fragment:`{% if params.heading %}
|
|
39
|
+
<p><strong>{{ params.heading }}</strong></p>
|
|
40
|
+
{% endif %}
|
|
41
|
+
<ul>
|
|
42
|
+
{% for author in abstract.authors %}
|
|
43
|
+
<li>{{ author.displayName }}{% if params.showAffiliation and author.affiliation %}, {{ author.affiliation }}{% endif %}{% if author.isPresenter %} (presenter){% endif %}</li>
|
|
44
|
+
{% endfor %}
|
|
45
|
+
</ul>`,name:"Author list",params:[{label:"Heading",paramCode:"heading",type:"text"},{default:!0,label:"Show affiliation",paramCode:"showAffiliation",type:"boolean"}],version:1}),Lt=Object.freeze({blockCode:"AUTHOR_LIST",category:"Abstract",contextCode:"ABSTRACT",description:"Authors in a table, with optional affiliation, presentation topic and capacity.",fragment:`<table cellpadding="2" cellspacing="0" role="presentation" style="border: 0;">
|
|
46
|
+
<tbody>
|
|
47
|
+
{% for author in abstract.authors %}
|
|
48
|
+
<tr>
|
|
49
|
+
<td valign="top">{{ author.displayName }}{% if params.details.presenter and author.isPresenter %} (presenter){% endif %}</td>
|
|
50
|
+
<td valign="top">
|
|
51
|
+
<em>
|
|
52
|
+
{% if params.details.affiliation %}{{ author.affiliation }}<br>{% endif %}
|
|
53
|
+
{% if params.details.presentationTopic %}{{ author.presentationTopic }}<br>{% endif %}
|
|
54
|
+
{% if params.details.capacity %}{{ author.capacity }}{% endif %}
|
|
55
|
+
</em>
|
|
56
|
+
</td>
|
|
57
|
+
</tr>
|
|
58
|
+
{% endfor %}
|
|
59
|
+
</tbody>
|
|
60
|
+
</table>`,name:"Author table",params:[{default:["presentationTopic","capacity"],label:"Details",options:[{label:"Affiliation",value:"affiliation"},{label:"Presentation topic",value:"presentationTopic"},{label:"Capacity",value:"capacity"},{label:"Mark the presenter",value:"presenter"}],paramCode:"details",type:"multiSelect"}],version:2});function yr({modified:t=Date.UTC(2027,0,1)}={}){const e=n=>bt.create({...n,modified:t}).publish({modified:t});return[e(Rt).deprecate({modified:t}),e(Nt),e(St),e(Lt)]}const ne=D({fields:{code:{description:"The recipient's event registration code.",label:"Registration code",type:"string"},displayName:{description:"Prefix, first name and last name, for greetings.",label:"Display name",type:"string",value:t=>[t.prefix,t.firstName,t.lastName].filter(Boolean).join(" ")},email:{description:"The recipient's email address.",label:"Email",type:"string"},firstName:{description:"The recipient's first name.",label:"First name",type:"string"},lastName:{description:"The recipient's last name.",label:"Last name",type:"string"},prefix:{description:"Title before the name, such as Dr or Prof.",label:"Prefix",type:"string"}},description:"Current email recipient values.",label:"Recipient",projectionCode:"PERSON"}),re=D({fields:{badge:{fields:{barcodeFormat:{description:"Barcode format printed on badges, such as QR_CODE.",label:"Barcode format",type:"string"}},description:"Badge settings of the event.",label:"Badge",type:"object"},displayDate:{description:"Event dates as shown to participants.",label:"Display date",type:"string"},isOnline:{description:"Whether the event is held online.",label:"Online event",type:"boolean"},location:{description:"Venue of the event.",label:"Location",type:"string"},name:{description:"Full name of the event.",label:"Event name",type:"string"},websiteUrl:{description:"Address of the event website.",label:"Website",type:"string"}},description:"Current congress or event display information.",label:"Event",projectionCode:"EVENT"}),Pt=D({fields:{amount:{description:"Amount of the line: quantity times unit price.",label:"Amount",type:"number"},name:{description:"Name of the item bought.",label:"Item",type:"string",value:t=>{var e;return(e=t.merchandise)==null?void 0:e.name}},qty:{description:"Number of items.",label:"Quantity",type:"number"},unitPrice:{description:"Price of one item.",label:"Unit price",type:"number"}},description:"One line of an invoice.",label:"Invoice line",projectionCode:"INVOICE_LINE"}),It=D({fields:{created:{description:"Date the invoice was issued.",label:"Invoice date",type:"date"},currencyCode:{description:"Currency code of the invoice, such as AUD.",label:"Currency",type:"string"},invoiceNumber:{description:"Number printed on the invoice.",label:"Invoice number",type:"string"},lines:oe(Pt,{description:"Items bought on the invoice.",label:"Lines"}),revisionNumber:{description:"Revision of the invoice; 0 for the first issue.",label:"Revision",type:"number"},total:{description:"Sum of all invoice lines.",label:"Total",type:"number",value:t=>(t.lines||[]).reduce((e,n)=>e+(n.amount||0),0)}},description:"Invoice header and number values.",label:"Invoice",projectionCode:"INVOICE"}),wt=D({fields:{paidAmount:{description:"Amount paid in this payment.",label:"Paid amount",type:"number"},paymentDate:{description:"Date the payment was made.",label:"Payment date",type:"date"},paymentMethod:{description:"How the payment was made, such as credit card.",label:"Payment method",type:"string"},paymentRemark:{description:"Remark recorded with the payment.",label:"Payment remark",type:"string"},receivedAmount:{description:"Amount received after fees.",label:"Received amount",type:"number"}},description:"Payment result, paid amount and payment details.",label:"Payment result",projectionCode:"PAYMENT_RESULT"}),Dt=D({fields:{affiliation:{description:"The author's institution.",label:"Affiliation",type:"string"},capacity:{description:"The author's role on the abstract, such as co-author.",label:"Capacity",type:"string"},displayName:{description:"First name and last name of the author.",label:"Display name",type:"string",value:t=>[t.firstName,t.lastName].filter(Boolean).join(" ")},isPresenter:{description:"Whether the author presents the abstract.",label:"Presenter",type:"boolean"},presentationTopic:{description:"Topic the author presents.",label:"Presentation topic",type:"string"}},description:"One author of an abstract.",label:"Author",projectionCode:"AUTHOR"}),vt=D({fields:{abstractCode:{description:"Reference ID of the submitted abstract.",label:"Abstract code",type:"string"},authors:oe(Dt,{description:"Authors attached to the abstract.",label:"Authors"}),conclusions:{description:"Conclusions section of the abstract.",label:"Conclusions",type:"string"},keywords:{description:"Keywords given by the submitter.",label:"Keywords",type:"string"},methods:{description:"Methods section of the abstract.",label:"Methods",type:"string"},presentationType:{description:"Requested presentation type, such as oral or poster.",label:"Presentation type",type:"string"},purpose:{description:"Purpose section of the abstract.",label:"Purpose",type:"string"},results:{description:"Results section of the abstract.",label:"Results",type:"string"},subspecialty:{description:"Subspecialty the abstract is submitted to.",label:"Subspecialty",type:"string"},summary:{description:"Summary of the abstract without formatting.",label:"Summary (plain text)",type:"string"},title:{description:"Title of the abstract.",label:"Title",type:"string"}},description:"Abstract submission values.",label:"Abstract",projectionCode:"ABSTRACT"}),jt=D({fields:{eventRegistrationCode:{description:"Code of the event registration.",label:"Registration code",type:"string"},hasBadge:{description:"Whether the registration includes a badge.",label:"Has badge",type:"boolean"},roleCodes:oe({label:"Role",type:"string"},{description:"Role codes of the registration.",label:"Roles"})},description:"Event registration profile values.",label:"Event registration",projectionCode:"EVENT_REGISTRATION"}),Ne=Object.freeze({badge:{barcodeFormat:"QR_CODE"},displayDate:"27-30 August 2027",isOnline:!1,location:"Example Convention Centre",name:"Example Congress 2027",websiteUrl:"https://congress.example.org"}),Se=Object.freeze({"ER-1001":{code:"ER-1001",email:"alex.chan@example.org",firstName:"Alex",lastName:"Chan",prefix:"Dr"},"ER-1002":{code:"ER-1002",email:"sam.wong@example.org",firstName:"Sam",lastName:"Wong",prefix:"Prof"},"ER-1003":{code:"ER-1003",email:"kim.lee@example.org",firstName:"Kim",lastName:"Lee",prefix:""}}),Bt=Object.freeze({"INV-2027-0001":{created:Date.UTC(2027,2,14),currencyCode:"HKD",invoiceNumber:"INV-2027-0001",lines:[{amount:2e3,merchandise:{name:"Delegate registration"},qty:1,unitPrice:2e3},{amount:1200,merchandise:{name:"Gala dinner"},qty:2,unitPrice:600},{amount:0,merchandise:{name:"Workshop waitlist"},qty:0,unitPrice:300}],payerCode:"ER-1001",paymentResult:{paidAmount:3200,paymentDate:Date.UTC(2027,2,15),paymentMethod:"Credit card",paymentRemark:"Paid online",receivedAmount:3200},revisionNumber:1}}),Mt=Object.freeze({"ABS-0042":{abstractCode:"ABS-0042",authors:[{affiliation:"Example University",capacity:"Presenting author",firstName:"Alex",lastName:"Chan",isPresenter:!0,presentationTopic:"Study design",registrationCode:"ER-1001"},{affiliation:"Example Hospital",capacity:"Co-author",firstName:"Sam",lastName:"Wong",isPresenter:!1,registrationCode:"ER-1002"}],conclusions:"The example approach was feasible.",keywords:"example, study",methods:"A retrospective review of example cases.",presentationType:"Oral",purpose:"To describe outcomes of an example study.",results:"Outcomes improved in most cases.",subspecialty:"Retina",submitterCode:"ER-1003",summary:`Background
|
|
61
|
+
Methods
|
|
62
|
+
Results`,title:"Outcomes of an example study"}}),$t=Object.freeze({"ER-1001":{eventRegistrationCode:"ER-1001",hasBadge:!0,roleCodes:["REGISTRANT","DELEGATE"]}}),x=Object.freeze({ALL_AUTHORS:"ALL_AUTHORS",PRESENTER:"PRESENTER",SUBMITTER:"SUBMITTER"}),kt=Q({contextCode:"ABSTRACT",functionNames:["__format_date","__multiline"],loadData:async({subjectRef:t,recipientType:e})=>{const n=Mt[t];return n?{[x.ALL_AUTHORS]:n.authors.map(i=>i.registrationCode),[x.PRESENTER]:n.authors.filter(i=>i.isPresenter).map(i=>i.registrationCode),[x.SUBMITTER]:[n.submitterCode]}[e].map(i=>({recipientRef:i,roots:{abstract:n,event:Ne,recipient:Se[i]}})):[]},name:"Abstract",recipientRules:[{name:"Submitter",recipientType:x.SUBMITTER},{name:"Presenting author",recipientType:x.PRESENTER},{name:"All authors",recipientType:x.ALL_AUTHORS}],roots:{abstract:vt,event:re,recipient:ne},sampleData:{abstract:{abstractCode:"ABS-0001",authors:[{affiliation:"Sample University",capacity:"Presenting author",displayName:"Alex Chan",isPresenter:!0,presentationTopic:"Sample topic"},{affiliation:"Sample Hospital",capacity:"Co-author",displayName:"Sam Wong",isPresenter:!1,presentationTopic:""}],conclusions:"Sample conclusions.",keywords:"sample, keywords",methods:"Sample methods.",presentationType:"Poster",purpose:"Sample purpose.",results:"Sample results.",subspecialty:"Retina",summary:`Line one
|
|
63
|
+
Line two`,title:"Sample abstract title"},event:{badge:{barcodeFormat:"QR_CODE"},displayDate:"27-30 August 2027",isOnline:!1,location:"Sample Venue",name:"Sample Congress",websiteUrl:"https://congress.example.org"},recipient:{code:"ER-0001",displayName:"Dr Alex Chan",email:"alex.chan@example.org",firstName:"Alex",lastName:"Chan",prefix:"Dr"}},subjectType:"Abstract"}),Ut=Q({contextCode:"EVENT_REGISTRATION",functionNames:["__barcode","__format_date"],loadData:async({subjectRef:t})=>{const e=$t[t];return e?[{recipientRef:t,roots:{event:Ne,eventRegistration:e,recipient:Se[t]}}]:[]},name:"Event registration",recipientRules:[{name:"Registrant",recipientType:"REGISTRANT"}],roots:{event:re,eventRegistration:jt,recipient:ne},sampleData:{event:{badge:{barcodeFormat:"QR_CODE"},displayDate:"27-30 August 2027",isOnline:!1,location:"Sample Venue",name:"Sample Congress",websiteUrl:"https://congress.example.org"},eventRegistration:{eventRegistrationCode:"ER-0001",hasBadge:!0,roleCodes:["REGISTRANT"]},recipient:{code:"ER-0001",displayName:"Dr Alex Chan",email:"alex.chan@example.org",firstName:"Alex",lastName:"Chan",prefix:"Dr"}},subjectType:"EventRegistration"}),Vt=Q({contextCode:"RECEIPT",functionNames:["__format_date","__format_money"],loadData:async({subjectRef:t})=>{const e=Bt[t];return e?[{recipientRef:e.payerCode,roots:{event:Ne,invoice:e,paymentResult:e.paymentResult,recipient:Se[e.payerCode]}}]:[]},name:"Receipt",recipientRules:[{name:"Payer",recipientType:"PAYER"}],roots:{event:re,invoice:It,paymentResult:wt,recipient:ne},sampleData:{event:{badge:{barcodeFormat:"QR_CODE"},displayDate:"27-30 August 2027",isOnline:!1,location:"Sample Venue",name:"Sample Congress",websiteUrl:"https://congress.example.org"},invoice:{created:Date.UTC(2027,0,5),currencyCode:"HKD",invoiceNumber:"INV-0001",lines:[{amount:2e3,name:"Delegate registration",qty:1,unitPrice:2e3},{amount:1200,name:"Gala dinner",qty:2,unitPrice:600}],revisionNumber:1,total:3200},paymentResult:{paidAmount:3200,paymentDate:Date.UTC(2027,0,6),paymentMethod:"Credit card",paymentRemark:"Paid online",receivedAmount:3200},recipient:{code:"ER-0001",displayName:"Dr Alex Chan",email:"alex.chan@example.org",firstName:"Alex",lastName:"Chan",prefix:"Dr"}},subjectType:"Invoice"}),_r=Q({contextCode:"LAYOUT",functionNames:["__format_date"],name:"Layout (every email)",roots:{event:re,recipient:ne},sampleData:{event:{badge:{barcodeFormat:"QR_CODE"},displayDate:"27-30 August 2027",isOnline:!1,location:"Sample Venue",name:"Sample Congress",websiteUrl:"https://congress.example.org"},recipient:{code:"ER-0001",displayName:"Dr Alex Chan",email:"alex.chan@example.org",firstName:"Alex",lastName:"Chan",prefix:"Dr"}}}),zt=Object.freeze({ABSTRACT:kt,EVENT_REGISTRATION:Ut,RECEIPT:Vt}),Or=Object.freeze({ABSTRACT:"ABSTRACT",EVENT_REGISTRATION:"EVENT_REGISTRATION",RECEIPT:"RECEIPT",STORE:"RECEIPT"});function Le(t){return Or[t]||null}function gr(t){return zt[Le(t)]||null}const Ft=Object.freeze([{description:"Format an amount with a currency code, e.g. HKD 1,200.00.",fn:(t,e)=>{if(t===null)return"";const n=Number(t).toLocaleString("en-US",{maximumFractionDigits:2,minimumFractionDigits:2});return e?`${e} ${n}`:n},label:"money",name:"__format_money",signature:[{types:["number"]},{optional:!0,types:["string"]}]},{description:"Format a timestamp as YYYY-MM-DD (UTC).",fn:t=>t===null?"":new Date(t).toISOString().slice(0,10),label:"date",name:"__format_date",signature:[{types:["number"]}]},{description:"Inline barcode image reference (cid:) for the given value and format.",fn:(t,e)=>t===null?"":`cid:barcode.${e||"QR_CODE"}.${encodeURIComponent(t)}`,label:"barcode",name:"__barcode",signature:[{types:["string"]},{optional:!0,types:["string"]}]},{description:"Escape plain text and keep its line breaks as <br>.",fn:t=>t===null?"":String(t).replace(/[&<>"']/g,e=>`&#${e.charCodeAt(0)};`).replace(/\r?\n/g,"<br>"),label:"lines",name:"__multiline",signature:[{types:["string"]}],trustedHtml:!0}]);function Ar(){const t=new Set(Z().map(({name:e})=>e));Ft.forEach(e=>{t.has(e.name)||Ze(e)})}const xt=Object.freeze({description:"Event banner across the top of the email.",eventShortCode:"EXAMPLE2027",html:'<img src="https://congress.2026.apvrs.org/userfile/apvrs/img/apvrs2026/banner.png" alt="{{ event.name }}" width="600" style="display: block; width: 100%; height: auto; border: 0;">',layoutCode:"APVRS_HEADER",name:"APVRS header",tenantCode:"example",version:1}),Kt=Object.freeze({description:"Event name, dates and website below the content.",eventShortCode:"EXAMPLE2027",html:'<p style="margin: 24px 0 0; padding-top: 12px; border-top: 1px solid #dddddd; font-size: 16px; color: #666666;">{{ event.name }} · {{ event.displayDate }} · <a href="{{ event.websiteUrl }}">{{ event.websiteUrl }}</a></p>',layoutCode:"CONGRESS_FOOTER",name:"Congress footer",tenantCode:"example",version:1}),Gt=Object.freeze({description:"APVRS 2026 venue and copyright lines for the footer row of the email frame.",eventShortCode:"EXAMPLE2027",html:'<p style="margin: 0; font-size: 12px; line-height: 1.5; color: #888888;">APVRS 2026 Gold Coast · Gold Coast Convention & Exhibition Centre, Queensland, Australia<br>© 2026 Asia-Pacific Vitreo-Retina Society. All rights reserved.</p>',layoutCode:"APVRS_FOOTER",name:"APVRS footer",tenantCode:"example",version:1}),Cr=Object.freeze([xt,Kt,Gt]),Rr=["mobileWalletBadgePass","subTemplateGroupName","templateGroupName"];class Nr extends yt{constructor(e={}){e=e||{},super({...e,contextCode:Le(e.templateGroupName)||e.contextCode}),this._type=e._type||"TemplateEmailCongress",this.eventShortCode=e.eventShortCode,this.mobileWalletBadgePass=!!e.mobileWalletBadgePass,this.subTemplateGroupName=e.subTemplateGroupName||null,this.templateGroupName=e.templateGroupName}static get _classname(){return"TemplateEmailCongress"}get isValid(){return super.isValid&&!!this.eventShortCode&&!!this.templateGroupName}update(e={}){return Rr.forEach(n=>{Object.hasOwn(e,n)&&(this[n]=n==="mobileWalletBadgePass"?!!e[n]:e[n])}),Object.hasOwn(e,"templateGroupName")&&(this.contextCode=Le(e.templateGroupName)),super.update(e)}toObject(){return{...super.toObject(),eventShortCode:this.eventShortCode,mobileWalletBadgePass:this.mobileWalletBadgePass,subTemplateGroupName:this.subTemplateGroupName,templateGroupName:this.templateGroupName}}}const Sr=Object.freeze({bcc:[{email:"finance@congress.example.org"}],eventShortCode:"EXAMPLE2027",from:{email:"secretariat@congress.example.org",name:"{{ event.name }} Secretariat"},meta:{revision:3},name:"Payment completed",partContent:{html:["<style>.receipt h2 { color: #1f4e79; } .invoice-lines th { background: #cedeea; }</style>",'<div class="receipt">',"<p>Dear {{ recipient.displayName }},</p>","<p>Thank you for your payment for {{ event.name }}.</p>","<h2>Invoice {{ invoice.invoiceNumber }}.{{ invoice.revisionNumber }}</h2>","<p>Invoice date: {{ invoice.created | __format_date }}</p>",`<div data-qw-block="INVOICE_LINES_TABLE@2" data-qw-params='{"columns":["name","qty","amount"]}'></div>`,"<p>Paid {{ paymentResult.paidAmount | __format_money: invoice.currencyCode }} by {{ paymentResult.paymentMethod }} on {{ paymentResult.paymentDate | __format_date }}.</p>","</div>"].join(`
|
|
64
|
+
`),subject:"Payment completed - {{ invoice.invoiceNumber }}",text:"Dear {{ recipient.displayName }}, thank you for your payment of {{ paymentResult.paidAmount | __format_money: invoice.currencyCode }} for {{ event.name }}."},replyTo:{email:"secretariat@congress.example.org"},subTemplateGroupName:"EVENT",templateCode:"RECEIPT.EVENT.paymentCompleted",templateGroupName:"RECEIPT",tenantCode:"example"}),Lr=Object.freeze({eventShortCode:"EXAMPLE2027",meta:{revision:1},name:"Submission acknowledgement",partContent:{html:["<p>Dear {{ recipient.displayName }},</p>",'<p>We have received abstract {{ abstract.abstractCode }} "{{ abstract.title }}" ({{ abstract.presentationType }}).</p>',`<div data-qw-block="AUTHOR_LIST@1" data-qw-params='{"heading":"Authors"}'></div>`,"<p>{{ abstract.summary | __multiline }}</p>","{% if event.isOnline %}<p>The congress is held online.</p>{% else %}<p>Venue: {{ event.location }}</p>{% endif %}"].join(`
|
|
65
|
+
`),subject:"Abstract {{ abstract.abstractCode }} received"},subTemplateGroupName:null,templateCode:"ABSTRACT.submissionAcknowledgement",templateGroupName:"ABSTRACT",tenantCode:"example"}),Pr=Object.freeze({eventShortCode:"EXAMPLE2027",meta:{revision:1},mobileWalletBadgePass:!0,name:"Registration confirmation",partContent:{html:["<p>Dear {{ recipient.displayName }},</p>","<p>Your registration code is {{ recipient.code }}.</p>",'{% if event.badge.barcodeFormat == "QR_CODE" %}',` <img alt="Badge" src="{{ recipient.code | __barcode: 'QR_CODE' }}">`,"{% else %}",` <img alt="Badge" src="{{ recipient.code | __barcode: 'PDF417' }}">`,"{% endif %}"].join(`
|
|
66
|
+
`),subject:"Registration confirmed - {{ event.name }}"},subTemplateGroupName:"CONFIRMATION",templateCode:"EVENT_REGISTRATION.CONFIRMATION.registration",templateGroupName:"EVENT_REGISTRATION",tenantCode:"example"});c.ABSTRACT_ACKNOWLEDGEMENT_TEMPLATE=Lr,c.ABSTRACT_RECIPIENT_TYPE=x,c.APVRS_FOOTER_V1=Gt,c.APVRS_HEADER_V1=xt,c.AUTHOR_LIST_V1=St,c.AUTHOR_LIST_V2=Lt,c.BLOCK_ATTRIBUTE=z,c.BLOCK_PARAMS_ATTRIBUTE=pe,c.BLOCK_PARAMS_ROOT=k,c.CONGRESS_CONTEXTS=zt,c.CONGRESS_FOOTER_V1=Kt,c.CONGRESS_LAYOUTS=Cr,c.CONGRESS_TEMPLATE_FUNCTIONS=Ft,c.DataContext=Je,c.INVOICE_LINES_TABLE_V1=Rt,c.INVOICE_LINES_TABLE_V2=Nt,c.LAYOUT_ATTRIBUTE=Be,c.LifecycleTemplateBlock=he,c.LifecycleTemplateLayout=We,c.RECEIPT_TEMPLATE=Sr,c.REGISTRATION_CONFIRMATION_TEMPLATE=Pr,c.SAMPLE_ABSTRACTS=Mt,c.SAMPLE_EVENT=Ne,c.SAMPLE_INVOICES=Bt,c.SAMPLE_PEOPLE=Se,c.SAMPLE_REGISTRATIONS=$t,c.SUPPORTED_TEMPLATE_SYNTAX_VERSIONS=Ie,c.TEMPLATE_BLOCK_ACTION_CODE=nr,c.TEMPLATE_BLOCK_PARAM_TYPE=S,c.TEMPLATE_BLOCK_STATE_CODE=F,c.TEMPLATE_BUILTIN_FILTERS=Ve,c.TEMPLATE_CONTENT_TYPE=B,c.TEMPLATE_EMAIL_KIND=be,c.TEMPLATE_EVALUATION_LIMITS=Ot,c.TEMPLATE_FIELD_KIND=M,c.TEMPLATE_FIELD_TYPE=P,c.TEMPLATE_FRAGMENT_TAGS=me,c.TEMPLATE_FUNCTION_ARG_TYPE=U,c.TEMPLATE_ISSUE_CODE=y,c.TEMPLATE_ISSUE_SEVERITY=K,c.TEMPLATE_KIND_CODE=Ee,c.TEMPLATE_LAYOUT_ACTION_CODE=or,c.TEMPLATE_LAYOUT_STATE_CODE=Re,c.TEMPLATE_SYNTAX_VERSION=se,c.TEMPLATE_TAGS=ke,c.Template=ct,c.TemplateBlock=bt,c.TemplateEmail=yt,c.TemplateEmailCongress=Nr,c.TemplateLayout=cr,c.TemplateProjection=De,c.TemplateRenderError=v,c.TemplateSyntaxError=Y,c.abstractContext=kt,c.abstractProjection=vt,c.authorProjection=Dt,c.checkBlockFragment=pt,c.checkTemplate=Wn,c.checkTemplateContent=Qn,c.checkTemplateLayoutContent=ft,c.clearCustomFunctions=on,c.contextCodeForTemplateGroup=Le,c.contextForTemplateGroup=gr,c.createBlockElement=On,c.createCongressBlocks=yr,c.createTemplateRenderer=At,c.defineDataContext=Q,c.defineTemplateProjection=D,c.describeTemplateFilter=Fn,c.describeTemplateFunctions=Z,c.describeTemplateKind=Bn,c.eventProjection=re,c.eventRegistrationContext=Ut,c.eventRegistrationProjection=jt,c.expandTemplateLayouts=tt,c.findBlockRefs=at,c.findLayoutCodes=de,c.formatBlockRef=fe,c.getTemplateFunctionDescriptor=sn,c.getTemplateKind=xe,c.hasTemplateErrors=V,c.invoiceLineProjection=Pt,c.invoiceProjection=It,c.layoutContext=_r,c.layoutElementHtml=fn,c.layoutHtmlIssues=$e,c.listOf=oe,c.normalizeBlockParamDefinitions=H,c.normalizeTemplateMarkup=rt,c.parseBlockRef=ot,c.parseTemplateContent=q,c.paymentResultProjection=wt,c.personProjection=ne,c.receiptContext=Vt,c.registerCongressTemplateFunctions=Ar,c.registerTemplateFunction=Ze,c.renderTemplateEmail=br,c.resolveBlockParams=ze,c.resolveTemplateLayout=Me,c.toDataContextDescriptor=J,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
67
|
+
//# sourceMappingURL=p-templates-model.umd.js.map
|