[{"id":"04b71c55-8bd3-415e-86ba-b81a040db2e9","key":"04b71c55-8bd3-415e-86ba-b81a040db2e9","value":{"rev":"9-3c8298d9d54d73a91eebf116445be1fb"},"doc":{"name":"Kronk!","_id":"04b71c55-8bd3-415e-86ba-b81a040db2e9","_rev":"9-3c8298d9d54d73a91eebf116445be1fb"}},{"id":"1f5d9520-5127-4795-9985-8c061c5b9a84","key":"1f5d9520-5127-4795-9985-8c061c5b9a84","value":{"rev":"314-e21f2b772cb3ceeed8acae5ea52f36ff"},"doc":{"type":"window","desktop":"secondary","caption":"New Window","component":"","text":"Specify what component to load, by filling-in the component property... This window is meant for secondary desktop!!!!!","x":948,"y":30,"w":706,"h":598,"zIndex":1215,"_id":"1f5d9520-5127-4795-9985-8c061c5b9a84","_rev":"314-e21f2b772cb3ceeed8acae5ea52f36ff"}},{"id":"35b879ea-baab-4c60-9f1e-594513cd6baa","key":"35b879ea-baab-4c60-9f1e-594513cd6baa","value":{"rev":"68-48439dedb92c1f82e3a02f56efd5e5ff"},"doc":{"name":"Dr. Meow, PhD","type":"user","_id":"35b879ea-baab-4c60-9f1e-594513cd6baa","_rev":"68-48439dedb92c1f82e3a02f56efd5e5ff"}},{"id":"546c270e-a2a5-4ff0-a416-5ae9ac6810e3","key":"546c270e-a2a5-4ff0-a416-5ae9ac6810e3","value":{"rev":"32-fdc1dcc28150d6cea6ced9b98cf4377e"},"doc":{"user":"Eleanor","name":"Wonderland","type":"project","root":"b1","_id":"546c270e-a2a5-4ff0-a416-5ae9ac6810e3","_rev":"32-fdc1dcc28150d6cea6ced9b98cf4377e"}},{"id":"5f5dcddc-6d19-4530-ad7e-c9b1d14b7852","key":"5f5dcddc-6d19-4530-ad7e-c9b1d14b7852","value":{"rev":"1-ffb5411dbcf82ca545eb99899ec1ba89"},"doc":{"name":"Gork","type":"user","_id":"5f5dcddc-6d19-4530-ad7e-c9b1d14b7852","_rev":"1-ffb5411dbcf82ca545eb99899ec1ba89"}},{"id":"_design/dashboards","key":"_design/dashboards","value":{"rev":"6-6311c90d0b20bf9a65e65a16e3dc22df"},"doc":{"views":{"cards":{"map":"({type, dash, _id}) => {\n  emit([type, dash], _id);\n};"},"dashboards":{"map":"({type, _id}) => {\n  emit(type, _id);\n};"}},"filters":{},"_id":"_design/dashboards","_rev":"6-6311c90d0b20bf9a65e65a16e3dc22df"}},{"id":"_design/desktops","key":"_design/desktops","value":{"rev":"3-f64aed3576f992bbe667a55b0d7cec90"},"doc":{"views":{"desktops":{"map":"({type, _id}) => {\n  emit(type, _id);\n};"},"windows":{"map":"({type, desktop, _id}) => {\n  emit([type, desktop], _id);\n};"}},"filters":{},"_id":"_design/desktops","_rev":"3-f64aed3576f992bbe667a55b0d7cec90"}},{"id":"_design/favorites","key":"_design/favorites","value":{"rev":"63-d7f169a2b4671fa1b0419d17c92cdf86"},"doc":{"views":{"by_name":{"map":"({_id, name, favorite, type}) => {\n  //console.log('_design/favorites/views/by_name reindexed', _id, favorite);\n\n  // \"If this is a record that matches the format, or having a favorite.\"\n  if(favorite){ // checked later\n    emit(favorite, {label: name});  \n  }\n};"}},"filters":{},"_id":"_design/favorites","_rev":"63-d7f169a2b4671fa1b0419d17c92cdf86"}},{"id":"_design/fled_fast","key":"_design/fled_fast","value":{"rev":"17-73819cfb286576c821f7812222256411"},"doc":{"views":{"by_name":{"map":"({name}) => {\n  emit(name, {label: name});\n};"},"by_type":{"map":"({type, name}) => {\n  emit(type, {label: name});\n};"}},"filters":{"by_type":"function filter(doc, req) {\n  return doc.type === req.query.type;\n}"},"_id":"_design/fled_fast","_rev":"17-73819cfb286576c821f7812222256411"}},{"id":"_design/idx-9f998e909a8b05cd330408eb0598d4fe","key":"_design/idx-9f998e909a8b05cd330408eb0598d4fe","value":{"rev":"1-d0fe12eb838e2dd5c6361a6e7ea4cf9b"},"doc":{"language":"query","views":{"idx-9f998e909a8b05cd330408eb0598d4fe":{"map":{"fields":{"type":"asc","user":"asc"}},"reduce":"_count","options":{"def":{"fields":["type","user"]}}}},"_id":"_design/idx-9f998e909a8b05cd330408eb0598d4fe","_rev":"1-d0fe12eb838e2dd5c6361a6e7ea4cf9b"}},{"id":"_design/layouts","key":"_design/layouts","value":{"rev":"5-6f902cbeb9f17e7bb000381b7d266175"},"doc":{"views":{"application_layouts":{"map":"({ type, name }) => {\n  emit(type, { label: name });\n};"}},"filters":{},"_id":"_design/layouts","_rev":"5-6f902cbeb9f17e7bb000381b7d266175"}},{"id":"_design/windows","key":"_design/windows","value":{"rev":"9-9f4e85f8fe920a085b1413d2c8f10b64"},"doc":{"views":{"windows":{"map":"({type, _id}) => {\n  emit(type, _id);\n};"},"controls":{"map":"({type, window, _id}) => {\n  emit([type, window], _id);\n};"}},"filters":{},"_id":"_design/windows","_rev":"9-9f4e85f8fe920a085b1413d2c8f10b64"}},{"id":"a","key":"a","value":{"rev":"21-f72dd46b0046953dd6d789245bbb46a4"},"doc":{"name":"Load Sounds","favorite":"yes","_id":"a","_rev":"21-f72dd46b0046953dd6d789245bbb46a4"}},{"id":"b","key":"b","value":{"rev":"15-a4c8e333db556b708587f9c11360a90f"},"doc":{"type":"node","name":"Main Player","body":"// Setup Player!!!!\nconst ${_.camelCase(name)} = new Tone.Player({\n url: '${url}',\n loop: ${loop},\n autostart: ${autostart},\n});","properties":{"url":{"type":"string"},"loop":{"type":"boolean"},"autostart":{"type":"boolean"}},"url":{"value":"https://tonejs.github.io/audio/drum-samples/loops/ominous.mp3"},"autostart":true,"favorite":"yes","_id":"b","_rev":"15-a4c8e333db556b708587f9c11360a90f"}},{"id":"b1","key":"b1","value":{"rev":"141-9043fd4a49d69b38661695b9eaf89f82"},"doc":{"type":"node","name":"Filter","body":"export class Document {\n  _id;\n  options;\n  value;\n  debug;\n\n  constructor(db, id, options = {}) {\n    this.debug = options.debug;\n    this.db = db;\n    this._id = id;\n    this.options = options;\n    this.value = {};\n    console.log('ccCCCCCCCCC', this.debug);\n  }\n\n  #subscribers = [];\n\n  // A store must contain a .subscribe method, which must accept as its argument a subscription function.\n\n  subscribe(subscriptionFunction) {\n    // This subscription function must be immediately and synchronously called with the store's current value upon calling .subscribe\n    subscriptionFunction(this.value);\n\n    // All of a store's active subscription functions must later be synchronously called whenever the store's value changes.\n\n    const isFirstSubscription = this.#subscribers.length == 0;\n    if (isFirstSubscription) this.connect(); // connect will be called when the number of subscribers goes from zero to one (but not from one to two, etc).\n    this.#subscribers.push(subscriptionFunction);\n    console.log('Document Listener Subscribed');\n\n    this.log(\n      `_id:${this._id}: new subscriber, there are now a total of ${\n        this.#subscribers.length\n      } subscribers.`,\n    );\n\n    //The .subscribe method must return an unsubscribe function.\n    // Calling an unsubscribe function must stop its subscription,\n    // and its corresponding subscription function must not be called again by the store.\n    return () => {\n      console.log('Document Listener Unsubscribed');\n      this.#subscribers.splice(\n        this.#subscribers.indexOf(subscriptionFunction),\n        1,\n      );\n      const isLastSubscription = this.#subscribers.length == 0;\n      if (isLastSubscription) this.disconnect();\n    };\n  }\n\n  set(value) {\n    // A store may optionally contain a .set method,\n    /// which must accept as its argument a new value for the store,\n    // and which synchronously calls all of the store's active subscription functions. Such a store is called a writable store.\n    this.value = value;\n    this.#subscribers.map((subscriber) => subscriber(this.value));\n  }\n\n  //update is a method that takes one argument which is a callback.\n  update(callback) {\n    // The callback takes the existing store value as its argument\n    // and returns the new value to be set to the store.\n    this.set(callback(this.value));\n  }\n\n  #changes;\n\n  reconnect() {\n    this.log(`_id:${this._id}: reconnecting to _id: ${this._id}`);\n    this.disconnect();\n    this.connect();\n  }\n\n  get id() {\n    return this._id;\n  }\n\n  set id(value) {\n    if (this._id === value) return; // nothing to do.\n    this.log(`_id:${this._id}: setting new id (${value}) and reconnecting`);\n    this._id = value;\n    this.reconnect();\n  }\n\n  connect() {\n    if (!this._id) return this.set({});\n    this.log(`_id:${this._id}: connecting...`);\n    const doc_ids = [this._id];\n    this.log(\n      `_id:${this._id}: listening to doc_ids: ${JSON.stringify(doc_ids)}`,\n    );\n    this.#changes = this.db.changes({\n      doc_ids,\n      // --- //\n      since: 'now',\n      live: true,\n      include_docs: true,\n    });\n    this.#changes.on('change', (data) => {\n      this.set(data.doc);\n      this.log(`_id:${this._id}: document changed! (Document.js)`);\n    });\n    this.log(`_id:${this._id}: ${this._id} is listening for changes...`);\n    this.db.get(this._id).then((doc) => {\n      this.set(doc);\n      this.log(`_id:${this._id}: initial data has been set`);\n    });\n  }\n\n  disconnect() {\n    this.log(`_id:${this._id}: disconnected`);\n    if (this.#changes) this.#changes.cancel();\n  }\n\n  #log = []; // holds messages\n  log(msg) {\n    if (!this.debug) return;\n    this.#log.push(msg);\n    console.log(msg);\n    this.#spies.map((spy) => spy({msg, log: this.#log}));\n  }\n\n  #spies = []; // holds spies that listen to mesages\n  spy(sub) {\n    this.#spies.push(sub);\n    return () => this.#spies.splice(this.#spies.indexOf(sub), 1);\n  }\n\n  destroy() {\n    this.disconnect();\n  }\n}","properties":{"frequency":{"type":"string"}},"url":"A!ddd","favorite":"no","_id":"b1","_rev":"141-9043fd4a49d69b38661695b9eaf89f82"}},{"id":"card-181","key":"card-181","value":{"rev":"12-2e0b07181e5887c57e00a260db133cb7"},"doc":{"type":"card","dash":"dash-087","name":"Theme Maker!!!!!!","_id":"card-181","_rev":"12-2e0b07181e5887c57e00a260db133cb7"}},{"id":"card-370","key":"card-370","value":{"rev":"12-7e8aab7166a514724d6aebf1edbeeb8f"},"doc":{"type":"card","dash":"dash-911","name":"Polybius","_id":"card-370","_rev":"12-7e8aab7166a514724d6aebf1edbeeb8f"}},{"id":"card-606","key":"card-606","value":{"rev":"5-96c329a0646c8b7f5b78074f387914ce"},"doc":{"type":"card","dash":"dash-911","name":"Beatrice Smith","_id":"card-606","_rev":"5-96c329a0646c8b7f5b78074f387914ce"}},{"id":"card-722","key":"card-722","value":{"rev":"5-b6e557f333f9d51f72d3737205ebcd82"},"doc":{"type":"card","dash":"dash-911","name":"Alice Smith","_id":"card-722","_rev":"5-b6e557f333f9d51f72d3737205ebcd82"}},{"id":"card-834","key":"card-834","value":{"rev":"8-eecf85de4a7c17abb87280a65aa5fdbf"},"doc":{"type":"card","dash":"dash-087","name":"Mr. Mxyzptlk","_id":"card-834","_rev":"8-eecf85de4a7c17abb87280a65aa5fdbf"}},{"id":"dash-087","key":"dash-087","value":{"rev":"2689-1d1f448ad761f47d2b07be53e1e3f3fe"},"doc":{"type":"window","caption":"My Happy Little Window!","text":"Everything Is A Document + Virtual Desktops + Desktop Panning + App Store + PouchDB Export <3","w":602,"h":415,"zIndex":1,"desktop":"primary","y":85,"x":24,"sid":0,"_id":"dash-087","_rev":"2689-1d1f448ad761f47d2b07be53e1e3f3fe"}},{"id":"dash-911","key":"dash-911","value":{"rev":"7-9e9d745ec043a0b95ae1fac44da08520"},"doc":{"type":"dash","name":"Quatrain Editor","favorite":"yes","_id":"dash-911","_rev":"7-9e9d745ec043a0b95ae1fac44da08520"}},{"id":"desktops-window","key":"desktops-window","value":{"rev":"2774-465e54f8866e7f75198fc7daf95e3532"},"doc":{"caption":"All Desktops","component":"PropertyQueue","w":227,"h":370,"zIndex":0,"type":"window","desktop":"primary","y":72,"x":885,"sid":0,"_id":"desktops-window","_rev":"2774-465e54f8866e7f75198fc7daf95e3532"}},{"id":"eb72f442-89c7-4036-a8a8-769ba6e34229","key":"eb72f442-89c7-4036-a8a8-769ba6e34229","value":{"rev":"11-fb5cf0150be7192007feda5c53316071"},"doc":{"name":"Dr. Thunderpussy","favorite":"1","_id":"eb72f442-89c7-4036-a8a8-769ba6e34229","_rev":"11-fb5cf0150be7192007feda5c53316071"}},{"id":"guid-172e2e86-1fe1-487b-aeb5-d48a64f59b6a","key":"guid-172e2e86-1fe1-487b-aeb5-d48a64f59b6a","value":{"rev":"1-451e44190019f9eeb2c4be898b816fd1"},"doc":{"title":"README.md","_id":"guid-172e2e86-1fe1-487b-aeb5-d48a64f59b6a","_rev":"1-451e44190019f9eeb2c4be898b816fd1"}},{"id":"guid-9073214c-7ac1-428b-9578-d5e7f6c2964c","key":"guid-9073214c-7ac1-428b-9578-d5e7f6c2964c","value":{"rev":"1-e5f1f99255300ac545513af153d51da0"},"doc":{"title":"Victorious Cabbage","_id":"guid-9073214c-7ac1-428b-9578-d5e7f6c2964c","_rev":"1-e5f1f99255300ac545513af153d51da0"}},{"id":"guid-96fcfeeb-0a76-4d2f-8859-a0181ff709fc","key":"guid-96fcfeeb-0a76-4d2f-8859-a0181ff709fc","value":{"rev":"1-737c191f8d234e3f3e6f19d885647786"},"doc":{"title":"Wonderland","sol":{"earth":{"usa":{"michigan":{"westland":""}}}},"_id":"guid-96fcfeeb-0a76-4d2f-8859-a0181ff709fc","_rev":"1-737c191f8d234e3f3e6f19d885647786"}},{"id":"guid-meow","key":"guid-meow","value":{"rev":"3-b156816934b5716f60199f28817d7579"},"doc":{"title":"Wow! wow! wow!","_id":"guid-meow","_rev":"3-b156816934b5716f60199f28817d7579"}},{"id":"manager_window","key":"manager_window","value":{"rev":"2748-d7de3df889af71898bf6f535bf1c9c9e"},"doc":{"caption":"Manager","component":"Manager","w":1080,"h":595,"zIndex":2,"type":"window","desktop":"primary","y":370,"x":-1234,"sid":0,"_id":"manager_window","_rev":"2748-d7de3df889af71898bf6f535bf1c9c9e"}},{"id":"primary","key":"primary","value":{"rev":"1-8d24b27f684f682b3412c56692c67fc5"},"doc":{"type":"desktop","caption":"Primary Desktop","_id":"primary","_rev":"1-8d24b27f684f682b3412c56692c67fc5"}},{"id":"secondary","key":"secondary","value":{"rev":"1-93ab7656036737104791713dad58be41"},"doc":{"type":"desktop","caption":"Secondary Desktop","_id":"secondary","_rev":"1-93ab7656036737104791713dad58be41"}},{"id":"secret-garden","key":"secret-garden","value":{"rev":"23-2e4f8fd4c7374716b650fab3f933dc25"},"doc":{"title":"Mighty Woot!","ninja":{"world":{"zoo":{"garden":{"cat":"Meow","dog":"Bork!"}}}},"dash":"dash-911","type":"card","name":"Jane","_id":"secret-garden","_rev":"23-2e4f8fd4c7374716b650fab3f933dc25"}}]
