package o; import com.adobe.internal.xmp.XMPException; import java.util.HashMap; import java.util.Map; import java.util.regex.Pattern; import org.bouncycastle.i18n.MessageBundle; /* renamed from: o.iYm, reason: case insensitive filesystem */ /* loaded from: classes.dex */ public final class C15778iYm implements Ngx { private Map a = new HashMap(); private Map d = new HashMap(); private Map c = new HashMap(); private Pattern e = Pattern.compile("[/*?\\[\\]]"); public C15778iYm() { try { c("http://www.w3.org/XML/1998/namespace", "xml"); c("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "rdf"); c("http://purl.org/dc/elements/1.1/", "dc"); c("http://iptc.org/std/Iptc4xmpCore/1.0/xmlns/", "Iptc4xmpCore"); c("http://iptc.org/std/Iptc4xmpExt/2008-02-29/", "Iptc4xmpExt"); c("http://ns.adobe.com/DICOM/", "DICOM"); c("http://ns.useplus.org/ldf/xmp/1.0/", "plus"); c("adobe:ns:meta/", "x"); c("http://ns.adobe.com/iX/1.0/", "iX"); c("http://ns.adobe.com/xap/1.0/", "xmp"); c("http://ns.adobe.com/xap/1.0/rights/", "xmpRights"); c("http://ns.adobe.com/xap/1.0/mm/", "xmpMM"); c("http://ns.adobe.com/xap/1.0/bj/", "xmpBJ"); c("http://ns.adobe.com/xmp/note/", "xmpNote"); c("http://ns.adobe.com/pdf/1.3/", "pdf"); c("http://ns.adobe.com/pdfx/1.3/", "pdfx"); c("http://www.npes.org/pdfx/ns/id/", "pdfxid"); c("http://www.aiim.org/pdfa/ns/schema#", "pdfaSchema"); c("http://www.aiim.org/pdfa/ns/property#", "pdfaProperty"); c("http://www.aiim.org/pdfa/ns/type#", "pdfaType"); c("http://www.aiim.org/pdfa/ns/field#", "pdfaField"); c("http://www.aiim.org/pdfa/ns/id/", "pdfaid"); c("http://www.aiim.org/pdfa/ns/extension/", "pdfaExtension"); c("http://ns.adobe.com/photoshop/1.0/", "photoshop"); c("http://ns.adobe.com/album/1.0/", "album"); c("http://ns.adobe.com/exif/1.0/", "exif"); c("http://cipa.jp/exif/1.0/", "exifEX"); c("http://ns.adobe.com/exif/1.0/aux/", "aux"); c("http://ns.adobe.com/tiff/1.0/", "tiff"); c("http://ns.adobe.com/png/1.0/", "png"); c("http://ns.adobe.com/jpeg/1.0/", "jpeg"); c("http://ns.adobe.com/jp2k/1.0/", "jp2k"); c("http://ns.adobe.com/camera-raw-settings/1.0/", "crs"); c("http://ns.adobe.com/StockPhoto/1.0/", "bmsp"); c("http://ns.adobe.com/creatorAtom/1.0/", "creatorAtom"); c("http://ns.adobe.com/asf/1.0/", "asf"); c("http://ns.adobe.com/xmp/wav/1.0/", "wav"); c("http://ns.adobe.com/bwf/bext/1.0/", "bext"); c("http://ns.adobe.com/riff/info/", "riffinfo"); c("http://ns.adobe.com/xmp/1.0/Script/", "xmpScript"); c("http://ns.adobe.com/TransformXMP/", "txmp"); c("http://ns.adobe.com/swf/1.0/", "swf"); c("http://ns.adobe.com/ccv/1.0/", "ccv"); c("http://ns.adobe.com/xmp/1.0/DynamicMedia/", "xmpDM"); c("http://ns.adobe.com/xmp/transient/1.0/", "xmpx"); c("http://ns.adobe.com/xap/1.0/t/", "xmpT"); c("http://ns.adobe.com/xap/1.0/t/pg/", "xmpTPg"); c("http://ns.adobe.com/xap/1.0/g/", "xmpG"); c("http://ns.adobe.com/xap/1.0/g/img/", "xmpGImg"); c("http://ns.adobe.com/xap/1.0/sType/Font#", "stFnt"); c("http://ns.adobe.com/xap/1.0/sType/Dimensions#", "stDim"); c("http://ns.adobe.com/xap/1.0/sType/ResourceEvent#", "stEvt"); c("http://ns.adobe.com/xap/1.0/sType/ResourceRef#", "stRef"); c("http://ns.adobe.com/xap/1.0/sType/Version#", "stVer"); c("http://ns.adobe.com/xap/1.0/sType/Job#", "stJob"); c("http://ns.adobe.com/xap/1.0/sType/ManifestItem#", "stMfs"); c("http://ns.adobe.com/xmp/Identifier/qual/1.0/", "xmpidq"); hbY hby = new hbY(); hby.a |= 1536; hbY hby2 = new hbY(); hby2.a |= 7680; e("http://ns.adobe.com/xap/1.0/", "Author", "http://purl.org/dc/elements/1.1/", "creator", hby); e("http://ns.adobe.com/xap/1.0/", "Authors", "http://purl.org/dc/elements/1.1/", "creator", null); e("http://ns.adobe.com/xap/1.0/", "Description", "http://purl.org/dc/elements/1.1/", "description", null); e("http://ns.adobe.com/xap/1.0/", "Format", "http://purl.org/dc/elements/1.1/", "format", null); e("http://ns.adobe.com/xap/1.0/", "Keywords", "http://purl.org/dc/elements/1.1/", "subject", null); e("http://ns.adobe.com/xap/1.0/", "Locale", "http://purl.org/dc/elements/1.1/", "language", null); e("http://ns.adobe.com/xap/1.0/", "Title", "http://purl.org/dc/elements/1.1/", MessageBundle.TITLE_ENTRY, null); e("http://ns.adobe.com/xap/1.0/rights/", "Copyright", "http://purl.org/dc/elements/1.1/", "rights", null); e("http://ns.adobe.com/pdf/1.3/", "Author", "http://purl.org/dc/elements/1.1/", "creator", hby); e("http://ns.adobe.com/pdf/1.3/", "BaseURL", "http://ns.adobe.com/xap/1.0/", "BaseURL", null); e("http://ns.adobe.com/pdf/1.3/", "CreationDate", "http://ns.adobe.com/xap/1.0/", "CreateDate", null); e("http://ns.adobe.com/pdf/1.3/", "Creator", "http://ns.adobe.com/xap/1.0/", "CreatorTool", null); e("http://ns.adobe.com/pdf/1.3/", "ModDate", "http://ns.adobe.com/xap/1.0/", "ModifyDate", null); e("http://ns.adobe.com/pdf/1.3/", "Subject", "http://purl.org/dc/elements/1.1/", "description", hby2); e("http://ns.adobe.com/pdf/1.3/", "Title", "http://purl.org/dc/elements/1.1/", MessageBundle.TITLE_ENTRY, hby2); e("http://ns.adobe.com/photoshop/1.0/", "Author", "http://purl.org/dc/elements/1.1/", "creator", hby); e("http://ns.adobe.com/photoshop/1.0/", "Caption", "http://purl.org/dc/elements/1.1/", "description", hby2); e("http://ns.adobe.com/photoshop/1.0/", "Copyright", "http://purl.org/dc/elements/1.1/", "rights", hby2); e("http://ns.adobe.com/photoshop/1.0/", "Keywords", "http://purl.org/dc/elements/1.1/", "subject", null); e("http://ns.adobe.com/photoshop/1.0/", "Marked", "http://ns.adobe.com/xap/1.0/rights/", "Marked", null); e("http://ns.adobe.com/photoshop/1.0/", "Title", "http://purl.org/dc/elements/1.1/", MessageBundle.TITLE_ENTRY, hby2); e("http://ns.adobe.com/photoshop/1.0/", "WebStatement", "http://ns.adobe.com/xap/1.0/rights/", "WebStatement", null); e("http://ns.adobe.com/tiff/1.0/", "Artist", "http://purl.org/dc/elements/1.1/", "creator", hby); e("http://ns.adobe.com/tiff/1.0/", "Copyright", "http://purl.org/dc/elements/1.1/", "rights", null); e("http://ns.adobe.com/tiff/1.0/", "DateTime", "http://ns.adobe.com/xap/1.0/", "ModifyDate", null); e("http://ns.adobe.com/exif/1.0/", "DateTimeDigitized", "http://ns.adobe.com/xap/1.0/", "CreateDate", null); e("http://ns.adobe.com/tiff/1.0/", "ImageDescription", "http://purl.org/dc/elements/1.1/", "description", null); e("http://ns.adobe.com/tiff/1.0/", "Software", "http://ns.adobe.com/xap/1.0/", "CreatorTool", null); e("http://ns.adobe.com/png/1.0/", "Author", "http://purl.org/dc/elements/1.1/", "creator", hby); e("http://ns.adobe.com/png/1.0/", "Copyright", "http://purl.org/dc/elements/1.1/", "rights", hby2); e("http://ns.adobe.com/png/1.0/", "CreationTime", "http://ns.adobe.com/xap/1.0/", "CreateDate", null); e("http://ns.adobe.com/png/1.0/", "Description", "http://purl.org/dc/elements/1.1/", "description", hby2); e("http://ns.adobe.com/png/1.0/", "ModificationTime", "http://ns.adobe.com/xap/1.0/", "ModifyDate", null); e("http://ns.adobe.com/png/1.0/", "Software", "http://ns.adobe.com/xap/1.0/", "CreatorTool", null); e("http://ns.adobe.com/png/1.0/", "Title", "http://purl.org/dc/elements/1.1/", MessageBundle.TITLE_ENTRY, hby2); } catch (XMPException unused) { throw new RuntimeException("The XMPSchemaRegistry cannot be initialized!"); } } @Override // o.Ngx public final String c(String str) { String str2; synchronized (this) { str2 = (String) this.a.get(str); } return str2; } @Override // o.Ngx public final String a(String str) { String str2; synchronized (this) { if (str != null) { if (!str.endsWith(":")) { StringBuilder sb = new StringBuilder(); sb.append(str); sb.append(":"); str = sb.toString(); } } str2 = (String) this.d.get(str); } return str2; } @Override // o.Ngx public final RTk e(String str) { RTk rTk; synchronized (this) { rTk = (RTk) this.c.get(str); } return rTk; } private void e(String str, String str2, String str3, String str4, hbY hby) throws XMPException { hbY hby2; synchronized (this) { if (str.length() == 0) { throw new XMPException("Empty schema namespace URI", 4); } if (str2.length() == 0) { throw new XMPException("Empty property name", 4); } if (str3.length() == 0) { throw new XMPException("Empty schema namespace URI", 4); } if (str4.length() != 0) { if (hby != null) { C14373frw c14373frw = new C14373frw(hby.a); if ((c14373frw.a & 4096) != 0) { c14373frw.a |= 2048; } if ((c14373frw.a & 2048) != 0) { c14373frw.a |= 1024; } if ((c14373frw.a & 1024) != 0) { c14373frw.a |= 512; } int i = c14373frw.a; c14373frw.c(c14373frw.a); hby2 = new hbY(c14373frw.a); } else { hby2 = new hbY(); } hbY hby3 = hby2; if (this.e.matcher(str2).find() || this.e.matcher(str4).find()) { throw new XMPException("Alias and actual property names must be simple", 102); } String c = c(str); String c2 = c(str3); if (c == null) { throw new XMPException("Alias namespace is not registered", 101); } if (c2 == null) { throw new XMPException("Actual namespace is not registered", 101); } StringBuilder sb = new StringBuilder(); sb.append(c); sb.append(str2); String obj = sb.toString(); if (this.c.containsKey(obj)) { throw new XMPException("Alias is already existing", 4); } Map map = this.c; StringBuilder sb2 = new StringBuilder(); sb2.append(c2); sb2.append(str4); if (map.containsKey(sb2.toString())) { throw new XMPException("Actual property is already an alias, use the base property", 4); } this.c.put(obj, new RTk(this, str3, c2, str4, hby3) { // from class: o.iYm.1 private hbY a; private String b; private String c; private C15778iYm d; private String e; { this.d = this; this.e = str3; this.c = c2; this.b = str4; this.a = hby3; } public final String toString() { StringBuilder sb3 = new StringBuilder(); sb3.append(this.c); sb3.append(this.b); sb3.append(" NS("); sb3.append(this.e); sb3.append("), FORM ("); sb3.append(this.a); sb3.append(")"); return sb3.toString(); } @Override // o.RTk public final String d() { return this.b; } @Override // o.RTk public final String b() { return this.c; } @Override // o.RTk public final String e() { return this.e; } @Override // o.RTk public final hbY c() { return this.a; } }); } else { throw new XMPException("Empty property name", 4); } } } @Override // o.Ngx public final String c(String str, String str2) throws XMPException { synchronized (this) { if (str != null) { if (str.length() != 0) { if (str2 != null && str2.length() != 0) { if (str2.charAt(str2.length() - 1) != ':') { StringBuilder sb = new StringBuilder(); sb.append(str2); sb.append(':'); str2 = sb.toString(); } if (!C15974jzn.e(str2.substring(0, str2.length() - 1))) { throw new XMPException("The prefix is a bad XML name", 201); } String str3 = (String) this.a.get(str); String str4 = (String) this.d.get(str2); if (str3 != null) { return str3; } if (str4 != null) { String str5 = str2; int i = 1; while (this.d.containsKey(str5)) { StringBuilder sb2 = new StringBuilder(); sb2.append(str2.substring(0, str2.length() - 1)); sb2.append("_"); sb2.append(i); sb2.append("_:"); str5 = sb2.toString(); i++; } str2 = str5; } this.d.put(str2, str); this.a.put(str, str2); return str2; } throw new XMPException("Empty prefix", 4); } } throw new XMPException("Empty schema namespace URI", 4); } } }