/*
  MIT License http://www.opensource.org/licenses/mit-license.php
  Author Tobias Koppers @sokra
*/

/*
 * Tine 2.0
 *
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Christian Feitl <c.feitl@metaways.de>
 * @copyright   Copyright (c) 2022 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2018 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiß <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2017 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiß <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2020 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiß <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2024 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2016 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 *
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2019 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @package     Addressbook
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2009-2023 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @package     Addressbook
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2023 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 *
 * @package     Addressbook
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Stefanie Stamer <s.stamer@metaways.de>
 * @copyright   Copyright (c) 2016 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2007-2011 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2007-2017 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2010 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2011 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 * 
 * @package     Addressbook
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Alexander Stintzing <a.stintzing@metaways.de>
 * @copyright   Copyright (c) 2013 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @package     Addressbook
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2007-2013 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @package     Addressbook
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Frederic Heihoff <heihoff@sh-systems.eu>
 * @copyright   Copyright (c) 2007-2011 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @package     Addressbook
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Frederic Heihoff <heihoff@sh-systems.eu>
 * @copyright   Copyright (c) 2009-2020 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @package     Addressbook
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2016 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @package     Addressbook
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2016-2021 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * 
 * @package     Addressbook
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Stefanie Stamer <s.stamer@metaways.de>
 * @copyright   Copyright (c) 2009 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * Addressbook industry combo box
 * 
 * @package     Addressbook
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2016 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/*
 * Tine 2.0
 * contacts combo box and store
 *
 * @package     Addressbook
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiß <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2016 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/*
 * Tine 2.0
 * contacts combo box and store
 * 
 * @package     Addressbook
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2007-2016 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/* 
 * Tine 2.0
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2007-2008 Metaways Infosystems GmbH (http://www.metaways.de)
 */

/* .Expression */

/* .HTMLProxy */

/* ["default"] */

/* ["default"].locals */

/* asset import */

/* binding */

/* default */

/* default.locals */

/* harmony default export */

/* harmony export */

/* harmony import */

/* import() | Tinebase/js/MapPanel */

/* import() | Tinebase/js/localized-address-format */

/* istanbul ignore if  */

/* istanbul ignore next  */

/* pkg: Addressbook FAT Client (css/Addressbook-FAT.css)*/

/* pkg: Addressbook FAT Client (js/Addressbook-FAT.js)*/

/* require.ensure | Tinebase/js/cytoscape */

/*#__PURE__*/

/**
   * @cfg contact record
   */

/**
   * @cfg {Boolean} addPathFilter
   */

/**
   * @cfg {Boolean} groupOnly
   */

/**
   * @cfg {Boolean} noEditPlugin
   */

/**
   * @cfg {Boolean} userOnly
   */

/**
   * @cfg {Bool} hasDetailsPanel 
   */

/**
   * @cfg {Tine.Tinebase.Application} app
   */

/**
   * @cfg {Tine.widgets.dialog.EditDialog}
   */

/**
   * @private
   */

/**
   * @property
   */

/**
   * @property Tine.Tinebase.Application app
   */

/**
   * @property {Tine.Addressbook.Model.Contact} recordClass
   */

/**
   * @property {cytoscape} cy
   */

/**
   * Called after contact record is loaded to fill map panels
   * 
   * @param {Tine.Addressbook.Model.Contact} record
   */

/**
   * Change active map card
   * 
   * @param {String} map
   */

/**
   * Company address map panel
   * @type {Tine.widgets.MapPanel}
   */

/**
   * Enable fields we have no privateData grant for, when this is the users own contact (special case).
   */

/**
   * Get translated application title of the calendar application
   * 
   * @return {String}
   */

/**
   * NOTE: this is bullshit! The logic for opening a EditDialog is contained in the center panel
   *       but we don't want to fetch the centerpanel - we don't even know where to find it in some cases!
   *       -> let openWindow method deal with records!
   *       -> we have the same problem in the relations genericPickerGridPanel!
   * @param record
   */

/**
   * Private address map panel
   * @type {Tine.widgets.MapPanel}
   */

/**
   * TODO implement removal of a memberrole OR reset role members after each update
   *
   * @param contact
   */

/**
   * The Addressbook Contact Grid to hook into
   * 
   * @type {Tine.Addressbook.ContactGridPanel}
   */

/**
   * The hooking application
   * 
   * @type Tine.Tinebase.Application
   */

/**
   * The hooking model name of the
   * 
   * @type 
   */

/**
   * add on click event after render
   */

/**
   * add selected contacts to a new record
   * 
   * @param {Button} btn 
   */

/**
   * add to action updater the first time we render
   */

/**
   * adds selected contacts to an existing record
   */

/**
   * auto hook text i18n._('New Contact')
   */

/**
   * before cell edit
   *
   * @param o
   */

/**
   * bus notified about record changes
   */

/**
   * called after a new set of Records has been loaded
   *
   * @param  {Ext.data.Store} this.store
   * @param  {Array}          loaded records
   * @param  {Array}          load options
   * @return {Void}
   */

/**
   * called before store queries for data
   */

/**
   * checkDisableEmailField
   */

/**
   * checks if form data is valid
   * 
   * @return {Boolean}
   */

/**
   * fill store with list roles and the members
   *
   * @param [] memberroles
   */

/**
   * get addressbook contact grid panel
   */

/**
   * get default / selected addressbook container
   *
   * @returns {Object|Tine.Tinebase.Model.Container}
   */

/**
   * get memberrole records from store
   *
   * @param data
   * @returns {mixed}
   */

/**
   * get memberroles
   *
   * @param roles
   * @param list
   */

/**
   * get values from store (as array)
   *
   * @param {Array}
   *
   */

/**
   * get values from store (as array)
   *
   * @return {Array}
   */

/**
   * grid specific
   * @private
   */

/**
   * init
   */

/**
   * init columns
   */

/**
   * init component
   */

/**
   * init default template
   */

/**
   * init single List template (this.tpl)
   */

/**
   * init template
   * @private
   */

/**
   * initToolbar
   */

/**
   * inits this cmp
   * @private
   */

/**
   * is called in accountMode to reset the value
   * @param value
   */

/**
   * onAfterRecordLoad
   */

/**
   * onRecordLoad
   */

/**
   * optional record edit plugin conf for search combo
   */

/**
   * parse address button
   * @type Ext.Button
   */

/**
   * parse address handler
   *
   * opens message box where user can paste address
   *
   * @param {Ext.Button} button
   */

/**
   * properties from record.json to preserve when editing (see Ext.copyTo for syntax)
   * @type {string}
   */

/**
   * record class
   * @cfg {Tine.Addressbook.Model.Contact} recordClass
   */

/**
   * record class
   * @cfg {Tine.Addressbook.Model.List} recordClass
   */

/**
   * responsive content Renderer
   *
   * @param {String} folderId
   * @param {Object} metadata
   * @param {Folder|Account} record
   * @return {String}
   */

/**
   * retrieves values from grid
   *
   * @returns {*|Array}
   */

/**
   * returns array with columns
   * 
   * @return {Array}
   */

/**
   * returns column model
   * 
   * @return Ext.grid.ColumnModel
   * @private
   */

/**
   * returns details panel
   * 
   * @private
   * @return {Tine.Addressbook.ContactGridDetailsPanel}
   */

/**
   * returns details panel
   * 
   * @private
   * @return {Tine.Addressbook.ListGridDetailsPanel}
   */

/**
   * returns selected contacts
   * @returns {Array}
   */

/**
   * returns the current filter if is filter selection
   * @param {Tine.widgets.MainScreen}
   * @return {Object}
   */

/**
   * returns true if record has an email address
   * @return {Boolean}
   */

/**
   * returns true preferred email if available
   * @return {String}
   */

/**
   * send address to server + fills record/form with parsed data + adds unrecognizedTokens to description box
   *
   * @param {String} address
   */

/**
   * sets values to innerForm (grid)
   */

/**
   * use account objects/records in get/setValue
   * 
   * @cfg {Boolean} legacy
   * @legacy
   * 
   * TODO remove this later
   */

/**
   * use beforequery to set query filter
   *
   * @param {Event} qevent
   */

/**
   * use beforequery to set query filter
   * 
   * @param {Event} qevent
   */

/**
   * value renderer
   * 
   * @param {Ext.data.Record} filter line
   * @param {Ext.Element} element to render to 
   */

/**
   *list member role render
   *
   * @param value
   * @returns {string}
   * @constructor
   */

/**
 * @namespace   Tine.Addressbook
 * @class       Tine.Addressbook.Application
 * @extends     Tine.Tinebase.Application
 * Addressbook Application Object <br>
 * 
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 */

/**
 * @namespace   Tine.Addressbook
 * @class       Tine.Addressbook.ContactEditDialog
 * @extends     Tine.widgets.dialog.EditDialog
 * Addressbook Edit Dialog <br>
 *
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 */

/**
 * @namespace   Tine.Addressbook
 * @class       Tine.Addressbook.GenericContactGridPanelHook
 * 
 * Hook prototype for other applications to hook into the addressbook contact grid context menu<br>
 * 
 * @author      Alexander Stintzing <a.stintzing@metaways.de>
 */

/**
 * @namespace   Tine.Addressbook
 * @class       Tine.Addressbook.ListEditDialog
 * @extends     Tine.widgets.dialog.EditDialog
 * Addressbook Edit Dialog <br>
 * 
 * @author      Frederic Heihoff <heihoff@sh-systems.eu>
 */

/**
 * @namespace   Tine.Addressbook
 * @class       Tine.Addressbook.ListEditDialogRoleGridPanel
 * @extends     Ext.grid.EditorGridPanel
 * @author      Philipp Schüle <p.schuele@metaways.de>
 *
 * NOTE: this is currently only used in ListEditDialog
 */

/**
 * @namespace   Tine.Addressbook
 * @class       Tine.Addressbook.ListEditDialogRoleGridPanel
 * @extends     Ext.grid.EditorGridPanel
 * @author      Philipp Schüle <p.schuele@metaways.de>
 */

/**
 * @namespace   Tine.Addressbook
 * @class       Tine.Addressbook.ListMemberRoleGridPanel
 * @extends     Ext.grid.EditorGridPanel
 * @author      Philipp Schüle <p.schuele@metaways.de>
 */

/**
 * @namespace   Tine.Addressbook
 * @class       Tine.Addressbook.ListRoleEditDialog
 * @extends     Tine.widgets.dialog.EditDialog
 * Addressbook Edit Dialog <br>
 *
 * @author      Philipp Schüle <p.schuele@metaways.de>
 */

/**
 * @namespace   Tine.Addressbook
 * @class       Tine.Addressbook.MainScreen
 * @extends     Tine.widgets.MainScreen
 * MainScreen of the Addressbook Application <br>
 * 
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 */

/**
 * @namespace   Tine.Calendar
 * @class       Tine.Addressbook.ContactFilterModel
 * @extends     Tine.widgets.grid.FilterModel
 * 
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 */

/**
 * Addressbook Admin Panel Popup
 * 
 * @param   {Object} config
 * @return  {Ext.ux.Window}
 */

/**
 * Column renderer adb preferred_address field
 * @param value
 * @return {*}
 */

/**
 * Column renderer adb preferred_email field
 * @return {*}
 * @param data
 * @param cell
 * @param record
 */

/**
 * Contact grid panel
 * 
 * @namespace   Tine.Addressbook
 * @class       Tine.Addressbook.ContactGridPanel
 * @extends     Tine.widgets.grid.GridPanel
 * 
 * <p>Contact Grid Panel</p>
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Cornelius Weiss <c.weiss@metaways.de>
 * @copyright   Copyright (c) 2007-2011 Metaways Infosystems GmbH (http://www.metaways.de)
 * 
 * @param       {Object} config
 * @constructor
 * Create a new Tine.Addressbook.ContactGridPanel
 */

/**
 * Contract selection combo box
 * 
 * @namespace   Tine.Addressbook
 * @class       Tine.Addressbook.IndustrySearchCombo
 * @extends     Ext.form.ComboBox
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schüle <p.schuele@metaways.de>log
 * @copyright   Copyright (c) 2016 Metaways Infosystems GmbH (http://www.metaways.de)
 * 
 * @param       {Object} config
 * @constructor
 * Create a new Tine.Addressbook.IndustrySearchCombo
 */

/**
 * Industry model
 */

/**
 * List grid panel
 * 
 * @namespace   Tine.Addressbook
 * @class       Tine.Addressbook.ListGridPanel
 * @extends     Tine.widgets.grid.GridPanel
 * 
 * <p>List Grid Panel</p>
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Frederic Heihoff <heihoff@sh-systems.eu>
 * @copyright   Copyright (c) 2007-2011 Metaways Infosystems GmbH (http://www.metaways.de)
 * 
 * @param       {Object} config
 * @constructor
 * Create a new Tine.Addressbook.ListGridPanel
 */

/**
 * Model of a grant
 */

/**
 * Opens a new List edit dialog window
 * 
 * @return {Ext.ux.Window}
 */

/**
 * Opens a new contact edit dialog window
 *
 * @return {Ext.ux.Window}
 */

/**
 * Render country name by it's iso code
 *
 * @namespace   Tine.Addressbook
 * @author      Michael Spahn <m.spahn@metaways.de>
 * @singleton
 */

/**
 * Render given MailAddresss
 *
 * @namespace   Tine.Addressbook
 * @author      Michael Spahn <m.spahn@metaways.de>
 * @singleton
 */

/**
 * Render given URL as html
 *
 * @namespace   Tine.Addressbook
 * @author      Michael Spahn <m.spahn@metaways.de>
 * @singleton
 */

/**
 * Render given addresss
 *
 * You need to pass the record and a config to use this renderer.
 * The config contains a mapping, which fields from the record should have which place in the template.
 * Undefined fields won't be rendered, this keeps it well reusable for all address like purposes.
 *
 * @namespace   Tine.Addressbook
 * @author      Michael Spahn <m.spahn@metaways.de>
 * @singleton
 */

/**
 * Render given image
 *
 * @namespace   Tine.Addressbook
 * @author      Michael Spahn <m.spahn@metaways.de>
 * @singleton
 */

/**
 * Render preferred addresss
 *
 * give the preferred address from contact. (street, postalcode and locality)
 * @namespace   Tine.Addressbook
 * @author      Christian Feitl <c.feitl@metaways.de>
 */

/**
 * Statically constructs the columns used to represent a contact. Reused by ListMemberGridPanel + ListMemberRoleGridPanel
 */

/**
 * Structure (fake) model
 */

/**
 * Tine 2.0
 *
 * @package     Addressbook
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schuele <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2007-2017 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 * TODO         add preference for sending mails with felamimail or mailto?
 */

/**
 * Tine 2.0
 * 
 * @package     Addressbook
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Frederic Heihoff <heihoff@sh-systems.eu>
 * @copyright   Copyright (c) 2007-2009 Metaways Infosystems GmbH (http://www.metaways.de)
 *
 */

/**
 * admin settings panel
 * 
 * @namespace   Tine.Addressbook
 * @class       Tine.Addressbook.AdminPanel
 * @extends     Ext.TabPanel
 * 
 * <p>Addressbook Admin Panel</p>
 * <p><pre>
 * </pre></p>
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Stefanie Stamer <s.stamer@metaways.de>
 * @copyright   Copyright (c) 2009 Metaways Infosystems GmbH (http://www.metaways.de)
 * 
 * @param       {Object} config
 * @constructor
 * Create a new Tine.Addressbook.AdminPanel
 */

/**
 * config grid panel
 * @TODO isn't this a standard recordsPicker?
 *
 * @namespace   Tine.Addressbook
 * @class       Tine.Addressbook.ListMemberRoleLayerCombo
 * @extends     Tine.widgets.grid.LayerCombo
 */

/**
 * contact selection combo box
 * 
 * @namespace   Tine.Addressbook
 * @class       Tine.Addressbook.SearchCombo
 * @extends     Ext.form.ComboBox
 * 
 * <p>Contact Search Combobox</p>
 * <p><pre>
 * TODO         make this a twin trigger field with 'clear' button?
 * TODO         add switch to filter for expired/enabled/disabled user accounts
 * </pre></p>
 * 
 * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
 * @author      Philipp Schuele <p.schuele@metaways.de>
 * @copyright   Copyright (c) 2007-2011 Metaways Infosystems GmbH (http://www.metaways.de)
 * 
 * @param       {Object} config
 * @constructor
 * Create a new Tine.Addressbook.SearchCombo
 * 
 * TODO         add     forceSelection: true ?
 */

/**
 * email address model
 */

/**
 * get filtermodel of Industry model
 *
 * @namespace Tine.Addressbook.Model
 * @static
 * @return {Array} filterModel definition
 */

/**
 * get filtermodel of emailaddress model
 * 
 * @namespace Tine.Addressbook.Model
 * @static
 * @return {Array} filterModel definition
 */

/**
 * list type renderer
 *
 * @private
 * @return {String} HTML
 */

/**
 * render the CardDAV Url into property panel of contianers
 * 
 * @class   Tine.Addressbook.CardDAVContainerPropertiesHookField
 * @extends Ext.form.TextField
 */

/**
 * the details panel (shows List details)
 * 
 * @namespace   Tine.Addressbook
 * @class       Tine.Addressbook.ListGridDetailsPanel
 * @extends     Tine.widgets.grid.DetailsPanel
 */

/**
 * the details panel (shows contact details)
 *
 * @namespace   Tine.Addressbook
 * @class       Tine.Addressbook.ContactGridDetailsPanel
 * @extends     Tine.widgets.grid.DetailsPanel
 */

/**
 * tid renderer
 * 
 * @private
 * @return {String} HTML
 */

/** 
   * Overide get main screen to allow for feature gating
   *
   **/

/***/

/*, 'notin'*/

/*global Ext, Tine*/

//

//             // mark row invalid somehow!

//             return false;

//             valid = false;

//            otherwise we can't open multiple dialogs with new records

//         const field = gridEditor.field;

//         field.setValue(values[name]);

//         if (!field.validate()) {

//         }

//       and not required fields should be disabled (n_given, n_family, etc.)

//     // prevent loading non existing remote record

//     _.forEach(config.customEditors, (gridEditor, name) => {

//     const values = this.getSource();

//     let valid = true;

//     record.setId(0);

//     return valid;

//     });

//  + get()

//  + getBlock() // block actually doesn't specify a certain field and only an record, the field declaration should come from the modelconfig later

// 'label': 'data(type)',

// -> might have to do with autounselectify opton :-)

// /* needed for isFormField cycle */

// 2024-10-01 do net set id to 0 any longer, solved by phantom: true

// @FIXME twing can't cope with null values yet, remove this once twing fixed it

// @TODO later: update actions

// @TODO: enable edit&delete btns // have action updater

// @TODO: implement selection model

// @TODO: map list-role to edgetype?

// @TODO: show relation type - resove all relation types e.g. SITE -> Standort

// @todo generalise!

// @todo required fields should depend on salutation ('company' -> org_name, etc.)

// @todo: this field doesn't actually require a certain field, there should be two methods for RenderManager:

// CONCATENATED MODULE: ../../Addressbook/js/AddressPanel.js

// CONCATENATED MODULE: ../../Addressbook/js/ContactEditDialog.js

// CONCATENATED MODULE: ./ux/form/FieldTriggerPlugin.js

// Custom rendering Template

// ESM COMPAT FLAG

// EXPORTS

// EXTERNAL MODULE: ./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js

// EXTERNAL MODULE: ./twingEnv.es6.js

// EXTERNAL MODULE: ./util/postalAddressFormater.js

// Exports

// For old IE

// If url is already wrapped in quotes, remove them

// Module

// NOTE: at the moment this means rw!

// NOTE: contact grid basecols have memberroles with different data layout

// NOTE: in case we are rendered after record was load

// NOTE: it comes again and again till

// NOTE: not yet, reloading(relayout) resets viewport

// See https://drafts.csswg.org/css-values-3/#urls

// Should url be wrapped?

// Special case to return head of iframe instead of iframe itself

// Static Methods

// TODO allow user to switch between those two grid panels (card layout?)

// TODO move this to a generic place

// TODO set record xprops

// This will throw an exception if access to iframe is blocked

// _('Structure')

// abstract code needs this name

// account object

// account record

// activities and tags

// add specific search combo to be able to switch "userOnly" for system groups

// allow dbclick to open

// allow to configure defaults from outside

// already id

// autoHeight: true,

// bodyStyle: 'border:1px solid #B5B8C8;',

// cardDAV URL

// check if already in store

// check if felamimail is installed and user has run right and wants to use felamimail in adb

// companyEl

// config.clearInvalid = Ext.form.Field.prototype.clearInvalid;

// config.getMessageHandler = Ext.form.Field.prototype.getMessageHandler;

// config.getName = Ext.form.Field.prototype.getName;

// config.getValue = Ext.emptyFn;

// config.isFormField = true;

// config.isValid = function() {

// config.markInvalid = Ext.form.Field.prototype.markInvalid;

// config.setValue = Ext.emptyFn;

// config.validate = function() { return this.isValid(); };

// console.error('getValue', value);

// console.error('setValue', field.fieldName, value, record)

// console.error('setValue', fieldName, _.get(value, fieldName));

// contact record

// deactivate some fns

// disabled: !Tine.Tinebase.common.hasRight('manage_sso', 'SSO'),

// due to cross-origin restrictions

// edge

// elements = values[0];

// els & edges

// filter = [{field: 'shadow_path', operator: 'contains', value: '{SITE}'}]

// for some reason cy internal selection model does not work :-(

// here we loose record.json data from old record! -> update existing record? vs. have preserveJSON props? // not a problem?

// i18n._('Private')

// if (!this.field.selectedRecord && mode === 'remote') {

// if a container is selected in the tree, take this as default container

// if currentValue differs from startValue add to changes

// if we have coordinates for company address add map panel

// if we have coordinates for private address add map panel

// import a list of modules into the list

// init cy

// init suggestions

// init templates

// istanbul ignore if

// istanbul ignore next

// legacy

// let me = this;

// let's see if our panels are inside a tabPanel and switch to the card

// make sure grid is updated after group changed

// might have an trailing /, we can safely remove it!

// nameEl

// ngettext('Addressbook', 'Addressbooks', n); gettext('Addressbooks');

// ngettext('Contact Personal Grant', 'Contact Personal Grants', n); gettext('Contact Personal Grant');

// ngettext('Email Address', 'Email Addresses', n); gettext('Email Addresses');

// ngettext('Industry', 'Industries', n); gettext('Industries');

// ngettext('List Personal Grant', 'List Personal Grants', n); gettext('List Personal Grant');

// ngettext('Structure', 'Structures', n); gettext('Structures');

// node

// only set the fields that could be detected

// only show if calendar is available and user has manage_resources right

// preserve space for triggers

// private

// ref: '../cyPanel',

// register actions in updater

// register grants for calendar containers

// return the list of modules as css string

// the list record

// this.recordProxy = Tine.Addressbook.contactBackend;

// update detailsPanel

// value is account record, but we need contacts!

// you need to fill in one of: n_given n_family org_name

// { id: 'role', header: i18n._('Job Role'), dataIndex: 'role' },

// { id: 'room', header: i18n._('Room'), dataIndex: 'room' },

// }

// };

//,

//dependentLocality: '',

//inject fake hidden field to take part of the record get/setValue cycle

//private

//requiredGrant: 'addGrant',

//sort?

//sortingCode: '',
