: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
margin.top = margin.bottom = values[0];
margin.left = margin.right = values[1];
margin.bottom = values[2];
margin.left = margin.right = values[1];
margin.bottom = values[2];
margin.right = values[3];
margin.top = getMeasurement(value);
margin.bottom = getMeasurement(value);
margin.left = getMeasurement(value);
margin.right = getMeasurement(value);
lineHeight = getMeasurement(value);
measure.pushData(xfaFont, margin, lineHeight);
measure.addString(this[$content]);
for (const child of this[$getChildren]()) {
if (child[$nodeName] === "#text") {
measure.addString(child[$content]);
child[$pushGlyphs](measure);
[$toHTML](availableSpace) {
this[$childrenToHTML]({});
if (children.length === 0 && !this[$content]) {
value = this[$content] ? this[$content].replaceAll(crlfForRichTextRegExp, "\n") : undefined;
value = this[$content] || undefined;
return HTMLResult.success({
style: mapStyle(this.style, this, this[$richText])
class A extends XhtmlObject {
constructor(attributes) {
this.href = fixURL(attributes.href) || "";
class B extends XhtmlObject {
constructor(attributes) {
super[$pushGlyphs](measure);
class Body extends XhtmlObject {
constructor(attributes) {
super(attributes, "body");
[$toHTML](availableSpace) {
const res = super[$toHTML](availableSpace);
html.attributes.class = ["xfaRich"];
class Br extends XhtmlObject {
constructor(attributes) {
[$toHTML](availableSpace) {
return HTMLResult.success({
class Html extends XhtmlObject {
constructor(attributes) {
super(attributes, "html");
[$toHTML](availableSpace) {
this[$childrenToHTML]({});
if (children.length === 0) {
return HTMLResult.success({
value: this[$content] || ""
if (children.length === 1) {
const child = children[0];
if (child.attributes?.class.includes("xfaRich")) {
return HTMLResult.success(child);
return HTMLResult.success({
class I extends XhtmlObject {
constructor(attributes) {
super[$pushGlyphs](measure);
class Li extends XhtmlObject {
constructor(attributes) {
class Ol extends XhtmlObject {
constructor(attributes) {
class P extends XhtmlObject {
constructor(attributes) {
super[$pushGlyphs](measure, false);
const siblings = this[$getParent]()[$getChildren]();
if (siblings.at(-1) === this) {
return super[$text]() + "\n";
class Span extends XhtmlObject {
constructor(attributes) {
super(attributes, "span");
class Sub extends XhtmlObject {
constructor(attributes) {
super(attributes, "sub");
class Sup extends XhtmlObject {
constructor(attributes) {
super(attributes, "sup");
class Ul extends XhtmlObject {
constructor(attributes) {
static [$buildXFAObject](name, attributes) {
if (XhtmlNamespace.hasOwnProperty(name)) {
return XhtmlNamespace[name](attributes);
return new A(attributes);
return new B(attributes);
static body(attributes) {
return new Body(attributes);
return new Br(attributes);
static html(attributes) {
return new Html(attributes);
return new I(attributes);
return new Li(attributes);
return new Ol(attributes);
return new P(attributes);
static span(attributes) {
return new Span(attributes);
return new Sub(attributes);
return new Sup(attributes);
return new Ul(attributes);
;// CONCATENATED MODULE: ./src/core/xfa/setup.js
connection: ConnectionSetNamespace,
datasets: DatasetsNamespace,
localeSet: LocaleSetNamespace,
signature: SignatureNamespace,
stylesheet: StylesheetNamespace,
template: TemplateNamespace,
;// CONCATENATED MODULE: ./src/core/xfa/unknown.js
[$buildXFAObject](name, attributes) {
return new XmlObject(this.namespaceId, name, attributes);
;// CONCATENATED MODULE: ./src/core/xfa/builder.js
class Root extends XFAObject {
super(-1, "root", Object.create(null));
if (this.element.template instanceof Template) {
this[$ids].set($root, this.element);
this.element.template[$resolvePrototypes](this[$ids]);
this.element.template[$ids] = this[$ids];
class Empty extends XFAObject {
super(-1, "", Object.create(null));
constructor(rootNameSpace = null) {
this._namespaceStack = [];
this._nsAgnosticLevel = 0;
this._namespacePrefixes = new Map();
this._namespaces = new Map();
this._nextNsId = Math.max(...Object.values(NamespaceIds).map(({
this._currentNamespace = rootNameSpace || new UnknownNamespace(++this._nextNsId);
const hasNamespaceDef = namespace !== null;
this._namespaceStack.push(this._currentNamespace);
this._currentNamespace = this._searchNamespace(namespace);
this._addNamespacePrefix(prefixes);
if (attributes.hasOwnProperty($nsAttributes)) {
const dataTemplate = NamespaceSetUp.datasets;
const nsAttrs = attributes[$nsAttributes];
for (const [ns, attrs] of Object.entries(nsAttrs)) {
const nsToUse = this._getNamespaceToUse(ns);
if (nsToUse === dataTemplate) {
attributes[$nsAttributes] = xfaAttrs;
delete attributes[$nsAttributes];
const namespaceToUse = this._getNamespaceToUse(nsPrefix);
const node = namespaceToUse?.[$buildXFAObject](name, attributes) || new Empty();
if (node[$isNsAgnostic]()) {
if (hasNamespaceDef || prefixes || node[$isNsAgnostic]()) {
hasNamespace: hasNamespaceDef,
nsAgnostic: node[$isNsAgnostic]()
return this._nsAgnosticLevel > 0;
_searchNamespace(nsName) {
let ns = this._namespaces.get(nsName);
}] of Object.entries(NamespaceIds)) {
ns = NamespaceSetUp[name];
this._namespaces.set(nsName, ns);
ns = new UnknownNamespace(++this._nextNsId);
this._namespaces.set(nsName, ns);
_addNamespacePrefix(prefixes) {
const namespace = this._searchNamespace(value);
let prefixStack = this._namespacePrefixes.get(prefix);
this._namespacePrefixes.set(prefix, prefixStack);
prefixStack.push(namespace);
_getNamespaceToUse(prefix) {
return this._currentNamespace;
const prefixStack = this._namespacePrefixes.get(prefix);
if (prefixStack?.length > 0) {
return prefixStack.at(-1);
warn(`Unknown namespace prefix: ${prefix}.`);
this._currentNamespace = this._namespaceStack.pop();
this._namespacePrefixes.get(prefix).pop();
;// CONCATENATED MODULE: ./src/core/xfa/parser.js
class XFAParser extends XMLParserBase {
constructor(rootNameSpace = null, richText = false) {
this._builder = new Builder(rootNameSpace);