diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml deleted file mode 100644 index e10da5e..0000000 --- a/.github/workflows/npmpublish.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Publish npm Package - -on: - release: - types: [created] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: 12 - - run: npm ci - - run: npm test - - publish-npm: - needs: build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - uses: actions/setup-node@v1 - with: - node-version: 12 - registry-url: https://registry.npmjs.org/ - - run: npm ci - - run: npm publish --access public - env: - NODE_AUTH_TOKEN: ${{secrets.npm_token}} diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 496df0a..0000000 --- a/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules/ -dist/ -yarn.lock -package-lock.json diff --git a/.npmignore b/.npmignore deleted file mode 100644 index a546c54..0000000 --- a/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -yarn.lock -package-lock.json diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index b1c5343..0000000 --- a/.prettierrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "semi": false, - "endOfLine": "lf", - "singleQuote": true, - "tabWidth": 2, - "trailingComma": "es5" -} diff --git a/asset-manifest.json b/asset-manifest.json new file mode 100644 index 0000000..1b58c7a --- /dev/null +++ b/asset-manifest.json @@ -0,0 +1,24 @@ +{ + "files": { + "main.css": "/react-org-chart/static/css/main.6060b8e6.chunk.css", + "main.js": "/react-org-chart/static/js/main.8a6eafd3.chunk.js", + "main.js.map": "/react-org-chart/static/js/main.8a6eafd3.chunk.js.map", + "runtime-main.js": "/react-org-chart/static/js/runtime-main.d9ba5a7a.js", + "runtime-main.js.map": "/react-org-chart/static/js/runtime-main.d9ba5a7a.js.map", + "static/js/2.748d1f8b.chunk.js": "/react-org-chart/static/js/2.748d1f8b.chunk.js", + "static/js/2.748d1f8b.chunk.js.map": "/react-org-chart/static/js/2.748d1f8b.chunk.js.map", + "index.html": "/react-org-chart/index.html", + "precache-manifest.6835890c922728daf964b5781076887e.js": "/react-org-chart/precache-manifest.6835890c922728daf964b5781076887e.js", + "service-worker.js": "/react-org-chart/service-worker.js", + "static/css/main.6060b8e6.chunk.css.map": "/react-org-chart/static/css/main.6060b8e6.chunk.css.map", + "static/js/2.748d1f8b.chunk.js.LICENSE.txt": "/react-org-chart/static/js/2.748d1f8b.chunk.js.LICENSE.txt", + "static/js/main.8a6eafd3.chunk.js.LICENSE.txt": "/react-org-chart/static/js/main.8a6eafd3.chunk.js.LICENSE.txt", + "static/media/avatar-personnel.svg": "/react-org-chart/static/media/avatar-personnel.f8399445.svg" + }, + "entrypoints": [ + "static/js/runtime-main.d9ba5a7a.js", + "static/js/2.748d1f8b.chunk.js", + "static/css/main.6060b8e6.chunk.css", + "static/js/main.8a6eafd3.chunk.js" + ] +} \ No newline at end of file diff --git a/examples/.env b/examples/.env deleted file mode 100644 index 7d910f1..0000000 --- a/examples/.env +++ /dev/null @@ -1 +0,0 @@ -SKIP_PREFLIGHT_CHECK=true \ No newline at end of file diff --git a/examples/.gitignore b/examples/.gitignore deleted file mode 100644 index 4d29575..0000000 --- a/examples/.gitignore +++ /dev/null @@ -1,23 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* diff --git a/examples/README.md b/examples/README.md deleted file mode 100644 index 89b278a..0000000 --- a/examples/README.md +++ /dev/null @@ -1,68 +0,0 @@ -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). - -## Available Scripts - -In the project directory, you can run: - -### `yarn start` - -Runs the app in the development mode.
-Open [http://localhost:3000](http://localhost:3000) to view it in the browser. - -The page will reload if you make edits.
-You will also see any lint errors in the console. - -### `yarn test` - -Launches the test runner in the interactive watch mode.
-See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. - -### `yarn build` - -Builds the app for production to the `build` folder.
-It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.
-Your app is ready to be deployed! - -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. - -### `yarn eject` - -**Note: this is a one-way operation. Once you `eject`, you can’t go back!** - -If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. - -Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. - -You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. - -## Learn More - -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). - -To learn React, check out the [React documentation](https://reactjs.org/). - -### Code Splitting - -This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting - -### Analyzing the Bundle Size - -This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size - -### Making a Progressive Web App - -This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app - -### Advanced Configuration - -This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration - -### Deployment - -This section has moved here: https://facebook.github.io/create-react-app/docs/deployment - -### `yarn build` fails to minify - -This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify diff --git a/examples/package.json b/examples/package.json deleted file mode 100644 index c65c139..0000000 --- a/examples/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "org-chart-example", - "version": "0.1.0", - "private": true, - "dependencies": { - "@unicef/react-org-chart": "file:..", - "gh-pages": "^2.2.0", - "react": "^16.12.0", - "react-d3": "^0.4.0", - "react-dom": "^16.12.0", - "react-router-dom": "^5.1.2", - "react-scripts": "^3.3.0" - }, - "homepage": "https://unicef.github.io/react-org-chart", - "repository": { - "type": "git", - "url": "git+https://github.com/unicef/react-org-chart.git" - }, - "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "predeploy": "npm run build", - "deploy": "gh-pages -d build", - "test": "react-scripts test", - "eject": "react-scripts eject" - }, - "eslintConfig": { - "extends": "react-app" - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - } -} diff --git a/examples/public/index.html b/examples/public/index.html deleted file mode 100644 index c240d2c..0000000 --- a/examples/public/index.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - React App - - - -
- - - diff --git a/examples/src/App.css b/examples/src/App.css deleted file mode 100644 index e439e59..0000000 --- a/examples/src/App.css +++ /dev/null @@ -1,99 +0,0 @@ -html, -body { - margin: 0; - height: 100%; - width: 100%; - font-size: 12px; - font-family: 'SF UI Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', - Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', - 'Segoe UI Symbol'; - -webkit-font-smoothing: antialiased; -} -#root, -#react-org-chart { - margin: 0; - cursor: move; - height: 100%; - width: 100%; - background-color: #f7f9fa; -} -.org-chart-person-name { - font-weight: 500; -} -.org-chart-person-link:hover g { - fill: #409cf9 !important; -} -.org-chart-node:hover .org-chart-person-reports { - fill: #409cf9 !important; -} -.org-chart-person-dept.engineering { - fill: #4caf50 !important; -} -.org-chart-person-dept.communications { - fill: #3f51b5 !important; -} -.org-chart-person-dept.product { - fill: #d500f9 !important; -} -.org-chart-person-dept.hr { - fill: #2196f3 !important; -} -.org-chart-person-dept.marketing { - fill: #f44336 !important; -} -.org-chart-person-dept.design { - fill: #26c6da !important; -} - -.zoom-buttons { - position: absolute; - top: 0; - left: 0; -} - -.download-buttons { - position: absolute; - top: 0; - right: 0; -} - -.zoom-button { - width: 40px; - height: 40px; - display: block !important; - margin: 8px; -} - -.btn { - font-size: 0.875rem; - text-transform: none; - text-decoration-line: none; - display: inline-block; - font-weight: 600; - text-align: center; - vertical-align: middle; - user-select: none; - padding: 0.5rem 1rem; - font-size: 0.875rem; - line-height: 1.5rem; - border-radius: 0.125rem; - cursor: pointer; - margin: 6px; -} - -.btn-outline-primary { - color: #374ea2; - border-color: #374ea2; -} - -.btn-outline-primary:not(:disabled):not(.disabled):active { - color: #fff; - background-color: #374ea2; - border-color: #374ea2; -} - -.github-link { - font-size: 16px; - margin-left: 8px; - margin-right: 16px; -} diff --git a/examples/src/App.js b/examples/src/App.js deleted file mode 100644 index 773a111..0000000 --- a/examples/src/App.js +++ /dev/null @@ -1,157 +0,0 @@ -import React from 'react' -import './App.css' -import OrgChart from '@unicef/react-org-chart' -import { BrowserRouter, Route } from 'react-router-dom' -import { tree, tree1, tree2, tree3, tree4 } from './Tree' -import avatarPersonnel from './assets/avatar-personnel.svg' - -export default class App extends React.Component { - constructor(props) { - super(props) - - this.state = { - tree: tree, - downloadingChart: false, - config: {}, - highlightPostNumbers: [1], - } - } - - getChild = id => { - switch (id) { - case 100: - return tree1 - case 36: - return tree2 - case 56: - return tree3 - case 25: - return tree4 - default: - return console.log('no children') - } - } - - getParent = d => { - if (d.id === 100) { - return { - id: 500, - person: { - id: 500, - avatar: avatarPersonnel, - department: '', - name: 'Pascal ruth', - title: 'Member', - totalReports: 1, - }, - hasChild: false, - hasParent: true, - children: [d], - } - } else if (d.id === 500) { - return { - id: 1, - person: { - id: 1, - avatar: avatarPersonnel, - department: '', - name: 'Bryce joe', - title: 'Director', - totalReports: 1, - }, - hasChild: false, - hasParent: false, - children: [d], - } - } else { - return d - } - } - - handleDownload = () => { - this.setState({ downloadingChart: false }) - } - - handleOnChangeConfig = config => { - this.setState({ config: config }) - } - - handleLoadConfig = () => { - const { config } = this.state - return config - } - - render() { - const { tree, downloadingChart } = this.state - - //For downloading org chart as image or pdf based on id - const downloadImageId = 'download-image' - const downloadPdfId = 'download-pdf' - - return ( - - - -
- - -
-
- - - - Github - - {downloadingChart &&
Downloading chart
} -
- { - this.handleOnChangeConfig(config) - }} - loadConfig={d => { - let configuration = this.handleLoadConfig(d) - if (configuration) { - return configuration - } - }} - downlowdedOrgChart={d => { - this.handleDownload() - }} - loadImage={d => { - return Promise.resolve(avatarPersonnel) - }} - loadParent={d => { - const parentData = this.getParent(d) - return parentData - }} - loadChildren={d => { - const childrenData = this.getChild(d.id) - return childrenData - }} - /> -
-
-
- ) - } -} diff --git a/examples/src/App.test.js b/examples/src/App.test.js deleted file mode 100644 index a754b20..0000000 --- a/examples/src/App.test.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import App from './App'; - -it('renders without crashing', () => { - const div = document.createElement('div'); - ReactDOM.render(, div); - ReactDOM.unmountComponentAtNode(div); -}); diff --git a/examples/src/Tree.js b/examples/src/Tree.js deleted file mode 100644 index 5113c23..0000000 --- a/examples/src/Tree.js +++ /dev/null @@ -1,214 +0,0 @@ -import avatarPersonnel from './assets/avatar-personnel.svg' - -export const tree = { - id: 100, - person: { - id: 100, - avatar: avatarPersonnel, - department: '', - name: 'Henry monger', - title: 'Manager', - totalReports: 3, - }, - hasChild: true, - hasParent: true, - children: [], -} - -export const tree1 = [ - { - id: 36, - person: { - id: 36, - avatar: avatarPersonnel, - department: '', - name: 'Tomasz polaski', - title: 'IT Specialist', - totalReports: 4, - }, - hasChild: true, - hasParent: true, - // children: [], - }, - { - id: 32, - person: { - id: 32, - avatar: avatarPersonnel, - department: '', - name: 'Emanuel walker', - title: 'IT Specialist', - totalReports: 0, - }, - hasChild: true, - hasParent: true, - children: [], - }, - { - id: 25, - person: { - id: 25, - avatar: avatarPersonnel, - department: '', - name: 'Kerry peter', - title: 'IT Specialist', - totalReports: 3, - }, - hasChild: true, - hasParent: true, - // children: [], - }, -] - -export const tree2 = [ - { - id: 56, - person: { - id: 56, - avatar: avatarPersonnel, - department: '', - name: 'Sam John', - title: 'HR', - totalReports: 2, - link: 'https://github.com/unicef/react-org-chart', - }, - hasChild: true, - hasParent: true, - // children: [], - }, - { - id: 66, - person: { - id: 66, - avatar: avatarPersonnel, - department: '', - name: 'John doe', - title: 'Developer', - totalReports: 0, - link: 'https://github.com/unicef/react-org-chart', - }, - hasChild: true, - hasParent: true, - children: [], - }, - { - id: 76, - person: { - id: 76, - avatar: avatarPersonnel, - department: '', - name: 'Emilia rogers', - title: 'Developer', - totalReports: 0, - link: 'https://github.com/unicef/react-org-chart', - }, - hasChild: true, - hasParent: true, - children: [], - }, - { - id: 60, - person: { - id: 60, - avatar: avatarPersonnel, - department: '', - name: 'Ellen cott', - title: 'IT Officer', - totalReports: 0, - }, - hasChild: false, - hasParent: true, - children: [], - }, -] - -export const tree3 = [ - { - id: 70, - person: { - id: 70, - avatar: avatarPersonnel, - department: '', - name: 'Kenneth dom', - title: 'IT Officer', - totalReports: 0, - }, - hasChild: false, - hasParent: true, - children: [], - }, - { - id: 45, - person: { - id: 45, - avatar: avatarPersonnel, - department: '', - name: 'Kin baker', - title: 'IT Officer', - totalReports: 0, - }, - hasChild: false, - hasParent: true, - children: [], - }, -] - -export const tree4 = [ - { - id: 102, - person: { - id: 102, - avatar: avatarPersonnel, - department: '', - name: 'Hendy kinger', - title: 'Manager', - totalReports: 0, - }, - hasChild: true, - hasParent: true, - children: [], - }, - { - id: 455, - person: { - id: 455, - avatar: avatarPersonnel, - department: '', - name: 'Kate baker', - title: 'IT Officer', - totalReports: 0, - }, - hasChild: false, - hasParent: true, - children: [], - }, - { - id: 444, - person: { - id: 444, - avatar: avatarPersonnel, - department: '', - name: 'John medis', - title: 'IT Officer', - totalReports: 0, - }, - hasChild: false, - hasParent: true, - children: [], - }, - - { - id: 456, - person: { - id: 456, - avatar: avatarPersonnel, - department: '', - name: 'Brett lee', - title: 'IT Officer', - totalReports: 0, - }, - hasChild: false, - hasParent: true, - children: [], - }, -] diff --git a/examples/src/index.css b/examples/src/index.css deleted file mode 100644 index 4a1df4d..0000000 --- a/examples/src/index.css +++ /dev/null @@ -1,13 +0,0 @@ -body { - margin: 0; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", - "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", - sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} - -code { - font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", - monospace; -} diff --git a/examples/src/index.js b/examples/src/index.js deleted file mode 100644 index 87d1be5..0000000 --- a/examples/src/index.js +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import './index.css'; -import App from './App'; -import * as serviceWorker from './serviceWorker'; - -ReactDOM.render(, document.getElementById('root')); - -// If you want your app to work offline and load faster, you can change -// unregister() to register() below. Note this comes with some pitfalls. -// Learn more about service workers: https://bit.ly/CRA-PWA -serviceWorker.unregister(); diff --git a/examples/src/serviceWorker.js b/examples/src/serviceWorker.js deleted file mode 100644 index f8c7e50..0000000 --- a/examples/src/serviceWorker.js +++ /dev/null @@ -1,135 +0,0 @@ -// This optional code is used to register a service worker. -// register() is not called by default. - -// This lets the app load faster on subsequent visits in production, and gives -// it offline capabilities. However, it also means that developers (and users) -// will only see deployed updates on subsequent visits to a page, after all the -// existing tabs open on the page have been closed, since previously cached -// resources are updated in the background. - -// To learn more about the benefits of this model and instructions on how to -// opt-in, read https://bit.ly/CRA-PWA - -const isLocalhost = Boolean( - window.location.hostname === 'localhost' || - // [::1] is the IPv6 localhost address. - window.location.hostname === '[::1]' || - // 127.0.0.1/8 is considered localhost for IPv4. - window.location.hostname.match( - /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/ - ) -); - -export function register(config) { - if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) { - // The URL constructor is available in all browsers that support SW. - const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href); - if (publicUrl.origin !== window.location.origin) { - // Our service worker won't work if PUBLIC_URL is on a different origin - // from what our page is served on. This might happen if a CDN is used to - // serve assets; see https://github.com/facebook/create-react-app/issues/2374 - return; - } - - window.addEventListener('load', () => { - const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; - - if (isLocalhost) { - // This is running on localhost. Let's check if a service worker still exists or not. - checkValidServiceWorker(swUrl, config); - - // Add some additional logging to localhost, pointing developers to the - // service worker/PWA documentation. - navigator.serviceWorker.ready.then(() => { - console.log( - 'This web app is being served cache-first by a service ' + - 'worker. To learn more, visit https://bit.ly/CRA-PWA' - ); - }); - } else { - // Is not localhost. Just register service worker - registerValidSW(swUrl, config); - } - }); - } -} - -function registerValidSW(swUrl, config) { - navigator.serviceWorker - .register(swUrl) - .then(registration => { - registration.onupdatefound = () => { - const installingWorker = registration.installing; - if (installingWorker == null) { - return; - } - installingWorker.onstatechange = () => { - if (installingWorker.state === 'installed') { - if (navigator.serviceWorker.controller) { - // At this point, the updated precached content has been fetched, - // but the previous service worker will still serve the older - // content until all client tabs are closed. - console.log( - 'New content is available and will be used when all ' + - 'tabs for this page are closed. See https://bit.ly/CRA-PWA.' - ); - - // Execute callback - if (config && config.onUpdate) { - config.onUpdate(registration); - } - } else { - // At this point, everything has been precached. - // It's the perfect time to display a - // "Content is cached for offline use." message. - console.log('Content is cached for offline use.'); - - // Execute callback - if (config && config.onSuccess) { - config.onSuccess(registration); - } - } - } - }; - }; - }) - .catch(error => { - console.error('Error during service worker registration:', error); - }); -} - -function checkValidServiceWorker(swUrl, config) { - // Check if the service worker can be found. If it can't reload the page. - fetch(swUrl) - .then(response => { - // Ensure service worker exists, and that we really are getting a JS file. - const contentType = response.headers.get('content-type'); - if ( - response.status === 404 || - (contentType != null && contentType.indexOf('javascript') === -1) - ) { - // No service worker found. Probably a different app. Reload the page. - navigator.serviceWorker.ready.then(registration => { - registration.unregister().then(() => { - window.location.reload(); - }); - }); - } else { - // Service worker found. Proceed as normal. - registerValidSW(swUrl, config); - } - }) - .catch(() => { - console.log( - 'No internet connection found. App is running in offline mode.' - ); - }); -} - -export function unregister() { - if ('serviceWorker' in navigator) { - navigator.serviceWorker.ready.then(registration => { - registration.unregister(); - }); - } -} diff --git a/examples/public/favicon.ico b/favicon.ico similarity index 100% rename from examples/public/favicon.ico rename to favicon.ico diff --git a/index.html b/index.html new file mode 100644 index 0000000..0a946b2 --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +React App
\ No newline at end of file diff --git a/examples/public/logo192.png b/logo192.png similarity index 100% rename from examples/public/logo192.png rename to logo192.png diff --git a/examples/public/logo512.png b/logo512.png similarity index 100% rename from examples/public/logo512.png rename to logo512.png diff --git a/examples/public/manifest.json b/manifest.json similarity index 100% rename from examples/public/manifest.json rename to manifest.json diff --git a/now.json b/now.json deleted file mode 100644 index d020766..0000000 --- a/now.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "react-org-chart", - "type": "static", - "files": ["examples", "dist"], - "alias": "react-org-chart.now.sh" -} diff --git a/package.json b/package.json deleted file mode 100644 index 22ce587..0000000 --- a/package.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "@unicef/react-org-chart", - "version": "0.3.4", - "description": "Simple, high-performance react component for d3 org chart", - "main": "dist/index.js", - "directories": { - "example": "src/examples" - }, - "files": [ - "dist/index.js" - ], - "homepage": "https://unicef.github.io/react-org-chart", - "repository": { - "type": "git", - "url": "git+https://github.com/unicef/react-org-chart.git" - }, - "scripts": { - "start": "webpack --watch --mode production", - "build": "webpack --mode production", - "clean": "rimraf dist", - "deploy": "cd examples && npm run deploy" - }, - "keywords": [], - "author": "UNICEF, based on work of Fouad Matin ", - "license": "MIT", - "devDependencies": { - "babel-core": "^6.26.0", - "babel-loader": "^7.1.4", - "babel-preset-env": "^1.6.1", - "babel-preset-stage-2": "^6.24.1", - "faker": "^4.1.0", - "glob": "^7.1.2", - "lodash": "^4.17.5", - "react": "^16.2.0", - "react-dom": "^16.2.0", - "rimraf": "^2.6.2", - "webpack": "^4.41.2", - "webpack-cli": "^3.1.1", - "webpack-dev-server": "^3.1.0" - }, - "peerDependencies": { - "d3": ">= 3.x < 4", - "react": ">= 15.x", - "react-dom": ">= 15.x" - }, - "babel": { - "presets": [ - "env", - "stage-2" - ] - }, - "dependencies": { - "d3-save-svg": "0.0.2", - "jspdf": "^1.5.3" - } -} diff --git a/precache-manifest.6835890c922728daf964b5781076887e.js b/precache-manifest.6835890c922728daf964b5781076887e.js new file mode 100644 index 0000000..6388fde --- /dev/null +++ b/precache-manifest.6835890c922728daf964b5781076887e.js @@ -0,0 +1,34 @@ +self.__precacheManifest = (self.__precacheManifest || []).concat([ + { + "revision": "9b4e8148b65cc121b351c10d16aecbd1", + "url": "/react-org-chart/index.html" + }, + { + "revision": "c03bbe2595e844a19510", + "url": "/react-org-chart/static/css/main.6060b8e6.chunk.css" + }, + { + "revision": "3be80ad3f2262f926632", + "url": "/react-org-chart/static/js/2.748d1f8b.chunk.js" + }, + { + "revision": "9b318b6fb13190fe82c0677e9264b3c7", + "url": "/react-org-chart/static/js/2.748d1f8b.chunk.js.LICENSE.txt" + }, + { + "revision": "c03bbe2595e844a19510", + "url": "/react-org-chart/static/js/main.8a6eafd3.chunk.js" + }, + { + "revision": "bb41dfa41bd2945e9ca534fcd6227399", + "url": "/react-org-chart/static/js/main.8a6eafd3.chunk.js.LICENSE.txt" + }, + { + "revision": "a897ade332a5b6f43d11", + "url": "/react-org-chart/static/js/runtime-main.d9ba5a7a.js" + }, + { + "revision": "f8399445e0f391bfe9059f4b992b3657", + "url": "/react-org-chart/static/media/avatar-personnel.f8399445.svg" + } +]); \ No newline at end of file diff --git a/readme.md b/readme.md deleted file mode 100644 index 21bc499..0000000 --- a/readme.md +++ /dev/null @@ -1,193 +0,0 @@ -# React Organizational Chart -[![npm version](https://badge.fury.io/js/%40unicef%2Freact-org-chart.svg)](https://badge.fury.io/js/%40unicef%2Freact-org-chart) - -React component for displaying organizational charts. - -This component is based on [coreseekdev/react-org-chart](https://github.com/coreseekdev/react-org-chart). On top of it, we added a few customization to fulfill our requirements. - -### [View demo](https://unicef.github.io/react-org-chart/) - - -# Features - -From the original package: - -- High-performance D3-based SVG rendering -- Lazy-load children with a custom function -- Handle up to 1 million collapsed nodes and 5,000 expanded nodes -- Pan (drag and drop) -- Zoom in zoom out (with mouse wheel/scroll) - -What we added: - -- Lazy-load of parents (go up in the tree) -- Zoom in, zoom out and zoom buttons. -- Download orgchart as image or PDF - -### React Props - -| **property** | **type** | **description** | **example** | -| ----------------- | ---------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------ | -| tree | `Object` | Nested data model with some of all the employees in the company (Required) | See sample below. | -| nodeWidth | `Number` | Width of the component for each individual (Optional) | 180 | -| nodeHeight | `Number` | Height of the component for each individual (Optional) | 100 | -| nodeSpacing | `Number` | Spacing between each of the nodes in the chart (Optional) | 12 | -| animationDuration | `Number` | Duration of the animations in milliseconds (Optional) | 350 | -| lineType | `String` | Type of line that connects the nodes to each other (Optional) | “angle” “curve” | -| downloadImageId | `String` | Id of the DOM element that, on click, will trigger the download of the org chart as PNG. OrgChart will bind the click event to the DOM element with this ID (Optional) | "download-image" (default) | -| downloadPdfId | `String` | Id of the DOM element that, on click, will trigger the download of the org chart as PDF. OrgChart will bind the click event to the DOM element with this ID (Optional) (Optional) | "download-pdf" (default) | -| zoomInId | `String` | Id of the DOM element that, on click, will trigger a zoom of the org chart. OrgChart will bind the click event to the DOM element with this ID (Optional) (Optional) | "zoom-in" (default) | -| zoomOutId | `String` | Id of the DOM element that, on click, will trigger the zoom out of the org chart. OrgChart will bind the click event to the DOM element with this ID (Optional) | "zoom-out" (default) | -| zoomExtentId | `String` | Id of the DOM element that, on click, will display whole org chart svg fit to screen. OrgChart will bind the click event to the DOM element with this ID(Optional) | "zoom-extent" (default) | -| loadParent(personData) | `Function` | Load parent with one level of children (Optional) | See usage below | -| loadChildren (personData) | `Function` | Load the children of particular node (Optional) | See usage below | -| onConfigChange | `Function` | To set the latest config to state on change | See usage below | -| loadConfig | `Function` | Pass latest config from state to OrgChart | See usage below | -| loadImage(personData) | `Function` | To get image of person on API call (Optional) | See usage below | - - - -### Sample tree data - -```jsx - -{ - id: 1, - person: { - id: 1, - avatar: 'https://s3.amazonaws.com/uifaces/faces/twitter/spbroma/128.jpg', - department: '', - name: 'Jane Doe', - title: 'CEO', - totalReports: 5 - }, - hasChild: true, - hasParent: false, - isHighlight: true, - children: [ - { - id: 2, - person: { - id: 2, - avatar: 'https://s3.amazonaws.com/uifaces/faces/twitter/spbroma/128.jpg', - department: '', - name: 'John Foo', - title: 'CTO', - totalReports: 0 - }, - hasChild: false, - hasParent: true, - isHighlight: false, - children: [] - }, - ... - ] -} - -``` - -### Usage - -You have a complete working example in the **[examples/](https://github.com/unicef/react-org-chart/tree/master/examples)** folder - -```jsx -import React from 'react' -import OrgChart from '@unicef/react-org-chart' - -handleLoadConfig = () => { - const { config } = this.state - return config -} - -render(){ - return ( - { - // Setting latest config to state - this.setState({ config: config }) - }} - loadConfig={d => { - // Called from d3 to get latest version of the config. - const config = this.handleLoadConfig(d) - return config - }} - loadParent={personData => { - // getParentData(): To get the parent data from API - const loadedParent = this.getParentData(personData) - return Promise.resolve(loadedParent) - }} - loadChildren={personData => { - // getChildrenData(): To get the children data from API - const loadedChildren = this.getChildrenData(personData) - return Promise.resolve(loadedChildren) - }} - loadImage={personData => { - // getImage(): To get the image from API - const image = getImage(personData.email) - return Promise.resolve(image) - }} - /> - ) -} -``` - - -# Development - -```bash -git clone https://github.com/unicef/react-org-chart.git -cd react-org-chart -npm install -``` - -To build in watch mode: - -```bash -npm start -``` - -To build for production - -```bash -npm run build -``` - -Running the example: - -```bash -cd example/ -npm install # Only first time -npm start -``` - -To deploy the example to gh-pages site - -```bash -npm run deploy -``` - -## About UNICEF - -[UNICEF](https://www.unicef.org/) works in over 190 countries and territories to protect the rights of every child. UNICEF has spent more than 70 years working to improve the lives of children and their families. In UNICEF, we **believe all children have a right to survive, thrive and fulfill their potential – to the benefit of a better world**. - -[Donate](https://donate.unicef.org/donate/now) - - -## Collaborations and support - -Just fork the project and make a pull request. You may also [consider donating](https://donate.unicef.org/donate/now). - - -# License - -Copyright 2019-2020 UNICEF http://www.unicef.org -Developed by ICTD, Solutions Center and Support, Digital Tools and Platforms, Custom Applications Team, New York. - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/examples/public/robots.txt b/robots.txt similarity index 100% rename from examples/public/robots.txt rename to robots.txt diff --git a/service-worker.js b/service-worker.js new file mode 100644 index 0000000..767b3b4 --- /dev/null +++ b/service-worker.js @@ -0,0 +1,39 @@ +/** + * Welcome to your Workbox-powered service worker! + * + * You'll need to register this file in your web app and you should + * disable HTTP caching for this file too. + * See https://goo.gl/nhQhGp + * + * The rest of the code is auto-generated. Please don't update this file + * directly; instead, make changes to your Workbox build configuration + * and re-run your build process. + * See https://goo.gl/2aRDsh + */ + +importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js"); + +importScripts( + "/react-org-chart/precache-manifest.6835890c922728daf964b5781076887e.js" +); + +self.addEventListener('message', (event) => { + if (event.data && event.data.type === 'SKIP_WAITING') { + self.skipWaiting(); + } +}); + +workbox.core.clientsClaim(); + +/** + * The workboxSW.precacheAndRoute() method efficiently caches and responds to + * requests for URLs in the manifest. + * See https://goo.gl/S9QRab + */ +self.__precacheManifest = [].concat(self.__precacheManifest || []); +workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); + +workbox.routing.registerNavigationRoute(workbox.precaching.getCacheKeyForURL("/react-org-chart/index.html"), { + + blacklist: [/^\/_/,/\/[^/?]+\.[^/]+$/], +}); diff --git a/src/chart/components/iconLink.js b/src/chart/components/iconLink.js deleted file mode 100644 index afe2380..0000000 --- a/src/chart/components/iconLink.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - - - - - - - - - - - - */ - -module.exports = function iconLink({ svg, x = 5, y = 5 }) { - const container = svg - .append('g') - .attr('stroke', 'none') - .attr('fill', 'none') - .style('cursor', 'pointer') - .append('g') - - const icon = container - .append('g') - .attr('id', 'icon') - .attr('fill', '#3344DD') - .attr('transform', `translate(${x}, ${y})`) - - const arrow = icon - .append('g') - .attr('id', 'arrow') - .attr( - 'transform', - 'translate(7.000000, 7.000000) scale(-1, 1) translate(-7.000000, -7.000000)' - ) - - arrow - .append('path') - .attr( - 'd', - 'M3.41421356,2 L8.70710678,7.29289322 C9.09763107,7.68341751 9.09763107,8.31658249 8.70710678,8.70710678 C8.31658249,9.09763107 7.68341751,9.09763107 7.29289322,8.70710678 L2,3.41421356 L2,7 C2,7.55228475 1.55228475,8 1,8 C0.44771525,8 0,7.55228475 0,7 L0,1.49100518 C0,0.675320548 0.667758414,0 1.49100518,0 L7,0 C7.55228475,0 8,0.44771525 8,1 C8,1.55228475 7.55228475,2 7,2 L3.41421356,2 Z' - ) - - arrow - .append('path') - // .attr('opacity', 0.7) - .attr( - 'd', - 'M12,2 L12,12 L2,12 L2,11 C2,10.4477153 1.55228475,10 1,10 C0.44771525,10 0,10.4477153 0,11 L0,12.4953156 C0,13.3242086 0.674596865,14 1.50034732,14 L12.4996527,14 C13.3281027,14 14,13.3234765 14,12.4996527 L14,1.50034732 C14,0.669321781 13.3358906,0 12.4953156,0 L11,0 C10.4477153,0 10,0.44771525 10,1 C10,1.55228475 10.4477153,2 11,2 L12,2 Z' - ) - - icon - .append('rect') - .attr('id', 'bounds') - .attr('x', 0) - .attr('y', 0) - .attr('width', 24) - .attr('height', 24) - .attr('fill', 'transparent') -} diff --git a/src/chart/components/supervisorIcon.js b/src/chart/components/supervisorIcon.js deleted file mode 100644 index 0bbfd83..0000000 --- a/src/chart/components/supervisorIcon.js +++ /dev/null @@ -1,88 +0,0 @@ -const onParentClick = require('../onParentClick') -// { -// -// -// -// -// -// - -// } -module.exports = function supervisorIcon({ - svg, - config, - treeData, - x = 5, - y = 5, -}) { - const container = svg - .append('g') - .attr('id', 'supervisorIcon') - .on('click', d => { - if (d3.event.defaultPrevented) return - onParentClick(config, treeData) - }) - .attr('stroke', 'none') - .attr('fill', 'none') - .style('display', treeData.hasParent ? '' : 'none') - .style('cursor', 'pointer') - .append('g') - - const icon = container - .append('g') - .attr('id', 'icon') - .attr('fill', 'none') - .attr('fill-rule', 'evenodd') - .attr('transform', `translate(51.5, -46)`) - - icon - .append('circle') - .attr('id', 'icon') - .attr('stroke', '#C9C9C9') - .attr('fill', '#FFF') - .attr('cx', 15.5) - .attr('cy', 15.5) - .attr('r', 15.5) - - icon - .append('path') - .attr('stroke', '#C9C9C9') - .attr('stroke-linecap', 'square') - .attr('d', 'M15.5 45V31.5') - - icon - .append('circle') - .attr('id', 'icon') - .attr('stroke', '#979797') - .attr('fill', '#9C9C9C') - .attr('cx', 9) - .attr('cy', 16) - .attr('r', 2) - - icon - .append('circle') - .attr('id', 'icon') - .attr('stroke', '#979797') - .attr('fill', '#9C9C9C') - .attr('cx', 15.5) - .attr('cy', 16) - .attr('r', 2) - - icon - .append('circle') - .attr('id', 'icon') - .attr('stroke', '#979797') - .attr('fill', '#9C9C9C') - .attr('cx', 22) - .attr('cy', 16) - .attr('r', 2) - - icon - .append('rect') - .attr('id', 'bounds') - .attr('x', 0) - .attr('y', 0) - .attr('width', 33) - .attr('height', 47) - .attr('fill', 'transparent') -} diff --git a/src/chart/config.js b/src/chart/config.js deleted file mode 100644 index 64b3de9..0000000 --- a/src/chart/config.js +++ /dev/null @@ -1,50 +0,0 @@ -const animationDuration = 350 -const shouldResize = true - -// Nodes -const nodeWidth = 140 -const nodeHeight = 180 -const nodeSpacing = 12 -const nodePaddingX = 16 -const nodePaddingY = 16 -const avatarWidth = 48 -const nodeBorderRadius = 4 -const margin = { - top: 20, - right: 20, - bottom: 20, - left: 20, -} - -// Lines -const lineType = 'angle' -const lineDepthY = 120 /* Height of the line for child nodes */ - -// Colors -const backgroundColor = '#fff' -const borderColor = '#c9c9c9' -const nameColor = '#222d38' -const titleColor = '#617080' -const reportsColor = '#92A0AD' - -const config = { - margin, - animationDuration, - nodeWidth, - nodeHeight, - nodeSpacing, - nodePaddingX, - nodePaddingY, - nodeBorderRadius, - avatarWidth, - lineType, - lineDepthY, - backgroundColor, - borderColor, - nameColor, - titleColor, - reportsColor, - shouldResize, -} - -module.exports = config diff --git a/src/chart/exportOrgChartImage.js b/src/chart/exportOrgChartImage.js deleted file mode 100644 index dd2301f..0000000 --- a/src/chart/exportOrgChartImage.js +++ /dev/null @@ -1,69 +0,0 @@ -const d3 = require('d3') - -module.exports = exportOrgChartImage - -function exportOrgChartImage({ loadConfig }) { - const config = loadConfig() - const { id, downlowdedOrgChart, nodeLeftX, nodeRightX, nodeY } = config - var w = nodeLeftX + nodeRightX - var h = nodeY - var ratio = w > 9000 ? 1 : 2 - - // checking wether it has canvas in the convas-container div - document.getElementById(`${id}-canvas-container`).querySelector('canvas') - ? document - .getElementById(`${id}-canvas-container`) - .querySelector('canvas') - .remove() - : '' - - // creating a canvas element - var canvas1 = document.createElement('canvas') - canvas1.id = 'canvas1' - canvas1.width = w * ratio - canvas1.height = h * ratio - document.getElementById(`${id}-canvas-container`).appendChild(canvas1) - - // creating duplicate org chart svg from original org chart svg - var step = document.createElementNS('http://www.w3.org/2000/svg', 'svg') - step.id = 'newsvg' - step.setAttribute('width', w) - step.setAttribute('height', h) - step.setAttribute('viewBox', `${-nodeLeftX} 0 ${w} ${h + 200}`) - step.innerHTML = document.getElementById('svg').innerHTML - - document.getElementById(`${id}-svg-container`).querySelector('svg') - ? document - .getElementById(`${id}-svg-container`) - .querySelector('svg') - .remove() - : '' - document.getElementById(`${id}-svg-container`).appendChild(step) - - // appending g element from svg - const g = document.getElementById(`${id}-svg-container`).querySelector('g') - g.setAttribute('transform', `translate(0,0)`) - var html = new XMLSerializer().serializeToString( - document.getElementById(`${id}-svg-container`).querySelector('svg') - ) - - // generating image with base 64 - var imgSrc = 'data:image/svg+xml;base64,' + btoa(html) - let canvas = document.getElementById('canvas1') - let context = canvas.getContext('2d') - let image = new Image() - image.src = imgSrc - - // downloading the image - image.onload = function() { - context.drawImage(image, 0, 0, canvas.width, canvas.height) - canvas.toBlob(function(blob) { - let a = document.createElement('a') - let url = URL.createObjectURL(blob) - a.download = 'orgchart.jpg' - a.href = url - a.click() - }) - downlowdedOrgChart(true) - } -} diff --git a/src/chart/exportOrgChartPdf.js b/src/chart/exportOrgChartPdf.js deleted file mode 100644 index f7ff704..0000000 --- a/src/chart/exportOrgChartPdf.js +++ /dev/null @@ -1,99 +0,0 @@ -const jsPDF = require('jspdf') - -module.exports = exportOrgChartPdf - -function exportOrgChartPdf({ loadConfig }) { - const config = loadConfig() - const { - id, - downlowdedOrgChart, - nodeLeftX, - nodeRightX, - nodeY, - nodeHeight, - margin, - } = config - - // a4 width and heigth for landscape - const a4Width = 3508 - const a4Height = 2480 - - // svg width and height - const svgWidth = nodeLeftX + nodeRightX - const svgHeight = nodeY + nodeHeight + 48 - - // calculating ratio for better quality if the svgWidth is less than a4Width - const ratio = svgWidth > a4Width ? 1 : 2 - - const widthWithRatio = svgWidth > a4Width ? svgWidth : svgWidth * ratio - const heightWithRatio = svgWidth > a4Width ? svgHeight : svgHeight * ratio - - const defaultScale = svgWidth > 600 ? 0.87 : 0.6 - - // scale - const scaleX = a4Width / widthWithRatio - const scaleY = a4Height / heightWithRatio - const chooseScale = scaleX < scaleY ? scaleX : scaleY - const scale = widthWithRatio > a4Width ? chooseScale - 0.04 : defaultScale - const translateX = nodeLeftX * scale + margin.left / 2 - - // Final width and height - const width = widthWithRatio * 0.85 - const height = heightWithRatio * 0.85 - - // checking wether it has canvas in the convas-container div - document.getElementById(`${id}-canvas-container`).querySelector('canvas') - ? document - .getElementById(`${id}-canvas-container`) - .querySelector('canvas') - .remove() - : '' - - // creating a canvas element - var canvas1 = document.createElement('canvas') - canvas1.id = 'canvas1' - canvas1.width = svgWidth * ratio - canvas1.height = svgHeight * ratio - document.getElementById(`${id}-canvas-container`).appendChild(canvas1) - - // creating duplicate org chart svg from original org chart svg - var step = document.createElementNS('http://www.w3.org/2000/svg', 'svg') - step.id = 'newsvg' - step.setAttribute('width', svgWidth) - step.setAttribute('height', svgHeight) - step.setAttribute('viewBox', `0 0 ${svgWidth} ${svgHeight}`) - step.innerHTML = document.getElementById('svg').innerHTML - - document.getElementById(`${id}-svg-container`).querySelector('svg') - ? document - .getElementById(`${id}-svg-container`) - .querySelector('svg') - .remove() - : '' - document.getElementById(`${id}-svg-container`).appendChild(step) - - // appending g element from svg - var g = document.getElementById(`${id}-svg-container`).querySelector('g') - g.setAttribute('transform', `translate(${translateX}, 2) scale(${scale})`) - var html = new XMLSerializer().serializeToString( - document.getElementById(`${id}-svg-container`).querySelector('svg') - ) - - // generating image with base 64 - const imgSrc = 'data:image/svg+xml;base64,' + btoa(html) - const canvas = document.getElementById('canvas1') - const context = canvas.getContext('2d') - const image = new Image() - image.src = imgSrc - - // downloading the image - image.onload = function() { - context.drawImage(image, 0, 0, width, height) - const canvasData = canvas.toDataURL('image/jpeg,1.0') - - const pdf = new jsPDF('l', 'px', [a4Width, a4Height]) - pdf.addImage(canvasData, 'JPEG', 15, 2, width, height) - pdf.save('Orgchart.pdf') - downlowdedOrgChart(true) - } -} diff --git a/src/chart/index.js b/src/chart/index.js deleted file mode 100644 index c2b54ce..0000000 --- a/src/chart/index.js +++ /dev/null @@ -1,271 +0,0 @@ -const d3 = require('d3') -const { collapse, wrapText, helpers } = require('../utils') -const defineBoxShadow = require('../defs/defineBoxShadow') -const defineAvatarClip = require('../defs/defineAvatarClip') -const render = require('./render') -const defaultConfig = require('./config') - -module.exports = { - init, -} - -function init(options) { - // Merge options with the default config - const config = { - ...defaultConfig, - ...options, - treeData: options.data, - } - - if (!config.id) { - console.error('react-org-chart: missing id for svg root') - return - } - - const { - id, - treeData, - lineType, - margin, - nodeWidth, - nodeHeight, - nodeSpacing, - shouldResize, - zoomInId, - zoomOutId, - zoomExtentId, - loadConfig, - } = config - - // Calculate how many pixel nodes to be spaced based on the - // type of line that needs to be rendered - if (lineType == 'angle') { - config.lineDepthY = nodeHeight + 40 - } else { - config.lineDepthY = nodeHeight + 60 - } - - // Get the root element - const elem = document.querySelector(id) - - if (!elem) { - console.error(`react-org-chart: svg root DOM node not found (id: ${id})`) - return - } - - // Reset in case there's any existing DOM - elem.innerHTML = '' - - const elemWidth = elem.offsetWidth - const elemHeight = elem.offsetHeight - - // Setup the d3 tree layout - config.tree = d3.layout - .tree() - .nodeSize([nodeWidth + nodeSpacing, nodeHeight + nodeSpacing]) - - // Calculate width of a node with expanded children - const childrenWidth = parseInt((treeData.children.length * nodeWidth) / 2) - - // elemWidth || svgHeight > elemHeight ? chooseScale : 1 - let translateX = nodeLeftX * scale + margin.left / 2 - - if (svgWidth > elemWidth || svgHeight > elemHeight) { - //If width is more than height - if (scaleX < scaleY) { - interpolateZoom([translateX, 48], scale) - //If height is more than width - } else if (scaleX > scaleY) { - translateX = elemWidth / 2 - margin.left / 2 - interpolateZoom([translateX, 48], scale) - } - } else { - translateX = elemWidth / 2 - margin.left / 2 - interpolateZoom([translateX, 48], scale) - } - - return - } - var clicked = d3.event.target, - direction = 1, - factor = 0.2, - target_zoom = 1, - center = [elemWidth / 2, elemHeight / 2], - extent = zoom.scaleExtent(), - translate = zoom.translate(), - translate0 = [], - l = [], - view = { x: translate[0], y: translate[1], k: zoom.scale() } - - d3.event.preventDefault() - direction = this.id === zoomInId ? 1 : -1 - target_zoom = zoom.scale() * (1 + factor * direction) - - if (target_zoom < extent[0] || target_zoom > extent[1]) { - return false - } - - translate0 = [(center[0] - view.x) / view.k, (center[1] - view.y) / view.k] - view.k = target_zoom - l = [translate0[0] * view.k + view.x, translate0[1] * view.k + view.y] - - view.x += center[0] - l[0] - view.y += center[1] - l[1] - - interpolateZoom([view.x, view.y], view.k) - } - - // d3 selects button on click - d3.select(`#${zoomInId}`).on('click', zoomClick) - d3.select(`#${zoomOutId}`).on('click', zoomClick) - d3.select(`#${zoomExtentId}`).on('click', zoomClick) - - // Add listener for when the browser or parent node resizes - const resize = () => { - if (!elem) { - global.removeEventListener('resize', resize) - return - } - - svgroot.attr('width', elem.offsetWidth).attr('height', elem.offsetHeight) - } - - if (shouldResize) { - global.addEventListener('resize', resize) - } - - // Start initial render - render(config) - - // Update DOM root height - d3.select(id).style('height', elemHeight + margin.top + margin.bottom) - - //creating canvas and duplicate svg for image and PDF download - const canvasContainer = document.createElement('div') - canvasContainer.setAttribute('id', `${id}-canvas-container`) - canvasContainer.setAttribute('style', 'display:none;') - - //duplicate svg container - const svgContainer = document.createElement('div') - svgContainer.setAttribute('id', `${id}-svg-container`) - svgContainer.setAttribute('style', 'display:none;') - - //appending svg and canvas containers to root - const orgChart = document.getElementById('root') - orgChart.append(canvasContainer) - orgChart.append(svgContainer) -} diff --git a/src/chart/onClick.js b/src/chart/onClick.js deleted file mode 100644 index 1f39dfa..0000000 --- a/src/chart/onClick.js +++ /dev/null @@ -1,115 +0,0 @@ -const d3 = require('d3') -const { collapse } = require('../utils') - -module.exports = onClick - -function onClick(configOnClick) { - const { loadConfig } = configOnClick - - return datum => { - if (d3.event.defaultPrevented) return - const config = loadConfig() - const { loadChildren, render, onPersonClick } = config - event.preventDefault() - - if (onPersonClick) { - const result = onPersonClick(datum, d3.event) - - // If the `onPersonClick` handler returns `false` - // Cancel the rest of this click handler - if (typeof result === 'boolean' && !result) { - return - } - } - - // If this person doesn't have children but `hasChild` is true, - // attempt to load using the `loadChildren` config function - if (!datum.children && !datum._children && datum.hasChild) { - if (!loadChildren) { - console.error( - 'react-org-chart.onClick: loadChildren() not found in config' - ) - return - } - - const result = loadChildren(datum) - const handler = handleChildrenResult(config, datum) - - // Check if the result is a promise and render the children - if (result.then) { - return result.then(handler) - } else { - return handler(result) - } - } - - if (datum.children) { - // Collapse the children - config.callerNode = datum - config.callerMode = 0 - datum._children = datum.children - datum.children = null - } else { - // Expand the children - config.callerNode = datum - config.callerMode = 1 - datum.children = datum._children - datum._children = null - } - - // Pass in the clicked datum as the sourceNode which - // tells the child nodes where to animate in from - render({ - ...config, - sourceNode: datum, - }) - } -} - -function handleChildrenResult(config, datum) { - const { tree, render } = config - - return children => { - const result = { - ...datum, - children, - } - - // Collapse the nested children - children.forEach(collapse) - - result.children.forEach(child => { - if (!tree.nodes(datum)[0]._children) { - tree.nodes(datum)[0]._children = [] - } - - child.x = datum.x - child.y = datum.y - child.x0 = datum.x0 - child.y0 = datum.y0 - - tree.nodes(datum)[0]._children.push(child) - }) - - if (datum.children) { - // Collapse the children - config.callerNode = datum - config.callerMode = 0 - datum._children = datum.children - datum.children = null - } else { - // Expand the children - config.callerNode = null - config.callerMode = 1 - datum.children = datum._children - datum._children = null - } - - // Pass in the newly rendered datum as the sourceNode - // which tells the child nodes where to animate in from - render({ - ...config, - sourceNode: result, - }) - } -} diff --git a/src/chart/onParentClick.js b/src/chart/onParentClick.js deleted file mode 100644 index aad5f12..0000000 --- a/src/chart/onParentClick.js +++ /dev/null @@ -1,52 +0,0 @@ -module.exports = onParentClick - -function onParentClick(configOnClick, children) { - event.preventDefault() - - const { loadConfig } = configOnClick - const config = loadConfig() - const { loadParent } = config - - // If this person have `hasParent` is true, - // attempt to load using the `loadParent` config function - if (children.hasParent) { - if (!loadParent) { - console.error('react-org-chart.onClick: loadParent() not found in config') - return - } - - const result = loadParent(children) - const handler = handleResult(config, children) - - // Check if the result is a promise and render the children - if (result.then) { - return result.then(handler) - } else { - return handler(result) - } - } -} - -function handleResult(config, d) { - const { render } = config - - return datum => { - const children = datum.children.map(item => { - if (item.id === d.id) { - return { ...item, ...d } - } else { - return item - } - }) - - const result = { ...datum, children } - - // Pass in the newly rendered datum as the sourceNode - // which tells the child nodes where to animate in from - render({ - ...config, - treeData: { ...result, children, _children: null }, - sourceNode: result, - }) - } -} diff --git a/src/chart/render.js b/src/chart/render.js deleted file mode 100644 index c14fbba..0000000 --- a/src/chart/render.js +++ /dev/null @@ -1,262 +0,0 @@ -const d3 = require('d3') -const { wrapText, helpers, covertImageToBase64 } = require('../utils') -const renderLines = require('./renderLines') -const exportOrgChartImage = require('./exportOrgChartImage') -const exportOrgChartPdf = require('./exportOrgChartPdf') -const onClick = require('./onClick') -const iconLink = require('./components/iconLink') -const supervisorIcon = require('./components/supervisorIcon') -const CHART_NODE_CLASS = 'org-chart-node' -const PERSON_LINK_CLASS = 'org-chart-person-link' -const PERSON_NAME_CLASS = 'org-chart-person-name' -const PERSON_TITLE_CLASS = 'org-chart-person-title' -const PERSON_HIGHLIGHT = 'org-chart-person-highlight' -const PERSON_REPORTS_CLASS = 'org-chart-person-reports' - -function render(config) { - const { - svgroot, - svg, - tree, - animationDuration, - nodeWidth, - nodeHeight, - nodePaddingX, - nodePaddingY, - nodeBorderRadius, - backgroundColor, - nameColor, - titleColor, - reportsColor, - borderColor, - avatarWidth, - lineDepthY, - treeData, - sourceNode, - onPersonLinkClick, - loadImage, - downloadImageId, - downloadPdfId, - elemWidth, - margin, - onConfigChange, - } = config - - // Compute the new tree layout. - const nodes = tree.nodes(treeData).reverse() - const links = tree.links(nodes) - - config.links = links - config.nodes = nodes - - // Normalize for fixed-depth. - nodes.forEach(function(d) { - d.y = d.depth * lineDepthY - }) - - // Update the nodes - const node = svg.selectAll('g.' + CHART_NODE_CLASS).data( - nodes.filter(d => d.id), - d => d.id - ) - - const parentNode = sourceNode || treeData - - svg.selectAll('#supervisorIcon').remove() - - supervisorIcon({ - svg: svg, - config, - treeData, - x: 70, - y: -24, - }) - - // Enter any new nodes at the parent's previous position. - const nodeEnter = node - .enter() - .insert('g') - .attr('class', CHART_NODE_CLASS) - .attr('transform', `translate(${parentNode.x0}, ${parentNode.y0})`) - .on('click', onClick(config)) - - // Person Card Shadow - nodeEnter - .append('rect') - .attr('width', nodeWidth) - .attr('height', nodeHeight) - .attr('fill', backgroundColor) - .attr('stroke', borderColor) - .attr('rx', nodeBorderRadius) - .attr('ry', nodeBorderRadius) - .attr('fill-opacity', 0.05) - .attr('stroke-opacity', 0.025) - .attr('filter', 'url(#boxShadow)') - - // Person Card Container - nodeEnter - .append('rect') - .attr('class', d => (d.isHighlight ? `${PERSON_HIGHLIGHT} box` : 'box')) - .attr('width', nodeWidth) - .attr('height', nodeHeight) - .attr('id', d => d.id) - .attr('fill', backgroundColor) - .attr('stroke', borderColor) - .attr('rx', nodeBorderRadius) - .attr('ry', nodeBorderRadius) - .style('cursor', helpers.getCursorForNode) - - const namePos = { - x: nodeWidth / 2, - y: nodePaddingY * 1.8 + avatarWidth, - } - - const avatarPos = { - x: nodeWidth / 2 - avatarWidth / 2, - y: nodePaddingY / 2, - } - - // Person's Name - nodeEnter - .append('text') - .attr('class', PERSON_NAME_CLASS + ' unedited') - .attr('x', namePos.x) - .attr('y', namePos.y) - .attr('dy', '.3em') - .style('cursor', 'pointer') - .style('fill', nameColor) - .style('font-size', 14) - .text(d => d.person.name) - // .on('click', onParentClick(config)) - - // Person's Title - nodeEnter - .append('text') - .attr('class', PERSON_TITLE_CLASS + ' unedited') - .attr('x', nodeWidth / 2) - .attr('y', namePos.y + nodePaddingY * 2.4) - .attr('dy', '0.1em') - .style('font-size', 12) - .style('cursor', 'pointer') - .style('fill', titleColor) - .text(d => d.person.title) - - const heightForTitle = 60 // getHeightForText(d.person.title) - - // Person's Reports - nodeEnter - .append('text') - .attr('class', PERSON_REPORTS_CLASS) - .attr('x', nodePaddingX + 8) - .attr('y', namePos.y + nodePaddingY + heightForTitle) - .attr('dy', '.9em') - .style('font-size', 14) - .style('font-weight', 400) - .style('cursor', 'pointer') - .style('fill', reportsColor) - .text(helpers.getTextForTitle) - - // Person's Avatar - nodeEnter - .append('image') - .attr('id', d => `image-${d.id}`) - .attr('width', avatarWidth) - .attr('height', avatarWidth) - .attr('x', avatarPos.x) - .attr('y', avatarPos.y) - .attr('stroke', borderColor) - .attr('s', d => { - d.person.hasImage - ? d.person.avatar - : loadImage(d).then(res => { - covertImageToBase64(res, function(dataUrl) { - d3.select(`#image-${d.id}`).attr('href', dataUrl) - d.person.avatar = dataUrl - }) - d.person.hasImage = true - return d.person.avatar - }) - }) - .attr('src', d => d.person.avatar) - .attr('href', d => d.person.avatar) - .attr('clip-path', 'url(#avatarClip)') - - // Person's Link - const nodeLink = nodeEnter - .append('a') - .attr('class', PERSON_LINK_CLASS) - .attr('display', d => (d.person.link ? '' : 'none')) - .attr('xlink:href', d => d.person.link) - .on('click', datum => { - d3.event.stopPropagation() - // TODO: fire link click handler - if (onPersonLinkClick) { - onPersonLinkClick(datum, d3.event) - } - }) - - iconLink({ - svg: nodeLink, - x: nodeWidth - 20, - y: 8, - }) - - // Transition nodes to their new position. - const nodeUpdate = node - .transition() - .duration(animationDuration) - .attr('transform', d => `translate(${d.x},${d.y})`) - - nodeUpdate - .select('rect.box') - .attr('fill', backgroundColor) - .attr('stroke', borderColor) - - // Transition exiting nodes to the parent's new position. - const nodeExit = node - .exit() - .transition() - .duration(animationDuration) - .attr('transform', d => `translate(${parentNode.x},${parentNode.y})`) - .remove() - - // Update the links - const link = svg.selectAll('path.link').data(links, d => d.target.id) - - // Wrap the title texts - const wrapWidth = 124 - svg.selectAll('text.unedited.' + PERSON_NAME_CLASS).call(wrapText, wrapWidth) - svg.selectAll('text.unedited.' + PERSON_TITLE_CLASS).call(wrapText, wrapWidth) - - // Render lines connecting nodes - renderLines(config) - - // Stash the old positions for transition. - nodes.forEach(function(d) { - d.x0 = d.x - d.y0 = d.y - }) - - var nodeLeftX = -70 - var nodeRightX = 70 - var nodeY = 200 - nodes.map(d => { - nodeLeftX = d.x < nodeLeftX ? d.x : nodeLeftX - nodeRightX = d.x > nodeRightX ? d.x : nodeRightX - nodeY = d.y > nodeY ? d.y : nodeY - }) - - config.nodeRightX = nodeRightX - config.nodeY = nodeY - config.nodeLeftX = nodeLeftX * -1 - - d3.select(downloadImageId).on('click', function() { - exportOrgChartImage(config) - }) - - d3.select(downloadPdfId).on('click', function() { - exportOrgChartPdf(config) - }) - onConfigChange(config) -} -module.exports = render diff --git a/src/chart/renderLines.js b/src/chart/renderLines.js deleted file mode 100644 index 8a5679d..0000000 --- a/src/chart/renderLines.js +++ /dev/null @@ -1,174 +0,0 @@ -const d3 = require('d3') - -module.exports = renderLines - -function renderLines(config = {}) { - const { - svg, - links, - margin, - nodeWidth, - nodeHeight, - borderColor, - sourceNode, - treeData, - lineType, - animationDuration, - } = config - - const parentNode = sourceNode || treeData - - // Select all the links to render the lines - const link = svg.selectAll('path.link').data( - links.filter(link => link.source.id), - d => d.target.id - ) - - // Define the curved line function - const curve = d3.svg - .diagonal() - .projection(d => [d.x + nodeWidth / 2, d.y + nodeHeight / 2]) - - // Define the angled line function - const angle = d3.svg - .line() - .x(d => d.x) - .y(d => d.y) - .interpolate('linear') - - if (lineType === 'angle') { - // Enter any new links at the parent's previous position. - link - .enter() - .insert('path', 'g') - .attr('class', 'link') - .attr('fill', 'none') - .attr('stroke', '#A9A9A9') - .attr('stroke-opacity', 1) - .attr('stroke-width', 1.25) - .attr('d', d => { - const linePoints = [ - { - x: d.source.x0 + parseInt(nodeWidth / 2), - y: d.source.y0 + nodeHeight + 2, - }, - { - x: d.source.x0 + parseInt(nodeWidth / 2), - y: d.source.y0 + nodeHeight + 2, - }, - { - x: d.source.x0 + parseInt(nodeWidth / 2), - y: d.source.y0 + nodeHeight + 2, - }, - { - x: d.source.x0 + parseInt(nodeWidth / 2), - y: d.source.y0 + nodeHeight + 2, - }, - ] - - return angle(linePoints) - }) - - // Transition links to their new position. - link - .transition() - .duration(animationDuration) - .attr('d', d => { - const linePoints = [ - { - x: d.source.x + parseInt(nodeWidth / 2), - y: d.source.y + nodeHeight, - }, - { - x: d.source.x + parseInt(nodeWidth / 2), - y: d.target.y - margin.top / 2, - }, - { - x: d.target.x + parseInt(nodeWidth / 2), - y: d.target.y - margin.top / 2, - }, - { - x: d.target.x + parseInt(nodeWidth / 2), - y: d.target.y, - }, - ] - - return angle(linePoints) - }) - - // Animate the existing links to the parent's new position - link - .exit() - .transition() - .duration(animationDuration) - .attr('d', d => { - const lineNode = config.callerNode ? config.callerNode : parentNode - const linePoints = [ - { - x: lineNode.x + parseInt(nodeWidth / 2), - y: lineNode.y + nodeHeight + 2, - }, - { - x: lineNode.x + parseInt(nodeWidth / 2), - y: lineNode.y + nodeHeight + 2, - }, - { - x: lineNode.x + parseInt(nodeWidth / 2), - y: lineNode.y + nodeHeight + 2, - }, - { - x: lineNode.x + parseInt(nodeWidth / 2), - y: lineNode.y + nodeHeight + 2, - }, - ] - - return angle(linePoints) - }) - .each('end', () => { - config.callerNode = null - }) - } else if (lineType === 'curve') { - link - .enter() - .insert('path', 'g') - .attr('class', 'link') - .attr('stroke', borderColor) - .attr('fill', 'none') - .attr('x', nodeWidth / 2) - .attr('y', nodeHeight / 2) - .attr('d', d => { - const source = { - x: parentNode.x0, - y: parentNode.y0, - } - - return curve({ - source, - target: source, - }) - }) - - // Transition links to their new position. - link - .transition() - .duration(animationDuration) - .attr('d', curve) - - // Transition exiting nodes to the parent's new position. - link - .exit() - .transition() - .duration(animationDuration) - .attr('d', function(d) { - const source = { - x: parentNode.x, - y: parentNode.y, - } - return curve({ - source, - target: source, - }) - }) - .remove() - } -} diff --git a/src/defs/defineAvatarClip.js b/src/defs/defineAvatarClip.js deleted file mode 100644 index a83d718..0000000 --- a/src/defs/defineAvatarClip.js +++ /dev/null @@ -1,20 +0,0 @@ -const defaultConfig = { - borderRadius: 4, -} - -module.exports = function defineAvatarClip(svg, id, config = {}) { - config = { - ...defaultConfig, - ...config, - } - - const defs = svg.append('svg:defs') - - defs - .append('clipPath') - .attr('id', id) - .append('circle') - .attr('cx', 70) - .attr('cy', 32) - .attr('r', 24) -} diff --git a/src/defs/defineBorderRadius.js b/src/defs/defineBorderRadius.js deleted file mode 100644 index eafac4c..0000000 --- a/src/defs/defineBorderRadius.js +++ /dev/null @@ -1,30 +0,0 @@ -const defaultConfig = { - width: '100%', - height: '100%', - x: null, - y: null, - radius: 1 -} - -module.exports = function defineBorderRadius(svg, id, config = {}) { - config = { - ...defaultConfig, - ...config - } - - const defs = svg.append('svg:defs') - const rectId = `${id}-rect` - - defs - .append('rect') - .attr('id', rectId) - .attr('height', '100%') - .attr('width', '100%') - .attr('rx', config.radius) - - defs - .append('clipPath') - .attr('id', id) - .append('use') - .attr('xlink:href', '#' + rectId) -} diff --git a/src/defs/defineBoxShadow.js b/src/defs/defineBoxShadow.js deleted file mode 100644 index eb8342c..0000000 --- a/src/defs/defineBoxShadow.js +++ /dev/null @@ -1,39 +0,0 @@ -const defaultConfig = { - width: '150%', - height: '150%', - x: 0, - y: 2, - blurRadius: 1, -} - -module.exports = function defineBoxShadow(svg, id, config = {}) { - config = { - ...defaultConfig, - ...config, - } - - const filter = svg - .append('svg:defs') - .append('svg:filter') - .attr('id', id) - .attr('height', '150%') - .attr('width', '150%') - - filter - .append('svg:feGaussianBlur') - .attr('in', 'SourceAlpha') - .attr('stdDeviation', config.blurRadius) // stdDeviation is how much to blur - .attr('result', 'blurOut') - - filter - .append('svg:feOffset') - .attr('in', 'blurOut') - .attr('dx', config.x) - .attr('dy', config.y) - .attr('result', 'offsetOut') // how much to offset - - const feMerge = filter.append('feMerge') - - feMerge.append('feMergeNode').attr('in', 'offsetOut') - feMerge.append('feMergeNode').attr('in', 'SourceGraphic') -} diff --git a/src/index.js b/src/index.js deleted file mode 100644 index 2a4d611..0000000 --- a/src/index.js +++ /dev/null @@ -1,6 +0,0 @@ -const OrgChart = require('./react/org-chart') -const { init } = require('./chart') - -OrgChart.init = init - -module.exports = OrgChart diff --git a/src/react/org-chart.js b/src/react/org-chart.js deleted file mode 100644 index 9e0e669..0000000 --- a/src/react/org-chart.js +++ /dev/null @@ -1,47 +0,0 @@ -const { createElement, PureComponent } = require('react') -const { init } = require('../chart') - -class OrgChart extends PureComponent { - render() { - const { id } = this.props - - return createElement('div', { - id, - }) - } - - static defaultProps = { - id: 'react-org-chart', - downloadImageId: 'download-image', - downloadPdfId: 'download-pdf', - zoomInId: 'zoom-in', - zoomOutId: 'zoom-out', - zoomExtentId: 'zoom-extent', - } - - componentDidMount() { - const { - id, - downloadImageId, - downloadPdfId, - zoomInId, - zoomOutId, - zoomExtentId, - tree, - ...options - } = this.props - - init({ - id: `#${id}`, - downloadImageId: `#${downloadImageId}`, - downloadPdfId: `#${downloadPdfId}`, - zoomInId: zoomInId, - zoomOutId: zoomOutId, - zoomExtentId: zoomExtentId, - data: tree, - ...options, - }) - } -} - -module.exports = OrgChart diff --git a/src/utils/collapse.js b/src/utils/collapse.js deleted file mode 100644 index 4237223..0000000 --- a/src/utils/collapse.js +++ /dev/null @@ -1,8 +0,0 @@ -module.exports = function collapseNode(node) { - // Check if this node has children - if (node.children) { - node._children = node.children - node._children.forEach(collapseNode) - node.children = null - } -} diff --git a/src/utils/covertImageToBase64.js b/src/utils/covertImageToBase64.js deleted file mode 100644 index f3e144e..0000000 --- a/src/utils/covertImageToBase64.js +++ /dev/null @@ -1,25 +0,0 @@ -module.exports = covertImageToBase64 - -function covertImageToBase64(src, callback, outputFormat) { - var img = new Image() - img.crossOrigin = 'Anonymous' - img.onload = function () { - var canvas = document.createElement('CANVAS') - var ctx = canvas.getContext('2d') - var dataURL - canvas.height = this.naturalHeight - canvas.width = this.naturalWidth - ctx.drawImage(this, 0, 0) - dataURL = canvas.toDataURL(outputFormat) - if (dataURL === 'data:,') { - dataURL = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAABgCAYAAADimHc4AAAKHklEQVR4Xu1da2wcVxU+Z3ZT2+uSuhUhG9Iip1CpcooUUglCioShqigICRcFJB4lRQqPNgICUgDxAwo/EBCpDaDwjERDC0gQNUZCUFRK/APSEqnGEo5VqRBHlOB1gxon7a699u4c9M3ubHbGszuvO3Mn9l7JciLf5/fde86955x7hymj6SWR66qv1HaQYYwwm7cQ8TCRbCUyNjHJkBANEtGGZvdXmKgsxAtE5gUiPk8k50SM58k0Z/quzU/dwHwpi0PlrHTqssirK4v1u0holAzeTSK3Ke0b8zSZcoqYJgoDuSc3Mv9Paf0RK9NKwL/L5ddew/17iGSMiN4RcQxRi50k4vFlWTr+usHB/0atJG45LQScL9fel2PaS0T3xB2AovIn6kLHtg7mf6uovsDVpErAfLl+v0nmfmbeHriHKWYUkTMGGUc2D+Z+mFazqRAA4IXpIJFsS2tg8drhWRY6lAYRiRIAUZNn/pqQvCkeIHpKM/HfayJfT1I0JUIAlGuf0f9tEfmoHujUtsrMj1XNpS8loayVEzC/WPsYCR8WkuvVwqC3Nia+SCwHNg/kf66yJ0oJKJVrPyamT6rsYObqEvpJcTD/KVX9UkLA3MvVEc4ZPyPiN6vqWLbrkdNSNz++5VV9M3H7GZuAF5dq7xaTf7HWRI4fsBBJbMhHXtOf/4Nf3m5/j0UA5L0IHYvTgau9LDPtjaMXIhPQ2NvLD652AFX0n4UfiHpmiERAD/zVtEUlITQBPbHTec1EEUehCIDCNU36vYplu1brMAx6TxjFHJgAbDWNXP4v6223E3aiYHdk1mtvC7pFDUxAqbLyt/Wzzw8Luzu/nC4WNrwlSC2BCFgXJ9wgaIXJE/DE7EtAT+mGQd2ZN4hS7kqAZdXk/ume3I9GAvRBVZZu62ZF7UrA/GL90SyZlF84d5b+c27W+kHC/5FuGr7Z+n3j8DZ6w60jtKm4JRpiCZSCKXvzQO7eTlV3JKDptx1PoE+hq5yZmqRnn/krXSjNBSoLAm7fdQeN7NgZKH/SmepCY52cOh0JmK/UJ3V7sgD4E+PHAwPvBhJE3D22R/uKgGdtcyHnORs8CciCqeHM1CRNPPE7qi4txZqgff399K6xPZZo0pk6mSo8CShV6md1OtAB/h/Hj3viBbECMAGsLfuhC0AUyv3rOW8TPUjYrlUk8WyxkGsoq7a0igDdsx9g/uaRo6vAB/C7R++kjUPdPZ2XFy7SqYmnCHrDne799Ge0iiOvVbCKgLnyyrSuuB3M4qOHv+MQO5jpo3e/N/Ts9RJhqGvfgS9aq0dHQtzRlsENjpBLBwG6dz5QuO6Z+4H79rVETVjQvFYTVhIUs67k3hE5CChVao/rCheE6Dh6+JADl7eO3kn4iZOenniK8NOe9h046CvK4rTpU/ZEsZB/v52nRUAjULbvfIINd63aDRS2kJDZKtKjP/q+Yyurgtg4/VqW6lb7dNwioFSpf5ZIvhun4jhlMfuxCuykctfi3lVBkWMV6Ev8uWIh9z2030ZA7c8aQsQtDNziB0py/5e/qhSfI9/6hkO5axZDJ4uF/DtbBDQvR1xQOuIQlbmVJWw6H7zvEyFq8M/660d+2rIhIXcc5e7fmn+OwkBuEy6JWCugVKl9iIh+6V8smRxuEZHETsW9w1Ip4iKi8uFiIf+rBgGaQwrdCjgJJZlGG6GIaDpsGgQs1v+h/E5WiN6syxXAPF0cyL2RcRtxebG+EAIv5VnXow4AiNcM5IZ47uWVt3OOJ5SjGqLCpHdBXiYO7LJ0mSRsaKQuozxXrt/PGQgxhA3o8sKVhahSSa4+BwxZNiHdSYQf4FJl5SEi/rzuzqynk/AVrOVh1mn/aSc9TVtQFsRPc+wnsAIyE3C1HqyhTkkjp1m396u9Q2vdH7BazPMsz1dqLwlRZi7UwREP66U7wZ2IA1oQjxj0CRSvO+n2iLn7w0QXoQOq2JLqVsLt7XfzCcMfDDL6+gesOCAkxAlVlxbpn8/NeAKPPCp3VQqxWgYBZrtVVGHlsaoCmHDMr5WoiA5gSGYJQIfXSlxQl5loEZA5EWSDDwJef+uIJVomQ0bG7dx1hxW+gjAVeNeyFK7YRshyZpQwwH7Bivs8a8V82qIHShfhKDBRIw/IeLE0Z8l8O0bU1gWIE7JjQ+HcR3iK7WWz44huHL6ZbhrelglCmkpYXxAWwJl85hSdmXrWV9a3E9FNubiB75QXhGzfcTvt3LXbd2cVS5l1LcyzWg5imN1QsJjNURLIuG7oescu6NLCRYdPOUy9WDXYJaVvnLMOYumGogB8uAf9Ip1tMFTsgkCGXz3QEXCDpkyCZYpIzRjXDXwM3JbPkOUABPmfnviTJabCJtQHRYwf/LuhY6BfGnrGi5D0SZCHUzVHewVJYdAAqVvgrB3vid+24u1ECBQyCLSB75QPhz2vnVUS7tBOfbDM0Wk5ZAAeTAztMy+q8x11YSeEWY3ZDRKhE/zMFF5AuA2AqA8miyh1hV2llkMmLZeke/ZvHMqGUwSguZ1Baa0CyyWJDqThlHfH5WTJNuO2PSURl7RqddhOeYuAFMJS3KGHmiPTHHi4nUGphC46wlJSCMx66MGvOAb9hQe/GVZkJppfQ/+uBGalEZqoYYChCEu7f47QREsMVZINzk17gKHQJ6KU++cMzm0QkGx4esoDDIt/ygR4hKcnfUHDvQvCwQs7oSwk2KXaXZhJ74I8L2g0xVBiV5S8TsFZAN+rDwmfA7yvKKEjSV7SC2qE002KyqtRXmPpekkPBZK8phrXxZg0OUk/beB7TRUDTPqiNlYCjGD2yydJgxqkftuAF/dGpl9bgS5qN3dEWp8q8BvI1fn3gE8VpLEKrk4A4/U61GMdFgkZeK4m3pCzUzr0czVJ74iyA006PYn0YJO1CjL2ZFk6cKltJfKTZehG79G+eGTEfrSvsQp6T9RHpSH2s5V2w2k4bKIOMrPlVD3c2iIhQzdpMgt6q2OKny62TBS9x7sD8Z7Y491ovfd8vT8HiT1fbzfdU8qdSQiidN2lfR/v9mouaYOd/zzLXo7UPmHSWgm9j/i0ZkFU8FFBpBXQE0dXVmAUsdO+fmMRYCvm3ofcoovE2ATYW9TepwyjkaCEgHV1Yg54wg1Kh1ICbNtR73O2QeGPqYQ7NdP7oLNmAuzme5809ydCuQjqfHCjgzq/SeAPhWNzOMtCh6J+oDNMW6kQ0H54M8ncr+t5fD9gELdjkHEkDeDtvqRKQLtoyjHt1fVSuwcRJ+pCxzp9aMePuDh/10KA3eFGQHD/HiIZ0/Bu9UkiHl+WpePdvvMVB9wgZbUS0N7B5iWRu0holAzerfwhWeZpMuUUMU0UBnJP4t3mIAAlnSczBLgHitub1VdqO8gwRpjNW4h4mEi2EhmbmGRIiAaJaEOz3AoTlYV4gci8QMTnieSciPE8meZM37X5qRuYLyUNZpT6/w90zovK7G7v6wAAAABJRU5ErkJggg==' - } - callback(dataURL) - } - img.src = src - if (img.complete || img.complete === undefined) { - img.src = - 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==' - img.src = src - } -} diff --git a/src/utils/helpers.js b/src/utils/helpers.js deleted file mode 100644 index 5f36bf2..0000000 --- a/src/utils/helpers.js +++ /dev/null @@ -1,52 +0,0 @@ -module.exports = { - getTextForTitle, - getTextForDepartment, - getCursorForNode, -} - -function getTextForTitle(datum) { - if (!datum.person || !datum.person.totalReports) { - return '' - } - - const { - person: { totalReports }, - } = datum - const pluralEnding = totalReports > 1 ? 's' : '' - - return `${totalReports} supervisee${pluralEnding}` -} - -const departmentAbbrMap = { - Marketing: 'mktg', - Operations: 'ops', - Growth: 'gwth', - Branding: 'brand', - Assurance: 'fin', - Data: 'data', - Design: 'design', - Communications: 'comms', - Product: 'prod', - People: 'people', - Sales: 'sales', -} - -function getTextForDepartment(datum) { - if (!datum.person.department) { - return '' - } - - const { department } = datum.person - - if (departmentAbbrMap[department]) { - return departmentAbbrMap[department].toUpperCase() - } - - return datum.person.department.substring(0, 3).toUpperCase() -} - -function getCursorForNode(datum) { - return datum.children || datum._children || datum.hasChild - ? 'pointer' - : 'default' -} diff --git a/src/utils/index.js b/src/utils/index.js deleted file mode 100644 index a3fc0f2..0000000 --- a/src/utils/index.js +++ /dev/null @@ -1,6 +0,0 @@ -module.exports = { - collapse: require('./collapse'), - wrapText: require('./wrapText'), - helpers: require('./helpers'), - covertImageToBase64: require('./covertImageToBase64'), -} diff --git a/src/utils/wrapText.js b/src/utils/wrapText.js deleted file mode 100644 index 76a5200..0000000 --- a/src/utils/wrapText.js +++ /dev/null @@ -1,57 +0,0 @@ -const d3 = require('d3') - -// One way of achieving text-wrapping capability in SVG -module.exports = function wrapText(text, width) { - if (text.length === 0) { - return '' - } - - let editedClass = '' - - text[0].forEach(textNode => { - const text = d3.select(textNode) - const x = text.attr('x') - const y = text.attr('y') - const dy = parseFloat(text.attr('dy')) - const lineHeight = 1.1 - const words = text - .text() - .split(/\s+/) - .reverse() - - let lineNumber = 0 - let word - let line = [] - let tspan = text - .text(null) - .append('tspan') - .style('text-anchor', 'middle') - .attr('x', x) - .attr('y', y) - .attr('dy', dy + 'em') - - while ((word = words.pop())) { - line.push(word) - tspan.text(line.join(' ')) - - if (tspan.node().getComputedTextLength() > width) { - line.pop() - tspan.text(line.join(' ')) - line = [word] - tspan = text - .append('tspan') - .style('text-anchor', 'middle') - .attr('x', x) - .attr('y', y) - .attr('dy', ++lineNumber * lineHeight + dy + 'em') - .text(word) - } - } - - if (!editedClass) { - editedClass = text.attr('class').replace(' unedited', '') - } - - text.attr('class', editedClass) - }) -} diff --git a/src/vendor/base.js b/src/vendor/base.js deleted file mode 100644 index dd840bb..0000000 --- a/src/vendor/base.js +++ /dev/null @@ -1 +0,0 @@ -require('d3') diff --git a/src/vendor/example.js b/src/vendor/example.js deleted file mode 100644 index 2adb3d6..0000000 --- a/src/vendor/example.js +++ /dev/null @@ -1,4 +0,0 @@ -require('d3') -require('faker') -require('react') -require('react-dom') diff --git a/static/css/main.6060b8e6.chunk.css b/static/css/main.6060b8e6.chunk.css new file mode 100644 index 0000000..d0e06ef --- /dev/null +++ b/static/css/main.6060b8e6.chunk.css @@ -0,0 +1,2 @@ +body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}code{font-family:source-code-pro,Menlo,Monaco,Consolas,"Courier New",monospace}body,html{margin:0;height:100%;width:100%;font-size:12px;font-family:"SF UI Text",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";-webkit-font-smoothing:antialiased;overscroll-behavior:none}#react-org-chart,#root{margin:0;width:100%;height:100%;background-color:#f7f9fa}.org-chart-person-name{font-weight:600}.org-chart-person-link:hover g{fill:#409cf9!important}.org-chart-node:hover .org-chart-person-reports{fill:#fff!important}.zoom-buttons{position:absolute;top:0;left:0}.zoom-button{background-color:#31c8eb;border-radius:4px;font-size:16px;border:none;width:40px;height:40px;display:block!important;margin:8px}.zoom-button:hover{background-color:#2aa2bd;color:#fff} +/*# sourceMappingURL=main.6060b8e6.chunk.css.map */ \ No newline at end of file diff --git a/static/css/main.6060b8e6.chunk.css.map b/static/css/main.6060b8e6.chunk.css.map new file mode 100644 index 0000000..3d5b1a3 --- /dev/null +++ b/static/css/main.6060b8e6.chunk.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.css","App.css"],"names":[],"mappings":"AAAA,KACE,QAAS,CACT,mJAEY,CACZ,kCAAmC,CACnC,iCACF,CAEA,KACE,yEAEF,CCZA,UAEE,QAAS,CACT,WAAY,CACZ,UAAW,CACX,cAAe,CACf,6JAEmB,CACnB,kCAAmC,CACnC,wBACF,CACA,uBAEE,QAAS,CACT,UAAW,CACX,WAAY,CACZ,wBACF,CACA,uBACE,eACF,CACA,+BACE,sBACF,CACA,gDACE,mBACF,CAEA,cACE,iBAAkB,CAClB,KAAM,CACN,MACF,CAEA,aACE,wBAAyB,CACzB,iBAAkB,CAClB,cAAe,CACf,WAAY,CACZ,UAAW,CACX,WAAY,CACZ,uBAAyB,CACzB,UACF,CACA,mBACE,wBAAyB,CACzB,UACF","file":"main.6060b8e6.chunk.css","sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Oxygen\",\n \"Ubuntu\", \"Cantarell\", \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\",\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, \"Courier New\",\n monospace;\n}\n","html,\nbody {\n margin: 0;\n height: 100%;\n width: 100%;\n font-size: 12px;\n font-family: 'SF UI Text', -apple-system, BlinkMacSystemFont, 'Segoe UI',\n Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',\n 'Segoe UI Symbol';\n -webkit-font-smoothing: antialiased;\n overscroll-behavior: none;\n}\n#root,\n#react-org-chart {\n margin: 0;\n width: 100%;\n height: 100%;\n background-color: #f7f9fa;\n}\n.org-chart-person-name {\n font-weight: 600;\n}\n.org-chart-person-link:hover g {\n fill: #409cf9 !important;\n}\n.org-chart-node:hover .org-chart-person-reports {\n fill: #ffffff !important;\n}\n\n.zoom-buttons {\n position: absolute;\n top: 0;\n left: 0;\n}\n\n.zoom-button {\n background-color: #31c8eb;\n border-radius: 4px;\n font-size: 16px;\n border: none;\n width: 40px;\n height: 40px;\n display: block !important;\n margin: 8px;\n}\n.zoom-button:hover {\n background-color: #2aa2bd;\n color: white;\n}\n"]} \ No newline at end of file diff --git a/static/js/2.748d1f8b.chunk.js b/static/js/2.748d1f8b.chunk.js new file mode 100644 index 0000000..ea5d8df --- /dev/null +++ b/static/js/2.748d1f8b.chunk.js @@ -0,0 +1,3 @@ +/*! For license information please see 2.748d1f8b.chunk.js.LICENSE.txt */ +(this["webpackJsonporg-chart-example"]=this["webpackJsonporg-chart-example"]||[]).push([[2],[function(e,n,t){"use strict";e.exports=t(18)},function(e,n,t){"use strict";(function(e){t.d(n,"a",(function(){return M})),t.d(n,"b",(function(){return x})),t.d(n,"c",(function(){return b})),t.d(n,"d",(function(){return E}));var r=t(6),i=t(0),o=t.n(i),u=t(8),a=t.n(u),l=t(4),c=t(5),f=t(2),s=t(9),p=t.n(s),h=(t(12),t(7)),d=(t(16),"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof e?e:{});function g(e){var n=[];return{on:function(e){n.push(e)},off:function(e){n=n.filter((function(n){return n!==e}))},get:function(){return e},set:function(t,r){e=t,n.forEach((function(n){return n(e,r)}))}}}var v=o.a.createContext||function(e,n){var t,i,u="__create-react-context-"+function(){var e="__global_unique_id__";return d[e]=(d[e]||0)+1}()+"__",l=function(e){function t(){for(var n,t=arguments.length,r=new Array(t),i=0;i=0;p--){var h=u[p];"."===h?o(u,p):".."===h?(o(u,p),s++):s&&(o(u,p),s--)}if(!c)for(;s--;s)u.unshift("..");!c||""===u[0]||u[0]&&i(u[0])||u.unshift("");var d=u.join("/");return t&&"/"!==d.substr(-1)&&(d+="/"),d};function a(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}var l=function e(n,t){if(n===t)return!0;if(null==n||null==t)return!1;if(Array.isArray(n))return Array.isArray(t)&&n.length===t.length&&n.every((function(n,r){return e(n,t[r])}));if("object"===typeof n||"object"===typeof t){var r=a(n),i=a(t);return r!==n||i!==t?e(r,i):Object.keys(Object.assign({},n,t)).every((function(r){return e(n[r],t[r])}))}return!1},c=t(5);function f(e){return"/"===e.charAt(0)?e:"/"+e}function s(e){return"/"===e.charAt(0)?e.substr(1):e}function p(e,n){return function(e,n){return 0===e.toLowerCase().indexOf(n.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(n.length))}(e,n)?e.substr(n.length):e}function h(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function d(e){var n=e.pathname,t=e.search,r=e.hash,i=n||"/";return t&&"?"!==t&&(i+="?"===t.charAt(0)?t:"?"+t),r&&"#"!==r&&(i+="#"===r.charAt(0)?r:"#"+r),i}function g(e,n,t,i){var o;"string"===typeof e?(o=function(e){var n=e||"/",t="",r="",i=n.indexOf("#");-1!==i&&(r=n.substr(i),n=n.substr(0,i));var o=n.indexOf("?");return-1!==o&&(t=n.substr(o),n=n.substr(0,o)),{pathname:n,search:"?"===t?"":t,hash:"#"===r?"":r}}(e)).state=n:(void 0===(o=Object(r.a)({},e)).pathname&&(o.pathname=""),o.search?"?"!==o.search.charAt(0)&&(o.search="?"+o.search):o.search="",o.hash?"#"!==o.hash.charAt(0)&&(o.hash="#"+o.hash):o.hash="",void 0!==n&&void 0===o.state&&(o.state=n));try{o.pathname=decodeURI(o.pathname)}catch(a){throw a instanceof URIError?new URIError('Pathname "'+o.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):a}return t&&(o.key=t),i?o.pathname?"/"!==o.pathname.charAt(0)&&(o.pathname=u(o.pathname,i.pathname)):o.pathname=i.pathname:o.pathname||(o.pathname="/"),o}function v(e,n){return e.pathname===n.pathname&&e.search===n.search&&e.hash===n.hash&&e.key===n.key&&l(e.state,n.state)}function m(){var e=null;var n=[];return{setPrompt:function(n){return e=n,function(){e===n&&(e=null)}},confirmTransitionTo:function(n,t,r,i){if(null!=e){var o="function"===typeof e?e(n,t):e;"string"===typeof o?"function"===typeof r?r(o,i):i(!0):i(!1!==o)}else i(!0)},appendListener:function(e){var t=!0;function r(){t&&e.apply(void 0,arguments)}return n.push(r),function(){t=!1,n=n.filter((function(e){return e!==r}))}},notifyListeners:function(){for(var e=arguments.length,t=new Array(e),r=0;rn?t.splice(n,t.length-n,r):t.push(r),s({action:"PUSH",location:r,index:n,entries:t})}}))},replace:function(e,n){var r=g(e,n,p(),x.location);f.confirmTransitionTo(r,"REPLACE",t,(function(e){e&&(x.entries[x.index]=r,s({action:"REPLACE",location:r}))}))},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(e){var n=x.index+e;return n>=0&&n-1?"[^"+c(e)+"]+?":c(n)+"|(?:(?!"+c(n)+")[^"+c(e)+"])+?"}function a(e){return encodeURI(e).replace(/[\/?#]/g,(function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()}))}function l(e,n){for(var t=new Array(e.length),i=0;iN.length&&N.push(e)}function z(e,n,t){return null==e?0:function e(n,t,r,i){var a=typeof n;"undefined"!==a&&"boolean"!==a||(n=null);var l=!1;if(null===n)l=!0;else switch(a){case"string":case"number":l=!0;break;case"object":switch(n.$$typeof){case o:case u:l=!0}}if(l)return r(i,n,""===t?"."+R(n,0):t),1;if(l=0,t=""===t?".":t+":",Array.isArray(n))for(var c=0;c',o=r.open();if(null!==o&&o.document.write(i),o||"undefined"==typeof safari)return o;case"datauri":case"dataurl":return r.document.location.href="data:application/pdf;filename="+e.filename+";base64,"+btoa(n);default:return null}}).foo=function(){try{return O.apply(this,arguments)}catch(n){var t=n.stack||"";~t.indexOf(" at ")&&(t=t.split(" at ")[1]);var e="Error in function "+t.split("\n")[0].split("<")[0]+": "+n.message;if(!r.console)throw new Error(e);r.console.error(e,n),r.alert&&alert(e)}},(O.foo.bar=O).foo),Mt=function(t){return!0===Array.isArray(at)&&-1":")"),et=1):(Z=Jt(e),Q=Xt(n),$=(c?"<":"(")+L[K]+(c?">":")")),void 0!==H&&void 0!==H[K]&&(nt=H[K]+" Tw\n"),0!==P.length&&0===K?t.push(nt+P.join(" ")+" "+Z.toFixed(2)+" "+Q.toFixed(2)+" Tm\n"+$):1===et||0===et&&0===K?t.push(nt+Z.toFixed(2)+" "+Q.toFixed(2)+" Td\n"+$):t.push(nt+$);t=0===et?t.join(" Tj\nT* "):t.join(" Tj\n"),t+=" Tj\n";var rt="BT\n/"+E+" "+V+" Tf\n"+(V*h).toFixed(2)+" TL\n"+te+"\n";return rt+=u,rt+=t,z(rt+="ET"),f[E]=!0,d},d.__private__.lstext=d.lstext=function(t,e,n,r){return console.warn("jsPDF.lstext is deprecated"),this.text(t,e,n,{charSpace:r})},d.__private__.clip=d.clip=function(t){z("evenodd"===t?"W*":"W"),z("n")},d.__private__.clip_fixed=d.clip_fixed=function(t){console.log("clip_fixed is deprecated"),d.clip(t)};var Dt=d.__private__.isValidStyle=function(t){var e=!1;return-1!==[void 0,null,"S","F","DF","FD","f","f*","B","B*"].indexOf(t)&&(e=!0),e},zt=d.__private__.getStyle=function(t){var e="S";return"F"===t?e="f":"FD"===t||"DF"===t?e="B":"f"!==t&&"f*"!==t&&"B"!==t&&"B*"!==t||(e=t),e};d.__private__.line=d.line=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw new Error("Invalid arguments passed to jsPDF.line");return this.lines([[n-t,r-e]],t,e)},d.__private__.lines=d.lines=function(t,e,n,r,i,o){var a,s,l,c,u,h,f,d,p,g,m,v;if("number"==typeof t&&(v=n,n=e,e=t,t=v),r=r||[1,1],o=o||!1,isNaN(e)||isNaN(n)||!Array.isArray(t)||!Array.isArray(r)||!Dt(i)||"boolean"!=typeof o)throw new Error("Invalid arguments passed to jsPDF.lines");for(z(b(Jt(e))+" "+b(Xt(n))+" m "),a=r[0],s=r[1],c=t.length,g=e,m=n,l=0;l=a.length-1;if(A&&!S){w+=" ";continue}if(A||S){if(S)v=N;else if(t.multiline&&c<(f+2)*(b+2)+2)continue t}else{if(!t.multiline)continue t;if(c<(f+2)*(b+2)+2)continue t;v=N}for(var _="",C=m;C<=v;C++)_+=a[C]+" ";switch(_=" "==_.substr(_.length-1)?_.substr(0,_.length-1):_,y=L(_,t,l).width,t.textAlign){case"right":p=u-y-2;break;case"center":p=(u-y)/2;break;case"left":default:p=2}e+=s(p)+" "+s(g)+" Td\n",e+="("+o(_)+") Tj\n",e+=-s(p)+" 0 Td\n",g=-(l+2),y=0,m=v+1,b++,w=""}break}return i.text=e,i.fontSize=l,i},L=function(t,e,r){var i=n.internal.getFont(e.fontName,e.fontStyle),o=n.getStringUnitWidth(t,{font:i,fontSize:parseFloat(r),charSpace:0})*parseFloat(r);return{height:n.getStringUnitWidth("3",{font:i,fontSize:parseFloat(r),charSpace:0})*parseFloat(r)*1.5,width:o}},N={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},A=function(){n.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var r=t[e];r.objId=void 0,r.hasAnnotation&&S.call(n,r)}},S=function(t){var e={type:"reference",object:t};void 0===n.internal.getPageInfo(t.page).pageContext.annotations.find((function(t){return t.type===e.type&&t.object===e.object}))&&n.internal.getPageInfo(t.page).pageContext.annotations.push(e)},_=function(){if(void 0===n.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");n.internal.write("/AcroForm "+n.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")},C=function(){n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID,n.internal.acroformPlugin.printedOut=!0},k=function(t){var e=!t;for(var r in t||(n.internal.newObjectDeferredBegin(n.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),n.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),t=t||n.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(t.hasOwnProperty(r)){var o=t[r],a=[],s=o.Rect;if(o.Rect&&(o.Rect=w.call(this,o.Rect)),n.internal.newObjectDeferredBegin(o.objId,!0),o.DA=J.createDefaultAppearanceStream(o),"object"===i(o)&&"function"==typeof o.getKeyValueListForStream&&(a=o.getKeyValueListForStream()),o.Rect=s,o.hasAppearanceStream&&!o.appearanceStreamContent){var l=b.call(this,o);a.push({key:"AP",value:"<>"}),n.internal.acroformPlugin.xForms.push(l)}if(o.appearanceStreamContent){var c="";for(var u in o.appearanceStreamContent)if(o.appearanceStreamContent.hasOwnProperty(u)){var h=o.appearanceStreamContent[u];if(c+="/"+u+" ",c+="<<",1<=Object.keys(h).length||Array.isArray(h))for(var r in h){var f;h.hasOwnProperty(r)&&("function"==typeof(f=h[r])&&(f=f.call(this,o)),c+="/"+r+" "+f+" ",0<=n.internal.acroformPlugin.xForms.indexOf(f)||n.internal.acroformPlugin.xForms.push(f))}else"function"==typeof(f=h)&&(f=f.call(this,o)),c+="/"+r+" "+f,0<=n.internal.acroformPlugin.xForms.indexOf(f)||n.internal.acroformPlugin.xForms.push(f);c+=">>"}a.push({key:"AP",value:"<<\n"+c+">>"})}n.internal.putStream({additionalKeyValues:a}),n.internal.out("endobj")}e&&P.call(this,n.internal.acroformPlugin.xForms)},P=function(t){for(var e in t)if(t.hasOwnProperty(e)){var r=e,o=t[e];n.internal.newObjectDeferredBegin(o&&o.objId,!0),"object"===i(o)&&"function"==typeof o.putStream&&o.putStream(),delete t[r]}},I=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(n=this,M.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(N)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");r=n.internal.scaleFactor,n.internal.acroformPlugin.acroFormDictionaryRoot=new O,n.internal.acroformPlugin.acroFormDictionaryRoot._eventID=n.internal.events.subscribe("postPutResources",C),n.internal.events.subscribe("buildDocument",A),n.internal.events.subscribe("putCatalog",_),n.internal.events.subscribe("postPutPages",k),n.internal.acroformPlugin.isInitialized=!0}},F=t.__acroform__.arrayToPdfArray=function(t){if(Array.isArray(t)){for(var e="[",n=0;n>"),n.join("\n")}},set:function(t){"object"===i(t)&&(e=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(t){"string"==typeof t&&(e.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(e){t="/"+e}})};c(z,M);var U=function(){z.call(this),this.pushButton=!0};c(U,z);var H=function(){z.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=void 0!==e?e:[]}})};c(H,z);var W=function(){var t,e;M.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(t){e=t}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t,e=[];for(t in e.push("<<"),r)e.push("/"+t+" ("+r[t]+")");return e.push(">>"),e.join("\n")},set:function(t){"object"===i(t)&&(r=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(t){"string"==typeof t&&(r.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(t){n="/"+t}}),this.optionName=name,this.caption="l",this.appearanceState="Off",this._AppearanceType=J.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(name)};c(W,M),H.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},H.prototype.createOption=function(t){this.Kids.length;var e=new W;return e.Parent=this,e.optionName=t,this.Kids.push(e),X.call(this,e),e};var V=function(){z.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=J.CheckBox.createAppearanceStream()};c(V,z);var G=function(){M.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(m(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,13):this.Ff=y(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(m(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,21):this.Ff=y(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(m(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,23):this.Ff=y(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(m(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,24):this.Ff=y(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(m(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,25):this.Ff=y(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(m(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,26):this.Ff=y(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};c(G,M);var Y=function(){G.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(m(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,14):this.Ff=y(this.Ff,14)}}),this.password=!0};c(Y,G);var J={CheckBox:{createAppearanceStream:function(){return{N:{On:J.CheckBox.YesNormal},D:{On:J.CheckBox.YesPushDown,Off:J.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=f(t),r=[],i=n.internal.getFont(t.fontName,t.fontStyle).id,o=n.__private__.encodeColorString(t.color),a=x(t,t.caption);return r.push("0.749023 g"),r.push("0 0 "+s(J.internal.getWidth(t))+" "+s(J.internal.getHeight(t))+" re"),r.push("f"),r.push("BMC"),r.push("q"),r.push("0 0 1 rg"),r.push("/"+i+" "+s(a.fontSize)+" Tf "+o),r.push("BT"),r.push(a.text),r.push("ET"),r.push("Q"),r.push("EMC"),e.stream=r.join("\n"),e},YesNormal:function(t){var e=f(t),r=n.internal.getFont(t.fontName,t.fontStyle).id,i=n.__private__.encodeColorString(t.color),o=[],a=J.internal.getHeight(t),l=J.internal.getWidth(t),c=x(t,t.caption);return o.push("1 g"),o.push("0 0 "+s(l)+" "+s(a)+" re"),o.push("f"),o.push("q"),o.push("0 0 1 rg"),o.push("0 0 "+s(l-1)+" "+s(a-1)+" re"),o.push("W"),o.push("n"),o.push("0 g"),o.push("BT"),o.push("/"+r+" "+s(c.fontSize)+" Tf "+i),o.push(c.text),o.push("ET"),o.push("Q"),e.stream=o.join("\n"),e},OffPushDown:function(t){var e=f(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+s(J.internal.getWidth(t))+" "+s(J.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:J.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=J.RadioButton.Circle.YesNormal,e.D[t]=J.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=f(t),n=[],r=J.internal.getWidth(t)<=J.internal.getHeight(t)?J.internal.getWidth(t)/4:J.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=J.internal.Bezier_C,o=Number((r*i).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+l(J.internal.getWidth(t)/2)+" "+l(J.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=f(t),n=[],r=J.internal.getWidth(t)<=J.internal.getHeight(t)?J.internal.getWidth(t)/4:J.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*J.internal.Bezier_C).toFixed(5)),a=Number((r*J.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+l(J.internal.getWidth(t)/2)+" "+l(J.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+l(J.internal.getWidth(t)/2)+" "+l(J.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+a+" "+a+" "+r+" 0 "+r+" c"),n.push("-"+a+" "+r+" -"+r+" "+a+" -"+r+" 0 c"),n.push("-"+r+" -"+a+" -"+a+" -"+r+" 0 -"+r+" c"),n.push(a+" -"+r+" "+r+" -"+a+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=f(t),n=[],r=J.internal.getWidth(t)<=J.internal.getHeight(t)?J.internal.getWidth(t)/4:J.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*J.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+l(J.internal.getWidth(t)/2)+" "+l(J.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:J.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=J.RadioButton.Cross.YesNormal,e.D[t]=J.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=f(t),n=[],r=J.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+s(J.internal.getWidth(t)-2)+" "+s(J.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(s(r.x1.x)+" "+s(r.x1.y)+" m"),n.push(s(r.x2.x)+" "+s(r.x2.y)+" l"),n.push(s(r.x4.x)+" "+s(r.x4.y)+" m"),n.push(s(r.x3.x)+" "+s(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=f(t),n=J.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+s(J.internal.getWidth(t))+" "+s(J.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+s(J.internal.getWidth(t)-2)+" "+s(J.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(s(n.x1.x)+" "+s(n.x1.y)+" m"),r.push(s(n.x2.x)+" "+s(n.x2.y)+" l"),r.push(s(n.x4.x)+" "+s(n.x4.y)+" m"),r.push(s(n.x3.x)+" "+s(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=f(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+s(J.internal.getWidth(t))+" "+s(J.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){var e=n.internal.getFont(t.fontName,t.fontStyle).id,r=n.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+r}};J.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=J.internal.getWidth(t),n=J.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},J.internal.getWidth=function(t){var e=0;return"object"===i(t)&&(e=u(t.Rect[2])),e},J.internal.getHeight=function(t){var e=0;return"object"===i(t)&&(e=u(t.Rect[3])),e};var X=t.addField=function(t){if(I.call(this),!(t instanceof M))throw new Error("Invalid argument passed to jsPDF.addField.");return function(t){n.internal.acroformPlugin.printedOut&&(n.internal.acroformPlugin.printedOut=!1,n.internal.acroformPlugin.acroFormDictionaryRoot=null),n.internal.acroformPlugin.acroFormDictionaryRoot||I.call(n),n.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)}.call(this,t),t.page=n.internal.getCurrentPageInfo().pageNumber,this};t.addButton=function(t){if(t instanceof z==0)throw new Error("Invalid argument passed to jsPDF.addButton.");return X.call(this,t)},t.addTextField=function(t){if(t instanceof G==0)throw new Error("Invalid argument passed to jsPDF.addTextField.");return X.call(this,t)},t.addChoiceField=function(t){if(t instanceof T==0)throw new Error("Invalid argument passed to jsPDF.addChoiceField.");return X.call(this,t)},"object"==i(e)&&void 0===e.ChoiceField&&void 0===e.ListBox&&void 0===e.ComboBox&&void 0===e.EditBox&&void 0===e.Button&&void 0===e.PushButton&&void 0===e.RadioButton&&void 0===e.CheckBox&&void 0===e.TextField&&void 0===e.PasswordField?(e.ChoiceField=T,e.ListBox=q,e.ComboBox=R,e.EditBox=D,e.Button=z,e.PushButton=U,e.RadioButton=H,e.CheckBox=V,e.TextField=G,e.PasswordField=Y,e.AcroForm={Appearance:J}):console.warn("AcroForm-Classes are not populated into global-namespace, because the class-Names exist already."),t.AcroFormChoiceField=T,t.AcroFormListBox=q,t.AcroFormComboBox=R,t.AcroFormEditBox=D,t.AcroFormButton=z,t.AcroFormPushButton=U,t.AcroFormRadioButton=H,t.AcroFormCheckBox=V,t.AcroFormTextField=G,t.AcroFormPasswordField=Y,t.AcroFormAppearance=J,t.AcroForm={ChoiceField:T,ListBox:q,ComboBox:R,EditBox:D,Button:z,PushButton:U,RadioButton:H,CheckBox:V,TextField:G,PasswordField:Y,Appearance:J}})((window.tmp=pt).API,"undefined"!=typeof window&&window||void 0!==r&&r),function(t){var e="addImage_",n={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},r=t.getImageFileTypeByImageData=function(e,r){var i,o;r=r||"UNKNOWN";var a,s,l,c="UNKNOWN";for(l in t.isArrayBufferView(e)&&(e=t.arrayBufferToBinaryString(e)),n)for(a=n[l],i=0;i>"}),"trns"in e&&e.trns.constructor==Array){for(var s="",l=0,c=e.trns.length;l>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==a?n+=r[(252&(e=i[s]))>>2]+r[(3&e)<<4]+"==":2==a&&(n+=r[(64512&(e=i[s]<<8|i[s+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+"="),n},t.createImageInfo=function(t,e,n,r,i,o,a,s,l,c,u,h,f){var d={alias:s,w:e,h:n,cs:r,bpc:i,i:a,data:t};return o&&(d.f=o),l&&(d.dp=l),c&&(d.trns=c),u&&(d.pal=u),h&&(d.smask=h),f&&(d.p=f),d},t.addImage=function(n,r,o,f,d,p,g,m,v){var y="";if("string"!=typeof r){var w=p;p=d,d=f,f=o,o=r,r=w}if("object"===i(n)&&!c(n)&&"imageData"in n){var b=n;n=b.imageData,r=b.format||r||"UNKNOWN",o=b.x||o||0,f=b.y||f||0,d=b.w||d,p=b.h||p,g=b.alias||g,m=b.compression||m,v=b.rotation||b.angle||v}var x=this.internal.getFilters();if(void 0===m&&-1!==x.indexOf("FlateEncode")&&(m="SLOW"),"string"==typeof n&&(n=unescape(n)),isNaN(o)||isNaN(f))throw console.error("jsPDF.addImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addImage");var L,N,A,S,_,C,k,P=function(){var t=this.internal.collections[e+"images"];return t||(this.internal.collections[e+"images"]=t={},this.internal.events.subscribe("putResources",a),this.internal.events.subscribe("putXobjectDict",s)),t}.call(this);if(!((L=h(n,P))||(c(n)&&(n=u(n,r)),(null==(k=g)||0===k.length)&&(g="string"==typeof(C=n)?t.sHashCode(C):t.isArrayBufferView(C)?t.sHashCode(t.arrayBufferToBinaryString(C)):null),L=h(g,P)))){if(this.isString(n)&&(""!==(y=this.convertStringToImageData(n))||void 0!==(y=t.loadFile(n)))&&(n=y),r=this.getImageFileTypeByImageData(n,r),!l(r))throw new Error("addImage does not support files of type '"+r+"', please ensure that a plugin for '"+r+"' support is added.");if(this.supportsArrayBuffer()&&(n instanceof Uint8Array||(N=n,n=this.binaryStringToUint8Array(n))),!(L=this["process"+r.toUpperCase()](n,(_=0,(S=P)&&(_=Object.keys?Object.keys(S).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(S)),_),g,((A=m)&&"string"==typeof A&&(A=A.toUpperCase()),A in t.image_compression?A:t.image_compression.NONE),N)))throw new Error("An unknown error occurred whilst processing the image")}return function(t,e,n,r,i,o,a,s){var l=function(t,e,n){return t||e||(e=t=-96),t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor),0===t&&(t=e*n.w/n.h),0===e&&(e=t*n.h/n.w),[t,e]}.call(this,n,r,i),c=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString;if(n=l[0],r=l[1],a[o]=i,s){s*=Math.PI/180;var h=Math.cos(s),f=Math.sin(s),d=function(t){return t.toFixed(4)},p=[d(h),d(f),d(-1*f),d(h),0,0,"cm"]}this.internal.write("q"),s?(this.internal.write([1,"0","0",1,c(t),u(e+r),"cm"].join(" ")),this.internal.write(p.join(" ")),this.internal.write([c(n),"0","0",c(r),"0","0","cm"].join(" "))):this.internal.write([c(n),"0","0",c(r),c(t),u(e+r),"cm"].join(" ")),this.internal.write("/I"+i.i+" Do"),this.internal.write("Q")}.call(this,o,f,d,p,L,L.i,P,v),this},t.convertStringToImageData=function(e){var n,r="";if(this.isString(e)){var i;n=null!==(i=this.extractImageFromDataUrl(e))?i.data:e;try{r=atob(n)}catch(e){throw t.validateStringAsBase64(n)?new Error("atob-Error in jsPDF.convertStringToImageData "+e.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertStringToImageData ")}}return r};var f=function(t,e){return t.subarray(e,e+5)};t.processJPEG=function(t,e,n,i,o,a){var s,l=this.decode.DCT_DECODE;if(!this.isString(t)&&!this.isArrayBuffer(t)&&!this.isArrayBufferView(t))return null;if(this.isString(t)&&(s=function(t){var e;if("JPEG"!==r(t))throw new Error("getJpegSize requires a binary string jpeg file");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),i=4,o=t.length;i>",c.content=m;var f=c.objId+" 0 R";m="<>";else if(l.options.pageNumber)switch(m="<>",this.internal.write(m))}}this.internal.write("]")}}]),a.createAnnotation=function(t){var e=this.internal.getCurrentPageInfo();switch(t.type){case"link":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case"text":case"freetext":e.pageContext.annotations.push(t)}},a.link=function(t,e,n,r,i){this.internal.getCurrentPageInfo().pageContext.annotations.push({x:t,y:e,w:n,h:r,options:i,type:"link"})},a.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,n),n+=.2*o,this.link(e,n-o,i,o,r),i},a.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor},function(t){var e={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},n={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},r={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},i=[1570,1571,1573,1575];t.__arabicParser__={};var o=t.__arabicParser__.isInArabicSubstitutionA=function(t){return void 0!==e[t.charCodeAt(0)]},a=t.__arabicParser__.isArabicLetter=function(t){return"string"==typeof t&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(t)},s=t.__arabicParser__.isArabicEndLetter=function(t){return a(t)&&o(t)&&e[t.charCodeAt(0)].length<=2},l=t.__arabicParser__.isArabicAlfLetter=function(t){return a(t)&&0<=i.indexOf(t.charCodeAt(0))},c=(t.__arabicParser__.arabicLetterHasIsolatedForm=function(t){return a(t)&&o(t)&&1<=e[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasFinalForm=function(t){return a(t)&&o(t)&&2<=e[t.charCodeAt(0)].length}),u=(t.__arabicParser__.arabicLetterHasInitialForm=function(t){return a(t)&&o(t)&&3<=e[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasMedialForm=function(t){return a(t)&&o(t)&&4==e[t.charCodeAt(0)].length}),h=t.__arabicParser__.resolveLigatures=function(t){var e=0,r=n,i=0,o="",a=0;for(e=0;e>"),this.internal.out("endobj")})),this.internal.events.subscribe("putCatalog",(function(){this.internal.out("/OpenAction "+e+" 0 R")}))}return this},s=pt.API,(l=function(){var t=void 0;Object.defineProperty(this,"pdf",{get:function(){return t},set:function(e){t=e}});var e=150;Object.defineProperty(this,"width",{get:function(){return e},set:function(t){e=isNaN(t)||!1===Number.isInteger(t)||t<0?150:t,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=e+1)}});var n=300;Object.defineProperty(this,"height",{get:function(){return n},set:function(t){n=isNaN(t)||!1===Number.isInteger(t)||t<0?300:t,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=n+1)}});var r=[];Object.defineProperty(this,"childNodes",{get:function(){return r},set:function(t){r=t}});var i={};Object.defineProperty(this,"style",{get:function(){return i},set:function(t){i=t}}),Object.defineProperty(this,"parentNode",{get:function(){return!1}})}).prototype.getContext=function(t,e){var n;if("2d"!==(t=t||"2d"))return null;for(n in e)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=e[n]);return(this.pdf.context2d._canvas=this).pdf.context2d},l.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},s.events.push(["initialized",function(){this.canvas=new l,this.canvas.pdf=this}]),c=pt.API,h={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},f=1,d=function(t,e,n,r,i){h={x:t,y:e,w:n,h:r,ln:i}},p=function(){return h},g={left:0,top:0,bottom:0},c.setHeaderFunction=function(t){u=t},c.getTextDimensions=function(t,e){var n=this.table_font_size||this.internal.getFontSize(),r=(this.internal.getFont().fontStyle,(e=e||{}).scaleFactor||this.internal.scaleFactor),i=0,o=0,a=0;if("string"==typeof t)0!=(i=this.getStringUnitWidth(t)*n)&&(o=1);else{if("[object Array]"!==Object.prototype.toString.call(t))throw new Error("getTextDimensions expects text-parameter to be of type String or an Array of Strings.");for(var s=0;s=this.internal.pageSize.getHeight()-c.bottom&&(this.cellAddPage(),l=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(o,!0)),e=p().y+p().h,l&&(e=23)}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,"FD"):this.rect(t,e,n,r),"right"===a){i instanceof Array||(i=[i]);for(var u=0;u=2*Math.PI&&(r=0,i=2*Math.PI),this.path.push({type:"arc",x:t,y:e,radius:n,startAngle:r,endAngle:i,counterclockwise:o})},c.prototype.arcTo=function(t,e,n,r,i){throw new Error("arcTo not implemented.")},c.prototype.rect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.lineTo(t+n,e),this.lineTo(t,e)},c.prototype.fillRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!h.call(this)){var i={};"butt"!==this.lineCap&&(i.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(i.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(t,e,n,r),this.fill(),i.hasOwnProperty("lineCap")&&(this.lineCap=i.lineCap),i.hasOwnProperty("lineJoin")&&(this.lineJoin=i.lineJoin)}},c.prototype.strokeRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");f.call(this)||(this.beginPath(),this.rect(t,e,n,r),this.stroke())},c.prototype.clearRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(t,e,n,r))},c.prototype.save=function(t){t="boolean"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n"},y=function(t){var e,n,r,i,o,a=String,s="length",l="charCodeAt",c="slice",u="replace";for(t[c](-2),t=t[c](0,-2)[u](/\s/g,"")[u]("z","!!!!!"),r=[],i=0,o=(t+=e="uuuuu"[c](t[s]%5||5))[s];i>24,255&n>>16,255&n>>8,255&n);return function(t,n){for(var r=e[s];0"},b=function(t){var e=new RegExp(/^([0-9A-Fa-f]{2})+$/);if(-1!==(t=t.replace(/\s/g,"")).indexOf(">")&&(t=t.substr(0,t.indexOf(">"))),t.length%2&&(t+="0"),!1===e.test(t))return"";for(var n="",r=0;r>8&255,n>>16&255,n>>24&255]),t.length+2),String.fromCharCode.apply(null,i)},m.processDataByFilters=function(t,e){var n=0,r=t||"",i=[];for("string"==typeof(e=e||[])&&(e=[e]),n=0;n>"),this.internal.out("endobj"),P=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+I+")"),this.internal.out(">>"),this.internal.out("endobj")})),this.internal.events.subscribe("putCatalog",(function(){void 0!==k&&void 0!==P&&this.internal.out("/Names <>")})),this},(F=pt.API).events.push(["postPutResources",function(){var t=this,e=/^(\d+) 0 obj$/;if(0> endobj")}var h=t.internal.newObject();for(t.internal.write("<< /Names [ "),r=0;r>","endobj"),t.internal.newObject(),t.internal.write("<< /Dests "+h+" 0 R"),t.internal.write(">>","endobj")}}]),F.events.push(["putCatalog",function(){0> \r\nendobj\r\n"},t.outline.count_r=function(t,e){for(var n=0;n>>24&255,f[h++]=s>>>16&255,f[h++]=s>>>8&255,f[h++]=255&s,B.arrayBufferToBinaryString(f)},O=function(t,e){var n=Math.LOG2E*Math.log(32768)-8<<4|8,r=n<<8;return r|=Math.min(3,(e-1&255)>>1)<<6,r|=0,[n,255&(r+=31-r%31)]},M=function(t,e){for(var n,r=1,i=0,o=t.length,a=0;0>>0},T=function(t,e,n,r){for(var i,o,a,s=t.length/e,l=new Uint8Array(t.length+s),c=W(),u=0;u>>1)&255;return o},U=function(t,e,n){var r,i,o,a,s=[],l=0,c=t.length;for(s[0]=4;l>>p&255,p+=o.bits;v[w]=x>>>p&255}if(16===o.bits){g=(_=new Uint32Array(o.decodePixels().buffer)).length,m=new Uint8Array(g*(32/o.pixelBitlength)*o.colors),v=new Uint8Array(g*(32/o.pixelBitlength));for(var x,L=1>>0&255,L&&(m[b++]=x>>>16&255,x=_[w++],m[b++]=x>>>0&255),v[N++]=x>>>16&255;d=8}r!==B.image_compression.NONE&&E()?(t=j(m,o.width*o.colors,o.colors,r),u=j(v,o.width,1,r)):(t=m,u=v,f=null)}if(3===o.colorType&&(h=this.color_spaces.INDEXED,c=o.palette,o.transparency.indexed)){var A=o.transparency.indexed,S=0;for(w=0,g=A.length;wr&&(i.push(t.slice(l,o)),s=0,l=o),s+=e[o],o++;return l!==o&&i.push(t.slice(l,o)),i},tt=function(t,e,n){n||(n={});var r,i,o,a,s,l,c=[],u=[c],h=n.textIndent||0,f=0,d=0,p=t.split(" "),g=K.apply(this,[" ",n])[0];if(l=-1===n.lineIndent?p[0].length+2:n.lineIndent||0){var m=Array(l).join(" "),v=[];p.map((function(t){1<(t=t.split(/\s*\n/)).length?v=v.concat(t.map((function(t,e){return(e&&t.length?"\n":"")+t}))):v.push(t[0])})),p=v,l=Q.apply(this,[m,n])}for(o=0,a=p.length;o>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},lt=pt.API,ht=ut=ct="",lt.addMetadata=function(t,e){return ut=e||"http://jspdf.default.namespaceuri/",ct=t,this.internal.events.subscribe("postPutResources",(function(){if(ct){var t='',e=unescape(encodeURIComponent('')),n=unescape(encodeURIComponent(t)),r=unescape(encodeURIComponent(ct)),i=unescape(encodeURIComponent("")),o=unescape(encodeURIComponent("")),a=n.length+r.length+i.length+e.length+o.length;ht=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+a+" >>"),this.internal.write("stream"),this.internal.write(e+n+r+i+o),this.internal.write("endstream"),this.internal.write("endobj")}else ht=""})),this.internal.events.subscribe("putCatalog",(function(){ht&&this.internal.write("/Metadata "+ht+" 0 R")})),this},function(t,e){var n=t.API,r=n.pdfEscape16=function(t,e){for(var n,r=e.metadata.Unicode.widths,i=["","0","00","000","0000"],o=[""],a=0,s=t.length;a<"+i+">");return r.length&&(o+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),o+"endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};n.events.push(["putFont",function(e){!function(e,n,r,o){if(e.metadata instanceof t.API.TTFFont&&"Identity-H"===e.encoding){for(var a=e.metadata.Unicode.widths,s=e.metadata.subset.encode(e.metadata.glyIdsUsed,1),l="",c=0;c>"),n("endobj");var d=r();n("<<"),n("/Type /Font"),n("/BaseFont /"+e.fontName),n("/FontDescriptor "+f+" 0 R"),n("/W "+t.API.PDFObject.convert(a)),n("/CIDToGIDMap /Identity"),n("/DW 1000"),n("/Subtype /CIDFontType2"),n("/CIDSystemInfo"),n("<<"),n("/Supplement 0"),n("/Registry (Adobe)"),n("/Ordering ("+e.encoding+")"),n(">>"),n(">>"),n("endobj"),e.objectNumber=r(),n("<<"),n("/Type /Font"),n("/Subtype /Type0"),n("/ToUnicode "+h+" 0 R"),n("/BaseFont /"+e.fontName),n("/Encoding /"+e.encoding),n("/DescendantFonts ["+d+" 0 R]"),n(">>"),n("endobj"),e.isAlreadyPutted=!0}}(e.font,e.out,e.newObject,e.putStream)}]),n.events.push(["putFont",function(e){!function(e,n,r,o){if(e.metadata instanceof t.API.TTFFont&&"WinAnsiEncoding"===e.encoding){e.metadata.Unicode.widths;for(var a=e.metadata.rawData,s="",l=0;l>"),n("endobj"),e.objectNumber=r(),l=0;l>"),n("endobj"),e.isAlreadyPutted=!0}}(e.font,e.out,e.newObject,e.putStream)}]);var o=function(t){var e,n,i=t.text||"",o=t.x,a=t.y,s=t.options||{},l=t.mutex||{},c=l.pdfEscape,u=l.activeFontKey,h=l.fonts,f=(l.activeFontSize,""),d=0,p="",g=h[n=u].encoding;if("Identity-H"!==h[n].encoding)return{text:i,x:o,y:a,options:s,mutex:l};for(p=i,n=u,"[object Array]"===Object.prototype.toString.call(i)&&(p=i[0]),d=0;dl-c.top-c.bottom&&r.pagesplit){var p=function(t,e,n,i,o){var a=document.createElement("canvas");a.height=o,a.width=i;var s=a.getContext("2d");return s.mozImageSmoothingEnabled=!1,s.webkitImageSmoothingEnabled=!1,s.msImageSmoothingEnabled=!1,s.imageSmoothingEnabled=!1,s.fillStyle=r.backgroundColor||"#ffffff",s.fillRect(0,0,i,o),s.drawImage(t,e,n,i,o,0,0,i,o),a},g=function(){for(var r,o,u=0,g=0,m={},v=!1;;){var y;if(g=0,m.top=0!==u?c.top:n,m.left=0!==u?c.left:e,v=(s-c.left-c.right)*a=t.width)break;this.addPage()}else w=[y=p(t,0,u,r,o),m.left,m.top,y.width/a,y.height/a,f,null,d],this.addImage.apply(this,w);if((u+=o)>=t.height)break;this.addPage()}i(h,u,null,w)}.bind(this);if("CANVAS"===t.nodeName){var m=new Image;m.onload=g,m.src=t.toDataURL("image/png"),t=m}else g()}else{var v=Math.random().toString(35),y=[t,e,n,h,u,f,v,d];this.addImage.apply(this,y),i(h,u,v,y)}}.bind(this),"undefined"!=typeof html2canvas&&!r.rstz)return html2canvas(t,r);if("undefined"==typeof rasterizeHTML)return null;var c="drawDocument";return"string"==typeof t&&(c=/^http/.test(t)?"drawURL":"drawHTML"),r.width=r.width||s*a,rasterizeHTML[c](t,void 0,r).then((function(t){r.onrendered(t.image)}),(function(t){i(null,t)}))},function(t){var e,n,r,o,a,s,l,c,u,h,f,d,p,g,m,v,y,w,b,x;e=function(){return function(e){return t.prototype=e,new t};function t(){}}(),h=function(t){var e,n,r,i,o,a,s;for(n=0,r=t.length,e=void 0,a=i=!1;!i&&n!==r;)(e=t[n]=t[n].trimLeft())&&(i=!0),n++;for(n=r-1;r&&!a&&-1!==n;)(e=t[n]=t[n].trimRight())&&(a=!0),n--;for(o=/\s+$/g,s=!0,n=0;n!==r;)"\u2028"!=t[n]&&(e=t[n].replace(/\s+/g," "),s&&(e=e.trimLeft()),e&&(s=o.test(e)),t[n]=e),n++;return t},d=function(t){var e,n,i;for(e=void 0,n=(i=t.split(",")).shift();!e&&n;)e=r[n.trim().toLowerCase()],n=i.shift();return e},p=function(t){var e;return-1<(t="auto"===t?"0px":t).indexOf("em")&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"),-1r.pdf.margins_doc.top&&(r.pdf.addPage(),r.y=r.pdf.margins_doc.top,r.executeWatchFunctions(a));var P=u(a),I=r.x,F=12/r.pdf.internal.scaleFactor,B=(P["margin-left"]+P["padding-left"])*F,E=(P["margin-right"]+P["padding-right"])*F,j=(P["margin-top"]+P["padding-top"])*F,O=(P["margin-bottom"]+P["padding-bottom"])*F;void 0!==P.float&&"right"===P.float?I+=r.settings.width-a.width-E:I+=B,r.pdf.addImage(C,I,r.y+j,a.width,a.height),C=void 0,"right"===P.float||"left"===P.float?(r.watchFunctions.push(function(t,e,n,i){return r.y>=e?(r.x+=t,r.settings.width+=n,!0):!!(i&&1===i.nodeType&&!L[i.nodeName]&&r.x+i.width>r.pdf.margins_doc.left+r.pdf.margins_doc.width)&&(r.x+=t,r.y=e,r.settings.width+=n,!0)}.bind(this,"left"===P.float?-a.width-B-E:0,r.y+a.height+j+O,a.width)),r.watchFunctions.push(function(t,e,n){return!(r.y]*?>/gi,""),u="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),(c=document.createElement("div")).style.cssText="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",c.innerHTML='',i=ie.open();if(null!==i&&i.document.write(r),i||\"undefined\"==typeof safari)return i;case\"datauri\":case\"dataurl\":return ie.document.location.href=\"data:application/pdf;filename=\"+e.filename+\";base64,\"+btoa(n);default:return null}}).foo=function(){try{return F.apply(this,arguments)}catch(t){var e=t.stack||\"\";~e.indexOf(\" at \")&&(e=e.split(\" at \")[1]);var n=\"Error in function \"+e.split(\"\\n\")[0].split(\"<\")[0]+\": \"+t.message;if(!ie.console)throw new Error(n);ie.console.error(n,t),ie.alert&&alert(n)}},(F.foo.bar=F).foo),Bt=function(t){return!0===Array.isArray(Y)&&-1\":\")\"),Y=1):(W=Wt(e),V=Vt(n),G=(l?\"<\":\"(\")+v[H]+(l?\">\":\")\")),void 0!==q&&void 0!==q[H]&&(J=q[H]+\" Tw\\n\"),0!==S.length&&0===H?t.push(J+S.join(\" \")+\" \"+W.toFixed(2)+\" \"+V.toFixed(2)+\" Tm\\n\"+G):1===Y||0===Y&&0===H?t.push(J+W.toFixed(2)+\" \"+V.toFixed(2)+\" Td\\n\"+G):t.push(J+G);t=0===Y?t.join(\" Tj\\nT* \"):t.join(\" Tj\\n\"),t+=\" Tj\\n\";var X=\"BT\\n/\"+$+\" \"+et+\" Tf\\n\"+(et*u).toFixed(2)+\" TL\\n\"+Kt+\"\\n\";return X+=h,X+=t,tt(X+=\"ET\"),K[$]=!0,c},l.__private__.lstext=l.lstext=function(t,e,n,r){return console.warn(\"jsPDF.lstext is deprecated\"),this.text(t,e,n,{charSpace:r})},l.__private__.clip=l.clip=function(t){tt(\"evenodd\"===t?\"W*\":\"W\"),tt(\"n\")},l.__private__.clip_fixed=l.clip_fixed=function(t){console.log(\"clip_fixed is deprecated\"),l.clip(t)};var Ot=l.__private__.isValidStyle=function(t){var e=!1;return-1!==[void 0,null,\"S\",\"F\",\"DF\",\"FD\",\"f\",\"f*\",\"B\",\"B*\"].indexOf(t)&&(e=!0),e},qt=l.__private__.getStyle=function(t){var e=\"S\";return\"F\"===t?e=\"f\":\"FD\"===t||\"DF\"===t?e=\"B\":\"f\"!==t&&\"f*\"!==t&&\"B\"!==t&&\"B*\"!==t||(e=t),e};l.__private__.line=l.line=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw new Error(\"Invalid arguments passed to jsPDF.line\");return this.lines([[n-t,r-e]],t,e)},l.__private__.lines=l.lines=function(t,e,n,r,i,o){var a,s,l,h,u,c,f,p,d,g,m,y;if(\"number\"==typeof t&&(y=n,n=e,e=t,t=y),r=r||[1,1],o=o||!1,isNaN(e)||isNaN(n)||!Array.isArray(t)||!Array.isArray(r)||!Ot(i)||\"boolean\"!=typeof o)throw new Error(\"Invalid arguments passed to jsPDF.lines\");for(tt(Q(Wt(e))+\" \"+Q(Vt(n))+\" m \"),a=r[0],s=r[1],h=t.length,g=e,m=n,l=0;l=o.length-1;if(b&&!x){m+=\" \";continue}if(b||x){if(x)d=w;else if(i.multiline&&a<(h+2)*(y+2)+2)continue t}else{if(!i.multiline)continue t;if(a<(h+2)*(y+2)+2)continue t;d=w}for(var N=\"\",L=p;L<=d;L++)N+=o[L]+\" \";switch(N=\" \"==N.substr(N.length-1)?N.substr(0,N.length-1):N,g=F(N,i,r).width,i.textAlign){case\"right\":c=s-g-2;break;case\"center\":c=(s-g)/2;break;case\"left\":default:c=2}t+=_(c)+\" \"+_(f)+\" Td\\n\",t+=\"(\"+S(N)+\") Tj\\n\",t+=-_(c)+\" 0 Td\\n\",f=-(r+2),g=0,p=d+1,y++,m=\"\"}else;break}return n.text=t,n.fontSize=r,n},F=function(t,e,n){var r=A.internal.getFont(e.fontName,e.fontStyle),i=A.getStringUnitWidth(t,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:A.getStringUnitWidth(\"3\",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:i}},u={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},p=function(){A.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=A.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];n.objId=void 0,n.hasAnnotation&&d.call(A,n)}},d=function(t){var e={type:\"reference\",object:t};void 0===A.internal.getPageInfo(t.page).pageContext.annotations.find(function(t){return t.type===e.type&&t.object===e.object})&&A.internal.getPageInfo(t.page).pageContext.annotations.push(e)},g=function(){if(void 0===A.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error(\"putCatalogCallback: Root missing.\");A.internal.write(\"/AcroForm \"+A.internal.acroformPlugin.acroFormDictionaryRoot.objId+\" 0 R\")},m=function(){A.internal.events.unsubscribe(A.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete A.internal.acroformPlugin.acroFormDictionaryRoot._eventID,A.internal.acroformPlugin.printedOut=!0},L=function(t){var e=!t;t||(A.internal.newObjectDeferredBegin(A.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),A.internal.acroformPlugin.acroFormDictionaryRoot.putStream());t=t||A.internal.acroformPlugin.acroFormDictionaryRoot.Kids;for(var n in t)if(t.hasOwnProperty(n)){var r=t[n],i=[],o=r.Rect;if(r.Rect&&(r.Rect=c.call(this,r.Rect)),A.internal.newObjectDeferredBegin(r.objId,!0),r.DA=Y.createDefaultAppearanceStream(r),\"object\"===se(r)&&\"function\"==typeof r.getKeyValueListForStream&&(i=r.getKeyValueListForStream()),r.Rect=o,r.hasAppearanceStream&&!r.appearanceStreamContent){var a=f.call(this,r);i.push({key:\"AP\",value:\"<>\"}),A.internal.acroformPlugin.xForms.push(a)}if(r.appearanceStreamContent){var s=\"\";for(var l in r.appearanceStreamContent)if(r.appearanceStreamContent.hasOwnProperty(l)){var h=r.appearanceStreamContent[l];if(s+=\"/\"+l+\" \",s+=\"<<\",1<=Object.keys(h).length||Array.isArray(h))for(var n in h){var u;if(h.hasOwnProperty(n))\"function\"==typeof(u=h[n])&&(u=u.call(this,r)),s+=\"/\"+n+\" \"+u+\" \",0<=A.internal.acroformPlugin.xForms.indexOf(u)||A.internal.acroformPlugin.xForms.push(u)}else\"function\"==typeof(u=h)&&(u=u.call(this,r)),s+=\"/\"+n+\" \"+u,0<=A.internal.acroformPlugin.xForms.indexOf(u)||A.internal.acroformPlugin.xForms.push(u);s+=\">>\"}i.push({key:\"AP\",value:\"<<\\n\"+s+\">>\"})}A.internal.putStream({additionalKeyValues:i}),A.internal.out(\"endobj\")}e&&P.call(this,A.internal.acroformPlugin.xForms)},P=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=e,r=t[e];A.internal.newObjectDeferredBegin(r&&r.objId,!0),\"object\"===se(r)&&\"function\"==typeof r.putStream&&r.putStream(),delete t[n]}},k=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(A=this,M.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(u)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error(\"Exception while creating AcroformDictionary\");n=A.internal.scaleFactor,A.internal.acroformPlugin.acroFormDictionaryRoot=new E,A.internal.acroformPlugin.acroFormDictionaryRoot._eventID=A.internal.events.subscribe(\"postPutResources\",m),A.internal.events.subscribe(\"buildDocument\",p),A.internal.events.subscribe(\"putCatalog\",g),A.internal.events.subscribe(\"postPutPages\",L),A.internal.acroformPlugin.isInitialized=!0}},I=t.__acroform__.arrayToPdfArray=function(t){if(Array.isArray(t)){for(var e=\"[\",n=0;n>\"),e.join(\"\\n\")}},set:function(t){\"object\"===se(t)&&(n=t)}}),Object.defineProperty(this,\"caption\",{enumerable:!0,configurable:!0,get:function(){return n.CA||\"\"},set:function(t){\"string\"==typeof t&&(n.CA=t)}}),Object.defineProperty(this,\"AS\",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,\"appearanceState\",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e=\"/\"+t}})};r(D,M);var U=function(){D.call(this),this.pushButton=!0};r(U,D);var z=function(){D.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,\"Kids\",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=void 0!==t?t:[]}})};r(z,D);var H=function(){var e,n;M.call(this),Object.defineProperty(this,\"Parent\",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,\"optionName\",{enumerable:!1,configurable:!0,get:function(){return n},set:function(t){n=t}});var r,i={};Object.defineProperty(this,\"MK\",{enumerable:!1,configurable:!1,get:function(){var t,e=[];for(t in e.push(\"<<\"),i)e.push(\"/\"+t+\" (\"+i[t]+\")\");return e.push(\">>\"),e.join(\"\\n\")},set:function(t){\"object\"===se(t)&&(i=t)}}),Object.defineProperty(this,\"caption\",{enumerable:!0,configurable:!0,get:function(){return i.CA||\"\"},set:function(t){\"string\"==typeof t&&(i.CA=t)}}),Object.defineProperty(this,\"AS\",{enumerable:!1,configurable:!1,get:function(){return r},set:function(t){r=t}}),Object.defineProperty(this,\"appearanceState\",{enumerable:!0,configurable:!0,get:function(){return r.substr(1,r.length-1)},set:function(t){r=\"/\"+t}}),this.optionName=name,this.caption=\"l\",this.appearanceState=\"Off\",this._AppearanceType=Y.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(name)};r(H,M),z.prototype.setAppearance=function(t){if(!(\"createAppearanceStream\"in t&&\"getCA\"in t))throw new Error(\"Couldn't assign Appearance to RadioButton. Appearance was Invalid!\");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},z.prototype.createOption=function(t){this.Kids.length;var e=new H;return e.Parent=this,e.optionName=t,this.Kids.push(e),J.call(this,e),e};var W=function(){D.call(this),this.fontName=\"zapfdingbats\",this.caption=\"3\",this.appearanceState=\"On\",this.value=\"On\",this.textAlign=\"center\",this.appearanceStreamContent=Y.CheckBox.createAppearanceStream()};r(W,D);var V=function(){M.call(this),this.FT=\"/Tx\",Object.defineProperty(this,\"multiline\",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,13):this.Ff=N(this.Ff,13)}}),Object.defineProperty(this,\"fileSelect\",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,21):this.Ff=N(this.Ff,21)}}),Object.defineProperty(this,\"doNotSpellCheck\",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,23):this.Ff=N(this.Ff,23)}}),Object.defineProperty(this,\"doNotScroll\",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,24):this.Ff=N(this.Ff,24)}}),Object.defineProperty(this,\"comb\",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,25):this.Ff=N(this.Ff,25)}}),Object.defineProperty(this,\"richText\",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,26):this.Ff=N(this.Ff,26)}});var e=null;Object.defineProperty(this,\"MaxLen\",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,\"maxLength\",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,\"hasAppearanceStream\",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};r(V,M);var G=function(){V.call(this),Object.defineProperty(this,\"password\",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,14):this.Ff=N(this.Ff,14)}}),this.password=!0};r(G,V);var Y={CheckBox:{createAppearanceStream:function(){return{N:{On:Y.CheckBox.YesNormal},D:{On:Y.CheckBox.YesPushDown,Off:Y.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=l(t),n=[],r=A.internal.getFont(t.fontName,t.fontStyle).id,i=A.__private__.encodeColorString(t.color),o=h(t,t.caption);return n.push(\"0.749023 g\"),n.push(\"0 0 \"+_(Y.internal.getWidth(t))+\" \"+_(Y.internal.getHeight(t))+\" re\"),n.push(\"f\"),n.push(\"BMC\"),n.push(\"q\"),n.push(\"0 0 1 rg\"),n.push(\"/\"+r+\" \"+_(o.fontSize)+\" Tf \"+i),n.push(\"BT\"),n.push(o.text),n.push(\"ET\"),n.push(\"Q\"),n.push(\"EMC\"),e.stream=n.join(\"\\n\"),e},YesNormal:function(t){var e=l(t),n=A.internal.getFont(t.fontName,t.fontStyle).id,r=A.__private__.encodeColorString(t.color),i=[],o=Y.internal.getHeight(t),a=Y.internal.getWidth(t),s=h(t,t.caption);return i.push(\"1 g\"),i.push(\"0 0 \"+_(a)+\" \"+_(o)+\" re\"),i.push(\"f\"),i.push(\"q\"),i.push(\"0 0 1 rg\"),i.push(\"0 0 \"+_(a-1)+\" \"+_(o-1)+\" re\"),i.push(\"W\"),i.push(\"n\"),i.push(\"0 g\"),i.push(\"BT\"),i.push(\"/\"+n+\" \"+_(s.fontSize)+\" Tf \"+r),i.push(s.text),i.push(\"ET\"),i.push(\"Q\"),e.stream=i.join(\"\\n\"),e},OffPushDown:function(t){var e=l(t),n=[];return n.push(\"0.749023 g\"),n.push(\"0 0 \"+_(Y.internal.getWidth(t))+\" \"+_(Y.internal.getHeight(t))+\" re\"),n.push(\"f\"),e.stream=n.join(\"\\n\"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:Y.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=Y.RadioButton.Circle.YesNormal,e.D[t]=Y.RadioButton.Circle.YesPushDown,e},getCA:function(){return\"l\"},YesNormal:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var i=Y.internal.Bezier_C,o=Number((r*i).toFixed(5));return n.push(\"q\"),n.push(\"1 0 0 1 \"+s(Y.internal.getWidth(t)/2)+\" \"+s(Y.internal.getHeight(t)/2)+\" cm\"),n.push(r+\" 0 m\"),n.push(r+\" \"+o+\" \"+o+\" \"+r+\" 0 \"+r+\" c\"),n.push(\"-\"+o+\" \"+r+\" -\"+r+\" \"+o+\" -\"+r+\" 0 c\"),n.push(\"-\"+r+\" -\"+o+\" -\"+o+\" -\"+r+\" 0 -\"+r+\" c\"),n.push(o+\" -\"+r+\" \"+r+\" -\"+o+\" \"+r+\" 0 c\"),n.push(\"f\"),n.push(\"Q\"),e.stream=n.join(\"\\n\"),e},YesPushDown:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*Y.internal.Bezier_C).toFixed(5)),a=Number((r*Y.internal.Bezier_C).toFixed(5));return n.push(\"0.749023 g\"),n.push(\"q\"),n.push(\"1 0 0 1 \"+s(Y.internal.getWidth(t)/2)+\" \"+s(Y.internal.getHeight(t)/2)+\" cm\"),n.push(i+\" 0 m\"),n.push(i+\" \"+o+\" \"+o+\" \"+i+\" 0 \"+i+\" c\"),n.push(\"-\"+o+\" \"+i+\" -\"+i+\" \"+o+\" -\"+i+\" 0 c\"),n.push(\"-\"+i+\" -\"+o+\" -\"+o+\" -\"+i+\" 0 -\"+i+\" c\"),n.push(o+\" -\"+i+\" \"+i+\" -\"+o+\" \"+i+\" 0 c\"),n.push(\"f\"),n.push(\"Q\"),n.push(\"0 g\"),n.push(\"q\"),n.push(\"1 0 0 1 \"+s(Y.internal.getWidth(t)/2)+\" \"+s(Y.internal.getHeight(t)/2)+\" cm\"),n.push(r+\" 0 m\"),n.push(r+\" \"+a+\" \"+a+\" \"+r+\" 0 \"+r+\" c\"),n.push(\"-\"+a+\" \"+r+\" -\"+r+\" \"+a+\" -\"+r+\" 0 c\"),n.push(\"-\"+r+\" -\"+a+\" -\"+a+\" -\"+r+\" 0 -\"+r+\" c\"),n.push(a+\" -\"+r+\" \"+r+\" -\"+a+\" \"+r+\" 0 c\"),n.push(\"f\"),n.push(\"Q\"),e.stream=n.join(\"\\n\"),e},OffPushDown:function(t){var e=l(t),n=[],r=Y.internal.getWidth(t)<=Y.internal.getHeight(t)?Y.internal.getWidth(t)/4:Y.internal.getHeight(t)/4,i=(r=Number((.9*r).toFixed(5)),Number((2*r).toFixed(5))),o=Number((i*Y.internal.Bezier_C).toFixed(5));return n.push(\"0.749023 g\"),n.push(\"q\"),n.push(\"1 0 0 1 \"+s(Y.internal.getWidth(t)/2)+\" \"+s(Y.internal.getHeight(t)/2)+\" cm\"),n.push(i+\" 0 m\"),n.push(i+\" \"+o+\" \"+o+\" \"+i+\" 0 \"+i+\" c\"),n.push(\"-\"+o+\" \"+i+\" -\"+i+\" \"+o+\" -\"+i+\" 0 c\"),n.push(\"-\"+i+\" -\"+o+\" -\"+o+\" -\"+i+\" 0 -\"+i+\" c\"),n.push(o+\" -\"+i+\" \"+i+\" -\"+o+\" \"+i+\" 0 c\"),n.push(\"f\"),n.push(\"Q\"),e.stream=n.join(\"\\n\"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:Y.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=Y.RadioButton.Cross.YesNormal,e.D[t]=Y.RadioButton.Cross.YesPushDown,e},getCA:function(){return\"8\"},YesNormal:function(t){var e=l(t),n=[],r=Y.internal.calculateCross(t);return n.push(\"q\"),n.push(\"1 1 \"+_(Y.internal.getWidth(t)-2)+\" \"+_(Y.internal.getHeight(t)-2)+\" re\"),n.push(\"W\"),n.push(\"n\"),n.push(_(r.x1.x)+\" \"+_(r.x1.y)+\" m\"),n.push(_(r.x2.x)+\" \"+_(r.x2.y)+\" l\"),n.push(_(r.x4.x)+\" \"+_(r.x4.y)+\" m\"),n.push(_(r.x3.x)+\" \"+_(r.x3.y)+\" l\"),n.push(\"s\"),n.push(\"Q\"),e.stream=n.join(\"\\n\"),e},YesPushDown:function(t){var e=l(t),n=Y.internal.calculateCross(t),r=[];return r.push(\"0.749023 g\"),r.push(\"0 0 \"+_(Y.internal.getWidth(t))+\" \"+_(Y.internal.getHeight(t))+\" re\"),r.push(\"f\"),r.push(\"q\"),r.push(\"1 1 \"+_(Y.internal.getWidth(t)-2)+\" \"+_(Y.internal.getHeight(t)-2)+\" re\"),r.push(\"W\"),r.push(\"n\"),r.push(_(n.x1.x)+\" \"+_(n.x1.y)+\" m\"),r.push(_(n.x2.x)+\" \"+_(n.x2.y)+\" l\"),r.push(_(n.x4.x)+\" \"+_(n.x4.y)+\" m\"),r.push(_(n.x3.x)+\" \"+_(n.x3.y)+\" l\"),r.push(\"s\"),r.push(\"Q\"),e.stream=r.join(\"\\n\"),e},OffPushDown:function(t){var e=l(t),n=[];return n.push(\"0.749023 g\"),n.push(\"0 0 \"+_(Y.internal.getWidth(t))+\" \"+_(Y.internal.getHeight(t))+\" re\"),n.push(\"f\"),e.stream=n.join(\"\\n\"),e}}},createDefaultAppearanceStream:function(t){var e=A.internal.getFont(t.fontName,t.fontStyle).id,n=A.__private__.encodeColorString(t.color);return\"/\"+e+\" \"+t.fontSize+\" Tf \"+n}};Y.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=Y.internal.getWidth(t),n=Y.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},Y.internal.getWidth=function(t){var e=0;return\"object\"===se(t)&&(e=v(t.Rect[2])),e},Y.internal.getHeight=function(t){var e=0;return\"object\"===se(t)&&(e=v(t.Rect[3])),e};var J=t.addField=function(t){if(k.call(this),!(t instanceof M))throw new Error(\"Invalid argument passed to jsPDF.addField.\");return function(t){A.internal.acroformPlugin.printedOut&&(A.internal.acroformPlugin.printedOut=!1,A.internal.acroformPlugin.acroFormDictionaryRoot=null),A.internal.acroformPlugin.acroFormDictionaryRoot||k.call(A),A.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)}.call(this,t),t.page=A.internal.getCurrentPageInfo().pageNumber,this};t.addButton=function(t){if(t instanceof D==!1)throw new Error(\"Invalid argument passed to jsPDF.addButton.\");return J.call(this,t)},t.addTextField=function(t){if(t instanceof V==!1)throw new Error(\"Invalid argument passed to jsPDF.addTextField.\");return J.call(this,t)},t.addChoiceField=function(t){if(t instanceof O==!1)throw new Error(\"Invalid argument passed to jsPDF.addChoiceField.\");return J.call(this,t)};\"object\"==se(e)&&void 0===e.ChoiceField&&void 0===e.ListBox&&void 0===e.ComboBox&&void 0===e.EditBox&&void 0===e.Button&&void 0===e.PushButton&&void 0===e.RadioButton&&void 0===e.CheckBox&&void 0===e.TextField&&void 0===e.PasswordField?(e.ChoiceField=O,e.ListBox=q,e.ComboBox=T,e.EditBox=R,e.Button=D,e.PushButton=U,e.RadioButton=z,e.CheckBox=W,e.TextField=V,e.PasswordField=G,e.AcroForm={Appearance:Y}):console.warn(\"AcroForm-Classes are not populated into global-namespace, because the class-Names exist already.\"),t.AcroFormChoiceField=O,t.AcroFormListBox=q,t.AcroFormComboBox=T,t.AcroFormEditBox=R,t.AcroFormButton=D,t.AcroFormPushButton=U,t.AcroFormRadioButton=z,t.AcroFormCheckBox=W,t.AcroFormTextField=V,t.AcroFormPasswordField=G,t.AcroFormAppearance=Y,t.AcroForm={ChoiceField:O,ListBox:q,ComboBox:T,EditBox:R,Button:D,PushButton:U,RadioButton:z,CheckBox:W,TextField:V,PasswordField:G,Appearance:Y}})((window.tmp=lt).API,\"undefined\"!=typeof window&&window||\"undefined\"!=typeof global&&global),\n/** @license\n * jsPDF addImage plugin\n * Copyright (c) 2012 Jason Siefken, https://github.com/siefkenj/\n * 2013 Chris Dowling, https://github.com/gingerchris\n * 2013 Trinh Ho, https://github.com/ineedfat\n * 2013 Edwin Alejandro Perez, https://github.com/eaparango\n * 2013 Norah Smith, https://github.com/burnburnrocket\n * 2014 Diego Casorran, https://github.com/diegocr\n * 2014 James Robb, https://github.com/jamesbrobb\n *\n * \n */\nfunction(x){var N=\"addImage_\",l={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},h=x.getImageFileTypeByImageData=function(t,e){var n,r;e=e||\"UNKNOWN\";var i,o,a,s=\"UNKNOWN\";for(a in x.isArrayBufferView(t)&&(t=x.arrayBufferToBinaryString(t)),l)for(i=l[a],n=0;n>\"}),\"trns\"in e&&e.trns.constructor==Array){for(var s=\"\",l=0,h=e.trns.length;l>18]+r[(258048&e)>>12]+r[(4032&e)>>6]+r[63&e];return 1==a?n+=r[(252&(e=i[s]))>>2]+r[(3&e)<<4]+\"==\":2==a&&(n+=r[(64512&(e=i[s]<<8|i[s+1]))>>10]+r[(1008&e)>>4]+r[(15&e)<<2]+\"=\"),n},x.createImageInfo=function(t,e,n,r,i,o,a,s,l,h,u,c,f){var p={alias:s,w:e,h:n,cs:r,bpc:i,i:a,data:t};return o&&(p.f=o),l&&(p.dp=l),h&&(p.trns=h),u&&(p.pal=u),c&&(p.smask=c),f&&(p.p=f),p},x.addImage=function(t,e,n,r,i,o,a,s,l){var h=\"\";if(\"string\"!=typeof e){var u=o;o=i,i=r,r=n,n=e,e=u}if(\"object\"===se(t)&&!_(t)&&\"imageData\"in t){var c=t;t=c.imageData,e=c.format||e||\"UNKNOWN\",n=c.x||n||0,r=c.y||r||0,i=c.w||i,o=c.h||o,a=c.alias||a,s=c.compression||s,l=c.rotation||c.angle||l}var f=this.internal.getFilters();if(void 0===s&&-1!==f.indexOf(\"FlateEncode\")&&(s=\"SLOW\"),\"string\"==typeof t&&(t=unescape(t)),isNaN(n)||isNaN(r))throw console.error(\"jsPDF.addImage: Invalid coordinates\",arguments),new Error(\"Invalid coordinates passed to jsPDF.addImage\");var p,d,g,m,y,v,w,b=function(){var t=this.internal.collections[N+\"images\"];return t||(this.internal.collections[N+\"images\"]=t={},this.internal.events.subscribe(\"putResources\",L),this.internal.events.subscribe(\"putXobjectDict\",A)),t}.call(this);if(!((p=P(t,b))||(_(t)&&(t=F(t,e)),(null==(w=a)||0===w.length)&&(a=\"string\"==typeof(v=t)?x.sHashCode(v):x.isArrayBufferView(v)?x.sHashCode(x.arrayBufferToBinaryString(v)):null),p=P(a,b)))){if(this.isString(t)&&(\"\"!==(h=this.convertStringToImageData(t))?t=h:void 0!==(h=x.loadFile(t))&&(t=h)),e=this.getImageFileTypeByImageData(t,e),!S(e))throw new Error(\"addImage does not support files of type '\"+e+\"', please ensure that a plugin for '\"+e+\"' support is added.\");if(this.supportsArrayBuffer()&&(t instanceof Uint8Array||(d=t,t=this.binaryStringToUint8Array(t))),!(p=this[\"process\"+e.toUpperCase()](t,(y=0,(m=b)&&(y=Object.keys?Object.keys(m).length:function(t){var e=0;for(var n in t)t.hasOwnProperty(n)&&e++;return e}(m)),y),a,((g=s)&&\"string\"==typeof g&&(g=g.toUpperCase()),g in x.image_compression?g:x.image_compression.NONE),d)))throw new Error(\"An unknown error occurred whilst processing the image\")}return function(t,e,n,r,i,o,a,s){var l=function(t,e,n){return t||e||(e=t=-96),t<0&&(t=-1*n.w*72/t/this.internal.scaleFactor),e<0&&(e=-1*n.h*72/e/this.internal.scaleFactor),0===t&&(t=e*n.w/n.h),0===e&&(e=t*n.h/n.w),[t,e]}.call(this,n,r,i),h=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString;if(n=l[0],r=l[1],a[o]=i,s){s*=Math.PI/180;var c=Math.cos(s),f=Math.sin(s),p=function(t){return t.toFixed(4)},d=[p(c),p(f),p(-1*f),p(c),0,0,\"cm\"]}this.internal.write(\"q\"),s?(this.internal.write([1,\"0\",\"0\",1,h(t),u(e+r),\"cm\"].join(\" \")),this.internal.write(d.join(\" \")),this.internal.write([h(n),\"0\",\"0\",h(r),\"0\",\"0\",\"cm\"].join(\" \"))):this.internal.write([h(n),\"0\",\"0\",h(r),h(t),u(e+r),\"cm\"].join(\" \")),this.internal.write(\"/I\"+i.i+\" Do\"),this.internal.write(\"Q\")}.call(this,n,r,i,o,p,p.i,b,l),this},x.convertStringToImageData=function(t){var e,n=\"\";if(this.isString(t)){var r;e=null!==(r=this.extractImageFromDataUrl(t))?r.data:t;try{n=atob(e)}catch(t){throw x.validateStringAsBase64(e)?new Error(\"atob-Error in jsPDF.convertStringToImageData \"+t.message):new Error(\"Supplied Data is not a valid base64-String jsPDF.convertStringToImageData \")}}return n};var u=function(t,e){return t.subarray(e,e+5)};x.processJPEG=function(t,e,n,r,i,o){var a,s=this.decode.DCT_DECODE;if(!this.isString(t)&&!this.isArrayBuffer(t)&&!this.isArrayBufferView(t))return null;if(this.isString(t)&&(a=function(t){var e;if(\"JPEG\"!==h(t))throw new Error(\"getJpegSize requires a binary string jpeg file\");for(var n=256*t.charCodeAt(4)+t.charCodeAt(5),r=4,i=t.length;r>\",h.content=m;var f=h.objId+\" 0 R\";m=\"<>\",u.content=m,this.internal.write(h.objId,\"0 R\",u.objId,\"0 R\");break;case\"freetext\":var p=\"/Rect [\"+a(l.bounds.x)+\" \"+s(l.bounds.y)+\" \"+a(l.bounds.x+l.bounds.w)+\" \"+s(l.bounds.y+l.bounds.h)+\"] \",d=l.color||\"#000000\";m=\"<>\",this.internal.write(m);break;case\"link\":if(l.options.name){var g=this.annotations._nameMap[l.options.name];l.options.pageNumber=g.page,l.options.top=g.y}else l.options.top||(l.options.top=0);p=\"/Rect [\"+a(l.x)+\" \"+s(l.y)+\" \"+a(l.x+l.w)+\" \"+s(l.y+l.h)+\"] \";var m=\"\";if(l.options.url)m=\"<>\";else if(l.options.pageNumber)switch(m=\"<>\",this.internal.write(m))}}this.internal.write(\"]\")}}]),t.createAnnotation=function(t){var e=this.internal.getCurrentPageInfo();switch(t.type){case\"link\":this.link(t.bounds.x,t.bounds.y,t.bounds.w,t.bounds.h,t);break;case\"text\":case\"freetext\":e.pageContext.annotations.push(t)}},t.link=function(t,e,n,r,i){this.internal.getCurrentPageInfo().pageContext.annotations.push({x:t,y:e,w:n,h:r,options:i,type:\"link\"})},t.textWithLink=function(t,e,n,r){var i=this.getTextWidth(t),o=this.internal.getLineHeight()/this.internal.scaleFactor;return this.text(t,e,n),n+=.2*o,this.link(e,n-o,i,o,r),i},t.getTextWidth=function(t){var e=this.internal.getFontSize();return this.getStringUnitWidth(t)*e/this.internal.scaleFactor},\n/**\n * @license\n * Copyright (c) 2017 Aras Abbasi \n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\nfunction(t){var h={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},a={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},e={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},n=[1570,1571,1573,1575];t.__arabicParser__={};var r=t.__arabicParser__.isInArabicSubstitutionA=function(t){return void 0!==h[t.charCodeAt(0)]},u=t.__arabicParser__.isArabicLetter=function(t){return\"string\"==typeof t&&/^[\\u0600-\\u06FF\\u0750-\\u077F\\u08A0-\\u08FF\\uFB50-\\uFDFF\\uFE70-\\uFEFF]+$/.test(t)},i=t.__arabicParser__.isArabicEndLetter=function(t){return u(t)&&r(t)&&h[t.charCodeAt(0)].length<=2},o=t.__arabicParser__.isArabicAlfLetter=function(t){return u(t)&&0<=n.indexOf(t.charCodeAt(0))},s=(t.__arabicParser__.arabicLetterHasIsolatedForm=function(t){return u(t)&&r(t)&&1<=h[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasFinalForm=function(t){return u(t)&&r(t)&&2<=h[t.charCodeAt(0)].length}),l=(t.__arabicParser__.arabicLetterHasInitialForm=function(t){return u(t)&&r(t)&&3<=h[t.charCodeAt(0)].length},t.__arabicParser__.arabicLetterHasMedialForm=function(t){return u(t)&&r(t)&&4==h[t.charCodeAt(0)].length}),c=t.__arabicParser__.resolveLigatures=function(t){var e=0,n=a,r=0,i=\"\",o=0;for(e=0;e>\"),this.internal.out(\"endobj\")}),this.internal.events.subscribe(\"putCatalog\",function(){this.internal.out(\"/OpenAction \"+e+\" 0 R\")})}return this},\n/**\n * @license\n * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\ne=lt.API,(n=function(){var e=void 0;Object.defineProperty(this,\"pdf\",{get:function(){return e},set:function(t){e=t}});var n=150;Object.defineProperty(this,\"width\",{get:function(){return n},set:function(t){n=isNaN(t)||!1===Number.isInteger(t)||t<0?150:t,this.getContext(\"2d\").pageWrapXEnabled&&(this.getContext(\"2d\").pageWrapX=n+1)}});var r=300;Object.defineProperty(this,\"height\",{get:function(){return r},set:function(t){r=isNaN(t)||!1===Number.isInteger(t)||t<0?300:t,this.getContext(\"2d\").pageWrapYEnabled&&(this.getContext(\"2d\").pageWrapY=r+1)}});var i=[];Object.defineProperty(this,\"childNodes\",{get:function(){return i},set:function(t){i=t}});var o={};Object.defineProperty(this,\"style\",{get:function(){return o},set:function(t){o=t}}),Object.defineProperty(this,\"parentNode\",{get:function(){return!1}})}).prototype.getContext=function(t,e){var n;if(\"2d\"!==(t=t||\"2d\"))return null;for(n in e)this.pdf.context2d.hasOwnProperty(n)&&(this.pdf.context2d[n]=e[n]);return(this.pdf.context2d._canvas=this).pdf.context2d},n.prototype.toDataURL=function(){throw new Error(\"toDataURL is not implemented.\")},e.events.push([\"initialized\",function(){this.canvas=new n,this.canvas.pdf=this}]),\n/** \n * @license\n * ====================================================================\n * Copyright (c) 2013 Youssef Beddad, youssef.beddad@gmail.com\n * 2013 Eduardo Menezes de Morais, eduardo.morais@usp.br\n * 2013 Lee Driscoll, https://github.com/lsdriscoll\n * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria\n * 2014 James Hall, james@parall.ax\n * 2014 Diego Casorran, https://github.com/diegocr\n *\n * \n * ====================================================================\n */\n_=lt.API,F={x:void 0,y:void 0,w:void 0,h:void 0,ln:void 0},P=1,p=function(t,e,n,r,i){F={x:t,y:e,w:n,h:r,ln:i}},d=function(){return F},k={left:0,top:0,bottom:0},_.setHeaderFunction=function(t){l=t},_.getTextDimensions=function(t,e){var n=this.table_font_size||this.internal.getFontSize(),r=(this.internal.getFont().fontStyle,(e=e||{}).scaleFactor||this.internal.scaleFactor),i=0,o=0,a=0;if(\"string\"==typeof t)0!=(i=this.getStringUnitWidth(t)*n)&&(o=1);else{if(\"[object Array]\"!==Object.prototype.toString.call(t))throw new Error(\"getTextDimensions expects text-parameter to be of type String or an Array of Strings.\");for(var s=0;s=this.internal.pageSize.getHeight()-h.bottom&&(this.cellAddPage(),l=!0,this.printHeaders&&this.tableHeaderRow&&this.printHeaderRow(o,!0)),e=d().y+d().h,l&&(e=23)}if(void 0!==i[0])if(this.printingHeaderRow?this.rect(t,e,n,r,\"FD\"):this.rect(t,e,n,r),\"right\"===a){i instanceof Array||(i=[i]);for(var u=0;u=2*Math.PI&&(r=0,i=2*Math.PI),this.path.push({type:\"arc\",x:t,y:e,radius:n,startAngle:r,endAngle:i,counterclockwise:o})},n.prototype.arcTo=function(t,e,n,r,i){throw new Error(\"arcTo not implemented.\")},n.prototype.rect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error(\"jsPDF.context2d.rect: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.rect\");this.moveTo(t,e),this.lineTo(t+n,e),this.lineTo(t+n,e+r),this.lineTo(t,e+r),this.lineTo(t,e),this.lineTo(t+n,e),this.lineTo(t,e)},n.prototype.fillRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error(\"jsPDF.context2d.fillRect: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.fillRect\");if(!N.call(this)){var i={};\"butt\"!==this.lineCap&&(i.lineCap=this.lineCap,this.lineCap=\"butt\"),\"miter\"!==this.lineJoin&&(i.lineJoin=this.lineJoin,this.lineJoin=\"miter\"),this.beginPath(),this.rect(t,e,n,r),this.fill(),i.hasOwnProperty(\"lineCap\")&&(this.lineCap=i.lineCap),i.hasOwnProperty(\"lineJoin\")&&(this.lineJoin=i.lineJoin)}},n.prototype.strokeRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error(\"jsPDF.context2d.strokeRect: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.strokeRect\");L.call(this)||(this.beginPath(),this.rect(t,e,n,r),this.stroke())},n.prototype.clearRect=function(t,e,n,r){if(isNaN(t)||isNaN(e)||isNaN(n)||isNaN(r))throw console.error(\"jsPDF.context2d.clearRect: Invalid arguments\",arguments),new Error(\"Invalid arguments passed to jsPDF.context2d.clearRect\");this.ignoreClearRect||(this.fillStyle=\"#ffffff\",this.fillRect(t,e,n,r))},n.prototype.save=function(t){t=\"boolean\"!=typeof t||t;for(var e=this.pdf.internal.getCurrentPageInfo().pageNumber,n=0;n\"},s=function(t){var r,e,n,i,o,a=String,s=\"length\",l=\"charCodeAt\",h=\"slice\",u=\"replace\";for(t[h](-2),t=t[h](0,-2)[u](/\\s/g,\"\")[u](\"z\",\"!!!!!\"),n=[],i=0,o=(t+=r=\"uuuuu\"[h](t[s]%5||5))[s];i>24,255&e>>16,255&e>>8,255&e);return function(t,e){for(var n=r[s];0\"},u=function(t){var e=new RegExp(/^([0-9A-Fa-f]{2})+$/);if(-1!==(t=t.replace(/\\s/g,\"\")).indexOf(\">\")&&(t=t.substr(0,t.indexOf(\">\"))),t.length%2&&(t+=\"0\"),!1===e.test(t))return\"\";for(var n=\"\",r=0;r>8&255,n>>16&255,n>>24&255]),t.length+2),t=String.fromCharCode.apply(null,i)},a.processDataByFilters=function(t,e){var n=0,r=t||\"\",i=[];for(\"string\"==typeof(e=e||[])&&(e=[e]),n=0;n>\"),this.internal.out(\"endobj\"),w=this.internal.newObject(),this.internal.out(\"<<\"),this.internal.out(\"/S /JavaScript\"),this.internal.out(\"/JS (\"+b+\")\"),this.internal.out(\">>\"),this.internal.out(\"endobj\")}),this.internal.events.subscribe(\"putCatalog\",function(){void 0!==v&&void 0!==w&&this.internal.out(\"/Names <>\")}),this},(\n/**\n * @license\n * Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv\n *\n * Licensed under the MIT License.\n * http://opensource.org/licenses/mit-license\n */\nx=lt.API).events.push([\"postPutResources\",function(){var t=this,e=/^(\\d+) 0 obj$/;if(0> endobj\")}var c=t.internal.newObject();for(t.internal.write(\"<< /Names [ \"),r=0;r>\",\"endobj\"),t.internal.newObject(),t.internal.write(\"<< /Dests \"+c+\" 0 R\"),t.internal.write(\">>\",\"endobj\")}}]),x.events.push([\"putCatalog\",function(){0> \\r\\nendobj\\r\\n\"},a.outline.count_r=function(t,e){for(var n=0;n>>24&255,f[c++]=s>>>16&255,f[c++]=s>>>8&255,f[c++]=255&s,I.arrayBufferToBinaryString(f)},N=function(t,e){var n=Math.LOG2E*Math.log(32768)-8<<4|8,r=n<<8;return r|=Math.min(3,(e-1&255)>>1)<<6,r|=0,[n,255&(r+=31-r%31)]},L=function(t,e){for(var n,r=1,i=0,o=t.length,a=0;0>>0},A=function(t,e,n,r){for(var i,o,a,s=t.length/e,l=new Uint8Array(t.length+s),h=T(),u=0;u>>1)&255;return o},O=function(t,e,n){var r,i,o,a,s=[],l=0,h=t.length;for(s[0]=4;l>>d&255,d+=o.bits;y[w]=x>>>d&255}if(16===o.bits){g=(_=new Uint32Array(o.decodePixels().buffer)).length,m=new Uint8Array(g*(32/o.pixelBitlength)*o.colors),y=new Uint8Array(g*(32/o.pixelBitlength));for(var x,N=1>>0&255,N&&(m[b++]=x>>>16&255,x=_[w++],m[b++]=x>>>0&255),y[L++]=x>>>16&255;p=8}r!==I.image_compression.NONE&&C()?(t=B(m,o.width*o.colors,o.colors,r),u=B(y,o.width,1,r)):(t=m,u=y,f=null)}if(3===o.colorType&&(c=this.color_spaces.INDEXED,h=o.palette,o.transparency.indexed)){var A=o.transparency.indexed,S=0;for(w=0,g=A.length;wr&&(i.push(t.slice(l,o)),s=0,l=o),s+=e[o],o++;return l!==o&&i.push(t.slice(l,o)),i},J=function(t,e,n){n||(n={});var r,i,o,a,s,l,h=[],u=[h],c=n.textIndent||0,f=0,p=0,d=t.split(\" \"),g=W.apply(this,[\" \",n])[0];if(l=-1===n.lineIndent?d[0].length+2:n.lineIndent||0){var m=Array(l).join(\" \"),y=[];d.map(function(t){1<(t=t.split(/\\s*\\n/)).length?y=y.concat(t.map(function(t,e){return(e&&t.length?\"\\n\":\"\")+t})):y.push(t[0])}),d=y,l=G.apply(this,[m,n])}for(o=0,a=d.length;o>\")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},\n/** ==================================================================== \n * jsPDF XMP metadata plugin\n * Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi\n * \n * \n * ====================================================================\n */\nnt=lt.API,ot=it=rt=\"\",nt.addMetadata=function(t,e){return it=e||\"http://jspdf.default.namespaceuri/\",rt=t,this.internal.events.subscribe(\"postPutResources\",function(){if(rt){var t='',e=unescape(encodeURIComponent('')),n=unescape(encodeURIComponent(t)),r=unescape(encodeURIComponent(rt)),i=unescape(encodeURIComponent(\"\")),o=unescape(encodeURIComponent(\"\")),a=n.length+r.length+i.length+e.length+o.length;ot=this.internal.newObject(),this.internal.write(\"<< /Type /Metadata /Subtype /XML /Length \"+a+\" >>\"),this.internal.write(\"stream\"),this.internal.write(e+n+r+i+o),this.internal.write(\"endstream\"),this.internal.write(\"endobj\")}else ot=\"\"}),this.internal.events.subscribe(\"putCatalog\",function(){ot&&this.internal.write(\"/Metadata \"+ot+\" 0 R\")}),this},function(f,t){var e=f.API;var m=e.pdfEscape16=function(t,e){for(var n,r=e.metadata.Unicode.widths,i=[\"\",\"0\",\"00\",\"000\",\"0000\"],o=[\"\"],a=0,s=t.length;a> def\\n/CMapName /Adobe-Identity-UCS def\\n/CMapType 2 def\\n1 begincodespacerange\\n<0000>\\nendcodespacerange\",r=[],a=0,s=(n=Object.keys(t).sort(function(t,e){return t-e})).length;a<\"+i+\">\");return r.length&&(o+=\"\\n\"+r.length+\" beginbfchar\\n\"+r.join(\"\\n\")+\"\\nendbfchar\\n\"),o+=\"endcmap\\nCMapName currentdict /CMap defineresource pop\\nend\\nend\"};e.events.push([\"putFont\",function(t){!function(t,e,n,r){if(t.metadata instanceof f.API.TTFFont&&\"Identity-H\"===t.encoding){for(var i=t.metadata.Unicode.widths,o=t.metadata.subset.encode(t.metadata.glyIdsUsed,1),a=\"\",s=0;s>\"),e(\"endobj\");var c=n();e(\"<<\"),e(\"/Type /Font\"),e(\"/BaseFont /\"+t.fontName),e(\"/FontDescriptor \"+u+\" 0 R\"),e(\"/W \"+f.API.PDFObject.convert(i)),e(\"/CIDToGIDMap /Identity\"),e(\"/DW 1000\"),e(\"/Subtype /CIDFontType2\"),e(\"/CIDSystemInfo\"),e(\"<<\"),e(\"/Supplement 0\"),e(\"/Registry (Adobe)\"),e(\"/Ordering (\"+t.encoding+\")\"),e(\">>\"),e(\">>\"),e(\"endobj\"),t.objectNumber=n(),e(\"<<\"),e(\"/Type /Font\"),e(\"/Subtype /Type0\"),e(\"/ToUnicode \"+h+\" 0 R\"),e(\"/BaseFont /\"+t.fontName),e(\"/Encoding /\"+t.encoding),e(\"/DescendantFonts [\"+c+\" 0 R]\"),e(\">>\"),e(\"endobj\"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);e.events.push([\"putFont\",function(t){!function(t,e,n,r){if(t.metadata instanceof f.API.TTFFont&&\"WinAnsiEncoding\"===t.encoding){t.metadata.Unicode.widths;for(var i=t.metadata.rawData,o=\"\",a=0;a>\"),e(\"endobj\"),t.objectNumber=n(),a=0;a>\"),e(\"endobj\"),t.isAlreadyPutted=!0}}(t.font,t.out,t.newObject,t.putStream)}]);var h=function(t){var e,n,r=t.text||\"\",i=t.x,o=t.y,a=t.options||{},s=t.mutex||{},l=s.pdfEscape,h=s.activeFontKey,u=s.fonts,c=(s.activeFontSize,\"\"),f=0,p=\"\",d=u[n=h].encoding;if(\"Identity-H\"!==u[n].encoding)return{text:r,x:i,y:o,options:a,mutex:s};for(p=r,n=h,\"[object Array]\"===Object.prototype.toString.call(r)&&(p=r[0]),f=0;fw-h.top-h.bottom&&s.pagesplit){var p=function(t,e,n,r,i){var o=document.createElement(\"canvas\");o.height=i,o.width=r;var a=o.getContext(\"2d\");return a.mozImageSmoothingEnabled=!1,a.webkitImageSmoothingEnabled=!1,a.msImageSmoothingEnabled=!1,a.imageSmoothingEnabled=!1,a.fillStyle=s.backgroundColor||\"#ffffff\",a.fillRect(0,0,r,i),a.drawImage(t,e,n,r,i,0,0,r,i),o},n=function(){for(var t,e,n=0,r=0,i={},o=!1;;){var a;if(r=0,i.top=0!==n?h.top:g,i.left=0!==n?h.left:d,o=(v-h.left-h.right)*y=l.width)break;this.addPage()}else s=[a=p(l,0,n,t,e),i.left,i.top,a.width/y,a.height/y,c,null,f],this.addImage.apply(this,s);if((n+=e)>=l.height)break;this.addPage()}m(u,n,null,s)}.bind(this);if(\"CANVAS\"===l.nodeName){var r=new Image;r.onload=n,r.src=l.toDataURL(\"image/png\"),l=r}else n()}else{var i=Math.random().toString(35),o=[l,d,g,u,e,c,i,f];this.addImage.apply(this,o),m(u,e,i,o)}}.bind(this),\"undefined\"!=typeof html2canvas&&!s.rstz)return html2canvas(t,s);if(\"undefined\"==typeof rasterizeHTML)return null;var n=\"drawDocument\";return\"string\"==typeof t&&(n=/^http/.test(t)?\"drawURL\":\"drawHTML\"),s.width=s.width||v*y,rasterizeHTML[n](t,void 0,s).then(function(t){s.onrendered(t.image)},function(t){m(null,t)})},\n/**\n * jsPDF fromHTML plugin. BETA stage. API subject to change. Needs browser\n * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com\n * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria\n * 2014 Diego Casorran, https://github.com/diegocr\n * 2014 Daniel Husar, https://github.com/danielhusar\n * 2014 Wolfgang Gassler, https://github.com/woolfg\n * 2014 Steven Spungin, https://github.com/flamenco\n *\n * @license\n * \n * ====================================================================\n */\nfunction(t){var P,k,i,a,s,l,h,u,I,w,f,c,p,n,C,B,d,g,m,j;P=function(){return function(t){return e.prototype=t,new e};function e(){}}(),w=function(t){var e,n,r,i,o,a,s;for(n=0,r=t.length,e=void 0,a=i=!1;!i&&n!==r;)(e=t[n]=t[n].trimLeft())&&(i=!0),n++;for(n=r-1;r&&!a&&-1!==n;)(e=t[n]=t[n].trimRight())&&(a=!0),n--;for(o=/\\s+$/g,s=!0,n=0;n!==r;)\"\\u2028\"!=t[n]&&(e=t[n].replace(/\\s+/g,\" \"),s&&(e=e.trimLeft()),e&&(s=o.test(e)),t[n]=e),n++;return t},c=function(t){var e,n,r;for(e=void 0,n=(r=t.split(\",\")).shift();!e&&n;)e=i[n.trim().toLowerCase()],n=r.shift();return e},p=function(t){var e;return-1<(t=\"auto\"===t?\"0px\":t).indexOf(\"em\")&&!isNaN(Number(t.replace(\"em\",\"\")))&&(t=18.719*Number(t.replace(\"em\",\"\"))+\"px\"),-1i.pdf.margins_doc.top&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top,i.executeWatchFunctions(n));var b=I(n),x=i.x,N=12/i.pdf.internal.scaleFactor,L=(b[\"margin-left\"]+b[\"padding-left\"])*N,A=(b[\"margin-right\"]+b[\"padding-right\"])*N,S=(b[\"margin-top\"]+b[\"padding-top\"])*N,_=(b[\"margin-bottom\"]+b[\"padding-bottom\"])*N;void 0!==b.float&&\"right\"===b.float?x+=i.settings.width-n.width-A:x+=L,i.pdf.addImage(v,x,i.y+S,n.width,n.height),v=void 0,\"right\"===b.float||\"left\"===b.float?(i.watchFunctions.push(function(t,e,n,r){return i.y>=e?(i.x+=t,i.settings.width+=n,!0):!!(r&&1===r.nodeType&&!E[r.nodeName]&&i.x+r.width>i.pdf.margins_doc.left+i.pdf.margins_doc.width)&&(i.x+=t,i.y=e,i.settings.width+=n,!0)}.bind(this,\"left\"===b.float?-n.width-L-A:0,i.y+n.height+S+_,n.width)),i.watchFunctions.push(function(t,e,n){return!(i.y]*?>/gi,\"\"),h=\"jsPDFhtmlText\"+Date.now().toString()+(1e3*Math.random()).toFixed(0),(l=document.createElement(\"div\")).style.cssText=\"position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;\",l.innerHTML='