/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { Base, fromEnum, markType } from "igniteui-angular-core";
import { XmlTextWriter } from "igniteui-angular-core";
import { Encoding } from "igniteui-angular-core";
import { DocCoreExtensions } from "./DocCoreExtensions";
/**
 * @hidden
 */
export class RelationshipsWriter extends Base {
    static j(a, b) {
        {
            let c = new XmlTextWriter(0, b, Encoding.uTF8);
            try {
                c.ad("xml", "version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"");
                c.an("Relationships", RelationshipsWriter.c);
                for (let d of fromEnum(a)) {
                    c.an("Relationship", RelationshipsWriter.c);
                    c.h("Id", d.id);
                    c.h("Type", d.relationshipType);
                    if (d.targetMode == 1) {
                        c.h("Target", d.targetUri.originalString);
                        c.h("TargetMode", "External");
                    }
                    else {
                        c.h("Target", DocCoreExtensions.fixDirectoryPath(d.targetUri.toString()));
                    }
                    c.v();
                }
                c.v();
            }
            finally {
                if (c != null) {
                    c.dispose();
                }
            }
        }
    }
}
RelationshipsWriter.$t = markType(RelationshipsWriter, 'RelationshipsWriter');
RelationshipsWriter.c = "http://schemas.openxmlformats.org/package/2006/relationships";
RelationshipsWriter.a = [RelationshipsWriter.c];
//# sourceMappingURL=RelationshipsWriter.js.map