{"version":3,"sources":["webpack://connections/./node_modules/classnames/index.js","webpack://connections/./node_modules/js-cookie/src/js.cookie.js","webpack://connections/webpack/bootstrap","webpack://connections/webpack/runtime/compat get default export","webpack://connections/webpack/runtime/define property getters","webpack://connections/webpack/runtime/hasOwnProperty shorthand","webpack://connections/external \"lodash\"","webpack://connections/./assets/js/RecentlyViewedCookie.js","webpack://connections/./node_modules/@babel/runtime/helpers/esm/defineProperty.js","webpack://connections/./node_modules/@babel/runtime/helpers/esm/classCallCheck.js","webpack://connections/./node_modules/@babel/runtime/helpers/esm/createClass.js","webpack://connections/./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","webpack://connections/./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","webpack://connections/./node_modules/@babel/runtime/helpers/esm/inherits.js","webpack://connections/./node_modules/@babel/runtime/helpers/esm/typeof.js","webpack://connections/./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","webpack://connections/./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","webpack://connections/./includes/blocks/components/filter-tag-selector/index.js","webpack://connections/./node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","webpack://connections/./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","webpack://connections/./node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","webpack://connections/./node_modules/@babel/runtime/helpers/esm/iterableToArray.js","webpack://connections/./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","webpack://connections/./node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","webpack://connections/./includes/blocks/utils/terms.js","webpack://connections/./includes/blocks/components/hierarchical-term-selector/index.js","webpack://connections/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://connections/./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","webpack://connections/./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","webpack://connections/./includes/blocks/components/page-select/index.js","webpack://connections/./includes/blocks/components/range-control/index.js","webpack://connections/./includes/blocks/components/entry/name.js","webpack://connections/./includes/blocks/components/entry/title.js","webpack://connections/./includes/blocks/components/entry/image.js","webpack://connections/./includes/blocks/components/entry/phone-numbers.js","webpack://connections/./includes/blocks/components/entry/email.js","webpack://connections/./includes/blocks/components/entry/social-networks.js","webpack://connections/./includes/blocks/components/entry/excerpt.js","webpack://connections/./includes/blocks/components/entry/social-network-icon.js","webpack://connections/./assets/js/RecentlyViewed.js"],"names":["hasOwn","hasOwnProperty","classNames","classes","i","arguments","length","arg","argType","push","Array","isArray","inner","apply","toString","Object","prototype","key","call","join","module","exports","default","factory","OldCookies","window","Cookies","api","noConflict","extend","result","attributes","decode","s","replace","decodeURIComponent","init","converter","set","value","document","path","defaults","expires","Date","toUTCString","JSON","stringify","test","e","write","encodeURIComponent","String","escape","stringifiedAttributes","attributeName","split","cookie","get","json","jar","cookies","parts","slice","charAt","name","read","parse","getJSON","remove","withConverter","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","obj","prop","lodash","cnViewing","recentlyViewed","getRecentlyViewed","findIndex","x","entryID","unshift","take","configurable","writable","instance","Constructor","TypeError","_defineProperties","target","props","descriptor","protoProps","staticProps","self","ReferenceError","_setPrototypeOf","p","setPrototypeOf","__proto__","subClass","superClass","create","constructor","_typeof","Symbol","iterator","getPrototypeOf","wp","element","Component","components","FormTokenField","apiFetch","url","addQueryArgs","_arrayLikeToArray","arr","len","arr2","_toConsumableArray","iter","from","minLen","groupBy","buildTermsTree","flatTerms","termsByParent","fillWithChildren","terms","map","term","children","id","i18n","__","_x","_n","sprintf","CheckboxControl","withSpokenMessages","Spinner","compose","withInstanceId","DEFAULT_QUERY","per_page","orderby","order","_fields","HierarchicalTermSelector","findTerm","bind","onChange","setFilterValue","sortBySelected","state","loading","availableTermsTree","availableTerms","filterValue","filteredTermsTree","termId","this","indexOf","without","parent","find","parseInt","toLowerCase","fetchTerms","invoke","fetchRequest","taxonomy","then","setState","xhr","statusText","termsTree","treeHasSelection","termTree","filter","child","sort","termA","termB","termASelected","termBSelected","event","getFilterMatcher","resultCount","getResultCount","count","resultsFoundMessage","debouncedSpeak","matchTermsForFilter","originalTerm","renderedTerms","className","checked","label","unescapeString","renderTerms","instanceId","filterInputId","filterLabel","startCase","groupLabel","showFilter","htmlFor","type","tabIndex","role","aria-label","_extends","assign","source","_objectWithoutProperties","excluded","sourceKeys","keys","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","data","withSelect","select","TreeSelect","ownProps","getEntityRecords","getPostType","getCurrentPostId","postType","postTypeMeta","postId","options","exclude","parent_exclude","noOptionLabel","isHierarchical","pageItems","pagesTree","item","title","raw","tree","selectedId","isFinite","BaseControl","Button","Dashicon","beforeIcon","afterIcon","help","allowReset","initialPosition","resetValue","onChangeValue","newValue","Number","initialSliderValue","classnames","icon","aria-describedby","onClick","disabled","decodeEntities","Fragment","htmlEntities","asPermalink","entry","Tag","tag","fn","rendered","href","link","isUndefined","job_title","_nx","size","usePlaceholder","placeholderWidth","placeholderHeight","has","images","height","width","style","display","maxWidth","srcSet","alt","toUpperCase","paddingBottom","render","RecentlyViewed","prepareQueryArgs","fetchAPI","fetchEntries","queryResults","isLoading","args","query","zc","limit","context","results","entries","items","URL","querySelectorAll","forEach","getAttribute"],"mappings":";sCAAA,OAOC,WACA,aAEA,IAAIA,EAAS,GAAGC,eAEhB,SAASC,IAGR,IAFA,IAAIC,EAAU,GAELC,EAAI,EAAGA,EAAIC,UAAUC,OAAQF,IAAK,CAC1C,IAAIG,EAAMF,UAAUD,GACpB,GAAKG,EAAL,CAEA,IAAIC,SAAiBD,EAErB,GAAgB,WAAZC,GAAoC,WAAZA,EAC3BL,EAAQM,KAAKF,QACP,GAAIG,MAAMC,QAAQJ,IACxB,GAAIA,EAAID,OAAQ,CACf,IAAIM,EAAQV,EAAWW,MAAM,KAAMN,GAC/BK,GACHT,EAAQM,KAAKG,SAGT,GAAgB,WAAZJ,EACV,G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2R,MAAQxC,EAAMM,QAE5CjJ,KAAK,SAAE2I,EAAOvR,GAGd,OACC,+BAAIa,IAAMb,GACT,gCAAK+M,UAAU,4BACd,yBAAC,GAAD,CAAYwE,MAAQA,EAAQ5D,KAAO,iBAAmB4D,EAAM5D,KAAO,OAAS,QAAUsE,KAAK,SAASC,gBAAgB,KAErH,gCAAKnF,UAAU,8BACd,yBAAC,GAAD,CAAWwE,MAAQA,EAAQE,IAAI,OAAOH,aAAc,IACpD,yBAAC,GAAD,CAAYC,MAAQA,SAMzB,OAAS,mCAAKuC,GAjCd,OACC,yBAAC,GAAD,KACC,oCACGlJ,KAAKP,MAAMiJ,UACZ,kCAAKrK,GAAI,aAAc,eAAvB,IAAyC,yBAAC,GAAD,OACzC,kCAAKA,GAAI,wCAAyC,sB,GArG5BzB,IAuINpF,SAAS4R,iBAAkB,uBAEnCC,SAAS,SAAAlO,GAEvB,IAAI2N,EAAQ3N,EAASmO,aAAc,cAC/B7E,EAAUtJ,EAASmO,aAAc,gBAErClB,GAAQ,yBAACC,GAAD,CAAgBS,MAAOA,EAAOrE,QAASA,IAAYtJ,M","file":"js/bundle.js","sourcesContent":["/*!\n Copyright (c) 2018 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString === Object.prototype.toString) {\n\t\t\t\t\tfor (var key in arg) {\n\t\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","/*!\n * JavaScript Cookie v2.2.1\n * https://github.com/js-cookie/js-cookie\n *\n * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n * Released under the MIT license\n */\n;(function (factory) {\n\tvar registeredInModuleLoader;\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (!registeredInModuleLoader) {\n\t\tvar OldCookies = window.Cookies;\n\t\tvar api = window.Cookies = factory();\n\t\tapi.noConflict = function () {\n\t\t\twindow.Cookies = OldCookies;\n\t\t\treturn api;\n\t\t};\n\t}\n}(function () {\n\tfunction extend () {\n\t\tvar i = 0;\n\t\tvar result = {};\n\t\tfor (; i < arguments.length; i++) {\n\t\t\tvar attributes = arguments[ i ];\n\t\t\tfor (var key in attributes) {\n\t\t\t\tresult[key] = attributes[key];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction decode (s) {\n\t\treturn s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);\n\t}\n\n\tfunction init (converter) {\n\t\tfunction api() {}\n\n\t\tfunction set (key, value, attributes) {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tattributes = extend({\n\t\t\t\tpath: '/'\n\t\t\t}, api.defaults, attributes);\n\n\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\tattributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);\n\t\t\t}\n\n\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\n\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\n\t\t\ttry {\n\t\t\t\tvar result = JSON.stringify(value);\n\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\tvalue = result;\n\t\t\t\t}\n\t\t\t} catch (e) {}\n\n\t\t\tvalue = converter.write ?\n\t\t\t\tconverter.write(value, key) :\n\t\t\t\tencodeURIComponent(String(value))\n\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\n\t\t\tkey = encodeURIComponent(String(key))\n\t\t\t\t.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)\n\t\t\t\t.replace(/[\\(\\)]/g, escape);\n\n\t\t\tvar stringifiedAttributes = '';\n\t\t\tfor (var attributeName in attributes) {\n\t\t\t\tif (!attributes[attributeName]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tstringifiedAttributes += '; ' + attributeName;\n\t\t\t\tif (attributes[attributeName] === true) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Considers RFC 6265 section 5.2:\n\t\t\t\t// ...\n\t\t\t\t// 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n\t\t\t\t// character:\n\t\t\t\t// Consume the characters of the unparsed-attributes up to,\n\t\t\t\t// not including, the first %x3B (\";\") character.\n\t\t\t\t// ...\n\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n\t\t\t}\n\n\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\n\t\t}\n\n\t\tfunction get (key, json) {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar jar = {};\n\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t// in case there are no cookies at all.\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\tvar cookie = parts.slice(1).join('=');\n\n\t\t\t\tif (!json && cookie.charAt(0) === '\"') {\n\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvar name = decode(parts[0]);\n\t\t\t\t\tcookie = (converter.read || converter)(cookie, name) ||\n\t\t\t\t\t\tdecode(cookie);\n\n\t\t\t\t\tif (json) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t\tjar[name] = cookie;\n\n\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\treturn key ? jar[key] : jar;\n\t\t}\n\n\t\tapi.set = set;\n\t\tapi.get = function (key) {\n\t\t\treturn get(key, false /* read as raw */);\n\t\t};\n\t\tapi.getJSON = function (key) {\n\t\t\treturn get(key, true /* read as json */);\n\t\t};\n\t\tapi.remove = function (key, attributes) {\n\t\t\tset(key, '', extend(attributes, {\n\t\t\t\texpires: -1\n\t\t\t}));\n\t\t};\n\n\t\tapi.defaults = {};\n\n\t\tapi.withConverter = init;\n\n\t\treturn api;\n\t}\n\n\treturn init(function () {});\n}));\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var __WEBPACK_NAMESPACE_OBJECT__ = lodash;","/**\r\n * External dependencies\r\n */\r\nimport * as Cookies from \"js-cookie\";\r\nimport { isArray, remove, take } from \"lodash\";\r\n\r\n/**\r\n * @return {[]}\r\n */\r\nconst getRecentlyViewed = () => {\r\n\r\n\tlet recentlyViewed = Cookies.getJSON( 'cnRecentlyViewed' );\r\n\r\n\tif ( !isArray( recentlyViewed ) ) {\r\n\r\n\t\trecentlyViewed = [];\r\n\t}\r\n\r\n\treturn recentlyViewed;\r\n}\r\n\r\n/**\r\n * The `cnViewing` variable is set during the `Connections_Directory/Render/Template/Single_Entry/After` action\r\n * by `wp_add_inline_script()` hooked to the `frontend` handle.\r\n *\r\n * NOTE: The `cnViewing` variable is JSON encoded, it must be decoded before use.\r\n *\r\n * @typedef {{postID: string, entryID: string}} cnViewing\r\n */\r\nif ( 'undefined' !== typeof cnViewing ) {\r\n\r\n\tlet recentlyViewed = getRecentlyViewed();\r\n\r\n\t// If current Entry being viewed already exists, remove it from the array.\r\n\tif ( 0 <= recentlyViewed.findIndex( x => x.entryID === cnViewing.entryID ) ) {\r\n\r\n\t\tremove( recentlyViewed, x => x.entryID === cnViewing.entryID );\r\n\t}\r\n\r\n\t// Insert the currently being viewed Entry to the head of the array.\r\n\trecentlyViewed.unshift( cnViewing );\r\n\r\n\tCookies.set( 'cnRecentlyViewed', take( recentlyViewed, 10 ) );\r\n}\r\n","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","export default function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nexport default function _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","export default function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}","import _typeof from \"@babel/runtime/helpers/typeof\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","/**\r\n * External dependencies\r\n */\r\nimport {\r\n\tfind,\r\n\tinvoke,\r\n\tisEmpty,\r\n\tmap,\r\n\tthrottle,\r\n\tunescape as unescapeString,\r\n\tuniqBy,\r\n} from 'lodash';\r\n\r\n/**\r\n * WordPress dependencies\r\n */\r\nconst { Component } = wp.element;\r\nconst { FormTokenField } = wp.components;\r\nconst { apiFetch } = wp;\r\nconst { addQueryArgs } = wp.url;\r\n\r\n/**\r\n * Module constants\r\n */\r\nconst DEFAULT_QUERY = {\r\n\tper_page: -1,\r\n};\r\n\r\nconst MAX_TERMS_SUGGESTIONS = 20;\r\n\r\nconst isSameTermName = ( termA, termB ) => termA.toLowerCase() === termB.toLowerCase();\r\n\r\nclass FilterTagSelector extends Component {\r\n\r\n\tconstructor() {\r\n\r\n\t\tsuper( ...arguments );\r\n\r\n\t\tthis.unescapeTerm = this.unescapeTerm.bind( this );\r\n\t\tthis.unescapeTerms = this.unescapeTerms.bind( this );\r\n\t\tthis.onChange = this.onChange.bind( this );\r\n\t\tthis.searchTerms = throttle( this.searchTerms.bind( this ), 300 );\r\n\r\n\t\tthis.state = {\r\n\t\t\tloading: false,\r\n\t\t\tavailableTerms: [],\r\n\t\t\tselectedTerms: [],\r\n\t\t};\r\n\t}\r\n\r\n\t/**\r\n\t * Returns a term object with name unescaped.\r\n\t * The unescape of the name property is done using lodash unescape function.\r\n\t *\r\n\t * @param {Object} term The term object to unescape.\r\n\t *\r\n\t * @return {Object} Term object with name property unescaped.\r\n\t */\r\n\tunescapeTerm( term ) {\r\n\r\n\t\tconst { renderField } = this.props;\r\n\r\n\t\treturn {\r\n\t\t\t...term,\r\n\t\t\tunescapeName: unescapeString( term[ renderField ] ),\r\n\t\t};\r\n\t};\r\n\r\n\t/**\r\n\t * Returns an array of term objects with names unescaped.\r\n\t * The unescape of each term is performed using the unescapeTerm function.\r\n\t *\r\n\t * @param {Object[]} terms Array of term objects to unescape.\r\n\t *\r\n\t * @return {Object[]} Array of therm objects unescaped.\r\n\t */\r\n\tunescapeTerms( terms ) {\r\n\r\n\t\treturn map( terms, this.unescapeTerm );\r\n\t};\r\n\r\n\tcomponentDidMount() {\r\n\r\n\t\tif ( ! isEmpty( this.props.terms ) ) {\r\n\r\n\t\t\tthis.setState( { loading: false } );\r\n\r\n\t\t\tthis.initRequest = this.fetchTerms( {\r\n\t\t\t\tsearch: this.props.terms.join( ',' ),\r\n\t\t\t\tper_page: -1,\r\n\t\t\t} );\r\n\r\n\t\t\tthis.initRequest.then(\r\n\t\t\t\t() => {\r\n\t\t\t\t\tthis.setState( { loading: false } );\r\n\t\t\t\t},\r\n\t\t\t\t( xhr ) => {\r\n\t\t\t\t\tif ( xhr.statusText === 'abort' ) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.setState( {\r\n\t\t\t\t\t\tloading: false,\r\n\t\t\t\t\t} );\r\n\t\t\t\t}\r\n\t\t\t);\r\n\t\t}\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\r\n\t\tinvoke( this.initRequest, [ 'abort' ] );\r\n\t\tinvoke( this.searchRequest, [ 'abort' ] );\r\n\t}\r\n\r\n\tcomponentDidUpdate( prevProps ) {\r\n\r\n\t\tif ( prevProps.terms !== this.props.terms ) {\r\n\r\n\t\t\tthis.updateSelectedTerms( this.props.terms );\r\n\t\t}\r\n\t}\r\n\r\n\tfetchTerms( params = {} ) {\r\n\r\n\t\tconst { getFields, type, renderField } = this.props;\r\n\t\tconst query = { ...DEFAULT_QUERY, ...params, ...{_fields: getFields} };\r\n\t\tconst request = apiFetch( {\r\n\t\t\tpath: addQueryArgs( `/cn-api/v1/autocomplete/${ type }`, query ),\r\n\t\t} );\r\n\r\n\t\trequest.then( this.unescapeTerms ).then( ( terms ) => {\r\n\r\n\t\t\tthis.setState( ( state ) => ( {\r\n\t\t\t\tavailableTerms: state.availableTerms.concat(\r\n\t\t\t\t\tterms.filter( ( term ) => ! find( state.availableTerms, ( availableTerm ) => availableTerm[ renderField ] === term[ renderField ] ) )\r\n\t\t\t\t),\r\n\t\t\t} ) );\r\n\r\n\t\t\tthis.updateSelectedTerms( this.props.terms );\r\n\t\t} );\r\n\r\n\t\treturn request;\r\n\t}\r\n\r\n\tupdateSelectedTerms( terms = [] ) {\r\n\r\n\t\tconst { renderField, returnField } = this.props;\r\n\r\n\t\tconst selectedTerms = terms.reduce( ( result, termId ) => {\r\n\r\n\t\t\t// console.log( termId );\r\n\r\n\t\t\tconst termObject = find( this.state.availableTerms, ( term ) => term[ returnField ] === termId );\r\n\r\n\t\t\tif ( termObject ) {\r\n\r\n\t\t\t\tresult.push( termObject[ renderField ] );\r\n\t\t\t}\r\n\r\n\t\t\treturn result;\r\n\t\t}, [] );\r\n\r\n\t\t// console.log( 'this.state.availableTerms=', this.state.availableTerms );\r\n\t\t// console.log( 'updateSelectedTerms::selectedTerms=', selectedTerms );\r\n\r\n\t\tthis.setState( {\r\n\t\t\tselectedTerms,\r\n\t\t} );\r\n\t}\r\n\r\n\tonChange( termNames ) {\r\n\r\n\t\tconst { onChange, renderField, returnField } = this.props;\r\n\r\n\t\t// console.log( 'onChange::onChange=', termNames );\r\n\r\n\t\tconst renderFieldToReturnField = ( names, availableTerms ) => {\r\n\t\t\treturn names\r\n\t\t\t\t.map( ( termName ) =>\r\n\t\t\t\t\tfind( availableTerms, ( term ) => isSameTermName( term[ renderField ], termName ) )[ returnField ]\r\n\t\t\t\t);\r\n\t\t};\r\n\r\n\t\t// console.log( 'termNames:', termNames );\r\n\r\n\t\tconst uniqueTerms = uniqBy( termNames, ( term ) => term.toLowerCase() );\r\n\r\n\t\tconst addTerm = uniqueTerms.filter( ( termName ) =>\r\n\t\t\tfind( this.state.availableTerms, ( term ) => isSameTermName( term[ renderField ], termName ) )\r\n\t\t);\r\n\r\n\t\t// console.log( 'addTerm:', addTerm );\r\n\r\n\t\tconst selectedTermIDs = renderFieldToReturnField( addTerm, this.state.availableTerms );\r\n\r\n\t\t// console.log( 'selectedTermIDs:', selectedTermIDs );\r\n\r\n\t\tonChange( selectedTermIDs );\r\n\t}\r\n\r\n\tsearchTerms( search = '' ) {\r\n\r\n\t\tinvoke( this.searchRequest, [ 'abort' ] );\r\n\t\tthis.searchRequest = this.fetchTerms( { search } );\r\n\t}\r\n\r\n\trender() {\r\n\r\n\t\tconst {\r\n\t\t\t label,\r\n\t\t\t messages,\r\n\t\t } = this.props;\r\n\r\n\t\tconst { loading, availableTerms, selectedTerms } = this.state;\r\n\t\tconst termNames = availableTerms.map( ( term ) => term.unescapeName );\r\n\r\n\t\treturn (\r\n\t\t\t\r\n\t\t);\r\n\t}\r\n}\r\n\r\nexport default FilterTagSelector;\r\n","export default function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nexport default function _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}","export default function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nexport default function _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}","export default function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}","/**\r\n * External dependencies\r\n */\r\nconst { groupBy } = lodash;\r\n\r\n/**\r\n * Returns terms in a tree form.\r\n *\r\n * Copies from WP core since it does not appear to be available in the global wp object.\r\n * @link https://github.com/WordPress/gutenberg/blob/master/packages/editor/src/utils/terms.js\r\n *\r\n * @param {Array} flatTerms Array of terms in flat format.\r\n *\r\n * @return {Array} Array of terms in tree format.\r\n */\r\nexport function buildTermsTree( flatTerms ) {\r\n\tconst termsByParent = groupBy( flatTerms, 'parent' );\r\n\tconst fillWithChildren = ( terms ) => {\r\n\t\treturn terms.map( ( term ) => {\r\n\t\t\tconst children = termsByParent[ term.id ];\r\n\t\t\treturn {\r\n\t\t\t\t...term,\r\n\t\t\t\tchildren: children && children.length ? fillWithChildren( children ) : [],\r\n\t\t\t};\r\n\t\t} );\r\n\t};\r\n\r\n\treturn fillWithChildren( termsByParent[ '0' ] || [] );\r\n}\r\n","/**\r\n * External dependencies\r\n */\r\nimport { unescape as unescapeString, without, find, invoke, startCase } from 'lodash';\r\n\r\n/**\r\n * WordPress dependencies\r\n */\r\nconst { __, _x, _n, sprintf } = wp.i18n;\r\nconst { Component } = wp.element;\r\nconst { CheckboxControl, withSpokenMessages, Spinner } = wp.components;\r\n// const { withSelect, withDispatch } = wp.data;\r\nconst { withInstanceId, compose } = wp.compose;\r\nconst { apiFetch } = wp;\r\nconst { addQueryArgs } = wp.url;\r\n\r\n/**\r\n * Internal dependencies\r\n */\r\nimport { buildTermsTree } from '../../utils/terms';\r\nimport './style.scss';\r\n\r\n/**\r\n * Module Constants\r\n */\r\nconst DEFAULT_QUERY = {\r\n\tper_page: -1,\r\n\torderby: 'name',\r\n\torder: 'asc',\r\n\t_fields: 'id,name,parent',\r\n};\r\n\r\nconst MIN_TERMS_COUNT_FOR_FILTER = 8;\r\n\r\nclass HierarchicalTermSelector extends Component {\r\n\tconstructor( ) {\r\n\t\tsuper( ...arguments );\r\n\t\tthis.findTerm = this.findTerm.bind( this );\r\n\t\tthis.onChange = this.onChange.bind( this );\r\n\t\tthis.setFilterValue = this.setFilterValue.bind( this );\r\n\t\tthis.sortBySelected = this.sortBySelected.bind( this );\r\n\t\tthis.state = {\r\n\t\t\tloading: true,\r\n\t\t\tavailableTermsTree: [],\r\n\t\t\tavailableTerms: [],\r\n\t\t\tfilterValue: '',\r\n\t\t\tfilteredTermsTree: [],\r\n\t\t};\r\n\t}\r\n\r\n\tonChange( termId ) {\r\n\r\n\t\tconst { onChange, terms } = this.props;\r\n\r\n\t\t// const termId = parseInt( event.target.value, 10 );\r\n\t\tconst hasTerm = terms.indexOf( termId ) !== -1;\r\n\t\tconst newTerms = hasTerm ? without( terms, termId ) : [ ...terms, termId ];\r\n\r\n\t\tonChange( newTerms );\r\n\t}\r\n\r\n\tfindTerm( terms, parent, name ) {\r\n\r\n\t\treturn find( terms, ( term ) => {\r\n\r\n\t\t\treturn ( ( ! term.parent && ! parent ) || parseInt( term.parent ) === parseInt( parent ) ) &&\r\n\t\t\t\tterm.name.toLowerCase() === name.toLowerCase();\r\n\t\t} );\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\tthis.fetchTerms();\r\n\t}\r\n\r\n\tcomponentWillUnmount() {\r\n\t\tinvoke( this.fetchRequest, [ 'abort' ] );\r\n\t}\r\n\r\n\tfetchTerms() {\r\n\r\n\t\tconst { taxonomy } = this.props;\r\n\r\n\t\tif ( ! taxonomy ) {\r\n\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tthis.fetchRequest = apiFetch( {\r\n\t\t\tpath: addQueryArgs( `/cn-api/v1/${ taxonomy }/`, DEFAULT_QUERY ),\r\n\t\t} );\r\n\r\n\t\tthis.fetchRequest.then(\r\n\t\t\t( terms ) => { // resolve\r\n\t\t\t\tconst availableTermsTree = this.sortBySelected( buildTermsTree( terms ) );\r\n\r\n\t\t\t\tthis.fetchRequest = null;\r\n\t\t\t\tthis.setState( {\r\n\t\t\t\t\tloading: false,\r\n\t\t\t\t\tavailableTermsTree,\r\n\t\t\t\t\tavailableTerms: terms,\r\n\t\t\t\t} );\r\n\t\t\t},\r\n\t\t\t( xhr ) => { // reject\r\n\t\t\t\tif ( xhr.statusText === 'abort' ) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\tthis.fetchRequest = null;\r\n\t\t\t\tthis.setState( {\r\n\t\t\t\t\tloading: false,\r\n\t\t\t\t} );\r\n\t\t\t}\r\n\t\t);\r\n\t}\r\n\r\n\tsortBySelected( termsTree ) {\r\n\r\n\t\tconst { terms } = this.props;\r\n\r\n\t\tconst treeHasSelection = ( termTree ) => {\r\n\r\n\t\t\tif ( terms.indexOf( termTree.id ) !== -1 ) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tif ( undefined === termTree.children ) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tconst anyChildIsSelected = termTree.children.map( treeHasSelection ).filter( ( child ) => child ).length > 0;\r\n\r\n\t\t\tif ( anyChildIsSelected ) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\treturn false;\r\n\t\t};\r\n\r\n\t\tconst termOrChildIsSelected = ( termA, termB ) => {\r\n\r\n\t\t\tconst termASelected = treeHasSelection( termA );\r\n\t\t\tconst termBSelected = treeHasSelection( termB );\r\n\r\n\t\t\tif ( termASelected === termBSelected ) {\r\n\t\t\t\treturn 0;\r\n\t\t\t}\r\n\r\n\t\t\tif ( termASelected && ! termBSelected ) {\r\n\t\t\t\treturn -1;\r\n\t\t\t}\r\n\r\n\t\t\tif ( ! termASelected && termBSelected ) {\r\n\t\t\t\treturn 1;\r\n\t\t\t}\r\n\r\n\t\t\treturn 0;\r\n\t\t};\r\n\r\n\t\ttermsTree.sort( termOrChildIsSelected );\r\n\r\n\t\treturn termsTree;\r\n\t}\r\n\r\n\tsetFilterValue( event ) {\r\n\r\n\t\tconst { availableTermsTree } = this.state;\r\n\t\tconst filterValue = event.target.value;\r\n\t\tconst filteredTermsTree = availableTermsTree.map( this.getFilterMatcher( filterValue ) ).filter( ( term ) => term );\r\n\r\n\t\tconst getResultCount = ( terms ) => {\r\n\t\t\tlet count = 0;\r\n\t\t\tfor ( let i = 0; i < terms.length; i++ ) {\r\n\t\t\t\tcount++;\r\n\t\t\t\tif ( undefined !== terms[ i ].children ) {\r\n\t\t\t\t\tcount += getResultCount( terms[ i ].children );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn count;\r\n\t\t};\r\n\r\n\t\tthis.setState(\r\n\t\t\t{\r\n\t\t\t\tfilterValue,\r\n\t\t\t\tfilteredTermsTree,\r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\tconst resultCount = getResultCount( filteredTermsTree );\r\n\r\n\t\tconst resultsFoundMessage = sprintf(\r\n\t\t\t_n( '%d result found.', '%d results found.', resultCount, 'connections' ),\r\n\t\t\tresultCount\r\n\t\t);\r\n\r\n\t\tthis.props.debouncedSpeak( resultsFoundMessage, 'assertive' );\r\n\t}\r\n\r\n\tgetFilterMatcher( filterValue ) {\r\n\r\n\t\tconst matchTermsForFilter = ( originalTerm ) => {\r\n\r\n\t\t\tif ( '' === filterValue ) {\r\n\t\t\t\treturn originalTerm;\r\n\t\t\t}\r\n\r\n\t\t\t// Shallow clone, because we'll be filtering the term's children and\r\n\t\t\t// don't want to modify the original term.\r\n\t\t\tconst term = { ...originalTerm };\r\n\r\n\t\t\t// Map and filter the children, recursive so we deal with grandchildren\r\n\t\t\t// and any deeper levels.\r\n\t\t\tif ( term.children.length > 0 ) {\r\n\t\t\t\tterm.children = term.children.map( matchTermsForFilter ).filter( ( child ) => child );\r\n\t\t\t}\r\n\r\n\t\t\t// If the term's name contains the filterValue, or it has children\r\n\t\t\t// (i.e. some child matched at some point in the tree) then return it.\r\n\t\t\tif ( -1 !== term.name.toLowerCase().indexOf( filterValue ) || term.children.length > 0 ) {\r\n\t\t\t\treturn term;\r\n\t\t\t}\r\n\r\n\t\t\t// Otherwise, return false. After mapping, the list of terms will need\r\n\t\t\t// to have false values filtered out.\r\n\t\t\treturn false;\r\n\t\t};\r\n\r\n\t\treturn matchTermsForFilter;\r\n\t}\r\n\r\n\trenderTerms( renderedTerms ) {\r\n\r\n\t\tconst { terms = [] } = this.props;\r\n\r\n\t\treturn renderedTerms.map( ( term ) => {\r\n\r\n\t\t\tconst id = `editor-post-taxonomies-hierarchical-term-${ term.id }`;\r\n\r\n\t\t\treturn (\r\n\t\t\t\t
\r\n\r\n\t\t\t\t\t {\r\n\t\t\t\t\t\t\tconst termId = parseInt( term.id, 10 );\r\n\t\t\t\t\t\t\tthis.onChange( termId );\r\n\t\t\t\t\t\t} }\r\n\t\t\t\t\t\tlabel={ unescapeString( term.name ) }\r\n\t\t\t\t\t/>\r\n\t\t\t\t\t{ !! term.children.length && (\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t\t\t{ this.renderTerms( term.children ) }\r\n\t\t\t\t\t\t
\r\n\t\t\t\t\t) }\r\n\r\n\t\t\t\t
\r\n\t\t\t);\r\n\t\t} );\r\n\t}\r\n\r\n\trender() {\r\n\r\n\t\tconst {\r\n\t\t\t taxonomy,\r\n\t\t\t instanceId,\r\n\t\t } = this.props;\r\n\t\tconst {\r\n\t\t\t availableTermsTree,\r\n\t\t\t availableTerms,\r\n\t\t\t filteredTermsTree,\r\n\t\t\t loading,\r\n\t\t\t filterValue\r\n\t\t } = this.state;\r\n\r\n\t\tif ( loading ) {\r\n\t\t\treturn (\r\n\t\t\t\t

\r\n\t\t\t\t\t\r\n\t\t\t\t\t{ __( 'Loading Data', 'connections' ) }\r\n\t\t\t\t

\r\n\t\t\t);\r\n\t\t}\r\n\r\n\t\tconst filterInputId = `editor-post-taxonomies__hierarchical-terms-filter-${ instanceId }`;\r\n\t\tconst filterLabel = sprintf(\r\n\t\t\t_x( 'Search %s', 'term', 'connections' ),\r\n\t\t\tstartCase( taxonomy )\r\n\t\t);\r\n\t\tconst groupLabel = sprintf(\r\n\t\t\t_x( 'Available %s', 'term', 'connections' ),\r\n\t\t\tstartCase( taxonomy )\r\n\t\t);\r\n\t\tconst showFilter = availableTerms.length >= MIN_TERMS_COUNT_FOR_FILTER;\r\n\r\n\t\treturn [\r\n\t\t\tshowFilter && \r\n\t\t\t\t{ filterLabel }\r\n\t\t\t,\r\n\t\t\tshowFilter && ,\r\n\t\t\t\r\n\t\t\t\t{ this.renderTerms( '' !== filterValue ? filteredTermsTree : availableTermsTree ) }\r\n\t\t\t,\r\n\t\t];\r\n\r\n\t}\r\n}\r\n\r\nexport default compose( [\r\n\t// withSelect( ( select, { slug } ) => {\r\n\t// \t// const { getCurrentPost } = select( 'core/editor' );\r\n\t// \t// const { getTaxonomy } = select( 'core' );\r\n\t// \t// const taxonomy = getTaxonomy( slug );\r\n\t// \treturn {\r\n\t// \t\t// hasCreateAction: taxonomy ? get( getCurrentPost(), [ '_links', 'wp:action-create-' + taxonomy.rest_base ], false ) : false,\r\n\t// \t\t// hasAssignAction: taxonomy ? get( getCurrentPost(), [ '_links', 'wp:action-assign-' + taxonomy.rest_base ], false ) : false,\r\n\t// \t\t// terms: select( 'connections-directory/categories' ).getCategories( {per_page: -1} ),\r\n\t// \t\t// terms: [],\r\n\t// \t\t// taxonomy,\r\n\t// \t};\r\n\t// } ),\r\n\t// withDispatch( ( dispatch ) => ( {\r\n\t// \tonUpdateTerms( terms, restBase ) {\r\n\t// \t\tdispatch( 'connections-directory/categories' ).receiveItems( terms );\r\n\t// \t},\r\n\t// } ) ),\r\n\twithSpokenMessages,\r\n\twithInstanceId,\r\n\t// withFilters( 'editor.PostTaxonomyType' ),\r\n] )( HierarchicalTermSelector );\r\n","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nexport default function _objectWithoutProperties(source, excluded) {\n if (source == null) return {};\n var target = objectWithoutPropertiesLoose(source, excluded);\n var key, i;\n\n if (Object.getOwnPropertySymbols) {\n var sourceSymbolKeys = Object.getOwnPropertySymbols(source);\n\n for (i = 0; i < sourceSymbolKeys.length; i++) {\n key = sourceSymbolKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;\n target[key] = source[key];\n }\n }\n\n return target;\n}","export default function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n}","/**\r\n * External dependencies\r\n */\r\nconst { get } = lodash;\r\n\r\n/**\r\n * WordPress dependencies\r\n */\r\nconst { __ } = wp.i18n;\r\nconst { select, withSelect } = wp.data;\r\nconst { Spinner } = wp.components;\r\n\r\n/**\r\n * Internal dependencies\r\n */\r\nconst { TreeSelect } = wp.components;\r\n\r\n// Import components\r\nimport { buildTermsTree } from '../../utils/terms';\r\n\r\nfunction PageSelect( {\r\n\t postType,\r\n\t postTypeMeta,\r\n\t label,\r\n\t value,\r\n\t noOptionLabel,\r\n\t options,\r\n\t onChange,\r\n\t ...props\r\n } ) {\r\n\r\n\tif ( null === options ) {\r\n\t\treturn (\r\n\t\t\t

\r\n\t\t\t\t\r\n\t\t\t\t{ __( 'Loading Data', 'connections' ) }\r\n\t\t\t

\r\n\t\t);\r\n\t}\r\n\r\n\t// const { getPostType } = select( 'core' );\r\n\r\n\t// const postTypeMeta = getPostType( postType );\r\n\tconst isHierarchical = get( postTypeMeta, [ 'hierarchical' ], false );\r\n\tconst pageItems = options || [];\r\n\tlet pagesTree = [];\r\n\r\n\tif ( ! pageItems.length ) {\r\n\r\n\t\treturn null;\r\n\t}\r\n\r\n\tif ( isHierarchical ) {\r\n\r\n\t\tpagesTree = buildTermsTree( pageItems.map( ( item ) => ({\r\n\t\t\tid: item.id,\r\n\t\t\tparent: item.parent,\r\n\t\t\tname: item.title.raw ? item.title.raw : `#${item.id} (${__( 'no title' )})`,\r\n\t\t}) ) );\r\n\r\n\t} else {\r\n\r\n\t\tpagesTree = pageItems.map( ( item ) => ({\r\n\t\t\tid: item.id,\r\n\t\t\tname: item.title.raw ? item.title.raw : `#${item.id} (${__( 'no title' )})`,\r\n\t\t}) );\r\n\t}\r\n\r\n\treturn (\r\n\t\t\r\n\t);\r\n}\r\n\r\nconst applyWithSelect = withSelect( ( select, ownProps ) => {\r\n\r\n\tconst { getEntityRecords, getPostType } = select( 'core' );\r\n\tconst { getCurrentPostId } = select( 'core/editor' );\r\n\r\n\tconst postType = typeof ownProps.postType === 'undefined' ? 'page' : ownProps.postType;\r\n\tconst postTypeMeta = getPostType( postType );\r\n\tconst postId = getCurrentPostId();\r\n\r\n\tconst query = {\r\n\t\tper_page: -1,\r\n\t\texclude: postId,\r\n\t\tparent_exclude: postId,\r\n\t\torderby: 'title',\r\n\t\torder: 'asc',\r\n\t\t_fields: 'id,parent,title',\r\n\t};\r\n\r\n\treturn {\r\n\t\toptions: getEntityRecords( 'postType', postType, query ),\r\n\t\tpostTypeMeta\r\n\t};\r\n} );\r\n\r\n// const renderedSelect = applyWithSelect( PageSelect );\r\n\r\n// export { renderedSelect as PageSelect };\r\nexport default applyWithSelect( PageSelect );\r\n","/**\r\n * External dependencies\r\n */\r\nimport classnames from 'classnames';\r\nconst { isFinite } = lodash;\r\n\r\n/**\r\n * WordPress dependencies\r\n */\r\nconst { __ } = wp.i18n;\r\nconst { withInstanceId } = wp.compose;\r\n\r\n/**\r\n * Internal dependencies\r\n */\r\nconst { BaseControl, Button, Dashicon } = wp.components;\r\n\r\nfunction RangeControl( {\r\n\t className,\r\n\t label,\r\n\t value,\r\n\t instanceId,\r\n\t onChange,\r\n\t beforeIcon,\r\n\t afterIcon,\r\n\t help,\r\n\t allowReset,\r\n\t initialPosition,\r\n\t ...props\r\n } ) {\r\n\tconst id = `inspector-range-control-${ instanceId }`;\r\n\tconst resetValue = () => onChange();\r\n\tconst onChangeValue = ( event ) => {\r\n\t\tconst newValue = event.target.value;\r\n\t\tif ( newValue === '' ) {\r\n\t\t\tresetValue();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tonChange( Number( newValue ) );\r\n\t};\r\n\tconst initialSliderValue = isFinite( value ) ? value : initialPosition || '';\r\n\r\n\treturn (\r\n\t\t\r\n\t\t\t{ beforeIcon && }\r\n\t\t\t\r\n\t\t\t{ afterIcon && }\r\n\t\t\t\r\n\t\t\t{ allowReset &&\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t);\r\n}\r\n\r\n// const asInstance = withInstanceId( RangeControl );\r\n\r\n// export { asInstance as RangeControl };\r\nexport default withInstanceId( RangeControl );\r\n","/**\r\n * WordPress dependencies\r\n */\r\nconst { Component, Fragment } = wp.element;\r\nconst { decodeEntities } = wp.htmlEntities;\r\n\r\nclass EntryName extends Component {\r\n\r\n\trender() {\r\n\r\n\t\tconst { asPermalink = false, attributes, entry, tag } = this.props;\r\n\t\tconst Tag = tag;\r\n\r\n\t\tlet name = decodeEntities( entry.fn.rendered );\r\n\r\n\t\tif ( asPermalink ) {\r\n\r\n\t\t\tname = {name}\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t{name}\r\n\t\t)\r\n\t}\r\n}\r\n\r\nexport default EntryName;\r\n","/**\r\n * WordPress dependencies\r\n */\r\nconst { Component, Fragment } = wp.element;\r\nconst { decodeEntities } = wp.htmlEntities;\r\n\r\n/**\r\n * External dependencies\r\n */\r\nimport { cloneDeep, findIndex, has, isUndefined } from 'lodash';\r\n\r\nclass EntryTitle extends Component {\r\n\r\n\trender() {\r\n\r\n\t\tconst { entry } = this.props;\r\n\r\n\t\tif ( isUndefined( entry.job_title ) || 1 > entry.job_title.rendered.length ) return null;\r\n\r\n\t\treturn (\r\n\t\t\t
{ decodeEntities( entry.job_title.rendered ) }
\r\n\t\t)\r\n\t}\r\n}\r\n\r\nexport default EntryTitle;\r\n","/**\r\n * WordPress dependencies\r\n */\r\nconst { Component } = wp.element;\r\nconst { decodeEntities } = wp.htmlEntities;\r\nconst { __, _n, _nx, _x, sprintf } = wp.i18n;\r\n\r\n/**\r\n * External dependencies\r\n */\r\nimport { has } from 'lodash';\r\n\r\nclass EntryImage extends Component {\r\n\r\n\trender() {\r\n\r\n\t\tconst {\r\n\t\t\t entry,\r\n\t\t\t size,\r\n\t\t\t type,\r\n\t\t\t usePlaceholder = false,\r\n\t\t\t placeholderWidth = 600, // This should be set the width fetched via the REST API.\r\n\t\t\t placeholderHeight = 520, // This should be set the height fetched via the REST API.\r\n\t\t } = this.props;\r\n\r\n\t\tif ( has( entry.images, [ type, size ] ) ) {\r\n\r\n\t\t\tconst {\r\n\t\t\t\theight,\r\n\t\t\t\turl,\r\n\t\t\t\twidth,\r\n\t\t\t} = entry.images[ type ][ size ];\r\n\r\n\t\t\treturn (\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t)\r\n\r\n\t\t} else if ( true === usePlaceholder ) {\r\n\r\n\t\t\tlet style = {\r\n\t\t\t\tdisplay: 'inline-block',\r\n\t\t\t\tpaddingBottom: `calc(${placeholderHeight} / ${placeholderWidth} * 100%)`,\r\n\t\t\t\twidth: placeholderWidth + 'px',\r\n\t\t\t}\r\n\r\n\t\t\treturn (\r\n\t\t\t\t\r\n\t\t\t\t\t{ __( 'No Image Available', 'connections' ) }\r\n\t\t\t\t\r\n\t\t\t)\r\n\r\n\t\t} else {\r\n\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}\r\n}\r\n\r\nexport default EntryImage;\r\n","/**\r\n * WordPress dependencies\r\n */\r\nconst { Component } = wp.element;\r\n// const { decodeEntities } = wp.htmlEntities;\r\n\r\n/**\r\n * External dependencies\r\n */\r\nimport { cloneDeep, findIndex, has, isUndefined } from 'lodash';\r\n\r\nclass EntryPhoneNumbers extends Component {\r\n\r\n\trender() {\r\n\r\n\t\tconst { entry, preferred = false } = this.props;\r\n\r\n\t\tif ( isUndefined( entry.tel ) || 0 === entry.tel.length ) return null;\r\n\r\n\t\tlet numbers = entry.tel\r\n\t\t\t.filter( ( phone ) => {\r\n\r\n\t\t\t\treturn preferred === phone.preferred || false === preferred;\r\n\t\t\t} )\r\n\t\t\t.map( ( phone ) => {\r\n\r\n\t\t\treturn (\r\n\t\t\t\t
{ phone.number.rendered }
\r\n\t\t\t)\r\n\t\t} );\r\n\r\n\t\tif ( 0 === numbers.length ) {\r\n\r\n\t\t\tnumbers =
{ entry.tel[0].number.rendered }
\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t
{ numbers }
\r\n\t\t)\r\n\t}\r\n}\r\n\r\nexport default EntryPhoneNumbers;\r\n","/**\r\n * WordPress dependencies\r\n */\r\nconst { Component } = wp.element;\r\n// const { decodeEntities } = wp.htmlEntities;\r\n\r\n/**\r\n * External dependencies\r\n */\r\nimport { cloneDeep, findIndex, has, isUndefined } from 'lodash';\r\n\r\nclass EntryEmail extends Component {\r\n\r\n\trender() {\r\n\r\n\t\tconst { entry, preferred = false } = this.props;\r\n\r\n\t\tif ( isUndefined( entry.email ) || 0 === entry.email.length ) return null;\r\n\r\n\t\tlet addresses = entry.email\r\n\t\t\t.filter( ( email ) => {\r\n\r\n\t\t\t\treturn preferred === email.preferred || false === preferred;\r\n\t\t\t} )\r\n\t\t\t.map( ( email ) => {\r\n\r\n\t\t\t\treturn (\r\n\t\t\t\t\t
{ email.address.rendered }
\r\n\t\t\t\t)\r\n\t\t\t} );\r\n\r\n\t\tif ( 0 === addresses.length ) {\r\n\r\n\t\t\taddresses =
{ entry.email[0].address.rendered }
\r\n\t\t}\r\n\r\n\t\treturn (\r\n\t\t\t
{ addresses }
\r\n\t\t)\r\n\t}\r\n}\r\n\r\nexport default EntryEmail;\r\n","/**\r\n * WordPress dependencies\r\n */\r\nconst { Component } = wp.element;\r\n// const { decodeEntities } = wp.htmlEntities;\r\n\r\n/**\r\n * External dependencies\r\n */\r\nimport { cloneDeep, findIndex, has, isUndefined } from 'lodash';\r\n\r\n/**\r\n * Internal dependencies\r\n */\r\nimport {\r\n\tSocialNetworkIcon,\r\n} from \"@Connections-Directory/components\";\r\n\r\nclass EntrySocialNetworks extends Component {\r\n\r\n\trender() {\r\n\r\n\t\tconst { entry } = this.props;\r\n\r\n\t\tif ( isUndefined( entry.social ) || 0 === entry.social.length ) return null;\r\n\r\n\t\tlet networks = entry.social.map( ( network ) => {\r\n\r\n\t\t\treturn (\r\n\t\t\t\t\r\n\t\t\t)\r\n\t\t} );\r\n\r\n\t\treturn (\r\n\t\t\t{ networks }\r\n\t\t)\r\n\t}\r\n}\r\n\r\nexport default EntrySocialNetworks;\r\n","/**\r\n * WordPress dependencies\r\n */\r\nconst { Component } = wp.element;\r\nconst { decodeEntities } = wp.htmlEntities;\r\n\r\n/**\r\n * External dependencies\r\n */\r\nimport { cloneDeep, findIndex, has, isUndefined } from 'lodash';\r\n\r\nclass EntryExcerpt extends Component {\r\n\r\n\trender() {\r\n\r\n\t\tconst { entry } = this.props;\r\n\r\n\t\tif ( isUndefined( entry.excerpt ) || 1 > entry.excerpt.rendered.length ) return null;\r\n\r\n\t\treturn (\r\n\t\t\t
\r\n\t\t)\r\n\t}\r\n}\r\n\r\nexport default EntryExcerpt;\r\n","/**\r\n * WordPress dependencies\r\n */\r\nconst { Component } = wp.element;\r\n// const { decodeEntities } = wp.htmlEntities;\r\n\r\nclass SocialNetworkIcon extends Component {\r\n\r\n\trender() {\r\n\r\n\t\tconst { network, size } = this.props;\r\n\r\n\t\tconst classes = [\r\n\t\t\t`cn-brandicon-${network.slug}`,\r\n\t\t\t`cn-brandicon-size-${size}`,\r\n\t\t];\r\n\r\n\t\treturn (\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t)\r\n\t}\r\n}\r\n\r\nexport default SocialNetworkIcon;\r\n","/**\r\n * WordPress dependencies\r\n */\r\nconst { __, _n, _nx, _x } = wp.i18n;\r\nconst { apiFetch } = wp;\r\nconst {\r\n\t Spinner,\r\n } = wp.components;\r\nconst { Component, Fragment, render } = wp.element;\r\nconst { addQueryArgs } = wp.url;\r\n\r\n/**\r\n * Internal dependencies\r\n */\r\nimport {\r\n\tEntryImage,\r\n\tEntryName, EntryTitle,\r\n} from \"@Connections-Directory/components\";\r\n\r\nconst ENDPOINT = '/cn-api/v1/recently_viewed/';\r\n\r\nclass RecentlyViewed extends Component {\r\n\r\n\t/**\r\n\t * Constructor for the Carousel Component.\r\n\t *\r\n\t * Sets up state, and creates bindings for functions.\r\n\t *\r\n\t * @param {object} props Component properties.\r\n\t */\r\n\tconstructor( props ) {\r\n\r\n\t\tsuper( props );\r\n\r\n\t\tthis.prepareQueryArgs = this.prepareQueryArgs.bind( this );\r\n\t\tthis.fetchAPI = this.fetchAPI.bind( this );\r\n\t\tthis.fetchEntries = this.fetchEntries.bind( this );\r\n\r\n\t\tthis.state = {\r\n\t\t\tqueryResults: [],\r\n\t\t\tisLoading: true,\r\n\t\t};\r\n\t}\r\n\r\n\tcomponentDidMount() {\r\n\t\t// console.log( this.props.name, ': componentDidMount()' );\r\n\t\t// console.log( getRecentlyViewed() );\r\n\r\n\t\t// const args = {\r\n\t\t// \trecent: getRecentlyViewed(),\r\n\t\t// }\r\n\r\n\t\tthis.fetchEntries();\r\n\t}\r\n\r\n\t/**\r\n\t * @param {object} args\r\n\t */\r\n\tprepareQueryArgs( args ) {\r\n\r\n\t\tlet query = {};\r\n\r\n\t\t// console.log( query );\r\n\t\t// console.log( this.props );\r\n\r\n\t\tquery['exclude'] = this.props.exclude;\r\n\r\n\t\tquery['_images'] = [\r\n\t\t\t{ type: 'logo', size: 'custom', width: 600, height: 520, zc: 2 },\r\n\t\t\t{ type: 'photo', size: 'custom', width: 600, height: 520, zc: 2 }\r\n\t\t];\r\n\r\n\t\tquery['per_page'] = this.props.limit;\r\n\r\n\t\tquery['_fields'] = 'type,fn.rendered,job_title.rendered,phone,email,social,excerpt.rendered,images,link';\r\n\r\n\t\tquery = { ...query, ...args };\r\n\r\n\t\treturn query;\r\n\t}\r\n\r\n\tfetchAPI( query ) {\r\n\r\n\t\tconst path = addQueryArgs(\r\n\t\t\tENDPOINT,\r\n\t\t\t{\r\n\t\t\t\t...query,\r\n\t\t\t\tcontext: 'view',\r\n\t\t\t}\r\n\t\t);\r\n\r\n\t\t// console.log( 'Fetching... ', query );\r\n\r\n\t\treturn apiFetch( { path: path } );\r\n\t}\r\n\r\n\t/**\r\n\t * @param {object} args\r\n\t */\r\n\tfetchEntries( args = {} ) {\r\n\r\n\t\tthis.fetchAPI( this.prepareQueryArgs( args ) ).then( ( results ) => {\r\n\r\n\t\t\tthis.setState( { isLoading: false, queryResults: results } );\r\n\t\t} );\r\n\t};\r\n\r\n\trender() {\r\n\r\n\t\tlet entries = this.state.queryResults;\r\n\r\n\t\tconst hasEntries = Array.isArray( entries ) && entries.length;\r\n\r\n\t\t// console.log( this.props );\r\n\r\n\t\tif ( !hasEntries ) {\r\n\r\n\t\t\treturn (\r\n\t\t\t\t\r\n\t\t\t\t\t
\r\n\t\t\t\t\t\t{ this.state.isLoading ?\r\n\t\t\t\t\t\t\t

{ __( 'Loading...', 'connections' ) }

:\r\n\t\t\t\t\t\t\t

{ __( 'No recently viewed directory entries.', 'connections' ) }

\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t
\r\n\t\t\t\t
\r\n\t\t\t)\r\n\r\n\t\t} else {\r\n\r\n\t\t\tconst items = entries\r\n\t\t\t\t// No need to display the Entry currently being viewed.\r\n\t\t\t\t.filter( ( entry ) => document.URL !== entry.link )\r\n\t\t\t\t// Render the Entry name as a permalink within `li` tags.\r\n\t\t\t\t.map( ( entry, i ) => {\r\n\t\t\t\t\t// console.log( entry );\r\n\r\n\t\t\t\t\treturn (\r\n\t\t\t\t\t\t
  • \r\n\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t
    \r\n\t\t\t\t\t\t
  • \r\n\t\t\t\t\t\t)\r\n\t\t\t\t} );\r\n\r\n\t\t\treturn (
      {items}
    );\r\n\t\t}\r\n\r\n\t};\r\n}\r\n\r\nconst recentlyViewed = document.querySelectorAll( '.cn-recently-viewed' );\r\n\r\nrecentlyViewed.forEach( instance => {\r\n\r\n\tlet limit = instance.getAttribute( 'data-limit' );\r\n\tlet exclude = instance.getAttribute( 'data-exclude' );\r\n\r\n\trender( , instance );\r\n} );\r\n"],"sourceRoot":""}