retold-remote 0.0.26 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +53 -1
- package/source/cli/RetoldRemote-Server-Setup.js +38 -3
- package/source/cli/commands/RetoldRemote-Command-Serve.js +25 -9
- package/source/server/RetoldRemote-ImageService.js +6 -1
- package/source/views/PictView-Remote-MediaViewer.js +15 -0
- package/web-application/retold-remote.js +6 -1
- package/web-application/retold-remote.js.map +1 -1
- package/web-application/retold-remote.min.js +6 -6
- package/web-application/retold-remote.min.js.map +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).retoldRemote=t()}}(function(){return function t(e,i,n){function o(a,s){if(!i[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(r)return r(a,!0);var d=new Error("Cannot find module '"+a+"'");throw d.code="MODULE_NOT_FOUND",d}var c=i[a]={exports:{}};e[a][0].call(c.exports,function(t){return o(e[a][1][t]||t)},c,c.exports,t,e,i,n)}return i[a].exports}for(var r="function"==typeof require&&require,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(t,e,i){},{}],2:[function(t,e,i){arguments[4][1][0].apply(i,arguments)},{dup:1}],3:[function(t,e,i){var n=t("function-bind"),o=t("./functionApply"),r=t("./functionCall"),a=t("./reflectApply");e.exports=a||n.call(r,o)},{"./functionApply":4,"./functionCall":5,"./reflectApply":7,"function-bind":22}],4:[function(t,e,i){e.exports=Function.prototype.apply},{}],5:[function(t,e,i){e.exports=Function.prototype.call},{}],6:[function(t,e,i){var n=t("function-bind"),o=t("es-errors/type"),r=t("./functionCall"),a=t("./actualApply");e.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new o("a function is required");return a(n,r,t)}},{"./actualApply":3,"./functionCall":5,"es-errors/type":16,"function-bind":22}],7:[function(t,e,i){e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},{}],8:[function(t,e,i){var n=t("get-intrinsic"),o=t("call-bind-apply-helpers"),r=o([n("%String.prototype.indexOf%")]);e.exports=function(t,e){var i=n(t,!!e);return"function"==typeof i&&r(t,".prototype.")>-1?o([i]):i}},{"call-bind-apply-helpers":6,"get-intrinsic":23}],9:[function(t,e,i){var n,o=t("call-bind-apply-helpers"),r=t("gopd");try{n=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var a=!!n&&r&&r(Object.prototype,"__proto__"),s=Object,l=s.getPrototypeOf;e.exports=a&&"function"==typeof a.get?o([a.get]):"function"==typeof l&&function(t){return l(null==t?t:s(t))}},{"call-bind-apply-helpers":6,gopd:28}],10:[function(t,e,i){var n=Object.defineProperty||!1;if(n)try{n({},"a",{value:1})}catch(t){n=!1}e.exports=n},{}],11:[function(t,e,i){e.exports=EvalError},{}],12:[function(t,e,i){e.exports=Error},{}],13:[function(t,e,i){e.exports=RangeError},{}],14:[function(t,e,i){e.exports=ReferenceError},{}],15:[function(t,e,i){e.exports=SyntaxError},{}],16:[function(t,e,i){e.exports=TypeError},{}],17:[function(t,e,i){e.exports=URIError},{}],18:[function(t,e,i){e.exports=Object},{}],19:[function(t,e,i){e.exports={name:"fable-serviceproviderbase",version:"3.0.19",description:"Simple base classes for fable services.",main:"source/Fable-ServiceProviderBase.js",scripts:{start:"node source/Fable-ServiceProviderBase.js",test:"npx quack test",tests:"npx quack test -g",coverage:"npx quack coverage",build:"npx quack build",types:"tsc -p ./tsconfig.build.json",check:"tsc -p . --noEmit"},types:"types/source/Fable-ServiceProviderBase.d.ts",mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},repository:{type:"git",url:"https://github.com/stevenvelozo/fable-serviceproviderbase.git"},keywords:["entity","behavior"],author:"Steven Velozo <steven@velozo.com> (http://velozo.com/)",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/fable-serviceproviderbase/issues"},homepage:"https://github.com/stevenvelozo/fable-serviceproviderbase",devDependencies:{"@types/mocha":"^10.0.10",fable:"^3.1.62",quackage:"^1.0.58",typescript:"^5.9.3"}}},{}],20:[function(t,e,i){const n=t("../package.json");class o{constructor(t,e,i){this.fable,this.UUID,this.options,this.services,this.servicesMap,"object"==typeof t&&t.isFable?this.connectFable(t):this.fable=!1,this._PackageFableServiceProvider=n,this.fable?(this.UUID=t.getUUID(),this.options="object"==typeof e?e:{}):(this.options="object"!=typeof t||t.isFable?"object"==typeof e?e:{}:t,this.UUID=`CORE-SVC-${Math.floor(89999*Math.random()+1e4)}`),this.serviceType=`Unknown-${this.UUID}`,this.Hash="string"==typeof i?i:this.fable||"string"!=typeof e?`${this.UUID}`:e}connectFable(t){if("object"!=typeof t||!t.isFable){let e=`Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [${typeof t}].}`;return console.log(e),new Error(e)}return this.fable||(this.fable=t),this.log||(this.log=this.fable.Logging),this.services||(this.services=this.fable.services),this.servicesMap||(this.servicesMap=this.fable.servicesMap),!0}static isFableService=!0}e.exports=o,e.exports.CoreServiceProviderBase=o},{"../package.json":19}],21:[function(t,e,i){var n=Object.prototype.toString,o=Math.max,r=function(t,e){for(var i=[],n=0;n<t.length;n+=1)i[n]=t[n];for(var o=0;o<e.length;o+=1)i[o+t.length]=e[o];return i};e.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==n.apply(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var i,a=function(t,e){for(var i=[],n=e||0,o=0;n<t.length;n+=1,o+=1)i[o]=t[n];return i}(arguments,1),s=o(0,e.length-a.length),l=[],d=0;d<s;d++)l[d]="$"+d;if(i=Function("binder","return function ("+function(t,e){for(var i="",n=0;n<t.length;n+=1)i+=t[n],n+1<t.length&&(i+=e);return i}(l,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var n=e.apply(this,r(a,arguments));return Object(n)===n?n:this}return e.apply(t,r(a,arguments))}),e.prototype){var c=function(){};c.prototype=e.prototype,i.prototype=new c,c.prototype=null}return i}},{}],22:[function(t,e,i){var n=t("./implementation");e.exports=Function.prototype.bind||n},{"./implementation":21}],23:[function(t,e,i){var n,o=t("es-object-atoms"),r=t("es-errors"),a=t("es-errors/eval"),s=t("es-errors/range"),l=t("es-errors/ref"),d=t("es-errors/syntax"),c=t("es-errors/type"),p=t("es-errors/uri"),h=t("math-intrinsics/abs"),u=t("math-intrinsics/floor"),m=t("math-intrinsics/max"),g=t("math-intrinsics/min"),f=t("math-intrinsics/pow"),v=t("math-intrinsics/round"),b=t("math-intrinsics/sign"),y=Function,w=function(t){try{return y('"use strict"; return ('+t+").constructor;")()}catch(t){}},C=t("gopd"),x=t("es-define-property"),R=function(){throw new c},_=C?function(){try{return R}catch(t){try{return C(arguments,"callee").get}catch(t){return R}}}():R,D=t("has-symbols")(),E=t("get-proto"),A=t("get-proto/Object.getPrototypeOf"),T=t("get-proto/Reflect.getPrototypeOf"),S=t("call-bind-apply-helpers/functionApply"),P=t("call-bind-apply-helpers/functionCall"),k={},F="undefined"!=typeof Uint8Array&&E?E(Uint8Array):n,I={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":D&&E?E([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":k,"%AsyncGenerator%":k,"%AsyncGeneratorFunction%":k,"%AsyncIteratorPrototype%":k,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":y,"%GeneratorFunction%":k,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":D&&E?E(E([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&D&&E?E((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":C,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":l,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&D&&E?E((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":D&&E?E(""[Symbol.iterator]()):n,"%Symbol%":D?Symbol:n,"%SyntaxError%":d,"%ThrowTypeError%":_,"%TypedArray%":F,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":p,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":S,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":A,"%Math.abs%":h,"%Math.floor%":u,"%Math.max%":m,"%Math.min%":g,"%Math.pow%":f,"%Math.round%":v,"%Math.sign%":b,"%Reflect.getPrototypeOf%":T};if(E)try{null.error}catch(t){var L=E(E(t));I["%Error.prototype%"]=L}var M=function t(e){var i;if("%AsyncFunction%"===e)i=w("async function () {}");else if("%GeneratorFunction%"===e)i=w("function* () {}");else if("%AsyncGeneratorFunction%"===e)i=w("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(i=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&E&&(i=E(o.prototype))}return I[e]=i,i},B={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},H=t("function-bind"),V=t("hasown"),O=H.call(P,Array.prototype.concat),N=H.call(S,Array.prototype.splice),z=H.call(P,String.prototype.replace),j=H.call(P,String.prototype.slice),U=H.call(P,RegExp.prototype.exec),$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W=/\\(\\)?/g,G=function(t,e){var i,n=t;if(V(B,n)&&(n="%"+(i=B[n])[0]+"%"),V(I,n)){var o=I[n];if(o===k&&(o=M(n)),void 0===o&&!e)throw new c("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new d("intrinsic "+t+" does not exist!")};e.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new c('"allowMissing" argument must be a boolean');if(null===U(/^%?[^%]*%?$/,t))throw new d("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=function(t){var e=j(t,0,1),i=j(t,-1);if("%"===e&&"%"!==i)throw new d("invalid intrinsic syntax, expected closing `%`");if("%"===i&&"%"!==e)throw new d("invalid intrinsic syntax, expected opening `%`");var n=[];return z(t,$,function(t,e,i,o){n[n.length]=i?z(o,W,"$1"):e||t}),n}(t),n=i.length>0?i[0]:"",o=G("%"+n+"%",e),r=o.name,a=o.value,s=!1,l=o.alias;l&&(n=l[0],N(i,O([0,1],l)));for(var p=1,h=!0;p<i.length;p+=1){var u=i[p],m=j(u,0,1),g=j(u,-1);if(('"'===m||"'"===m||"`"===m||'"'===g||"'"===g||"`"===g)&&m!==g)throw new d("property names with quotes must have matching quotes");if("constructor"!==u&&h||(s=!0),V(I,r="%"+(n+="."+u)+"%"))a=I[r];else if(null!=a){if(!(u in a)){if(!e)throw new c("base intrinsic for "+t+" exists, but the property is not available.");return}if(C&&p+1>=i.length){var f=C(a,u);a=(h=!!f)&&"get"in f&&!("originalValue"in f.get)?f.get:a[u]}else h=V(a,u),a=a[u];h&&!s&&(I[r]=a)}}return a}},{"call-bind-apply-helpers/functionApply":4,"call-bind-apply-helpers/functionCall":5,"es-define-property":10,"es-errors":12,"es-errors/eval":11,"es-errors/range":13,"es-errors/ref":14,"es-errors/syntax":15,"es-errors/type":16,"es-errors/uri":17,"es-object-atoms":18,"function-bind":22,"get-proto":26,"get-proto/Object.getPrototypeOf":24,"get-proto/Reflect.getPrototypeOf":25,gopd:28,"has-symbols":29,hasown:31,"math-intrinsics/abs":33,"math-intrinsics/floor":34,"math-intrinsics/max":36,"math-intrinsics/min":37,"math-intrinsics/pow":38,"math-intrinsics/round":39,"math-intrinsics/sign":40}],24:[function(t,e,i){var n=t("es-object-atoms");e.exports=n.getPrototypeOf||null},{"es-object-atoms":18}],25:[function(t,e,i){e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},{}],26:[function(t,e,i){var n=t("./Reflect.getPrototypeOf"),o=t("./Object.getPrototypeOf"),r=t("dunder-proto/get");e.exports=n?function(t){return n(t)}:o?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return o(t)}:r?function(t){return r(t)}:null},{"./Object.getPrototypeOf":24,"./Reflect.getPrototypeOf":25,"dunder-proto/get":9}],27:[function(t,e,i){e.exports=Object.getOwnPropertyDescriptor},{}],28:[function(t,e,i){var n=t("./gOPD");if(n)try{n([],"length")}catch(t){n=null}e.exports=n},{"./gOPD":27}],29:[function(t,e,i){var n="undefined"!=typeof Symbol&&Symbol,o=t("./shams");e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},{"./shams":30}],30:[function(t,e,i){e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),i=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(var n in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var r=Object.getOwnPropertyDescriptor(t,e);if(42!==r.value||!0!==r.enumerable)return!1}return!0}},{}],31:[function(t,e,i){var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,r=t("function-bind");e.exports=r.call(n,o)},{"function-bind":22}],32:[function(t,e,i){!function(){var t,n,o,r,a,s,l,d,c,p,h,u,m,g,f,v,b,y,w,C,x,R,_,D,E,A,T,S,P,k,F,I=function(t){var e=new I.Builder;return e.pipeline.add(I.trimmer,I.stopWordFilter,I.stemmer),e.searchPipeline.add(I.stemmer),t.call(e,e),e.build()};I.version="2.3.9",
|
|
1
|
+
"use strict";!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).retoldRemote=t()}}(function(){return function t(e,i,n){function o(a,s){if(!i[a]){if(!e[a]){var l="function"==typeof require&&require;if(!s&&l)return l(a,!0);if(r)return r(a,!0);var d=new Error("Cannot find module '"+a+"'");throw d.code="MODULE_NOT_FOUND",d}var c=i[a]={exports:{}};e[a][0].call(c.exports,function(t){return o(e[a][1][t]||t)},c,c.exports,t,e,i,n)}return i[a].exports}for(var r="function"==typeof require&&require,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(t,e,i){},{}],2:[function(t,e,i){arguments[4][1][0].apply(i,arguments)},{dup:1}],3:[function(t,e,i){var n=t("function-bind"),o=t("./functionApply"),r=t("./functionCall"),a=t("./reflectApply");e.exports=a||n.call(r,o)},{"./functionApply":4,"./functionCall":5,"./reflectApply":7,"function-bind":22}],4:[function(t,e,i){e.exports=Function.prototype.apply},{}],5:[function(t,e,i){e.exports=Function.prototype.call},{}],6:[function(t,e,i){var n=t("function-bind"),o=t("es-errors/type"),r=t("./functionCall"),a=t("./actualApply");e.exports=function(t){if(t.length<1||"function"!=typeof t[0])throw new o("a function is required");return a(n,r,t)}},{"./actualApply":3,"./functionCall":5,"es-errors/type":16,"function-bind":22}],7:[function(t,e,i){e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},{}],8:[function(t,e,i){var n=t("get-intrinsic"),o=t("call-bind-apply-helpers"),r=o([n("%String.prototype.indexOf%")]);e.exports=function(t,e){var i=n(t,!!e);return"function"==typeof i&&r(t,".prototype.")>-1?o([i]):i}},{"call-bind-apply-helpers":6,"get-intrinsic":23}],9:[function(t,e,i){var n,o=t("call-bind-apply-helpers"),r=t("gopd");try{n=[].__proto__===Array.prototype}catch(t){if(!t||"object"!=typeof t||!("code"in t)||"ERR_PROTO_ACCESS"!==t.code)throw t}var a=!!n&&r&&r(Object.prototype,"__proto__"),s=Object,l=s.getPrototypeOf;e.exports=a&&"function"==typeof a.get?o([a.get]):"function"==typeof l&&function(t){return l(null==t?t:s(t))}},{"call-bind-apply-helpers":6,gopd:28}],10:[function(t,e,i){var n=Object.defineProperty||!1;if(n)try{n({},"a",{value:1})}catch(t){n=!1}e.exports=n},{}],11:[function(t,e,i){e.exports=EvalError},{}],12:[function(t,e,i){e.exports=Error},{}],13:[function(t,e,i){e.exports=RangeError},{}],14:[function(t,e,i){e.exports=ReferenceError},{}],15:[function(t,e,i){e.exports=SyntaxError},{}],16:[function(t,e,i){e.exports=TypeError},{}],17:[function(t,e,i){e.exports=URIError},{}],18:[function(t,e,i){e.exports=Object},{}],19:[function(t,e,i){e.exports={name:"fable-serviceproviderbase",version:"3.0.19",description:"Simple base classes for fable services.",main:"source/Fable-ServiceProviderBase.js",scripts:{start:"node source/Fable-ServiceProviderBase.js",test:"npx quack test",tests:"npx quack test -g",coverage:"npx quack coverage",build:"npx quack build",types:"tsc -p ./tsconfig.build.json",check:"tsc -p . --noEmit"},types:"types/source/Fable-ServiceProviderBase.d.ts",mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},repository:{type:"git",url:"https://github.com/stevenvelozo/fable-serviceproviderbase.git"},keywords:["entity","behavior"],author:"Steven Velozo <steven@velozo.com> (http://velozo.com/)",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/fable-serviceproviderbase/issues"},homepage:"https://github.com/stevenvelozo/fable-serviceproviderbase",devDependencies:{"@types/mocha":"^10.0.10",fable:"^3.1.62",quackage:"^1.0.58",typescript:"^5.9.3"}}},{}],20:[function(t,e,i){const n=t("../package.json");class o{constructor(t,e,i){this.fable,this.UUID,this.options,this.services,this.servicesMap,"object"==typeof t&&t.isFable?this.connectFable(t):this.fable=!1,this._PackageFableServiceProvider=n,this.fable?(this.UUID=t.getUUID(),this.options="object"==typeof e?e:{}):(this.options="object"!=typeof t||t.isFable?"object"==typeof e?e:{}:t,this.UUID=`CORE-SVC-${Math.floor(89999*Math.random()+1e4)}`),this.serviceType=`Unknown-${this.UUID}`,this.Hash="string"==typeof i?i:this.fable||"string"!=typeof e?`${this.UUID}`:e}connectFable(t){if("object"!=typeof t||!t.isFable){let e=`Fable Service Provider Base: Cannot connect to Fable, invalid Fable object passed in. The pFable parameter was a [${typeof t}].}`;return console.log(e),new Error(e)}return this.fable||(this.fable=t),this.log||(this.log=this.fable.Logging),this.services||(this.services=this.fable.services),this.servicesMap||(this.servicesMap=this.fable.servicesMap),!0}static isFableService=!0}e.exports=o,e.exports.CoreServiceProviderBase=o},{"../package.json":19}],21:[function(t,e,i){var n=Object.prototype.toString,o=Math.max,r=function(t,e){for(var i=[],n=0;n<t.length;n+=1)i[n]=t[n];for(var o=0;o<e.length;o+=1)i[o+t.length]=e[o];return i};e.exports=function(t){var e=this;if("function"!=typeof e||"[object Function]"!==n.apply(e))throw new TypeError("Function.prototype.bind called on incompatible "+e);for(var i,a=function(t,e){for(var i=[],n=e||0,o=0;n<t.length;n+=1,o+=1)i[o]=t[n];return i}(arguments,1),s=o(0,e.length-a.length),l=[],d=0;d<s;d++)l[d]="$"+d;if(i=Function("binder","return function ("+function(t,e){for(var i="",n=0;n<t.length;n+=1)i+=t[n],n+1<t.length&&(i+=e);return i}(l,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var n=e.apply(this,r(a,arguments));return Object(n)===n?n:this}return e.apply(t,r(a,arguments))}),e.prototype){var c=function(){};c.prototype=e.prototype,i.prototype=new c,c.prototype=null}return i}},{}],22:[function(t,e,i){var n=t("./implementation");e.exports=Function.prototype.bind||n},{"./implementation":21}],23:[function(t,e,i){var n,o=t("es-object-atoms"),r=t("es-errors"),a=t("es-errors/eval"),s=t("es-errors/range"),l=t("es-errors/ref"),d=t("es-errors/syntax"),c=t("es-errors/type"),p=t("es-errors/uri"),h=t("math-intrinsics/abs"),u=t("math-intrinsics/floor"),m=t("math-intrinsics/max"),g=t("math-intrinsics/min"),f=t("math-intrinsics/pow"),v=t("math-intrinsics/round"),b=t("math-intrinsics/sign"),y=Function,w=function(t){try{return y('"use strict"; return ('+t+").constructor;")()}catch(t){}},C=t("gopd"),x=t("es-define-property"),R=function(){throw new c},_=C?function(){try{return R}catch(t){try{return C(arguments,"callee").get}catch(t){return R}}}():R,D=t("has-symbols")(),E=t("get-proto"),A=t("get-proto/Object.getPrototypeOf"),S=t("get-proto/Reflect.getPrototypeOf"),T=t("call-bind-apply-helpers/functionApply"),P=t("call-bind-apply-helpers/functionCall"),k={},F="undefined"!=typeof Uint8Array&&E?E(Uint8Array):n,I={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":D&&E?E([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":k,"%AsyncGenerator%":k,"%AsyncGeneratorFunction%":k,"%AsyncIteratorPrototype%":k,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":r,"%eval%":eval,"%EvalError%":a,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":y,"%GeneratorFunction%":k,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":D&&E?E(E([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&D&&E?E((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":o,"%Object.getOwnPropertyDescriptor%":C,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":l,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&D&&E?E((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":D&&E?E(""[Symbol.iterator]()):n,"%Symbol%":D?Symbol:n,"%SyntaxError%":d,"%ThrowTypeError%":_,"%TypedArray%":F,"%TypeError%":c,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":p,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":P,"%Function.prototype.apply%":T,"%Object.defineProperty%":x,"%Object.getPrototypeOf%":A,"%Math.abs%":h,"%Math.floor%":u,"%Math.max%":m,"%Math.min%":g,"%Math.pow%":f,"%Math.round%":v,"%Math.sign%":b,"%Reflect.getPrototypeOf%":S};if(E)try{null.error}catch(t){var L=E(E(t));I["%Error.prototype%"]=L}var M=function t(e){var i;if("%AsyncFunction%"===e)i=w("async function () {}");else if("%GeneratorFunction%"===e)i=w("function* () {}");else if("%AsyncGeneratorFunction%"===e)i=w("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(i=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&E&&(i=E(o.prototype))}return I[e]=i,i},B={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},H=t("function-bind"),V=t("hasown"),O=H.call(P,Array.prototype.concat),N=H.call(T,Array.prototype.splice),z=H.call(P,String.prototype.replace),j=H.call(P,String.prototype.slice),U=H.call(P,RegExp.prototype.exec),$=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W=/\\(\\)?/g,G=function(t,e){var i,n=t;if(V(B,n)&&(n="%"+(i=B[n])[0]+"%"),V(I,n)){var o=I[n];if(o===k&&(o=M(n)),void 0===o&&!e)throw new c("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new d("intrinsic "+t+" does not exist!")};e.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new c('"allowMissing" argument must be a boolean');if(null===U(/^%?[^%]*%?$/,t))throw new d("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=function(t){var e=j(t,0,1),i=j(t,-1);if("%"===e&&"%"!==i)throw new d("invalid intrinsic syntax, expected closing `%`");if("%"===i&&"%"!==e)throw new d("invalid intrinsic syntax, expected opening `%`");var n=[];return z(t,$,function(t,e,i,o){n[n.length]=i?z(o,W,"$1"):e||t}),n}(t),n=i.length>0?i[0]:"",o=G("%"+n+"%",e),r=o.name,a=o.value,s=!1,l=o.alias;l&&(n=l[0],N(i,O([0,1],l)));for(var p=1,h=!0;p<i.length;p+=1){var u=i[p],m=j(u,0,1),g=j(u,-1);if(('"'===m||"'"===m||"`"===m||'"'===g||"'"===g||"`"===g)&&m!==g)throw new d("property names with quotes must have matching quotes");if("constructor"!==u&&h||(s=!0),V(I,r="%"+(n+="."+u)+"%"))a=I[r];else if(null!=a){if(!(u in a)){if(!e)throw new c("base intrinsic for "+t+" exists, but the property is not available.");return}if(C&&p+1>=i.length){var f=C(a,u);a=(h=!!f)&&"get"in f&&!("originalValue"in f.get)?f.get:a[u]}else h=V(a,u),a=a[u];h&&!s&&(I[r]=a)}}return a}},{"call-bind-apply-helpers/functionApply":4,"call-bind-apply-helpers/functionCall":5,"es-define-property":10,"es-errors":12,"es-errors/eval":11,"es-errors/range":13,"es-errors/ref":14,"es-errors/syntax":15,"es-errors/type":16,"es-errors/uri":17,"es-object-atoms":18,"function-bind":22,"get-proto":26,"get-proto/Object.getPrototypeOf":24,"get-proto/Reflect.getPrototypeOf":25,gopd:28,"has-symbols":29,hasown:31,"math-intrinsics/abs":33,"math-intrinsics/floor":34,"math-intrinsics/max":36,"math-intrinsics/min":37,"math-intrinsics/pow":38,"math-intrinsics/round":39,"math-intrinsics/sign":40}],24:[function(t,e,i){var n=t("es-object-atoms");e.exports=n.getPrototypeOf||null},{"es-object-atoms":18}],25:[function(t,e,i){e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},{}],26:[function(t,e,i){var n=t("./Reflect.getPrototypeOf"),o=t("./Object.getPrototypeOf"),r=t("dunder-proto/get");e.exports=n?function(t){return n(t)}:o?function(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return o(t)}:r?function(t){return r(t)}:null},{"./Object.getPrototypeOf":24,"./Reflect.getPrototypeOf":25,"dunder-proto/get":9}],27:[function(t,e,i){e.exports=Object.getOwnPropertyDescriptor},{}],28:[function(t,e,i){var n=t("./gOPD");if(n)try{n([],"length")}catch(t){n=null}e.exports=n},{"./gOPD":27}],29:[function(t,e,i){var n="undefined"!=typeof Symbol&&Symbol,o=t("./shams");e.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&o())))}},{"./shams":30}],30:[function(t,e,i){e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),i=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(var n in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var o=Object.getOwnPropertySymbols(t);if(1!==o.length||o[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var r=Object.getOwnPropertyDescriptor(t,e);if(42!==r.value||!0!==r.enumerable)return!1}return!0}},{}],31:[function(t,e,i){var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,r=t("function-bind");e.exports=r.call(n,o)},{"function-bind":22}],32:[function(t,e,i){!function(){var t,n,o,r,a,s,l,d,c,p,h,u,m,g,f,v,b,y,w,C,x,R,_,D,E,A,S,T,P,k,F,I=function(t){var e=new I.Builder;return e.pipeline.add(I.trimmer,I.stopWordFilter,I.stemmer),e.searchPipeline.add(I.stemmer),t.call(e,e),e.build()};I.version="2.3.9",
|
|
2
2
|
/*!
|
|
3
3
|
* lunr.utils
|
|
4
4
|
* Copyright (C) 2020 Oliver Nightingale
|
|
@@ -29,7 +29,7 @@ I.Vector=function(t){this._magnitude=0,this.elements=t||[]},I.Vector.prototype.p
|
|
|
29
29
|
* Copyright (C) 2020 Oliver Nightingale
|
|
30
30
|
* Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt
|
|
31
31
|
*/
|
|
32
|
-
I.stemmer=(t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},n={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},s="^("+(r="[^aeiou][^aeiouy]*")+")?"+(a=(o="[aeiouy]")+"[aeiou]*")+r+"("+a+")?$",l="^("+r+")?"+a+r+a+r,d="^("+r+")?"+o,c=new RegExp("^("+r+")?"+a+r),p=new RegExp(l),h=new RegExp(s),u=new RegExp(d),m=/^(.+?)(ss|i)es$/,g=/^(.+?)([^s])s$/,f=/^(.+?)eed$/,v=/^(.+?)(ed|ing)$/,b=/.$/,y=/(at|bl|iz)$/,w=new RegExp("([^aeiouylsz])\\1$"),C=new RegExp("^"+r+o+"[^aeiouwxy]$"),x=/^(.+?[^aeiou])y$/,R=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,_=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,D=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,E=/^(.+?)(s|t)(ion)$/,A=/^(.+?)e$/,
|
|
32
|
+
I.stemmer=(t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},n={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},s="^("+(r="[^aeiou][^aeiouy]*")+")?"+(a=(o="[aeiouy]")+"[aeiou]*")+r+"("+a+")?$",l="^("+r+")?"+a+r+a+r,d="^("+r+")?"+o,c=new RegExp("^("+r+")?"+a+r),p=new RegExp(l),h=new RegExp(s),u=new RegExp(d),m=/^(.+?)(ss|i)es$/,g=/^(.+?)([^s])s$/,f=/^(.+?)eed$/,v=/^(.+?)(ed|ing)$/,b=/.$/,y=/(at|bl|iz)$/,w=new RegExp("([^aeiouylsz])\\1$"),C=new RegExp("^"+r+o+"[^aeiouwxy]$"),x=/^(.+?[^aeiou])y$/,R=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,_=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,D=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,E=/^(.+?)(s|t)(ion)$/,A=/^(.+?)e$/,S=/ll$/,T=new RegExp("^"+r+o+"[^aeiouwxy]$"),P=function(e){var i,o,r,a,s,l,d;if(e.length<3)return e;if("y"==(r=e.substr(0,1))&&(e=r.toUpperCase()+e.substr(1)),s=g,(a=m).test(e)?e=e.replace(a,"$1$2"):s.test(e)&&(e=e.replace(s,"$1$2")),s=v,(a=f).test(e)){var P=a.exec(e);(a=c).test(P[1])&&(a=b,e=e.replace(a,""))}else s.test(e)&&(i=(P=s.exec(e))[1],(s=u).test(i)&&(l=w,d=C,(s=y).test(e=i)?e+="e":l.test(e)?(a=b,e=e.replace(a,"")):d.test(e)&&(e+="e")));return(a=x).test(e)&&(e=(i=(P=a.exec(e))[1])+"i"),(a=R).test(e)&&(i=(P=a.exec(e))[1],o=P[2],(a=c).test(i)&&(e=i+t[o])),(a=_).test(e)&&(i=(P=a.exec(e))[1],o=P[2],(a=c).test(i)&&(e=i+n[o])),s=E,(a=D).test(e)?(i=(P=a.exec(e))[1],(a=p).test(i)&&(e=i)):s.test(e)&&(i=(P=s.exec(e))[1]+P[2],(s=p).test(i)&&(e=i)),(a=A).test(e)&&(i=(P=a.exec(e))[1],s=h,l=T,((a=p).test(i)||s.test(i)&&!l.test(i))&&(e=i)),s=p,(a=S).test(e)&&s.test(e)&&(a=b,e=e.replace(a,"")),"y"==r&&(e=r.toLowerCase()+e.substr(1)),e},function(t){return t.update(P)}),I.Pipeline.registerFunction(I.stemmer,"stemmer"),
|
|
33
33
|
/*!
|
|
34
34
|
* lunr.stopWordFilter
|
|
35
35
|
* Copyright (C) 2020 Oliver Nightingale
|
|
@@ -49,12 +49,12 @@ I.TokenSet=function(){this.final=!1,this.edges={},this.id=I.TokenSet._nextId,I.T
|
|
|
49
49
|
* lunr.Index
|
|
50
50
|
* Copyright (C) 2020 Oliver Nightingale
|
|
51
51
|
*/
|
|
52
|
-
I.Index=function(t){this.invertedIndex=t.invertedIndex,this.fieldVectors=t.fieldVectors,this.tokenSet=t.tokenSet,this.fields=t.fields,this.pipeline=t.pipeline},I.Index.prototype.search=function(t){return this.query(function(e){new I.QueryParser(t,e).parse()})},I.Index.prototype.query=function(t){for(var e=new I.Query(this.fields),i=Object.create(null),n=Object.create(null),o=Object.create(null),r=Object.create(null),a=Object.create(null),s=0;s<this.fields.length;s++)n[this.fields[s]]=new I.Vector;t.call(e,e);for(s=0;s<e.clauses.length;s++){var l=e.clauses[s],d=null,c=I.Set.empty;d=l.usePipeline?this.pipeline.runString(l.term,{fields:l.fields}):[l.term];for(var p=0;p<d.length;p++){var h=d[p];l.term=h;var u=I.TokenSet.fromClause(l),m=this.tokenSet.intersect(u).toArray();if(0===m.length&&l.presence===I.Query.presence.REQUIRED){for(var g=0;g<l.fields.length;g++){r[k=l.fields[g]]=I.Set.empty}break}for(var f=0;f<m.length;f++){var v=m[f],b=this.invertedIndex[v],y=b._index;for(g=0;g<l.fields.length;g++){var w=b[k=l.fields[g]],C=Object.keys(w),x=v+"/"+k,R=new I.Set(C);if(l.presence==I.Query.presence.REQUIRED&&(c=c.union(R),void 0===r[k]&&(r[k]=I.Set.complete)),l.presence!=I.Query.presence.PROHIBITED){if(n[k].upsert(y,l.boost,function(t,e){return t+e}),!o[x]){for(var _=0;_<C.length;_++){var D,E=C[_],A=new I.FieldRef(E,k),
|
|
52
|
+
I.Index=function(t){this.invertedIndex=t.invertedIndex,this.fieldVectors=t.fieldVectors,this.tokenSet=t.tokenSet,this.fields=t.fields,this.pipeline=t.pipeline},I.Index.prototype.search=function(t){return this.query(function(e){new I.QueryParser(t,e).parse()})},I.Index.prototype.query=function(t){for(var e=new I.Query(this.fields),i=Object.create(null),n=Object.create(null),o=Object.create(null),r=Object.create(null),a=Object.create(null),s=0;s<this.fields.length;s++)n[this.fields[s]]=new I.Vector;t.call(e,e);for(s=0;s<e.clauses.length;s++){var l=e.clauses[s],d=null,c=I.Set.empty;d=l.usePipeline?this.pipeline.runString(l.term,{fields:l.fields}):[l.term];for(var p=0;p<d.length;p++){var h=d[p];l.term=h;var u=I.TokenSet.fromClause(l),m=this.tokenSet.intersect(u).toArray();if(0===m.length&&l.presence===I.Query.presence.REQUIRED){for(var g=0;g<l.fields.length;g++){r[k=l.fields[g]]=I.Set.empty}break}for(var f=0;f<m.length;f++){var v=m[f],b=this.invertedIndex[v],y=b._index;for(g=0;g<l.fields.length;g++){var w=b[k=l.fields[g]],C=Object.keys(w),x=v+"/"+k,R=new I.Set(C);if(l.presence==I.Query.presence.REQUIRED&&(c=c.union(R),void 0===r[k]&&(r[k]=I.Set.complete)),l.presence!=I.Query.presence.PROHIBITED){if(n[k].upsert(y,l.boost,function(t,e){return t+e}),!o[x]){for(var _=0;_<C.length;_++){var D,E=C[_],A=new I.FieldRef(E,k),S=w[E];void 0===(D=i[A])?i[A]=new I.MatchData(v,k,S):D.add(v,k,S)}o[x]=!0}}else void 0===a[k]&&(a[k]=I.Set.empty),a[k]=a[k].union(R)}}}if(l.presence===I.Query.presence.REQUIRED)for(g=0;g<l.fields.length;g++){r[k=l.fields[g]]=r[k].intersect(c)}}var T=I.Set.complete,P=I.Set.empty;for(s=0;s<this.fields.length;s++){var k;r[k=this.fields[s]]&&(T=T.intersect(r[k])),a[k]&&(P=P.union(a[k]))}var F=Object.keys(i),L=[],M=Object.create(null);if(e.isNegated()){F=Object.keys(this.fieldVectors);for(s=0;s<F.length;s++){A=F[s];var B=I.FieldRef.fromString(A);i[A]=new I.MatchData}}for(s=0;s<F.length;s++){var H=(B=I.FieldRef.fromString(F[s])).docRef;if(T.contains(H)&&!P.contains(H)){var V,O=this.fieldVectors[B],N=n[B.fieldName].similarity(O);if(void 0!==(V=M[H]))V.score+=N,V.matchData.combine(i[B]);else{var z={ref:H,score:N,matchData:i[B]};M[H]=z,L.push(z)}}}return L.sort(function(t,e){return e.score-t.score})},I.Index.prototype.toJSON=function(){var t=Object.keys(this.invertedIndex).sort().map(function(t){return[t,this.invertedIndex[t]]},this),e=Object.keys(this.fieldVectors).map(function(t){return[t,this.fieldVectors[t].toJSON()]},this);return{version:I.version,fields:this.fields,fieldVectors:e,invertedIndex:t,pipeline:this.pipeline.toJSON()}},I.Index.load=function(t){var e={},i={},n=t.fieldVectors,o=Object.create(null),r=t.invertedIndex,a=new I.TokenSet.Builder,s=I.Pipeline.load(t.pipeline);t.version!=I.version&&I.utils.warn("Version mismatch when loading serialised index. Current version of lunr '"+I.version+"' does not match serialized index '"+t.version+"'");for(var l=0;l<n.length;l++){var d=(p=n[l])[0],c=p[1];i[d]=new I.Vector(c)}for(l=0;l<r.length;l++){var p,h=(p=r[l])[0],u=p[1];a.insert(h),o[h]=u}return a.finish(),e.fields=t.fields,e.fieldVectors=i,e.invertedIndex=o,e.tokenSet=a.root,e.pipeline=s,new I.Index(e)},
|
|
53
53
|
/*!
|
|
54
54
|
* lunr.Builder
|
|
55
55
|
* Copyright (C) 2020 Oliver Nightingale
|
|
56
56
|
*/
|
|
57
|
-
I.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=I.tokenizer,this.pipeline=new I.Pipeline,this.searchPipeline=new I.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},I.Builder.prototype.ref=function(t){this._ref=t},I.Builder.prototype.field=function(t,e){if(/\//.test(t))throw new RangeError("Field '"+t+"' contains illegal character '/'");this._fields[t]=e||{}},I.Builder.prototype.b=function(t){this._b=t<0?0:t>1?1:t},I.Builder.prototype.k1=function(t){this._k1=t},I.Builder.prototype.add=function(t,e){var i=t[this._ref],n=Object.keys(this._fields);this._documents[i]=e||{},this.documentCount+=1;for(var o=0;o<n.length;o++){var r=n[o],a=this._fields[r].extractor,s=a?a(t):t[r],l=this.tokenizer(s,{fields:[r]}),d=this.pipeline.run(l),c=new I.FieldRef(i,r),p=Object.create(null);this.fieldTermFrequencies[c]=p,this.fieldLengths[c]=0,this.fieldLengths[c]+=d.length;for(var h=0;h<d.length;h++){var u=d[h];if(null==p[u]&&(p[u]=0),p[u]+=1,null==this.invertedIndex[u]){var m=Object.create(null);m._index=this.termIndex,this.termIndex+=1;for(var g=0;g<n.length;g++)m[n[g]]=Object.create(null);this.invertedIndex[u]=m}null==this.invertedIndex[u][r][i]&&(this.invertedIndex[u][r][i]=Object.create(null));for(var f=0;f<this.metadataWhitelist.length;f++){var v=this.metadataWhitelist[f],b=u.metadata[v];null==this.invertedIndex[u][r][i][v]&&(this.invertedIndex[u][r][i][v]=[]),this.invertedIndex[u][r][i][v].push(b)}}}},I.Builder.prototype.calculateAverageFieldLengths=function(){for(var t=Object.keys(this.fieldLengths),e=t.length,i={},n={},o=0;o<e;o++){var r=I.FieldRef.fromString(t[o]),a=r.fieldName;n[a]||(n[a]=0),n[a]+=1,i[a]||(i[a]=0),i[a]+=this.fieldLengths[r]}var s=Object.keys(this._fields);for(o=0;o<s.length;o++){var l=s[o];i[l]=i[l]/n[l]}this.averageFieldLength=i},I.Builder.prototype.createFieldVectors=function(){for(var t={},e=Object.keys(this.fieldTermFrequencies),i=e.length,n=Object.create(null),o=0;o<i;o++){for(var r=I.FieldRef.fromString(e[o]),a=r.fieldName,s=this.fieldLengths[r],l=new I.Vector,d=this.fieldTermFrequencies[r],c=Object.keys(d),p=c.length,h=this._fields[a].boost||1,u=this._documents[r.docRef].boost||1,m=0;m<p;m++){var g,f,v,b=c[m],y=d[b],w=this.invertedIndex[b]._index;void 0===n[b]?(g=I.idf(this.invertedIndex[b],this.documentCount),n[b]=g):g=n[b],f=g*((this._k1+1)*y)/(this._k1*(1-this._b+this._b*(s/this.averageFieldLength[a]))+y),f*=h,f*=u,v=Math.round(1e3*f)/1e3,l.insert(w,v)}t[r]=l}this.fieldVectors=t},I.Builder.prototype.createTokenSet=function(){this.tokenSet=I.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},I.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new I.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},I.Builder.prototype.use=function(t){var e=Array.prototype.slice.call(arguments,1);e.unshift(this),t.apply(this,e)},I.MatchData=function(t,e,i){for(var n=Object.create(null),o=Object.keys(i||{}),r=0;r<o.length;r++){var a=o[r];n[a]=i[a].slice()}this.metadata=Object.create(null),void 0!==t&&(this.metadata[t]=Object.create(null),this.metadata[t][e]=n)},I.MatchData.prototype.combine=function(t){for(var e=Object.keys(t.metadata),i=0;i<e.length;i++){var n=e[i],o=Object.keys(t.metadata[n]);null==this.metadata[n]&&(this.metadata[n]=Object.create(null));for(var r=0;r<o.length;r++){var a=o[r],s=Object.keys(t.metadata[n][a]);null==this.metadata[n][a]&&(this.metadata[n][a]=Object.create(null));for(var l=0;l<s.length;l++){var d=s[l];null==this.metadata[n][a][d]?this.metadata[n][a][d]=t.metadata[n][a][d]:this.metadata[n][a][d]=this.metadata[n][a][d].concat(t.metadata[n][a][d])}}}},I.MatchData.prototype.add=function(t,e,i){if(!(t in this.metadata))return this.metadata[t]=Object.create(null),void(this.metadata[t][e]=i);if(e in this.metadata[t])for(var n=Object.keys(i),o=0;o<n.length;o++){var r=n[o];r in this.metadata[t][e]?this.metadata[t][e][r]=this.metadata[t][e][r].concat(i[r]):this.metadata[t][e][r]=i[r]}else this.metadata[t][e]=i},I.Query=function(t){this.clauses=[],this.allFields=t},I.Query.wildcard=new String("*"),I.Query.wildcard.NONE=0,I.Query.wildcard.LEADING=1,I.Query.wildcard.TRAILING=2,I.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},I.Query.prototype.clause=function(t){return"fields"in t||(t.fields=this.allFields),"boost"in t||(t.boost=1),"usePipeline"in t||(t.usePipeline=!0),"wildcard"in t||(t.wildcard=I.Query.wildcard.NONE),t.wildcard&I.Query.wildcard.LEADING&&t.term.charAt(0)!=I.Query.wildcard&&(t.term="*"+t.term),t.wildcard&I.Query.wildcard.TRAILING&&t.term.slice(-1)!=I.Query.wildcard&&(t.term=t.term+"*"),"presence"in t||(t.presence=I.Query.presence.OPTIONAL),this.clauses.push(t),this},I.Query.prototype.isNegated=function(){for(var t=0;t<this.clauses.length;t++)if(this.clauses[t].presence!=I.Query.presence.PROHIBITED)return!1;return!0},I.Query.prototype.term=function(t,e){if(Array.isArray(t))return t.forEach(function(t){this.term(t,I.utils.clone(e))},this),this;var i=e||{};return i.term=t.toString(),this.clause(i),this},I.QueryParseError=function(t,e,i){this.name="QueryParseError",this.message=t,this.start=e,this.end=i},I.QueryParseError.prototype=new Error,I.QueryLexer=function(t){this.lexemes=[],this.str=t,this.length=t.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},I.QueryLexer.prototype.run=function(){for(var t=I.QueryLexer.lexText;t;)t=t(this)},I.QueryLexer.prototype.sliceString=function(){for(var t=[],e=this.start,i=this.pos,n=0;n<this.escapeCharPositions.length;n++)i=this.escapeCharPositions[n],t.push(this.str.slice(e,i)),e=i+1;return t.push(this.str.slice(e,this.pos)),this.escapeCharPositions.length=0,t.join("")},I.QueryLexer.prototype.emit=function(t){this.lexemes.push({type:t,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},I.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},I.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return I.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},I.QueryLexer.prototype.width=function(){return this.pos-this.start},I.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},I.QueryLexer.prototype.backup=function(){this.pos-=1},I.QueryLexer.prototype.acceptDigitRun=function(){var t,e;do{e=(t=this.next()).charCodeAt(0)}while(e>47&&e<58);t!=I.QueryLexer.EOS&&this.backup()},I.QueryLexer.prototype.more=function(){return this.pos<this.length},I.QueryLexer.EOS="EOS",I.QueryLexer.FIELD="FIELD",I.QueryLexer.TERM="TERM",I.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",I.QueryLexer.BOOST="BOOST",I.QueryLexer.PRESENCE="PRESENCE",I.QueryLexer.lexField=function(t){return t.backup(),t.emit(I.QueryLexer.FIELD),t.ignore(),I.QueryLexer.lexText},I.QueryLexer.lexTerm=function(t){if(t.width()>1&&(t.backup(),t.emit(I.QueryLexer.TERM)),t.ignore(),t.more())return I.QueryLexer.lexText},I.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(I.QueryLexer.EDIT_DISTANCE),I.QueryLexer.lexText},I.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(I.QueryLexer.BOOST),I.QueryLexer.lexText},I.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(I.QueryLexer.TERM)},I.QueryLexer.termSeparator=I.tokenizer.separator,I.QueryLexer.lexText=function(t){for(;;){var e=t.next();if(e==I.QueryLexer.EOS)return I.QueryLexer.lexEOS;if(92!=e.charCodeAt(0)){if(":"==e)return I.QueryLexer.lexField;if("~"==e)return t.backup(),t.width()>0&&t.emit(I.QueryLexer.TERM),I.QueryLexer.lexEditDistance;if("^"==e)return t.backup(),t.width()>0&&t.emit(I.QueryLexer.TERM),I.QueryLexer.lexBoost;if("+"==e&&1===t.width())return t.emit(I.QueryLexer.PRESENCE),I.QueryLexer.lexText;if("-"==e&&1===t.width())return t.emit(I.QueryLexer.PRESENCE),I.QueryLexer.lexText;if(e.match(I.QueryLexer.termSeparator))return I.QueryLexer.lexTerm}else t.escapeCharacter()}},I.QueryParser=function(t,e){this.lexer=new I.QueryLexer(t),this.query=e,this.currentClause={},this.lexemeIdx=0},I.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=I.QueryParser.parseClause;t;)t=t(this);return this.query},I.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},I.QueryParser.prototype.consumeLexeme=function(){var t=this.peekLexeme();return this.lexemeIdx+=1,t},I.QueryParser.prototype.nextClause=function(){var t=this.currentClause;this.query.clause(t),this.currentClause={}},I.QueryParser.parseClause=function(t){var e=t.peekLexeme();if(null!=e)switch(e.type){case I.QueryLexer.PRESENCE:return I.QueryParser.parsePresence;case I.QueryLexer.FIELD:return I.QueryParser.parseField;case I.QueryLexer.TERM:return I.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+e.type;throw e.str.length>=1&&(i+=" with value '"+e.str+"'"),new I.QueryParseError(i,e.start,e.end)}},I.QueryParser.parsePresence=function(t){var e=t.consumeLexeme();if(null!=e){switch(e.str){case"-":t.currentClause.presence=I.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=I.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+e.str+"'";throw new I.QueryParseError(i,e.start,e.end)}var n=t.peekLexeme();if(null==n){i="expecting term or field, found nothing";throw new I.QueryParseError(i,e.start,e.end)}switch(n.type){case I.QueryLexer.FIELD:return I.QueryParser.parseField;case I.QueryLexer.TERM:return I.QueryParser.parseTerm;default:i="expecting term or field, found '"+n.type+"'";throw new I.QueryParseError(i,n.start,n.end)}}},I.QueryParser.parseField=function(t){var e=t.consumeLexeme();if(null!=e){if(-1==t.query.allFields.indexOf(e.str)){var i=t.query.allFields.map(function(t){return"'"+t+"'"}).join(", "),n="unrecognised field '"+e.str+"', possible fields: "+i;throw new I.QueryParseError(n,e.start,e.end)}t.currentClause.fields=[e.str];var o=t.peekLexeme();if(null==o){n="expecting term, found nothing";throw new I.QueryParseError(n,e.start,e.end)}if(o.type===I.QueryLexer.TERM)return I.QueryParser.parseTerm;n="expecting term, found '"+o.type+"'";throw new I.QueryParseError(n,o.start,o.end)}},I.QueryParser.parseTerm=function(t){var e=t.consumeLexeme();if(null!=e){t.currentClause.term=e.str.toLowerCase(),-1!=e.str.indexOf("*")&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(null!=i)switch(i.type){case I.QueryLexer.TERM:return t.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return t.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;case I.QueryLexer.PRESENCE:return t.nextClause(),I.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+i.type+"'";throw new I.QueryParseError(n,i.start,i.end)}else t.nextClause()}},I.QueryParser.parseEditDistance=function(t){var e=t.consumeLexeme();if(null!=e){var i=parseInt(e.str,10);if(isNaN(i)){var n="edit distance must be numeric";throw new I.QueryParseError(n,e.start,e.end)}t.currentClause.editDistance=i;var o=t.peekLexeme();if(null!=o)switch(o.type){case I.QueryLexer.TERM:return t.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return t.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;case I.QueryLexer.PRESENCE:return t.nextClause(),I.QueryParser.parsePresence;default:n="Unexpected lexeme type '"+o.type+"'";throw new I.QueryParseError(n,o.start,o.end)}else t.nextClause()}},I.QueryParser.parseBoost=function(t){var e=t.consumeLexeme();if(null!=e){var i=parseInt(e.str,10);if(isNaN(i)){var n="boost must be numeric";throw new I.QueryParseError(n,e.start,e.end)}t.currentClause.boost=i;var o=t.peekLexeme();if(null!=o)switch(o.type){case I.QueryLexer.TERM:return t.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return t.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;case I.QueryLexer.PRESENCE:return t.nextClause(),I.QueryParser.parsePresence;default:n="Unexpected lexeme type '"+o.type+"'";throw new I.QueryParseError(n,o.start,o.end)}else t.nextClause()}},k=this,F=function(){return I},"object"==typeof i?e.exports=F():k.lunr=F()}()},{}],33:[function(t,e,i){e.exports=Math.abs},{}],34:[function(t,e,i){e.exports=Math.floor},{}],35:[function(t,e,i){e.exports=Number.isNaN||function(t){return t!=t}},{}],36:[function(t,e,i){e.exports=Math.max},{}],37:[function(t,e,i){e.exports=Math.min},{}],38:[function(t,e,i){e.exports=Math.pow},{}],39:[function(t,e,i){e.exports=Math.round},{}],40:[function(t,e,i){var n=t("./isNaN");e.exports=function(t){return n(t)||0===t?t:t<0?-1:1}},{"./isNaN":35}],41:[function(t,e,i){(function(i){(function(){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,d=s&&l&&"function"==typeof l.get?l.get:null,c=s&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,u="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,m=Boolean.prototype.valueOf,g=Object.prototype.toString,f=Function.prototype.toString,v=String.prototype.match,b=String.prototype.slice,y=String.prototype.replace,w=String.prototype.toUpperCase,C=String.prototype.toLowerCase,x=RegExp.prototype.test,R=Array.prototype.concat,_=Array.prototype.join,D=Array.prototype.slice,E=Math.floor,A="function"==typeof BigInt?BigInt.prototype.valueOf:null,T=Object.getOwnPropertySymbols,S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,P="function"==typeof Symbol&&"object"==typeof Symbol.iterator,k="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===P||"symbol")?Symbol.toStringTag:null,F=Object.prototype.propertyIsEnumerable,I=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function L(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||x.call(/e/,e))return e;var i=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-E(-t):E(t);if(n!==t){var o=String(n),r=b.call(e,o.length+1);return y.call(o,i,"$&_")+"."+y.call(y.call(r,/([0-9]{3})/g,"$&_"),/_$/,"")}}return y.call(e,i,"$&_")}var M=t("./util.inspect"),B=M.custom,H=W(B)?B:null,V={__proto__:null,double:'"',single:"'"},O={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function N(t,e,i){var n=i.quoteStyle||e,o=V[n];return o+t+o}function z(t){return y.call(String(t),/"/g,""")}function j(t){return!k||!("object"==typeof t&&(k in t||void 0!==t[k]))}function U(t){return"[object Array]"===X(t)&&j(t)}function $(t){return"[object RegExp]"===X(t)&&j(t)}function W(t){if(P)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!S)return!1;try{return S.call(t),!0}catch(t){}return!1}e.exports=function t(e,n,o,s){var l=n||{};if(q(l,"quoteStyle")&&!q(V,l.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var g=!q(l,"customInspect")||l.customInspect;if("boolean"!=typeof g&&"symbol"!==g)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(q(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=l.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return Q(e,l);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var x=String(e);return w?L(e,x):x}if("bigint"==typeof e){var E=String(e)+"n";return w?L(e,E):E}var T=void 0===l.depth?5:l.depth;if(void 0===o&&(o=0),o>=T&&T>0&&"object"==typeof e)return U(e)?"[Array]":"[Object]";var B=function(t,e){var i;if("\t"===t.indent)i="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;i=_.call(Array(t.indent+1)," ")}return{base:i,prev:_.call(Array(e+1),i)}}(l,o);if(void 0===s)s=[];else if(K(s,e)>=0)return"[Circular]";function O(e,i,n){if(i&&(s=D.call(s)).push(i),n){var r={depth:l.depth};return q(l,"quoteStyle")&&(r.quoteStyle=l.quoteStyle),t(e,r,o+1,s)}return t(e,l,o+1,s)}if("function"==typeof e&&!$(e)){var G=function(t){if(t.name)return t.name;var e=v.call(f.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),J=it(e,O);return"[Function"+(G?": "+G:" (anonymous)")+"]"+(J.length>0?" { "+_.call(J,", ")+" }":"")}if(W(e)){var nt=P?y.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):S.call(e);return"object"!=typeof e||P?nt:Z(nt)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var ot="<"+C.call(String(e.nodeName)),rt=e.attributes||[],at=0;at<rt.length;at++)ot+=" "+rt[at].name+"="+N(z(rt[at].value),"double",l);return ot+=">",e.childNodes&&e.childNodes.length&&(ot+="..."),ot+="</"+C.call(String(e.nodeName))+">"}if(U(e)){if(0===e.length)return"[]";var st=it(e,O);return B&&!function(t){for(var e=0;e<t.length;e++)if(K(t[e],"\n")>=0)return!1;return!0}(st)?"["+et(st,B)+"]":"[ "+_.call(st,", ")+" ]"}if(function(t){return"[object Error]"===X(t)&&j(t)}(e)){var lt=it(e,O);return"cause"in Error.prototype||!("cause"in e)||F.call(e,"cause")?0===lt.length?"["+String(e)+"]":"{ ["+String(e)+"] "+_.call(lt,", ")+" }":"{ ["+String(e)+"] "+_.call(R.call("[cause]: "+O(e.cause),lt),", ")+" }"}if("object"==typeof e&&g){if(H&&"function"==typeof e[H]&&M)return M(e,{depth:T-o});if("symbol"!==g&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!r||!t||"object"!=typeof t)return!1;try{r.call(t);try{d.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var dt=[];return a&&a.call(e,function(t,i){dt.push(O(i,e,!0)+" => "+O(t,e))}),tt("Map",r.call(e),dt,B)}if(function(t){if(!d||!t||"object"!=typeof t)return!1;try{d.call(t);try{r.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ct=[];return c&&c.call(e,function(t){ct.push(O(t,e))}),tt("Set",d.call(e),ct,B)}if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y("WeakMap");if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t,h);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y("WeakSet");if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{return u.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return"[object Number]"===X(t)&&j(t)}(e))return Z(O(Number(e)));if(function(t){if(!t||"object"!=typeof t||!A)return!1;try{return A.call(t),!0}catch(t){}return!1}(e))return Z(O(A.call(e)));if(function(t){return"[object Boolean]"===X(t)&&j(t)}(e))return Z(m.call(e));if(function(t){return"[object String]"===X(t)&&j(t)}(e))return Z(O(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||void 0!==i&&e===i)return"{ [object globalThis] }";if(!function(t){return"[object Date]"===X(t)&&j(t)}(e)&&!$(e)){var pt=it(e,O),ht=I?I(e)===Object.prototype:e instanceof Object||e.constructor===Object,ut=e instanceof Object?"":"null prototype",mt=!ht&&k&&Object(e)===e&&k in e?b.call(X(e),8,-1):ut?"Object":"",gt=(ht||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(mt||ut?"["+_.call(R.call([],mt||[],ut||[]),": ")+"] ":"");return 0===pt.length?gt+"{}":B?gt+"{"+et(pt,B)+"}":gt+"{ "+_.call(pt,", ")+" }"}return String(e)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function q(t,e){return G.call(t,e)}function X(t){return g.call(t)}function K(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1}function Q(t,e){if(t.length>e.maxStringLength){var i=t.length-e.maxStringLength,n="... "+i+" more character"+(i>1?"s":"");return Q(b.call(t,0,e.maxStringLength),e)+n}var o=O[e.quoteStyle||"single"];return o.lastIndex=0,N(y.call(y.call(t,o,"\\$1"),/[\x00-\x1f]/g,J),"single",e)}function J(t){var e=t.charCodeAt(0),i={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return i?"\\"+i:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function Z(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function tt(t,e,i,n){return t+" ("+e+") {"+(n?et(i,n):_.call(i,", "))+"}"}function et(t,e){if(0===t.length)return"";var i="\n"+e.prev+e.base;return i+_.call(t,","+i)+"\n"+e.prev}function it(t,e){var i=U(t),n=[];if(i){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=q(t,o)?e(t[o],t):""}var r,a="function"==typeof T?T(t):[];if(P){r={};for(var s=0;s<a.length;s++)r["$"+a[s]]=a[s]}for(var l in t)q(t,l)&&(i&&String(Number(l))===l&&l<t.length||P&&r["$"+l]instanceof Symbol||(x.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if("function"==typeof T)for(var d=0;d<a.length;d++)F.call(t,a[d])&&n.push("["+e(a[d])+"]: "+e(t[a[d]],t));return n}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./util.inspect":1}],42:[function(t,e,i){(function(t){(function(){function i(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function n(t,e){for(var i,n="",o=0,r=-1,a=0,s=0;s<=t.length;++s){if(s<t.length)i=t.charCodeAt(s);else{if(47===i)break;i=47}if(47===i){if(r===s-1||1===a);else if(r!==s-1&&2===a){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",o=0):o=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),r=s,a=0;continue}}else if(2===n.length||1===n.length){n="",o=0,r=s,a=0;continue}e&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+t.slice(r+1,s):n=t.slice(r+1,s),o=s-r-1;r=s,a=0}else 46===i&&-1!==a?++a:a=-1}return n}var o={resolve:function(){for(var e,o="",r=!1,a=arguments.length-1;a>=-1&&!r;a--){var s;a>=0?s=arguments[a]:(void 0===e&&(e=t.cwd()),s=e),i(s),0!==s.length&&(o=s+"/"+o,r=47===s.charCodeAt(0))}return o=n(o,!r),r?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(t){if(i(t),0===t.length)return".";var e=47===t.charCodeAt(0),o=47===t.charCodeAt(t.length-1);return 0!==(t=n(t,!e)).length||e||(t="."),t.length>0&&o&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return i(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var n=arguments[e];i(n),n.length>0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":o.normalize(t)},relative:function(t,e){if(i(t),i(e),t===e)return"";if((t=o.resolve(t))===(e=o.resolve(e)))return"";for(var n=1;n<t.length&&47===t.charCodeAt(n);++n);for(var r=t.length,a=r-n,s=1;s<e.length&&47===e.charCodeAt(s);++s);for(var l=e.length-s,d=a<l?a:l,c=-1,p=0;p<=d;++p){if(p===d){if(l>d){if(47===e.charCodeAt(s+p))return e.slice(s+p+1);if(0===p)return e.slice(s+p)}else a>d&&(47===t.charCodeAt(n+p)?c=p:0===p&&(c=0));break}var h=t.charCodeAt(n+p);if(h!==e.charCodeAt(s+p))break;47===h&&(c=p)}var u="";for(p=n+c+1;p<=r;++p)p!==r&&47!==t.charCodeAt(p)||(0===u.length?u+="..":u+="/..");return u.length>0?u+e.slice(s+c):(s+=c,47===e.charCodeAt(s)&&++s,e.slice(s))},_makeLong:function(t){return t},dirname:function(t){if(i(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,o=-1,r=!0,a=t.length-1;a>=1;--a)if(47===(e=t.charCodeAt(a))){if(!r){o=a;break}}else r=!1;return-1===o?n?"/":".":n&&1===o?"//":t.slice(0,o)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');i(t);var n,o=0,r=-1,a=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var s=e.length-1,l=-1;for(n=t.length-1;n>=0;--n){var d=t.charCodeAt(n);if(47===d){if(!a){o=n+1;break}}else-1===l&&(a=!1,l=n+1),s>=0&&(d===e.charCodeAt(s)?-1===--s&&(r=n):(s=-1,r=l))}return o===r?r=l:-1===r&&(r=t.length),t.slice(o,r)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!a){o=n+1;break}}else-1===r&&(a=!1,r=n+1);return-1===r?"":t.slice(o,r)},extname:function(t){i(t);for(var e=-1,n=0,o=-1,r=!0,a=0,s=t.length-1;s>=0;--s){var l=t.charCodeAt(s);if(47!==l)-1===o&&(r=!1,o=s+1),46===l?-1===e?e=s:1!==a&&(a=1):-1!==e&&(a=-1);else if(!r){n=s+1;break}}return-1===e||-1===o||0===a||1===a&&e===o-1&&e===n+1?"":t.slice(e,o)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var i=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return i?i===e.root?i+n:i+t+n:n}("/",t)},parse:function(t){i(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,o=t.charCodeAt(0),r=47===o;r?(e.root="/",n=1):n=0;for(var a=-1,s=0,l=-1,d=!0,c=t.length-1,p=0;c>=n;--c)if(47!==(o=t.charCodeAt(c)))-1===l&&(d=!1,l=c+1),46===o?-1===a?a=c:1!==p&&(p=1):-1!==a&&(p=-1);else if(!d){s=c+1;break}return-1===a||-1===l||0===p||1===p&&a===l-1&&a===s+1?-1!==l&&(e.base=e.name=0===s&&r?t.slice(1,l):t.slice(s,l)):(0===s&&r?(e.name=t.slice(1,a),e.base=t.slice(1,l)):(e.name=t.slice(s,a),e.base=t.slice(s,l)),e.ext=t.slice(a,l)),s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,e.exports=o}).call(this)}).call(this,t("_process"))},{_process:103}],43:[function(t,e,i){e.exports={name:"pict-application",version:"1.0.33",description:"Application base class for a pict view-based application",main:"source/Pict-Application.js",scripts:{test:"npx quack test",start:"node source/Pict-Application.js",coverage:"npx quack coverage",build:"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-application-image:local","docker-dev-run":'docker run -it -d --name pict-application-dev -p 30001:8080 -p 38086:8086 -v "$PWD/.config:/home/coder/.config" -v "$PWD:/home/coder/pict-application" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" pict-application-image:local',"docker-dev-shell":"docker exec -it pict-application-dev /bin/bash",tests:"npx quack test -g",lint:"eslint source/**",types:"tsc -p ."},types:"types/source/Pict-Application.d.ts",repository:{type:"git",url:"git+https://github.com/stevenvelozo/pict-application.git"},author:"steven velozo <steven@velozo.com>",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/pict-application/issues"},homepage:"https://github.com/stevenvelozo/pict-application#readme",devDependencies:{"@eslint/js":"^9.28.0","browser-env":"^3.3.0",eslint:"^9.28.0",pict:"^1.0.348","pict-provider":"^1.0.10","pict-view":"^1.0.66",quackage:"^1.0.58",typescript:"^5.9.3"},mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},dependencies:{"fable-serviceproviderbase":"^3.0.19"}}},{}],44:[function(t,e,i){const n=t("fable-serviceproviderbase"),o=t("../package.json"),r={Name:"DefaultPictApplication",MainViewportViewIdentifier:"Default-View",MainViewportRenderableHash:!1,MainViewportDestinationAddress:!1,MainViewportDefaultDataAddress:!1,AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!0,AutoRenderViewsAfterInitialize:!1,AutoLoginAfterInitialize:!1,AutoLoadDataAfterLogin:!1,ConfigurationOnlyViews:[],Manifests:{},IdentifierAddressPrefix:"PICT-"};e.exports=class extends n{constructor(t,e,i){let n="object"==typeof t.settings.PictApplicationConfiguration?t.settings.PictApplicationConfiguration:{};super(t,Object.assign({},JSON.parse(JSON.stringify(r)),n,e),i),this.options,this.log,this.fable,this.UUID,this.Hash,this.servicesMap,this.serviceType="PictApplication",this._Package=o,this.pict=this.fable,this.AppData=this.fable.AppData,this.Bundle=this.fable.Bundle,this.initializeTimestamp,this.lastSolvedTimestamp,this.lastLoginTimestamp,this.lastMarshalFromViewsTimestamp,this.lastMarshalToViewsTimestamp,this.lastAutoRenderTimestamp,this.lastLoadDataTimestamp;let a=Object.keys(this.options.Manifests);if(a.length>0)for(let t=0;t<a.length;t++){let e=a[t];this.fable.instantiateServiceProvider("Manifest",this.options.Manifests[e],e)}}onPreSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onPreSolve:`),!0}onPreSolveAsync(t){return this.onPreSolve(),t()}onBeforeSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeSolve:`),!0}onBeforeSolveAsync(t){return this.onBeforeSolve(),t()}onSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onSolve:`),!0}onSolveAsync(t){return this.onSolve(),t()}solve(){this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} executing solve() function...`);let t=Object.keys(this.pict.providers),e=[];for(let i=0;i<t.length;i++){let n=this.pict.providers[t[i]];n.options.AutoSolveWithApp&&e.push(n)}e.sort((t,e)=>t.options.AutoSolveOrdinal-e.options.AutoSolveOrdinal);for(let t=0;t<e.length;t++)e[t].solve(e[t]);this.onBeforeSolve();let i=Object.keys(this.pict.views),n=[];for(let t=0;t<i.length;t++){let e=this.pict.views[i[t]];e.options.AutoInitialize&&n.push(e)}n.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let t=0;t<n.length;t++)n[t].solve();return this.onSolve(),this.onAfterSolve(),this.lastSolvedTimestamp=this.fable.log.getTimeStamp(),!0}solveAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");e.anticipate(this.onBeforeSolveAsync.bind(this));let i="function"==typeof t&&t;i||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync Auto Callback Error: ${t}`,t)});let n=Object.keys(this.pict.providers),o=[];for(let t=0;t<n.length;t++){let e=this.pict.providers[n[t]];e.options.AutoSolveWithApp&&o.push(e)}o.sort((t,e)=>t.options.AutoSolveOrdinal-e.options.AutoSolveOrdinal);for(let t=0;t<o.length;t++)e.anticipate(o[t].solveAsync.bind(o[t]));let r=Object.keys(this.pict.views),a=[];for(let t=0;t<r.length;t++){let e=this.pict.views[r[t]];e.options.AutoSolveWithApp&&a.push(e)}a.sort((t,e)=>t.options.AutoSolveOrdinal-e.options.AutoSolveOrdinal);for(let t=0;t<a.length;t++)e.anticipate(a[t].solveAsync.bind(a[t]));e.anticipate(this.onSolveAsync.bind(this)),e.anticipate(this.onAfterSolveAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync() complete.`),this.lastSolvedTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterSolve:`),!0}onAfterSolveAsync(t){return this.onAfterSolve(),t()}onBeforeLoginAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeLoginAsync:`),t()}onLoginAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onLoginAsync:`),t()}loginAsync(t){const e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");let i=t;"function"!=typeof i&&(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loginAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loginAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeLoginAsync.bind(this)),e.anticipate(this.onLoginAsync.bind(this)),e.anticipate(this.onAfterLoginAsync.bind(this)),this.options.AutoLoadDataAfterLogin&&e.anticipate(t=>{if(!this.isLoggedIn())return t();this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto loading data after login...`),this.loadDataAsync(e=>{t(e)})}),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loginAsync() complete.`),this.lastLoginTimestamp=this.fable.log.getTimeStamp(),i(t)))}isLoggedIn(){return!0}onAfterLoginAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterLoginAsync:`),t()}onBeforeLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeLoadDataAsync:`),t()}onLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onLoadDataAsync:`),t()}loadDataAsync(t){const e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");let i=t;"function"!=typeof i&&(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loadDataAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loadDataAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeLoadDataAsync.bind(this));let n=Object.keys(this.pict.providers),o=[];for(let t=0;t<n.length;t++){let e=this.pict.providers[n[t]];e.options.AutoLoadDataWithApp&&o.push(e)}o.sort((t,e)=>t.options.AutoLoadDataOrdinal-e.options.AutoLoadDataOrdinal);for(const t of o)e.anticipate(t.onBeforeLoadDataAsync.bind(t));e.anticipate(this.onLoadDataAsync.bind(this));for(const t of o)e.anticipate(t.onLoadDataAsync.bind(t));e.anticipate(this.onAfterLoadDataAsync.bind(this));for(const t of o)e.anticipate(t.onAfterLoadDataAsync.bind(t));e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loadDataAsync() complete.`),this.lastLoadDataTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterLoadDataAsync:`),t()}onBeforeSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeSaveDataAsync:`),t()}onSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onSaveDataAsync:`),t()}saveDataAsync(t){const e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");let i=t;"function"!=typeof i&&(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} saveDataAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} saveDataAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeSaveDataAsync.bind(this));let n=Object.keys(this.pict.providers),o=[];for(let t=0;t<n.length;t++){let e=this.pict.providers[n[t]];e.options.AutoSaveDataWithApp&&o.push(e)}o.sort((t,e)=>t.options.AutoSaveDataOrdinal-e.options.AutoSaveDataOrdinal);for(const t of o)e.anticipate(t.onBeforeSaveDataAsync.bind(t));e.anticipate(this.onSaveDataAsync.bind(this));for(const t of o)e.anticipate(t.onSaveDataAsync.bind(t));e.anticipate(this.onAfterSaveDataAsync.bind(this));for(const t of o)e.anticipate(t.onAfterSaveDataAsync.bind(t));e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} saveDataAsync() complete.`),this.lastSaveDataTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterSaveDataAsync:`),t()}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeInitialize:`),!0}onBeforeInitializeAsync(t){return this.onBeforeInitialize(),t()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onInitialize:`),!0}onInitializeAsync(t){return this.onInitialize(),t()}initialize(){if(this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} initialize:`),this.initializeTimestamp)return this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initialize called but initialization is already completed. Aborting.`),!1;{if(this.onBeforeInitialize(),"ConfigurationOnlyViews"in this.options)for(let t=0;t<this.options.ConfigurationOnlyViews.length;t++){let e=void 0===this.options.ConfigurationOnlyViews[t].ViewIdentifier?`AutoView-${this.fable.getUUID()}`:this.options.ConfigurationOnlyViews[t].ViewIdentifier;this.log.info(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} adding configuration only view: ${e}`),this.pict.addView(e,this.options.ConfigurationOnlyViews[t])}this.onInitialize();let t=Object.keys(this.pict.providers),e=[];for(let i=0;i<t.length;i++){let n=this.pict.providers[t[i]];n.options.AutoInitialize&&e.push(n)}e.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let t=0;t<e.length;t++)e[t].initialize();let i=Object.keys(this.pict.views),n=[];for(let t=0;t<i.length;t++){let e=this.pict.views[i[t]];e.options.AutoInitialize&&n.push(e)}n.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let t=0;t<n.length;t++)n[t].initialize();return this.onAfterInitialize(),this.options.AutoSolveAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto solving after initialization...`),this.solve()),this.options.AutoRenderMainViewportViewAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto rendering after initialization...`),this.render()),this.initializeTimestamp=this.fable.log.getTimeStamp(),this.onCompletionOfInitialize(),!0}}initializeAsync(t){this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync:`);let e="function"==typeof t&&t;if(e||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),e=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync Auto Callback Error: ${t}`,t)}),this.initializeTimestamp)return this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} async initialize called but initialization is already completed. Aborting.`),this.onCompletionOfInitializeAsync(e);{let t=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");if(this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} beginning initialization...`),"ConfigurationOnlyViews"in this.options)for(let t=0;t<this.options.ConfigurationOnlyViews.length;t++){let e=void 0===this.options.ConfigurationOnlyViews[t].ViewIdentifier?`AutoView-${this.fable.getUUID()}`:this.options.ConfigurationOnlyViews[t].ViewIdentifier;this.log.info(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} adding configuration only view: ${e}`),this.pict.addView(e,this.options.ConfigurationOnlyViews[t])}t.anticipate(this.onBeforeInitializeAsync.bind(this)),t.anticipate(this.onInitializeAsync.bind(this));let i=Object.keys(this.pict.providers),n=[];for(let t=0;t<i.length;t++){let e=this.pict.providers[i[t]];e.options.AutoInitialize&&n.push(e)}n.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let e=0;e<n.length;e++)t.anticipate(n[e].initializeAsync.bind(n[e]));let o=Object.keys(this.pict.views),r=[];for(let t=0;t<o.length;t++){let e=this.pict.views[o[t]];e.options.AutoInitialize&&r.push(e)}r.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let e=0;e<r.length;e++){let i=r[e];t.anticipate(i.initializeAsync.bind(i))}t.anticipate(this.onAfterInitializeAsync.bind(this)),this.options.AutoLoginAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto login (asynchronously) after initialization...`),t.anticipate(this.loginAsync.bind(this))),this.options.AutoSolveAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto solving (asynchronously) after initialization...`),t.anticipate(this.solveAsync.bind(this))),this.options.AutoRenderMainViewportViewAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto rendering (asynchronously) after initialization...`),t.anticipate(this.renderMainViewportAsync.bind(this))),t.wait(t=>(t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync Error: ${t.message||t}`,{stack:t.stack}),this.initializeTimestamp=this.fable.log.getTimeStamp(),this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initialization complete.`),e()))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterInitialize:`),!0}onAfterInitializeAsync(t){return this.onAfterInitialize(),t()}onCompletionOfInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onCompletionOfInitialize:`),!0}onCompletionOfInitializeAsync(t){return this.onCompletionOfInitialize(),t()}onBeforeMarshalFromViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeMarshalFromViews:`),!0}onBeforeMarshalFromViewsAsync(t){return this.onBeforeMarshalFromViews(),t()}onMarshalFromViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onMarshalFromViews:`),!0}onMarshalFromViewsAsync(t){return this.onMarshalFromViews(),t()}marshalFromViews(){this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} executing marshalFromViews() function...`),this.onBeforeMarshalFromViews();let t=Object.keys(this.pict.views),e=[];for(let i=0;i<t.length;i++){let n=this.pict.views[t[i]];e.push(n)}for(let t=0;t<e.length;t++)e[t].marshalFromView();return this.onMarshalFromViews(),this.onAfterMarshalFromViews(),this.lastMarshalFromViewsTimestamp=this.fable.log.getTimeStamp(),!0}marshalFromViewsAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t&&t;i||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewsAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeMarshalFromViewsAsync.bind(this));let n=Object.keys(this.pict.views),o=[];for(let t=0;t<n.length;t++){let e=this.pict.views[n[t]];o.push(e)}for(let t=0;t<o.length;t++)e.anticipate(o[t].marshalFromViewAsync.bind(o[t]));e.anticipate(this.onMarshalFromViewsAsync.bind(this)),e.anticipate(this.onAfterMarshalFromViewsAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewsAsync() complete.`),this.lastMarshalFromViewsTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterMarshalFromViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterMarshalFromViews:`),!0}onAfterMarshalFromViewsAsync(t){return this.onAfterMarshalFromViews(),t()}onBeforeMarshalToViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeMarshalToViews:`),!0}onBeforeMarshalToViewsAsync(t){return this.onBeforeMarshalToViews(),t()}onMarshalToViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onMarshalToViews:`),!0}onMarshalToViewsAsync(t){return this.onMarshalToViews(),t()}marshalToViews(){this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} executing marshalToViews() function...`),this.onBeforeMarshalToViews();let t=Object.keys(this.pict.views),e=[];for(let i=0;i<t.length;i++){let n=this.pict.views[t[i]];e.push(n)}for(let t=0;t<e.length;t++)e[t].marshalToView();return this.onMarshalToViews(),this.onAfterMarshalToViews(),this.lastMarshalToViewsTimestamp=this.fable.log.getTimeStamp(),!0}marshalToViewsAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t&&t;i||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewsAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeMarshalToViewsAsync.bind(this));let n=Object.keys(this.pict.views),o=[];for(let t=0;t<n.length;t++){let e=this.pict.views[n[t]];o.push(e)}for(let t=0;t<o.length;t++)e.anticipate(o[t].marshalToViewAsync.bind(o[t]));e.anticipate(this.onMarshalToViewsAsync.bind(this)),e.anticipate(this.onAfterMarshalToViewsAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewsAsync() complete.`),this.lastMarshalToViewsTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterMarshalToViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterMarshalToViews:`),!0}onAfterMarshalToViewsAsync(t){return this.onAfterMarshalToViews(),t()}onBeforeRender(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeRender:`),!0}onBeforeRenderAsync(t){return this.onBeforeRender(),t()}render(t,e,i,n){let o="string"!=typeof t?this.options.MainViewportViewIdentifier:t,r="string"!=typeof e?this.options.MainViewportRenderableHash:e,a="string"!=typeof i?this.options.MainViewportDestinationAddress:i,s="string"!=typeof n?this.options.MainViewportDefaultDataAddress:n;this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} VIEW Renderable[${r}] Destination[${a}] TemplateDataAddress[${s}] render:`),this.onBeforeRender();let l="string"==typeof o&&this.servicesMap.PictView[o];return l?(this.onRender(),l.render(r,a,s),this.onAfterRender(),!0):(this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} could not render from View ${o} because it is not a valid view.`),!1)}onRender(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onRender:`),!0}onRenderAsync(t){return this.onRender(),t()}renderAsync(t,e,i,n,o){let r="string"!=typeof t?this.options.MainViewportViewIdentifier:t,a="string"!=typeof e?this.options.MainViewportRenderableHash:e,s="string"!=typeof i?this.options.MainViewportDestinationAddress:i,l="string"!=typeof n?this.options.MainViewportDefaultDataAddress:n,d="function"==typeof o?o:"function"==typeof n?n:"function"==typeof i?i:"function"==typeof e?e:"function"==typeof t&&t;d||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),d=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAsync Auto Callback Error: ${t}`,t)}),this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} VIEW Renderable[${a}] Destination[${s}] TemplateDataAddress[${l}] renderAsync:`);let c=this.fable.newAnticipate();c.anticipate(this.onBeforeRenderAsync.bind(this));let p="string"==typeof r&&this.servicesMap.PictView[r];if(!p){let t=`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} could not asynchronously render from View ${r} because it is not a valid view.`;return this.pict.LogNoisiness>3&&this.log.error(t),d(new Error(t))}return c.anticipate(this.onRenderAsync.bind(this)),c.anticipate(t=>{p.renderAsync.call(p,a,s,l,t)}),c.anticipate(this.onAfterRenderAsync.bind(this)),c.wait(d)}onAfterRender(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterRender:`),!0}onAfterRenderAsync(t){return this.onAfterRender(),t()}renderMainViewport(){return this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderMainViewport:`),this.render()}renderMainViewportAsync(t){return this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderMainViewportAsync:`),this.renderAsync(t)}renderAutoViews(){this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} beginning renderAutoViews...`);let t=Object.keys(this.pict.views);t.sort((t,e)=>this.pict.views[t].options.AutoRenderOrdinal-this.pict.views[e].options.AutoRenderOrdinal);for(let e=0;e<t.length;e++){let i=this.pict.views[t[e]];i.options.AutoRender&&i.render()}this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync complete.`)}renderAutoViewsAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t&&t;i||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync Auto Callback Error: ${t}`,t)}),this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} beginning renderAutoViewsAsync...`);let n=Object.keys(this.pict.views);n.sort((t,e)=>this.pict.views[t].options.AutoRenderOrdinal-this.pict.views[e].options.AutoRenderOrdinal);for(let t=0;t<n.length;t++){let i=this.pict.views[n[t]];i.options.AutoRender&&e.anticipate(i.renderAsync.bind(i))}e.wait(t=>(this.lastAutoRenderTimestamp=this.fable.log.getTimeStamp(),this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync complete.`),i(t)))}get isPictApplication(){return!0}}},{"../package.json":43,"fable-serviceproviderbase":20}],45:[function(t,e,i){e.exports={Name:"Pict Docuserve",Hash:"Docuserve",MainViewportViewIdentifier:"Docuserve-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1,pict_configuration:{Product:"Docuserve-Pict-Application"}}},{}],46:[function(t,e,i){const n=t("pict-application"),o=t("./providers/Pict-Provider-Docuserve-Documentation.js"),r=t("./views/PictView-Docuserve-Layout.js"),a=t("./views/PictView-Docuserve-TopBar.js"),s=t("./views/PictView-Docuserve-Sidebar.js"),l=t("./views/PictView-Docuserve-Splash.js"),d=t("./views/PictView-Docuserve-Content.js"),c=t("./views/PictView-Docuserve-Search.js");e.exports=class extends n{constructor(t,e,i){super(t,e,i),this.pict.addProvider("Docuserve-Documentation",o.default_configuration,o),this.pict.addView("Docuserve-Layout",r.default_configuration,r),this.pict.addView("Docuserve-TopBar",a.default_configuration,a),this.pict.addView("Docuserve-Sidebar",s.default_configuration,s),this.pict.addView("Docuserve-Splash",l.default_configuration,l),this.pict.addView("Docuserve-Content",d.default_configuration,d),this.pict.addView("Docuserve-Search",c.default_configuration,c)}onAfterInitializeAsync(t){try{let t=(window.location.pathname||"/").replace(/\/[^/]*$/,"/"),e="docuserve-theme:"+window.location.origin+t,i=localStorage.getItem(e);"light"!==i&&"dark"!==i||document.documentElement.setAttribute("data-theme",i)}catch(t){}this.pict.AppData.Docuserve={CatalogLoaded:!1,Catalog:null,CoverLoaded:!1,Cover:null,SidebarLoaded:!1,SidebarGroups:[],TopBarLoaded:!1,TopBar:null,VersionLoaded:!1,Version:null,ErrorPageLoaded:!1,ErrorPageHTML:null,KeywordIndexLoaded:!1,KeywordDocumentCount:0,CurrentGroup:"",CurrentModule:"",CurrentPath:"",SidebarVisible:!0,DocsBaseURL:"",CatalogURL:"retold-catalog.json"},this.pict.providers["Docuserve-Documentation"].loadCatalog(()=>{let e=this.pict.AppData.Docuserve,i="";return e.CoverLoaded&&e.Cover&&e.Cover.Title?i=e.Cover.Title.replace(/<[^>]*>/g,"").trim():e.TopBarLoaded&&e.TopBar&&e.TopBar.Brand&&(i=e.TopBar.Brand.replace(/<[^>]*>/g,"").trim()),i&&(e.VersionLoaded&&e.Version&&e.Version.Version?document.title=`${i} v${e.Version.Version} Documentation`:document.title=i),this.pict.views["Docuserve-Layout"].render(),super.onAfterInitializeAsync(t)})}resolveHash(){let t=(window.location.hash||"").replace(/^#\/?/,"");if(!t||"Home"===t)return void this.showView("Docuserve-Splash");let e=t.split("/");if("search"===e[0]){let t=decodeURIComponent(e.slice(1).join("/"));return void this.navigateToSearch(t)}if("page"===e[0]&&e.length>=2){let t=e.slice(1).join("/");return void this.navigateToPage(t)}if("doc"===e[0]&&e.length>=3){let t=e[1],i=e[2];if(e.length>=4){let n=e.slice(3).join("/");this.navigateToModulePath(t,i,n)}else this.navigateToModule(t,i);return}this.navigateToPage(t)}navigateTo(t){window.location.hash=t}showView(t){t in this.pict.views&&(this.pict.AppData.Docuserve.CurrentGroup="",this.pict.AppData.Docuserve.CurrentModule="",this.pict.AppData.Docuserve.CurrentPath="",this.pict.views[t].render(),this.pict.views["Docuserve-Sidebar"].clearModuleNav(),this.pict.views["Docuserve-Sidebar"].renderSidebarGroups())}navigateToModule(t,e){this.navigateToModulePath(t,e,"README.md")}navigateToModulePath(t,e,i){let n=this.pict.providers["Docuserve-Documentation"],o=this.pict.views["Docuserve-Content"],r=this.pict.views["Docuserve-Sidebar"];this.pict.AppData.Docuserve.CurrentGroup=t,this.pict.AppData.Docuserve.CurrentModule=e,this.pict.AppData.Docuserve.CurrentPath=i,o.render(),o.showLoading(),r.renderSidebarGroups(),r.renderModuleNav(t,e);let a=n.resolveDocumentURL(t,e,i||"README.md");if(!a)return void o.displayContent(n.getErrorPageHTML(t+"/"+e));let s=i||"README.md";n.fetchDocument(a,(i,r)=>{if(!i)return void o.displayContent(r);let a=t+"/"+e+"/"+s;n.fetchLocalDocument(a,(t,e)=>{o.displayContent(e)},t,e,s)},t,e,s)}navigateToPage(t){let e=this.pict.providers["Docuserve-Documentation"],i=this.pict.views["Docuserve-Content"],n=this.pict.views["Docuserve-Sidebar"];this.pict.AppData.Docuserve.CurrentGroup="",this.pict.AppData.Docuserve.CurrentModule="",this.pict.AppData.Docuserve.CurrentPath=t,i.render(),i.showLoading(),n.clearModuleNav(),n.renderSidebarGroups();let o=t;o.match(/\.md$/)||(o+=".md"),e.fetchLocalDocument(o,(t,e)=>{i.displayContent(e)})}navigateToSearch(t){let e=this.pict.views["Docuserve-Sidebar"],i=this.pict.views["Docuserve-Search"];this.pict.AppData.Docuserve.CurrentGroup="",this.pict.AppData.Docuserve.CurrentModule="",this.pict.AppData.Docuserve.CurrentPath="",e.clearModuleNav(),e.renderSidebarGroups(),i.render(),i.showSearch(t||"")}},e.exports.default_configuration=t("./Pict-Application-Docuserve-Configuration.json")},{"./Pict-Application-Docuserve-Configuration.json":45,"./providers/Pict-Provider-Docuserve-Documentation.js":47,"./views/PictView-Docuserve-Content.js":48,"./views/PictView-Docuserve-Layout.js":49,"./views/PictView-Docuserve-Search.js":50,"./views/PictView-Docuserve-Sidebar.js":51,"./views/PictView-Docuserve-Splash.js":52,"./views/PictView-Docuserve-TopBar.js":53,"pict-application":44}],47:[function(t,e,i){const n=t("pict-provider"),o=t("lunr"),r=t("pict-section-content").PictContentProvider;e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._Catalog=null,this._ContentCache={},this._ContentProvider=this.pict.addProvider("Pict-Content",r.default_configuration,r)}_createLinkResolver(t,e,i){return(n,o)=>{if(n.match(/^\//)||n.match(/^[^:]+\.md/)){return{href:this.convertDocLink(n,t,e,i)}}let r=this.resolveGitHubURLToRoute(n);return r?{href:r}:null}}_createImageResolver(t){let e="";if(t){let i=t.lastIndexOf("/");i>=0&&(e=t.substring(0,i+1))}return(t,i)=>t.match(/^https?:\/\//)||t.match(/^data:/)||t.match(/^\//)?t:e+t}loadCatalog(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.CatalogURL||"retold-catalog.json",n=()=>{let t=6,i=()=>{if(t--,t<=0){if(this.pict.AppData.Docuserve.SidebarGroups&&!(this.pict.AppData.Docuserve.SidebarGroups.length<1))return e();this.autoDiscoverSidebar(e)}};this.loadCover(i),this.loadSidebar(i),this.loadTopbar(i),this.loadErrorPage(i),this.loadKeywordIndex(i),this.loadVersion(i)};fetch(i).then(t=>t.ok?t.json():(this.log.info(`Docuserve: No catalog at [${i}]; running in standalone mode.`),null)).then(t=>{t&&(this._Catalog=t,this.pict.AppData.Docuserve.Catalog=t,this.pict.AppData.Docuserve.CatalogLoaded=!0,this.buildSidebarData(t)),n()}).catch(t=>{this.log.info(`Docuserve: Catalog load error (${t}); continuing in standalone mode.`),n()})}autoDiscoverSidebar(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"README.md").then(t=>t.ok?t.text():null).then(t=>{if(t){let e=t.match(/^#+\s+(.+)/m),i=e?e[1].trim():"Docs";this.pict.AppData.Docuserve.SidebarGroups=[{Name:i,Key:"docs",Route:"#/page/README",Modules:[]}],this.pict.AppData.Docuserve.CoverLoaded||(this.pict.AppData.Docuserve.Cover={Title:i,Tagline:"",Description:"",Highlights:[],Actions:[{Text:"Read the Docs",Href:"README.md"}]},this.pict.AppData.Docuserve.CoverLoaded=!0)}else this.log.info("Docuserve: No README.md found; sidebar will be empty.");return e()}).catch(t=>(this.log.info(`Docuserve: README.md discovery failed (${t}).`),e()))}loadCover(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"_cover.md").then(t=>t.ok?t.text():null).then(t=>t?(this.pict.AppData.Docuserve.Cover=this.parseCover(t),this.pict.AppData.Docuserve.CoverLoaded=!0,e()):(this.log.info("Docuserve: No _cover.md found; splash will use catalog data."),e())).catch(t=>(this.log.warn(`Docuserve: Error loading _cover.md: ${t}`),e()))}parseCover(t){let e={Title:"",Tagline:"",Description:"",Highlights:[],Actions:[]},i=t.split("\n");for(let t=0;t<i.length;t++){let n=i[t].trim();if(!n)continue;let o=n.match(/^#+\s+(.+)/);if(o){e.Title=o[1].trim();continue}let r=n.match(/^>\s*(.*)/);if(r){e.Tagline=r[1].trim();continue}let a=n.match(/^[-*+]\s+(.*)/);if(a){let t=a[1],i=t.match(/^\*\*([^*]+)\*\*\s*[-—:]\s*(.*)/);i?e.Highlights.push({Label:i[1].trim(),Text:i[2].trim()}):e.Highlights.push({Label:"",Text:t.trim()});continue}let s=n.match(/^\[([^\]]+)\]\(([^)]+)\)\s*$/);s?e.Actions.push({Text:s[1].trim(),Href:s[2].trim()}):e.Description?e.Description+=" "+n:e.Description=n}return e}loadSidebar(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"_sidebar.md").then(t=>t.ok?t.text():null).then(t=>{if(!t)return this.log.info("Docuserve: No _sidebar.md found; sidebar will use catalog data."),e();let i=this.parseSidebarMarkdown(t);return i&&i.length>0&&(this.pict.AppData.Docuserve.SidebarGroups=i,this.pict.AppData.Docuserve.SidebarLoaded=!0),e()}).catch(t=>(this.log.warn(`Docuserve: Error loading _sidebar.md: ${t}`),e()))}loadTopbar(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"_topbar.md").then(t=>t.ok?t.text():null).then(t=>t?(this.pict.AppData.Docuserve.TopBar=this.parseTopbar(t),this.pict.AppData.Docuserve.TopBarLoaded=!0,e()):(this.log.info("Docuserve: No _topbar.md found; top bar will use defaults."),e())).catch(t=>(this.log.warn(`Docuserve: Error loading _topbar.md: ${t}`),e()))}parseTopbar(t){let e={Brand:"",NavLinks:[],ExternalLinks:[]},i=t.split("\n");for(let t=0;t<i.length;t++){let n=i[t].trim();if(!n)continue;let o=n.match(/^#+\s+(.+)/);if(o){e.Brand=o[1].trim();continue}let r=n.match(/^[-*+]\s+(.*)/);if(r){let t=r[1].trim().match(/^\[([^\]]+)\]\(([^)]+)\)/);if(t){let i=t[1].trim(),n=t[2].trim();if(n.match(/^https?:\/\//))e.ExternalLinks.push({Text:i,Href:n});else{let t=this.convertSidebarLink(n);e.NavLinks.push({Text:i,Href:t})}}continue}}return e}loadVersion(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"_version.json").then(t=>t.ok?t.json():null).then(t=>t?(this.pict.AppData.Docuserve.Version=t,this.pict.AppData.Docuserve.VersionLoaded=!0,e()):(this.log.info("Docuserve: No _version.json found; version placard disabled."),e())).catch(t=>(this.log.warn(`Docuserve: Error loading _version.json: ${t}`),e()))}loadErrorPage(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"errorpage.md").then(t=>t.ok?t.text():null).then(t=>t?(this.pict.AppData.Docuserve.ErrorPageHTML=this._ContentProvider.parseMarkdown(t),this.pict.AppData.Docuserve.ErrorPageLoaded=!0,e()):(this.log.info("Docuserve: No errorpage.md found; errors will use default page."),e())).catch(t=>(this.log.warn(`Docuserve: Error loading errorpage.md: ${t}`),e()))}loadKeywordIndex(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"retold-keyword-index.json").then(t=>t.ok?t.json():null).then(t=>{if(!t||!t.LunrIndex||!t.Documents)return this.log.info("Docuserve: No keyword index found; search will be unavailable."),e();try{this._LunrIndex=o.Index.load(t.LunrIndex),this._KeywordDocuments=t.Documents,this.pict.AppData.Docuserve.KeywordIndexLoaded=!0,this.pict.AppData.Docuserve.KeywordDocumentCount=t.DocumentCount||0,this.log.info(`Docuserve: Keyword index loaded (${t.DocumentCount||0} documents).`)}catch(t){this.log.warn(`Docuserve: Error hydrating lunr index: ${t}`)}return e()}).catch(t=>(this.log.warn(`Docuserve: Error loading keyword index: ${t}`),e()))}isModuleInCatalog(t,e){if(!this._Catalog||!this._Catalog.Groups)return!1;for(let i=0;i<this._Catalog.Groups.length;i++){let n=this._Catalog.Groups[i];if(n.Key===t)for(let t=0;t<n.Modules.length;t++){if(n.Modules[t].Name===e)return!0}}return!1}findModuleGroupKey(t){if(!this._Catalog||!this._Catalog.Groups)return null;for(let e=0;e<this._Catalog.Groups.length;e++){let i=this._Catalog.Groups[e];for(let e=0;e<i.Modules.length;e++)if(i.Modules[e].Name===t)return i.Key}return null}isGroupInCatalog(t){if(!this._Catalog||!this._Catalog.Groups)return!1;for(let e=0;e<this._Catalog.Groups.length;e++)if(this._Catalog.Groups[e].Key===t)return!0;return!1}search(t){if(!(this._LunrIndex&&this._KeywordDocuments&&t&&t.trim()))return[];let e=[];try{let i=this._LunrIndex.search(t);for(let t=0;t<i.length;t++){let n=i[t].ref,o=i[t].score,r=this._KeywordDocuments[n];if(!r)continue;let a=n.split("/"),s="";if(a.length>=2){let t=a[0],e=a[1];s=this.isModuleInCatalog(t,e)?"#/doc/"+n:"#/page/"+n}e.push({Key:n,Title:r.Title||n,Group:r.Group||"",Module:r.Module||"",DocPath:r.DocPath||"",Score:o,Route:s})}}catch(t){this.log.warn(`Docuserve: Search error: ${t}`)}return e}getErrorPageHTML(t){let e=t||"unknown";return this.pict.AppData.Docuserve.ErrorPageLoaded&&this.pict.AppData.Docuserve.ErrorPageHTML?this.pict.AppData.Docuserve.ErrorPageHTML.replace(/\{\{path\}\}/g,this._ContentProvider.escapeHTML(e)):'<div class="docuserve-not-found"><h2>Page Not Found</h2><p>The document <code>'+this._ContentProvider.escapeHTML(e)+'</code> could not be loaded.</p><p><a href="#/Home">Return to the home page</a></p></div>'}parseSidebarMarkdown(t){let e=[],i=null,n=t.split("\n");for(let t=0;t<n.length;t++){let o=n[t];if(!o.trim())continue;let r=o.match(/^(\s*)/),a=r?r[1].length:0,s=o.trim().match(/^[-*+]\s+(.*)/);if(!s)continue;let l=s[1].trim(),d=l.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(a<2)if(d){let t=d[1].trim(),n=d[2].trim();i={Name:t,Key:this.deriveGroupKey(t,n),Route:this.convertSidebarLink(n),Modules:[]},e.push(i)}else{let t=l,n=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");i={Name:t,Key:n,Route:"",Modules:[]},e.push(i)}else if(i)if(d){let t=d[1].trim(),e=d[2].trim(),n=this.convertSidebarLink(e);i.Modules.push({Name:t,HasDocs:!0,Group:i.Key,Route:n})}else i.Modules.push({Name:l,HasDocs:!1,Group:i.Key,Route:""})}return e}convertSidebarLink(t){if(!t)return"";if("/"===t)return"#/Home";if(t.match(/^#[^/]/)){let t=this.pict.AppData.Docuserve.SidebarGroups;if(t)for(let e=0;e<t.length;e++){let i=t[e].Modules;if(i)for(let t=0;t<i.length;t++)if(i[t].HasDocs&&i[t].Route&&"#/Home"!==i[t].Route)return i[t].Route;if(t[e].Route&&"#/Home"!==t[e].Route)return t[e].Route}return"#/Home"}let e=t.replace(/^\//,"").replace(/\/$/,"");if(!e)return"#/Home";let i=e.split("/");if(i.length>=2){if(this.isGroupInCatalog(i[0])&&this.isModuleInCatalog(i[0],i[1]))return"#/doc/"+e;let t=this.findModuleGroupKey(i[1]);if(t){let e=i.slice(2).join("/");return e?"#/doc/"+t+"/"+i[1]+"/"+e:"#/doc/"+t+"/"+i[1]}}return e.match(/\.md$/)?"#/page/"+e.replace(/\.md$/,""):"#/page/"+e}deriveGroupKey(t,e){if(e&&"/"!==e){let t=e.replace(/^\//,"").replace(/\.md$/,"").replace(/\/$/,"");if(t&&!t.includes("/"))return t.toLowerCase()}return t.split(/[\s—\-:]+/)[0].toLowerCase().replace(/[^a-z0-9]/g,"")}buildSidebarData(t){let e=[];for(let i=0;i<t.Groups.length;i++){let n=t.Groups[i],o={Name:n.Name,Key:n.Key,Description:n.Description,Modules:[]};for(let t=0;t<n.Modules.length;t++){let e=n.Modules[t];o.Modules.push({Name:e.Name,HasDocs:e.HasDocs,Group:n.Key,Route:"#/doc/"+n.Key+"/"+e.Name})}e.push(o)}this.pict.AppData.Docuserve.SidebarGroups=e}resolveDocumentURL(t,e,i){if(!this._Catalog)return null;let n=this._Catalog.GitHubOrg||"stevenvelozo",o=this._Catalog.DefaultBranch||"master";for(let r=0;r<this._Catalog.Groups.length;r++){let a=this._Catalog.Groups[r];if(a.Key===t)for(let t=0;t<a.Modules.length;t++){let r=a.Modules[t];if(r.Name!==e)continue;let s=r.Branch||o,l=i||"README.md";return"https://raw.githubusercontent.com/"+n+"/"+r.Repo+"/"+s+"/docs/"+l}}return null}resolveGitHubURLToRoute(t){if(!this._Catalog||!this._Catalog.Groups||!t)return null;let e=t.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+)/);if(!e)return null;let i=e[1],n=e[2];if(i!==this._Catalog.GitHubOrg)return null;for(let t=0;t<this._Catalog.Groups.length;t++){let e=this._Catalog.Groups[t];for(let t=0;t<e.Modules.length;t++){let i=e.Modules[t];if(i.Repo===n)return"#/doc/"+e.Key+"/"+i.Name}}return null}resolveGitHubPagesURL(t,e){if(!this._Catalog||!this._Catalog.Groups)return null;let i=this._Catalog.GitHubOrg||"stevenvelozo";for(let n=0;n<this._Catalog.Groups.length;n++){let o=this._Catalog.Groups[n];if(o.Key===t)for(let t=0;t<o.Modules.length;t++){let n=o.Modules[t];if(n.Name===e)return n.HasDocs?"https://"+i+".github.io/"+n.Repo+"/":null}}return null}getModuleSidebar(t,e){if(!this._Catalog)return null;for(let i=0;i<this._Catalog.Groups.length;i++){let n=this._Catalog.Groups[i];if(n.Key===t)for(let t=0;t<n.Modules.length;t++){let i=n.Modules[t];if(i.Name===e)return i.Sidebar||null}}return null}fetchDocument(t,e,i,n,o){let r="function"==typeof e?e:()=>{};return t?this._ContentCache[t]?r(null,this._ContentCache[t]):void fetch(t).then(t=>t.ok?t.text():null).then(e=>{if(!e)return r("Document not found",this.getErrorPageHTML(t));let a=this._ContentProvider.parseMarkdown(e,this._createLinkResolver(i,n,o),this._createImageResolver(t));return this._ContentCache[t]=a,r(null,a)}).catch(e=>(this.log.warn(`Docuserve: Error fetching document [${t}]: ${e}`),r(e,this.getErrorPageHTML(t)))):r("No URL provided","")}fetchLocalDocument(t,e,i,n,o){let r=(this.pict.AppData.Docuserve.DocsBaseURL||"")+t;this.fetchDocument(r,e,i,n,o)}convertDocLink(t,e,i,n){let o=t.replace(/^\.\//,"");o=o.replace(/^\//,"");let r=o.split("/");if(r.length>=2&&this.isGroupInCatalog(r[0])&&this.isModuleInCatalog(r[0],r[1]))return"#/doc/"+o;if(e&&i){let t="";if(n){let e=n.split("/");e.length>1&&(e.pop(),t=e.join("/")+"/")}return"#/doc/"+e+"/"+i+"/"+t+o}if(o.match(/\.md$/)){return"#/page/"+o.replace(/\.md$/,"")}return"#/page/"+o}},e.exports.default_configuration={ProviderIdentifier:"Docuserve-Documentation",AutoInitialize:!0,AutoInitializeOrdinal:0}},{lunr:32,"pict-provider":58,"pict-section-content":62}],48:[function(t,e,i){const n=t("pict-section-content"),o={ViewIdentifier:"Docuserve-Content",DefaultRenderable:"Docuserve-Content-Display",DefaultDestinationAddress:"#Docuserve-Content-Container",AutoRender:!1,CSS:"\n\t\t.pict-content {\n\t\t\tpadding: 2em 3em;\n\t\t\tmax-width: 900px;\n\t\t\tmargin: 0 auto;\n\t\t\tcolor: var(--docuserve-text);\n\t\t}\n\t\t.pict-content-loading {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-height: 200px;\n\t\t\tcolor: var(--docuserve-text-dim);\n\t\t\tfont-size: 1em;\n\t\t}\n\t\t.pict-content h1 {\n\t\t\tfont-size: 2em;\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t\tborder-bottom: 1px solid var(--docuserve-border);\n\t\t\tpadding-bottom: 0.3em;\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t.pict-content h2 {\n\t\t\tfont-size: 1.5em;\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t\tborder-bottom: 1px solid var(--docuserve-border-soft);\n\t\t\tpadding-bottom: 0.25em;\n\t\t\tmargin-top: 1.5em;\n\t\t}\n\t\t.pict-content h3 {\n\t\t\tfont-size: 1.25em;\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t\tmargin-top: 1.25em;\n\t\t}\n\t\t.pict-content h4, .pict-content h5, .pict-content h6 {\n\t\t\tcolor: var(--docuserve-text-muted);\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\t.pict-content p {\n\t\t\tline-height: 1.7;\n\t\t\tcolor: var(--docuserve-text);\n\t\t\tmargin: 0.75em 0;\n\t\t}\n\t\t.pict-content a {\n\t\t\tcolor: var(--docuserve-accent);\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.pict-content a:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t/* Plain <pre> (no wrap) - rare; keep for safety */\n\t\t.pict-content pre {\n\t\t\tbackground: var(--docuserve-code-bg);\n\t\t\tcolor: var(--docuserve-code-text);\n\t\t\tpadding: 1.25em;\n\t\t\tborder-radius: 6px;\n\t\t\tborder: 1px solid var(--docuserve-code-border);\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: 0.9em;\n\t\t}\n\t\t/* Inline code */\n\t\t.pict-content code {\n\t\t\tbackground: var(--docuserve-inline-code-bg);\n\t\t\tpadding: 0.15em 0.4em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: var(--docuserve-inline-code-text);\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;\n\t\t}\n\t\t.pict-content pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t/* Fenced code block wrapper emitted by pict-section-content */\n\t\t.pict-content-code-wrap {\n\t\t\tposition: relative;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;\n\t\t\tfont-size: 14px;\n\t\t\tline-height: 1.5;\n\t\t\tborder-radius: 6px;\n\t\t\tborder: 1px solid var(--docuserve-code-border);\n\t\t\toverflow: auto;\n\t\t\tmargin: 1em 0;\n\t\t\tbackground: var(--docuserve-code-bg);\n\t\t}\n\t\t.pict-content-code-wrap .pict-content-code-line-numbers {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 40px;\n\t\t\tpadding: 1.25em 0;\n\t\t\ttext-align: right;\n\t\t\tbackground: var(--docuserve-code-gutter-bg);\n\t\t\tborder-right: 1px solid var(--docuserve-code-gutter-border);\n\t\t\tcolor: var(--docuserve-code-gutter-text);\n\t\t\tfont-family: inherit;\n\t\t\tfont-size: inherit;\n\t\t\tline-height: inherit;\n\t\t\tuser-select: none;\n\t\t\tpointer-events: none;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.pict-content-code-wrap .pict-content-code-line-numbers span {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0 8px 0 0;\n\t\t}\n\t\t.pict-content-code-wrap pre {\n\t\t\tmargin: 0;\n\t\t\tbackground: var(--docuserve-code-bg);\n\t\t\tcolor: var(--docuserve-code-text);\n\t\t\tpadding: 1.25em 1.25em 1.25em 52px;\n\t\t\tborder: none;\n\t\t\tborder-radius: 0;\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.pict-content-code-wrap pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t/* Syntax tokens — these rules must match the span classes emitted by\n\t\t pict-section-code's highlighter. Also apply without .pict-content-code-wrap\n\t\t as a belt-and-suspenders for any <pre><code> not emitted from a fence. */\n\t\t.pict-content-code-wrap .keyword,\n\t\t.pict-content pre code .keyword { color: var(--docuserve-tok-keyword); }\n\t\t.pict-content-code-wrap .string,\n\t\t.pict-content pre code .string { color: var(--docuserve-tok-string); }\n\t\t.pict-content-code-wrap .number,\n\t\t.pict-content pre code .number { color: var(--docuserve-tok-number); }\n\t\t.pict-content-code-wrap .comment,\n\t\t.pict-content pre code .comment { color: var(--docuserve-tok-comment); font-style: italic; }\n\t\t.pict-content-code-wrap .operator,\n\t\t.pict-content pre code .operator { color: var(--docuserve-tok-operator); }\n\t\t.pict-content-code-wrap .punctuation,\n\t\t.pict-content pre code .punctuation { color: var(--docuserve-tok-punctuation); }\n\t\t.pict-content-code-wrap .function-name,\n\t\t.pict-content pre code .function-name { color: var(--docuserve-tok-function); }\n\t\t.pict-content-code-wrap .property,\n\t\t.pict-content pre code .property { color: var(--docuserve-tok-property); }\n\t\t.pict-content-code-wrap .tag,\n\t\t.pict-content pre code .tag { color: var(--docuserve-tok-tag); }\n\t\t.pict-content-code-wrap .attr-name,\n\t\t.pict-content pre code .attr-name { color: var(--docuserve-tok-attr-name); }\n\t\t.pict-content-code-wrap .attr-value,\n\t\t.pict-content pre code .attr-value { color: var(--docuserve-tok-attr-value); }\n\t\t.pict-content blockquote {\n\t\t\tborder-left: 4px solid var(--docuserve-blockquote-border);\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em 1em;\n\t\t\tbackground: var(--docuserve-blockquote-bg);\n\t\t\tcolor: var(--docuserve-blockquote-text);\n\t\t}\n\t\t.pict-content blockquote p {\n\t\t\tmargin: 0.25em 0;\n\t\t}\n\t\t.pict-content ul, .pict-content ol {\n\t\t\tpadding-left: 2em;\n\t\t\tline-height: 1.8;\n\t\t}\n\t\t.pict-content li {\n\t\t\tmargin: 0.25em 0;\n\t\t\tcolor: var(--docuserve-text);\n\t\t}\n\t\t.pict-content hr {\n\t\t\tborder: none;\n\t\t\tborder-top: 1px solid var(--docuserve-border);\n\t\t\tmargin: 2em 0;\n\t\t}\n\t\t.pict-content table {\n\t\t\twidth: 100%;\n\t\t\tborder-collapse: collapse;\n\t\t\tmargin: 1em 0;\n\t\t}\n\t\t.pict-content table th {\n\t\t\tbackground: var(--docuserve-table-header-bg);\n\t\t\tborder: 1px solid var(--docuserve-border);\n\t\t\tpadding: 0.6em 0.8em;\n\t\t\ttext-align: left;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t}\n\t\t.pict-content table td {\n\t\t\tborder: 1px solid var(--docuserve-border);\n\t\t\tpadding: 0.5em 0.8em;\n\t\t\tcolor: var(--docuserve-text);\n\t\t}\n\t\t.pict-content table tr:nth-child(even) {\n\t\t\tbackground: var(--docuserve-table-row-alt-bg);\n\t\t}\n\t\t.pict-content img {\n\t\t\tmax-width: 100%;\n\t\t\theight: auto;\n\t\t}\n\t\t.pict-content pre.mermaid {\n\t\t\tbackground: var(--docuserve-mermaid-bg);\n\t\t\tcolor: #2A241E;\n\t\t\ttext-align: center;\n\t\t\tpadding: 1em;\n\t\t\tborder: 1px solid var(--docuserve-border-soft);\n\t\t}\n\t\t/* Force dark text inside mermaid SVGs so diagrams stay readable\n\t\t in dark mode (mermaid bg is always light). */\n\t\t.pict-content pre.mermaid text,\n\t\t.pict-content pre.mermaid .nodeLabel,\n\t\t.pict-content pre.mermaid .edgeLabel,\n\t\t.pict-content pre.mermaid .label,\n\t\t.pict-content pre.mermaid .cluster-label,\n\t\t.pict-content pre.mermaid span,\n\t\t.pict-content pre.mermaid foreignObject p,\n\t\t.pict-content pre.mermaid foreignObject div,\n\t\t.pict-content pre.mermaid foreignObject span {\n\t\t\tcolor: #2A241E !important;\n\t\t\tfill: #2A241E !important;\n\t\t}\n\t\t.pict-content pre.mermaid .edgePath .path {\n\t\t\tstroke: #5E5549 !important;\n\t\t}\n\t\t.pict-content pre.mermaid .arrowheadPath {\n\t\t\tfill: #5E5549 !important;\n\t\t}\n\t\t.pict-content .pict-content-katex-display {\n\t\t\ttext-align: center;\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em;\n\t\t\toverflow-x: auto;\n\t\t}\n\t\t.pict-content .pict-content-katex-inline {\n\t\t\tdisplay: inline;\n\t\t}\n\t\t.docuserve-module-external-link {\n\t\t\tpadding: 0.5em 0;\n\t\t\tmargin-bottom: 0.5em;\n\t\t\tborder-bottom: 1px solid var(--docuserve-border-soft);\n\t\t\tfont-size: 0.85em;\n\t\t\ttext-align: right;\n\t\t}\n\t\t.docuserve-module-external-link a {\n\t\t\tcolor: var(--docuserve-accent);\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.docuserve-module-external-link a:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.docuserve-not-found {\n\t\t\ttext-align: center;\n\t\t\tpadding: 3em 1em;\n\t\t\tcolor: var(--docuserve-text-muted);\n\t\t}\n\t\t.docuserve-not-found h2 {\n\t\t\tcolor: var(--docuserve-text-dim);\n\t\t\tfont-size: 1.5em;\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t.docuserve-not-found code {\n\t\t\tbackground: var(--docuserve-inline-code-bg);\n\t\t\tpadding: 0.15em 0.4em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: var(--docuserve-inline-code-text);\n\t\t}\n\n\t\t/* Fullscreen viewer for images and mermaid diagrams (click-to-zoom) */\n\t\t.pict-content [data-fullscreen-source] {\n\t\t\tcursor: zoom-in;\n\t\t\toutline: 1px solid transparent;\n\t\t\toutline-offset: 3px;\n\t\t\tborder-radius: 4px;\n\t\t\ttransition: outline-color 0.15s ease;\n\t\t}\n\t\t.pict-content [data-fullscreen-source]:hover {\n\t\t\toutline-color: var(--docuserve-accent);\n\t\t}\n\t\t/* Code block container with hover-revealed action buttons */\n\t\t.pict-content-code-container {\n\t\t\tposition: relative;\n\t\t\tdisplay: flex;\n\t\t\talign-items: flex-start;\n\t\t\tgap: 8px;\n\t\t\tmargin: 1em 0;\n\t\t}\n\t\t.pict-content-code-container > .pict-content-code-wrap {\n\t\t\tmargin: 0;\n\t\t\tflex: 1 1 auto;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.pict-content-code-actions {\n\t\t\tposition: sticky;\n\t\t\ttop: 64px;\n\t\t\talign-self: flex-start;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tgap: 6px;\n\t\t\tflex: 0 0 auto;\n\t\t\tpadding-top: 6px;\n\t\t\topacity: 0;\n\t\t\ttransform: translateX(-4px);\n\t\t\ttransition: opacity 0.15s ease, transform 0.15s ease;\n\t\t\tpointer-events: none;\n\t\t}\n\t\t.pict-content-code-container:hover .pict-content-code-actions,\n\t\t.pict-content-code-container:focus-within .pict-content-code-actions {\n\t\t\topacity: 1;\n\t\t\ttransform: translateX(0);\n\t\t\tpointer-events: auto;\n\t\t}\n\t\t.pict-content-code-action-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 28px;\n\t\t\theight: 28px;\n\t\t\tpadding: 0;\n\t\t\tbackground: var(--docuserve-bg-elevated);\n\t\t\tcolor: var(--docuserve-text-muted);\n\t\t\tborder: 1px solid var(--docuserve-border);\n\t\t\tborder-radius: 6px;\n\t\t\tcursor: pointer;\n\t\t\tbox-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n\t\t\ttransition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;\n\t\t}\n\t\t.pict-content-code-action-btn svg {\n\t\t\tdisplay: block;\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t\tstroke: currentColor;\n\t\t\tfill: none;\n\t\t\tstroke-width: 1.6;\n\t\t\tstroke-linecap: round;\n\t\t\tstroke-linejoin: round;\n\t\t}\n\t\t.pict-content-code-action-btn:hover {\n\t\t\tbackground: var(--docuserve-accent);\n\t\t\tcolor: #FFFFFF;\n\t\t\tborder-color: var(--docuserve-accent);\n\t\t\tbox-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);\n\t\t}\n\t\t.pict-content-code-action-btn:focus-visible {\n\t\t\toutline: 2px solid var(--docuserve-accent);\n\t\t\toutline-offset: 2px;\n\t\t}\n\t\t.pict-content-code-action-btn.is-copied {\n\t\t\tbackground: var(--docuserve-accent);\n\t\t\tcolor: #FFFFFF;\n\t\t\tborder-color: var(--docuserve-accent);\n\t\t}\n\t\t.pict-content-code-action-btn.is-copy-failed {\n\t\t\tbackground: #B23A3A;\n\t\t\tcolor: #FFFFFF;\n\t\t\tborder-color: #B23A3A;\n\t\t}\n\t\t.pict-fullscreen-overlay {\n\t\t\tposition: fixed;\n\t\t\tinset: 0;\n\t\t\tz-index: 9999;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tbackground: rgba(0, 0, 0, 0.62);\n\t\t\tbackdrop-filter: blur(6px);\n\t\t\t-webkit-backdrop-filter: blur(6px);\n\t\t\tcolor: var(--docuserve-text);\n\t\t}\n\t\t.pict-fullscreen-overlay[hidden] {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.pict-fullscreen-titlebar {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tgap: 1em;\n\t\t\theight: 48px;\n\t\t\tpadding: 0 1em;\n\t\t\tbackground: var(--docuserve-bg-elevated);\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t\tborder-bottom: 1px solid var(--docuserve-border);\n\t\t\tbox-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);\n\t\t\tflex: 0 0 auto;\n\t\t}\n\t\t.pict-fullscreen-title {\n\t\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n\t\t\tfont-size: 0.95em;\n\t\t\tfont-weight: 600;\n\t\t\tletter-spacing: 0.01em;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t}\n\t\t.pict-fullscreen-controls {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t}\n\t\t.pict-fullscreen-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 32px;\n\t\t\theight: 32px;\n\t\t\tpadding: 0;\n\t\t\tbackground: transparent;\n\t\t\tborder: 1px solid transparent;\n\t\t\tborder-radius: 6px;\n\t\t\tcolor: var(--docuserve-text-muted);\n\t\t\tcursor: pointer;\n\t\t\ttransition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;\n\t\t}\n\t\t.pict-fullscreen-btn svg {\n\t\t\tdisplay: block;\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\tstroke: currentColor;\n\t\t\tfill: none;\n\t\t\tstroke-width: 1.75;\n\t\t\tstroke-linecap: round;\n\t\t\tstroke-linejoin: round;\n\t\t}\n\t\t.pict-fullscreen-btn:hover {\n\t\t\tbackground: var(--docuserve-border-soft);\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t}\n\t\t.pict-fullscreen-btn:focus-visible {\n\t\t\toutline: 2px solid var(--docuserve-accent);\n\t\t\toutline-offset: 2px;\n\t\t}\n\t\t.pict-fullscreen-close:hover {\n\t\t\tbackground: var(--docuserve-accent);\n\t\t\tcolor: #FFFFFF;\n\t\t}\n\t\t.pict-fullscreen-stage {\n\t\t\tflex: 1 1 auto;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\toverflow: hidden;\n\t\t\tpadding: 1.5em;\n\t\t\tcursor: zoom-in;\n\t\t\ttouch-action: none;\n\t\t}\n\t\t.pict-fullscreen-stage.is-zoomed {\n\t\t\tcursor: grab;\n\t\t}\n\t\t.pict-fullscreen-stage.is-panning {\n\t\t\tcursor: grabbing;\n\t\t}\n\t\t.pict-fullscreen-content {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 100%;\n\t\t\ttransform-origin: center center;\n\t\t\ttransition: transform 0.05s linear;\n\t\t\twill-change: transform;\n\t\t}\n\t\t.pict-fullscreen-content > * {\n\t\t\tbox-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);\n\t\t}\n\t\t.pict-fullscreen-content .pict-fullscreen-img {\n\t\t\tmax-width: 90vw;\n\t\t\tmax-height: calc(100vh - 96px);\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t\tobject-fit: contain;\n\t\t\tbackground: var(--docuserve-bg-elevated);\n\t\t\tpadding: 12px;\n\t\t\tborder-radius: 6px;\n\t\t}\n\t\t.pict-fullscreen-content .pict-fullscreen-mermaid-svg {\n\t\t\twidth: min(90vw, 1400px);\n\t\t\theight: auto;\n\t\t\tmax-height: calc(100vh - 96px);\n\t\t\tbackground: var(--docuserve-mermaid-bg);\n\t\t\tcolor: #2A241E;\n\t\t\tpadding: 16px;\n\t\t\tborder-radius: 6px;\n\t\t}\n\t\t.pict-fullscreen-content .pict-fullscreen-mermaid-svg text,\n\t\t.pict-fullscreen-content .pict-fullscreen-mermaid-svg .nodeLabel,\n\t\t.pict-fullscreen-content .pict-fullscreen-mermaid-svg .edgeLabel,\n\t\t.pict-fullscreen-content .pict-fullscreen-mermaid-svg .label,\n\t\t.pict-fullscreen-content .pict-fullscreen-mermaid-svg span,\n\t\t.pict-fullscreen-content .pict-fullscreen-mermaid-svg foreignObject p,\n\t\t.pict-fullscreen-content .pict-fullscreen-mermaid-svg foreignObject div,\n\t\t.pict-fullscreen-content .pict-fullscreen-mermaid-svg foreignObject span {\n\t\t\tcolor: #2A241E !important;\n\t\t\tfill: #2A241E !important;\n\t\t}\n\t\t.pict-fullscreen-content .pict-fullscreen-codewrap {\n\t\t\tmax-width: 90vw;\n\t\t\tmax-height: calc(100vh - 96px);\n\t\t\tmargin: 0;\n\t\t\toverflow: auto;\n\t\t\tbox-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Content-Template",Template:'\n<div class="pict-content" id="Docuserve-Content-Body">\n\t<div class="pict-content-loading">Loading documentation...</div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Content-Display",TemplateHash:"Docuserve-Content-Template",DestinationAddress:"#Docuserve-Content-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i)}displayContent(t){let e=t,i=this.pict.AppData.Docuserve.CurrentGroup,n=this.pict.AppData.Docuserve.CurrentModule;if(i&&n){let t=this.pict.providers["Docuserve-Documentation"];if(t){let o=t.resolveGitHubPagesURL(i,n);o&&(e='<div class="docuserve-module-external-link"><a href="'+o+'" target="_blank" rel="noopener">↗ View '+n+" documentation site</a></div>"+e)}}super.displayContent(e,"Docuserve-Content-Body")}showLoading(){super.showLoading("Loading documentation...","Docuserve-Content-Body")}},e.exports.default_configuration=o},{"pict-section-content":62}],49:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Docuserve-Layout",DefaultRenderable:"Docuserve-Layout-Shell",DefaultDestinationAddress:"#Docuserve-Application-Container",AutoRender:!1,CSS:"\n\t\t#Docuserve-Application-Container {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100vh;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t#Docuserve-TopBar-Container {\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.docuserve-body {\n\t\t\tdisplay: flex;\n\t\t\tflex: 1;\n\t\t\tmin-height: 0;\n\t\t}\n\t\t#Docuserve-Sidebar-Container {\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 280px;\n\t\t\toverflow-y: auto;\n\t\t\tbackground-color: #F5F0E8;\n\t\t}\n\t\t#Docuserve-Content-Container {\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\toverflow-y: auto;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Layout-Shell-Template",Template:'\n<div id="Docuserve-TopBar-Container"></div>\n<div class="docuserve-body">\n\t<div id="Docuserve-Sidebar-Container"></div>\n\t<div id="Docuserve-Content-Container"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Layout-Shell",TemplateHash:"Docuserve-Layout-Shell-Template",DestinationAddress:"#Docuserve-Application-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(t,e,i,n){if(this.pict.views["Docuserve-TopBar"].render(),this.pict.views["Docuserve-Sidebar"].render(),this.pict.views["Docuserve-Splash"].render(),this.pict.CSSMap.injectCSS(),this.pict.PictApplication.resolveHash(),!this._HashChangeListenerBound){this._HashChangeListenerBound=!0;let t=this;window.addEventListener("hashchange",()=>{t.pict.PictApplication.resolveHash()})}return super.onAfterRender(t,e,i,n)}},e.exports.default_configuration=o},{"pict-view":102}],50:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Docuserve-Search",DefaultRenderable:"Docuserve-Search-Display",DefaultDestinationAddress:"#Docuserve-Content-Container",AutoRender:!1,CSS:"\n\t\t.docuserve-search {\n\t\t\tpadding: 2em 3em;\n\t\t\tmax-width: 900px;\n\t\t\tmargin: 0 auto;\n\t\t}\n\t\t.docuserve-search-header {\n\t\t\tmargin-bottom: 1.5em;\n\t\t}\n\t\t.docuserve-search-header h1 {\n\t\t\tfont-size: 1.75em;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin: 0 0 0.75em 0;\n\t\t}\n\t\t.docuserve-search-input {\n\t\t\twidth: 100%;\n\t\t\tpadding: 0.75em 1em;\n\t\t\tfont-size: 1.1em;\n\t\t\tborder: 2px solid #D4CCBE;\n\t\t\tborder-radius: 6px;\n\t\t\toutline: none;\n\t\t\tbox-sizing: border-box;\n\t\t\ttransition: border-color 0.15s;\n\t\t}\n\t\t.docuserve-search-input:focus {\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.docuserve-search-status {\n\t\t\tmargin-top: 0.75em;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #8A7F72;\n\t\t}\n\t\t.docuserve-search-results {\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\t.docuserve-search-result {\n\t\t\tdisplay: block;\n\t\t\tpadding: 1em 1.25em;\n\t\t\tmargin-bottom: 0.5em;\n\t\t\tborder: 1px solid #EAE3D8;\n\t\t\tborder-radius: 6px;\n\t\t\ttext-decoration: none;\n\t\t\tcolor: inherit;\n\t\t\ttransition: border-color 0.15s, box-shadow 0.15s;\n\t\t}\n\t\t.docuserve-search-result:hover {\n\t\t\tborder-color: #2E7D74;\n\t\t\tbox-shadow: 0 2px 8px rgba(46, 125, 116, 0.1);\n\t\t}\n\t\t.docuserve-search-result-title {\n\t\t\tfont-size: 1.05em;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #2E7D74;\n\t\t\tmargin-bottom: 0.25em;\n\t\t}\n\t\t.docuserve-search-result-breadcrumb {\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 0.2em;\n\t\t}\n\t\t.docuserve-search-result-path {\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: #A39889;\n\t\t\tfont-family: monospace;\n\t\t}\n\t\t.docuserve-search-empty {\n\t\t\ttext-align: center;\n\t\t\tpadding: 3em 1em;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1em;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Search-Template",Template:'\n<div class="docuserve-search">\n\t<div class="docuserve-search-header">\n\t\t<h1>Search Documentation</h1>\n\t\t<input type="text" class="docuserve-search-input" id="Docuserve-Search-Input" placeholder="Search across all modules...">\n\t\t<div id="Docuserve-Search-Status" class="docuserve-search-status"></div>\n\t</div>\n\t<div id="Docuserve-Search-Results" class="docuserve-search-results"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Search-Display",TemplateHash:"Docuserve-Search-Template",DestinationAddress:"#Docuserve-Content-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._SearchDebounceTimer=null}onAfterRender(t,e,i,n){let o=document.getElementById("Docuserve-Search-Input");return o&&o.addEventListener("input",()=>{this._SearchDebounceTimer&&clearTimeout(this._SearchDebounceTimer),this._SearchDebounceTimer=setTimeout(()=>{this.performSearch(o.value)},250)}),super.onAfterRender(t,e,i,n)}showSearch(t){let e=document.getElementById("Docuserve-Search-Input");if(e&&(e.value=t||"",e.focus()),t&&t.trim())this.performSearch(t);else{let t=this.pict.AppData.Docuserve.KeywordDocumentCount||0,e=t>0?"Search across "+t+" documents.":"Enter a search term to find documentation.";this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status",e),this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results","")}let i=document.getElementById("Docuserve-Content-Container");i&&(i.scrollTop=0)}performSearch(t){if(!t||!t.trim()){let t=this.pict.AppData.Docuserve.KeywordDocumentCount||0,e=t>0?"Search across "+t+" documents.":"Enter a search term to find documentation.";return this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status",e),void this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results","")}let e=this.pict.providers["Docuserve-Documentation"].search(t);if(0===e.length)return this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status","No results found for '"+this.escapeHTML(t)+"'."),void this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results","");this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status",e.length+" result"+(1!==e.length?"s":"")+" for '"+this.escapeHTML(t)+"'");let i="";for(let t=0;t<e.length;t++){let n=e[t],o="";n.Group&&n.Module&&(o=n.Group+" › "+n.Module),i+='<a class="docuserve-search-result" href="'+n.Route+'">',i+='<div class="docuserve-search-result-title">'+this.escapeHTML(n.Title)+"</div>",o&&(i+='<div class="docuserve-search-result-breadcrumb">'+o+"</div>"),n.DocPath&&(i+='<div class="docuserve-search-result-path">'+this.escapeHTML(n.DocPath)+"</div>"),i+="</a>"}this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results",i)}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}},e.exports.default_configuration=o},{"pict-view":102}],51:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Docuserve-Sidebar",DefaultRenderable:"Docuserve-Sidebar-Content",DefaultDestinationAddress:"#Docuserve-Sidebar-Container",AutoRender:!1,CSS:"\n\t\t.docuserve-sidebar {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tbackground: var(--docuserve-sidebar-bg);\n\t\t\tborder-right: 1px solid var(--docuserve-sidebar-border);\n\t\t\tpadding: 1em 0;\n\t\t\tpadding-top: 0;\n\t\t\tmin-height: 100%;\n\t\t\tposition: relative;\n\t\t\ttransition: background-color 0.15s ease;\n\t\t}\n\t\t.docuserve-sidebar-header {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: flex-end;\n\t\t\tpadding: 0.4em 0.5em 0;\n\t\t}\n\t\t.docuserve-sidebar-close {\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: var(--docuserve-text-dim);\n\t\t\tfont-size: 1.2em;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 0.2em 0.4em;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.docuserve-sidebar-close:hover {\n\t\t\tcolor: var(--docuserve-accent);\n\t\t}\n\t\t.docuserve-sidebar-search {\n\t\t\tpadding: 0 1em 1em 1em;\n\t\t\tborder-bottom: 1px solid var(--docuserve-sidebar-border-soft);\n\t\t\tmargin-bottom: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-search input {\n\t\t\twidth: 100%;\n\t\t\tpadding: 0.5em 0.75em;\n\t\t\tbackground: var(--docuserve-sidebar-search-bg);\n\t\t\tcolor: var(--docuserve-text);\n\t\t\tborder: 1px solid var(--docuserve-sidebar-search-border);\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.85em;\n\t\t\toutline: none;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.docuserve-sidebar-search input:focus {\n\t\t\tborder-color: var(--docuserve-accent);\n\t\t}\n\t\t.docuserve-sidebar-search-results {\n\t\t\tmargin-top: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-search-results a {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.4em 0.5em;\n\t\t\tcolor: var(--docuserve-sidebar-text);\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.82em;\n\t\t\tborder-radius: 3px;\n\t\t\ttransition: background-color 0.1s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-sidebar-search-results a:hover {\n\t\t\tbackground-color: var(--docuserve-sidebar-hover-bg);\n\t\t\tcolor: var(--docuserve-sidebar-hover-text);\n\t\t}\n\t\t.docuserve-sidebar-search-result-title {\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t}\n\t\t.docuserve-sidebar-search-results a:hover .docuserve-sidebar-search-result-title {\n\t\t\tcolor: var(--docuserve-sidebar-hover-text);\n\t\t}\n\t\t.docuserve-sidebar-search-result-meta {\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: var(--docuserve-text-dim);\n\t\t}\n\t\t.docuserve-sidebar-search-all {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.4em 0.5em;\n\t\t\tfont-size: 0.82em;\n\t\t\tcolor: var(--docuserve-accent);\n\t\t\ttext-decoration: none;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t\tborder-top: 1px solid var(--docuserve-sidebar-border-soft);\n\t\t\tmargin-top: 0.25em;\n\t\t\tpadding-top: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-search-all:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.docuserve-sidebar-home {\n\t\t\tpadding: 0.5em 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.85em;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t}\n\t\t.docuserve-sidebar-home a {\n\t\t\tcolor: var(--docuserve-sidebar-module-text);\n\t\t\ttext-decoration: none;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.docuserve-sidebar-home a:hover {\n\t\t\tcolor: var(--docuserve-sidebar-hover-text);\n\t\t}\n\t\t.docuserve-sidebar-group {\n\t\t\tmargin-top: 0.25em;\n\t\t}\n\t\t.docuserve-sidebar-group-title {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.5em 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.85em;\n\t\t\tcolor: var(--docuserve-sidebar-group-title);\n\t\t\ttext-decoration: none;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t\ttransition: background-color 0.1s, color 0.1s;\n\t\t}\n\t\t.docuserve-sidebar-group-title:hover {\n\t\t\tcolor: var(--docuserve-sidebar-hover-text);\n\t\t\tbackground-color: var(--docuserve-sidebar-hover-bg);\n\t\t}\n\t\ta.docuserve-sidebar-group-title.active {\n\t\t\tcolor: var(--docuserve-sidebar-active-text);\n\t\t\tbackground-color: var(--docuserve-sidebar-active-bg);\n\t\t}\n\t\t.docuserve-sidebar-modules {\n\t\t\tlist-style: none;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\t.docuserve-sidebar-modules li {\n\t\t\tpadding: 0;\n\t\t}\n\t\t.docuserve-sidebar-modules a {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.3em 1.25em 0.3em 2em;\n\t\t\tcolor: var(--docuserve-sidebar-module-text);\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.85em;\n\t\t\ttransition: background-color 0.1s, color 0.1s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-sidebar-modules a:hover {\n\t\t\tbackground-color: var(--docuserve-sidebar-hover-bg);\n\t\t\tcolor: var(--docuserve-sidebar-hover-text);\n\t\t}\n\t\t.docuserve-sidebar-modules a.active {\n\t\t\tcolor: var(--docuserve-sidebar-active-text);\n\t\t\tfont-weight: 600;\n\t\t\tbackground-color: var(--docuserve-sidebar-active-bg);\n\t\t}\n\t\t.docuserve-sidebar-modules .no-docs {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.3em 1.25em 0.3em 2em;\n\t\t\tcolor: var(--docuserve-text-dim);\n\t\t\tfont-size: 0.85em;\n\t\t}\n\t\t.docuserve-sidebar-module-nav {\n\t\t\tborder-top: 1px solid var(--docuserve-sidebar-border-soft);\n\t\t\tmargin-top: 0.5em;\n\t\t\tpadding-top: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-module-nav-section {\n\t\t\tpadding: 0.4em 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: var(--docuserve-text-dim);\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.02em;\n\t\t}\n\t\t.docuserve-sidebar-module-nav a {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.25em 1.25em 0.25em 2.25em;\n\t\t\tcolor: var(--docuserve-sidebar-module-text);\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.82em;\n\t\t\ttransition: background-color 0.1s, color 0.1s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-sidebar-module-nav a:hover {\n\t\t\tbackground-color: var(--docuserve-sidebar-hover-bg);\n\t\t\tcolor: var(--docuserve-sidebar-hover-text);\n\t\t}\n\t\t.docuserve-sidebar-footer {\n\t\t\tmargin-top: auto;\n\t\t\tpadding: 0.9em 1.25em 1em 1.25em;\n\t\t\tborder-top: 1px solid var(--docuserve-sidebar-border-soft);\n\t\t}\n\t\t.docuserve-sidebar-footer:empty {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.docuserve-version-placard {\n\t\t\tfont-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n\t\t\tline-height: 1.35;\n\t\t}\n\t\t.docuserve-version-name {\n\t\t\tfont-size: 0.78em;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--docuserve-text-muted);\n\t\t\tletter-spacing: 0.02em;\n\t\t}\n\t\t.docuserve-version-number {\n\t\t\tfont-size: 0.82em;\n\t\t\tfont-weight: 500;\n\t\t\tcolor: var(--docuserve-accent);\n\t\t}\n\t\t.docuserve-version-meta {\n\t\t\tfont-size: 0.7em;\n\t\t\tcolor: var(--docuserve-text-dim);\n\t\t\tmargin-top: 0.15em;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Sidebar-Template",Template:'\n<div class="docuserve-sidebar">\n\t<div class="docuserve-sidebar-header">\n\t\t<button class="docuserve-sidebar-close" onclick="{~P~}.views[\'Docuserve-Sidebar\'].toggleSidebar()">×</button>\n\t</div>\n\t<div id="Docuserve-Sidebar-Search" class="docuserve-sidebar-search" style="display:none;">\n\t\t<input type="text" placeholder="Search docs..." id="Docuserve-Sidebar-Search-Input">\n\t\t<div id="Docuserve-Sidebar-Search-Results" class="docuserve-sidebar-search-results"></div>\n\t</div>\n\t<div class="docuserve-sidebar-home">\n\t\t<a onclick="{~P~}.PictApplication.navigateTo(\'/Home\')">Home</a>\n\t</div>\n\t<div id="Docuserve-Sidebar-Groups"></div>\n\t<div id="Docuserve-Sidebar-ModuleNav"></div>\n\t<div id="Docuserve-Sidebar-Footer" class="docuserve-sidebar-footer"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Sidebar-Content",TemplateHash:"Docuserve-Sidebar-Template",DestinationAddress:"#Docuserve-Sidebar-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._SidebarSearchDebounceTimer=null}onAfterRender(t,e,i,n){this.renderSidebarGroups(),this.renderSidebarFooter();let o=document.getElementById("Docuserve-Sidebar-Search");if(o&&this.pict.AppData.Docuserve.KeywordIndexLoaded){o.style.display="";let t=document.getElementById("Docuserve-Sidebar-Search-Input");t&&t.addEventListener("input",()=>{this._SidebarSearchDebounceTimer&&clearTimeout(this._SidebarSearchDebounceTimer),this._SidebarSearchDebounceTimer=setTimeout(()=>{this.performSidebarSearch(t.value)},250)})}return super.onAfterRender(t,e,i,n)}renderSidebarFooter(){let t=document.getElementById("Docuserve-Sidebar-Footer");if(!t)return;let e=this.pict.AppData.Docuserve;if(!e.VersionLoaded||!e.Version||!e.Version.Version)return void(t.innerHTML="");let i=e.Version,n='<div class="docuserve-version-placard">';i.Name&&(n+='<div class="docuserve-version-name">'+this.escapeHTML(i.Name)+"</div>"),n+='<div class="docuserve-version-number">v'+this.escapeHTML(i.Version)+"</div>";let o=[];if(i.GeneratedAt){let t=String(i.GeneratedAt).match(/^(\d{4}-\d{2}-\d{2})/);t&&o.push("built "+t[1])}i.GitCommit&&o.push(i.GitCommit),o.length>0&&(n+='<div class="docuserve-version-meta">'+this.escapeHTML(o.join(" · "))+"</div>"),n+="</div>",t.innerHTML=n}renderSidebarGroups(){let t=this.pict.AppData.Docuserve.SidebarGroups;if(!t||t.length<1)return void this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-Groups","");let e="";for(let i=0;i<t.length;i++){let n=t[i];e+='<div class="docuserve-sidebar-group">';let o=n.Route||"";if(!o)for(let t=0;t<n.Modules.length;t++)if(n.Modules[t].HasDocs&&n.Modules[t].Route){o=n.Modules[t].Route;break}if(o){let t="",i=window.location.hash||"";this.pict.AppData.Docuserve.CurrentGroup!==n.Key&&i!==o||(t=" active"),e+='<a class="docuserve-sidebar-group-title'+t+'" href="'+o+'">'+this.escapeHTML(n.Name)+"</a>"}else e+='<div class="docuserve-sidebar-group-title">'+this.escapeHTML(n.Name)+"</div>";e+='<ul class="docuserve-sidebar-modules">';for(let t=0;t<n.Modules.length;t++){let i=n.Modules[t];if(i.HasDocs){let t="";this.pict.AppData.Docuserve.CurrentGroup===i.Group&&this.pict.AppData.Docuserve.CurrentModule===i.Name&&(t=' class="active"'),e+="<li><a"+t+' href="'+i.Route+'">'+this.escapeHTML(i.Name)+"</a></li>"}else e+='<li><span class="no-docs">'+this.escapeHTML(i.Name)+"</span></li>"}e+="</ul>",e+="</div>"}this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-Groups",e)}renderModuleNav(t,e){let i=this.pict.providers["Docuserve-Documentation"];if(!i)return;let n=i.getModuleSidebar(t,e);if(!n)return void this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-ModuleNav","");let o="#/doc/"+t+"/"+e+"/",r='<div class="docuserve-sidebar-module-nav">';for(let t=0;t<n.length;t++){let e=n[t];if(e.Children){r+='<div class="docuserve-sidebar-module-nav-section">'+this.escapeHTML(e.Title)+"</div>";for(let t=0;t<e.Children.length;t++){let i=e.Children[t];i.Path&&(r+='<a href="'+o+i.Path+'">'+this.escapeHTML(i.Title)+"</a>")}}else e.Path&&(r+='<a href="'+o+e.Path+'">'+this.escapeHTML(e.Title)+"</a>")}r+="</div>",this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-ModuleNav",r)}performSidebarSearch(t){let e=document.getElementById("Docuserve-Sidebar-Search-Results");if(!e)return;if(!t||!t.trim())return void(e.innerHTML="");let i=this.pict.providers["Docuserve-Documentation"].search(t);if(0===i.length)return void(e.innerHTML='<div style="padding: 0.4em 0.5em; font-size: 0.82em; color: #8A7F72;">No results found.</div>');let n="";for(let t=0;t<i.length&&t<8;t++){let e=i[t],o="";e.Group&&e.Module&&(o=e.Group+" / "+e.Module),n+='<a href="'+e.Route+'">',n+='<div class="docuserve-sidebar-search-result-title">'+this.escapeHTML(e.Title)+"</div>",o&&(n+='<div class="docuserve-sidebar-search-result-meta">'+this.escapeHTML(o)+"</div>"),n+="</a>"}if(i.length>8){n+='<a class="docuserve-sidebar-search-all" href="#/search/'+encodeURIComponent(t)+'">See all '+i.length+" results</a>"}e.innerHTML=n}toggleSidebar(){this.pict.AppData.Docuserve.SidebarVisible=!this.pict.AppData.Docuserve.SidebarVisible;let t=document.getElementById("Docuserve-Sidebar-Container"),e=document.getElementById("Docuserve-TopBar-Toggle");this.pict.AppData.Docuserve.SidebarVisible?(t&&(t.style.display=""),e&&(e.style.display="none")):(t&&(t.style.display="none"),e&&(e.style.display="inline-block"))}clearModuleNav(){this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-ModuleNav","")}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}},e.exports.default_configuration=o},{"pict-view":102}],52:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Docuserve-Splash",DefaultRenderable:"Docuserve-Splash-Content",DefaultDestinationAddress:"#Docuserve-Content-Container",AutoRender:!1,CSS:"\n\t\t.docuserve-splash {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-height: calc(100vh - 56px);\n\t\t\tpadding: 3em 2em;\n\t\t\ttext-align: center;\n\t\t\tbackground: var(--docuserve-bg);\n\t\t}\n\t\t.docuserve-splash h1 {\n\t\t\tfont-size: 3em;\n\t\t\tfont-weight: 700;\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t\tmargin: 0 0 0.25em 0;\n\t\t}\n\t\t.docuserve-splash h1 small {\n\t\t\tfont-size: 0.4em;\n\t\t\tfont-weight: 400;\n\t\t\tcolor: var(--docuserve-text-dim);\n\t\t\tvertical-align: middle;\n\t\t\tmargin-left: 0.15em;\n\t\t}\n\t\t.docuserve-splash-tagline {\n\t\t\tfont-size: 1.25em;\n\t\t\tcolor: var(--docuserve-text-muted);\n\t\t\tmargin-bottom: 1.5em;\n\t\t\tfont-style: italic;\n\t\t}\n\t\t.docuserve-splash-description {\n\t\t\tfont-size: 1em;\n\t\t\tcolor: var(--docuserve-text-muted);\n\t\t\tmax-width: 600px;\n\t\t\tline-height: 1.7;\n\t\t\tmargin-bottom: 2em;\n\t\t}\n\t\t.docuserve-splash-highlights {\n\t\t\tdisplay: grid;\n\t\t\tgrid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n\t\t\tgap: 1.25em;\n\t\t\tmax-width: 900px;\n\t\t\twidth: 100%;\n\t\t\tmargin-bottom: 2.5em;\n\t\t}\n\t\t.docuserve-splash-highlight-card {\n\t\t\tbackground: var(--docuserve-bg-elevated);\n\t\t\tborder: 1px solid var(--docuserve-border);\n\t\t\tborder-radius: 8px;\n\t\t\tpadding: 1.25em;\n\t\t\ttext-align: left;\n\t\t\ttransition: box-shadow 0.2s, border-color 0.2s;\n\t\t}\n\t\t.docuserve-splash-highlight-card:hover {\n\t\t\tbox-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);\n\t\t\tborder-color: var(--docuserve-accent);\n\t\t}\n\t\t.docuserve-splash-highlight-card h3 {\n\t\t\tmargin: 0 0 0.5em 0;\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t\tfont-size: 1em;\n\t\t}\n\t\t.docuserve-splash-highlight-card p {\n\t\t\tmargin: 0;\n\t\t\tcolor: var(--docuserve-text-muted);\n\t\t\tfont-size: 0.85em;\n\t\t\tline-height: 1.5;\n\t\t}\n\t\t.docuserve-splash-actions {\n\t\t\tdisplay: flex;\n\t\t\tgap: 1em;\n\t\t\tflex-wrap: wrap;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.docuserve-splash-actions a {\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 0.7em 1.5em;\n\t\t\tborder-radius: 6px;\n\t\t\tfont-size: 0.95em;\n\t\t\tfont-weight: 600;\n\t\t\ttext-decoration: none;\n\t\t\ttransition: background-color 0.15s, color 0.15s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-splash-actions .primary {\n\t\t\tbackground-color: var(--docuserve-accent);\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-splash-actions .primary:hover {\n\t\t\tbackground-color: var(--docuserve-accent-hover);\n\t\t}\n\t\t.docuserve-splash-actions .secondary {\n\t\t\tbackground-color: var(--docuserve-bg-elevated);\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t\tborder: 2px solid var(--docuserve-accent);\n\t\t}\n\t\t.docuserve-splash-actions .secondary:hover {\n\t\t\tborder-color: var(--docuserve-accent-hover);\n\t\t\tcolor: var(--docuserve-accent);\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Splash-Template",Template:'\n<div class="docuserve-splash">\n\t<h1 id="Docuserve-Splash-Title"></h1>\n\t<div class="docuserve-splash-tagline" id="Docuserve-Splash-Tagline"></div>\n\t<div class="docuserve-splash-description" id="Docuserve-Splash-Description"></div>\n\t<div class="docuserve-splash-highlights" id="Docuserve-Splash-Highlights"></div>\n\t<div class="docuserve-splash-actions" id="Docuserve-Splash-Actions"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Splash-Content",TemplateHash:"Docuserve-Splash-Template",DestinationAddress:"#Docuserve-Content-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(t,e,i,n){let o=this.pict.AppData.Docuserve;return o.CoverLoaded&&o.Cover?this.renderFromCover(o.Cover):this.renderFromCatalog(o),super.onAfterRender(t,e,i,n)}renderFromCover(t){this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Title",this.sanitizeTitle(t.Title)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Tagline",this.escapeHTML(t.Tagline)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Description",this.escapeHTML(t.Description));let e="";for(let i=0;i<t.Highlights.length;i++){let n=t.Highlights[i];e+='<div class="docuserve-splash-highlight-card">',n.Label&&(e+="<h3>"+this.escapeHTML(n.Label)+"</h3>"),e+="<p>"+this.escapeHTML(n.Text)+"</p>",e+="</div>"}this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Highlights",e);let i="",n=this.pict.providers["Docuserve-Documentation"];for(let e=0;e<t.Actions.length;e++){let o=t.Actions[e],r=0===e?"primary":"secondary",a=o.Href;if(a.match(/^https?:\/\//))i+='<a class="'+r+'" href="'+this.escapeHTML(a)+'" target="_blank" rel="noopener">'+this.escapeHTML(o.Text)+"</a>";else{let t=n.convertSidebarLink(a);i+='<a class="'+r+'" href="'+this.escapeHTML(t)+'">'+this.escapeHTML(o.Text)+"</a>"}}this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Actions",i)}renderFromCatalog(t){let e="Documentation",i="";t.CatalogLoaded&&t.Catalog&&t.Catalog.Name?e=t.Catalog.Name:t.TopBarLoaded&&t.TopBar&&t.TopBar.Brand?e=t.TopBar.Brand:"undefined"!=typeof document&&document.title&&(e=document.title),t.CatalogLoaded&&t.Catalog&&t.Catalog.Description&&(i=t.Catalog.Description),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Title",this.escapeHTML(e)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Tagline",this.escapeHTML(i)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Description","");let n="",o=t.SidebarGroups||[];for(let t=0;t<o.length;t++){let e=o[t];if(!e.Modules||e.Modules.length<1)continue;let i=e.Description||e.Modules.length+" modules";n+='<div class="docuserve-splash-highlight-card">',n+="<h3>"+this.escapeHTML(e.Name)+"</h3>",n+="<p>"+this.escapeHTML(i)+"</p>",n+="</div>"}this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Highlights",n),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Actions","")}sanitizeTitle(t){return t?this.escapeHTML(t).replace(/<small>/gi,"<small>").replace(/<\/small>/gi,"</small>"):""}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}},e.exports.default_configuration=o},{"pict-view":102}],53:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Docuserve-TopBar",DefaultRenderable:"Docuserve-TopBar-Content",DefaultDestinationAddress:"#Docuserve-TopBar-Container",AutoRender:!1,CSS:'\n\t\t.docuserve-topbar {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tbackground-color: var(--docuserve-topbar-bg);\n\t\t\tcolor: var(--docuserve-topbar-text);\n\t\t\tpadding: 0 1.5em;\n\t\t\theight: 56px;\n\t\t\tbox-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);\n\t\t\tposition: sticky;\n\t\t\ttop: 0;\n\t\t\tz-index: 100;\n\t\t\ttransition: background-color 0.15s ease, color 0.15s ease;\n\t\t}\n\t\t.docuserve-topbar-brand {\n\t\t\tfont-size: 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tletter-spacing: 0.02em;\n\t\t\tcolor: var(--docuserve-topbar-text);\n\t\t\ttext-decoration: none;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-topbar-brand small {\n\t\t\tfont-size: 0.65em;\n\t\t\tfont-weight: 400;\n\t\t\tcolor: var(--docuserve-topbar-text-dim);\n\t\t\tmargin-left: 0.2em;\n\t\t}\n\t\t.docuserve-topbar-brand:hover {\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-topbar-brandgroup {\n\t\t\tdisplay: flex;\n\t\t\talign-items: baseline;\n\t\t\tgap: 0.6em;\n\t\t}\n\t\t.docuserve-topbar-version {\n\t\t\tfont-size: 0.75em;\n\t\t\tfont-weight: 500;\n\t\t\tcolor: var(--docuserve-topbar-version-text);\n\t\t\tbackground-color: var(--docuserve-topbar-version-bg);\n\t\t\tborder: 1px solid var(--docuserve-topbar-version-border);\n\t\t\tpadding: 0.12em 0.5em;\n\t\t\tborder-radius: 10px;\n\t\t\tfont-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n\t\t\tletter-spacing: 0.02em;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.docuserve-topbar-version:empty {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.docuserve-topbar-nav {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.25em;\n\t\t}\n\t\t.docuserve-topbar-nav a {\n\t\t\tcolor: var(--docuserve-topbar-text-muted);\n\t\t\ttext-decoration: none;\n\t\t\tpadding: 0.5em 0.75em;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.9em;\n\t\t\ttransition: background-color 0.15s, color 0.15s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-topbar-nav a:hover {\n\t\t\tbackground-color: var(--docuserve-topbar-hover-bg);\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-topbar-links {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.5em;\n\t\t}\n\t\t.docuserve-topbar-links a {\n\t\t\tcolor: var(--docuserve-topbar-text-dim);\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.85em;\n\t\t\tpadding: 0.4em 0.6em;\n\t\t\tborder-radius: 4px;\n\t\t\ttransition: background-color 0.15s, color 0.15s;\n\t\t}\n\t\t.docuserve-topbar-links a:hover {\n\t\t\tbackground-color: var(--docuserve-topbar-hover-bg);\n\t\t\tcolor: var(--docuserve-topbar-text);\n\t\t}\n\t\t.docuserve-topbar-theme {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 2px;\n\t\t\tmargin: 0 0.35em 0 0.15em;\n\t\t\tpadding: 2px;\n\t\t\tbackground: rgba(255, 255, 255, 0.035);\n\t\t\tborder: 1px solid rgba(255, 255, 255, 0.08);\n\t\t\tborder-radius: 999px;\n\t\t}\n\t\t.docuserve-topbar-theme-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 24px;\n\t\t\theight: 24px;\n\t\t\tpadding: 0;\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tborder-radius: 999px;\n\t\t\tcolor: var(--docuserve-topbar-text-dim);\n\t\t\tcursor: pointer;\n\t\t\ttransition: background-color 0.15s ease, color 0.15s ease;\n\t\t}\n\t\t.docuserve-topbar-theme-btn svg {\n\t\t\tdisplay: block;\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t\tstroke: currentColor;\n\t\t\tfill: none;\n\t\t\tstroke-width: 1.75;\n\t\t\tstroke-linecap: round;\n\t\t\tstroke-linejoin: round;\n\t\t}\n\t\t.docuserve-topbar-theme-btn:hover {\n\t\t\tcolor: var(--docuserve-topbar-text);\n\t\t}\n\t\t.docuserve-topbar-theme-btn[aria-pressed="true"] {\n\t\t\tbackground: var(--docuserve-topbar-hover-bg);\n\t\t\tcolor: var(--docuserve-topbar-text);\n\t\t}\n\t\t.docuserve-topbar-toggle {\n\t\t\tdisplay: none;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: var(--docuserve-topbar-text-muted);\n\t\t\tfont-size: 1.3em;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 0.3em 0.5em;\n\t\t\tmargin-left: 0.5em;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.docuserve-topbar-toggle:hover {\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-topbar-right {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t}\n\t',Templates:[{Hash:"Docuserve-TopBar-Template",Template:'\n<div class="docuserve-topbar">\n\t<div class="docuserve-topbar-brandgroup">\n\t\t<a id="Docuserve-TopBar-Brand" class="docuserve-topbar-brand" href="#/Home"></a>\n\t\t<span id="Docuserve-TopBar-Version" class="docuserve-topbar-version" title=""></span>\n\t</div>\n\t<div id="Docuserve-TopBar-Nav" class="docuserve-topbar-nav"></div>\n\t<div class="docuserve-topbar-right">\n\t\t<div id="Docuserve-TopBar-Links" class="docuserve-topbar-links"></div>\n\t\t<div id="Docuserve-TopBar-Theme" class="docuserve-topbar-theme" role="group" aria-label="Theme">\n\t\t\t<button type="button" class="docuserve-topbar-theme-btn" data-theme-choice="system" aria-label="Use system theme" aria-pressed="false"><svg viewBox="0 0 16 16" aria-hidden="true"><rect x="1.75" y="2.5" width="12.5" height="8.5" rx="1.25"></rect><line x1="5.5" y1="13.5" x2="10.5" y2="13.5"></line><line x1="8" y1="11" x2="8" y2="13.5"></line></svg></button>\n\t\t\t<button type="button" class="docuserve-topbar-theme-btn" data-theme-choice="light" aria-label="Use light theme" aria-pressed="false"><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="3.25"></circle><line x1="8" y1="1.25" x2="8" y2="2.75"></line><line x1="8" y1="13.25" x2="8" y2="14.75"></line><line x1="1.25" y1="8" x2="2.75" y2="8"></line><line x1="13.25" y1="8" x2="14.75" y2="8"></line><line x1="3.25" y1="3.25" x2="4.3" y2="4.3"></line><line x1="11.7" y1="11.7" x2="12.75" y2="12.75"></line><line x1="3.25" y1="12.75" x2="4.3" y2="11.7"></line><line x1="11.7" y1="4.3" x2="12.75" y2="3.25"></line></svg></button>\n\t\t\t<button type="button" class="docuserve-topbar-theme-btn" data-theme-choice="dark" aria-label="Use dark theme" aria-pressed="false"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M13.25 9.5A5.5 5.5 0 0 1 6.5 2.75a5.5 5.5 0 1 0 6.75 6.75z"></path></svg></button>\n\t\t</div>\n\t\t<button id="Docuserve-TopBar-Toggle" class="docuserve-topbar-toggle" onclick="{~P~}.views[\'Docuserve-Sidebar\'].toggleSidebar()">☰</button>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-TopBar-Content",TemplateHash:"Docuserve-TopBar-Template",DestinationAddress:"#Docuserve-TopBar-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(t,e,i,n){return this.renderTopBarContent(),this.initThemeToggle(),super.onAfterRender(t,e,i,n)}getThemeStorageKey(){try{let t=(window.location.pathname||"/").replace(/\/[^/]*$/,"/");return"docuserve-theme:"+window.location.origin+t}catch(t){return"docuserve-theme"}}initThemeToggle(){let t=document.getElementById("Docuserve-TopBar-Theme");if(!t)return;let e=t.querySelectorAll(".docuserve-topbar-theme-btn"),i=this.getThemeStorageKey(),n=null;try{n=localStorage.getItem(i)}catch(t){}"light"!==n&&"dark"!==n&&"system"!==n&&(n="system"),this.applyTheme(n,e,i);for(let t=0;t<e.length;t++){let n=e[t];n.addEventListener("click",()=>{let t=n.getAttribute("data-theme-choice");this.applyTheme(t,e,i)})}}applyTheme(t,e,i){"light"===t?document.documentElement.setAttribute("data-theme","light"):"dark"===t?document.documentElement.setAttribute("data-theme","dark"):(document.documentElement.removeAttribute("data-theme"),t="system");try{localStorage.setItem(i,t)}catch(t){}if(e)for(let i=0;i<e.length;i++){let n=e[i],o=n.getAttribute("data-theme-choice")===t;n.setAttribute("aria-pressed",o?"true":"false")}}renderTopBarContent(){let t=this.pict.AppData.Docuserve,e=document.getElementById("Docuserve-TopBar-Brand"),i=document.getElementById("Docuserve-TopBar-Nav"),n=document.getElementById("Docuserve-TopBar-Links"),o=document.getElementById("Docuserve-TopBar-Version");if(e&&i&&n)if(this.renderVersionChip(o,t),t.TopBarLoaded&&t.TopBar){let o=t.TopBar;e.innerHTML=this.sanitizeTitle(o.Brand||"Documentation");let r='<a href="#/Home">Home</a>';for(let t=0;t<o.NavLinks.length;t++){let e=o.NavLinks[t];r+='<a href="'+e.Href+'">'+this.escapeHTML(e.Text)+"</a>"}i.innerHTML=r;let a="";t.KeywordIndexLoaded&&(a+='<a href="#/search/">Search</a>');for(let t=0;t<o.ExternalLinks.length;t++){let e=o.ExternalLinks[t];a+='<a href="'+this.escapeHTML(e.Href)+'" target="_blank" rel="noopener">'+this.escapeHTML(e.Text)+"</a>"}n.innerHTML=a}else{let o="Documentation";t.CoverLoaded&&t.Cover&&t.Cover.Title?o=t.Cover.Title:t.CatalogLoaded&&t.Catalog&&t.Catalog.Name&&(o=t.Catalog.Name),e.innerHTML=this.sanitizeTitle(o),i.innerHTML='<a href="#/Home">Home</a>',n.innerHTML=t.KeywordIndexLoaded?'<a href="#/search/">Search</a>':""}}renderVersionChip(t,e){if(!t)return;if(!e.VersionLoaded||!e.Version||!e.Version.Version)return t.innerHTML="",void t.setAttribute("title","");let i=e.Version;t.innerHTML="v"+this.escapeHTML(i.Version);let n=[];i.Name?n.push(i.Name+" v"+i.Version):n.push("v"+i.Version),i.GeneratedAt&&n.push("built "+this.formatVersionDate(i.GeneratedAt)),i.GitCommit&&n.push(i.GitCommit),t.setAttribute("title",n.join(" · "))}formatVersionDate(t){if(!t)return"";let e=String(t).match(/^(\d{4}-\d{2}-\d{2})/);return e?e[1]:String(t)}sanitizeTitle(t){return t?this.escapeHTML(t).replace(/<small>/gi,"<small>").replace(/<\/small>/gi,"</small>"):""}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}},e.exports.default_configuration=o},{"pict-view":102}],54:[function(t,e,i){e.exports="\n/* ── Vocabulary term marker ─────────────────────────── */\n.pict-vocab-term {\n\tborder-bottom: 1px dotted var(--accent, #2a8a7a);\n\tcursor: help;\n}\n\n/* ── Popover ────────────────────────────────────────── */\n.vocab-popover {\n\tposition: fixed;\n\tz-index: 10000;\n\tmax-width: 320px;\n\tpadding: 12px 16px;\n\tbackground: var(--bg-secondary, #1a2a2a);\n\tborder: 1px solid var(--border-color, #2a3a3a);\n\tborder-radius: 6px;\n\tbox-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);\n\tfont-size: 0.85em;\n\tline-height: 1.5;\n\tcolor: var(--text-primary, #d0dada);\n}\n\n.vocab-popover-title {\n\tfont-weight: bold;\n\tmargin-bottom: 6px;\n\tcolor: var(--accent, #2a8a7a);\n}\n\n.vocab-popover-short {\n\tmargin-bottom: 8px;\n\tcolor: var(--text-secondary, #8ca0a0);\n}\n\n.vocab-popover-link {\n\tcolor: var(--accent, #2a8a7a);\n\ttext-decoration: none;\n\tfont-size: 0.85em;\n}\n.vocab-popover-link:hover {\n\ttext-decoration: underline;\n}\n\n/* ── Vocabulary Manager View ────────────────────────── */\n.vocab-layout {\n\tdisplay: flex;\n\theight: calc(100vh - 80px);\n\tgap: 0;\n}\n\n.vocab-sidebar {\n\twidth: 260px;\n\tmin-width: 200px;\n\tborder-right: 1px solid var(--border-color, #2a3a3a);\n\toverflow-y: auto;\n\tbackground: var(--bg-secondary, #1a2a2a);\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.vocab-sidebar-header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 12px 14px;\n\tborder-bottom: 1px solid var(--border-color, #2a3a3a);\n}\n\n.vocab-content {\n\tflex: 1;\n\toverflow-y: auto;\n\tpadding: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.vocab-list {\n\tflex: 1;\n\toverflow-y: auto;\n\tpadding: 6px 0;\n}\n\n.vocab-item {\n\tpadding: 6px 14px;\n\tcursor: pointer;\n\tfont-size: 0.85em;\n\tcolor: var(--text-secondary, #8ca0a0);\n\tborder-left: 3px solid transparent;\n}\n.vocab-item:hover {\n\tbackground: var(--bg-hover, #2a3a3a);\n}\n.vocab-item-active {\n\tbackground: var(--bg-hover, #2a3a3a);\n\tcolor: var(--text-primary, #d0dada);\n\tborder-left-color: var(--accent, #2a8a7a);\n}\n\n.vocab-item-title {\n\tfont-weight: 600;\n\tcolor: var(--text-primary, #d0dada);\n}\n.vocab-item-short {\n\tfont-size: 0.78em;\n\tcolor: var(--text-muted, #6a8080);\n\tmargin-top: 2px;\n\tline-height: 1.3;\n}\n\n.vocab-filter {\n\tmargin: 8px 10px;\n\tpadding: 6px 10px;\n\tborder: 1px solid var(--border-color, #2a3a3a);\n\tborder-radius: 4px;\n\tbackground: var(--bg-primary, #0e1818);\n\tcolor: var(--text-primary, #d0dada);\n\tfont-size: 0.85em;\n}\n.vocab-filter:focus {\n\tborder-color: var(--accent, #2a8a7a);\n\toutline: none;\n}\n\n.vocab-toolbar {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tpadding: 10px 16px;\n\tborder-bottom: 1px solid var(--border-color, #2a3a3a);\n\tbackground: var(--bg-secondary, #1a2a2a);\n}\n\n.vocab-slug {\n\tflex: 1;\n\tfont-family: 'SF Mono', Menlo, Monaco, monospace;\n\tfont-size: 0.82em;\n\tcolor: var(--text-muted, #6a8080);\n}\n\n.vocab-btn {\n\tpadding: 4px 12px;\n\tborder: 1px solid var(--border-color, #2a3a3a);\n\tborder-radius: 4px;\n\tbackground: var(--bg-primary, #0e1818);\n\tcolor: var(--text-secondary, #8ca0a0);\n\tcursor: pointer;\n\tfont-size: 0.82em;\n}\n.vocab-btn:hover {\n\tbackground: var(--bg-hover, #2a3a3a);\n}\n.vocab-btn-primary {\n\tbackground: var(--accent, #2a8a7a);\n\tborder-color: var(--accent, #2a8a7a);\n\tcolor: #fff;\n}\n.vocab-btn-danger {\n\tcolor: #D9534F;\n\tborder-color: #D9534F;\n}\n.vocab-btn-danger:hover {\n\tbackground: #D9534F;\n\tborder-color: #D9534F;\n\tcolor: #fff;\n}\n\n.vocab-rendered {\n\tflex: 1;\n\tpadding: 20px 24px;\n\toverflow-y: auto;\n\tline-height: 1.6;\n}\n\n.vocab-editor {\n\tflex: 1;\n\twidth: 100%;\n\tpadding: 16px 20px;\n\tborder: none;\n\tbackground: var(--bg-primary, #0e1818);\n\tcolor: var(--text-primary, #d0dada);\n\tfont-family: 'SF Mono', Menlo, Monaco, monospace;\n\tfont-size: 0.85em;\n\tline-height: 1.5;\n\tresize: none;\n}\n.vocab-editor:focus {\n\toutline: none;\n}\n\n.vocab-empty {\n\tpadding: 40px 24px;\n\ttext-align: center;\n\tcolor: var(--text-muted, #6a8080);\n\tfont-size: 0.9em;\n}\n\n/* ── Term preview (expanded active item) ───────────── */\n.vocab-item-preview-short {\n\tmargin-top: 6px;\n\tpadding: 6px 0;\n\tcolor: var(--text-secondary, #8ca0a0);\n\tfont-size: 0.8em;\n\tline-height: 1.4;\n\tborder-bottom: 1px solid var(--border-color, #2a3a3a);\n}\n.vocab-item-preview-body {\n\tmargin-top: 6px;\n\tpadding: 8px 10px;\n\tbackground: var(--bg-primary, #0e1818);\n\tborder-radius: 4px;\n\tcolor: var(--text-muted, #6a8080);\n\twhite-space: pre-wrap;\n\tfont-family: 'SF Mono', Menlo, Monaco, monospace;\n\tfont-size: 0.72em;\n\tline-height: 1.4;\n\tmax-height: 200px;\n\toverflow-y: auto;\n}\n.vocab-item-preview-actions {\n\tmargin-top: 6px;\n\tpadding-bottom: 2px;\n}\n\n/* ── Create-term modal overlay ─────────────────────── */\n.vocab-create-overlay {\n\tdisplay: none;\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\tright: 0;\n\tbottom: 0;\n\tz-index: 10001;\n\tbackground: rgba(0, 0, 0, 0.35);\n}\n.vocab-create-overlay.open {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n.vocab-create-panel {\n\tbackground: var(--bg-primary, #0e1818);\n\tborder: 1px solid var(--border-color, #2a3a3a);\n\tborder-radius: 10px;\n\tbox-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);\n\twidth: 360px;\n\tmax-width: 90vw;\n\toverflow: hidden;\n}\n.vocab-create-body {\n\tpadding: 24px 22px 16px;\n}\n.vocab-create-title {\n\tfont-size: 0.95rem;\n\tfont-weight: 600;\n\tcolor: var(--text-primary, #d0dada);\n\tmargin-bottom: 12px;\n\ttext-align: center;\n}\n.vocab-create-input {\n\tdisplay: block;\n\twidth: 100%;\n\tbox-sizing: border-box;\n\tpadding: 8px 12px;\n\tborder: 1px solid var(--border-color, #2a3a3a);\n\tborder-radius: 5px;\n\tbackground: var(--bg-secondary, #1a2a2a);\n\tcolor: var(--text-primary, #d0dada);\n\tfont-size: 0.88rem;\n\tfont-family: 'SF Mono', Menlo, Monaco, monospace;\n}\n.vocab-create-input:focus {\n\tborder-color: var(--accent, #2a8a7a);\n\toutline: none;\n}\n.vocab-create-actions {\n\tdisplay: flex;\n\tgap: 10px;\n\tjustify-content: center;\n\tpadding: 0 22px 16px;\n}\n.vocab-create-footer {\n\tpadding: 10px 22px;\n\tborder-top: 1px solid var(--border-color, #2a3a3a);\n\tfont-size: 0.72rem;\n\tcolor: var(--text-muted, #6a8080);\n\ttext-align: center;\n}\n.vocab-create-footer kbd {\n\tdisplay: inline-block;\n\tpadding: 1px 5px;\n\tfont-size: 0.68rem;\n\tfont-family: monospace;\n\tbackground: var(--bg-secondary, #1a2a2a);\n\tborder: 1px solid var(--border-color, #2a3a3a);\n\tborder-radius: 3px;\n\tcolor: var(--text-secondary, #8ca0a0);\n}\n"},{}],55:[function(t,e,i){
|
|
57
|
+
I.Builder=function(){this._ref="id",this._fields=Object.create(null),this._documents=Object.create(null),this.invertedIndex=Object.create(null),this.fieldTermFrequencies={},this.fieldLengths={},this.tokenizer=I.tokenizer,this.pipeline=new I.Pipeline,this.searchPipeline=new I.Pipeline,this.documentCount=0,this._b=.75,this._k1=1.2,this.termIndex=0,this.metadataWhitelist=[]},I.Builder.prototype.ref=function(t){this._ref=t},I.Builder.prototype.field=function(t,e){if(/\//.test(t))throw new RangeError("Field '"+t+"' contains illegal character '/'");this._fields[t]=e||{}},I.Builder.prototype.b=function(t){this._b=t<0?0:t>1?1:t},I.Builder.prototype.k1=function(t){this._k1=t},I.Builder.prototype.add=function(t,e){var i=t[this._ref],n=Object.keys(this._fields);this._documents[i]=e||{},this.documentCount+=1;for(var o=0;o<n.length;o++){var r=n[o],a=this._fields[r].extractor,s=a?a(t):t[r],l=this.tokenizer(s,{fields:[r]}),d=this.pipeline.run(l),c=new I.FieldRef(i,r),p=Object.create(null);this.fieldTermFrequencies[c]=p,this.fieldLengths[c]=0,this.fieldLengths[c]+=d.length;for(var h=0;h<d.length;h++){var u=d[h];if(null==p[u]&&(p[u]=0),p[u]+=1,null==this.invertedIndex[u]){var m=Object.create(null);m._index=this.termIndex,this.termIndex+=1;for(var g=0;g<n.length;g++)m[n[g]]=Object.create(null);this.invertedIndex[u]=m}null==this.invertedIndex[u][r][i]&&(this.invertedIndex[u][r][i]=Object.create(null));for(var f=0;f<this.metadataWhitelist.length;f++){var v=this.metadataWhitelist[f],b=u.metadata[v];null==this.invertedIndex[u][r][i][v]&&(this.invertedIndex[u][r][i][v]=[]),this.invertedIndex[u][r][i][v].push(b)}}}},I.Builder.prototype.calculateAverageFieldLengths=function(){for(var t=Object.keys(this.fieldLengths),e=t.length,i={},n={},o=0;o<e;o++){var r=I.FieldRef.fromString(t[o]),a=r.fieldName;n[a]||(n[a]=0),n[a]+=1,i[a]||(i[a]=0),i[a]+=this.fieldLengths[r]}var s=Object.keys(this._fields);for(o=0;o<s.length;o++){var l=s[o];i[l]=i[l]/n[l]}this.averageFieldLength=i},I.Builder.prototype.createFieldVectors=function(){for(var t={},e=Object.keys(this.fieldTermFrequencies),i=e.length,n=Object.create(null),o=0;o<i;o++){for(var r=I.FieldRef.fromString(e[o]),a=r.fieldName,s=this.fieldLengths[r],l=new I.Vector,d=this.fieldTermFrequencies[r],c=Object.keys(d),p=c.length,h=this._fields[a].boost||1,u=this._documents[r.docRef].boost||1,m=0;m<p;m++){var g,f,v,b=c[m],y=d[b],w=this.invertedIndex[b]._index;void 0===n[b]?(g=I.idf(this.invertedIndex[b],this.documentCount),n[b]=g):g=n[b],f=g*((this._k1+1)*y)/(this._k1*(1-this._b+this._b*(s/this.averageFieldLength[a]))+y),f*=h,f*=u,v=Math.round(1e3*f)/1e3,l.insert(w,v)}t[r]=l}this.fieldVectors=t},I.Builder.prototype.createTokenSet=function(){this.tokenSet=I.TokenSet.fromArray(Object.keys(this.invertedIndex).sort())},I.Builder.prototype.build=function(){return this.calculateAverageFieldLengths(),this.createFieldVectors(),this.createTokenSet(),new I.Index({invertedIndex:this.invertedIndex,fieldVectors:this.fieldVectors,tokenSet:this.tokenSet,fields:Object.keys(this._fields),pipeline:this.searchPipeline})},I.Builder.prototype.use=function(t){var e=Array.prototype.slice.call(arguments,1);e.unshift(this),t.apply(this,e)},I.MatchData=function(t,e,i){for(var n=Object.create(null),o=Object.keys(i||{}),r=0;r<o.length;r++){var a=o[r];n[a]=i[a].slice()}this.metadata=Object.create(null),void 0!==t&&(this.metadata[t]=Object.create(null),this.metadata[t][e]=n)},I.MatchData.prototype.combine=function(t){for(var e=Object.keys(t.metadata),i=0;i<e.length;i++){var n=e[i],o=Object.keys(t.metadata[n]);null==this.metadata[n]&&(this.metadata[n]=Object.create(null));for(var r=0;r<o.length;r++){var a=o[r],s=Object.keys(t.metadata[n][a]);null==this.metadata[n][a]&&(this.metadata[n][a]=Object.create(null));for(var l=0;l<s.length;l++){var d=s[l];null==this.metadata[n][a][d]?this.metadata[n][a][d]=t.metadata[n][a][d]:this.metadata[n][a][d]=this.metadata[n][a][d].concat(t.metadata[n][a][d])}}}},I.MatchData.prototype.add=function(t,e,i){if(!(t in this.metadata))return this.metadata[t]=Object.create(null),void(this.metadata[t][e]=i);if(e in this.metadata[t])for(var n=Object.keys(i),o=0;o<n.length;o++){var r=n[o];r in this.metadata[t][e]?this.metadata[t][e][r]=this.metadata[t][e][r].concat(i[r]):this.metadata[t][e][r]=i[r]}else this.metadata[t][e]=i},I.Query=function(t){this.clauses=[],this.allFields=t},I.Query.wildcard=new String("*"),I.Query.wildcard.NONE=0,I.Query.wildcard.LEADING=1,I.Query.wildcard.TRAILING=2,I.Query.presence={OPTIONAL:1,REQUIRED:2,PROHIBITED:3},I.Query.prototype.clause=function(t){return"fields"in t||(t.fields=this.allFields),"boost"in t||(t.boost=1),"usePipeline"in t||(t.usePipeline=!0),"wildcard"in t||(t.wildcard=I.Query.wildcard.NONE),t.wildcard&I.Query.wildcard.LEADING&&t.term.charAt(0)!=I.Query.wildcard&&(t.term="*"+t.term),t.wildcard&I.Query.wildcard.TRAILING&&t.term.slice(-1)!=I.Query.wildcard&&(t.term=t.term+"*"),"presence"in t||(t.presence=I.Query.presence.OPTIONAL),this.clauses.push(t),this},I.Query.prototype.isNegated=function(){for(var t=0;t<this.clauses.length;t++)if(this.clauses[t].presence!=I.Query.presence.PROHIBITED)return!1;return!0},I.Query.prototype.term=function(t,e){if(Array.isArray(t))return t.forEach(function(t){this.term(t,I.utils.clone(e))},this),this;var i=e||{};return i.term=t.toString(),this.clause(i),this},I.QueryParseError=function(t,e,i){this.name="QueryParseError",this.message=t,this.start=e,this.end=i},I.QueryParseError.prototype=new Error,I.QueryLexer=function(t){this.lexemes=[],this.str=t,this.length=t.length,this.pos=0,this.start=0,this.escapeCharPositions=[]},I.QueryLexer.prototype.run=function(){for(var t=I.QueryLexer.lexText;t;)t=t(this)},I.QueryLexer.prototype.sliceString=function(){for(var t=[],e=this.start,i=this.pos,n=0;n<this.escapeCharPositions.length;n++)i=this.escapeCharPositions[n],t.push(this.str.slice(e,i)),e=i+1;return t.push(this.str.slice(e,this.pos)),this.escapeCharPositions.length=0,t.join("")},I.QueryLexer.prototype.emit=function(t){this.lexemes.push({type:t,str:this.sliceString(),start:this.start,end:this.pos}),this.start=this.pos},I.QueryLexer.prototype.escapeCharacter=function(){this.escapeCharPositions.push(this.pos-1),this.pos+=1},I.QueryLexer.prototype.next=function(){if(this.pos>=this.length)return I.QueryLexer.EOS;var t=this.str.charAt(this.pos);return this.pos+=1,t},I.QueryLexer.prototype.width=function(){return this.pos-this.start},I.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},I.QueryLexer.prototype.backup=function(){this.pos-=1},I.QueryLexer.prototype.acceptDigitRun=function(){var t,e;do{e=(t=this.next()).charCodeAt(0)}while(e>47&&e<58);t!=I.QueryLexer.EOS&&this.backup()},I.QueryLexer.prototype.more=function(){return this.pos<this.length},I.QueryLexer.EOS="EOS",I.QueryLexer.FIELD="FIELD",I.QueryLexer.TERM="TERM",I.QueryLexer.EDIT_DISTANCE="EDIT_DISTANCE",I.QueryLexer.BOOST="BOOST",I.QueryLexer.PRESENCE="PRESENCE",I.QueryLexer.lexField=function(t){return t.backup(),t.emit(I.QueryLexer.FIELD),t.ignore(),I.QueryLexer.lexText},I.QueryLexer.lexTerm=function(t){if(t.width()>1&&(t.backup(),t.emit(I.QueryLexer.TERM)),t.ignore(),t.more())return I.QueryLexer.lexText},I.QueryLexer.lexEditDistance=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(I.QueryLexer.EDIT_DISTANCE),I.QueryLexer.lexText},I.QueryLexer.lexBoost=function(t){return t.ignore(),t.acceptDigitRun(),t.emit(I.QueryLexer.BOOST),I.QueryLexer.lexText},I.QueryLexer.lexEOS=function(t){t.width()>0&&t.emit(I.QueryLexer.TERM)},I.QueryLexer.termSeparator=I.tokenizer.separator,I.QueryLexer.lexText=function(t){for(;;){var e=t.next();if(e==I.QueryLexer.EOS)return I.QueryLexer.lexEOS;if(92!=e.charCodeAt(0)){if(":"==e)return I.QueryLexer.lexField;if("~"==e)return t.backup(),t.width()>0&&t.emit(I.QueryLexer.TERM),I.QueryLexer.lexEditDistance;if("^"==e)return t.backup(),t.width()>0&&t.emit(I.QueryLexer.TERM),I.QueryLexer.lexBoost;if("+"==e&&1===t.width())return t.emit(I.QueryLexer.PRESENCE),I.QueryLexer.lexText;if("-"==e&&1===t.width())return t.emit(I.QueryLexer.PRESENCE),I.QueryLexer.lexText;if(e.match(I.QueryLexer.termSeparator))return I.QueryLexer.lexTerm}else t.escapeCharacter()}},I.QueryParser=function(t,e){this.lexer=new I.QueryLexer(t),this.query=e,this.currentClause={},this.lexemeIdx=0},I.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var t=I.QueryParser.parseClause;t;)t=t(this);return this.query},I.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},I.QueryParser.prototype.consumeLexeme=function(){var t=this.peekLexeme();return this.lexemeIdx+=1,t},I.QueryParser.prototype.nextClause=function(){var t=this.currentClause;this.query.clause(t),this.currentClause={}},I.QueryParser.parseClause=function(t){var e=t.peekLexeme();if(null!=e)switch(e.type){case I.QueryLexer.PRESENCE:return I.QueryParser.parsePresence;case I.QueryLexer.FIELD:return I.QueryParser.parseField;case I.QueryLexer.TERM:return I.QueryParser.parseTerm;default:var i="expected either a field or a term, found "+e.type;throw e.str.length>=1&&(i+=" with value '"+e.str+"'"),new I.QueryParseError(i,e.start,e.end)}},I.QueryParser.parsePresence=function(t){var e=t.consumeLexeme();if(null!=e){switch(e.str){case"-":t.currentClause.presence=I.Query.presence.PROHIBITED;break;case"+":t.currentClause.presence=I.Query.presence.REQUIRED;break;default:var i="unrecognised presence operator'"+e.str+"'";throw new I.QueryParseError(i,e.start,e.end)}var n=t.peekLexeme();if(null==n){i="expecting term or field, found nothing";throw new I.QueryParseError(i,e.start,e.end)}switch(n.type){case I.QueryLexer.FIELD:return I.QueryParser.parseField;case I.QueryLexer.TERM:return I.QueryParser.parseTerm;default:i="expecting term or field, found '"+n.type+"'";throw new I.QueryParseError(i,n.start,n.end)}}},I.QueryParser.parseField=function(t){var e=t.consumeLexeme();if(null!=e){if(-1==t.query.allFields.indexOf(e.str)){var i=t.query.allFields.map(function(t){return"'"+t+"'"}).join(", "),n="unrecognised field '"+e.str+"', possible fields: "+i;throw new I.QueryParseError(n,e.start,e.end)}t.currentClause.fields=[e.str];var o=t.peekLexeme();if(null==o){n="expecting term, found nothing";throw new I.QueryParseError(n,e.start,e.end)}if(o.type===I.QueryLexer.TERM)return I.QueryParser.parseTerm;n="expecting term, found '"+o.type+"'";throw new I.QueryParseError(n,o.start,o.end)}},I.QueryParser.parseTerm=function(t){var e=t.consumeLexeme();if(null!=e){t.currentClause.term=e.str.toLowerCase(),-1!=e.str.indexOf("*")&&(t.currentClause.usePipeline=!1);var i=t.peekLexeme();if(null!=i)switch(i.type){case I.QueryLexer.TERM:return t.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return t.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;case I.QueryLexer.PRESENCE:return t.nextClause(),I.QueryParser.parsePresence;default:var n="Unexpected lexeme type '"+i.type+"'";throw new I.QueryParseError(n,i.start,i.end)}else t.nextClause()}},I.QueryParser.parseEditDistance=function(t){var e=t.consumeLexeme();if(null!=e){var i=parseInt(e.str,10);if(isNaN(i)){var n="edit distance must be numeric";throw new I.QueryParseError(n,e.start,e.end)}t.currentClause.editDistance=i;var o=t.peekLexeme();if(null!=o)switch(o.type){case I.QueryLexer.TERM:return t.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return t.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;case I.QueryLexer.PRESENCE:return t.nextClause(),I.QueryParser.parsePresence;default:n="Unexpected lexeme type '"+o.type+"'";throw new I.QueryParseError(n,o.start,o.end)}else t.nextClause()}},I.QueryParser.parseBoost=function(t){var e=t.consumeLexeme();if(null!=e){var i=parseInt(e.str,10);if(isNaN(i)){var n="boost must be numeric";throw new I.QueryParseError(n,e.start,e.end)}t.currentClause.boost=i;var o=t.peekLexeme();if(null!=o)switch(o.type){case I.QueryLexer.TERM:return t.nextClause(),I.QueryParser.parseTerm;case I.QueryLexer.FIELD:return t.nextClause(),I.QueryParser.parseField;case I.QueryLexer.EDIT_DISTANCE:return I.QueryParser.parseEditDistance;case I.QueryLexer.BOOST:return I.QueryParser.parseBoost;case I.QueryLexer.PRESENCE:return t.nextClause(),I.QueryParser.parsePresence;default:n="Unexpected lexeme type '"+o.type+"'";throw new I.QueryParseError(n,o.start,o.end)}else t.nextClause()}},k=this,F=function(){return I},"object"==typeof i?e.exports=F():k.lunr=F()}()},{}],33:[function(t,e,i){e.exports=Math.abs},{}],34:[function(t,e,i){e.exports=Math.floor},{}],35:[function(t,e,i){e.exports=Number.isNaN||function(t){return t!=t}},{}],36:[function(t,e,i){e.exports=Math.max},{}],37:[function(t,e,i){e.exports=Math.min},{}],38:[function(t,e,i){e.exports=Math.pow},{}],39:[function(t,e,i){e.exports=Math.round},{}],40:[function(t,e,i){var n=t("./isNaN");e.exports=function(t){return n(t)||0===t?t:t<0?-1:1}},{"./isNaN":35}],41:[function(t,e,i){(function(i){(function(){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,d=s&&l&&"function"==typeof l.get?l.get:null,c=s&&Set.prototype.forEach,p="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,u="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,m=Boolean.prototype.valueOf,g=Object.prototype.toString,f=Function.prototype.toString,v=String.prototype.match,b=String.prototype.slice,y=String.prototype.replace,w=String.prototype.toUpperCase,C=String.prototype.toLowerCase,x=RegExp.prototype.test,R=Array.prototype.concat,_=Array.prototype.join,D=Array.prototype.slice,E=Math.floor,A="function"==typeof BigInt?BigInt.prototype.valueOf:null,S=Object.getOwnPropertySymbols,T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,P="function"==typeof Symbol&&"object"==typeof Symbol.iterator,k="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===P||"symbol")?Symbol.toStringTag:null,F=Object.prototype.propertyIsEnumerable,I=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function L(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||x.call(/e/,e))return e;var i=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-E(-t):E(t);if(n!==t){var o=String(n),r=b.call(e,o.length+1);return y.call(o,i,"$&_")+"."+y.call(y.call(r,/([0-9]{3})/g,"$&_"),/_$/,"")}}return y.call(e,i,"$&_")}var M=t("./util.inspect"),B=M.custom,H=W(B)?B:null,V={__proto__:null,double:'"',single:"'"},O={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function N(t,e,i){var n=i.quoteStyle||e,o=V[n];return o+t+o}function z(t){return y.call(String(t),/"/g,""")}function j(t){return!k||!("object"==typeof t&&(k in t||void 0!==t[k]))}function U(t){return"[object Array]"===X(t)&&j(t)}function $(t){return"[object RegExp]"===X(t)&&j(t)}function W(t){if(P)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!T)return!1;try{return T.call(t),!0}catch(t){}return!1}e.exports=function t(e,n,o,s){var l=n||{};if(q(l,"quoteStyle")&&!q(V,l.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(q(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var g=!q(l,"customInspect")||l.customInspect;if("boolean"!=typeof g&&"symbol"!==g)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(q(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(q(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=l.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return Q(e,l);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var x=String(e);return w?L(e,x):x}if("bigint"==typeof e){var E=String(e)+"n";return w?L(e,E):E}var S=void 0===l.depth?5:l.depth;if(void 0===o&&(o=0),o>=S&&S>0&&"object"==typeof e)return U(e)?"[Array]":"[Object]";var B=function(t,e){var i;if("\t"===t.indent)i="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;i=_.call(Array(t.indent+1)," ")}return{base:i,prev:_.call(Array(e+1),i)}}(l,o);if(void 0===s)s=[];else if(K(s,e)>=0)return"[Circular]";function O(e,i,n){if(i&&(s=D.call(s)).push(i),n){var r={depth:l.depth};return q(l,"quoteStyle")&&(r.quoteStyle=l.quoteStyle),t(e,r,o+1,s)}return t(e,l,o+1,s)}if("function"==typeof e&&!$(e)){var G=function(t){if(t.name)return t.name;var e=v.call(f.call(t),/^function\s*([\w$]+)/);if(e)return e[1];return null}(e),J=it(e,O);return"[Function"+(G?": "+G:" (anonymous)")+"]"+(J.length>0?" { "+_.call(J,", ")+" }":"")}if(W(e)){var nt=P?y.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):T.call(e);return"object"!=typeof e||P?nt:Z(nt)}if(function(t){if(!t||"object"!=typeof t)return!1;if("undefined"!=typeof HTMLElement&&t instanceof HTMLElement)return!0;return"string"==typeof t.nodeName&&"function"==typeof t.getAttribute}(e)){for(var ot="<"+C.call(String(e.nodeName)),rt=e.attributes||[],at=0;at<rt.length;at++)ot+=" "+rt[at].name+"="+N(z(rt[at].value),"double",l);return ot+=">",e.childNodes&&e.childNodes.length&&(ot+="..."),ot+="</"+C.call(String(e.nodeName))+">"}if(U(e)){if(0===e.length)return"[]";var st=it(e,O);return B&&!function(t){for(var e=0;e<t.length;e++)if(K(t[e],"\n")>=0)return!1;return!0}(st)?"["+et(st,B)+"]":"[ "+_.call(st,", ")+" ]"}if(function(t){return"[object Error]"===X(t)&&j(t)}(e)){var lt=it(e,O);return"cause"in Error.prototype||!("cause"in e)||F.call(e,"cause")?0===lt.length?"["+String(e)+"]":"{ ["+String(e)+"] "+_.call(lt,", ")+" }":"{ ["+String(e)+"] "+_.call(R.call("[cause]: "+O(e.cause),lt),", ")+" }"}if("object"==typeof e&&g){if(H&&"function"==typeof e[H]&&M)return M(e,{depth:S-o});if("symbol"!==g&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!r||!t||"object"!=typeof t)return!1;try{r.call(t);try{d.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var dt=[];return a&&a.call(e,function(t,i){dt.push(O(i,e,!0)+" => "+O(t,e))}),tt("Map",r.call(e),dt,B)}if(function(t){if(!d||!t||"object"!=typeof t)return!1;try{d.call(t);try{r.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ct=[];return c&&c.call(e,function(t){ct.push(O(t,e))}),tt("Set",d.call(e),ct,B)}if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{p.call(t,p);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return Y("WeakMap");if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t,h);try{p.call(t,p)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return Y("WeakSet");if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{return u.call(t),!0}catch(t){}return!1}(e))return Y("WeakRef");if(function(t){return"[object Number]"===X(t)&&j(t)}(e))return Z(O(Number(e)));if(function(t){if(!t||"object"!=typeof t||!A)return!1;try{return A.call(t),!0}catch(t){}return!1}(e))return Z(O(A.call(e)));if(function(t){return"[object Boolean]"===X(t)&&j(t)}(e))return Z(m.call(e));if(function(t){return"[object String]"===X(t)&&j(t)}(e))return Z(O(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||void 0!==i&&e===i)return"{ [object globalThis] }";if(!function(t){return"[object Date]"===X(t)&&j(t)}(e)&&!$(e)){var pt=it(e,O),ht=I?I(e)===Object.prototype:e instanceof Object||e.constructor===Object,ut=e instanceof Object?"":"null prototype",mt=!ht&&k&&Object(e)===e&&k in e?b.call(X(e),8,-1):ut?"Object":"",gt=(ht||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(mt||ut?"["+_.call(R.call([],mt||[],ut||[]),": ")+"] ":"");return 0===pt.length?gt+"{}":B?gt+"{"+et(pt,B)+"}":gt+"{ "+_.call(pt,", ")+" }"}return String(e)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function q(t,e){return G.call(t,e)}function X(t){return g.call(t)}function K(t,e){if(t.indexOf)return t.indexOf(e);for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1}function Q(t,e){if(t.length>e.maxStringLength){var i=t.length-e.maxStringLength,n="... "+i+" more character"+(i>1?"s":"");return Q(b.call(t,0,e.maxStringLength),e)+n}var o=O[e.quoteStyle||"single"];return o.lastIndex=0,N(y.call(y.call(t,o,"\\$1"),/[\x00-\x1f]/g,J),"single",e)}function J(t){var e=t.charCodeAt(0),i={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return i?"\\"+i:"\\x"+(e<16?"0":"")+w.call(e.toString(16))}function Z(t){return"Object("+t+")"}function Y(t){return t+" { ? }"}function tt(t,e,i,n){return t+" ("+e+") {"+(n?et(i,n):_.call(i,", "))+"}"}function et(t,e){if(0===t.length)return"";var i="\n"+e.prev+e.base;return i+_.call(t,","+i)+"\n"+e.prev}function it(t,e){var i=U(t),n=[];if(i){n.length=t.length;for(var o=0;o<t.length;o++)n[o]=q(t,o)?e(t[o],t):""}var r,a="function"==typeof S?S(t):[];if(P){r={};for(var s=0;s<a.length;s++)r["$"+a[s]]=a[s]}for(var l in t)q(t,l)&&(i&&String(Number(l))===l&&l<t.length||P&&r["$"+l]instanceof Symbol||(x.call(/[^\w$]/,l)?n.push(e(l,t)+": "+e(t[l],t)):n.push(l+": "+e(t[l],t))));if("function"==typeof S)for(var d=0;d<a.length;d++)F.call(t,a[d])&&n.push("["+e(a[d])+"]: "+e(t[a[d]],t));return n}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./util.inspect":1}],42:[function(t,e,i){(function(t){(function(){function i(t){if("string"!=typeof t)throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function n(t,e){for(var i,n="",o=0,r=-1,a=0,s=0;s<=t.length;++s){if(s<t.length)i=t.charCodeAt(s);else{if(47===i)break;i=47}if(47===i){if(r===s-1||1===a);else if(r!==s-1&&2===a){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",o=0):o=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),r=s,a=0;continue}}else if(2===n.length||1===n.length){n="",o=0,r=s,a=0;continue}e&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+t.slice(r+1,s):n=t.slice(r+1,s),o=s-r-1;r=s,a=0}else 46===i&&-1!==a?++a:a=-1}return n}var o={resolve:function(){for(var e,o="",r=!1,a=arguments.length-1;a>=-1&&!r;a--){var s;a>=0?s=arguments[a]:(void 0===e&&(e=t.cwd()),s=e),i(s),0!==s.length&&(o=s+"/"+o,r=47===s.charCodeAt(0))}return o=n(o,!r),r?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(t){if(i(t),0===t.length)return".";var e=47===t.charCodeAt(0),o=47===t.charCodeAt(t.length-1);return 0!==(t=n(t,!e)).length||e||(t="."),t.length>0&&o&&(t+="/"),e?"/"+t:t},isAbsolute:function(t){return i(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,e=0;e<arguments.length;++e){var n=arguments[e];i(n),n.length>0&&(void 0===t?t=n:t+="/"+n)}return void 0===t?".":o.normalize(t)},relative:function(t,e){if(i(t),i(e),t===e)return"";if((t=o.resolve(t))===(e=o.resolve(e)))return"";for(var n=1;n<t.length&&47===t.charCodeAt(n);++n);for(var r=t.length,a=r-n,s=1;s<e.length&&47===e.charCodeAt(s);++s);for(var l=e.length-s,d=a<l?a:l,c=-1,p=0;p<=d;++p){if(p===d){if(l>d){if(47===e.charCodeAt(s+p))return e.slice(s+p+1);if(0===p)return e.slice(s+p)}else a>d&&(47===t.charCodeAt(n+p)?c=p:0===p&&(c=0));break}var h=t.charCodeAt(n+p);if(h!==e.charCodeAt(s+p))break;47===h&&(c=p)}var u="";for(p=n+c+1;p<=r;++p)p!==r&&47!==t.charCodeAt(p)||(0===u.length?u+="..":u+="/..");return u.length>0?u+e.slice(s+c):(s+=c,47===e.charCodeAt(s)&&++s,e.slice(s))},_makeLong:function(t){return t},dirname:function(t){if(i(t),0===t.length)return".";for(var e=t.charCodeAt(0),n=47===e,o=-1,r=!0,a=t.length-1;a>=1;--a)if(47===(e=t.charCodeAt(a))){if(!r){o=a;break}}else r=!1;return-1===o?n?"/":".":n&&1===o?"//":t.slice(0,o)},basename:function(t,e){if(void 0!==e&&"string"!=typeof e)throw new TypeError('"ext" argument must be a string');i(t);var n,o=0,r=-1,a=!0;if(void 0!==e&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";var s=e.length-1,l=-1;for(n=t.length-1;n>=0;--n){var d=t.charCodeAt(n);if(47===d){if(!a){o=n+1;break}}else-1===l&&(a=!1,l=n+1),s>=0&&(d===e.charCodeAt(s)?-1===--s&&(r=n):(s=-1,r=l))}return o===r?r=l:-1===r&&(r=t.length),t.slice(o,r)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!a){o=n+1;break}}else-1===r&&(a=!1,r=n+1);return-1===r?"":t.slice(o,r)},extname:function(t){i(t);for(var e=-1,n=0,o=-1,r=!0,a=0,s=t.length-1;s>=0;--s){var l=t.charCodeAt(s);if(47!==l)-1===o&&(r=!1,o=s+1),46===l?-1===e?e=s:1!==a&&(a=1):-1!==e&&(a=-1);else if(!r){n=s+1;break}}return-1===e||-1===o||0===a||1===a&&e===o-1&&e===n+1?"":t.slice(e,o)},format:function(t){if(null===t||"object"!=typeof t)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return function(t,e){var i=e.dir||e.root,n=e.base||(e.name||"")+(e.ext||"");return i?i===e.root?i+n:i+t+n:n}("/",t)},parse:function(t){i(t);var e={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return e;var n,o=t.charCodeAt(0),r=47===o;r?(e.root="/",n=1):n=0;for(var a=-1,s=0,l=-1,d=!0,c=t.length-1,p=0;c>=n;--c)if(47!==(o=t.charCodeAt(c)))-1===l&&(d=!1,l=c+1),46===o?-1===a?a=c:1!==p&&(p=1):-1!==a&&(p=-1);else if(!d){s=c+1;break}return-1===a||-1===l||0===p||1===p&&a===l-1&&a===s+1?-1!==l&&(e.base=e.name=0===s&&r?t.slice(1,l):t.slice(s,l)):(0===s&&r?(e.name=t.slice(1,a),e.base=t.slice(1,l)):(e.name=t.slice(s,a),e.base=t.slice(s,l)),e.ext=t.slice(a,l)),s>0?e.dir=t.slice(0,s-1):r&&(e.dir="/"),e},sep:"/",delimiter:":",win32:null,posix:null};o.posix=o,e.exports=o}).call(this)}).call(this,t("_process"))},{_process:103}],43:[function(t,e,i){e.exports={name:"pict-application",version:"1.0.33",description:"Application base class for a pict view-based application",main:"source/Pict-Application.js",scripts:{test:"npx quack test",start:"node source/Pict-Application.js",coverage:"npx quack coverage",build:"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-application-image:local","docker-dev-run":'docker run -it -d --name pict-application-dev -p 30001:8080 -p 38086:8086 -v "$PWD/.config:/home/coder/.config" -v "$PWD:/home/coder/pict-application" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" pict-application-image:local',"docker-dev-shell":"docker exec -it pict-application-dev /bin/bash",tests:"npx quack test -g",lint:"eslint source/**",types:"tsc -p ."},types:"types/source/Pict-Application.d.ts",repository:{type:"git",url:"git+https://github.com/stevenvelozo/pict-application.git"},author:"steven velozo <steven@velozo.com>",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/pict-application/issues"},homepage:"https://github.com/stevenvelozo/pict-application#readme",devDependencies:{"@eslint/js":"^9.28.0","browser-env":"^3.3.0",eslint:"^9.28.0",pict:"^1.0.348","pict-provider":"^1.0.10","pict-view":"^1.0.66",quackage:"^1.0.58",typescript:"^5.9.3"},mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},dependencies:{"fable-serviceproviderbase":"^3.0.19"}}},{}],44:[function(t,e,i){const n=t("fable-serviceproviderbase"),o=t("../package.json"),r={Name:"DefaultPictApplication",MainViewportViewIdentifier:"Default-View",MainViewportRenderableHash:!1,MainViewportDestinationAddress:!1,MainViewportDefaultDataAddress:!1,AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!0,AutoRenderViewsAfterInitialize:!1,AutoLoginAfterInitialize:!1,AutoLoadDataAfterLogin:!1,ConfigurationOnlyViews:[],Manifests:{},IdentifierAddressPrefix:"PICT-"};e.exports=class extends n{constructor(t,e,i){let n="object"==typeof t.settings.PictApplicationConfiguration?t.settings.PictApplicationConfiguration:{};super(t,Object.assign({},JSON.parse(JSON.stringify(r)),n,e),i),this.options,this.log,this.fable,this.UUID,this.Hash,this.servicesMap,this.serviceType="PictApplication",this._Package=o,this.pict=this.fable,this.AppData=this.fable.AppData,this.Bundle=this.fable.Bundle,this.initializeTimestamp,this.lastSolvedTimestamp,this.lastLoginTimestamp,this.lastMarshalFromViewsTimestamp,this.lastMarshalToViewsTimestamp,this.lastAutoRenderTimestamp,this.lastLoadDataTimestamp;let a=Object.keys(this.options.Manifests);if(a.length>0)for(let t=0;t<a.length;t++){let e=a[t];this.fable.instantiateServiceProvider("Manifest",this.options.Manifests[e],e)}}onPreSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onPreSolve:`),!0}onPreSolveAsync(t){return this.onPreSolve(),t()}onBeforeSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeSolve:`),!0}onBeforeSolveAsync(t){return this.onBeforeSolve(),t()}onSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onSolve:`),!0}onSolveAsync(t){return this.onSolve(),t()}solve(){this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} executing solve() function...`);let t=Object.keys(this.pict.providers),e=[];for(let i=0;i<t.length;i++){let n=this.pict.providers[t[i]];n.options.AutoSolveWithApp&&e.push(n)}e.sort((t,e)=>t.options.AutoSolveOrdinal-e.options.AutoSolveOrdinal);for(let t=0;t<e.length;t++)e[t].solve(e[t]);this.onBeforeSolve();let i=Object.keys(this.pict.views),n=[];for(let t=0;t<i.length;t++){let e=this.pict.views[i[t]];e.options.AutoInitialize&&n.push(e)}n.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let t=0;t<n.length;t++)n[t].solve();return this.onSolve(),this.onAfterSolve(),this.lastSolvedTimestamp=this.fable.log.getTimeStamp(),!0}solveAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");e.anticipate(this.onBeforeSolveAsync.bind(this));let i="function"==typeof t&&t;i||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync Auto Callback Error: ${t}`,t)});let n=Object.keys(this.pict.providers),o=[];for(let t=0;t<n.length;t++){let e=this.pict.providers[n[t]];e.options.AutoSolveWithApp&&o.push(e)}o.sort((t,e)=>t.options.AutoSolveOrdinal-e.options.AutoSolveOrdinal);for(let t=0;t<o.length;t++)e.anticipate(o[t].solveAsync.bind(o[t]));let r=Object.keys(this.pict.views),a=[];for(let t=0;t<r.length;t++){let e=this.pict.views[r[t]];e.options.AutoSolveWithApp&&a.push(e)}a.sort((t,e)=>t.options.AutoSolveOrdinal-e.options.AutoSolveOrdinal);for(let t=0;t<a.length;t++)e.anticipate(a[t].solveAsync.bind(a[t]));e.anticipate(this.onSolveAsync.bind(this)),e.anticipate(this.onAfterSolveAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync() complete.`),this.lastSolvedTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterSolve:`),!0}onAfterSolveAsync(t){return this.onAfterSolve(),t()}onBeforeLoginAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeLoginAsync:`),t()}onLoginAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onLoginAsync:`),t()}loginAsync(t){const e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");let i=t;"function"!=typeof i&&(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loginAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loginAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeLoginAsync.bind(this)),e.anticipate(this.onLoginAsync.bind(this)),e.anticipate(this.onAfterLoginAsync.bind(this)),this.options.AutoLoadDataAfterLogin&&e.anticipate(t=>{if(!this.isLoggedIn())return t();this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto loading data after login...`),this.loadDataAsync(e=>{t(e)})}),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loginAsync() complete.`),this.lastLoginTimestamp=this.fable.log.getTimeStamp(),i(t)))}isLoggedIn(){return!0}onAfterLoginAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterLoginAsync:`),t()}onBeforeLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeLoadDataAsync:`),t()}onLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onLoadDataAsync:`),t()}loadDataAsync(t){const e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");let i=t;"function"!=typeof i&&(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loadDataAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loadDataAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeLoadDataAsync.bind(this));let n=Object.keys(this.pict.providers),o=[];for(let t=0;t<n.length;t++){let e=this.pict.providers[n[t]];e.options.AutoLoadDataWithApp&&o.push(e)}o.sort((t,e)=>t.options.AutoLoadDataOrdinal-e.options.AutoLoadDataOrdinal);for(const t of o)e.anticipate(t.onBeforeLoadDataAsync.bind(t));e.anticipate(this.onLoadDataAsync.bind(this));for(const t of o)e.anticipate(t.onLoadDataAsync.bind(t));e.anticipate(this.onAfterLoadDataAsync.bind(this));for(const t of o)e.anticipate(t.onAfterLoadDataAsync.bind(t));e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} loadDataAsync() complete.`),this.lastLoadDataTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterLoadDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterLoadDataAsync:`),t()}onBeforeSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeSaveDataAsync:`),t()}onSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onSaveDataAsync:`),t()}saveDataAsync(t){const e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");let i=t;"function"!=typeof i&&(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} saveDataAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} saveDataAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeSaveDataAsync.bind(this));let n=Object.keys(this.pict.providers),o=[];for(let t=0;t<n.length;t++){let e=this.pict.providers[n[t]];e.options.AutoSaveDataWithApp&&o.push(e)}o.sort((t,e)=>t.options.AutoSaveDataOrdinal-e.options.AutoSaveDataOrdinal);for(const t of o)e.anticipate(t.onBeforeSaveDataAsync.bind(t));e.anticipate(this.onSaveDataAsync.bind(this));for(const t of o)e.anticipate(t.onSaveDataAsync.bind(t));e.anticipate(this.onAfterSaveDataAsync.bind(this));for(const t of o)e.anticipate(t.onAfterSaveDataAsync.bind(t));e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} saveDataAsync() complete.`),this.lastSaveDataTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterSaveDataAsync(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterSaveDataAsync:`),t()}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeInitialize:`),!0}onBeforeInitializeAsync(t){return this.onBeforeInitialize(),t()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onInitialize:`),!0}onInitializeAsync(t){return this.onInitialize(),t()}initialize(){if(this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} initialize:`),this.initializeTimestamp)return this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initialize called but initialization is already completed. Aborting.`),!1;{if(this.onBeforeInitialize(),"ConfigurationOnlyViews"in this.options)for(let t=0;t<this.options.ConfigurationOnlyViews.length;t++){let e=void 0===this.options.ConfigurationOnlyViews[t].ViewIdentifier?`AutoView-${this.fable.getUUID()}`:this.options.ConfigurationOnlyViews[t].ViewIdentifier;this.log.info(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} adding configuration only view: ${e}`),this.pict.addView(e,this.options.ConfigurationOnlyViews[t])}this.onInitialize();let t=Object.keys(this.pict.providers),e=[];for(let i=0;i<t.length;i++){let n=this.pict.providers[t[i]];n.options.AutoInitialize&&e.push(n)}e.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let t=0;t<e.length;t++)e[t].initialize();let i=Object.keys(this.pict.views),n=[];for(let t=0;t<i.length;t++){let e=this.pict.views[i[t]];e.options.AutoInitialize&&n.push(e)}n.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let t=0;t<n.length;t++)n[t].initialize();return this.onAfterInitialize(),this.options.AutoSolveAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto solving after initialization...`),this.solve()),this.options.AutoRenderMainViewportViewAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto rendering after initialization...`),this.render()),this.initializeTimestamp=this.fable.log.getTimeStamp(),this.onCompletionOfInitialize(),!0}}initializeAsync(t){this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync:`);let e="function"==typeof t&&t;if(e||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),e=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync Auto Callback Error: ${t}`,t)}),this.initializeTimestamp)return this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} async initialize called but initialization is already completed. Aborting.`),this.onCompletionOfInitializeAsync(e);{let t=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate");if(this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} beginning initialization...`),"ConfigurationOnlyViews"in this.options)for(let t=0;t<this.options.ConfigurationOnlyViews.length;t++){let e=void 0===this.options.ConfigurationOnlyViews[t].ViewIdentifier?`AutoView-${this.fable.getUUID()}`:this.options.ConfigurationOnlyViews[t].ViewIdentifier;this.log.info(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} adding configuration only view: ${e}`),this.pict.addView(e,this.options.ConfigurationOnlyViews[t])}t.anticipate(this.onBeforeInitializeAsync.bind(this)),t.anticipate(this.onInitializeAsync.bind(this));let i=Object.keys(this.pict.providers),n=[];for(let t=0;t<i.length;t++){let e=this.pict.providers[i[t]];e.options.AutoInitialize&&n.push(e)}n.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let e=0;e<n.length;e++)t.anticipate(n[e].initializeAsync.bind(n[e]));let o=Object.keys(this.pict.views),r=[];for(let t=0;t<o.length;t++){let e=this.pict.views[o[t]];e.options.AutoInitialize&&r.push(e)}r.sort((t,e)=>t.options.AutoInitializeOrdinal-e.options.AutoInitializeOrdinal);for(let e=0;e<r.length;e++){let i=r[e];t.anticipate(i.initializeAsync.bind(i))}t.anticipate(this.onAfterInitializeAsync.bind(this)),this.options.AutoLoginAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto login (asynchronously) after initialization...`),t.anticipate(this.loginAsync.bind(this))),this.options.AutoSolveAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto solving (asynchronously) after initialization...`),t.anticipate(this.solveAsync.bind(this))),this.options.AutoRenderMainViewportViewAfterInitialize&&(this.pict.LogNoisiness>1&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} auto rendering (asynchronously) after initialization...`),t.anticipate(this.renderMainViewportAsync.bind(this))),t.wait(t=>(t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initializeAsync Error: ${t.message||t}`,{stack:t.stack}),this.initializeTimestamp=this.fable.log.getTimeStamp(),this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} initialization complete.`),e()))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterInitialize:`),!0}onAfterInitializeAsync(t){return this.onAfterInitialize(),t()}onCompletionOfInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onCompletionOfInitialize:`),!0}onCompletionOfInitializeAsync(t){return this.onCompletionOfInitialize(),t()}onBeforeMarshalFromViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeMarshalFromViews:`),!0}onBeforeMarshalFromViewsAsync(t){return this.onBeforeMarshalFromViews(),t()}onMarshalFromViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onMarshalFromViews:`),!0}onMarshalFromViewsAsync(t){return this.onMarshalFromViews(),t()}marshalFromViews(){this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} executing marshalFromViews() function...`),this.onBeforeMarshalFromViews();let t=Object.keys(this.pict.views),e=[];for(let i=0;i<t.length;i++){let n=this.pict.views[t[i]];e.push(n)}for(let t=0;t<e.length;t++)e[t].marshalFromView();return this.onMarshalFromViews(),this.onAfterMarshalFromViews(),this.lastMarshalFromViewsTimestamp=this.fable.log.getTimeStamp(),!0}marshalFromViewsAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t&&t;i||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewsAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeMarshalFromViewsAsync.bind(this));let n=Object.keys(this.pict.views),o=[];for(let t=0;t<n.length;t++){let e=this.pict.views[n[t]];o.push(e)}for(let t=0;t<o.length;t++)e.anticipate(o[t].marshalFromViewAsync.bind(o[t]));e.anticipate(this.onMarshalFromViewsAsync.bind(this)),e.anticipate(this.onAfterMarshalFromViewsAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewsAsync() complete.`),this.lastMarshalFromViewsTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterMarshalFromViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterMarshalFromViews:`),!0}onAfterMarshalFromViewsAsync(t){return this.onAfterMarshalFromViews(),t()}onBeforeMarshalToViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeMarshalToViews:`),!0}onBeforeMarshalToViewsAsync(t){return this.onBeforeMarshalToViews(),t()}onMarshalToViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onMarshalToViews:`),!0}onMarshalToViewsAsync(t){return this.onMarshalToViews(),t()}marshalToViews(){this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} executing marshalToViews() function...`),this.onBeforeMarshalToViews();let t=Object.keys(this.pict.views),e=[];for(let i=0;i<t.length;i++){let n=this.pict.views[t[i]];e.push(n)}for(let t=0;t<e.length;t++)e[t].marshalToView();return this.onMarshalToViews(),this.onAfterMarshalToViews(),this.lastMarshalToViewsTimestamp=this.fable.log.getTimeStamp(),!0}marshalToViewsAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t&&t;i||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewsAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeMarshalToViewsAsync.bind(this));let n=Object.keys(this.pict.views),o=[];for(let t=0;t<n.length;t++){let e=this.pict.views[n[t]];o.push(e)}for(let t=0;t<o.length;t++)e.anticipate(o[t].marshalToViewAsync.bind(o[t]));e.anticipate(this.onMarshalToViewsAsync.bind(this)),e.anticipate(this.onAfterMarshalToViewsAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewsAsync() complete.`),this.lastMarshalToViewsTimestamp=this.fable.log.getTimeStamp(),i(t)))}onAfterMarshalToViews(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterMarshalToViews:`),!0}onAfterMarshalToViewsAsync(t){return this.onAfterMarshalToViews(),t()}onBeforeRender(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onBeforeRender:`),!0}onBeforeRenderAsync(t){return this.onBeforeRender(),t()}render(t,e,i,n){let o="string"!=typeof t?this.options.MainViewportViewIdentifier:t,r="string"!=typeof e?this.options.MainViewportRenderableHash:e,a="string"!=typeof i?this.options.MainViewportDestinationAddress:i,s="string"!=typeof n?this.options.MainViewportDefaultDataAddress:n;this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} VIEW Renderable[${r}] Destination[${a}] TemplateDataAddress[${s}] render:`),this.onBeforeRender();let l="string"==typeof o&&this.servicesMap.PictView[o];return l?(this.onRender(),l.render(r,a,s),this.onAfterRender(),!0):(this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} could not render from View ${o} because it is not a valid view.`),!1)}onRender(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onRender:`),!0}onRenderAsync(t){return this.onRender(),t()}renderAsync(t,e,i,n,o){let r="string"!=typeof t?this.options.MainViewportViewIdentifier:t,a="string"!=typeof e?this.options.MainViewportRenderableHash:e,s="string"!=typeof i?this.options.MainViewportDestinationAddress:i,l="string"!=typeof n?this.options.MainViewportDefaultDataAddress:n,d="function"==typeof o?o:"function"==typeof n?n:"function"==typeof i?i:"function"==typeof e?e:"function"==typeof t&&t;d||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),d=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAsync Auto Callback Error: ${t}`,t)}),this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} VIEW Renderable[${a}] Destination[${s}] TemplateDataAddress[${l}] renderAsync:`);let c=this.fable.newAnticipate();c.anticipate(this.onBeforeRenderAsync.bind(this));let p="string"==typeof r&&this.servicesMap.PictView[r];if(!p){let t=`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} could not asynchronously render from View ${r} because it is not a valid view.`;return this.pict.LogNoisiness>3&&this.log.error(t),d(new Error(t))}return c.anticipate(this.onRenderAsync.bind(this)),c.anticipate(t=>{p.renderAsync.call(p,a,s,l,t)}),c.anticipate(this.onAfterRenderAsync.bind(this)),c.wait(d)}onAfterRender(){return this.pict.LogNoisiness>3&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} onAfterRender:`),!0}onAfterRenderAsync(t){return this.onAfterRender(),t()}renderMainViewport(){return this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderMainViewport:`),this.render()}renderMainViewportAsync(t){return this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow APPLICATION [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderMainViewportAsync:`),this.renderAsync(t)}renderAutoViews(){this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} beginning renderAutoViews...`);let t=Object.keys(this.pict.views);t.sort((t,e)=>this.pict.views[t].options.AutoRenderOrdinal-this.pict.views[e].options.AutoRenderOrdinal);for(let e=0;e<t.length;e++){let i=this.pict.views[t[e]];i.options.AutoRender&&i.render()}this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync complete.`)}renderAutoViewsAsync(t){let e=this.fable.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t&&t;i||(this.log.warn(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync Auto Callback Error: ${t}`,t)}),this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} beginning renderAutoViewsAsync...`);let n=Object.keys(this.pict.views);n.sort((t,e)=>this.pict.views[t].options.AutoRenderOrdinal-this.pict.views[e].options.AutoRenderOrdinal);for(let t=0;t<n.length;t++){let i=this.pict.views[n[t]];i.options.AutoRender&&e.anticipate(i.renderAsync.bind(i))}e.wait(t=>(this.lastAutoRenderTimestamp=this.fable.log.getTimeStamp(),this.pict.LogNoisiness>0&&this.log.trace(`PictApp [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAutoViewsAsync complete.`),i(t)))}get isPictApplication(){return!0}}},{"../package.json":43,"fable-serviceproviderbase":20}],45:[function(t,e,i){e.exports={Name:"Pict Docuserve",Hash:"Docuserve",MainViewportViewIdentifier:"Docuserve-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1,pict_configuration:{Product:"Docuserve-Pict-Application"}}},{}],46:[function(t,e,i){const n=t("pict-application"),o=t("./providers/Pict-Provider-Docuserve-Documentation.js"),r=t("./views/PictView-Docuserve-Layout.js"),a=t("./views/PictView-Docuserve-TopBar.js"),s=t("./views/PictView-Docuserve-Sidebar.js"),l=t("./views/PictView-Docuserve-Splash.js"),d=t("./views/PictView-Docuserve-Content.js"),c=t("./views/PictView-Docuserve-Search.js");e.exports=class extends n{constructor(t,e,i){super(t,e,i),this.pict.addProvider("Docuserve-Documentation",o.default_configuration,o),this.pict.addView("Docuserve-Layout",r.default_configuration,r),this.pict.addView("Docuserve-TopBar",a.default_configuration,a),this.pict.addView("Docuserve-Sidebar",s.default_configuration,s),this.pict.addView("Docuserve-Splash",l.default_configuration,l),this.pict.addView("Docuserve-Content",d.default_configuration,d),this.pict.addView("Docuserve-Search",c.default_configuration,c)}onAfterInitializeAsync(t){try{let t=(window.location.pathname||"/").replace(/\/[^/]*$/,"/"),e="docuserve-theme:"+window.location.origin+t,i=localStorage.getItem(e);"light"!==i&&"dark"!==i||document.documentElement.setAttribute("data-theme",i)}catch(t){}this.pict.AppData.Docuserve={CatalogLoaded:!1,Catalog:null,CoverLoaded:!1,Cover:null,SidebarLoaded:!1,SidebarGroups:[],TopBarLoaded:!1,TopBar:null,VersionLoaded:!1,Version:null,ErrorPageLoaded:!1,ErrorPageHTML:null,KeywordIndexLoaded:!1,KeywordDocumentCount:0,CurrentGroup:"",CurrentModule:"",CurrentPath:"",SidebarVisible:!0,DocsBaseURL:"",CatalogURL:"retold-catalog.json"},this.pict.providers["Docuserve-Documentation"].loadCatalog(()=>{let e=this.pict.AppData.Docuserve,i="";return e.CoverLoaded&&e.Cover&&e.Cover.Title?i=e.Cover.Title.replace(/<[^>]*>/g,"").trim():e.TopBarLoaded&&e.TopBar&&e.TopBar.Brand&&(i=e.TopBar.Brand.replace(/<[^>]*>/g,"").trim()),i&&(e.VersionLoaded&&e.Version&&e.Version.Version?document.title=`${i} v${e.Version.Version} Documentation`:document.title=i),this.pict.views["Docuserve-Layout"].render(),super.onAfterInitializeAsync(t)})}resolveHash(){let t=(window.location.hash||"").replace(/^#\/?/,"");if(!t||"Home"===t)return void this.showView("Docuserve-Splash");let e=t.split("/");if("search"===e[0]){let t=decodeURIComponent(e.slice(1).join("/"));return void this.navigateToSearch(t)}if("page"===e[0]&&e.length>=2){let t=e.slice(1).join("/");return void this.navigateToPage(t)}if("doc"===e[0]&&e.length>=3){let t=e[1],i=e[2];if(e.length>=4){let n=e.slice(3).join("/");this.navigateToModulePath(t,i,n)}else this.navigateToModule(t,i);return}this.navigateToPage(t)}navigateTo(t){window.location.hash=t}showView(t){t in this.pict.views&&(this.pict.AppData.Docuserve.CurrentGroup="",this.pict.AppData.Docuserve.CurrentModule="",this.pict.AppData.Docuserve.CurrentPath="",this.pict.views[t].render(),this.pict.views["Docuserve-Sidebar"].clearModuleNav(),this.pict.views["Docuserve-Sidebar"].renderSidebarGroups())}navigateToModule(t,e){this.navigateToModulePath(t,e,"README.md")}navigateToModulePath(t,e,i){let n=this.pict.providers["Docuserve-Documentation"],o=this.pict.views["Docuserve-Content"],r=this.pict.views["Docuserve-Sidebar"];this.pict.AppData.Docuserve.CurrentGroup=t,this.pict.AppData.Docuserve.CurrentModule=e,this.pict.AppData.Docuserve.CurrentPath=i,o.render(),o.showLoading(),r.renderSidebarGroups(),r.renderModuleNav(t,e);let a=n.resolveDocumentURL(t,e,i||"README.md");if(!a)return void o.displayContent(n.getErrorPageHTML(t+"/"+e));let s=i||"README.md";n.fetchDocument(a,(i,r)=>{if(!i)return void o.displayContent(r);let a=t+"/"+e+"/"+s;n.fetchLocalDocument(a,(t,e)=>{o.displayContent(e)},t,e,s)},t,e,s)}navigateToPage(t){let e=this.pict.providers["Docuserve-Documentation"],i=this.pict.views["Docuserve-Content"],n=this.pict.views["Docuserve-Sidebar"];this.pict.AppData.Docuserve.CurrentGroup="",this.pict.AppData.Docuserve.CurrentModule="",this.pict.AppData.Docuserve.CurrentPath=t,i.render(),i.showLoading(),n.clearModuleNav(),n.renderSidebarGroups();let o=t;o.match(/\.md$/)||(o+=".md"),e.fetchLocalDocument(o,(t,e)=>{i.displayContent(e)})}navigateToSearch(t){let e=this.pict.views["Docuserve-Sidebar"],i=this.pict.views["Docuserve-Search"];this.pict.AppData.Docuserve.CurrentGroup="",this.pict.AppData.Docuserve.CurrentModule="",this.pict.AppData.Docuserve.CurrentPath="",e.clearModuleNav(),e.renderSidebarGroups(),i.render(),i.showSearch(t||"")}},e.exports.default_configuration=t("./Pict-Application-Docuserve-Configuration.json")},{"./Pict-Application-Docuserve-Configuration.json":45,"./providers/Pict-Provider-Docuserve-Documentation.js":47,"./views/PictView-Docuserve-Content.js":48,"./views/PictView-Docuserve-Layout.js":49,"./views/PictView-Docuserve-Search.js":50,"./views/PictView-Docuserve-Sidebar.js":51,"./views/PictView-Docuserve-Splash.js":52,"./views/PictView-Docuserve-TopBar.js":53,"pict-application":44}],47:[function(t,e,i){const n=t("pict-provider"),o=t("lunr"),r=t("pict-section-content").PictContentProvider;e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._Catalog=null,this._ContentCache={},this._ContentProvider=this.pict.addProvider("Pict-Content",r.default_configuration,r)}_createLinkResolver(t,e,i){return(n,o)=>{if(n.match(/^\//)||n.match(/^[^:]+\.md/)){return{href:this.convertDocLink(n,t,e,i)}}let r=this.resolveGitHubURLToRoute(n);return r?{href:r}:null}}_createImageResolver(t){let e="";if(t){let i=t.lastIndexOf("/");i>=0&&(e=t.substring(0,i+1))}return(t,i)=>t.match(/^https?:\/\//)||t.match(/^data:/)||t.match(/^\//)?t:e+t}loadCatalog(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.CatalogURL||"retold-catalog.json",n=()=>{let t=6,i=()=>{if(t--,t<=0){if(this.pict.AppData.Docuserve.SidebarGroups&&!(this.pict.AppData.Docuserve.SidebarGroups.length<1))return e();this.autoDiscoverSidebar(e)}};this.loadCover(i),this.loadSidebar(i),this.loadTopbar(i),this.loadErrorPage(i),this.loadKeywordIndex(i),this.loadVersion(i)};fetch(i).then(t=>t.ok?t.json():(this.log.info(`Docuserve: No catalog at [${i}]; running in standalone mode.`),null)).then(t=>{t&&(this._Catalog=t,this.pict.AppData.Docuserve.Catalog=t,this.pict.AppData.Docuserve.CatalogLoaded=!0,this.buildSidebarData(t)),n()}).catch(t=>{this.log.info(`Docuserve: Catalog load error (${t}); continuing in standalone mode.`),n()})}autoDiscoverSidebar(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"README.md").then(t=>t.ok?t.text():null).then(t=>{if(t){let e=t.match(/^#+\s+(.+)/m),i=e?e[1].trim():"Docs";this.pict.AppData.Docuserve.SidebarGroups=[{Name:i,Key:"docs",Route:"#/page/README",Modules:[]}],this.pict.AppData.Docuserve.CoverLoaded||(this.pict.AppData.Docuserve.Cover={Title:i,Tagline:"",Description:"",Highlights:[],Actions:[{Text:"Read the Docs",Href:"README.md"}]},this.pict.AppData.Docuserve.CoverLoaded=!0)}else this.log.info("Docuserve: No README.md found; sidebar will be empty.");return e()}).catch(t=>(this.log.info(`Docuserve: README.md discovery failed (${t}).`),e()))}loadCover(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"_cover.md").then(t=>t.ok?t.text():null).then(t=>t?(this.pict.AppData.Docuserve.Cover=this.parseCover(t),this.pict.AppData.Docuserve.CoverLoaded=!0,e()):(this.log.info("Docuserve: No _cover.md found; splash will use catalog data."),e())).catch(t=>(this.log.warn(`Docuserve: Error loading _cover.md: ${t}`),e()))}parseCover(t){let e={Title:"",Tagline:"",Description:"",Highlights:[],Actions:[]},i=t.split("\n");for(let t=0;t<i.length;t++){let n=i[t].trim();if(!n)continue;let o=n.match(/^#+\s+(.+)/);if(o){e.Title=o[1].trim();continue}let r=n.match(/^>\s*(.*)/);if(r){e.Tagline=r[1].trim();continue}let a=n.match(/^[-*+]\s+(.*)/);if(a){let t=a[1],i=t.match(/^\*\*([^*]+)\*\*\s*[-—:]\s*(.*)/);i?e.Highlights.push({Label:i[1].trim(),Text:i[2].trim()}):e.Highlights.push({Label:"",Text:t.trim()});continue}let s=n.match(/^\[([^\]]+)\]\(([^)]+)\)\s*$/);s?e.Actions.push({Text:s[1].trim(),Href:s[2].trim()}):e.Description?e.Description+=" "+n:e.Description=n}return e}loadSidebar(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"_sidebar.md").then(t=>t.ok?t.text():null).then(t=>{if(!t)return this.log.info("Docuserve: No _sidebar.md found; sidebar will use catalog data."),e();let i=this.parseSidebarMarkdown(t);return i&&i.length>0&&(this.pict.AppData.Docuserve.SidebarGroups=i,this.pict.AppData.Docuserve.SidebarLoaded=!0),e()}).catch(t=>(this.log.warn(`Docuserve: Error loading _sidebar.md: ${t}`),e()))}loadTopbar(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"_topbar.md").then(t=>t.ok?t.text():null).then(t=>t?(this.pict.AppData.Docuserve.TopBar=this.parseTopbar(t),this.pict.AppData.Docuserve.TopBarLoaded=!0,e()):(this.log.info("Docuserve: No _topbar.md found; top bar will use defaults."),e())).catch(t=>(this.log.warn(`Docuserve: Error loading _topbar.md: ${t}`),e()))}parseTopbar(t){let e={Brand:"",NavLinks:[],ExternalLinks:[]},i=t.split("\n");for(let t=0;t<i.length;t++){let n=i[t].trim();if(!n)continue;let o=n.match(/^#+\s+(.+)/);if(o){e.Brand=o[1].trim();continue}let r=n.match(/^[-*+]\s+(.*)/);if(r){let t=r[1].trim().match(/^\[([^\]]+)\]\(([^)]+)\)/);if(t){let i=t[1].trim(),n=t[2].trim();if(n.match(/^https?:\/\//))e.ExternalLinks.push({Text:i,Href:n});else{let t=this.convertSidebarLink(n);e.NavLinks.push({Text:i,Href:t})}}continue}}return e}loadVersion(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"_version.json").then(t=>t.ok?t.json():null).then(t=>t?(this.pict.AppData.Docuserve.Version=t,this.pict.AppData.Docuserve.VersionLoaded=!0,e()):(this.log.info("Docuserve: No _version.json found; version placard disabled."),e())).catch(t=>(this.log.warn(`Docuserve: Error loading _version.json: ${t}`),e()))}loadErrorPage(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"errorpage.md").then(t=>t.ok?t.text():null).then(t=>t?(this.pict.AppData.Docuserve.ErrorPageHTML=this._ContentProvider.parseMarkdown(t),this.pict.AppData.Docuserve.ErrorPageLoaded=!0,e()):(this.log.info("Docuserve: No errorpage.md found; errors will use default page."),e())).catch(t=>(this.log.warn(`Docuserve: Error loading errorpage.md: ${t}`),e()))}loadKeywordIndex(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.Docuserve.DocsBaseURL||"";fetch(i+"retold-keyword-index.json").then(t=>t.ok?t.json():null).then(t=>{if(!t||!t.LunrIndex||!t.Documents)return this.log.info("Docuserve: No keyword index found; search will be unavailable."),e();try{this._LunrIndex=o.Index.load(t.LunrIndex),this._KeywordDocuments=t.Documents,this.pict.AppData.Docuserve.KeywordIndexLoaded=!0,this.pict.AppData.Docuserve.KeywordDocumentCount=t.DocumentCount||0,this.log.info(`Docuserve: Keyword index loaded (${t.DocumentCount||0} documents).`)}catch(t){this.log.warn(`Docuserve: Error hydrating lunr index: ${t}`)}return e()}).catch(t=>(this.log.warn(`Docuserve: Error loading keyword index: ${t}`),e()))}isModuleInCatalog(t,e){if(!this._Catalog||!this._Catalog.Groups)return!1;for(let i=0;i<this._Catalog.Groups.length;i++){let n=this._Catalog.Groups[i];if(n.Key===t)for(let t=0;t<n.Modules.length;t++){if(n.Modules[t].Name===e)return!0}}return!1}findModuleGroupKey(t){if(!this._Catalog||!this._Catalog.Groups)return null;for(let e=0;e<this._Catalog.Groups.length;e++){let i=this._Catalog.Groups[e];for(let e=0;e<i.Modules.length;e++)if(i.Modules[e].Name===t)return i.Key}return null}isGroupInCatalog(t){if(!this._Catalog||!this._Catalog.Groups)return!1;for(let e=0;e<this._Catalog.Groups.length;e++)if(this._Catalog.Groups[e].Key===t)return!0;return!1}search(t){if(!(this._LunrIndex&&this._KeywordDocuments&&t&&t.trim()))return[];let e=[];try{let i=this._LunrIndex.search(t);for(let t=0;t<i.length;t++){let n=i[t].ref,o=i[t].score,r=this._KeywordDocuments[n];if(!r)continue;let a=n.split("/"),s="";if(a.length>=2){let t=a[0],e=a[1];s=this.isModuleInCatalog(t,e)?"#/doc/"+n:"#/page/"+n}e.push({Key:n,Title:r.Title||n,Group:r.Group||"",Module:r.Module||"",DocPath:r.DocPath||"",Score:o,Route:s})}}catch(t){this.log.warn(`Docuserve: Search error: ${t}`)}return e}getErrorPageHTML(t){let e=t||"unknown";return this.pict.AppData.Docuserve.ErrorPageLoaded&&this.pict.AppData.Docuserve.ErrorPageHTML?this.pict.AppData.Docuserve.ErrorPageHTML.replace(/\{\{path\}\}/g,this._ContentProvider.escapeHTML(e)):'<div class="docuserve-not-found"><h2>Page Not Found</h2><p>The document <code>'+this._ContentProvider.escapeHTML(e)+'</code> could not be loaded.</p><p><a href="#/Home">Return to the home page</a></p></div>'}parseSidebarMarkdown(t){let e=[],i=null,n=t.split("\n");for(let t=0;t<n.length;t++){let o=n[t];if(!o.trim())continue;let r=o.match(/^(\s*)/),a=r?r[1].length:0,s=o.trim().match(/^[-*+]\s+(.*)/);if(!s)continue;let l=s[1].trim(),d=l.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(a<2)if(d){let t=d[1].trim(),n=d[2].trim();i={Name:t,Key:this.deriveGroupKey(t,n),Route:this.convertSidebarLink(n),Modules:[]},e.push(i)}else{let t=l,n=t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"");i={Name:t,Key:n,Route:"",Modules:[]},e.push(i)}else if(i)if(d){let t=d[1].trim(),e=d[2].trim(),n=this.convertSidebarLink(e);i.Modules.push({Name:t,HasDocs:!0,Group:i.Key,Route:n})}else i.Modules.push({Name:l,HasDocs:!1,Group:i.Key,Route:""})}return e}convertSidebarLink(t){if(!t)return"";if("/"===t)return"#/Home";if(t.match(/^#[^/]/)){let t=this.pict.AppData.Docuserve.SidebarGroups;if(t)for(let e=0;e<t.length;e++){let i=t[e].Modules;if(i)for(let t=0;t<i.length;t++)if(i[t].HasDocs&&i[t].Route&&"#/Home"!==i[t].Route)return i[t].Route;if(t[e].Route&&"#/Home"!==t[e].Route)return t[e].Route}return"#/Home"}let e=t.replace(/^\//,"").replace(/\/$/,"");if(!e)return"#/Home";let i=e.split("/");if(i.length>=2){if(this.isGroupInCatalog(i[0])&&this.isModuleInCatalog(i[0],i[1]))return"#/doc/"+e;let t=this.findModuleGroupKey(i[1]);if(t){let e=i.slice(2).join("/");return e?"#/doc/"+t+"/"+i[1]+"/"+e:"#/doc/"+t+"/"+i[1]}}return e.match(/\.md$/)?"#/page/"+e.replace(/\.md$/,""):"#/page/"+e}deriveGroupKey(t,e){if(e&&"/"!==e){let t=e.replace(/^\//,"").replace(/\.md$/,"").replace(/\/$/,"");if(t&&!t.includes("/"))return t.toLowerCase()}return t.split(/[\s—\-:]+/)[0].toLowerCase().replace(/[^a-z0-9]/g,"")}buildSidebarData(t){let e=[];for(let i=0;i<t.Groups.length;i++){let n=t.Groups[i],o={Name:n.Name,Key:n.Key,Description:n.Description,Modules:[]};for(let t=0;t<n.Modules.length;t++){let e=n.Modules[t];o.Modules.push({Name:e.Name,HasDocs:e.HasDocs,Group:n.Key,Route:"#/doc/"+n.Key+"/"+e.Name})}e.push(o)}this.pict.AppData.Docuserve.SidebarGroups=e}resolveDocumentURL(t,e,i){if(!this._Catalog)return null;let n=this._Catalog.GitHubOrg||"stevenvelozo",o=this._Catalog.DefaultBranch||"master";for(let r=0;r<this._Catalog.Groups.length;r++){let a=this._Catalog.Groups[r];if(a.Key===t)for(let t=0;t<a.Modules.length;t++){let r=a.Modules[t];if(r.Name!==e)continue;let s=r.Branch||o,l=i||"README.md";return"https://raw.githubusercontent.com/"+n+"/"+r.Repo+"/"+s+"/docs/"+l}}return null}resolveGitHubURLToRoute(t){if(!this._Catalog||!this._Catalog.Groups||!t)return null;let e=t.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+)/);if(!e)return null;let i=e[1],n=e[2];if(i!==this._Catalog.GitHubOrg)return null;for(let t=0;t<this._Catalog.Groups.length;t++){let e=this._Catalog.Groups[t];for(let t=0;t<e.Modules.length;t++){let i=e.Modules[t];if(i.Repo===n)return"#/doc/"+e.Key+"/"+i.Name}}return null}resolveGitHubPagesURL(t,e){if(!this._Catalog||!this._Catalog.Groups)return null;let i=this._Catalog.GitHubOrg||"stevenvelozo";for(let n=0;n<this._Catalog.Groups.length;n++){let o=this._Catalog.Groups[n];if(o.Key===t)for(let t=0;t<o.Modules.length;t++){let n=o.Modules[t];if(n.Name===e)return n.HasDocs?"https://"+i+".github.io/"+n.Repo+"/":null}}return null}getModuleSidebar(t,e){if(!this._Catalog)return null;for(let i=0;i<this._Catalog.Groups.length;i++){let n=this._Catalog.Groups[i];if(n.Key===t)for(let t=0;t<n.Modules.length;t++){let i=n.Modules[t];if(i.Name===e)return i.Sidebar||null}}return null}fetchDocument(t,e,i,n,o){let r="function"==typeof e?e:()=>{};return t?this._ContentCache[t]?r(null,this._ContentCache[t]):void fetch(t).then(t=>t.ok?t.text():null).then(e=>{if(!e)return r("Document not found",this.getErrorPageHTML(t));let a=this._ContentProvider.parseMarkdown(e,this._createLinkResolver(i,n,o),this._createImageResolver(t));return this._ContentCache[t]=a,r(null,a)}).catch(e=>(this.log.warn(`Docuserve: Error fetching document [${t}]: ${e}`),r(e,this.getErrorPageHTML(t)))):r("No URL provided","")}fetchLocalDocument(t,e,i,n,o){let r=(this.pict.AppData.Docuserve.DocsBaseURL||"")+t;this.fetchDocument(r,e,i,n,o)}convertDocLink(t,e,i,n){let o=t.replace(/^\.\//,"");o=o.replace(/^\//,"");let r=o.split("/");if(r.length>=2&&this.isGroupInCatalog(r[0])&&this.isModuleInCatalog(r[0],r[1]))return"#/doc/"+o;if(e&&i){let t="";if(n){let e=n.split("/");e.length>1&&(e.pop(),t=e.join("/")+"/")}return"#/doc/"+e+"/"+i+"/"+t+o}if(o.match(/\.md$/)){return"#/page/"+o.replace(/\.md$/,"")}return"#/page/"+o}},e.exports.default_configuration={ProviderIdentifier:"Docuserve-Documentation",AutoInitialize:!0,AutoInitializeOrdinal:0}},{lunr:32,"pict-provider":58,"pict-section-content":62}],48:[function(t,e,i){const n=t("pict-section-content"),o={ViewIdentifier:"Docuserve-Content",DefaultRenderable:"Docuserve-Content-Display",DefaultDestinationAddress:"#Docuserve-Content-Container",AutoRender:!1,CSS:"\n\t\t.pict-content {\n\t\t\tpadding: 2em 3em;\n\t\t\tmax-width: 900px;\n\t\t\tmargin: 0 auto;\n\t\t\tcolor: var(--docuserve-text);\n\t\t}\n\t\t.pict-content-loading {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-height: 200px;\n\t\t\tcolor: var(--docuserve-text-dim);\n\t\t\tfont-size: 1em;\n\t\t}\n\t\t.pict-content h1 {\n\t\t\tfont-size: 2em;\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t\tborder-bottom: 1px solid var(--docuserve-border);\n\t\t\tpadding-bottom: 0.3em;\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t.pict-content h2 {\n\t\t\tfont-size: 1.5em;\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t\tborder-bottom: 1px solid var(--docuserve-border-soft);\n\t\t\tpadding-bottom: 0.25em;\n\t\t\tmargin-top: 1.5em;\n\t\t}\n\t\t.pict-content h3 {\n\t\t\tfont-size: 1.25em;\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t\tmargin-top: 1.25em;\n\t\t}\n\t\t.pict-content h4, .pict-content h5, .pict-content h6 {\n\t\t\tcolor: var(--docuserve-text-muted);\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\t.pict-content p {\n\t\t\tline-height: 1.7;\n\t\t\tcolor: var(--docuserve-text);\n\t\t\tmargin: 0.75em 0;\n\t\t}\n\t\t.pict-content a {\n\t\t\tcolor: var(--docuserve-accent);\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.pict-content a:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t/* Plain <pre> (no wrap) - rare; keep for safety */\n\t\t.pict-content pre {\n\t\t\tbackground: var(--docuserve-code-bg);\n\t\t\tcolor: var(--docuserve-code-text);\n\t\t\tpadding: 1.25em;\n\t\t\tborder-radius: 6px;\n\t\t\tborder: 1px solid var(--docuserve-code-border);\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: 0.9em;\n\t\t}\n\t\t/* Inline code */\n\t\t.pict-content code {\n\t\t\tbackground: var(--docuserve-inline-code-bg);\n\t\t\tpadding: 0.15em 0.4em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: var(--docuserve-inline-code-text);\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;\n\t\t}\n\t\t.pict-content pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t/* Fenced code block wrapper emitted by pict-section-content */\n\t\t.pict-content-code-wrap {\n\t\t\tposition: relative;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;\n\t\t\tfont-size: 14px;\n\t\t\tline-height: 1.5;\n\t\t\tborder-radius: 6px;\n\t\t\tborder: 1px solid var(--docuserve-code-border);\n\t\t\toverflow: auto;\n\t\t\tmargin: 1em 0;\n\t\t\tbackground: var(--docuserve-code-bg);\n\t\t}\n\t\t.pict-content-code-wrap .pict-content-code-line-numbers {\n\t\t\tposition: absolute;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\twidth: 40px;\n\t\t\tpadding: 1.25em 0;\n\t\t\ttext-align: right;\n\t\t\tbackground: var(--docuserve-code-gutter-bg);\n\t\t\tborder-right: 1px solid var(--docuserve-code-gutter-border);\n\t\t\tcolor: var(--docuserve-code-gutter-text);\n\t\t\tfont-family: inherit;\n\t\t\tfont-size: inherit;\n\t\t\tline-height: inherit;\n\t\t\tuser-select: none;\n\t\t\tpointer-events: none;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.pict-content-code-wrap .pict-content-code-line-numbers span {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0 8px 0 0;\n\t\t}\n\t\t.pict-content-code-wrap pre {\n\t\t\tmargin: 0;\n\t\t\tbackground: var(--docuserve-code-bg);\n\t\t\tcolor: var(--docuserve-code-text);\n\t\t\tpadding: 1.25em 1.25em 1.25em 52px;\n\t\t\tborder: none;\n\t\t\tborder-radius: 0;\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.pict-content-code-wrap pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t/* Syntax tokens — these rules must match the span classes emitted by\n\t\t pict-section-code's highlighter. Also apply without .pict-content-code-wrap\n\t\t as a belt-and-suspenders for any <pre><code> not emitted from a fence. */\n\t\t.pict-content-code-wrap .keyword,\n\t\t.pict-content pre code .keyword { color: var(--docuserve-tok-keyword); }\n\t\t.pict-content-code-wrap .string,\n\t\t.pict-content pre code .string { color: var(--docuserve-tok-string); }\n\t\t.pict-content-code-wrap .number,\n\t\t.pict-content pre code .number { color: var(--docuserve-tok-number); }\n\t\t.pict-content-code-wrap .comment,\n\t\t.pict-content pre code .comment { color: var(--docuserve-tok-comment); font-style: italic; }\n\t\t.pict-content-code-wrap .operator,\n\t\t.pict-content pre code .operator { color: var(--docuserve-tok-operator); }\n\t\t.pict-content-code-wrap .punctuation,\n\t\t.pict-content pre code .punctuation { color: var(--docuserve-tok-punctuation); }\n\t\t.pict-content-code-wrap .function-name,\n\t\t.pict-content pre code .function-name { color: var(--docuserve-tok-function); }\n\t\t.pict-content-code-wrap .property,\n\t\t.pict-content pre code .property { color: var(--docuserve-tok-property); }\n\t\t.pict-content-code-wrap .tag,\n\t\t.pict-content pre code .tag { color: var(--docuserve-tok-tag); }\n\t\t.pict-content-code-wrap .attr-name,\n\t\t.pict-content pre code .attr-name { color: var(--docuserve-tok-attr-name); }\n\t\t.pict-content-code-wrap .attr-value,\n\t\t.pict-content pre code .attr-value { color: var(--docuserve-tok-attr-value); }\n\t\t.pict-content blockquote {\n\t\t\tborder-left: 4px solid var(--docuserve-blockquote-border);\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em 1em;\n\t\t\tbackground: var(--docuserve-blockquote-bg);\n\t\t\tcolor: var(--docuserve-blockquote-text);\n\t\t}\n\t\t.pict-content blockquote p {\n\t\t\tmargin: 0.25em 0;\n\t\t}\n\t\t.pict-content ul, .pict-content ol {\n\t\t\tpadding-left: 2em;\n\t\t\tline-height: 1.8;\n\t\t}\n\t\t.pict-content li {\n\t\t\tmargin: 0.25em 0;\n\t\t\tcolor: var(--docuserve-text);\n\t\t}\n\t\t.pict-content hr {\n\t\t\tborder: none;\n\t\t\tborder-top: 1px solid var(--docuserve-border);\n\t\t\tmargin: 2em 0;\n\t\t}\n\t\t.pict-content table {\n\t\t\twidth: 100%;\n\t\t\tborder-collapse: collapse;\n\t\t\tmargin: 1em 0;\n\t\t}\n\t\t.pict-content table th {\n\t\t\tbackground: var(--docuserve-table-header-bg);\n\t\t\tborder: 1px solid var(--docuserve-border);\n\t\t\tpadding: 0.6em 0.8em;\n\t\t\ttext-align: left;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t}\n\t\t.pict-content table td {\n\t\t\tborder: 1px solid var(--docuserve-border);\n\t\t\tpadding: 0.5em 0.8em;\n\t\t\tcolor: var(--docuserve-text);\n\t\t}\n\t\t.pict-content table tr:nth-child(even) {\n\t\t\tbackground: var(--docuserve-table-row-alt-bg);\n\t\t}\n\t\t.pict-content img {\n\t\t\tmax-width: 100%;\n\t\t\theight: auto;\n\t\t}\n\t\t.pict-content pre.mermaid {\n\t\t\tbackground: var(--docuserve-mermaid-bg);\n\t\t\tcolor: #2A241E;\n\t\t\ttext-align: center;\n\t\t\tpadding: 1em;\n\t\t\tborder: 1px solid var(--docuserve-border-soft);\n\t\t}\n\t\t/* Force dark text inside mermaid SVGs so diagrams stay readable\n\t\t in dark mode (mermaid bg is always light). */\n\t\t.pict-content pre.mermaid text,\n\t\t.pict-content pre.mermaid .nodeLabel,\n\t\t.pict-content pre.mermaid .edgeLabel,\n\t\t.pict-content pre.mermaid .label,\n\t\t.pict-content pre.mermaid .cluster-label,\n\t\t.pict-content pre.mermaid span,\n\t\t.pict-content pre.mermaid foreignObject p,\n\t\t.pict-content pre.mermaid foreignObject div,\n\t\t.pict-content pre.mermaid foreignObject span {\n\t\t\tcolor: #2A241E !important;\n\t\t\tfill: #2A241E !important;\n\t\t}\n\t\t.pict-content pre.mermaid .edgePath .path {\n\t\t\tstroke: #5E5549 !important;\n\t\t}\n\t\t.pict-content pre.mermaid .arrowheadPath {\n\t\t\tfill: #5E5549 !important;\n\t\t}\n\t\t.pict-content .pict-content-katex-display {\n\t\t\ttext-align: center;\n\t\t\tmargin: 1em 0;\n\t\t\tpadding: 0.5em;\n\t\t\toverflow-x: auto;\n\t\t}\n\t\t.pict-content .pict-content-katex-inline {\n\t\t\tdisplay: inline;\n\t\t}\n\t\t.docuserve-module-external-link {\n\t\t\tpadding: 0.5em 0;\n\t\t\tmargin-bottom: 0.5em;\n\t\t\tborder-bottom: 1px solid var(--docuserve-border-soft);\n\t\t\tfont-size: 0.85em;\n\t\t\ttext-align: right;\n\t\t}\n\t\t.docuserve-module-external-link a {\n\t\t\tcolor: var(--docuserve-accent);\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.docuserve-module-external-link a:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.docuserve-not-found {\n\t\t\ttext-align: center;\n\t\t\tpadding: 3em 1em;\n\t\t\tcolor: var(--docuserve-text-muted);\n\t\t}\n\t\t.docuserve-not-found h2 {\n\t\t\tcolor: var(--docuserve-text-dim);\n\t\t\tfont-size: 1.5em;\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t.docuserve-not-found code {\n\t\t\tbackground: var(--docuserve-inline-code-bg);\n\t\t\tpadding: 0.15em 0.4em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: var(--docuserve-inline-code-text);\n\t\t}\n\n\t\t/* Fullscreen viewer for images and mermaid diagrams (click-to-zoom) */\n\t\t.pict-content [data-fullscreen-source] {\n\t\t\tcursor: zoom-in;\n\t\t\toutline: 1px solid transparent;\n\t\t\toutline-offset: 3px;\n\t\t\tborder-radius: 4px;\n\t\t\ttransition: outline-color 0.15s ease;\n\t\t}\n\t\t.pict-content [data-fullscreen-source]:hover {\n\t\t\toutline-color: var(--docuserve-accent);\n\t\t}\n\t\t/* Code block container with hover-revealed action buttons */\n\t\t.pict-content-code-container {\n\t\t\tposition: relative;\n\t\t\tdisplay: flex;\n\t\t\talign-items: flex-start;\n\t\t\tgap: 8px;\n\t\t\tmargin: 1em 0;\n\t\t}\n\t\t.pict-content-code-container > .pict-content-code-wrap {\n\t\t\tmargin: 0;\n\t\t\tflex: 1 1 auto;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.pict-content-code-actions {\n\t\t\tposition: sticky;\n\t\t\ttop: 64px;\n\t\t\talign-self: flex-start;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tgap: 6px;\n\t\t\tflex: 0 0 auto;\n\t\t\tpadding-top: 6px;\n\t\t\topacity: 0;\n\t\t\ttransform: translateX(-4px);\n\t\t\ttransition: opacity 0.15s ease, transform 0.15s ease;\n\t\t\tpointer-events: none;\n\t\t}\n\t\t.pict-content-code-container:hover .pict-content-code-actions,\n\t\t.pict-content-code-container:focus-within .pict-content-code-actions {\n\t\t\topacity: 1;\n\t\t\ttransform: translateX(0);\n\t\t\tpointer-events: auto;\n\t\t}\n\t\t.pict-content-code-action-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 28px;\n\t\t\theight: 28px;\n\t\t\tpadding: 0;\n\t\t\tbackground: var(--docuserve-bg-elevated);\n\t\t\tcolor: var(--docuserve-text-muted);\n\t\t\tborder: 1px solid var(--docuserve-border);\n\t\t\tborder-radius: 6px;\n\t\t\tcursor: pointer;\n\t\t\tbox-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n\t\t\ttransition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;\n\t\t}\n\t\t.pict-content-code-action-btn svg {\n\t\t\tdisplay: block;\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t\tstroke: currentColor;\n\t\t\tfill: none;\n\t\t\tstroke-width: 1.6;\n\t\t\tstroke-linecap: round;\n\t\t\tstroke-linejoin: round;\n\t\t}\n\t\t.pict-content-code-action-btn:hover {\n\t\t\tbackground: var(--docuserve-accent);\n\t\t\tcolor: #FFFFFF;\n\t\t\tborder-color: var(--docuserve-accent);\n\t\t\tbox-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);\n\t\t}\n\t\t.pict-content-code-action-btn:focus-visible {\n\t\t\toutline: 2px solid var(--docuserve-accent);\n\t\t\toutline-offset: 2px;\n\t\t}\n\t\t.pict-content-code-action-btn.is-copied {\n\t\t\tbackground: var(--docuserve-accent);\n\t\t\tcolor: #FFFFFF;\n\t\t\tborder-color: var(--docuserve-accent);\n\t\t}\n\t\t.pict-content-code-action-btn.is-copy-failed {\n\t\t\tbackground: #B23A3A;\n\t\t\tcolor: #FFFFFF;\n\t\t\tborder-color: #B23A3A;\n\t\t}\n\t\t.pict-fullscreen-overlay {\n\t\t\tposition: fixed;\n\t\t\tinset: 0;\n\t\t\tz-index: 9999;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tbackground: rgba(0, 0, 0, 0.62);\n\t\t\tbackdrop-filter: blur(6px);\n\t\t\t-webkit-backdrop-filter: blur(6px);\n\t\t\tcolor: var(--docuserve-text);\n\t\t}\n\t\t.pict-fullscreen-overlay[hidden] {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.pict-fullscreen-titlebar {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tgap: 1em;\n\t\t\theight: 48px;\n\t\t\tpadding: 0 1em;\n\t\t\tbackground: var(--docuserve-bg-elevated);\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t\tborder-bottom: 1px solid var(--docuserve-border);\n\t\t\tbox-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);\n\t\t\tflex: 0 0 auto;\n\t\t}\n\t\t.pict-fullscreen-title {\n\t\t\tfont-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, sans-serif;\n\t\t\tfont-size: 0.95em;\n\t\t\tfont-weight: 600;\n\t\t\tletter-spacing: 0.01em;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t}\n\t\t.pict-fullscreen-controls {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t}\n\t\t.pict-fullscreen-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 32px;\n\t\t\theight: 32px;\n\t\t\tpadding: 0;\n\t\t\tbackground: transparent;\n\t\t\tborder: 1px solid transparent;\n\t\t\tborder-radius: 6px;\n\t\t\tcolor: var(--docuserve-text-muted);\n\t\t\tcursor: pointer;\n\t\t\ttransition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;\n\t\t}\n\t\t.pict-fullscreen-btn svg {\n\t\t\tdisplay: block;\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\tstroke: currentColor;\n\t\t\tfill: none;\n\t\t\tstroke-width: 1.75;\n\t\t\tstroke-linecap: round;\n\t\t\tstroke-linejoin: round;\n\t\t}\n\t\t.pict-fullscreen-btn:hover {\n\t\t\tbackground: var(--docuserve-border-soft);\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t}\n\t\t.pict-fullscreen-btn:focus-visible {\n\t\t\toutline: 2px solid var(--docuserve-accent);\n\t\t\toutline-offset: 2px;\n\t\t}\n\t\t.pict-fullscreen-close:hover {\n\t\t\tbackground: var(--docuserve-accent);\n\t\t\tcolor: #FFFFFF;\n\t\t}\n\t\t.pict-fullscreen-stage {\n\t\t\tflex: 1 1 auto;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\toverflow: hidden;\n\t\t\tpadding: 1.5em;\n\t\t\tcursor: zoom-in;\n\t\t\ttouch-action: none;\n\t\t}\n\t\t.pict-fullscreen-stage.is-zoomed {\n\t\t\tcursor: grab;\n\t\t}\n\t\t.pict-fullscreen-stage.is-panning {\n\t\t\tcursor: grabbing;\n\t\t}\n\t\t.pict-fullscreen-content {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 100%;\n\t\t\ttransform-origin: center center;\n\t\t\ttransition: transform 0.05s linear;\n\t\t\twill-change: transform;\n\t\t}\n\t\t.pict-fullscreen-content > * {\n\t\t\tbox-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);\n\t\t}\n\t\t.pict-fullscreen-content .pict-fullscreen-img {\n\t\t\tmax-width: 90vw;\n\t\t\tmax-height: calc(100vh - 96px);\n\t\t\twidth: auto;\n\t\t\theight: auto;\n\t\t\tobject-fit: contain;\n\t\t\tbackground: var(--docuserve-bg-elevated);\n\t\t\tpadding: 12px;\n\t\t\tborder-radius: 6px;\n\t\t}\n\t\t.pict-fullscreen-content .pict-fullscreen-mermaid-svg {\n\t\t\twidth: min(90vw, 1400px);\n\t\t\theight: auto;\n\t\t\tmax-height: calc(100vh - 96px);\n\t\t\tbackground: var(--docuserve-mermaid-bg);\n\t\t\tcolor: #2A241E;\n\t\t\tpadding: 16px;\n\t\t\tborder-radius: 6px;\n\t\t}\n\t\t.pict-fullscreen-content .pict-fullscreen-mermaid-svg text,\n\t\t.pict-fullscreen-content .pict-fullscreen-mermaid-svg .nodeLabel,\n\t\t.pict-fullscreen-content .pict-fullscreen-mermaid-svg .edgeLabel,\n\t\t.pict-fullscreen-content .pict-fullscreen-mermaid-svg .label,\n\t\t.pict-fullscreen-content .pict-fullscreen-mermaid-svg span,\n\t\t.pict-fullscreen-content .pict-fullscreen-mermaid-svg foreignObject p,\n\t\t.pict-fullscreen-content .pict-fullscreen-mermaid-svg foreignObject div,\n\t\t.pict-fullscreen-content .pict-fullscreen-mermaid-svg foreignObject span {\n\t\t\tcolor: #2A241E !important;\n\t\t\tfill: #2A241E !important;\n\t\t}\n\t\t.pict-fullscreen-content .pict-fullscreen-codewrap {\n\t\t\tmax-width: 90vw;\n\t\t\tmax-height: calc(100vh - 96px);\n\t\t\tmargin: 0;\n\t\t\toverflow: auto;\n\t\t\tbox-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Content-Template",Template:'\n<div class="pict-content" id="Docuserve-Content-Body">\n\t<div class="pict-content-loading">Loading documentation...</div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Content-Display",TemplateHash:"Docuserve-Content-Template",DestinationAddress:"#Docuserve-Content-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i)}displayContent(t){let e=t,i=this.pict.AppData.Docuserve.CurrentGroup,n=this.pict.AppData.Docuserve.CurrentModule;if(i&&n){let t=this.pict.providers["Docuserve-Documentation"];if(t){let o=t.resolveGitHubPagesURL(i,n);o&&(e='<div class="docuserve-module-external-link"><a href="'+o+'" target="_blank" rel="noopener">↗ View '+n+" documentation site</a></div>"+e)}}super.displayContent(e,"Docuserve-Content-Body")}showLoading(){super.showLoading("Loading documentation...","Docuserve-Content-Body")}},e.exports.default_configuration=o},{"pict-section-content":62}],49:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Docuserve-Layout",DefaultRenderable:"Docuserve-Layout-Shell",DefaultDestinationAddress:"#Docuserve-Application-Container",AutoRender:!1,CSS:"\n\t\t#Docuserve-Application-Container {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100vh;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t#Docuserve-TopBar-Container {\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.docuserve-body {\n\t\t\tdisplay: flex;\n\t\t\tflex: 1;\n\t\t\tmin-height: 0;\n\t\t}\n\t\t#Docuserve-Sidebar-Container {\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 280px;\n\t\t\toverflow-y: auto;\n\t\t\tbackground-color: #F5F0E8;\n\t\t}\n\t\t#Docuserve-Content-Container {\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\toverflow-y: auto;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Layout-Shell-Template",Template:'\n<div id="Docuserve-TopBar-Container"></div>\n<div class="docuserve-body">\n\t<div id="Docuserve-Sidebar-Container"></div>\n\t<div id="Docuserve-Content-Container"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Layout-Shell",TemplateHash:"Docuserve-Layout-Shell-Template",DestinationAddress:"#Docuserve-Application-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(t,e,i,n){if(this.pict.views["Docuserve-TopBar"].render(),this.pict.views["Docuserve-Sidebar"].render(),this.pict.views["Docuserve-Splash"].render(),this.pict.CSSMap.injectCSS(),this.pict.PictApplication.resolveHash(),!this._HashChangeListenerBound){this._HashChangeListenerBound=!0;let t=this;window.addEventListener("hashchange",()=>{t.pict.PictApplication.resolveHash()})}return super.onAfterRender(t,e,i,n)}},e.exports.default_configuration=o},{"pict-view":102}],50:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Docuserve-Search",DefaultRenderable:"Docuserve-Search-Display",DefaultDestinationAddress:"#Docuserve-Content-Container",AutoRender:!1,CSS:"\n\t\t.docuserve-search {\n\t\t\tpadding: 2em 3em;\n\t\t\tmax-width: 900px;\n\t\t\tmargin: 0 auto;\n\t\t}\n\t\t.docuserve-search-header {\n\t\t\tmargin-bottom: 1.5em;\n\t\t}\n\t\t.docuserve-search-header h1 {\n\t\t\tfont-size: 1.75em;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin: 0 0 0.75em 0;\n\t\t}\n\t\t.docuserve-search-input {\n\t\t\twidth: 100%;\n\t\t\tpadding: 0.75em 1em;\n\t\t\tfont-size: 1.1em;\n\t\t\tborder: 2px solid #D4CCBE;\n\t\t\tborder-radius: 6px;\n\t\t\toutline: none;\n\t\t\tbox-sizing: border-box;\n\t\t\ttransition: border-color 0.15s;\n\t\t}\n\t\t.docuserve-search-input:focus {\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.docuserve-search-status {\n\t\t\tmargin-top: 0.75em;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #8A7F72;\n\t\t}\n\t\t.docuserve-search-results {\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\t.docuserve-search-result {\n\t\t\tdisplay: block;\n\t\t\tpadding: 1em 1.25em;\n\t\t\tmargin-bottom: 0.5em;\n\t\t\tborder: 1px solid #EAE3D8;\n\t\t\tborder-radius: 6px;\n\t\t\ttext-decoration: none;\n\t\t\tcolor: inherit;\n\t\t\ttransition: border-color 0.15s, box-shadow 0.15s;\n\t\t}\n\t\t.docuserve-search-result:hover {\n\t\t\tborder-color: #2E7D74;\n\t\t\tbox-shadow: 0 2px 8px rgba(46, 125, 116, 0.1);\n\t\t}\n\t\t.docuserve-search-result-title {\n\t\t\tfont-size: 1.05em;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #2E7D74;\n\t\t\tmargin-bottom: 0.25em;\n\t\t}\n\t\t.docuserve-search-result-breadcrumb {\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 0.2em;\n\t\t}\n\t\t.docuserve-search-result-path {\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: #A39889;\n\t\t\tfont-family: monospace;\n\t\t}\n\t\t.docuserve-search-empty {\n\t\t\ttext-align: center;\n\t\t\tpadding: 3em 1em;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1em;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Search-Template",Template:'\n<div class="docuserve-search">\n\t<div class="docuserve-search-header">\n\t\t<h1>Search Documentation</h1>\n\t\t<input type="text" class="docuserve-search-input" id="Docuserve-Search-Input" placeholder="Search across all modules...">\n\t\t<div id="Docuserve-Search-Status" class="docuserve-search-status"></div>\n\t</div>\n\t<div id="Docuserve-Search-Results" class="docuserve-search-results"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Search-Display",TemplateHash:"Docuserve-Search-Template",DestinationAddress:"#Docuserve-Content-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._SearchDebounceTimer=null}onAfterRender(t,e,i,n){let o=document.getElementById("Docuserve-Search-Input");return o&&o.addEventListener("input",()=>{this._SearchDebounceTimer&&clearTimeout(this._SearchDebounceTimer),this._SearchDebounceTimer=setTimeout(()=>{this.performSearch(o.value)},250)}),super.onAfterRender(t,e,i,n)}showSearch(t){let e=document.getElementById("Docuserve-Search-Input");if(e&&(e.value=t||"",e.focus()),t&&t.trim())this.performSearch(t);else{let t=this.pict.AppData.Docuserve.KeywordDocumentCount||0,e=t>0?"Search across "+t+" documents.":"Enter a search term to find documentation.";this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status",e),this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results","")}let i=document.getElementById("Docuserve-Content-Container");i&&(i.scrollTop=0)}performSearch(t){if(!t||!t.trim()){let t=this.pict.AppData.Docuserve.KeywordDocumentCount||0,e=t>0?"Search across "+t+" documents.":"Enter a search term to find documentation.";return this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status",e),void this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results","")}let e=this.pict.providers["Docuserve-Documentation"].search(t);if(0===e.length)return this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status","No results found for '"+this.escapeHTML(t)+"'."),void this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results","");this.pict.ContentAssignment.assignContent("#Docuserve-Search-Status",e.length+" result"+(1!==e.length?"s":"")+" for '"+this.escapeHTML(t)+"'");let i="";for(let t=0;t<e.length;t++){let n=e[t],o="";n.Group&&n.Module&&(o=n.Group+" › "+n.Module),i+='<a class="docuserve-search-result" href="'+n.Route+'">',i+='<div class="docuserve-search-result-title">'+this.escapeHTML(n.Title)+"</div>",o&&(i+='<div class="docuserve-search-result-breadcrumb">'+o+"</div>"),n.DocPath&&(i+='<div class="docuserve-search-result-path">'+this.escapeHTML(n.DocPath)+"</div>"),i+="</a>"}this.pict.ContentAssignment.assignContent("#Docuserve-Search-Results",i)}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}},e.exports.default_configuration=o},{"pict-view":102}],51:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Docuserve-Sidebar",DefaultRenderable:"Docuserve-Sidebar-Content",DefaultDestinationAddress:"#Docuserve-Sidebar-Container",AutoRender:!1,CSS:"\n\t\t.docuserve-sidebar {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tbackground: var(--docuserve-sidebar-bg);\n\t\t\tborder-right: 1px solid var(--docuserve-sidebar-border);\n\t\t\tpadding: 1em 0;\n\t\t\tpadding-top: 0;\n\t\t\tmin-height: 100%;\n\t\t\tposition: relative;\n\t\t\ttransition: background-color 0.15s ease;\n\t\t}\n\t\t.docuserve-sidebar-header {\n\t\t\tdisplay: flex;\n\t\t\tjustify-content: flex-end;\n\t\t\tpadding: 0.4em 0.5em 0;\n\t\t}\n\t\t.docuserve-sidebar-close {\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: var(--docuserve-text-dim);\n\t\t\tfont-size: 1.2em;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 0.2em 0.4em;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.docuserve-sidebar-close:hover {\n\t\t\tcolor: var(--docuserve-accent);\n\t\t}\n\t\t.docuserve-sidebar-search {\n\t\t\tpadding: 0 1em 1em 1em;\n\t\t\tborder-bottom: 1px solid var(--docuserve-sidebar-border-soft);\n\t\t\tmargin-bottom: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-search input {\n\t\t\twidth: 100%;\n\t\t\tpadding: 0.5em 0.75em;\n\t\t\tbackground: var(--docuserve-sidebar-search-bg);\n\t\t\tcolor: var(--docuserve-text);\n\t\t\tborder: 1px solid var(--docuserve-sidebar-search-border);\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.85em;\n\t\t\toutline: none;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.docuserve-sidebar-search input:focus {\n\t\t\tborder-color: var(--docuserve-accent);\n\t\t}\n\t\t.docuserve-sidebar-search-results {\n\t\t\tmargin-top: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-search-results a {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.4em 0.5em;\n\t\t\tcolor: var(--docuserve-sidebar-text);\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.82em;\n\t\t\tborder-radius: 3px;\n\t\t\ttransition: background-color 0.1s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-sidebar-search-results a:hover {\n\t\t\tbackground-color: var(--docuserve-sidebar-hover-bg);\n\t\t\tcolor: var(--docuserve-sidebar-hover-text);\n\t\t}\n\t\t.docuserve-sidebar-search-result-title {\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t}\n\t\t.docuserve-sidebar-search-results a:hover .docuserve-sidebar-search-result-title {\n\t\t\tcolor: var(--docuserve-sidebar-hover-text);\n\t\t}\n\t\t.docuserve-sidebar-search-result-meta {\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: var(--docuserve-text-dim);\n\t\t}\n\t\t.docuserve-sidebar-search-all {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.4em 0.5em;\n\t\t\tfont-size: 0.82em;\n\t\t\tcolor: var(--docuserve-accent);\n\t\t\ttext-decoration: none;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t\tborder-top: 1px solid var(--docuserve-sidebar-border-soft);\n\t\t\tmargin-top: 0.25em;\n\t\t\tpadding-top: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-search-all:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.docuserve-sidebar-home {\n\t\t\tpadding: 0.5em 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.85em;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t}\n\t\t.docuserve-sidebar-home a {\n\t\t\tcolor: var(--docuserve-sidebar-module-text);\n\t\t\ttext-decoration: none;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.docuserve-sidebar-home a:hover {\n\t\t\tcolor: var(--docuserve-sidebar-hover-text);\n\t\t}\n\t\t.docuserve-sidebar-group {\n\t\t\tmargin-top: 0.25em;\n\t\t}\n\t\t.docuserve-sidebar-group-title {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.5em 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.85em;\n\t\t\tcolor: var(--docuserve-sidebar-group-title);\n\t\t\ttext-decoration: none;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t\ttransition: background-color 0.1s, color 0.1s;\n\t\t}\n\t\t.docuserve-sidebar-group-title:hover {\n\t\t\tcolor: var(--docuserve-sidebar-hover-text);\n\t\t\tbackground-color: var(--docuserve-sidebar-hover-bg);\n\t\t}\n\t\ta.docuserve-sidebar-group-title.active {\n\t\t\tcolor: var(--docuserve-sidebar-active-text);\n\t\t\tbackground-color: var(--docuserve-sidebar-active-bg);\n\t\t}\n\t\t.docuserve-sidebar-modules {\n\t\t\tlist-style: none;\n\t\t\tmargin: 0;\n\t\t\tpadding: 0;\n\t\t}\n\t\t.docuserve-sidebar-modules li {\n\t\t\tpadding: 0;\n\t\t}\n\t\t.docuserve-sidebar-modules a {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.3em 1.25em 0.3em 2em;\n\t\t\tcolor: var(--docuserve-sidebar-module-text);\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.85em;\n\t\t\ttransition: background-color 0.1s, color 0.1s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-sidebar-modules a:hover {\n\t\t\tbackground-color: var(--docuserve-sidebar-hover-bg);\n\t\t\tcolor: var(--docuserve-sidebar-hover-text);\n\t\t}\n\t\t.docuserve-sidebar-modules a.active {\n\t\t\tcolor: var(--docuserve-sidebar-active-text);\n\t\t\tfont-weight: 600;\n\t\t\tbackground-color: var(--docuserve-sidebar-active-bg);\n\t\t}\n\t\t.docuserve-sidebar-modules .no-docs {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.3em 1.25em 0.3em 2em;\n\t\t\tcolor: var(--docuserve-text-dim);\n\t\t\tfont-size: 0.85em;\n\t\t}\n\t\t.docuserve-sidebar-module-nav {\n\t\t\tborder-top: 1px solid var(--docuserve-sidebar-border-soft);\n\t\t\tmargin-top: 0.5em;\n\t\t\tpadding-top: 0.5em;\n\t\t}\n\t\t.docuserve-sidebar-module-nav-section {\n\t\t\tpadding: 0.4em 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: var(--docuserve-text-dim);\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.02em;\n\t\t}\n\t\t.docuserve-sidebar-module-nav a {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.25em 1.25em 0.25em 2.25em;\n\t\t\tcolor: var(--docuserve-sidebar-module-text);\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.82em;\n\t\t\ttransition: background-color 0.1s, color 0.1s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-sidebar-module-nav a:hover {\n\t\t\tbackground-color: var(--docuserve-sidebar-hover-bg);\n\t\t\tcolor: var(--docuserve-sidebar-hover-text);\n\t\t}\n\t\t.docuserve-sidebar-footer {\n\t\t\tmargin-top: auto;\n\t\t\tpadding: 0.9em 1.25em 1em 1.25em;\n\t\t\tborder-top: 1px solid var(--docuserve-sidebar-border-soft);\n\t\t}\n\t\t.docuserve-sidebar-footer:empty {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.docuserve-version-placard {\n\t\t\tfont-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n\t\t\tline-height: 1.35;\n\t\t}\n\t\t.docuserve-version-name {\n\t\t\tfont-size: 0.78em;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: var(--docuserve-text-muted);\n\t\t\tletter-spacing: 0.02em;\n\t\t}\n\t\t.docuserve-version-number {\n\t\t\tfont-size: 0.82em;\n\t\t\tfont-weight: 500;\n\t\t\tcolor: var(--docuserve-accent);\n\t\t}\n\t\t.docuserve-version-meta {\n\t\t\tfont-size: 0.7em;\n\t\t\tcolor: var(--docuserve-text-dim);\n\t\t\tmargin-top: 0.15em;\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Sidebar-Template",Template:'\n<div class="docuserve-sidebar">\n\t<div class="docuserve-sidebar-header">\n\t\t<button class="docuserve-sidebar-close" onclick="{~P~}.views[\'Docuserve-Sidebar\'].toggleSidebar()">×</button>\n\t</div>\n\t<div id="Docuserve-Sidebar-Search" class="docuserve-sidebar-search" style="display:none;">\n\t\t<input type="text" placeholder="Search docs..." id="Docuserve-Sidebar-Search-Input">\n\t\t<div id="Docuserve-Sidebar-Search-Results" class="docuserve-sidebar-search-results"></div>\n\t</div>\n\t<div class="docuserve-sidebar-home">\n\t\t<a onclick="{~P~}.PictApplication.navigateTo(\'/Home\')">Home</a>\n\t</div>\n\t<div id="Docuserve-Sidebar-Groups"></div>\n\t<div id="Docuserve-Sidebar-ModuleNav"></div>\n\t<div id="Docuserve-Sidebar-Footer" class="docuserve-sidebar-footer"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Sidebar-Content",TemplateHash:"Docuserve-Sidebar-Template",DestinationAddress:"#Docuserve-Sidebar-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._SidebarSearchDebounceTimer=null}onAfterRender(t,e,i,n){this.renderSidebarGroups(),this.renderSidebarFooter();let o=document.getElementById("Docuserve-Sidebar-Search");if(o&&this.pict.AppData.Docuserve.KeywordIndexLoaded){o.style.display="";let t=document.getElementById("Docuserve-Sidebar-Search-Input");t&&t.addEventListener("input",()=>{this._SidebarSearchDebounceTimer&&clearTimeout(this._SidebarSearchDebounceTimer),this._SidebarSearchDebounceTimer=setTimeout(()=>{this.performSidebarSearch(t.value)},250)})}return super.onAfterRender(t,e,i,n)}renderSidebarFooter(){let t=document.getElementById("Docuserve-Sidebar-Footer");if(!t)return;let e=this.pict.AppData.Docuserve;if(!e.VersionLoaded||!e.Version||!e.Version.Version)return void(t.innerHTML="");let i=e.Version,n='<div class="docuserve-version-placard">';i.Name&&(n+='<div class="docuserve-version-name">'+this.escapeHTML(i.Name)+"</div>"),n+='<div class="docuserve-version-number">v'+this.escapeHTML(i.Version)+"</div>";let o=[];if(i.GeneratedAt){let t=String(i.GeneratedAt).match(/^(\d{4}-\d{2}-\d{2})/);t&&o.push("built "+t[1])}i.GitCommit&&o.push(i.GitCommit),o.length>0&&(n+='<div class="docuserve-version-meta">'+this.escapeHTML(o.join(" · "))+"</div>"),n+="</div>",t.innerHTML=n}renderSidebarGroups(){let t=this.pict.AppData.Docuserve.SidebarGroups;if(!t||t.length<1)return void this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-Groups","");let e="";for(let i=0;i<t.length;i++){let n=t[i];e+='<div class="docuserve-sidebar-group">';let o=n.Route||"";if(!o)for(let t=0;t<n.Modules.length;t++)if(n.Modules[t].HasDocs&&n.Modules[t].Route){o=n.Modules[t].Route;break}if(o){let t="",i=window.location.hash||"";this.pict.AppData.Docuserve.CurrentGroup!==n.Key&&i!==o||(t=" active"),e+='<a class="docuserve-sidebar-group-title'+t+'" href="'+o+'">'+this.escapeHTML(n.Name)+"</a>"}else e+='<div class="docuserve-sidebar-group-title">'+this.escapeHTML(n.Name)+"</div>";e+='<ul class="docuserve-sidebar-modules">';for(let t=0;t<n.Modules.length;t++){let i=n.Modules[t];if(i.HasDocs){let t="";this.pict.AppData.Docuserve.CurrentGroup===i.Group&&this.pict.AppData.Docuserve.CurrentModule===i.Name&&(t=' class="active"'),e+="<li><a"+t+' href="'+i.Route+'">'+this.escapeHTML(i.Name)+"</a></li>"}else e+='<li><span class="no-docs">'+this.escapeHTML(i.Name)+"</span></li>"}e+="</ul>",e+="</div>"}this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-Groups",e)}renderModuleNav(t,e){let i=this.pict.providers["Docuserve-Documentation"];if(!i)return;let n=i.getModuleSidebar(t,e);if(!n)return void this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-ModuleNav","");let o="#/doc/"+t+"/"+e+"/",r='<div class="docuserve-sidebar-module-nav">';for(let t=0;t<n.length;t++){let e=n[t];if(e.Children){r+='<div class="docuserve-sidebar-module-nav-section">'+this.escapeHTML(e.Title)+"</div>";for(let t=0;t<e.Children.length;t++){let i=e.Children[t];i.Path&&(r+='<a href="'+o+i.Path+'">'+this.escapeHTML(i.Title)+"</a>")}}else e.Path&&(r+='<a href="'+o+e.Path+'">'+this.escapeHTML(e.Title)+"</a>")}r+="</div>",this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-ModuleNav",r)}performSidebarSearch(t){let e=document.getElementById("Docuserve-Sidebar-Search-Results");if(!e)return;if(!t||!t.trim())return void(e.innerHTML="");let i=this.pict.providers["Docuserve-Documentation"].search(t);if(0===i.length)return void(e.innerHTML='<div style="padding: 0.4em 0.5em; font-size: 0.82em; color: #8A7F72;">No results found.</div>');let n="";for(let t=0;t<i.length&&t<8;t++){let e=i[t],o="";e.Group&&e.Module&&(o=e.Group+" / "+e.Module),n+='<a href="'+e.Route+'">',n+='<div class="docuserve-sidebar-search-result-title">'+this.escapeHTML(e.Title)+"</div>",o&&(n+='<div class="docuserve-sidebar-search-result-meta">'+this.escapeHTML(o)+"</div>"),n+="</a>"}if(i.length>8){n+='<a class="docuserve-sidebar-search-all" href="#/search/'+encodeURIComponent(t)+'">See all '+i.length+" results</a>"}e.innerHTML=n}toggleSidebar(){this.pict.AppData.Docuserve.SidebarVisible=!this.pict.AppData.Docuserve.SidebarVisible;let t=document.getElementById("Docuserve-Sidebar-Container"),e=document.getElementById("Docuserve-TopBar-Toggle");this.pict.AppData.Docuserve.SidebarVisible?(t&&(t.style.display=""),e&&(e.style.display="none")):(t&&(t.style.display="none"),e&&(e.style.display="inline-block"))}clearModuleNav(){this.pict.ContentAssignment.assignContent("#Docuserve-Sidebar-ModuleNav","")}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}},e.exports.default_configuration=o},{"pict-view":102}],52:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Docuserve-Splash",DefaultRenderable:"Docuserve-Splash-Content",DefaultDestinationAddress:"#Docuserve-Content-Container",AutoRender:!1,CSS:"\n\t\t.docuserve-splash {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-height: calc(100vh - 56px);\n\t\t\tpadding: 3em 2em;\n\t\t\ttext-align: center;\n\t\t\tbackground: var(--docuserve-bg);\n\t\t}\n\t\t.docuserve-splash h1 {\n\t\t\tfont-size: 3em;\n\t\t\tfont-weight: 700;\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t\tmargin: 0 0 0.25em 0;\n\t\t}\n\t\t.docuserve-splash h1 small {\n\t\t\tfont-size: 0.4em;\n\t\t\tfont-weight: 400;\n\t\t\tcolor: var(--docuserve-text-dim);\n\t\t\tvertical-align: middle;\n\t\t\tmargin-left: 0.15em;\n\t\t}\n\t\t.docuserve-splash-tagline {\n\t\t\tfont-size: 1.25em;\n\t\t\tcolor: var(--docuserve-text-muted);\n\t\t\tmargin-bottom: 1.5em;\n\t\t\tfont-style: italic;\n\t\t}\n\t\t.docuserve-splash-description {\n\t\t\tfont-size: 1em;\n\t\t\tcolor: var(--docuserve-text-muted);\n\t\t\tmax-width: 600px;\n\t\t\tline-height: 1.7;\n\t\t\tmargin-bottom: 2em;\n\t\t}\n\t\t.docuserve-splash-highlights {\n\t\t\tdisplay: grid;\n\t\t\tgrid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n\t\t\tgap: 1.25em;\n\t\t\tmax-width: 900px;\n\t\t\twidth: 100%;\n\t\t\tmargin-bottom: 2.5em;\n\t\t}\n\t\t.docuserve-splash-highlight-card {\n\t\t\tbackground: var(--docuserve-bg-elevated);\n\t\t\tborder: 1px solid var(--docuserve-border);\n\t\t\tborder-radius: 8px;\n\t\t\tpadding: 1.25em;\n\t\t\ttext-align: left;\n\t\t\ttransition: box-shadow 0.2s, border-color 0.2s;\n\t\t}\n\t\t.docuserve-splash-highlight-card:hover {\n\t\t\tbox-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);\n\t\t\tborder-color: var(--docuserve-accent);\n\t\t}\n\t\t.docuserve-splash-highlight-card h3 {\n\t\t\tmargin: 0 0 0.5em 0;\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t\tfont-size: 1em;\n\t\t}\n\t\t.docuserve-splash-highlight-card p {\n\t\t\tmargin: 0;\n\t\t\tcolor: var(--docuserve-text-muted);\n\t\t\tfont-size: 0.85em;\n\t\t\tline-height: 1.5;\n\t\t}\n\t\t.docuserve-splash-actions {\n\t\t\tdisplay: flex;\n\t\t\tgap: 1em;\n\t\t\tflex-wrap: wrap;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.docuserve-splash-actions a {\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 0.7em 1.5em;\n\t\t\tborder-radius: 6px;\n\t\t\tfont-size: 0.95em;\n\t\t\tfont-weight: 600;\n\t\t\ttext-decoration: none;\n\t\t\ttransition: background-color 0.15s, color 0.15s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-splash-actions .primary {\n\t\t\tbackground-color: var(--docuserve-accent);\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-splash-actions .primary:hover {\n\t\t\tbackground-color: var(--docuserve-accent-hover);\n\t\t}\n\t\t.docuserve-splash-actions .secondary {\n\t\t\tbackground-color: var(--docuserve-bg-elevated);\n\t\t\tcolor: var(--docuserve-text-strong);\n\t\t\tborder: 2px solid var(--docuserve-accent);\n\t\t}\n\t\t.docuserve-splash-actions .secondary:hover {\n\t\t\tborder-color: var(--docuserve-accent-hover);\n\t\t\tcolor: var(--docuserve-accent);\n\t\t}\n\t",Templates:[{Hash:"Docuserve-Splash-Template",Template:'\n<div class="docuserve-splash">\n\t<h1 id="Docuserve-Splash-Title"></h1>\n\t<div class="docuserve-splash-tagline" id="Docuserve-Splash-Tagline"></div>\n\t<div class="docuserve-splash-description" id="Docuserve-Splash-Description"></div>\n\t<div class="docuserve-splash-highlights" id="Docuserve-Splash-Highlights"></div>\n\t<div class="docuserve-splash-actions" id="Docuserve-Splash-Actions"></div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-Splash-Content",TemplateHash:"Docuserve-Splash-Template",DestinationAddress:"#Docuserve-Content-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(t,e,i,n){let o=this.pict.AppData.Docuserve;return o.CoverLoaded&&o.Cover?this.renderFromCover(o.Cover):this.renderFromCatalog(o),super.onAfterRender(t,e,i,n)}renderFromCover(t){this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Title",this.sanitizeTitle(t.Title)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Tagline",this.escapeHTML(t.Tagline)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Description",this.escapeHTML(t.Description));let e="";for(let i=0;i<t.Highlights.length;i++){let n=t.Highlights[i];e+='<div class="docuserve-splash-highlight-card">',n.Label&&(e+="<h3>"+this.escapeHTML(n.Label)+"</h3>"),e+="<p>"+this.escapeHTML(n.Text)+"</p>",e+="</div>"}this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Highlights",e);let i="",n=this.pict.providers["Docuserve-Documentation"];for(let e=0;e<t.Actions.length;e++){let o=t.Actions[e],r=0===e?"primary":"secondary",a=o.Href;if(a.match(/^https?:\/\//))i+='<a class="'+r+'" href="'+this.escapeHTML(a)+'" target="_blank" rel="noopener">'+this.escapeHTML(o.Text)+"</a>";else{let t=n.convertSidebarLink(a);i+='<a class="'+r+'" href="'+this.escapeHTML(t)+'">'+this.escapeHTML(o.Text)+"</a>"}}this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Actions",i)}renderFromCatalog(t){let e="Documentation",i="";t.CatalogLoaded&&t.Catalog&&t.Catalog.Name?e=t.Catalog.Name:t.TopBarLoaded&&t.TopBar&&t.TopBar.Brand?e=t.TopBar.Brand:"undefined"!=typeof document&&document.title&&(e=document.title),t.CatalogLoaded&&t.Catalog&&t.Catalog.Description&&(i=t.Catalog.Description),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Title",this.escapeHTML(e)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Tagline",this.escapeHTML(i)),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Description","");let n="",o=t.SidebarGroups||[];for(let t=0;t<o.length;t++){let e=o[t];if(!e.Modules||e.Modules.length<1)continue;let i=e.Description||e.Modules.length+" modules";n+='<div class="docuserve-splash-highlight-card">',n+="<h3>"+this.escapeHTML(e.Name)+"</h3>",n+="<p>"+this.escapeHTML(i)+"</p>",n+="</div>"}this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Highlights",n),this.pict.ContentAssignment.assignContent("#Docuserve-Splash-Actions","")}sanitizeTitle(t){return t?this.escapeHTML(t).replace(/<small>/gi,"<small>").replace(/<\/small>/gi,"</small>"):""}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}},e.exports.default_configuration=o},{"pict-view":102}],53:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Docuserve-TopBar",DefaultRenderable:"Docuserve-TopBar-Content",DefaultDestinationAddress:"#Docuserve-TopBar-Container",AutoRender:!1,CSS:'\n\t\t.docuserve-topbar {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tbackground-color: var(--docuserve-topbar-bg);\n\t\t\tcolor: var(--docuserve-topbar-text);\n\t\t\tpadding: 0 1.5em;\n\t\t\theight: 56px;\n\t\t\tbox-shadow: 0 2px 4px rgba(0, 0, 0, 0.18);\n\t\t\tposition: sticky;\n\t\t\ttop: 0;\n\t\t\tz-index: 100;\n\t\t\ttransition: background-color 0.15s ease, color 0.15s ease;\n\t\t}\n\t\t.docuserve-topbar-brand {\n\t\t\tfont-size: 1.25em;\n\t\t\tfont-weight: 600;\n\t\t\tletter-spacing: 0.02em;\n\t\t\tcolor: var(--docuserve-topbar-text);\n\t\t\ttext-decoration: none;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-topbar-brand small {\n\t\t\tfont-size: 0.65em;\n\t\t\tfont-weight: 400;\n\t\t\tcolor: var(--docuserve-topbar-text-dim);\n\t\t\tmargin-left: 0.2em;\n\t\t}\n\t\t.docuserve-topbar-brand:hover {\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-topbar-brandgroup {\n\t\t\tdisplay: flex;\n\t\t\talign-items: baseline;\n\t\t\tgap: 0.6em;\n\t\t}\n\t\t.docuserve-topbar-version {\n\t\t\tfont-size: 0.75em;\n\t\t\tfont-weight: 500;\n\t\t\tcolor: var(--docuserve-topbar-version-text);\n\t\t\tbackground-color: var(--docuserve-topbar-version-bg);\n\t\t\tborder: 1px solid var(--docuserve-topbar-version-border);\n\t\t\tpadding: 0.12em 0.5em;\n\t\t\tborder-radius: 10px;\n\t\t\tfont-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n\t\t\tletter-spacing: 0.02em;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.docuserve-topbar-version:empty {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.docuserve-topbar-nav {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.25em;\n\t\t}\n\t\t.docuserve-topbar-nav a {\n\t\t\tcolor: var(--docuserve-topbar-text-muted);\n\t\t\ttext-decoration: none;\n\t\t\tpadding: 0.5em 0.75em;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.9em;\n\t\t\ttransition: background-color 0.15s, color 0.15s;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.docuserve-topbar-nav a:hover {\n\t\t\tbackground-color: var(--docuserve-topbar-hover-bg);\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-topbar-links {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.5em;\n\t\t}\n\t\t.docuserve-topbar-links a {\n\t\t\tcolor: var(--docuserve-topbar-text-dim);\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.85em;\n\t\t\tpadding: 0.4em 0.6em;\n\t\t\tborder-radius: 4px;\n\t\t\ttransition: background-color 0.15s, color 0.15s;\n\t\t}\n\t\t.docuserve-topbar-links a:hover {\n\t\t\tbackground-color: var(--docuserve-topbar-hover-bg);\n\t\t\tcolor: var(--docuserve-topbar-text);\n\t\t}\n\t\t.docuserve-topbar-theme {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 2px;\n\t\t\tmargin: 0 0.35em 0 0.15em;\n\t\t\tpadding: 2px;\n\t\t\tbackground: rgba(255, 255, 255, 0.035);\n\t\t\tborder: 1px solid rgba(255, 255, 255, 0.08);\n\t\t\tborder-radius: 999px;\n\t\t}\n\t\t.docuserve-topbar-theme-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 24px;\n\t\t\theight: 24px;\n\t\t\tpadding: 0;\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tborder-radius: 999px;\n\t\t\tcolor: var(--docuserve-topbar-text-dim);\n\t\t\tcursor: pointer;\n\t\t\ttransition: background-color 0.15s ease, color 0.15s ease;\n\t\t}\n\t\t.docuserve-topbar-theme-btn svg {\n\t\t\tdisplay: block;\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t\tstroke: currentColor;\n\t\t\tfill: none;\n\t\t\tstroke-width: 1.75;\n\t\t\tstroke-linecap: round;\n\t\t\tstroke-linejoin: round;\n\t\t}\n\t\t.docuserve-topbar-theme-btn:hover {\n\t\t\tcolor: var(--docuserve-topbar-text);\n\t\t}\n\t\t.docuserve-topbar-theme-btn[aria-pressed="true"] {\n\t\t\tbackground: var(--docuserve-topbar-hover-bg);\n\t\t\tcolor: var(--docuserve-topbar-text);\n\t\t}\n\t\t.docuserve-topbar-toggle {\n\t\t\tdisplay: none;\n\t\t\tbackground: none;\n\t\t\tborder: none;\n\t\t\tcolor: var(--docuserve-topbar-text-muted);\n\t\t\tfont-size: 1.3em;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 0.3em 0.5em;\n\t\t\tmargin-left: 0.5em;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.docuserve-topbar-toggle:hover {\n\t\t\tcolor: #fff;\n\t\t}\n\t\t.docuserve-topbar-right {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t}\n\t',Templates:[{Hash:"Docuserve-TopBar-Template",Template:'\n<div class="docuserve-topbar">\n\t<div class="docuserve-topbar-brandgroup">\n\t\t<a id="Docuserve-TopBar-Brand" class="docuserve-topbar-brand" href="#/Home"></a>\n\t\t<span id="Docuserve-TopBar-Version" class="docuserve-topbar-version" title=""></span>\n\t</div>\n\t<div id="Docuserve-TopBar-Nav" class="docuserve-topbar-nav"></div>\n\t<div class="docuserve-topbar-right">\n\t\t<div id="Docuserve-TopBar-Links" class="docuserve-topbar-links"></div>\n\t\t<div id="Docuserve-TopBar-Theme" class="docuserve-topbar-theme" role="group" aria-label="Theme">\n\t\t\t<button type="button" class="docuserve-topbar-theme-btn" data-theme-choice="system" aria-label="Use system theme" aria-pressed="false"><svg viewBox="0 0 16 16" aria-hidden="true"><rect x="1.75" y="2.5" width="12.5" height="8.5" rx="1.25"></rect><line x1="5.5" y1="13.5" x2="10.5" y2="13.5"></line><line x1="8" y1="11" x2="8" y2="13.5"></line></svg></button>\n\t\t\t<button type="button" class="docuserve-topbar-theme-btn" data-theme-choice="light" aria-label="Use light theme" aria-pressed="false"><svg viewBox="0 0 16 16" aria-hidden="true"><circle cx="8" cy="8" r="3.25"></circle><line x1="8" y1="1.25" x2="8" y2="2.75"></line><line x1="8" y1="13.25" x2="8" y2="14.75"></line><line x1="1.25" y1="8" x2="2.75" y2="8"></line><line x1="13.25" y1="8" x2="14.75" y2="8"></line><line x1="3.25" y1="3.25" x2="4.3" y2="4.3"></line><line x1="11.7" y1="11.7" x2="12.75" y2="12.75"></line><line x1="3.25" y1="12.75" x2="4.3" y2="11.7"></line><line x1="11.7" y1="4.3" x2="12.75" y2="3.25"></line></svg></button>\n\t\t\t<button type="button" class="docuserve-topbar-theme-btn" data-theme-choice="dark" aria-label="Use dark theme" aria-pressed="false"><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M13.25 9.5A5.5 5.5 0 0 1 6.5 2.75a5.5 5.5 0 1 0 6.75 6.75z"></path></svg></button>\n\t\t</div>\n\t\t<button id="Docuserve-TopBar-Toggle" class="docuserve-topbar-toggle" onclick="{~P~}.views[\'Docuserve-Sidebar\'].toggleSidebar()">☰</button>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"Docuserve-TopBar-Content",TemplateHash:"Docuserve-TopBar-Template",DestinationAddress:"#Docuserve-TopBar-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(t,e,i,n){return this.renderTopBarContent(),this.initThemeToggle(),super.onAfterRender(t,e,i,n)}getThemeStorageKey(){try{let t=(window.location.pathname||"/").replace(/\/[^/]*$/,"/");return"docuserve-theme:"+window.location.origin+t}catch(t){return"docuserve-theme"}}initThemeToggle(){let t=document.getElementById("Docuserve-TopBar-Theme");if(!t)return;let e=t.querySelectorAll(".docuserve-topbar-theme-btn"),i=this.getThemeStorageKey(),n=null;try{n=localStorage.getItem(i)}catch(t){}"light"!==n&&"dark"!==n&&"system"!==n&&(n="system"),this.applyTheme(n,e,i);for(let t=0;t<e.length;t++){let n=e[t];n.addEventListener("click",()=>{let t=n.getAttribute("data-theme-choice");this.applyTheme(t,e,i)})}}applyTheme(t,e,i){"light"===t?document.documentElement.setAttribute("data-theme","light"):"dark"===t?document.documentElement.setAttribute("data-theme","dark"):(document.documentElement.removeAttribute("data-theme"),t="system");try{localStorage.setItem(i,t)}catch(t){}if(e)for(let i=0;i<e.length;i++){let n=e[i],o=n.getAttribute("data-theme-choice")===t;n.setAttribute("aria-pressed",o?"true":"false")}}renderTopBarContent(){let t=this.pict.AppData.Docuserve,e=document.getElementById("Docuserve-TopBar-Brand"),i=document.getElementById("Docuserve-TopBar-Nav"),n=document.getElementById("Docuserve-TopBar-Links"),o=document.getElementById("Docuserve-TopBar-Version");if(e&&i&&n)if(this.renderVersionChip(o,t),t.TopBarLoaded&&t.TopBar){let o=t.TopBar;e.innerHTML=this.sanitizeTitle(o.Brand||"Documentation");let r='<a href="#/Home">Home</a>';for(let t=0;t<o.NavLinks.length;t++){let e=o.NavLinks[t];r+='<a href="'+e.Href+'">'+this.escapeHTML(e.Text)+"</a>"}i.innerHTML=r;let a="";t.KeywordIndexLoaded&&(a+='<a href="#/search/">Search</a>');for(let t=0;t<o.ExternalLinks.length;t++){let e=o.ExternalLinks[t];a+='<a href="'+this.escapeHTML(e.Href)+'" target="_blank" rel="noopener">'+this.escapeHTML(e.Text)+"</a>"}n.innerHTML=a}else{let o="Documentation";t.CoverLoaded&&t.Cover&&t.Cover.Title?o=t.Cover.Title:t.CatalogLoaded&&t.Catalog&&t.Catalog.Name&&(o=t.Catalog.Name),e.innerHTML=this.sanitizeTitle(o),i.innerHTML='<a href="#/Home">Home</a>',n.innerHTML=t.KeywordIndexLoaded?'<a href="#/search/">Search</a>':""}}renderVersionChip(t,e){if(!t)return;if(!e.VersionLoaded||!e.Version||!e.Version.Version)return t.innerHTML="",void t.setAttribute("title","");let i=e.Version;t.innerHTML="v"+this.escapeHTML(i.Version);let n=[];i.Name?n.push(i.Name+" v"+i.Version):n.push("v"+i.Version),i.GeneratedAt&&n.push("built "+this.formatVersionDate(i.GeneratedAt)),i.GitCommit&&n.push(i.GitCommit),t.setAttribute("title",n.join(" · "))}formatVersionDate(t){if(!t)return"";let e=String(t).match(/^(\d{4}-\d{2}-\d{2})/);return e?e[1]:String(t)}sanitizeTitle(t){return t?this.escapeHTML(t).replace(/<small>/gi,"<small>").replace(/<\/small>/gi,"</small>"):""}escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):""}},e.exports.default_configuration=o},{"pict-view":102}],54:[function(t,e,i){e.exports="\n/* ── Vocabulary term marker ─────────────────────────── */\n.pict-vocab-term {\n\tborder-bottom: 1px dotted var(--accent, #2a8a7a);\n\tcursor: help;\n}\n\n/* ── Popover ────────────────────────────────────────── */\n.vocab-popover {\n\tposition: fixed;\n\tz-index: 10000;\n\tmax-width: 320px;\n\tpadding: 12px 16px;\n\tbackground: var(--bg-secondary, #1a2a2a);\n\tborder: 1px solid var(--border-color, #2a3a3a);\n\tborder-radius: 6px;\n\tbox-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);\n\tfont-size: 0.85em;\n\tline-height: 1.5;\n\tcolor: var(--text-primary, #d0dada);\n}\n\n.vocab-popover-title {\n\tfont-weight: bold;\n\tmargin-bottom: 6px;\n\tcolor: var(--accent, #2a8a7a);\n}\n\n.vocab-popover-short {\n\tmargin-bottom: 8px;\n\tcolor: var(--text-secondary, #8ca0a0);\n}\n\n.vocab-popover-link {\n\tcolor: var(--accent, #2a8a7a);\n\ttext-decoration: none;\n\tfont-size: 0.85em;\n}\n.vocab-popover-link:hover {\n\ttext-decoration: underline;\n}\n\n/* ── Vocabulary Manager View ────────────────────────── */\n.vocab-layout {\n\tdisplay: flex;\n\theight: calc(100vh - 80px);\n\tgap: 0;\n}\n\n.vocab-sidebar {\n\twidth: 260px;\n\tmin-width: 200px;\n\tborder-right: 1px solid var(--border-color, #2a3a3a);\n\toverflow-y: auto;\n\tbackground: var(--bg-secondary, #1a2a2a);\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.vocab-sidebar-header {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 12px 14px;\n\tborder-bottom: 1px solid var(--border-color, #2a3a3a);\n}\n\n.vocab-content {\n\tflex: 1;\n\toverflow-y: auto;\n\tpadding: 0;\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n.vocab-list {\n\tflex: 1;\n\toverflow-y: auto;\n\tpadding: 6px 0;\n}\n\n.vocab-item {\n\tpadding: 6px 14px;\n\tcursor: pointer;\n\tfont-size: 0.85em;\n\tcolor: var(--text-secondary, #8ca0a0);\n\tborder-left: 3px solid transparent;\n}\n.vocab-item:hover {\n\tbackground: var(--bg-hover, #2a3a3a);\n}\n.vocab-item-active {\n\tbackground: var(--bg-hover, #2a3a3a);\n\tcolor: var(--text-primary, #d0dada);\n\tborder-left-color: var(--accent, #2a8a7a);\n}\n\n.vocab-item-title {\n\tfont-weight: 600;\n\tcolor: var(--text-primary, #d0dada);\n}\n.vocab-item-short {\n\tfont-size: 0.78em;\n\tcolor: var(--text-muted, #6a8080);\n\tmargin-top: 2px;\n\tline-height: 1.3;\n}\n\n.vocab-filter {\n\tmargin: 8px 10px;\n\tpadding: 6px 10px;\n\tborder: 1px solid var(--border-color, #2a3a3a);\n\tborder-radius: 4px;\n\tbackground: var(--bg-primary, #0e1818);\n\tcolor: var(--text-primary, #d0dada);\n\tfont-size: 0.85em;\n}\n.vocab-filter:focus {\n\tborder-color: var(--accent, #2a8a7a);\n\toutline: none;\n}\n\n.vocab-toolbar {\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tpadding: 10px 16px;\n\tborder-bottom: 1px solid var(--border-color, #2a3a3a);\n\tbackground: var(--bg-secondary, #1a2a2a);\n}\n\n.vocab-slug {\n\tflex: 1;\n\tfont-family: 'SF Mono', Menlo, Monaco, monospace;\n\tfont-size: 0.82em;\n\tcolor: var(--text-muted, #6a8080);\n}\n\n.vocab-btn {\n\tpadding: 4px 12px;\n\tborder: 1px solid var(--border-color, #2a3a3a);\n\tborder-radius: 4px;\n\tbackground: var(--bg-primary, #0e1818);\n\tcolor: var(--text-secondary, #8ca0a0);\n\tcursor: pointer;\n\tfont-size: 0.82em;\n}\n.vocab-btn:hover {\n\tbackground: var(--bg-hover, #2a3a3a);\n}\n.vocab-btn-primary {\n\tbackground: var(--accent, #2a8a7a);\n\tborder-color: var(--accent, #2a8a7a);\n\tcolor: #fff;\n}\n.vocab-btn-danger {\n\tcolor: #D9534F;\n\tborder-color: #D9534F;\n}\n.vocab-btn-danger:hover {\n\tbackground: #D9534F;\n\tborder-color: #D9534F;\n\tcolor: #fff;\n}\n\n.vocab-rendered {\n\tflex: 1;\n\tpadding: 20px 24px;\n\toverflow-y: auto;\n\tline-height: 1.6;\n}\n\n.vocab-editor {\n\tflex: 1;\n\twidth: 100%;\n\tpadding: 16px 20px;\n\tborder: none;\n\tbackground: var(--bg-primary, #0e1818);\n\tcolor: var(--text-primary, #d0dada);\n\tfont-family: 'SF Mono', Menlo, Monaco, monospace;\n\tfont-size: 0.85em;\n\tline-height: 1.5;\n\tresize: none;\n}\n.vocab-editor:focus {\n\toutline: none;\n}\n\n.vocab-empty {\n\tpadding: 40px 24px;\n\ttext-align: center;\n\tcolor: var(--text-muted, #6a8080);\n\tfont-size: 0.9em;\n}\n\n/* ── Term preview (expanded active item) ───────────── */\n.vocab-item-preview-short {\n\tmargin-top: 6px;\n\tpadding: 6px 0;\n\tcolor: var(--text-secondary, #8ca0a0);\n\tfont-size: 0.8em;\n\tline-height: 1.4;\n\tborder-bottom: 1px solid var(--border-color, #2a3a3a);\n}\n.vocab-item-preview-body {\n\tmargin-top: 6px;\n\tpadding: 8px 10px;\n\tbackground: var(--bg-primary, #0e1818);\n\tborder-radius: 4px;\n\tcolor: var(--text-muted, #6a8080);\n\twhite-space: pre-wrap;\n\tfont-family: 'SF Mono', Menlo, Monaco, monospace;\n\tfont-size: 0.72em;\n\tline-height: 1.4;\n\tmax-height: 200px;\n\toverflow-y: auto;\n}\n.vocab-item-preview-actions {\n\tmargin-top: 6px;\n\tpadding-bottom: 2px;\n}\n\n/* ── Create-term modal overlay ─────────────────────── */\n.vocab-create-overlay {\n\tdisplay: none;\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\tright: 0;\n\tbottom: 0;\n\tz-index: 10001;\n\tbackground: rgba(0, 0, 0, 0.35);\n}\n.vocab-create-overlay.open {\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n.vocab-create-panel {\n\tbackground: var(--bg-primary, #0e1818);\n\tborder: 1px solid var(--border-color, #2a3a3a);\n\tborder-radius: 10px;\n\tbox-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);\n\twidth: 360px;\n\tmax-width: 90vw;\n\toverflow: hidden;\n}\n.vocab-create-body {\n\tpadding: 24px 22px 16px;\n}\n.vocab-create-title {\n\tfont-size: 0.95rem;\n\tfont-weight: 600;\n\tcolor: var(--text-primary, #d0dada);\n\tmargin-bottom: 12px;\n\ttext-align: center;\n}\n.vocab-create-input {\n\tdisplay: block;\n\twidth: 100%;\n\tbox-sizing: border-box;\n\tpadding: 8px 12px;\n\tborder: 1px solid var(--border-color, #2a3a3a);\n\tborder-radius: 5px;\n\tbackground: var(--bg-secondary, #1a2a2a);\n\tcolor: var(--text-primary, #d0dada);\n\tfont-size: 0.88rem;\n\tfont-family: 'SF Mono', Menlo, Monaco, monospace;\n}\n.vocab-create-input:focus {\n\tborder-color: var(--accent, #2a8a7a);\n\toutline: none;\n}\n.vocab-create-actions {\n\tdisplay: flex;\n\tgap: 10px;\n\tjustify-content: center;\n\tpadding: 0 22px 16px;\n}\n.vocab-create-footer {\n\tpadding: 10px 22px;\n\tborder-top: 1px solid var(--border-color, #2a3a3a);\n\tfont-size: 0.72rem;\n\tcolor: var(--text-muted, #6a8080);\n\ttext-align: center;\n}\n.vocab-create-footer kbd {\n\tdisplay: inline-block;\n\tpadding: 1px 5px;\n\tfont-size: 0.68rem;\n\tfont-family: monospace;\n\tbackground: var(--bg-secondary, #1a2a2a);\n\tborder: 1px solid var(--border-color, #2a3a3a);\n\tborder-radius: 3px;\n\tcolor: var(--text-secondary, #8ca0a0);\n}\n"},{}],55:[function(t,e,i){
|
|
58
58
|
/**
|
|
59
59
|
* Pict Provider: Vocabulary
|
|
60
60
|
*
|
|
@@ -124,7 +124,7 @@ const n=t("pict-view"),o={ViewIdentifier:"Pict-VocabularyManager",DefaultRendera
|
|
|
124
124
|
* @license MIT
|
|
125
125
|
* @author Steven Velozo <steven@velozo.com>
|
|
126
126
|
*/
|
|
127
|
-
const n=t("fable-serviceproviderbase"),o=t("path"),r=t("fs"),a=t("url"),s={BasePath:".",APIRoutePrefix:"/api/filebrowser",WebAppRoute:"/filebrowser/*",WebAppRouteStrip:"/filebrowser/",ServeWebApp:!0,IncludeHiddenFiles:!1,MaxTreeDepth:2};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this.serviceType="PictFileBrowserService";for(let t in s)t in this.options||(this.options[t]=s[t]);this.basePath=o.resolve(this.options.BasePath)}connectRoutes(){if(!this.fable.Orator||!this.fable.Orator.serviceServer)return this.log.error("PictFileBrowserService: Orator service server is not available. Initialize Orator first."),!1;let t=this.fable.Orator.serviceServer,e=this.options.APIRoutePrefix;if(t.get(e+"/list",(t,e,i)=>{let n=this.parseQueryParams(t).path||"";this.listDirectory(n,(t,n)=>t?(e.send(400,{Error:t.message}),i()):(e.send(n),i()))}),t.get(e+"/tree",(t,e,i)=>{let n=this.parseQueryParams(t),o=this.options.MaxTreeDepth;n.depth&&(o=parseInt(n.depth)||this.options.MaxTreeDepth),this.buildFolderTree("",o,(t,n)=>t?(e.send(400,{Error:t.message}),i()):(e.send(n),i()))}),t.get(e+"/info",(t,e,i)=>{let n=this.parseQueryParams(t).path||"";this.getFileInfo(n,(t,n)=>t?(e.send(400,{Error:t.message}),i()):(e.send(n),i()))}),t.get(e+"/children",(t,e,i)=>{let n=this.parseQueryParams(t).path||"";this.listChildFolders(n,(t,n)=>t?(e.send(400,{Error:t.message}),i()):(e.send(n),i()))}),this.options.ServeWebApp){let t=o.join(i,"..","www");this.fable.Orator.addStaticRoute(t,"index.html",this.options.WebAppRoute,this.options.WebAppRouteStrip)}return this.log.info("PictFileBrowserService: Routes connected. Browsing path: "+this.basePath),!0}parseQueryParams(t){if(t.query&&"object"==typeof t.query)return t.query;return a.parse(t.url,!0).query||{}}resolveSafePath(t){let e=(t||"").replace(/\.\./g,"").replace(/\/\//g,"/"),i=o.resolve(this.basePath,e);return 0!==i.indexOf(this.basePath)?null:i}listDirectory(t,e){let i=this.resolveSafePath(t);if(!i)return e(new Error("Invalid path"));r.readdir(i,{withFileTypes:!0},(n,a)=>{if(n)return"ENOENT"===n.code?e(new Error("Path not found")):"ENOTDIR"===n.code?e(new Error("Path is not a directory")):e(n);let s=[],l=a.length;if(0===l)return e(null,s);for(let n=0;n<a.length;n++){let d=a[n],c=d.name;if(!this.options.IncludeHiddenFiles&&"."===c.charAt(0)){if(l--,0===l)return e(null,s);continue}let p=o.join(i,c),h=t?t+"/"+c:c;r.stat(p,((t,i,n)=>(r,a)=>{let d={Name:t,Path:i,Type:n?"folder":"file"};if(a&&!r&&(d.Size=a.size,d.Modified=a.mtime,d.Created=a.birthtime,n||(d.Extension=o.extname(t))),s.push(d),l--,0===l)return e(null,s)})(c,h,d.isDirectory()))}})}listChildFolders(t,e){let i=this.resolveSafePath(t);if(!i)return e(new Error("Invalid path"));r.readdir(i,{withFileTypes:!0},(n,a)=>{if(n)return"ENOENT"===n.code?e(new Error("Path not found")):"ENOTDIR"===n.code?e(new Error("Path is not a directory")):e(n);let s=[];for(let t=0;t<a.length;t++){if(!a[t].isDirectory())continue;let e=a[t].name;(this.options.IncludeHiddenFiles||"."!==e.charAt(0))&&s.push(e)}if(s.sort((t,e)=>t.localeCompare(e)),0===s.length)return e(null,[]);let l=[],d=s.length;for(let n=0;n<s.length;n++){let a=s[n],c=o.join(i,a),p=t?t+"/"+a:a;r.readdir(c,{withFileTypes:!0},((t,i)=>(n,o)=>{let r=!1;if(!n&&o)for(let t=0;t<o.length;t++)if(o[t].isDirectory()){let e=o[t].name;if(this.options.IncludeHiddenFiles||"."!==e.charAt(0)){r=!0;break}}if(l.push({Name:t,Path:i,HasChildren:r}),d--,0===d)return l.sort((t,e)=>t.Name.localeCompare(e.Name)),e(null,l)})(a,p))}})}buildFolderTree(t,e,i){let n=this.resolveSafePath(t);if(!n)return i(new Error("Invalid path"));this._buildTreeRecursive(n,t,e,0,i)}_buildTreeRecursive(t,e,i,n,a){if(i>0&&n>=i)return a(null,[]);r.readdir(t,{withFileTypes:!0},(r,s)=>{if(r)return a(null,[]);let l=[];for(let t=0;t<s.length;t++)if(s[t].isDirectory()){let e=s[t].name;if(!this.options.IncludeHiddenFiles&&"."===e.charAt(0))continue;l.push(e)}if(0===l.length)return a(null,[]);let d=[],c=l.length;for(let r=0;r<l.length;r++){let s=l[r],p=o.join(t,s),h=e?e+"/"+s:s;this._buildTreeRecursive(p,h,i,n+1,((t,e)=>(i,n)=>{if(d.push({Name:t,Path:e,Children:n||[]}),c--,0===c)return d.sort((t,e)=>t.Name.localeCompare(e.Name)),a(null,d)})(s,h))}})}getFileInfo(t,e){let i=this.resolveSafePath(t);if(!i)return e(new Error("Invalid path"));r.stat(i,(n,r)=>{if(n)return"ENOENT"===n.code?e(new Error("Path not found")):e(n);let a=o.basename(i),s={Name:a,Path:t||a,Type:r.isDirectory()?"folder":"file",Size:r.size,Modified:r.mtime,Created:r.birthtime};return r.isDirectory()||(s.Extension=o.extname(a)),e(null,s)})}},e.exports.default_configuration=s}).call(this)}).call(this,"/node_modules/pict-section-filebrowser/source/services")},{"fable-serviceproviderbase":20,fs:2,path:42,url:127}],73:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Pict-FileBrowser-BrowseSearch",DefaultRenderable:"BrowseSearch-Container",DefaultDestinationAddress:"#Pict-FileBrowser-BrowsePane",AutoRender:!1,Templates:[{Hash:"FileBrowser-BrowseSearch-Container-Template",Template:'\n<div class="pict-fb-search">\n\t<input type="text" class="pict-fb-search-input"\n\t\tid="Pict-FileBrowser-SearchInput"\n\t\tplaceholder="Search files..."\n\t\toninput="pict.views[\'{~D:Record.ViewHash~}\'].onSearchInput(this.value)" />\n\t<div class="pict-fb-search-results" id="Pict-FileBrowser-SearchResults"></div>\n</div>\n'},{Hash:"FileBrowser-BrowseSearch-Result-Template",Template:'\n<div class="pict-fb-search-result" onclick="{~D:Record.ClickHandler~}">\n\t<span class="pict-fb-search-result-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-search-result-name">{~D:Record.Name~}</span>\n\t<span class="pict-fb-search-result-path">{~D:Record.Path~}</span>\n</div>\n'},{Hash:"FileBrowser-BrowseSearch-Empty-Template",Template:'<div class="pict-fb-empty">{~D:Record.Message~}</div>'}],Renderables:[{RenderableHash:"BrowseSearch-Container",TemplateHash:"FileBrowser-BrowseSearch-Container-Template",DestinationAddress:"#Pict-FileBrowser-BrowsePane",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},o,e),i),this.lastQuery="",this.debounceTimer=null}onAfterRender(t){let e=this.pict.parseTemplateByHash("FileBrowser-BrowseSearch-Container-Template",{ViewHash:this.Hash});return this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-BrowsePane",e),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}onSearchInput(t){this.lastQuery=t||"",this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.performSearch(this.lastQuery)},150)}performSearch(t){let e="#Pict-FileBrowser-SearchResults";if(!t||t.length<1)return void this.pict.ContentAssignment.assignContent(e,"");let i=this.pict.providers["Pict-FileBrowser-Browse"];if(!i)return;let n=i.searchFiles(t),o=this.pict.providers["Pict-FileBrowser-List"];if(0===n.length){let t=this.pict.parseTemplateByHash("FileBrowser-BrowseSearch-Empty-Template",{Message:"No results found"});return void this.pict.ContentAssignment.assignContent(e,t)}let r="";for(let t=0;t<n.length&&t<50;t++){let e=n[t],i=o?o.getEntryIcon(e):"📄",a=e.Path||"",s={Name:e.Name,Path:a,Icon:i,ClickHandler:"pict.views['"+this.Hash+"'].selectResult("+t+")"};r+=this.pict.parseTemplateByHash("FileBrowser-BrowseSearch-Result-Template",s)}this.pict.ContentAssignment.assignContent(e,r),this._lastResults=n}selectResult(t){if(!this._lastResults||t>=this._lastResults.length)return;let e=this._lastResults[t],i=this.pict.providers["Pict-FileBrowser-List"];i&&i.openEntry(e)}},e.exports.default_configuration=o},{"pict-view":102}],74:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Pict-FileBrowser-BrowseTree",DefaultRenderable:"BrowseTree-Container",DefaultDestinationAddress:"#Pict-FileBrowser-BrowsePane",AutoRender:!1,Templates:[{Hash:"FileBrowser-BrowseTree-Container-Template",Template:'<div class="pict-fb-tree" id="Pict-FileBrowser-Tree"></div>'},{Hash:"FileBrowser-BrowseTree-Node-Template",Template:'\n<div class="pict-fb-tree-node{~D:Record.SelectedClass~}" style="padding-left: {~D:Record.Indent~}px;" data-path="{~D:Record.Path~}" onclick="{~D:Record.ClickHandler~}">\n\t<span class="{~D:Record.ToggleClass~}" onclick="{~D:Record.ToggleHandler~}">{~D:Record.ToggleIcon~}</span>\n\t<span class="pict-fb-tree-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-tree-label">{~D:Record.Name~}</span>\n</div>\n<div class="pict-fb-tree-children{~D:Record.ExpandedClass~}" id="Pict-FB-TreeChildren-{~D:Record.NodeID~}">\n{~D:Record.ChildrenHTML~}\n</div>\n'}],Renderables:[{RenderableHash:"BrowseTree-Container",TemplateHash:"FileBrowser-BrowseTree-Container-Template",DestinationAddress:"#Pict-FileBrowser-BrowsePane",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},o,e),i),this.expandedPaths={}}onAfterRender(t){return this.rebuildTree(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildTree(){if(!this.pict.providers["Pict-FileBrowser-Browse"])return;let t=this.getCurrentLocation(),e=this.renderTreeLevel("",0,t);this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-Tree",e)}renderTreeLevel(t,e,i){let n=this.pict.providers["Pict-FileBrowser-Browse"];if(!n)return"";let o=n.getChildFolders(t);if(!o)return this.expandedPaths[t]?'<div class="pict-fb-tree-loading" style="padding-left: '+(24+16*e)+'px;">Loading...</div>':"";let r="";for(let t=0;t<o.length;t++){let a=o[t],s=a.Path,l=s.replace(/[^a-zA-Z0-9]/g,"_"),d=!!this.expandedPaths[s],c=s===i,p=n.getChildFolders(s),h=a.HasChildren||p&&p.length>0,u="";d&&(u=this.renderTreeLevel(s,e+1,i));let m=this.pict.providers["Pict-FileBrowser-Icons"],g=m?m.getIcon("folder",16):"📁",f="";h&&(f=m?d?m.getIcon("chevron-down",10):m.getIcon("chevron-right",10):d?"▾":"▸");let v={Name:a.Name,Path:s,NodeID:l,Indent:8+16*e,Icon:g,ToggleIcon:f,ToggleClass:h?"pict-fb-tree-toggle":"pict-fb-tree-toggle-empty",ToggleHandler:h?"event.stopPropagation(); pict.views['"+this.Hash+"'].toggleNode('"+s+"')":"",ClickHandler:"pict.views['"+this.Hash+"'].selectFolder('"+s+"')",SelectedClass:c?" selected":"",ExpandedClass:d?" expanded":"",ChildrenHTML:u};r+=this.pict.parseTemplateByHash("FileBrowser-BrowseTree-Node-Template",v)}return r}toggleNode(t){if(this.expandedPaths[t]=!this.expandedPaths[t],this.expandedPaths[t]){let e=this.pict.providers["Pict-FileBrowser-Browse"];if(e){e.getChildFolders(t)||"function"==typeof this.onRequestChildren&&this.onRequestChildren(t)}}this.rebuildTree()}onRequestChildren(t){}selectFolder(t){this.expandedPaths[t]=!0;let e=this.pict.providers["Pict-FileBrowser-Browse"];if(e){e.getChildFolders(t)||"function"==typeof this.onRequestChildren&&this.onRequestChildren(t),e.navigateToFolder(t)}this.rebuildTree()}getCurrentLocation(){let t=(this.options.StateAddresses||{}).CurrentLocation||"AppData.PictFileBrowser.CurrentLocation";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||""}},e.exports.default_configuration=o},{"pict-view":102}],75:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Pict-FileBrowser-ListDetail",DefaultRenderable:"ListDetail-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ListPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ListDetail-Container-Template",Template:'\n<div class="pict-fb-detail" id="Pict-FileBrowser-DetailList">\n\t<div class="pict-fb-breadcrumb" id="Pict-FileBrowser-Breadcrumb"></div>\n\t<div class="pict-fb-detail-header">\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-name" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Name\')">Name</div>\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-size" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Size\')">Size</div>\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-modified" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Modified\')">Modified</div>\n\t</div>\n\t<div id="Pict-FileBrowser-DetailRows"></div>\n</div>\n'},{Hash:"FileBrowser-ListDetail-Row-Template",Template:'\n<div class="pict-fb-detail-row{~D:Record.SelectedClass~}" data-index="{~D:Record.Index~}" onclick="{~D:Record.ClickHandler~}" ondblclick="{~D:Record.DblClickHandler~}">\n\t<span class="pict-fb-detail-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-detail-name">{~D:Record.Name~}</span>\n\t<span class="pict-fb-detail-size">{~D:Record.SizeFormatted~}</span>\n\t<span class="pict-fb-detail-modified">{~D:Record.ModifiedFormatted~}</span>\n</div>\n'},{Hash:"FileBrowser-ListDetail-Empty-Template",Template:'<div class="pict-fb-empty">{~D:Record.Message~}</div>'},{Hash:"FileBrowser-Breadcrumb-Segment-Template",Template:'<span class="pict-fb-breadcrumb-segment" onclick="{~D:Record.ClickHandler~}">{~D:Record.Label~}</span>'},{Hash:"FileBrowser-Breadcrumb-Separator-Template",Template:'<span class="pict-fb-breadcrumb-separator">/</span>'},{Hash:"FileBrowser-Breadcrumb-Current-Template",Template:'<span class="pict-fb-breadcrumb-current">{~D:Record.Label~}</span>'}],Renderables:[{RenderableHash:"ListDetail-Container",TemplateHash:"FileBrowser-ListDetail-Container-Template",DestinationAddress:"#Pict-FileBrowser-ListPane",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},o,e),i),this._cachedFileList=[]}onAfterRender(t){let e=this.pict.parseTemplateByHash("FileBrowser-ListDetail-Container-Template",{ViewHash:this.Hash});return this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ListPane",e),this.rebuildList(),this.rebuildBreadcrumb(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildList(){let t=this.pict.providers["Pict-FileBrowser-List"];if(!t)return;let e=t.getSortedFileList();this._cachedFileList=e;let i=t.getSelectedFile();if(0===e.length){let t=this.pict.parseTemplateByHash("FileBrowser-ListDetail-Empty-Template",{Message:"This folder is empty"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-DetailRows",t)}let n="";for(let o=0;o<e.length;o++){let r=e[o],a=i&&i.Name===r.Name&&i.Path===r.Path,s={Index:o,Name:r.Name,Icon:t.getEntryIcon(r),SizeFormatted:"folder"===r.Type?"--":t.formatFileSize(r.Size),ModifiedFormatted:t.formatDate(r.Modified),SelectedClass:a?" selected":"",ClickHandler:"pict.views['"+this.Hash+"'].selectEntry("+o+")",DblClickHandler:"pict.views['"+this.Hash+"'].openEntry("+o+")"};n+=this.pict.parseTemplateByHash("FileBrowser-ListDetail-Row-Template",s)}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-DetailRows",n)}rebuildBreadcrumb(){let t=this.getCurrentLocation(),e="",i=this.pict.providers["Pict-FileBrowser-Icons"],n=i?i.getIcon("home",16):"🏠";if(e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:n,ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('')"}),t){let i=t.split("/"),n="";for(let t=0;t<i.length;t++)if(n=n?n+"/"+i[t]:i[t],e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Separator-Template",{}),t===i.length-1)e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Current-Template",{Label:i[t]});else{let o=n;e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:i[t],ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('"+o+"')"})}}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-Breadcrumb",e)}selectEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.selectFile(this._cachedFileList[t]),this.rebuildList()}openEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.openEntry(this._cachedFileList[t]),this.rebuildList(),this.rebuildBreadcrumb()}sortBy(t){let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.setSortField(t),this.rebuildList()}navigateToPath(t){let e=this.pict.providers["Pict-FileBrowser-Browse"];e&&e.navigateToFolder(t),this.rebuildList(),this.rebuildBreadcrumb()}getCurrentLocation(){let t=(this.options.StateAddresses||{}).CurrentLocation||"AppData.PictFileBrowser.CurrentLocation";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||""}},e.exports.default_configuration=o},{"pict-view":102}],76:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Pict-FileBrowser-ListIcons",DefaultRenderable:"ListIcons-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ListPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ListIcons-Container-Template",Template:'\n<div id="Pict-FileBrowser-IconList">\n\t<div class="pict-fb-breadcrumb" id="Pict-FileBrowser-IconBreadcrumb"></div>\n\t<div class="pict-fb-icons" id="Pict-FileBrowser-IconGrid"></div>\n</div>\n'},{Hash:"FileBrowser-ListIcons-Item-Template",Template:'\n<div class="pict-fb-icon-item{~D:Record.SelectedClass~}" data-index="{~D:Record.Index~}" onclick="{~D:Record.ClickHandler~}" ondblclick="{~D:Record.DblClickHandler~}">\n\t<div class="pict-fb-icon-graphic">{~D:Record.Icon~}</div>\n\t<div class="pict-fb-icon-label">{~D:Record.Name~}</div>\n</div>\n'},{Hash:"FileBrowser-ListIcons-Empty-Template",Template:'<div class="pict-fb-empty">{~D:Record.Message~}</div>'}],Renderables:[{RenderableHash:"ListIcons-Container",TemplateHash:"FileBrowser-ListIcons-Container-Template",DestinationAddress:"#Pict-FileBrowser-ListPane",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},o,e),i),this._cachedFileList=[]}onAfterRender(t){return this.rebuildGrid(),this.rebuildBreadcrumb(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildGrid(){let t=this.pict.providers["Pict-FileBrowser-List"];if(!t)return;let e=t.getSortedFileList();this._cachedFileList=e;let i=t.getSelectedFile();if(0===e.length){let t=this.pict.parseTemplateByHash("FileBrowser-ListIcons-Empty-Template",{Message:"This folder is empty"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-IconGrid",t)}let n="";for(let o=0;o<e.length;o++){let r=e[o],a=i&&i.Name===r.Name&&i.Path===r.Path,s={Index:o,Name:r.Name,Icon:t.getEntryIcon(r),SelectedClass:a?" selected":"",ClickHandler:"pict.views['"+this.Hash+"'].selectEntry("+o+")",DblClickHandler:"pict.views['"+this.Hash+"'].openEntry("+o+")"};n+=this.pict.parseTemplateByHash("FileBrowser-ListIcons-Item-Template",s)}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-IconGrid",n)}rebuildBreadcrumb(){let t=this.getCurrentLocation(),e="";if(e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:"🏠",ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('')"}),t){let i=t.split("/"),n="";for(let t=0;t<i.length;t++)if(n=n?n+"/"+i[t]:i[t],e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Separator-Template",{}),t===i.length-1)e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Current-Template",{Label:i[t]});else{let o=n;e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:i[t],ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('"+o+"')"})}}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-IconBreadcrumb",e)}selectEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.selectFile(this._cachedFileList[t]),this.rebuildGrid()}openEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.openEntry(this._cachedFileList[t]),this.rebuildGrid(),this.rebuildBreadcrumb()}navigateToPath(t){let e=this.pict.providers["Pict-FileBrowser-Browse"];e&&e.navigateToFolder(t),this.rebuildGrid(),this.rebuildBreadcrumb()}getCurrentLocation(){let t=(this.options.StateAddresses||{}).CurrentLocation||"AppData.PictFileBrowser.CurrentLocation";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||""}},e.exports.default_configuration=o},{"pict-view":102}],77:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Pict-FileBrowser-ViewFileInfo",DefaultRenderable:"ViewFileInfo-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ViewPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ViewFileInfo-Container-Template",Template:'<div class="pict-fb-fileinfo" id="Pict-FileBrowser-FileInfo"></div>'},{Hash:"FileBrowser-ViewFileInfo-Detail-Template",Template:'\n<div class="pict-fb-fileinfo-title">{~D:Record.Name~}</div>\n<table class="pict-fb-fileinfo-table">\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Type</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.TypeDescription~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Size</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.SizeFormatted~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Modified</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.ModifiedFormatted~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Extension</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.Extension~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Path</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.Path~}</td>\n\t</tr>\n</table>\n'},{Hash:"FileBrowser-ViewFileInfo-Empty-Template",Template:'<div class="pict-fb-fileinfo-none">No file selected</div>'}],Renderables:[{RenderableHash:"ViewFileInfo-Container",TemplateHash:"FileBrowser-ViewFileInfo-Container-Template",DestinationAddress:"#Pict-FileBrowser-ViewPane",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},o,e),i)}onAfterRender(t){return this.rebuildFileInfo(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildFileInfo(){let t=this.pict.providers["Pict-FileBrowser-View"],e=this.pict.providers["Pict-FileBrowser-List"],i=t?t.getCurrentFile():null;if(!i){let t=this.pict.parseTemplateByHash("FileBrowser-ViewFileInfo-Empty-Template",{});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-FileInfo",t)}let n={Name:i.Name||"Unknown",TypeDescription:t?t.getFileTypeDescription(i):"File",SizeFormatted:e?e.formatFileSize(i.Size):i.Size||"--",ModifiedFormatted:e?e.formatDate(i.Modified):i.Modified||"--",Extension:i.Extension||"--",Path:i.Path||"--"},o=this.pict.parseTemplateByHash("FileBrowser-ViewFileInfo-Detail-Template",n);this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-FileInfo",o)}},e.exports.default_configuration=o},{"pict-view":102}],78:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Pict-FileBrowser-ViewImage",DefaultRenderable:"ViewImage-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ViewPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ViewImage-Container-Template",Template:'<div class="pict-fb-image-viewer" id="Pict-FileBrowser-ImageViewer"></div>'},{Hash:"FileBrowser-ViewImage-Display-Template",Template:'<img src="{~D:Record.ImageURL~}" alt="{~D:Record.Name~}" />'},{Hash:"FileBrowser-ViewImage-NoImage-Template",Template:'<div class="pict-fb-image-viewer-none">{~D:Record.Message~}</div>'}],Renderables:[{RenderableHash:"ViewImage-Container",TemplateHash:"FileBrowser-ViewImage-Container-Template",DestinationAddress:"#Pict-FileBrowser-ViewPane",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},o,e),i)}onAfterRender(t){return this.rebuildImageView(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildImageView(){let t=this.pict.providers["Pict-FileBrowser-View"],e=t?t.getCurrentFile():null;if(!e){let t=this.pict.parseTemplateByHash("FileBrowser-ViewImage-NoImage-Template",{Message:"No file selected"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",t)}if(!(!!t&&t.isImage(e))){let t=this.pict.parseTemplateByHash("FileBrowser-ViewImage-NoImage-Template",{Message:"Selected file is not an image"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",t)}let i=t?t.getImageURL(e):null;if(!i){let t=this.pict.parseTemplateByHash("FileBrowser-ViewImage-NoImage-Template",{Message:"No image URL available"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",t)}let n=this.pict.parseTemplateByHash("FileBrowser-ViewImage-Display-Template",{ImageURL:i,Name:e.Name||"Image"});this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",n)}},e.exports.default_configuration=o},{"pict-view":102}],79:[function(t,e,i){const n=t("pict-view"),o=t("../Pict-Section-FileBrowser-DefaultConfiguration.js"),r=t("../providers/Pict-Provider-FileBrowserBrowse.js"),a=t("../providers/Pict-Provider-FileBrowserList.js"),s=t("../providers/Pict-Provider-FileBrowserView.js"),l=t("../providers/Pict-Provider-FileBrowserLayout.js"),d=t("../providers/Pict-Provider-FileBrowserIcons.js");e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},JSON.parse(JSON.stringify(o)),e),i),this.pict.providers["Pict-FileBrowser-Browse"]||this.pict.addProvider("Pict-FileBrowser-Browse",r.default_configuration,r),this.pict.providers["Pict-FileBrowser-List"]||this.pict.addProvider("Pict-FileBrowser-List",a.default_configuration,a),this.pict.providers["Pict-FileBrowser-View"]||this.pict.addProvider("Pict-FileBrowser-View",s.default_configuration,s),this.pict.providers["Pict-FileBrowser-Layout"]||this.pict.addProvider("Pict-FileBrowser-Layout",l.default_configuration,l),this.pict.providers["Pict-FileBrowser-Icons"]||this.pict.addProvider("Pict-FileBrowser-Icons",d.default_configuration,d),this.ensureDefaultState()}ensureDefaultState(){let t=this.options.DefaultState||{},e=this.options.StateAddresses||{},i={AppData:this.pict.AppData,Pict:this.pict};this.pict.AppData.PictFileBrowser||(this.pict.AppData.PictFileBrowser={});for(let n in e){let o=e[n],r=this.pict.manifest.getValueByHash(i,o);if(null==r){let e=t[n];void 0!==e&&this.pict.manifest.setValueByHash(i,o,e)}}this.pict.AppData.PictFileBrowser.FileList||(this.pict.AppData.PictFileBrowser.FileList=[]),this.pict.AppData.PictFileBrowser.FolderTree||(this.pict.AppData.PictFileBrowser.FolderTree=[])}onAfterRender(t){return this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}getState(t){let e=(this.options.StateAddresses||{})[t];if(e)return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},e)}setState(t,e){let i=(this.options.StateAddresses||{})[t];i&&this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},i,e)}},e.exports.default_configuration=o},{"../Pict-Section-FileBrowser-DefaultConfiguration.js":65,"../providers/Pict-Provider-FileBrowserBrowse.js":67,"../providers/Pict-Provider-FileBrowserIcons.js":68,"../providers/Pict-Provider-FileBrowserLayout.js":69,"../providers/Pict-Provider-FileBrowserList.js":70,"../providers/Pict-Provider-FileBrowserView.js":71,"pict-view":102}],80:[function(t,e,i){e.exports=t("./providers/Pict-Provider-InlineDocumentation.js"),e.exports.InlineDocumentationLayoutView=t("./views/Pict-View-InlineDocumentation-Layout.js"),e.exports.InlineDocumentationContentView=t("./views/Pict-View-InlineDocumentation-Content.js"),e.exports.InlineDocumentationNavView=t("./views/Pict-View-InlineDocumentation-Nav.js"),e.exports.InlineDocumentationTopicManagerView=t("./views/Pict-View-InlineDocumentation-TopicManager.js")},{"./providers/Pict-Provider-InlineDocumentation.js":81,"./views/Pict-View-InlineDocumentation-Content.js":82,"./views/Pict-View-InlineDocumentation-Layout.js":83,"./views/Pict-View-InlineDocumentation-Nav.js":84,"./views/Pict-View-InlineDocumentation-TopicManager.js":85}],81:[function(t,e,i){const n=t("pict-provider"),o=t("pict-section-content").PictContentProvider,r=t("pict-section-modal"),a=t("pict-section-markdowneditor"),s=t("lunr"),l=t("../views/Pict-View-InlineDocumentation-Layout.js"),d=t("../views/Pict-View-InlineDocumentation-Content.js"),c=t("../views/Pict-View-InlineDocumentation-Nav.js"),p=t("../views/Pict-View-InlineDocumentation-TopicManager.js");const h={ProviderIdentifier:"Pict-InlineDocumentation",AutoInitialize:!0,AutoInitializeOrdinal:0};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},JSON.parse(JSON.stringify(h)),e),i),this._ContentCache={},this._ActiveTooltipBindings=[],this._tooltipHelpLinkHandler=null,this._ContentProvider=this.pict.addProviderSingleton("Pict-Content",o.default_configuration,o),this.pict.addViewSingleton("InlineDoc-Layout",l.default_configuration,l),this.pict.addViewSingleton("InlineDoc-Content",d.default_configuration,d),this.pict.addViewSingleton("InlineDoc-Nav",c.default_configuration,c),this.pict.addViewSingleton("InlineDoc-TopicManager",p.default_configuration,p),this.pict.views["Pict-Section-Modal"]||this.pict.addViewSingleton("Pict-Section-Modal",r.default_configuration,r);let n=JSON.parse(JSON.stringify(a.default_configuration));n.DefaultDestinationAddress="#InlineDoc-Editor-Container",n.TargetElementAddress="#InlineDoc-Editor-Container",n.ContentDataAddress="AppData.InlineDocumentation.EditorSegments",n.DefaultPreviewMode="off",n.Renderables=[{RenderableHash:"MarkdownEditor-Wrap",TemplateHash:"MarkdownEditor-Container",ContentDestinationAddress:"#InlineDoc-Editor-Container"}],this.pict.addViewSingleton("InlineDoc-MarkdownEditor",n,a)}initializeDocumentation(t,e){let i="function"==typeof e?e:()=>{},n=t||{};this.pict.AppData.InlineDocumentation||(this.pict.AppData.InlineDocumentation={});let o=this.pict.AppData.InlineDocumentation;if(o.DocsBaseURL=n.DocsBaseURL||o.DocsBaseURL||"",o.CurrentPath="",o.CurrentRoute="",o.SidebarGroups=o.SidebarGroups||[],o.Topic=null,o.Topics=o.Topics||{},o.NavigationHistory=[],o.NavCollapsed=!0,o.CollapsedGroups={},o.ActiveDocumentHeadings=[],o.NavFilterText="",o.SearchIndexLoaded=!1,o.SearchQuery="",o.SearchResults=[],o.ExternalDocBaseURL=n.ExternalDocBaseURL||"",void 0!==n.EditEnabled?o.EditEnabled=!!n.EditEnabled:o.EditEnabled=o.EditEnabled||!1,o.Editing=!1,o.EditingPath="",o.EditingContent="",o.TooltipEditMode=!1,"function"==typeof n.onSave&&(this._onSave=n.onSave),"function"==typeof n.onTopicsSave&&(this._onTopicsSave=n.onTopicsSave),"function"==typeof n.onImageUpload&&(this._onImageUpload=n.onImageUpload,this._wireEditorImageUpload()),void 0!==n.TopicManagerEnabled?(o.TopicManagerEnabled=!!n.TopicManagerEnabled,this._topicManagerExplicitlySet=!0):(o.TopicManagerEnabled=o.EditEnabled||!1,this._topicManagerExplicitlySet=!1),n.ContainerAddress){let t=this.pict.views["InlineDoc-Layout"];if(t&&t.options&&t.options.Renderables)for(let e=0;e<t.options.Renderables.length;e++)t.options.Renderables[e].ContentDestinationAddress=n.ContainerAddress}let r=2;n.SearchIndexURL&&r++;let a=this,s=()=>{if(r--,r<=0)return a._markExternalSidebarItems(),a.pict.views["InlineDoc-Layout"].render(),a.pict.views["InlineDoc-Nav"].render(),i()};this._loadSidebar(s),this._loadTopics(n.TopicsURL,s),n.SearchIndexURL&&this._loadSearchIndex(n.SearchIndexURL,s)}loadDocument(t,e){let i="function"==typeof e?e:()=>{};if(!t)return i("No document path provided");let n=this.pict.AppData.InlineDocumentation,o=this.pict.views["InlineDoc-Content"],r="",a=t,s=a.indexOf("#");s>=0&&(r=a.substring(s+1),a=a.substring(0,s)),a.match(/\.md$/)||(a+=".md"),n.CurrentPath=a,n.NavigationHistory.push(a),o.render(),o.showLoading();let l=(n.DocsBaseURL||"")+a;this._fetchDocument(l,(t,e)=>t?(o.displayContent(this._getErrorPageHTML(a)),i(t)):(o.displayContent(e),r&&this._scrollToAnchor(r),n.NavCollapsed=!0,n.NavFilterText="",n.SearchQuery="",n.SearchResults=[],this.pict.views["InlineDoc-Nav"].render(),i(null,e)))}setTopic(t){let e=this.pict.AppData.InlineDocumentation;t&&e.Topics&&e.Topics[t]?(e.Topic=t,this.pict.views["InlineDoc-Nav"].render()):this.log.warn(`InlineDocumentation: Topic [${t}] not found.`)}loadTopicDocument(t,e){let i=this.pict.AppData.InlineDocumentation;if(!t||!i.Topics||!i.Topics[t])return this.log.warn(`InlineDocumentation: Topic [${t}] not found.`),"function"==typeof e?e("Topic not found"):void 0;let n=i.Topics[t];i.Topic=t,this.pict.views["InlineDoc-Nav"].render();let o=n.TopicHelpFilePath||"";o&&this.loadDocument(o,e)}clearTopic(){this.pict.AppData.InlineDocumentation.Topic=null,this.pict.views["InlineDoc-Nav"].render()}addTopic(t,e){let i=this.pict.AppData.InlineDocumentation;if(!t)return void this.log.warn("InlineDocumentation: addTopic requires a TopicCode.");i.Topics||(i.Topics={});let n=Object.assign({TopicCode:t},e||{});i.Topics[t]=n}addRouteToTopic(t,e){let i=this.pict.AppData.InlineDocumentation;if(!t||!i.Topics||!i.Topics[t])return void this.log.warn(`InlineDocumentation: Topic [${t}] not found for addRouteToTopic.`);let n=i.Topics[t];n.Routes||(n.Routes=[]),n.Routes.indexOf(e)<0&&n.Routes.push(e)}getTopicList(){let t=this.pict.AppData.InlineDocumentation,e=[];if(!t||!t.Topics)return e;let i=Object.keys(t.Topics);for(let n=0;n<i.length;n++){let o=t.Topics[i[n]];e.push({TopicCode:i[n],TopicTitle:o.TopicTitle||o.Name||i[n],TopicHelpFilePath:o.TopicHelpFilePath||"",RouteCount:o.Routes&&Array.isArray(o.Routes)?o.Routes.length:0})}return e}updateTopic(t,e){let i=this.pict.AppData.InlineDocumentation;if(!t||!i.Topics||!i.Topics[t])return!1;let n=i.Topics[t],o=e||{};return o.hasOwnProperty("TopicTitle")&&(n.TopicTitle=o.TopicTitle),o.hasOwnProperty("TopicHelpFilePath")&&(n.TopicHelpFilePath=o.TopicHelpFilePath),o.hasOwnProperty("Routes")&&(n.Routes=o.Routes),!0}removeTopic(t){let e=this.pict.AppData.InlineDocumentation;return!!(t&&e.Topics&&e.Topics[t])&&(delete e.Topics[t],e.Topic===t&&(e.Topic=null),!0)}removeRouteFromTopic(t,e){let i=this.pict.AppData.InlineDocumentation;if(!t||!i.Topics||!i.Topics[t])return!1;let n=i.Topics[t];if(!n.Routes||!Array.isArray(n.Routes))return!1;let o=n.Routes.indexOf(e);return!(o<0)&&(n.Routes.splice(o,1),!0)}saveTopics(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.InlineDocumentation;if("function"!=typeof this._onTopicsSave)return e(null);this._onTopicsSave(i.Topics,t=>t?(this.log.warn(`InlineDocumentation: Topics save failed: ${t}`),e(t)):e(null))}setTopicManagerEnabled(t){this.pict.AppData.InlineDocumentation.TopicManagerEnabled=!!t;let e=this.pict.views["InlineDoc-Nav"];e&&e.render()}getRouteSegments(t){if(!t||"string"!=typeof t)return[];let e=t.replace(/^\//,"");if(!e)return[];let i=e.split("/"),n=[];for(let t=0;t<i.length;t++){let e="/"+i.slice(0,t+1).join("/");n.push({Segment:i[t],Path:e,WildcardPattern:e+"/*",Index:t})}return n}buildWildcardPattern(t,e){let i=this.getRouteSegments(t);return i.length<1||e<0||e>=i.length?"":i[e].WildcardPattern}getTopicsForRoute(t){let e=this.pict.AppData.InlineDocumentation,i=[];if(!t||!e.Topics)return i;let n=Object.keys(e.Topics);for(let o=0;o<n.length;o++){let r=e.Topics[n[o]];if(r.Routes&&Array.isArray(r.Routes))for(let e=0;e<r.Routes.length;e++){let a=r.Routes[e];if(!a)continue;let s=0,l=!1;if(a.endsWith("/*")){let e=a.slice(0,-2);t!==e&&0!==t.indexOf(e+"/")||(l=!0,s=e.length)}else t===a&&(l=!0,s=a.length);l&&i.push({TopicCode:n[o],Pattern:a,MatchLength:s})}}return i.sort((t,e)=>e.MatchLength-t.MatchLength),i}setDocsBaseURL(t){this.pict.AppData.InlineDocumentation||(this.pict.AppData.InlineDocumentation={}),this.pict.AppData.InlineDocumentation.DocsBaseURL=t||"",this._ContentCache={}}getNavigationHistory(){let t=this.pict.AppData.InlineDocumentation;return t&&t.NavigationHistory?t.NavigationHistory:[]}navigateBack(t){let e=this.getNavigationHistory();if(e.length<2)return;e.pop();let i=e.pop();this.loadDocument(i,t)}setEditEnabled(t){let e=this.pict.AppData.InlineDocumentation;if(e.EditEnabled=!!t,!this._topicManagerExplicitlySet){e.TopicManagerEnabled=!!t;let i=this.pict.views["InlineDoc-Nav"];i&&i.render()}let i=this.pict.views["InlineDoc-Content"];i&&i.renderEditToolbar()}toggleEdit(){this.pict.AppData.InlineDocumentation.Editing?this.cancelEdit():this.beginEdit()}beginEdit(){let t=this.pict.AppData.InlineDocumentation;if(!t.EditEnabled||!t.CurrentPath)return;let e=(t.DocsBaseURL||"")+t.CurrentPath,i=this._ContentCache[e],n=i&&i.markdown?i.markdown:"";t.Editing=!0,t.EditingPath=t.CurrentPath,t.EditingContent=n;let o=this.pict.views["InlineDoc-Content"];o&&o.showEditor(n)}cancelEdit(){let t=this.pict.AppData.InlineDocumentation;t.Editing=!1,t.EditingPath="",t.EditingContent="",t.EditorSegments=[];let e=this.pict.views["InlineDoc-Content"];if(e){e.hideEditor();let i=(t.DocsBaseURL||"")+t.CurrentPath,n=this._ContentCache[i];n&&n.html&&e.displayContent(n.html)}}saveEdit(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.InlineDocumentation,n=this.pict.views["InlineDoc-Content"];if(!i.Editing)return e("Not in edit mode");let o="",r=this.pict.views["InlineDoc-MarkdownEditor"];r&&"function"==typeof r.marshalFromView&&r.marshalFromView(),i.EditorSegments&&i.EditorSegments.length>0&&(o=i.EditorSegments[0].Content||"");let a=i.EditingPath,s=(i.DocsBaseURL||"")+a,l={Path:a,Content:o},d=()=>{let t=this._ContentProvider.parseMarkdown(o,this._createLinkResolver(),this._createImageResolver(s));return this._ContentCache[s]={html:t,markdown:o},i.Editing=!1,i.EditingPath="",i.EditingContent="",i.EditorSegments=[],n&&(n.hideEditor(),n.displayContent(t)),e(null)};"function"==typeof this._onSave?this._onSave(l,t=>{if(t)return this.log.warn(`InlineDocumentation: Save failed: ${t}`),e(t);d()}):d()}resolveHelpForRoute(t){let e=this.pict.AppData.InlineDocumentation;if(!t||!e.Topics)return null;let i=null,n=-1,o=Object.keys(e.Topics);for(let r=0;r<o.length;r++){let a=e.Topics[o[r]];if(a.Routes&&Array.isArray(a.Routes))for(let e=0;e<a.Routes.length;e++){let s=a.Routes[e];if(!s)continue;let l=!1,d=0;if(s.endsWith("/*")){let e=s.slice(0,-2);t!==e&&0!==t.indexOf(e+"/")||(l=!0,d=e.length)}else t===s&&(l=!0,d=s.length);l&&d>n&&(i=o[r],n=d)}}return i}navigateToRoute(t,e){this.pict.AppData.InlineDocumentation.CurrentRoute=t||"";let i=this.resolveHelpForRoute(t);return!!i&&(this.loadTopicDocument(i,e),!0)}setTooltipEditMode(t){let e=this.pict.AppData.InlineDocumentation;e&&(e.TooltipEditMode=!!t,this.scanTooltips())}getTooltipContent(t){let e=this.pict.AppData.InlineDocumentation;if(!(t&&e&&e.Topic&&e.Topics))return null;let i=e.Topics[e.Topic];return i&&i.Tooltips&&i.Tooltips[t]&&i.Tooltips[t].Content||null}setTooltipContent(t,e){let i=this.pict.AppData.InlineDocumentation;if(!(t&&i&&i.Topic&&i.Topics))return!1;let n=i.Topics[i.Topic];return!!n&&(e?(n.Tooltips||(n.Tooltips={}),n.Tooltips[t]={Content:e},!0):(n.Tooltips&&n.Tooltips[t]&&delete n.Tooltips[t],!0))}clearTooltipBindings(){for(let t=0;t<this._ActiveTooltipBindings.length;t++){let e=this._ActiveTooltipBindings[t];e.TooltipHandle&&"function"==typeof e.TooltipHandle.destroy&&e.TooltipHandle.destroy(),e.ClickHandler&&e.Element&&e.Element.removeEventListener("click",e.ClickHandler),e.InjectedIcon&&e.InjectedIcon.parentNode&&e.InjectedIcon.parentNode.removeChild(e.InjectedIcon),e.Element&&e.Element.classList.remove("pict-inline-doc-tooltip-edit-target","pict-inline-doc-tooltip-empty"),void 0!==e.OriginalDisplay&&e.Element&&(e.Element.style.display=e.OriginalDisplay)}this._ActiveTooltipBindings=[],this._tooltipHelpLinkHandler&&"undefined"!=typeof document&&(document.removeEventListener("click",this._tooltipHelpLinkHandler),this._tooltipHelpLinkHandler=null)}scanTooltips(){if(this.clearTooltipBindings(),"undefined"==typeof document)return;let t=this.pict.AppData.InlineDocumentation;if(!t)return;let e=this.pict.views["Pict-Section-Modal"],i=document.querySelectorAll("[data-d-tooltip]"),n=t.TooltipEditMode||!1;for(let t=0;t<i.length;t++){let o=i[t],r=o.getAttribute("data-d-tooltip");if(!r)continue;let a=this.getTooltipContent(r),s=o.hasAttribute("data-d-tooltip-icon"),l={Element:o,Key:r,Type:s?"icon":"attribute",TooltipHandle:null,ClickHandler:null,InjectedIcon:null,OriginalDisplay:void 0};n?this._wireTooltipEditMode(o,r,a,s,l,e):this._wireTooltipNormalMode(o,r,a,s,l,e),this._ActiveTooltipBindings.push(l)}this._installTooltipHelpLinkHandler()}_installTooltipHelpLinkHandler(){if("undefined"==typeof document)return;this._tooltipHelpLinkHandler&&document.removeEventListener("click",this._tooltipHelpLinkHandler);let t=this;this._tooltipHelpLinkHandler=e=>{let i=e.target;for(;i&&i!==document;){if("A"===i.tagName&&i.getAttribute("rel")&&0===i.getAttribute("rel").indexOf("pict-inline-doc-help:")){e.preventDefault(),e.stopPropagation();let n=i.getAttribute("rel").replace("pict-inline-doc-help:","");return void t.loadDocument(n)}i=i.parentNode}},document.addEventListener("click",this._tooltipHelpLinkHandler)}_wireTooltipNormalMode(t,e,i,n,o,r){if(n)if(i){let e=this._createTooltipIcon(t);if(o.InjectedIcon=e,r&&r.richTooltip){let e=this._ContentProvider.parseMarkdown(i,this._createTooltipLinkResolver());o.TooltipHandle=r.richTooltip(t,e,{interactive:!0,maxWidth:"350px"})}}else o.OriginalDisplay=t.style.display,t.style.display="none";else if(i&&r&&r.richTooltip){let e=this._ContentProvider.parseMarkdown(i,this._createTooltipLinkResolver());o.TooltipHandle=r.richTooltip(t,e,{interactive:!0,maxWidth:"350px"})}}_wireTooltipEditMode(t,e,i,n,o,r){if(t.classList.add("pict-inline-doc-tooltip-edit-target"),n){let e=this._createTooltipIcon(t);o.InjectedIcon=e,i||t.classList.add("pict-inline-doc-tooltip-empty")}let a=this,s=t=>{t.preventDefault(),t.stopPropagation(),a._showTooltipEditor(e)};t.addEventListener("click",s),o.ClickHandler=s}_createTooltipIcon(t){let e=document.createElement("span");e.className="pict-inline-doc-tooltip-icon";let i=t.getAttribute("data-d-tooltip-icon");return i&&""!==i?e.className+=" "+i:e.innerHTML="❓",t.appendChild(e),e}_showTooltipEditor(t){let e=this.pict.views["Pict-Section-Modal"];if(!e)return;let i=this.getTooltipContent(t)||"",n=this,o='<div class="pict-inline-doc-tm-form-group">';o+='<label class="pict-inline-doc-tm-form-label">Tooltip Key</label>',o+='<div style="font-family:monospace;font-size:0.85em;color:#8A7F72;padding:0.3em 0;">'+this._escapeTooltipHTML(t)+"</div>",o+="</div>",o+='<div class="pict-inline-doc-tm-form-group">',o+='<label class="pict-inline-doc-tm-form-label">Content (Markdown)</label>',o+='<textarea class="pict-inline-doc-tooltip-editor-textarea" id="InlineDoc-Tooltip-Editor-Textarea">'+this._escapeTooltipHTML(i)+"</textarea>",o+="</div>",o+='<div class="pict-inline-doc-tooltip-preview-label">Preview</div>',o+='<div class="pict-inline-doc-tooltip-preview" id="InlineDoc-Tooltip-Editor-Preview"></div>',e.show({title:"Edit Tooltip",content:o,closeable:!0,width:"480px",buttons:[{Hash:"cancel",Label:"Cancel"},{Hash:"save",Label:"Save",Style:"primary"}],onOpen:t=>{let e=document.getElementById("InlineDoc-Tooltip-Editor-Textarea"),o=document.getElementById("InlineDoc-Tooltip-Editor-Preview");if(e&&o){let t=n._createTooltipLinkResolver(),r=i?n._ContentProvider.parseMarkdown(i,t):'<span style="color:#8A7F72;">No content yet.</span>';o.innerHTML=r,e.addEventListener("input",()=>{let i=e.value.trim();o.innerHTML=i?n._ContentProvider.parseMarkdown(i,t):'<span style="color:#8A7F72;">No content yet.</span>'}),e.focus()}}}).then(i=>{if("save"===i){let i=document.getElementById("InlineDoc-Tooltip-Editor-Textarea"),o=i?i.value.trim():"";n.setTooltipContent(t,o||null),n.saveTopics(),n.scanTooltips(),e.toast&&e.toast("Tooltip saved.",{type:"success"})}})}_escapeTooltipHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}_wireEditorImageUpload(){let t=this,e=this.pict.views["InlineDoc-MarkdownEditor"];e&&(e.onImageUpload=(e,i,n)=>{if("function"!=typeof t._onImageUpload)return!1;let o=t.pict.AppData.InlineDocumentation,r=o&&o.EditingPath?o.EditingPath:"";return t._onImageUpload(e,r,(e,i)=>{e&&t.log.warn(`InlineDocumentation: Image upload failed: ${e}`),n(e,i)}),!0})}_scrollToAnchor(t){"undefined"!=typeof document&&t&&setTimeout(()=>{let e=document.getElementById("InlineDoc-Content-Body");if(!e)return;let i=t.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-"),n=e.querySelector("#"+CSS.escape(i));if(!n){let t=e.querySelectorAll("h1, h2, h3, h4, h5, h6");for(let e=0;e<t.length;e++){if((t[e].textContent||"").toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")===i){n=t[e];break}}}n&&n.scrollIntoView({behavior:"smooth",block:"start"})},50)}_loadSearchIndex(t,e){let i="function"==typeof e?e:()=>{},n=this;if("undefined"==typeof fetch)return i();fetch(t).then(t=>t.ok?t.json():null).then(t=>{if(!t||!t.LunrIndex||!t.Documents)return n.log&&n.log.info("InlineDocumentation: No keyword index found; search unavailable."),i();try{n._LunrIndex=s.Index.load(t.LunrIndex),n._SearchDocuments=t.Documents;let e=n.pict.AppData.InlineDocumentation;e&&(e.SearchIndexLoaded=!0),n.log&&n.log.info("InlineDocumentation: Search index loaded ("+(t.DocumentCount||0)+" documents).")}catch(t){n.log&&n.log.warn("InlineDocumentation: Error hydrating lunr index: "+t)}return i()}).catch(t=>(n.log&&n.log.warn("InlineDocumentation: Error loading search index: "+t),i()))}search(t){if(!(this._LunrIndex&&this._SearchDocuments&&t&&t.trim()))return[];let e=[];try{let i=this._LunrIndex.search(t);for(let t=0;t<i.length;t++){let n=i[t].ref,o=i[t].score,r=this._SearchDocuments[n];r&&e.push({Key:n,Title:r.Title||n,Group:r.Group||"",Module:r.Module||"",DocPath:r.DocPath||n,Score:o})}}catch(t){this.log&&this.log.warn("InlineDocumentation: Search error: "+t)}return e}isExternalPath(t){if(!t)return!1;let e=this.pict.AppData.InlineDocumentation;return!(!e||!e.ExternalDocBaseURL)&&t.replace(/^\.\//,"").replace(/^\//,"").split("/").filter(t=>t.length>0).length>=2}resolveExternalURL(t){if(!this.isExternalPath(t))return null;let e=this.pict.AppData.InlineDocumentation,i=e&&e.ExternalDocBaseURL||"";return i?i+t.replace(/^\.\//,"").replace(/^\//,""):null}_markExternalSidebarItems(){let t=this.pict.AppData.InlineDocumentation;if(!t||!t.ExternalDocBaseURL)return;let e=t.SidebarGroups||[];for(let t=0;t<e.length;t++){let i=e[t].Items||[];for(let t=0;t<i.length;t++){let e=i[t];this.isExternalPath(e.Path)&&(e.External=!0,e.ExternalURL=this.resolveExternalURL(e.Path))}}}_extractHeadings(){let t=[];if("undefined"==typeof document)return t;let e=document.getElementById("InlineDoc-Content-Body");if(!e)return t;let i=e.querySelectorAll("h2, h3");for(let e=0;e<i.length;e++){let n=i[e],o=(n.textContent||"").trim(),r=parseInt(n.tagName.substring(1),10),a=o.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-");n.id||(n.id=a),t.push({Text:o,Slug:a,Level:r})}let n=this.pict.AppData.InlineDocumentation;return n&&(n.ActiveDocumentHeadings=t),t}_fetchDocument(t,e){let i="function"==typeof e?e:()=>{};return t?this._ContentCache[t]?i(null,this._ContentCache[t].html):void fetch(t).then(t=>t.ok?t.text():null).then(e=>{if(!e)return i("Document not found","");let n=this._ContentProvider.parseMarkdown(e,this._createLinkResolver(),this._createImageResolver(t));return this._ContentCache[t]={html:n,markdown:e},i(null,n)}).catch(e=>(this.log.warn(`InlineDocumentation: Error fetching [${t}]: ${e}`),i(e,""))):i("No URL provided","")}_createLinkResolver(){return(t,e)=>{if(t.match(/^https?:\/\//))return{href:t,target:"_blank",rel:"noopener"};if(t.match(/^help:/)){return{href:"javascript:void(0)",target:"",rel:"pict-inline-doc-link:"+t.replace(/^help:/,"")}}return{href:"javascript:void(0)",target:"",rel:"pict-inline-doc-link:"+t.replace(/^\.\//,"").replace(/^\//,"")}}}_createTooltipLinkResolver(){return(t,e)=>{if(t.match(/^https?:\/\//))return{href:t,target:"_blank",rel:"noopener"};let i=t.replace(/^help:/,"");return i=i.replace(/^\.\//,"").replace(/^\//,""),{href:"javascript:void(0)",target:"",rel:"pict-inline-doc-help:"+i}}}_createImageResolver(t){let e="";if(t){let i=t.lastIndexOf("/");i>=0&&(e=t.substring(0,i+1))}return(t,i)=>t.match(/^https?:\/\//)||t.match(/^data:/)||t.match(/^\//)?t:e+t}_loadSidebar(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.InlineDocumentation,n=i.DocsBaseURL||"";fetch(n+"_sidebar.md").then(t=>t.ok?t.text():null).then(t=>t?(i.SidebarGroups=this._parseSidebarMarkdown(t),e()):(this.log.info("InlineDocumentation: No _sidebar.md found."),e())).catch(t=>(this.log.warn(`InlineDocumentation: Error loading _sidebar.md: ${t}`),e()))}_loadTopics(t,e){let i="function"==typeof e?e:()=>{},n=this.pict.AppData.InlineDocumentation,o=n.DocsBaseURL||"";fetch(t||o+"_topics.json").then(t=>t.ok?t.json():null).then(t=>(t?(n.Topics=t,this.log.info(`InlineDocumentation: Topics loaded (${Object.keys(t).length} topics).`)):this.log.info("InlineDocumentation: No _topics.json found."),i())).catch(t=>(this.log.info(`InlineDocumentation: No topics loaded (${t}).`),i()))}_parseSidebarMarkdown(t){let e=[],i=null,n=t.split("\n");for(let t=0;t<n.length;t++){let o=n[t];if(!o.trim())continue;let r=o.match(/^(\s*)/),a=r?r[1].length:0,s=o.trim().match(/^[-*+]\s+(.*)/);if(!s)continue;let l=s[1].trim(),d=l.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(a<2)if(d){let t=d[1].trim(),n=d[2].trim();i={Name:t,Key:t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),Path:this._normalizePath(n),Items:[]},e.push(i)}else i={Name:l,Key:l.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),Path:"",Items:[]},e.push(i);else i&&(d?i.Items.push({Name:d[1].trim(),Path:this._normalizePath(d[2].trim())}):i.Items.push({Name:l,Path:""}))}return e}_normalizePath(t){return t?t.replace(/^\.\//,"").replace(/^\//,""):""}_getErrorPageHTML(t){return'<div class="pict-inline-doc-not-found"><h2>Page Not Found</h2><p>The document <code>'+this._ContentProvider.escapeHTML(t||"unknown")+"</code> could not be loaded.</p></div>"}},e.exports.default_configuration=h},{"../views/Pict-View-InlineDocumentation-Content.js":82,"../views/Pict-View-InlineDocumentation-Layout.js":83,"../views/Pict-View-InlineDocumentation-Nav.js":84,"../views/Pict-View-InlineDocumentation-TopicManager.js":85,lunr:32,"pict-provider":58,"pict-section-content":62,"pict-section-markdowneditor":92,"pict-section-modal":100}],82:[function(t,e,i){const n=t("pict-section-content"),o={ViewIdentifier:"InlineDoc-Content",DefaultRenderable:"InlineDoc-Content-Display",DefaultContentDestinationAddress:"#InlineDoc-Content-Container",AutoRender:!1,CSS:"\n\t\t.pict-inline-doc-content {\n\t\t\tpadding: 1em 1.25em;\n\t\t\tmax-width: 100%;\n\t\t\tword-wrap: break-word;\n\t\t\toverflow-wrap: break-word;\n\t\t}\n\t\t.pict-inline-doc-content-loading {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-height: 150px;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 0.95em;\n\t\t}\n\t\t.pict-inline-doc-content h1 {\n\t\t\tfont-size: 1.75em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tpadding-bottom: 0.3em;\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t.pict-inline-doc-content h2 {\n\t\t\tfont-size: 1.35em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tpadding-bottom: 0.2em;\n\t\t\tmargin-top: 1.25em;\n\t\t}\n\t\t.pict-inline-doc-content h3 {\n\t\t\tfont-size: 1.15em;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\t.pict-inline-doc-content h4, .pict-inline-doc-content h5, .pict-inline-doc-content h6 {\n\t\t\tcolor: #5E5549;\n\t\t\tmargin-top: 0.8em;\n\t\t}\n\t\t.pict-inline-doc-content p {\n\t\t\tline-height: 1.65;\n\t\t\tcolor: #423D37;\n\t\t\tmargin: 0.6em 0;\n\t\t}\n\t\t.pict-inline-doc-content a {\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.pict-inline-doc-content a:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.pict-inline-doc-content pre {\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 1em;\n\t\t\tborder-radius: 5px;\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: 0.85em;\n\t\t\tmax-width: 100%;\n\t\t}\n\t\t.pict-inline-doc-content code {\n\t\t\tbackground: #F0ECE4;\n\t\t\tpadding: 0.15em 0.35em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.85em;\n\t\t\tcolor: #9E6B47;\n\t\t}\n\t\t.pict-inline-doc-content pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.pict-inline-doc-content blockquote {\n\t\t\tborder-left: 3px solid #2E7D74;\n\t\t\tmargin: 0.8em 0;\n\t\t\tpadding: 0.4em 0.8em;\n\t\t\tbackground: #F7F5F0;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.pict-inline-doc-content blockquote p {\n\t\t\tmargin: 0.2em 0;\n\t\t}\n\t\t.pict-inline-doc-content ul, .pict-inline-doc-content ol {\n\t\t\tpadding-left: 1.8em;\n\t\t\tline-height: 1.7;\n\t\t}\n\t\t.pict-inline-doc-content li {\n\t\t\tmargin: 0.2em 0;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-inline-doc-content hr {\n\t\t\tborder: none;\n\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\tmargin: 1.5em 0;\n\t\t}\n\t\t.pict-inline-doc-content table {\n\t\t\twidth: 100%;\n\t\t\tborder-collapse: collapse;\n\t\t\tmargin: 0.8em 0;\n\t\t\tdisplay: block;\n\t\t\toverflow-x: auto;\n\t\t}\n\t\t.pict-inline-doc-content table th {\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.5em 0.7em;\n\t\t\ttext-align: left;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-inline-doc-content table td {\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.4em 0.7em;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-inline-doc-content table tr:nth-child(even) {\n\t\t\tbackground: #F7F5F0;\n\t\t}\n\t\t.pict-inline-doc-content img {\n\t\t\tmax-width: 100%;\n\t\t\theight: auto;\n\t\t}\n\t\t.pict-inline-doc-not-found {\n\t\t\ttext-align: center;\n\t\t\tpadding: 2em 1em;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.pict-inline-doc-not-found h2 {\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1.3em;\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t.pict-inline-doc-not-found code {\n\t\t\tbackground: #F0ECE4;\n\t\t\tpadding: 0.15em 0.35em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.85em;\n\t\t\tcolor: #9E6B47;\n\t\t}\n\t\t/* Code block action buttons (copy, fullscreen) from pict-section-content */\n\t\t.pict-content-code-actions {\n\t\t\tposition: sticky;\n\t\t\ttop: 64px;\n\t\t\talign-self: flex-start;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tgap: 6px;\n\t\t\tflex: 0 0 auto;\n\t\t\tpadding-top: 6px;\n\t\t\topacity: 0;\n\t\t\ttransform: translateX(-4px);\n\t\t\ttransition: opacity 0.15s ease, transform 0.15s ease;\n\t\t\tpointer-events: none;\n\t\t}\n\t\t.pict-content-code-container:hover .pict-content-code-actions,\n\t\t.pict-content-code-container:focus-within .pict-content-code-actions {\n\t\t\topacity: 1;\n\t\t\ttransform: translateX(0);\n\t\t\tpointer-events: auto;\n\t\t}\n\t\t.pict-content-code-action-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 28px;\n\t\t\theight: 28px;\n\t\t\tpadding: 0;\n\t\t\tbackground: #FFFFFF;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 6px;\n\t\t\tcursor: pointer;\n\t\t\tbox-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n\t\t\ttransition: background-color 0.15s ease, color 0.15s ease;\n\t\t}\n\t\t.pict-content-code-action-btn svg {\n\t\t\tdisplay: block;\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t\tstroke: currentColor;\n\t\t\tfill: none;\n\t\t\tstroke-width: 1.6;\n\t\t\tstroke-linecap: round;\n\t\t\tstroke-linejoin: round;\n\t\t}\n\t\t.pict-content-code-action-btn:hover {\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFFFFF;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-content-code-action-btn.is-copied {\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFFFFF;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-edit-toolbar {\n\t\t\tdisplay: none;\n\t\t\talign-items: center;\n\t\t\tgap: 0.4em;\n\t\t\tpadding: 0.4em 0.6em;\n\t\t\tmargin-bottom: 0.5em;\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder: 1px solid #E5DED4;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.8em;\n\t\t}\n\t\t.pict-inline-doc-edit-toolbar.visible {\n\t\t\tdisplay: flex;\n\t\t}\n\t\t.pict-inline-doc-edit-toolbar .edit-label {\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-right: auto;\n\t\t}\n\t\t.pict-inline-doc-edit-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tpadding: 0.25em 0.6em;\n\t\t\tborder: 1px solid #D4A373;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: #fff;\n\t\t\tcolor: #5E5549;\n\t\t\tfont-size: 0.9em;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.pict-inline-doc-edit-btn:hover {\n\t\t\tbackground: #F0ECE4;\n\t\t}\n\t\t.pict-inline-doc-edit-btn.primary {\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #fff;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-edit-btn.primary:hover {\n\t\t\tbackground: #266D65;\n\t\t}\n\t\t.pict-inline-doc-edit-btn .btn-icon {\n\t\t\tmargin-right: 0.3em;\n\t\t}\n\t\t#InlineDoc-Editor-Container {\n\t\t\tmin-height: 300px;\n\t\t}\n\t\t/* Tooltip placeholder: edit mode indicators */\n\t\t[data-d-tooltip].pict-inline-doc-tooltip-edit-target {\n\t\t\toutline: 1px dashed #2E7D74;\n\t\t\toutline-offset: 2px;\n\t\t\tcursor: pointer;\n\t\t\tposition: relative;\n\t\t}\n\t\t[data-d-tooltip].pict-inline-doc-tooltip-edit-target:not([data-d-tooltip-icon])::after {\n\t\t\tcontent: '?';\n\t\t\tposition: absolute;\n\t\t\ttop: -6px;\n\t\t\tright: -6px;\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #fff;\n\t\t\tborder-radius: 50%;\n\t\t\tfont-size: 9px;\n\t\t\tline-height: 14px;\n\t\t\ttext-align: center;\n\t\t\tfont-weight: 700;\n\t\t\tpointer-events: none;\n\t\t}\n\t\t/* Tooltip placeholder: default icon */\n\t\t.pict-inline-doc-tooltip-icon {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\tfont-size: 12px;\n\t\t\tcolor: #2E7D74;\n\t\t\tcursor: pointer;\n\t\t\tvertical-align: middle;\n\t\t}\n\t\t/* Empty icon tooltip in edit mode */\n\t\t.pict-inline-doc-tooltip-empty .pict-inline-doc-tooltip-icon {\n\t\t\topacity: 0.4;\n\t\t\toutline: 1px dashed #8A7F72;\n\t\t\toutline-offset: 1px;\n\t\t\tborder-radius: 50%;\n\t\t}\n\t\t/* Tooltip editor textarea in modal */\n\t\t.pict-inline-doc-tooltip-editor-textarea {\n\t\t\twidth: 100%;\n\t\t\tmin-height: 120px;\n\t\t\tpadding: 0.6em;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace;\n\t\t\tfont-size: 0.85em;\n\t\t\tline-height: 1.5;\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #FDFCFA;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tresize: vertical;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.pict-inline-doc-tooltip-editor-textarea:focus {\n\t\t\toutline: none;\n\t\t\tborder-color: #2E7D74;\n\t\t\tbox-shadow: 0 0 0 2px rgba(46, 125, 116, 0.15);\n\t\t}\n\t\t.pict-inline-doc-tooltip-preview {\n\t\t\tmargin-top: 0.5em;\n\t\t\tpadding: 0.5em 0.7em;\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder: 1px solid #E5DED4;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.9em;\n\t\t\tmin-height: 2em;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-inline-doc-tooltip-preview-label {\n\t\t\tfont-size: 0.75em;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t\tmargin-bottom: 0.3em;\n\t\t}\n\t",Templates:[{Hash:"InlineDoc-Content-Template",Template:'\n<div class="pict-inline-doc-edit-toolbar" id="InlineDoc-Edit-Toolbar">\n\t<span class="edit-label" id="InlineDoc-Edit-Label">View mode</span>\n\t<button class="pict-inline-doc-edit-btn" id="InlineDoc-Edit-Toggle" title="Edit this document"><span class="btn-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M11.5 1.5l3 3L5 14H2v-3z"/><line x1="9" y1="4" x2="12" y2="7"/></svg></span> Edit</button>\n\t<button class="pict-inline-doc-edit-btn primary" id="InlineDoc-Edit-Save" style="display:none"><span class="btn-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="3,8 6.5,11.5 13,4.5"/></svg></span> Save</button>\n\t<button class="pict-inline-doc-edit-btn" id="InlineDoc-Edit-Cancel" style="display:none"><span class="btn-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg></span> Cancel</button>\n</div>\n<div class="pict-inline-doc-content pict-content" id="InlineDoc-Content-Body">\n\t<div class="pict-inline-doc-content-loading">Loading...</div>\n</div>\n'}],Renderables:[{RenderableHash:"InlineDoc-Content-Display",TemplateHash:"InlineDoc-Content-Template",ContentDestinationAddress:"#InlineDoc-Content-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(){return this.renderEditToolbar(),super.onAfterRender()}displayContent(t){super.displayContent(t,"InlineDoc-Content-Body"),this._wireInternalLinks(),this.renderEditToolbar()}showLoading(){super.showLoading("Loading...","InlineDoc-Content-Body")}renderEditToolbar(){if("undefined"==typeof document)return;let t=document.getElementById("InlineDoc-Edit-Toolbar");if(!t)return;let e=this.pict.AppData.InlineDocumentation;if(!e)return;e.EditEnabled&&e.CurrentPath?t.classList.add("visible"):t.classList.remove("visible");let i=document.getElementById("InlineDoc-Edit-Toggle"),n=document.getElementById("InlineDoc-Edit-Save"),o=document.getElementById("InlineDoc-Edit-Cancel"),r=document.getElementById("InlineDoc-Edit-Label");e.Editing?(i&&(i.style.display="none"),n&&(n.style.display=""),o&&(o.style.display=""),r&&(r.textContent="Editing: "+(e.EditingPath||""))):(i&&(i.style.display=""),n&&(n.style.display="none"),o&&(o.style.display="none"),r&&(r.textContent=e.CurrentPath||"View mode")),this._wireEditToolbar()}showEditor(t){if("undefined"==typeof document)return;let e=document.getElementById("InlineDoc-Content-Body");if(!e)return;e.innerHTML='<div id="InlineDoc-Editor-Container"></div>',this.pict.AppData.InlineDocumentation||(this.pict.AppData.InlineDocumentation={}),this.pict.AppData.InlineDocumentation.EditorSegments=[{Content:t||""}];let i=this.pict.views["InlineDoc-MarkdownEditor"];i&&i.render(),this.renderEditToolbar()}hideEditor(){this.renderEditToolbar()}_wireEditToolbar(){if("undefined"==typeof document)return;let t=this.pict.providers["Pict-InlineDocumentation"],e=document.getElementById("InlineDoc-Edit-Toggle");e&&e.addEventListener("click",()=>{t&&t.beginEdit()});let i=document.getElementById("InlineDoc-Edit-Save");i&&i.addEventListener("click",()=>{t&&t.saveEdit()});let n=document.getElementById("InlineDoc-Edit-Cancel");n&&n.addEventListener("click",()=>{t&&t.cancelEdit()})}_wireInternalLinks(){if("undefined"==typeof document)return;let t=document.getElementById("InlineDoc-Content-Body");if(!t)return;let e=t.querySelectorAll('a[rel^="pict-inline-doc-link:"]'),i=this.pict.providers["Pict-InlineDocumentation"];for(let t=0;t<e.length;t++){let n=e[t],o=n.getAttribute("rel").replace("pict-inline-doc-link:","");if(i&&"function"==typeof i.isExternalPath&&i.isExternalPath(o)){let t=i.resolveExternalURL(o);if(t){n.setAttribute("href",t),n.setAttribute("target","_blank"),n.setAttribute("rel","noopener");continue}}n.addEventListener("click",t=>{t.preventDefault(),i&&i.loadDocument(o)})}}},e.exports.default_configuration=o},{"pict-section-content":62}],83:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"InlineDoc-Layout",DefaultRenderable:"InlineDoc-Layout-Container",DefaultContentDestinationAddress:"#InlineDoc-Container",AutoRender:!1,CSS:"\n\t\t.pict-inline-doc {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: row;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tmin-height: 300px;\n\t\t\tfont-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n\t\t\tfont-size: 15px;\n\t\t\tcolor: #423D37;\n\t\t\tbackground: #FDFCFA;\n\t\t\tborder: 1px solid #E5DED4;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.pict-inline-doc-nav-container {\n\t\t\twidth: 240px;\n\t\t\tmin-width: 200px;\n\t\t\tmax-width: 300px;\n\t\t\tborder-right: 1px solid #E5DED4;\n\t\t\tbackground: #F7F5F0;\n\t\t\toverflow-y: auto;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.pict-inline-doc-content-container {\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\toverflow-x: hidden;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.pict-inline-doc-nav-container.pict-inline-doc-nav-hidden {\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Compact mode: stack nav above content when container is narrow */\n\t\t.pict-inline-doc.pict-inline-doc-compact {\n\t\t\tflex-direction: column;\n\t\t}\n\t\t.pict-inline-doc.pict-inline-doc-compact .pict-inline-doc-nav-container {\n\t\t\twidth: 100%;\n\t\t\tmin-width: 0;\n\t\t\tmax-width: none;\n\t\t\tborder-right: none;\n\t\t\tborder-bottom: 1px solid #E5DED4;\n\t\t\toverflow-y: visible;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t",Templates:[{Hash:"InlineDoc-Layout-Template",Template:'\n<div class="pict-inline-doc">\n\t<div class="pict-inline-doc-nav-container" id="InlineDoc-Nav-Container"></div>\n\t<div class="pict-inline-doc-content-container" id="InlineDoc-Content-Container"></div>\n</div>\n'}],Renderables:[{RenderableHash:"InlineDoc-Layout-Container",TemplateHash:"InlineDoc-Layout-Template",ContentDestinationAddress:"#InlineDoc-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(){return this.pict.CSSMap.injectCSS(),this._setupCompactModeObserver(),super.onAfterRender()}_setupCompactModeObserver(){if("undefined"==typeof document||"undefined"==typeof ResizeObserver)return;let t=document.querySelector(".pict-inline-doc");if(!t)return;this._resizeObserver&&this._resizeObserver.disconnect();this._resizeObserver=new ResizeObserver(e=>{for(let i=0;i<e.length;i++){e[i].contentRect.width<550?t.classList.add("pict-inline-doc-compact"):t.classList.remove("pict-inline-doc-compact")}}),this._resizeObserver.observe(t);let e=t.offsetWidth;e>0&&e<550&&t.classList.add("pict-inline-doc-compact")}},e.exports.default_configuration=o},{"pict-view":102}],84:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"InlineDoc-Nav",DefaultRenderable:"InlineDoc-Nav-Display",DefaultContentDestinationAddress:"#InlineDoc-Nav-Container",AutoRender:!1,CSS:"\n\t\t.pict-inline-doc-nav {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t}\n\t\t.pict-inline-doc-nav-collapsed-header {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 0.5em 0.8em;\n\t\t\tcursor: pointer;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tbackground: #F7F5F0;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.pict-inline-doc-nav-collapsed-header:hover {\n\t\t\tbackground: #EDE8DF;\n\t\t}\n\t\t.pict-inline-doc-nav-chevron {\n\t\t\tfont-size: 0.6em;\n\t\t\ttransition: transform 0.2s ease;\n\t\t\tcolor: #8A7F72;\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tmargin-right: 0.5em;\n\t\t}\n\t\t.pict-inline-doc-nav-chevron.expanded {\n\t\t\ttransform: rotate(90deg);\n\t\t}\n\t\t.pict-inline-doc-nav-current-title {\n\t\t\tfont-size: 0.9em;\n\t\t\tfont-weight: 500;\n\t\t\tcolor: #3D3229;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\tflex: 1;\n\t\t}\n\t\t.pict-inline-doc-nav-outline {\n\t\t\tdisplay: none;\n\t\t\toverflow-y: auto;\n\t\t}\n\t\t.pict-inline-doc-nav-outline.expanded {\n\t\t\tdisplay: block;\n\t\t}\n\t\t.pict-inline-doc-nav-filter {\n\t\t\tpadding: 0.3em 0.6em;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t}\n\t\t.pict-inline-doc-nav-filter input {\n\t\t\twidth: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t\tpadding: 0.3em 0.5em;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.85em;\n\t\t\toutline: none;\n\t\t}\n\t\t.pict-inline-doc-nav-filter input:focus {\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-nav-group {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t\t.pict-inline-doc-nav-group-header {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 0.4em 0.8em;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.7em;\n\t\t\tcolor: #5E5549;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.pict-inline-doc-nav-group-header:hover {\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #F0ECE4;\n\t\t}\n\t\t.pict-inline-doc-nav-group-toggle {\n\t\t\tmargin-right: 0.35em;\n\t\t\tfont-size: 0.65em;\n\t\t\ttransition: transform 0.15s ease;\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t}\n\t\t.pict-inline-doc-nav-group-toggle.collapsed {\n\t\t\ttransform: rotate(-90deg);\n\t\t}\n\t\t.pict-inline-doc-nav-group.collapsed .pict-inline-doc-nav-group-items {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.pict-inline-doc-nav-item {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.25em 0.8em 0.25em 1.6em;\n\t\t\tcolor: #5E5549;\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.85em;\n\t\t\tcursor: pointer;\n\t\t\tborder-left: 3px solid transparent;\n\t\t\ttransition: background 0.1s ease, border-color 0.1s ease;\n\t\t}\n\t\t.pict-inline-doc-nav-item:hover {\n\t\t\tbackground: #EDE8DF;\n\t\t}\n\t\t.pict-inline-doc-nav-item.active {\n\t\t\tbackground: #E8E3D8;\n\t\t\tcolor: #2E7D74;\n\t\t\tborder-left-color: #2E7D74;\n\t\t\tfont-weight: 500;\n\t\t}\n\t\t.pict-inline-doc-nav-heading {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.15em 0.8em 0.15em 2.4em;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 0.78em;\n\t\t\tcursor: pointer;\n\t\t\tborder-left: 3px solid transparent;\n\t\t\ttransition: background 0.1s ease, color 0.1s ease;\n\t\t}\n\t\t.pict-inline-doc-nav-heading:hover {\n\t\t\tbackground: #EDE8DF;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.pict-inline-doc-nav-heading.h3 {\n\t\t\tpadding-left: 3.2em;\n\t\t\tfont-size: 0.72em;\n\t\t}\n\t\t/* Search icon in collapsed header */\n\t\t.pict-inline-doc-nav-search-icon {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tcolor: #8A7F72;\n\t\t\topacity: 0.5;\n\t\t\ttransition: opacity 0.2s;\n\t\t\tflex-shrink: 0;\n\t\t\tmargin-left: 0.3em;\n\t\t}\n\t\t.pict-inline-doc-nav-search-icon:hover {\n\t\t\topacity: 1;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t/* Search results section */\n\t\t.pict-inline-doc-nav-search-results {\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tpadding: 0.3em 0;\n\t\t}\n\t\t.pict-inline-doc-nav-search-status {\n\t\t\tpadding: 0.2em 0.8em;\n\t\t\tfont-size: 0.7em;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t}\n\t\t.pict-inline-doc-nav-search-result {\n\t\t\tdisplay: flex;\n\t\t\talign-items: baseline;\n\t\t\tpadding: 0.25em 0.8em 0.25em 1.2em;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.82em;\n\t\t\tcolor: #3D3229;\n\t\t\ttext-decoration: none;\n\t\t\ttransition: background 0.1s ease;\n\t\t\tgap: 0.5em;\n\t\t}\n\t\t.pict-inline-doc-nav-search-result:hover {\n\t\t\tbackground: #EDE8DF;\n\t\t}\n\t\t.pict-inline-doc-nav-search-result-title {\n\t\t\tflex: 1;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.pict-inline-doc-nav-search-result-group {\n\t\t\tfont-size: 0.75em;\n\t\t\tcolor: #8A7F72;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t/* External link indicator */\n\t\t.pict-inline-doc-nav-item-external {\n\t\t\tcolor: #8A7F72;\n\t\t}\n\t\t.pict-inline-doc-nav-item-external:hover {\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-nav-external-icon {\n\t\t\tdisplay: inline;\n\t\t\tmargin-left: 0.3em;\n\t\t\topacity: 0.5;\n\t\t\tvertical-align: -0.05em;\n\t\t}\n\t\t.pict-inline-doc-nav-topic-badge {\n\t\t\tdisplay: inline-block;\n\t\t\tmargin: 0.5em 1em;\n\t\t\tpadding: 0.3em 0.7em;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #fff;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.8em;\n\t\t\tfont-weight: 500;\n\t\t}\n\t\t.pict-inline-doc-nav-topic-clear {\n\t\t\tmargin-left: 0.5em;\n\t\t\tcursor: pointer;\n\t\t\topacity: 0.8;\n\t\t}\n\t\t.pict-inline-doc-nav-topic-clear:hover {\n\t\t\topacity: 1;\n\t\t}\n\t\t.pict-inline-doc-nav-toolbar {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.3em;\n\t\t\tpadding: 0.3em 1em;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t}\n\t\t.pict-inline-doc-nav-toolbar-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 28px;\n\t\t\theight: 28px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: #fff;\n\t\t\tcolor: #5E5549;\n\t\t\tfont-size: 0.9em;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s, border-color 0.1s;\n\t\t}\n\t\t.pict-inline-doc-nav-toolbar-btn:hover {\n\t\t\tbackground: #F0ECE4;\n\t\t\tborder-color: #C4BDB3;\n\t\t}\n\t\t.pict-inline-doc-nav-toolbar-btn.accent {\n\t\t\tborder-color: #2E7D74;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-nav-toolbar-btn.accent:hover {\n\t\t\tbackground: #F0F9F7;\n\t\t}\n\t\t.pict-inline-doc-nav-toolbar-btn.active {\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #fff;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-nav-toolbar-btn.active:hover {\n\t\t\tbackground: #266D65;\n\t\t}\n\t\t.pict-inline-doc-nav-toolbar-spacer {\n\t\t\tflex: 1;\n\t\t}\n\t",Templates:[{Hash:"InlineDoc-Nav-Template",Template:'<div class="pict-inline-doc-nav" id="InlineDoc-Nav-Body"></div>'}],Renderables:[{RenderableHash:"InlineDoc-Nav-Display",TemplateHash:"InlineDoc-Nav-Template",ContentDestinationAddress:"#InlineDoc-Nav-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(){return this._renderNavigation(),super.onAfterRender()}_renderNavigation(){if("undefined"==typeof document)return;let t=document.getElementById("InlineDoc-Nav-Body");if(!t)return;let e=this.pict.AppData.InlineDocumentation;if(!e)return;let i=this.pict.providers["Pict-InlineDocumentation"],n=[];i&&"function"==typeof i._extractHeadings&&(n=i._extractHeadings());let o=e.CurrentPath||"",r=!1!==e.NavCollapsed,a=e.NavFilterText||"",s=this._resolveCurrentDocName(e,o),l="",d=e.SearchQuery||"",c=e.SearchResults||[];if(l+='<div class="pict-inline-doc-nav-collapsed-header">',l+='<span class="'+("pict-inline-doc-nav-chevron"+(r?"":" expanded"))+'" id="InlineDoc-Nav-CollapseToggle">',l+='<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6,3 11,8 6,13"/></svg>',l+="</span>",l+='<span class="pict-inline-doc-nav-current-title" id="InlineDoc-Nav-TitleToggle">'+this._escapeHTML(s)+"</span>",l+='<span class="pict-inline-doc-nav-search-icon" id="InlineDoc-Nav-SearchBtn" title="Search documentation">',l+='<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="7" cy="7" r="4.5"/><line x1="10.5" y1="10.5" x2="14" y2="14"/></svg>',l+="</span>",l+="</div>",l+='<div class="'+("pict-inline-doc-nav-outline"+(r?"":" expanded"))+'" id="InlineDoc-Nav-Outline">',l+='<div class="pict-inline-doc-nav-filter">',l+='<input type="text" id="InlineDoc-Nav-FilterInput" placeholder="'+(e.SearchIndexLoaded?"Search documentation...":"Filter...")+'" value="'+this._escapeHTML(d||a)+'" />',l+="</div>",c.length>0&&d){l+='<div class="pict-inline-doc-nav-search-results">',l+='<div class="pict-inline-doc-nav-search-status">'+c.length+" result"+(1!==c.length?"s":"")+"</div>";for(let t=0;t<c.length&&t<15;t++){let e=c[t];l+='<a class="pict-inline-doc-nav-search-result" data-search-path="'+this._escapeHTML(e.DocPath)+'">',l+='<span class="pict-inline-doc-nav-search-result-title">'+this._escapeHTML(e.Title)+"</span>",e.Group&&(l+='<span class="pict-inline-doc-nav-search-result-group">'+this._escapeHTML(e.Group)+"</span>"),l+="</a>"}l+="</div>"}l+=this._renderTopicBadge(e),l+=this._renderToolbar(e),l+=this._renderGroupTree(e,o,n,a),l+="</div>",t.innerHTML=l,this._wireClickHandlers(t)}_resolveCurrentDocName(t,e){if(!e)return"Documentation";let i=t.SidebarGroups||[];for(let t=0;t<i.length;t++){let n=i[t];if(n.Path&&n.Path===e)return n.Name||e;let o=n.Items||[];for(let t=0;t<o.length;t++)if(o[t].Path===e)return o[t].Name||e}return e}_renderTopicBadge(t){let e=t.Topic;if(!e||!t.Topics||!t.Topics[e])return"";let i=t.Topics[e],n=i.TopicTitle||i.Name||e;return'<div class="pict-inline-doc-nav-topic-badge">'+this._escapeHTML(n)+'<span class="pict-inline-doc-nav-topic-clear" id="InlineDoc-Nav-ClearTopic"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg></span></div>'}_renderToolbar(t){if(!t.TopicManagerEnabled)return"";let e='<div class="pict-inline-doc-nav-toolbar">';return e+='<button class="pict-inline-doc-nav-toolbar-btn" id="InlineDoc-Nav-ManageTopics" title="Manage Topics"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="8" cy="8" r="2.5"/><path d="M8 1v2M8 13v2M1 8h2M13 8h2M3.05 3.05l1.41 1.41M11.54 11.54l1.41 1.41M3.05 12.95l1.41-1.41M11.54 4.46l1.41-1.41"/></svg></button>',t.CurrentRoute&&(e+='<button class="pict-inline-doc-nav-toolbar-btn accent" id="InlineDoc-Nav-BindTopic" title="Bind topic to current route"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M6.5 9.5a3.5 3.5 0 005 0l2-2a3.5 3.5 0 00-5-5l-1 1"/><path d="M9.5 6.5a3.5 3.5 0 00-5 0l-2 2a3.5 3.5 0 005 5l1-1"/></svg></button>'),e+='<button class="pict-inline-doc-nav-toolbar-btn'+(t.TooltipEditMode?" active":"")+'" id="InlineDoc-Nav-TooltipEditMode" title="Toggle tooltip edit mode"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M14 10a1.5 1.5 0 01-1.5 1.5H4l-3 3V3A1.5 1.5 0 012.5 1.5h10A1.5 1.5 0 0114 3z"/></svg></button>',e+='<span class="pict-inline-doc-nav-toolbar-spacer"></span>',e+="</div>",e}_renderGroupTree(t,e,i,n){let o="",r=t.SidebarGroups||[],a=t.Topic,s=null,l=(n||"").toLowerCase();if(a&&t.Topics&&t.Topics[a]){let e=t.Topics[a];s=e.TopicHelpFilePath?[e.TopicHelpFilePath]:e.Documents?e.Documents:[]}for(let n=0;n<r.length;n++){let a=r[n],d=a.Items||[];if(s){d=d.filter(t=>s.indexOf(t.Path)>=0);let t=s.indexOf(a.Path)>=0;if(d.length<1&&!t)continue}if(l){d=d.filter(t=>{if((t.Name||"").toLowerCase().indexOf(l)>=0)return!0;if(t.Path===e&&i.length>0)for(let t=0;t<i.length;t++)if((i[t].Text||"").toLowerCase().indexOf(l)>=0)return!0;return!1});let t=(a.Name||"").toLowerCase().indexOf(l)>=0;if(d.length<1&&!t)continue}let c=a.Key||a.Name||"group-"+n,p=t.CollapsedGroups&&t.CollapsedGroups[c],h="pict-inline-doc-nav-group-toggle"+(p?" collapsed":"");if(o+='<div class="'+("pict-inline-doc-nav-group"+(p?" collapsed":""))+'" data-group="'+this._escapeHTML(c)+'">',o+='<div class="pict-inline-doc-nav-group-header">',o+='<span class="'+h+'">▼</span>',o+=this._escapeHTML(a.Name),o+="</div>",o+='<div class="pict-inline-doc-nav-group-items">',a.Path){o+='<a class="pict-inline-doc-nav-item'+(e===a.Path?" active":"")+'" data-doc-path="'+this._escapeHTML(a.Path)+'">'+this._escapeHTML(a.Name)+"</a>",e===a.Path&&(o+=this._renderHeadingSubItems(i,l))}for(let t=0;t<d.length;t++){let n=d[t];if(n.Path)if(n.External&&n.ExternalURL)o+='<a class="pict-inline-doc-nav-item pict-inline-doc-nav-item-external" data-external-url="'+this._escapeHTML(n.ExternalURL)+'">'+this._escapeHTML(n.Name)+'<svg class="pict-inline-doc-nav-external-icon" width="0.75em" height="0.75em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12 9v4a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1h4"/><polyline points="8,2 14,2 14,8"/><line x1="14" y1="2" x2="7" y2="9"/></svg></a>';else{o+='<a class="pict-inline-doc-nav-item'+(e===n.Path?" active":"")+'" data-doc-path="'+this._escapeHTML(n.Path)+'">'+this._escapeHTML(n.Name)+"</a>",e===n.Path&&(o+=this._renderHeadingSubItems(i,l))}else o+='<span class="pict-inline-doc-nav-item">'+this._escapeHTML(n.Name)+"</span>"}o+="</div>",o+="</div>"}return o}_renderHeadingSubItems(t,e){if(!t||t.length<1)return"";let i="";for(let n=0;n<t.length;n++){let o=t[n],r=o.Text||"";e&&r.toLowerCase().indexOf(e)<0||(i+='<a class="pict-inline-doc-nav-heading'+(3===o.Level?" h3":"")+'" data-heading-slug="'+this._escapeHTML(o.Slug)+'">'+this._escapeHTML(r)+"</a>")}return i}_wireClickHandlers(t){let e=this.pict.providers["Pict-InlineDocumentation"],i=this.pict.AppData.InlineDocumentation,n=this,o=t.querySelector("#InlineDoc-Nav-CollapseToggle");o&&o.addEventListener("click",()=>{i&&(i.NavCollapsed=!i.NavCollapsed),n._renderNavigation()});let r=t.querySelector("#InlineDoc-Nav-TitleToggle");r&&r.addEventListener("click",()=>{i&&(i.NavCollapsed=!i.NavCollapsed),n._renderNavigation()});let a=t.querySelector("#InlineDoc-Nav-SearchBtn");a&&a.addEventListener("click",t=>{t.stopPropagation(),i&&(i.NavCollapsed=!1),n._renderNavigation();let e=document.getElementById("InlineDoc-Nav-FilterInput");e&&e.focus()});let s=t.querySelector("#InlineDoc-Nav-FilterInput");if(s){let t=null;s.addEventListener("input",o=>{let r=o.target.value||"";if(i&&(i.NavFilterText=r),i&&i.SearchIndexLoaded&&e&&"function"==typeof e.search)t&&clearTimeout(t),t=setTimeout(()=>{i.SearchQuery=r,i.SearchResults=r.trim()?e.search(r):[],n._renderNavigation();let t=document.getElementById("InlineDoc-Nav-FilterInput");if(t){t.focus();let e=t.value.length;t.setSelectionRange(e,e)}},250);else{n._renderNavigation();let t=document.getElementById("InlineDoc-Nav-FilterInput");if(t){t.focus();let e=t.value.length;t.setSelectionRange(e,e)}}})}let l=t.querySelectorAll(".pict-inline-doc-nav-search-result[data-search-path]");for(let t=0;t<l.length;t++){let n=l[t];n.addEventListener("click",t=>{t.preventDefault();let o=n.getAttribute("data-search-path");e&&o&&(i&&(i.SearchQuery="",i.SearchResults=[],i.NavFilterText=""),e.loadDocument(o))})}let d=t.querySelectorAll("[data-external-url]");for(let t=0;t<d.length;t++){let e=d[t];e.addEventListener("click",t=>{t.preventDefault();let i=e.getAttribute("data-external-url");i&&window.open(i,"_blank")})}let c=t.querySelectorAll(".pict-inline-doc-nav-item[data-doc-path]");for(let t=0;t<c.length;t++){let n=c[t];n.addEventListener("click",t=>{t.preventDefault();let o=n.getAttribute("data-doc-path");e&&o&&(i&&(i.NavFilterText=""),e.loadDocument(o))})}let p=t.querySelectorAll(".pict-inline-doc-nav-heading[data-heading-slug]");for(let t=0;t<p.length;t++){let i=p[t];i.addEventListener("click",t=>{t.preventDefault();let n=i.getAttribute("data-heading-slug");e&&n&&e._scrollToAnchor(n)})}let h=t.querySelectorAll(".pict-inline-doc-nav-group-header");for(let t=0;t<h.length;t++){let e=h[t];e.addEventListener("click",()=>{let t=e.parentElement;if(t){t.classList.toggle("collapsed");let e=t.getAttribute("data-group");if(i&&e){i.CollapsedGroups||(i.CollapsedGroups={});let n=t.querySelector(".pict-inline-doc-nav-group-toggle");t.classList.contains("collapsed")?(i.CollapsedGroups[e]=!0,n&&n.classList.add("collapsed")):(delete i.CollapsedGroups[e],n&&n.classList.remove("collapsed"))}}})}let u=t.querySelector("#InlineDoc-Nav-ClearTopic");u&&e&&u.addEventListener("click",t=>{t.stopPropagation(),e.clearTopic()});let m=t.querySelector("#InlineDoc-Nav-ManageTopics");m&&m.addEventListener("click",t=>{t.stopPropagation();let e=this.pict.views["InlineDoc-TopicManager"];e&&e.showTopicManager()});let g=t.querySelector("#InlineDoc-Nav-TooltipEditMode");g&&g.addEventListener("click",t=>{t.stopPropagation();let e=this.pict.providers["Pict-InlineDocumentation"];if(e){let t=this.pict.AppData.InlineDocumentation;e.setTooltipEditMode(!t.TooltipEditMode)}});let f=t.querySelector("#InlineDoc-Nav-BindTopic");f&&f.addEventListener("click",t=>{t.stopPropagation();let e=this.pict.views["InlineDoc-TopicManager"];e&&e.showBindTopicToRoute()})}_escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}},e.exports.default_configuration=o},{"pict-view":102}],85:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"InlineDoc-TopicManager",AutoRender:!1,CSS:"\n\t\t.pict-inline-doc-tm-topic-list {\n\t\t\tmax-height: 400px;\n\t\t\toverflow-y: auto;\n\t\t\tmargin: 0 -0.5em;\n\t\t}\n\t\t.pict-inline-doc-tm-topic-item {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 0.6em 0.8em;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.pict-inline-doc-tm-topic-item:hover {\n\t\t\tbackground: #F5F0E8;\n\t\t}\n\t\t.pict-inline-doc-tm-topic-item:last-child {\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t.pict-inline-doc-tm-topic-info {\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.pict-inline-doc-tm-topic-title {\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-size: 0.95em;\n\t\t}\n\t\t.pict-inline-doc-tm-topic-meta {\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-top: 0.15em;\n\t\t}\n\t\t.pict-inline-doc-tm-topic-actions {\n\t\t\tdisplay: flex;\n\t\t\tgap: 0.3em;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.pict-inline-doc-tm-action-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 28px;\n\t\t\theight: 28px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: #fff;\n\t\t\tcolor: #5E5549;\n\t\t\tfont-size: 0.85em;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s, border-color 0.1s;\n\t\t}\n\t\t.pict-inline-doc-tm-action-btn:hover {\n\t\t\tbackground: #F0ECE4;\n\t\t\tborder-color: #C4BDB3;\n\t\t}\n\t\t.pict-inline-doc-tm-action-btn.danger:hover {\n\t\t\tbackground: #FDE8E8;\n\t\t\tborder-color: #E57373;\n\t\t\tcolor: #C62828;\n\t\t}\n\t\t.pict-inline-doc-tm-new-topic {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tpadding: 0.7em;\n\t\t\tmargin-top: 0.5em;\n\t\t\tborder: 1px dashed #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tcolor: #2E7D74;\n\t\t\tfont-size: 0.9em;\n\t\t\tfont-weight: 500;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s, border-color 0.1s;\n\t\t}\n\t\t.pict-inline-doc-tm-new-topic:hover {\n\t\t\tbackground: #F0F9F7;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-tm-empty {\n\t\t\ttext-align: center;\n\t\t\tpadding: 2em 1em;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 0.9em;\n\t\t}\n\t\t.pict-inline-doc-tm-form-group {\n\t\t\tmargin-bottom: 0.8em;\n\t\t}\n\t\t.pict-inline-doc-tm-form-label {\n\t\t\tdisplay: block;\n\t\t\tfont-size: 0.8em;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #5E5549;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t\tmargin-bottom: 0.3em;\n\t\t}\n\t\t.pict-inline-doc-tm-form-input {\n\t\t\twidth: 100%;\n\t\t\tpadding: 0.45em 0.6em;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #FDFCFA;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.pict-inline-doc-tm-form-input:focus {\n\t\t\toutline: none;\n\t\t\tborder-color: #2E7D74;\n\t\t\tbox-shadow: 0 0 0 2px rgba(46, 125, 116, 0.15);\n\t\t}\n\t\t.pict-inline-doc-tm-form-input[readonly] {\n\t\t\tbackground: #F5F0E8;\n\t\t\tcolor: #8A7F72;\n\t\t}\n\t\t.pict-inline-doc-tm-form-hint {\n\t\t\tfont-size: 0.75em;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-top: 0.2em;\n\t\t}\n\t\t.pict-inline-doc-tm-routes-section {\n\t\t\tmargin-top: 0.5em;\n\t\t}\n\t\t.pict-inline-doc-tm-route-chips {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tgap: 0.3em;\n\t\t\tmargin-bottom: 0.5em;\n\t\t}\n\t\t.pict-inline-doc-tm-route-chip {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 0.2em 0.5em;\n\t\t\tbackground: #E8E3D8;\n\t\t\tborder-radius: 12px;\n\t\t\tfont-size: 0.82em;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace;\n\t\t}\n\t\t.pict-inline-doc-tm-route-chip-remove {\n\t\t\tmargin-left: 0.4em;\n\t\t\tcursor: pointer;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 0.9em;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.pict-inline-doc-tm-route-chip-remove:hover {\n\t\t\tcolor: #C62828;\n\t\t}\n\t\t.pict-inline-doc-tm-route-actions {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tgap: 0.3em;\n\t\t}\n\t\t.pict-inline-doc-tm-route-action-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 0.25em 0.5em;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: #fff;\n\t\t\tcolor: #5E5549;\n\t\t\tfont-size: 0.8em;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.pict-inline-doc-tm-route-action-btn:hover {\n\t\t\tbackground: #F0ECE4;\n\t\t}\n\t\t.pict-inline-doc-tm-route-action-btn.accent {\n\t\t\tborder-color: #2E7D74;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-tm-route-action-btn.accent:hover {\n\t\t\tbackground: #F0F9F7;\n\t\t}\n\t\t.pict-inline-doc-tm-route-input-row {\n\t\t\tdisplay: none;\n\t\t\talign-items: center;\n\t\t\tgap: 0.3em;\n\t\t\tmargin-top: 0.4em;\n\t\t}\n\t\t.pict-inline-doc-tm-route-input-row.visible {\n\t\t\tdisplay: flex;\n\t\t}\n\t\t.pict-inline-doc-tm-route-input {\n\t\t\tflex: 1;\n\t\t\tpadding: 0.35em 0.5em;\n\t\t\tfont-size: 0.85em;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace;\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #FDFCFA;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t}\n\t\t.pict-inline-doc-tm-route-input:focus {\n\t\t\toutline: none;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-container {\n\t\t\tpadding: 0.5em 0;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-label {\n\t\t\tfont-size: 0.85em;\n\t\t\tcolor: #5E5549;\n\t\t\tmargin-bottom: 0.6em;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-segments {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\talign-items: center;\n\t\t\tgap: 0.15em;\n\t\t\tmargin-bottom: 0.8em;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-slash {\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1.1em;\n\t\t\tfont-weight: 300;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-segment {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 0.4em 0.7em;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: #fff;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace;\n\t\t\tfont-size: 0.9em;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.15s, border-color 0.15s, opacity 0.15s;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-segment:hover {\n\t\t\tborder-color: #2E7D74;\n\t\t\tbackground: #F0F9F7;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-segment.selected {\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #fff;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-segment.after-wildcard {\n\t\t\topacity: 0.35;\n\t\t\tborder-style: dashed;\n\t\t\tcursor: default;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-segment.after-wildcard:hover {\n\t\t\tborder-color: #DDD6CA;\n\t\t\tbackground: #fff;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-wildcard-star {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 0.4em 0.6em;\n\t\t\tcolor: #2E7D74;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace;\n\t\t\tfont-size: 1.1em;\n\t\t\tfont-weight: 700;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-preview {\n\t\t\tpadding: 0.5em 0.7em;\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder: 1px solid #E5DED4;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-preview-label {\n\t\t\tfont-size: 0.75em;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t\tmargin-bottom: 0.3em;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-route-display {\n\t\t\tpadding: 0.5em 0.7em;\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder: 1px solid #E5DED4;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-bottom: 0.8em;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-topic-list {\n\t\t\tmax-height: 250px;\n\t\t\toverflow-y: auto;\n\t\t\tmargin-bottom: 0.6em;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-topic-option {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 0.5em 0.6em;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-topic-option:hover {\n\t\t\tbackground: #F5F0E8;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-topic-option.selected {\n\t\t\tbackground: #F0F9F7;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-radio {\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\tborder: 2px solid #DDD6CA;\n\t\t\tborder-radius: 50%;\n\t\t\tmargin-right: 0.6em;\n\t\t\tflex-shrink: 0;\n\t\t\tposition: relative;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-topic-option.selected .pict-inline-doc-tm-bind-radio {\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-topic-option.selected .pict-inline-doc-tm-bind-radio::after {\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\ttop: 3px;\n\t\t\tleft: 3px;\n\t\t\twidth: 6px;\n\t\t\theight: 6px;\n\t\t\tbackground: #2E7D74;\n\t\t\tborder-radius: 50%;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-route-type {\n\t\t\tdisplay: flex;\n\t\t\tgap: 0.5em;\n\t\t\tmargin-bottom: 0.5em;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-route-type-btn {\n\t\t\tflex: 1;\n\t\t\tpadding: 0.5em;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: #fff;\n\t\t\tcolor: #5E5549;\n\t\t\tfont-size: 0.85em;\n\t\t\ttext-align: center;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s, border-color 0.1s;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-route-type-btn:hover {\n\t\t\tbackground: #F0ECE4;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-route-type-btn.selected {\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #fff;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-tm-sidebar-list {\n\t\t\tmax-height: 300px;\n\t\t\toverflow-y: auto;\n\t\t}\n\t\t.pict-inline-doc-tm-sidebar-item {\n\t\t\tpadding: 0.4em 0.6em;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.pict-inline-doc-tm-sidebar-item:hover {\n\t\t\tbackground: #F5F0E8;\n\t\t}\n\t\t.pict-inline-doc-tm-sidebar-item .path {\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace;\n\t\t\tfont-size: 0.85em;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-left: 0.5em;\n\t\t}\n\t\t.pict-inline-doc-tm-validation-error {\n\t\t\tcolor: #C62828;\n\t\t\tfont-size: 0.8em;\n\t\t\tmargin-top: 0.3em;\n\t\t}\n\t",Templates:[],Renderables:[]};e.exports=class extends n{constructor(t,e,i){super(t,e,i)}_getModal(){return this.pict.views.PictSectionModal||this.pict.views["Pict-Section-Modal"]||null}_getProvider(){return this.pict.providers["Pict-InlineDocumentation"]||null}showTopicManager(){let t=this._getModal(),e=this._getProvider();if(!t)return void this.log.warn("InlineDocumentation TopicManager: Pict-Section-Modal view is not registered.");if(!e)return;let i=e.getTopicList(),n=this._buildTopicListHTML(i);t.show({title:"Manage Topics",content:n,closeable:!0,width:"520px",buttons:[{Hash:"close",Label:"Close",Style:"primary"}],onOpen:t=>{this._wireTopicListHandlers(t)}})}_buildTopicListHTML(t){if(!t||t.length<1)return'<div class="pict-inline-doc-tm-empty">No topics defined yet.</div><div class="pict-inline-doc-tm-new-topic" data-action="new-topic">+ New Topic</div>';let e='<div class="pict-inline-doc-tm-topic-list">';for(let i=0;i<t.length;i++){let n=t[i];e+='<div class="pict-inline-doc-tm-topic-item" data-topic-code="'+this._escapeHTML(n.TopicCode)+'">',e+='<div class="pict-inline-doc-tm-topic-info">',e+='<div class="pict-inline-doc-tm-topic-title">'+this._escapeHTML(n.TopicTitle)+"</div>",e+='<div class="pict-inline-doc-tm-topic-meta">',e+=this._escapeHTML(n.TopicCode),n.TopicHelpFilePath&&(e+=" · "+this._escapeHTML(n.TopicHelpFilePath)),e+=" · "+n.RouteCount+" route"+(1!==n.RouteCount?"s":""),e+="</div>",e+="</div>",e+='<div class="pict-inline-doc-tm-topic-actions">',e+='<button class="pict-inline-doc-tm-action-btn" data-action="edit" data-topic-code="'+this._escapeHTML(n.TopicCode)+'" title="Edit"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M11.5 1.5l3 3L5 14H2v-3z"/><line x1="9" y1="4" x2="12" y2="7"/></svg></button>',e+='<button class="pict-inline-doc-tm-action-btn danger" data-action="delete" data-topic-code="'+this._escapeHTML(n.TopicCode)+'" title="Delete"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg></button>',e+="</div>",e+="</div>"}return e+="</div>",e+='<div class="pict-inline-doc-tm-new-topic" data-action="new-topic">+ New Topic</div>',e}_wireTopicListHandlers(t){let e=this,i=this._getModal(),n=this._getProvider(),o=t.querySelectorAll('[data-action="edit"]');for(let t=0;t<o.length;t++)o[t].addEventListener("click",n=>{n.stopPropagation();let r=o[t].getAttribute("data-topic-code");i&&i.dismissModals&&i.dismissModals(),setTimeout(()=>{e.showTopicEditor(r)},250)});let r=t.querySelectorAll('[data-action="delete"]');for(let t=0;t<r.length;t++)r[t].addEventListener("click",o=>{o.stopPropagation();let a=r[t].getAttribute("data-topic-code");i&&i.confirm&&i.confirm('Are you sure you want to delete the topic "'+a+'"?',{title:"Delete Topic",dangerous:!0}).then(t=>{if(t&&n){n.removeTopic(a),n.saveTopics();let t=e.pict.views["InlineDoc-Nav"];t&&t.render(),i.toast&&i.toast("Topic deleted.",{type:"success"}),setTimeout(()=>{e.showTopicManager()},250)}})});let a=t.querySelector('[data-action="new-topic"]');a&&a.addEventListener("click",()=>{i&&i.dismissModals&&i.dismissModals(),setTimeout(()=>{e.showTopicEditor(null)},250)})}showTopicEditor(t){let e=this._getModal(),i=this._getProvider();if(!e||!i)return;let n=this.pict.AppData.InlineDocumentation,o=!t,r=null;r=t&&n.Topics&&n.Topics[t]?JSON.parse(JSON.stringify(n.Topics[t])):{TopicCode:"",TopicTitle:"",TopicHelpFilePath:"",Routes:[]};let a=this._buildTopicEditorHTML(r,o),s=r.Routes?r.Routes.slice():[];e.show({title:o?"New Topic":"Edit Topic",content:a,closeable:!0,width:"500px",buttons:[{Hash:"cancel",Label:"Cancel"},{Hash:"save",Label:"Save",Style:"primary"}],onOpen:t=>{this._wireTopicEditorHandlers(t,r,o,s)}}).then(t=>{"save"===t?this._handleTopicEditorSave(r,o,s):setTimeout(()=>{this.showTopicManager()},250)})}_buildTopicEditorHTML(t,e){let i="";i+='<div class="pict-inline-doc-tm-form-group">',i+='<label class="pict-inline-doc-tm-form-label">Topic Code</label>',e?(i+='<input type="text" class="pict-inline-doc-tm-form-input" id="tm-editor-code" value="" placeholder="MY-TOPIC-CODE" />',i+='<div class="pict-inline-doc-tm-form-hint">Uppercase letters, numbers, and hyphens only.</div>'):i+='<input type="text" class="pict-inline-doc-tm-form-input" id="tm-editor-code" value="'+this._escapeHTML(t.TopicCode)+'" readonly />',i+='<div class="pict-inline-doc-tm-validation-error" id="tm-editor-code-error"></div>',i+="</div>",i+='<div class="pict-inline-doc-tm-form-group">',i+='<label class="pict-inline-doc-tm-form-label">Title</label>',i+='<input type="text" class="pict-inline-doc-tm-form-input" id="tm-editor-title" value="'+this._escapeHTML(t.TopicTitle||t.Name||"")+'" placeholder="My Topic Title" />',i+='<div class="pict-inline-doc-tm-validation-error" id="tm-editor-title-error"></div>',i+="</div>",i+='<div class="pict-inline-doc-tm-form-group">',i+='<label class="pict-inline-doc-tm-form-label">Help Document</label>',i+='<div style="display:flex;gap:0.3em;align-items:center;">',i+='<input type="text" class="pict-inline-doc-tm-form-input" id="tm-editor-helpfile" value="'+this._escapeHTML(t.TopicHelpFilePath||"")+'" placeholder="help-topic.md" style="flex:1;" />',i+='<button class="pict-inline-doc-tm-route-action-btn" id="tm-editor-browse-sidebar" title="Browse sidebar documents">Browse</button>',i+="</div>",i+="</div>",i+='<div class="pict-inline-doc-tm-form-group">',i+='<label class="pict-inline-doc-tm-form-label">Routes</label>',i+='<div class="pict-inline-doc-tm-routes-section">',i+='<div class="pict-inline-doc-tm-route-chips" id="tm-editor-route-chips">',i+=this._buildRouteChipsHTML(t.Routes||[]),i+="</div>",i+='<div class="pict-inline-doc-tm-route-actions">',i+='<button class="pict-inline-doc-tm-route-action-btn" id="tm-editor-add-route">+ Add Route</button>';let n=this.pict.AppData.InlineDocumentation;return n&&n.CurrentRoute&&(i+='<button class="pict-inline-doc-tm-route-action-btn accent" id="tm-editor-add-current-route">+ Current Route</button>',i+='<button class="pict-inline-doc-tm-route-action-btn accent" id="tm-editor-build-wildcard">Build Wildcard</button>'),i+="</div>",i+='<div class="pict-inline-doc-tm-route-input-row" id="tm-editor-route-input-row">',i+='<input type="text" class="pict-inline-doc-tm-route-input" id="tm-editor-route-input" placeholder="/my/route" />',i+='<button class="pict-inline-doc-tm-route-action-btn accent" id="tm-editor-route-input-add">Add</button>',i+="</div>",i+="</div>",i+="</div>",i}_buildRouteChipsHTML(t){if(!t||t.length<1)return'<span style="font-size:0.8em;color:#8A7F72;">No routes bound.</span>';let e="";for(let i=0;i<t.length;i++)e+='<span class="pict-inline-doc-tm-route-chip">',e+=this._escapeHTML(t[i]),e+='<span class="pict-inline-doc-tm-route-chip-remove" data-route="'+this._escapeHTML(t[i])+'">×</span>',e+="</span>";return e}_refreshRouteChips(t){if("undefined"==typeof document)return;let e=document.getElementById("tm-editor-route-chips");e&&(e.innerHTML=this._buildRouteChipsHTML(t),this._wireRouteChipRemoveHandlers(t))}_wireRouteChipRemoveHandlers(t){if("undefined"==typeof document)return;let e=this,i=document.querySelectorAll(".pict-inline-doc-tm-route-chip-remove");for(let n=0;n<i.length;n++)i[n].addEventListener("click",o=>{o.stopPropagation();let r=i[n].getAttribute("data-route"),a=t.indexOf(r);a>=0&&t.splice(a,1),e._refreshRouteChips(t)})}_wireTopicEditorHandlers(t,e,i,n){let o=this,r=this._getProvider(),a=this.pict.AppData.InlineDocumentation;this._wireRouteChipRemoveHandlers(n);let s=document.getElementById("tm-editor-add-route");s&&s.addEventListener("click",()=>{let t=document.getElementById("tm-editor-route-input-row");if(t){t.classList.toggle("visible");let e=document.getElementById("tm-editor-route-input");e&&e.focus()}});let l=document.getElementById("tm-editor-route-input-add");l&&l.addEventListener("click",()=>{let t=document.getElementById("tm-editor-route-input");if(t&&t.value.trim()){let e=t.value.trim();"/"!==e.charAt(0)&&(e="/"+e),n.indexOf(e)<0&&(n.push(e),o._refreshRouteChips(n)),t.value=""}});let d=document.getElementById("tm-editor-route-input");d&&d.addEventListener("keydown",t=>{"Enter"===t.key&&(t.preventDefault(),l&&l.click())});let c=document.getElementById("tm-editor-add-current-route");c&&a&&a.CurrentRoute&&c.addEventListener("click",()=>{let t=a.CurrentRoute;n.indexOf(t)<0&&(n.push(t),o._refreshRouteChips(n))});let p=document.getElementById("tm-editor-build-wildcard");p&&r&&a&&a.CurrentRoute&&p.addEventListener("click",()=>{let t=o._getModal();t&&t.dismissModals&&t.dismissModals(),setTimeout(()=>{o.showWildcardBuilder(a.CurrentRoute,t=>{t&&n.indexOf(t)<0&&n.push(t),o._reopenEditorAfterSubflow(e,i,n)})},250)});let h=document.getElementById("tm-editor-browse-sidebar");h&&h.addEventListener("click",()=>{let t=o._getModal();t&&t.dismissModals&&t.dismissModals(),setTimeout(()=>{o._showSidebarPicker(t=>{t&&(e.TopicHelpFilePath=t),o._reopenEditorAfterSubflow(e,i,n)})},250)})}_reopenEditorAfterSubflow(t,e,i){let n=this._getModal(),o=this._getProvider();if(!n||!o)return;let r=this._buildTopicEditorHTML({TopicCode:t.TopicCode,TopicTitle:t.TopicTitle,TopicHelpFilePath:t.TopicHelpFilePath,Routes:i},e);n.show({title:e?"New Topic":"Edit Topic",content:r,closeable:!0,width:"500px",buttons:[{Hash:"cancel",Label:"Cancel"},{Hash:"save",Label:"Save",Style:"primary"}],onOpen:n=>{this._wireTopicEditorHandlers(n,t,e,i)}}).then(n=>{"save"===n?this._handleTopicEditorSave(t,e,i):setTimeout(()=>{this.showTopicManager()},250)})}_handleTopicEditorSave(t,e,i){let n=this._getProvider(),o=this._getModal(),r=this.pict.AppData.InlineDocumentation;if(!n)return;let a="",s="",l="";if("undefined"!=typeof document){let t=document.getElementById("tm-editor-code"),e=document.getElementById("tm-editor-title"),i=document.getElementById("tm-editor-helpfile");t&&(a=t.value.trim()),e&&(s=e.value.trim()),i&&(l=i.value.trim())}let d=[];if(e?a?/^[A-Z0-9][A-Z0-9-]*$/.test(a)?r.Topics&&r.Topics[a]&&d.push('A topic with code "'+a+'" already exists.'):d.push("Topic Code must use uppercase letters, numbers, and hyphens only."):d.push("Topic Code is required."):a=t.TopicCode,s||d.push("Title is required."),d.length>0)return o&&o.toast&&o.toast(d.join(" "),{type:"error"}),t.TopicTitle=s,t.TopicHelpFilePath=l,e&&(t.TopicCode=a),void setTimeout(()=>{this._reopenEditorAfterSubflow(t,e,i)},300);e?n.addTopic(a,{TopicCode:a,TopicTitle:s,TopicHelpFilePath:l,Routes:i}):n.updateTopic(a,{TopicTitle:s,TopicHelpFilePath:l,Routes:i}),n.saveTopics();let c=this.pict.views["InlineDoc-Nav"];c&&c.render(),o&&o.toast&&o.toast("Topic saved.",{type:"success"}),setTimeout(()=>{this.showTopicManager()},300)}showWildcardBuilder(t,e){let i=this._getModal(),n=this._getProvider();if(!i||!n)return void("function"==typeof e&&e(null));let o=n.getRouteSegments(t);if(o.length<1)return i.toast&&i.toast("No route segments to build a wildcard from.",{type:"error"}),void("function"==typeof e&&e(null));let r=Math.max(0,o.length-2),a=this._buildWildcardBuilderHTML(o,t,r);i.show({title:"Build Wildcard Pattern",content:a,closeable:!0,width:"520px",buttons:[{Hash:"cancel",Label:"Cancel"},{Hash:"exact",Label:"Use Exact Route"},{Hash:"pattern",Label:"Use Pattern",Style:"primary"}],onOpen:t=>{this._wireWildcardBuilderHandlers(t,o,r)}}).then(i=>{if("pattern"===i){let t="undefined"!=typeof document?document.getElementById("tm-wc-preview-value"):null,i=t?t.textContent:o[r].WildcardPattern;"function"==typeof e&&e(i)}else"exact"===i?"function"==typeof e&&e(t):"function"==typeof e&&e(null)})}_buildWildcardBuilderHTML(t,e,i){let n='<div class="pict-inline-doc-tm-wc-container">';n+='<div class="pict-inline-doc-tm-wc-label">Click a segment to set the wildcard boundary. Everything after the selected segment will match any path.</div>',n+='<div class="pict-inline-doc-tm-wc-segments" id="tm-wc-segments">';for(let e=0;e<t.length;e++){let o="pict-inline-doc-tm-wc-segment";e===i?o+=" selected":e>i&&(o+=" after-wildcard"),n+='<span class="pict-inline-doc-tm-wc-slash">/</span>',n+='<span class="'+o+'" data-segment-index="'+e+'">',n+=this._escapeHTML(t[e].Segment),n+="</span>"}return n+='<span class="pict-inline-doc-tm-wc-slash">/</span>',n+='<span class="pict-inline-doc-tm-wc-wildcard-star" id="tm-wc-star">*</span>',n+="</div>",n+='<div class="pict-inline-doc-tm-wc-preview-label">Pattern</div>',n+='<div class="pict-inline-doc-tm-wc-preview" id="tm-wc-preview-value">',n+=this._escapeHTML(t[i].WildcardPattern),n+="</div>",n+="</div>",n}_wireWildcardBuilderHandlers(t,e,i){let n=i,o=i=>{n=i;let o=t.querySelectorAll(".pict-inline-doc-tm-wc-segment");for(let t=0;t<o.length;t++){let e=parseInt(o[t].getAttribute("data-segment-index"),10);o[t].classList.remove("selected","after-wildcard"),e===i?o[t].classList.add("selected"):e>i&&o[t].classList.add("after-wildcard")}let r=t.querySelector("#tm-wc-preview-value");r&&(r.textContent=e[i].WildcardPattern)},r=t.querySelectorAll(".pict-inline-doc-tm-wc-segment");for(let t=0;t<r.length;t++)r[t].addEventListener("click",()=>{let e=parseInt(r[t].getAttribute("data-segment-index"),10);o(e)})}showBindTopicToRoute(){let t=this._getModal(),e=this._getProvider();if(!t||!e)return;let i=this.pict.AppData.InlineDocumentation;if(!i||!i.CurrentRoute)return void(t.toast&&t.toast("No current route to bind to.",{type:"error"}));let n=i.CurrentRoute,o=e.getTopicList(),r=this._buildBindHTML(n,o),a=null,s="exact";t.show({title:"Bind Topic to Route",content:r,closeable:!0,width:"480px",buttons:[{Hash:"cancel",Label:"Cancel"},{Hash:"bind",Label:"Bind Route",Style:"primary"}],onOpen:t=>{this._wireBindHandlers(t,o,n,t=>{a=t},t=>{s=t})}}).then(i=>{if("bind"===i&&a)if("__NEW__"!==a)if("wildcard"===s)this.showWildcardBuilder(n,i=>{if(i){e.addRouteToTopic(a,i),e.saveTopics();let n=this.pict.views["InlineDoc-Nav"];n&&n.render(),t.toast&&t.toast("Route bound to topic.",{type:"success"})}});else{e.addRouteToTopic(a,n),e.saveTopics();let i=this.pict.views["InlineDoc-Nav"];i&&i.render(),t.toast&&t.toast("Route bound to topic.",{type:"success"})}else this.showTopicEditor(null)})}_buildBindHTML(t,e){let i="";i+='<div class="pict-inline-doc-tm-bind-route-display">'+this._escapeHTML(t)+"</div>",i+='<div class="pict-inline-doc-tm-form-group">',i+='<label class="pict-inline-doc-tm-form-label">Route Match Type</label>',i+='<div class="pict-inline-doc-tm-bind-route-type">',i+='<div class="pict-inline-doc-tm-bind-route-type-btn selected" data-route-type="exact">Exact Match</div>',i+='<div class="pict-inline-doc-tm-bind-route-type-btn" data-route-type="wildcard">Wildcard Pattern</div>',i+="</div>",i+="</div>",i+='<div class="pict-inline-doc-tm-form-group">',i+='<label class="pict-inline-doc-tm-form-label">Select Topic</label>',i+='<div class="pict-inline-doc-tm-bind-topic-list">';for(let t=0;t<e.length;t++){let n=e[t];i+='<div class="pict-inline-doc-tm-bind-topic-option" data-topic-code="'+this._escapeHTML(n.TopicCode)+'">',i+='<div class="pict-inline-doc-tm-bind-radio"></div>',i+='<div class="pict-inline-doc-tm-topic-info">',i+='<div class="pict-inline-doc-tm-topic-title">'+this._escapeHTML(n.TopicTitle)+"</div>",i+='<div class="pict-inline-doc-tm-topic-meta">'+this._escapeHTML(n.TopicCode)+"</div>",i+="</div>",i+="</div>"}return i+='<div class="pict-inline-doc-tm-bind-topic-option" data-topic-code="__NEW__">',i+='<div class="pict-inline-doc-tm-bind-radio"></div>',i+='<div class="pict-inline-doc-tm-topic-info">',i+='<div class="pict-inline-doc-tm-topic-title" style="color:#2E7D74;">+ Create New Topic</div>',i+="</div>",i+="</div>",i+="</div>",i+="</div>",i}_wireBindHandlers(t,e,i,n,o){let r=t.querySelectorAll(".pict-inline-doc-tm-bind-topic-option");for(let t=0;t<r.length;t++)r[t].addEventListener("click",()=>{for(let t=0;t<r.length;t++)r[t].classList.remove("selected");r[t].classList.add("selected"),n(r[t].getAttribute("data-topic-code"))});let a=t.querySelectorAll(".pict-inline-doc-tm-bind-route-type-btn");for(let t=0;t<a.length;t++)a[t].addEventListener("click",()=>{for(let t=0;t<a.length;t++)a[t].classList.remove("selected");a[t].classList.add("selected"),o(a[t].getAttribute("data-route-type"))})}_showSidebarPicker(t){let e=this._getModal(),i=this.pict.AppData.InlineDocumentation;if(!e)return void("function"==typeof t&&t(null));let n=i&&i.SidebarGroups?i.SidebarGroups:[],o=this._buildSidebarPickerHTML(n);e.show({title:"Select Document",content:o,closeable:!0,width:"400px",buttons:[{Hash:"cancel",Label:"Cancel"}],onOpen:i=>{let n=i.querySelectorAll(".pict-inline-doc-tm-sidebar-item");for(let i=0;i<n.length;i++)n[i].addEventListener("click",()=>{let o=n[i].getAttribute("data-path");e.dismissModals&&e.dismissModals(),"function"==typeof t&&t(o)})}}).then(e=>{"cancel"!==e&&null!==e||"function"==typeof t&&t(null)})}_buildSidebarPickerHTML(t){let e='<div class="pict-inline-doc-tm-sidebar-list">',i=!1;for(let n=0;n<t.length;n++){let o=t[n];o.Path&&(i=!0,e+='<div class="pict-inline-doc-tm-sidebar-item" data-path="'+this._escapeHTML(o.Path)+'">',e+=this._escapeHTML(o.Name),e+='<span class="path">'+this._escapeHTML(o.Path)+"</span>",e+="</div>");let r=o.Items||[];for(let t=0;t<r.length;t++)r[t].Path&&(i=!0,e+='<div class="pict-inline-doc-tm-sidebar-item" data-path="'+this._escapeHTML(r[t].Path)+'">',e+=this._escapeHTML(r[t].Name),e+='<span class="path">'+this._escapeHTML(r[t].Path)+"</span>",e+="</div>")}return i||(e+='<div class="pict-inline-doc-tm-empty">No sidebar documents found.</div>'),e+="</div>",e}_escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}},e.exports.default_configuration=o},{"pict-view":102}],86:[function(t,e,i){e.exports.attach=function(t){t._createEditorInContainer=function(e,i,n){let o=t._codeMirrorModules,r=[];r.push(o.EditorView.domEventHandlers({keydown:(e,n)=>(e.ctrlKey||e.metaKey)&&"b"===e.key?(e.preventDefault(),t.applyFormatting(i,"bold"),!0):(e.ctrlKey||e.metaKey)&&"i"===e.key?(e.preventDefault(),t.applyFormatting(i,"italic"),!0):(e.ctrlKey||e.metaKey)&&"e"===e.key?(e.preventDefault(),t.applyFormatting(i,"code"),!0):void 0,paste:(e,n)=>{let o=e.clipboardData&&e.clipboardData.items;if(!o)return!1;for(let n=0;n<o.length;n++)if(o[n].type.startsWith("image/")){e.preventDefault();let r=o[n].getAsFile();return r&&t._processImageFile(r,i),!0}return!1},drop:(e,n)=>{if(t._dragSourceIndex>=0)return!1;if(!e.dataTransfer||!e.dataTransfer.files||e.dataTransfer.files.length<1)return!1;let o=e.dataTransfer.files[0];if(o.type&&o.type.startsWith("image/")){e.preventDefault(),e.stopPropagation(),t._processImageFile(o,i);let r=n.dom.closest(".pict-mde-segment-editor");return r&&r.classList.remove("pict-mde-image-dragover"),!0}return!1}})),o.extensions&&Array.isArray(o.extensions)&&(r=r.concat(o.extensions)),r.push(o.EditorView.updateListener.of(e=>{e.docChanged&&t._onSegmentContentChange(i,e.state.doc.toString()),e.focusChanged&&(e.view.hasFocus?(t._setActiveSegment(i),t._updateSidebarPosition(i)):setTimeout(()=>{if(t._activeSegmentIndex===i){let e=document.getElementById(`PictMDE-Segment-${i}`);e&&!e.contains(document.activeElement)&&(t._clearActiveSegment(i),t._resetSidebarPosition(i))}},100)),e.selectionSet&&e.view.hasFocus&&t._updateSidebarPosition(i)}));let a=t._buildDataURICollapseExtension();a&&r.push(a),t.options.ReadOnly&&(r.push(o.EditorState.readOnly.of(!0)),r.push(o.EditorView.editable.of(!1))),r=t.customConfigureExtensions(r,i);let s=o.EditorState.create({doc:n||"",extensions:r}),l=new o.EditorView({state:s,parent:e});t._segmentEditors[i]=l,l.contentDOM.addEventListener("keydown",function(e){if("ArrowDown"!==e.key&&"ArrowUp"!==e.key)return;if(e.shiftKey||e.ctrlKey||e.metaKey||e.altKey)return;let n=l.state,o=n.selection.main.head,r=n.doc.lineAt(o),a=o-r.from;if("ArrowDown"===e.key){if(r.to<n.doc.length)return;let o=t._getOrderedSegmentIndices(),s=t._getLogicalIndex(i);if(s<0||s>=o.length-1)return;let l=o[s+1],d=t._segmentEditors[l];if(!d)return;e.preventDefault(),e.stopPropagation();let c=d.state.doc.line(1),p=Math.min(a,c.to-c.from);d.focus(),d.dispatch({selection:{anchor:c.from+p}}),t._setActiveSegment(l)}else if("ArrowUp"===e.key){if(r.number>1)return;let n=t._getOrderedSegmentIndices(),o=t._getLogicalIndex(i);if(o<=0)return;let s=n[o-1],l=t._segmentEditors[s];if(!l)return;e.preventDefault(),e.stopPropagation();let d=l.state.doc.line(l.state.doc.lines),c=Math.min(a,d.to-d.from);l.focus(),l.dispatch({selection:{anchor:d.from+c}}),t._setActiveSegment(s)}},!0),l.contentDOM.addEventListener("drop",function(e){if(t._dragSourceIndex>=0)return;if(!e.dataTransfer||!e.dataTransfer.files||e.dataTransfer.files.length<1)return;let n=e.dataTransfer.files[0];if(n.type&&n.type.startsWith("image/")){e.preventDefault(),e.stopPropagation(),t._processImageFile(n,i);let o=document.getElementById(`PictMDE-SegmentEditor-${i}`);o&&o.classList.remove("pict-mde-image-dragover")}},!0)},t._buildDataURICollapseExtension=function(){let e=t._codeMirrorModules;if(!(e&&e.Decoration&&e.ViewPlugin&&e.WidgetType))return null;let i=e.Decoration,n=e.ViewPlugin,o=e.WidgetType;class r extends o{constructor(t){super(),this.label=t}toDOM(){let t=document.createElement("span");return t.className="pict-mde-data-uri-collapsed",t.textContent=this.label,t.title="Data URI (click to expand in image preview below)",t}eq(t){return this.label===t.label}}function a(t){let e=[],n=t.state.doc;for(let o of t.visibleRanges){let t,a=o.from,s=o.to,l=n.sliceString(a,s),d=/!\[[^\]]*\]\(data:([^;]+);base64,/g;for(;null!==(t=d.exec(l));){let o=a+t.index+t[0].length,s=-1,l=o,d=n.length,c=Math.min(d,l+5242880),p=4096;for(let t=l;t<c;t+=p){let e=Math.min(t+p,c),i=n.sliceString(t,e).indexOf(")");if(i>=0){s=t+i;break}}if(s<0)continue;let h=s-o;if(h<200)continue;let u,m=Math.round(.75*h);u=m>=1048576?(m/1048576).toFixed(1)+"MB":m>=1024?Math.round(m/1024)+"KB":m+"B";t[1];let g=`…${u})`,f=i.replace({widget:new r(g)});e.push(f.range(o,s+1))}}return i.set(e,!0)}return n.fromClass(class{constructor(t){this.decorations=a(t)}update(t){(t.docChanged||t.viewportChanged)&&(this.decorations=a(t.view))}},{decorations:t=>t.decorations})}}},{}],87:[function(t,e,i){e.exports.attach=function(t){t._wireSegmentDragEvents=function(e,i){let n=e.querySelector(".pict-mde-drag-handle");n&&(n.addEventListener("dragstart",n=>{t._dragSourceIndex=i,n.dataTransfer.effectAllowed="move",n.dataTransfer.setData("text/plain",String(i));let o=t._getContainerElement();o&&o.classList.add("pict-mde-dragging"),setTimeout(()=>{e.style.opacity="0.4"},0)}),n.addEventListener("dragend",()=>{e.style.opacity="",t._dragSourceIndex=-1,t._clearAllDropIndicators();let i=t._getContainerElement();i&&i.classList.remove("pict-mde-dragging")}),e.addEventListener("dragover",i=>{i.preventDefault(),i.dataTransfer.dropEffect="move",t._clearAllDropIndicators();let n=e.getBoundingClientRect(),o=n.top+n.height/2;i.clientY<o?e.classList.add("pict-mde-drag-over-top"):e.classList.add("pict-mde-drag-over-bottom")}),e.addEventListener("dragleave",t=>{e.contains(t.relatedTarget)||(e.classList.remove("pict-mde-drag-over-top"),e.classList.remove("pict-mde-drag-over-bottom"))}),e.addEventListener("drop",n=>{n.preventDefault();let o=e.classList.contains("pict-mde-drag-over-bottom");t._clearAllDropIndicators();let r=t._dragSourceIndex;r<0||r===i||t._reorderSegment(r,i,o)}))},t._clearAllDropIndicators=function(){let e=t._getContainerElement();if(!e)return;let i=e.querySelectorAll(".pict-mde-segment");for(let t=0;t<i.length;t++)i[t].classList.remove("pict-mde-drag-over-top"),i[t].classList.remove("pict-mde-drag-over-bottom")},t._reorderSegment=function(e,i,n){let o=t._getLogicalIndex(e),r=t._getLogicalIndex(i);if(o<0||r<0)return void t.log.warn(`PICT-MarkdownEditor _reorderSegment: could not resolve logical indices (from=${o}, to=${r}).`);if(o===r)return;t._marshalAllEditorsToData();let a=t._getSegmentsFromData();if(!a||a.length<2)return;let s=n?r+1:r;if(o<s&&s--,s===o)return;let l=a.splice(o,1)[0];a.splice(s,0,l),t._setSegmentsToData(a),t._reorderHiddenPreviewState(o,s),t._reorderSegmentTabStates(o,s),t._buildEditorUI()},t._reorderHiddenPreviewState=function(e,i){if(e===i)return;let n=Object.keys(t._hiddenPreviewSegments).map(t=>parseInt(t,10));if(0===n.length)return;let o=Math.max(...n,e,i),r=[];for(let e=0;e<=o;e++)r.push(!!t._hiddenPreviewSegments[e]);let a=r.splice(e,1)[0];r.splice(i,0,a),t._hiddenPreviewSegments={};for(let e=0;e<r.length;e++)r[e]&&(t._hiddenPreviewSegments[e]=!0)},t._swapHiddenPreviewState=function(e,i){let n=!!t._hiddenPreviewSegments[e];!!t._hiddenPreviewSegments[i]?t._hiddenPreviewSegments[e]=!0:delete t._hiddenPreviewSegments[e],n?t._hiddenPreviewSegments[i]=!0:delete t._hiddenPreviewSegments[i]},t._reorderSegmentTabStates=function(e,i){if(e===i)return;let n=Object.keys(t._segmentTabStates).map(t=>parseInt(t,10));if(0===n.length)return;let o=Math.max(...n,e,i),r=[];for(let e=0;e<=o;e++)r.push(t._segmentTabStates[e]||"editor");let a=r.splice(e,1)[0];r.splice(i,0,a),t._segmentTabStates={};for(let e=0;e<r.length;e++)"editor"!==r[e]&&(t._segmentTabStates[e]=r[e])},t._swapSegmentTabStates=function(e,i){let n=t._segmentTabStates[e]||"editor",o=t._segmentTabStates[i]||"editor";"editor"!==o?t._segmentTabStates[e]=o:delete t._segmentTabStates[e],"editor"!==n?t._segmentTabStates[i]=n:delete t._segmentTabStates[i]},t._setActiveSegment=function(e){if(t._activeSegmentIndex>=0&&t._activeSegmentIndex!==e){let e=document.getElementById(`PictMDE-Segment-${t._activeSegmentIndex}`);e&&e.classList.remove("pict-mde-active")}t._activeSegmentIndex=e;let i=document.getElementById(`PictMDE-Segment-${e}`);i&&i.classList.add("pict-mde-active")},t._clearActiveSegment=function(e){t._activeSegmentIndex===e&&(t._activeSegmentIndex=-1);let i=document.getElementById(`PictMDE-Segment-${e}`);i&&i.classList.remove("pict-mde-active"),t._resetSidebarPosition(e)},t._updateSidebarPosition=function(e){let i=document.getElementById(`PictMDE-Segment-${e}`);if(!i)return;let n=i.querySelector(".pict-mde-quadrant-tr");if(!n)return;let o=t._segmentEditors[e];if(!o)return;let r=o.state.selection.main.head,a=o.coordsAtPos(r);if(!a)return void t._resetSidebarPosition(e);let s=i.getBoundingClientRect(),l=a.top-s.top,d=n.offsetHeight||0,c=i.offsetHeight||0,p=Math.max(0,c-d);l=Math.max(0,Math.min(l,p)),n.classList.add("pict-mde-sidebar-at-cursor"),n.style.setProperty("--pict-mde-sidebar-top",`${l}px`)},t._resetSidebarPosition=function(t){let e=document.getElementById(`PictMDE-Segment-${t}`);if(!e)return;let i=e.querySelector(".pict-mde-quadrant-tr");i&&(i.classList.remove("pict-mde-sidebar-at-cursor"),i.style.removeProperty("--pict-mde-sidebar-top"))}}},{}],88:[function(t,e,i){const n={bold:{wrap:"**"},italic:{wrap:"*"},code:{wrap:"`"},heading:{prefix:"# "},link:{before:"[",after:"](url)"}};e.exports.attach=function(t){t.applyFormatting=function(e,i){let o=t._segmentEditors[e];if(!o)return void t.log.warn(`PICT-MarkdownEditor applyFormatting: no editor for segment ${e}.`);let r=n[i];if(!r)return void t.log.warn(`PICT-MarkdownEditor applyFormatting: unknown format type "${i}".`);let a,s,l=o.state,d=l.selection.main,c=d.from,p=d.to,h=c!==p,u=h?l.sliceDoc(c,p):"";if(r.wrap){let t=r.wrap;if(h){let e=l.sliceDoc(Math.max(0,c-t.length),c),i=l.sliceDoc(p,Math.min(l.doc.length,p+t.length));if(e===t&&i===t)return a=[{from:c-t.length,to:c,insert:""},{from:p,to:p+t.length,insert:""}],s=c-t.length,void o.dispatch({changes:a,selection:{anchor:s,head:s+u.length}});a={from:c,to:p,insert:t+u+t},s=c+t.length,o.dispatch({changes:a,selection:{anchor:s,head:s+u.length}})}else{a={from:c,insert:t+t},s=c+t.length,o.dispatch({changes:a,selection:{anchor:s}})}}else if(r.prefix){let t=l.doc.lineAt(c);a=t.text.startsWith(r.prefix)?{from:t.from,to:t.from+r.prefix.length,insert:""}:{from:t.from,insert:r.prefix},o.dispatch({changes:a})}else if(r.before&&r.after)if(h){a={from:c,to:p,insert:r.before+u+r.after},s=c+r.before.length+u.length+2,o.dispatch({changes:a,selection:{anchor:s,head:s+3}})}else{a={from:c,insert:r.before+r.after},s=c+r.before.length,o.dispatch({changes:a,selection:{anchor:s}})}o.focus()}}},{}],89:[function(t,e,i){e.exports.attach=function(t){t.openImagePicker=function(e){let i=document.getElementById(`PictMDE-ImageInput-${e}`);i?(i.onchange=()=>{i.files&&i.files.length>0&&t._processImageFile(i.files[0],e),i.value=""},i.click()):t.log.warn(`PICT-MarkdownEditor openImagePicker: file input not found for segment ${e}.`)},t._processImageFile=function(e,i){if(!e||!e.type||!e.type.startsWith("image/"))return void t.log.warn(`PICT-MarkdownEditor _processImageFile: not an image file (type: ${e?e.type:"null"}).`);let n=e.name?e.name.replace(/\.[^.]+$/,""):"image";if(t.onImageUpload(e,i,(e,o)=>{e?t.log.error(`PICT-MarkdownEditor image upload error: ${e}`):o&&t._insertImageMarkdown(i,o,n)}))return;if("undefined"==typeof FileReader)return void t.log.error("PICT-MarkdownEditor _processImageFile: FileReader not available in this environment.");let o=new FileReader;o.onload=()=>{t._insertImageMarkdown(i,o.result,n)},o.onerror=()=>{t.log.error("PICT-MarkdownEditor _processImageFile: FileReader error.")},o.readAsDataURL(e)},t._insertImageMarkdown=function(e,i,n){let o=t._segmentEditors[e];if(!o)return void t.log.warn(`PICT-MarkdownEditor _insertImageMarkdown: no editor for segment ${e}.`);let r=``,a=o.state.selection.main.head;o.dispatch({changes:{from:a,insert:r},selection:{anchor:a+r.length}}),o.focus(),t._updateImagePreviews(e)},t._updateImagePreviews=function(e){let i=document.getElementById(`PictMDE-ImagePreview-${e}`);if(!i)return;let n=t._segmentEditors[e];if(!n)return i.innerHTML="",void i.classList.remove("pict-mde-has-images");let o,r=n.state.doc.toString(),a=/!\[([^\]]*)\]\(([^)]+)\)/g,s=[];for(;null!==(o=a.exec(r));)s.push({alt:o[1]||"image",url:o[2]});if(0===s.length)return i.innerHTML="",void i.classList.remove("pict-mde-has-images");let l="";for(let e=0;e<s.length;e++){let i=s[e].alt.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");l+=`<div class="pict-mde-image-preview-item"><img src="${t._resolveImageURL(s[e].url).replace(/&/g,"&").replace(/"/g,""")}" alt="${i}" /><span class="pict-mde-image-preview-label">${i}</span></div>`}i.innerHTML=l,i.classList.add("pict-mde-has-images")},t._wireImageDragEvents=function(e,i){e.addEventListener("dragover",i=>{t._dragSourceIndex>=0||!i.dataTransfer||!i.dataTransfer.types||i.dataTransfer.types.indexOf("Files")<0||(i.preventDefault(),i.dataTransfer.dropEffect="copy",e.classList.add("pict-mde-image-dragover"))}),e.addEventListener("dragleave",t=>{e.contains(t.relatedTarget)||e.classList.remove("pict-mde-image-dragover")}),e.addEventListener("drop",n=>{if(e.classList.remove("pict-mde-image-dragover"),t._dragSourceIndex>=0)return;if(!n.dataTransfer||!n.dataTransfer.files||n.dataTransfer.files.length<1)return;let o=n.dataTransfer.files[0];o.type&&o.type.startsWith("image/")&&(n.preventDefault(),n.stopPropagation(),t._processImageFile(o,i))})}}},{}],90:[function(t,e,i){const n=t("pict-section-content").PictContentProvider;e.exports.attach=function(t){t._getContentProvider=function(){return t._contentProvider||(t._contentProvider=new n(t.fable,{},"Pict-Content-Provider-MDE")),t._contentProvider},t._updateRichPreviews=function(e){if(!t.options.EnableRichPreview)return;let i=document.getElementById(`PictMDE-RichPreview-${e}`);if(!i)return;let n=t._segmentEditors[e];if(!n)return i.innerHTML="",void i.classList.remove("pict-mde-has-rich-preview");let o=n.state.doc.toString();if(!o||0===o.trim().length)return i.innerHTML="",void i.classList.remove("pict-mde-has-rich-preview");let r=t._getContentProvider(),a=null;t.pict&&t.pict.providers&&t.pict.providers.Vocabulary&&"function"==typeof t.pict.providers.Vocabulary.getResolver&&(a=t.pict.providers.Vocabulary.getResolver());let s=r.parseMarkdown(o,null,null,a);if(!s||0===s.trim().length)return i.innerHTML="",void i.classList.remove("pict-mde-has-rich-preview");let l=`PictMDE-RichPreviewBody-${e}`;if(i.innerHTML=`<div class="pict-content" id="${l}">${s}</div>`,i.classList.add("pict-mde-has-rich-preview"),t.pict&&t.pict.providers&&t.pict.providers.Vocabulary&&"function"==typeof t.pict.providers.Vocabulary.wirePopovers&&t.pict.providers.Vocabulary.wirePopovers("#"+l),t.options.ImageBaseURL){let e=i.querySelectorAll("img");for(let i=0;i<e.length;i++){let n=e[i].getAttribute("src");if(n){let o=t._resolveImageURL(n);o!==n&&e[i].setAttribute("src",o)}}}let d=(t._richPreviewGenerations[e]||0)+1;t._richPreviewGenerations[e]=d,t._postRenderMermaid(l,e,d),t._postRenderKaTeX(l)},t._postRenderMermaid=function(e,i,n){if("undefined"==typeof mermaid)return;let o=document.getElementById(e);if(!o)return;let r=o.querySelectorAll("pre.mermaid");if(!(r.length<1))try{let e=mermaid.run({nodes:r});e&&"function"==typeof e.catch&&e.catch(e=>{(-1===i?t._renderedViewGeneration:t._richPreviewGenerations[i])===n&&t.log.warn(`PICT-MarkdownEditor mermaid render error: ${e.message||e}`)})}catch(e){t.log.warn(`PICT-MarkdownEditor mermaid render error: ${e.message||e}`)}},t._postRenderKaTeX=function(e){if("undefined"==typeof katex)return;let i=document.getElementById(e);if(!i)return;let n=i.querySelectorAll(".pict-content-katex-inline");for(let e=0;e<n.length;e++)try{katex.render(n[e].textContent,n[e],{throwOnError:!1,displayMode:!1})}catch(e){t.log.warn(`PICT-MarkdownEditor KaTeX inline error: ${e.message||e}`)}let o=i.querySelectorAll(".pict-content-katex-display");for(let e=0;e<o.length;e++)try{katex.render(o[e].textContent,o[e],{throwOnError:!1,displayMode:!0})}catch(e){t.log.warn(`PICT-MarkdownEditor KaTeX display error: ${e.message||e}`)}},t._escapeHTMLForPreview=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},t.toggleRenderedView=function(e){t._renderedViewActive="boolean"==typeof e?e:!t._renderedViewActive,t._renderedViewActive?t._renderRenderedView():t._restoreEditingView()},t._renderRenderedView=function(){let e=t._getContainerElement();if(!e)return;t._marshalAllEditorsToData();let i=t._getSegmentsFromData(),n="";if(i&&i.length>0){let t=[];for(let e=0;e<i.length;e++)t.push(i[e].Content||"");n=t.join("\n\n")}for(let e in t._segmentEditors)t._segmentEditors[e]&&t._segmentEditors[e].destroy();t._segmentEditors={};let o=t._getContentProvider().parseMarkdown(n),r="PictMDE-RenderedView";if(e.innerHTML=`<div class="pict-mde-rendered-view" id="${r}"><div class="pict-content">${o||""}</div></div>`,e.classList.add("pict-mde-rendered-mode"),t.options.ImageBaseURL){let i=e.querySelectorAll(".pict-mde-rendered-view img");for(let e=0;e<i.length;e++){let n=i[e].getAttribute("src");if(n){let o=t._resolveImageURL(n);o!==n&&i[e].setAttribute("src",o)}}}t._renderedViewGeneration++;let a=t._renderedViewGeneration,s=e.querySelector(`#${r} .pict-content`);if(s){let e="PictMDE-RenderedViewContent";s.id=e,t._postRenderMermaid(e,-1,a),t._postRenderKaTeX(e)}},t._restoreEditingView=function(){let e=t._getContainerElement();e&&(e.classList.remove("pict-mde-rendered-mode"),t._buildEditorUI())}}},{"pict-section-content":62}],91:[function(t,e,i){e.exports={DefaultRenderable:"MarkdownEditor-Wrap",DefaultDestinationAddress:"#MarkdownEditor-Container-Div",Templates:[{Hash:"MarkdownEditor-Container",Template:'<div class="pict-mde" id="PictMDE-Container"></div>'},{Hash:"MarkdownEditor-Segment",Template:'<div class="pict-mde-segment" id="PictMDE-Segment-{~D:Record.SegmentIndex~}" data-segment-index="{~D:Record.SegmentIndex~}">\n\t<div class="pict-mde-left-controls">\n\t\t<div class="pict-mde-quadrant-tl"></div>\n\t\t<div class="pict-mde-quadrant-bl"></div>\n\t</div>\n\t<div class="pict-mde-drag-handle" draggable="true" title="Drag to reorder"></div>\n\t<div class="pict-mde-segment-body">\n\t\t<div class="pict-mde-tab-bar" id="PictMDE-TabBar-{~D:Record.SegmentIndex~}">\n\t\t\t<button type="button" class="pict-mde-tab pict-mde-tab-active" data-tab="editor" onclick="{~D:Record.ViewIdentifier~}.switchSegmentTab({~D:Record.SegmentIndex~}, \'editor\')">Edit</button>\n\t\t\t<button type="button" class="pict-mde-tab" data-tab="preview" onclick="{~D:Record.ViewIdentifier~}.switchSegmentTab({~D:Record.SegmentIndex~}, \'preview\')">Preview</button>\n\t\t</div>\n\t\t<div class="pict-mde-segment-editor" id="PictMDE-SegmentEditor-{~D:Record.SegmentIndex~}"></div>\n\t\t<div class="pict-mde-preview-pane" id="PictMDE-PreviewPane-{~D:Record.SegmentIndex~}">\n\t\t\t<div class="pict-mde-image-preview" id="PictMDE-ImagePreview-{~D:Record.SegmentIndex~}"></div>\n\t\t\t<div class="pict-mde-rich-preview" id="PictMDE-RichPreview-{~D:Record.SegmentIndex~}"></div>\n\t\t</div>\n\t</div>\n\t<div class="pict-mde-sidebar" id="PictMDE-Sidebar-{~D:Record.SegmentIndex~}">\n\t\t<div class="pict-mde-quadrant-tr"></div>\n\t\t<div class="pict-mde-quadrant-br"></div>\n\t\t<input type="file" accept="image/*" class="pict-mde-image-input" id="PictMDE-ImageInput-{~D:Record.SegmentIndex~}" style="display:none" />\n\t</div>\n</div>'},{Hash:"MarkdownEditor-AddSegment",Template:'<div class="pict-mde-add-segment">\n\t<button type="button" class="pict-mde-btn-add" onclick="{~D:Record.ViewIdentifier~}.addSegment()">+ Add Segment</button>\n</div>'}],Renderables:[{RenderableHash:"MarkdownEditor-Wrap",TemplateHash:"MarkdownEditor-Container",DestinationAddress:"#MarkdownEditor-Container-Div"}],TargetElementAddress:"#MarkdownEditor-Container-Div",ContentDataAddress:!1,ReadOnly:!1,EnableRichPreview:!0,DefaultPreviewMode:"off",ImageBaseURL:"",ButtonsTL:[{HTML:"×",Action:"removeSegment",Class:"pict-mde-btn-remove",Title:"Remove Segment"}],ButtonsBL:[{HTML:"↑",Action:"moveSegmentUp",Class:"pict-mde-btn-move",Title:"Move Up"},{HTML:"↓",Action:"moveSegmentDown",Class:"pict-mde-btn-move",Title:"Move Down"},{HTML:"⊞",Action:"toggleControls",Class:"pict-mde-btn-linenums",Title:"Toggle Controls"},{HTML:"◎",Action:"cyclePreviewMode",Class:"pict-mde-btn-preview",Title:"Cycle Preview Mode"}],ButtonsTR:[{HTML:"<b>B</b>",Action:"applyFormatting:bold",Class:"",Title:"Bold (Ctrl+B)"},{HTML:"<i>I</i>",Action:"applyFormatting:italic",Class:"",Title:"Italic (Ctrl+I)"},{HTML:"<code><></code>",Action:"applyFormatting:code",Class:"",Title:"Inline Code (Ctrl+E)"},{HTML:"#",Action:"applyFormatting:heading",Class:"",Title:"Heading"},{HTML:"[ ]",Action:"applyFormatting:link",Class:"",Title:"Link"},{HTML:"▣",Action:"openImagePicker",Class:"pict-mde-sidebar-btn-image",Title:"Insert Image"}],ButtonsBR:[],CSS:"\n/* ---- Container ---- */\n.pict-mde\n{\n\tfont-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;\n\tfont-size: 14px;\n}\n\n/* ---- Segment row: left-controls | drag-handle | editor body | sidebar ---- */\n.pict-mde-segment\n{\n\tposition: relative;\n\tdisplay: flex;\n\tflex-direction: row;\n\talign-items: stretch;\n\tmargin-bottom: 6px;\n\tmin-height: 48px;\n\ttransition: background-color 0.15s ease;\n}\n\n/* ---- Left controls column ---- */\n.pict-mde-left-controls\n{\n\tflex: 0 0 22px;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 2px 0;\n}\n\n/* ---- Left-side quadrants ---- */\n.pict-mde-quadrant-tl\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tposition: sticky;\n\ttop: 2px;\n\tz-index: 2;\n}\n.pict-mde-quadrant-bl\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 1px;\n\tposition: sticky;\n\tbottom: 2px;\n\tz-index: 2;\n}\n\n/* ---- Left-side buttons (shared base) ---- */\n.pict-mde-left-btn\n{\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 20px;\n\theight: 20px;\n\tborder: none;\n\tbackground: transparent;\n\tcursor: pointer;\n\tfont-size: 12px;\n\tpadding: 0;\n\tcolor: #888;\n\tline-height: 1;\n\tfont-family: inherit;\n\topacity: 0;\n\ttransition: opacity 0.15s ease;\n}\n.pict-mde-segment:hover .pict-mde-left-btn,\n.pict-mde-segment.pict-mde-active .pict-mde-left-btn\n{\n\topacity: 1;\n}\n.pict-mde-left-btn:hover\n{\n\tcolor: #222;\n}\n.pict-mde-btn-remove:hover\n{\n\tcolor: #CC3333;\n}\n.pict-mde-btn-linenums\n{\n\tfont-size: 11px;\n\tfont-weight: 600;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', monospace;\n}\n/* Highlight when controls are active */\n.pict-mde.pict-mde-controls-on .pict-mde-btn-linenums\n{\n\tcolor: #4A90D9;\n}\n.pict-mde-btn-preview\n{\n\tfont-size: 11px;\n}\n/* Preview button: highlight when any preview mode is active */\n.pict-mde.pict-mde-preview-bottom .pict-mde-btn-preview,\n.pict-mde.pict-mde-preview-side .pict-mde-btn-preview,\n.pict-mde.pict-mde-preview-tabbed .pict-mde-btn-preview\n{\n\tcolor: #4A90D9;\n}\n/* Dim preview button when mode is off */\n.pict-mde.pict-mde-preview-off .pict-mde-btn-preview\n{\n\tcolor: #CCC;\n}\n\n/* ---- Drag handle (simple grey bar) ---- */\n.pict-mde-drag-handle\n{\n\tflex: 0 0 8px;\n\tcursor: grab;\n\tbackground: #EDEDED;\n\ttransition: background-color 0.15s ease;\n\tuser-select: none;\n}\n.pict-mde-drag-handle:active\n{\n\tcursor: grabbing;\n}\n.pict-mde-drag-handle:hover\n{\n\tbackground: #C8C8C8;\n}\n\n/* ---- Editor body (middle column) ---- */\n.pict-mde-segment-body\n{\n\tflex: 1 1 0%;\n\tmin-width: 0;\n\toverflow: hidden;\n\tbackground: #FFFFFF;\n\ttransition: background-color 0.15s ease;\n}\n.pict-mde-segment-editor\n{\n\tmin-height: 48px;\n}\n\n/* ---- Image preview area below the editor ---- */\n.pict-mde-image-preview\n{\n\tdisplay: none;\n}\n.pict-mde-image-preview.pict-mde-has-images\n{\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n\tpadding: 8px 12px;\n\tborder-top: 1px solid #EDEDED;\n}\n.pict-mde-image-preview img\n{\n\tmax-width: 200px;\n\tmax-height: 150px;\n\tborder-radius: 3px;\n\tborder: 1px solid #E0E0E0;\n\tobject-fit: contain;\n\tbackground: #F8F8F8;\n}\n.pict-mde-image-preview-item\n{\n\tposition: relative;\n\tdisplay: inline-block;\n}\n.pict-mde-image-preview-label\n{\n\tdisplay: block;\n\tfont-size: 10px;\n\tcolor: #999;\n\tmargin-top: 2px;\n\tmax-width: 200px;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n/* ---- Rich content preview area (rendered via pict-section-content) ---- */\n.pict-mde-rich-preview\n{\n\tdisplay: none;\n}\n.pict-mde-rich-preview.pict-mde-has-rich-preview\n{\n\tdisplay: block;\n\tborder-top: 1px solid #EDEDED;\n\tbackground: #FCFCFC;\n\toverflow: hidden;\n}\n/* Constrain images in the rich preview even if pict-section-content CSS loads late */\n.pict-mde-rich-preview img\n{\n\tmax-width: 100%;\n\theight: auto;\n}\n/* ---- Preview layout modes ---- */\n\n/* Tab bar: hidden by default, shown only in tabbed mode */\n.pict-mde-tab-bar\n{\n\tdisplay: none;\n}\n.pict-mde.pict-mde-preview-tabbed .pict-mde-tab-bar\n{\n\tdisplay: flex;\n\tgap: 0;\n\tborder-bottom: 1px solid #EDEDED;\n\tbackground: #F8F8F8;\n}\n.pict-mde-tab\n{\n\tpadding: 4px 12px;\n\tborder: none;\n\tbackground: transparent;\n\tcursor: pointer;\n\tfont-size: 12px;\n\tcolor: #888;\n\tborder-bottom: 2px solid transparent;\n\tfont-family: inherit;\n}\n.pict-mde-tab:hover\n{\n\tcolor: #222;\n}\n.pict-mde-tab.pict-mde-tab-active\n{\n\tcolor: #4A90D9;\n\tborder-bottom-color: #4A90D9;\n}\n\n/* Off mode: hide all preview panes and tab bars */\n.pict-mde.pict-mde-preview-off .pict-mde-preview-pane\n{\n\tdisplay: none;\n}\n.pict-mde.pict-mde-preview-off .pict-mde-tab-bar\n{\n\tdisplay: none;\n}\n/* Legacy class alias for backward compatibility */\n.pict-mde.pict-mde-previews-hidden .pict-mde-preview-pane\n{\n\tdisplay: none;\n}\n\n/* Bottom mode: vertical stacking (default flex-column behavior) */\n.pict-mde.pict-mde-preview-bottom .pict-mde-segment-body\n{\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n/* Side-by-side mode: editor and preview side by side */\n.pict-mde.pict-mde-preview-side .pict-mde-segment-body\n{\n\tdisplay: flex;\n\tflex-direction: row;\n}\n.pict-mde.pict-mde-preview-side .pict-mde-segment-editor\n{\n\tflex: 1 1 50%;\n\tmin-width: 0;\n\toverflow: hidden;\n}\n.pict-mde.pict-mde-preview-side .pict-mde-preview-pane\n{\n\tflex: 1 1 50%;\n\tmin-width: 0;\n\toverflow: auto;\n\tborder-left: 1px solid #EDEDED;\n}\n/* Side-by-side: remove top borders since preview is beside, not below */\n.pict-mde.pict-mde-preview-side .pict-mde-rich-preview.pict-mde-has-rich-preview\n{\n\tborder-top: none;\n}\n.pict-mde.pict-mde-preview-side .pict-mde-image-preview.pict-mde-has-images\n{\n\tborder-top: none;\n}\n\n/* Tabbed mode: default hides preview, shows editor */\n.pict-mde.pict-mde-preview-tabbed .pict-mde-segment-body\n{\n\tdisplay: flex;\n\tflex-direction: column;\n}\n.pict-mde.pict-mde-preview-tabbed .pict-mde-preview-pane\n{\n\tdisplay: none;\n}\n/* Tabbed mode: when showing preview, hide editor and show preview */\n.pict-mde.pict-mde-preview-tabbed .pict-mde-segment.pict-mde-tab-showing-preview .pict-mde-segment-editor\n{\n\tdisplay: none;\n}\n.pict-mde.pict-mde-preview-tabbed .pict-mde-segment.pict-mde-tab-showing-preview .pict-mde-preview-pane\n{\n\tdisplay: block;\n}\n\n/* Per-segment preview hide: only applies in bottom and side modes */\n.pict-mde.pict-mde-preview-bottom .pict-mde-segment.pict-mde-preview-hidden .pict-mde-preview-pane,\n.pict-mde.pict-mde-preview-side .pict-mde-segment.pict-mde-preview-hidden .pict-mde-preview-pane\n{\n\tdisplay: none;\n}\n/* Constrain the pict-content inside the preview to fit the segment */\n.pict-mde-rich-preview .pict-content\n{\n\tpadding: 12px;\n\tmax-width: none;\n\tmargin: 0;\n\tfont-size: 13px;\n}\n/* Reduce heading sizes in the preview to be proportional */\n.pict-mde-rich-preview .pict-content h1\n{\n\tfont-size: 1.4em;\n\tmargin-top: 0;\n}\n.pict-mde-rich-preview .pict-content h2\n{\n\tfont-size: 1.2em;\n\tmargin-top: 0.75em;\n}\n.pict-mde-rich-preview .pict-content h3\n{\n\tfont-size: 1.1em;\n\tmargin-top: 0.6em;\n}\n\n/* ---- Rendered view (full document preview mode) ---- */\n.pict-mde-rendered-view\n{\n\tpadding: 16px 20px;\n\tbackground: #FFFFFF;\n\tmin-height: 120px;\n}\n.pict-mde-rendered-view .pict-content\n{\n\tmax-width: none;\n\tmargin: 0;\n}\n/* Hide the add-segment button in rendered mode */\n.pict-mde.pict-mde-rendered-mode .pict-mde-add-segment\n{\n\tdisplay: none;\n}\n\n/* Focused / active editor gets subtle warm background */\n.pict-mde-segment.pict-mde-active .pict-mde-segment-body\n{\n\tbackground: #FAFAF5;\n}\n.pict-mde-segment.pict-mde-active .pict-mde-drag-handle\n{\n\tbackground: #9CB4C8;\n}\n\n/* ---- Right sidebar column ---- */\n.pict-mde-sidebar\n{\n\tflex: 0 0 30px;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: flex-start;\n\tjustify-content: space-between;\n\tposition: relative;\n}\n\n/* ---- Right-side quadrants ---- */\n.pict-mde-quadrant-tr\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 1px;\n\tpadding: 4px 0;\n\twidth: 100%;\n\topacity: 0;\n\ttransition: opacity 0.15s ease, top 0.1s ease;\n\tposition: sticky;\n\ttop: 0;\n}\n.pict-mde-quadrant-br\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 1px;\n\tpadding: 4px 0;\n\twidth: 100%;\n\topacity: 0;\n\ttransition: opacity 0.15s ease;\n\tposition: sticky;\n\tbottom: 0;\n}\n\n/* Active segment always shows its right-side quadrants */\n.pict-mde-segment.pict-mde-active .pict-mde-quadrant-tr,\n.pict-mde-segment.pict-mde-active .pict-mde-quadrant-br\n{\n\topacity: 1;\n}\n/* When no segment is active, hovering shows both left + right controls */\n.pict-mde:not(:has(.pict-mde-active)) .pict-mde-segment:hover .pict-mde-quadrant-tr,\n.pict-mde:not(:has(.pict-mde-active)) .pict-mde-segment:hover .pict-mde-quadrant-br\n{\n\topacity: 1;\n}\n\n/* ---- Controls-hidden mode: right quadrants show faintly on hover ---- */\n.pict-mde.pict-mde-controls-hidden .pict-mde-quadrant-tr,\n.pict-mde.pict-mde-controls-hidden .pict-mde-quadrant-br\n{\n\topacity: 0;\n}\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment:hover .pict-mde-quadrant-tr,\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment:hover .pict-mde-quadrant-br\n{\n\topacity: 0.3;\n}\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment.pict-mde-active .pict-mde-quadrant-tr,\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment.pict-mde-active .pict-mde-quadrant-br\n{\n\topacity: 0.3;\n}\n\n/* When JS sets a cursor-relative offset, switch TR from sticky to absolute positioning */\n.pict-mde-quadrant-tr.pict-mde-sidebar-at-cursor\n{\n\tposition: absolute;\n\ttop: var(--pict-mde-sidebar-top, 0px);\n}\n\n/* ---- Right-side buttons (shared base) ---- */\n.pict-mde-sidebar-btn\n{\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 24px;\n\theight: 22px;\n\tborder: none;\n\tbackground: transparent;\n\tcursor: pointer;\n\tfont-size: 12px;\n\tpadding: 0;\n\tborder-radius: 3px;\n\tcolor: #666;\n\tline-height: 1;\n\tfont-family: inherit;\n}\n.pict-mde-sidebar-btn:hover\n{\n\tcolor: #222;\n}\n.pict-mde-sidebar-btn b\n{\n\tfont-size: 13px;\n\tfont-weight: 700;\n}\n.pict-mde-sidebar-btn i\n{\n\tfont-size: 13px;\n\tfont-style: italic;\n}\n.pict-mde-sidebar-btn code\n{\n\tfont-size: 10px;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', monospace;\n}\n\n/* ---- Add segment button ---- */\n.pict-mde-add-segment\n{\n\tmargin-top: 6px;\n\tpadding-left: 30px;\n}\n.pict-mde-btn-add\n{\n\tdisplay: block;\n\twidth: 100%;\n\tpadding: 7px;\n\tborder: 2px dashed #D0D0D0;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcolor: #999;\n\tfont-size: 12px;\n\tfont-weight: 600;\n\tcursor: pointer;\n\ttransition: all 0.15s ease;\n}\n.pict-mde-btn-add:hover\n{\n\tborder-color: #4A90D9;\n\tcolor: #4A90D9;\n\tbackground: rgba(74, 144, 217, 0.04);\n}\n\n/* ---- Image drag-over indicator ---- */\n.pict-mde-segment-editor.pict-mde-image-dragover\n{\n\toutline: 2px dashed #4A90D9;\n\toutline-offset: -2px;\n}\n\n/* ---- Drag-in-progress: prevent CodeMirror from intercepting drop events ---- */\n.pict-mde.pict-mde-dragging .pict-mde-segment-editor\n{\n\tpointer-events: none;\n}\n\n/* ---- Drop target indicators for drag reorder ---- */\n.pict-mde-segment.pict-mde-drag-over-top\n{\n\tbox-shadow: 0 -2px 0 0 #4A90D9;\n}\n.pict-mde-segment.pict-mde-drag-over-bottom\n{\n\tbox-shadow: 0 2px 0 0 #4A90D9;\n}\n\n/* ---- CodeMirror overrides inside segments ---- */\n.pict-mde-segment-editor .cm-editor\n{\n\tborder: none;\n}\n.pict-mde-segment-editor .cm-editor .cm-scroller\n{\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;\n\tfont-size: 14px;\n\tline-height: 1.6;\n}\n.pict-mde-segment-editor .cm-editor.cm-focused\n{\n\toutline: none;\n}\n.pict-mde-segment-editor .cm-editor .cm-content\n{\n\tpadding: 8px 12px;\n\tmin-height: 36px;\n}\n.pict-mde-segment-editor .cm-editor .cm-gutters\n{\n\tbackground: #F8F8F8;\n\tborder-right: 1px solid #E8E8E8;\n\tcolor: #BBB;\n}\n\n/* ---- Collapsed data URI widget ---- */\n.pict-mde-data-uri-collapsed\n{\n\tdisplay: inline;\n\tbackground: #F0F0F0;\n\tcolor: #888;\n\tfont-size: 11px;\n\tpadding: 1px 4px;\n\tborder-radius: 3px;\n\tborder: 1px solid #E0E0E0;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', monospace;\n\tcursor: default;\n\twhite-space: nowrap;\n}\n\n/* ---- Line number / controls toggle: gutters hidden by default ---- */\n.pict-mde .cm-editor .cm-gutters\n{\n\tdisplay: none;\n}\n.pict-mde.pict-mde-controls-on .cm-editor .cm-gutters\n{\n\tdisplay: flex;\n}\n\n/* ============================================\n RESPONSIVE: Tablet / Phone (max-width: 768px)\n ============================================ */\n@media (max-width: 768px)\n{\n\t/* Prevent any horizontal overflow in the editor */\n\t.pict-mde\n\t{\n\t\toverflow-x: hidden;\n\t\tmax-width: 100%;\n\t}\n\n\t/* Reduce the left controls column width */\n\t.pict-mde-left-controls\n\t{\n\t\tflex: 0 0 16px;\n\t}\n\t.pict-mde-left-btn\n\t{\n\t\twidth: 16px;\n\t\theight: 18px;\n\t\tfont-size: 10px;\n\t}\n\n\t/* Make left-side buttons always visible on touch (no hover) */\n\t.pict-mde-left-btn\n\t{\n\t\topacity: 0.6;\n\t}\n\n\t/* Narrow the drag handle */\n\t.pict-mde-drag-handle\n\t{\n\t\tflex: 0 0 5px;\n\t}\n\n\t/* Shrink the right sidebar column */\n\t.pict-mde-sidebar\n\t{\n\t\tflex: 0 0 24px;\n\t}\n\t.pict-mde-sidebar-btn\n\t{\n\t\twidth: 20px;\n\t\theight: 20px;\n\t\tfont-size: 11px;\n\t}\n\n\t/* Make right sidebar buttons always visible (touch devices) */\n\t.pict-mde-quadrant-tr,\n\t.pict-mde-quadrant-br\n\t{\n\t\topacity: 0.7;\n\t}\n\t.pict-mde-segment.pict-mde-active .pict-mde-quadrant-tr,\n\t.pict-mde-segment.pict-mde-active .pict-mde-quadrant-br\n\t{\n\t\topacity: 1;\n\t}\n\n\t/* Reduce CodeMirror content padding */\n\t.pict-mde-segment-editor .cm-editor .cm-content\n\t{\n\t\tpadding: 6px 6px;\n\t}\n\n\t/* Reduce font size slightly for more content on screen */\n\t.pict-mde-segment-editor .cm-editor .cm-scroller\n\t{\n\t\tfont-size: 13px;\n\t}\n\n\t/* Add segment button: reduce left margin */\n\t.pict-mde-add-segment\n\t{\n\t\tpadding-left: 21px;\n\t}\n\n\t/* Side-by-side: fall back to vertical stacking on narrow screens */\n\t.pict-mde.pict-mde-preview-side .pict-mde-segment-body\n\t{\n\t\tflex-direction: column;\n\t}\n\t.pict-mde.pict-mde-preview-side .pict-mde-preview-pane\n\t{\n\t\tborder-left: none;\n\t\tborder-top: 1px solid #EDEDED;\n\t}\n\n\t/* Tab bar: smaller on tablet */\n\t.pict-mde-tab\n\t{\n\t\tpadding: 3px 8px;\n\t\tfont-size: 11px;\n\t}\n\n\t/* Rich preview: less padding */\n\t.pict-mde-rich-preview .pict-content\n\t{\n\t\tpadding: 8px;\n\t\tfont-size: 12px;\n\t}\n\n\t/* Image previews: smaller max dimensions */\n\t.pict-mde-image-preview img\n\t{\n\t\tmax-width: 120px;\n\t\tmax-height: 100px;\n\t}\n\n\t/* Rendered view: less padding */\n\t.pict-mde-rendered-view\n\t{\n\t\tpadding: 10px 8px;\n\t}\n}\n\n/* ============================================\n RESPONSIVE: Small phone (max-width: 480px)\n ============================================ */\n@media (max-width: 480px)\n{\n\t/* Wrap segment so left controls flow to the top as a horizontal bar */\n\t.pict-mde-segment\n\t{\n\t\tflex-wrap: wrap;\n\t}\n\n\t/* Left controls become a horizontal toolbar at the top of the segment */\n\t.pict-mde-left-controls\n\t{\n\t\tflex: 0 0 100%;\n\t\tflex-direction: row;\n\t\tjustify-content: flex-start;\n\t\tgap: 2px;\n\t\tpadding: 3px 4px;\n\t\torder: -1;\n\t\tbackground: #F5F5F5;\n\t\tborder-bottom: 1px solid #EDEDED;\n\t}\n\t.pict-mde-left-btn\n\t{\n\t\twidth: 24px;\n\t\theight: 24px;\n\t\tfont-size: 12px;\n\t\topacity: 0.7;\n\t}\n\n\t/* Left quadrants flow horizontally */\n\t.pict-mde-quadrant-tl,\n\t.pict-mde-quadrant-bl\n\t{\n\t\tflex-direction: row;\n\t\tgap: 2px;\n\t\tposition: static;\n\t}\n\n\t/* Segment body: explicit basis so it fills the wrapped row */\n\t.pict-mde-segment-body\n\t{\n\t\tflex: 1 1 calc(100% - 20px);\n\t}\n\n\t/* Hide drag handle on very small screens */\n\t.pict-mde-drag-handle\n\t{\n\t\tdisplay: none;\n\t}\n\n\t/* Right sidebar: further shrink */\n\t.pict-mde-sidebar\n\t{\n\t\tflex: 0 0 20px;\n\t}\n\t.pict-mde-sidebar-btn\n\t{\n\t\twidth: 18px;\n\t\theight: 18px;\n\t\tfont-size: 10px;\n\t}\n\n\t/* Add segment: no left offset since controls are at top */\n\t.pict-mde-add-segment\n\t{\n\t\tpadding-left: 0;\n\t}\n\n\t/* Even tighter CodeMirror padding */\n\t.pict-mde-segment-editor .cm-editor .cm-content\n\t{\n\t\tpadding: 4px 4px;\n\t}\n}\n"}},{}],92:[function(t,e,i){const n=t("pict-view"),o=t("pict-section-content"),r=t("./Pict-Section-MarkdownEditor-DefaultConfiguration.js"),a=t("./Pict-MDE-Formatting.js"),s=t("./Pict-MDE-ImageHandling.js"),l=t("./Pict-MDE-DragAndReorder.js"),d=t("./Pict-MDE-RichPreview.js"),c=t("./Pict-MDE-CodeMirror.js");e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},r,e),i),this.initialRenderComplete=!1,this._codeMirrorModules=null,this._segmentEditors={},this._segmentCounter=0,this._viewCallIdentifier=!1,this._activeSegmentIndex=-1,this._dragSourceIndex=-1,this._controlsVisible=!0,this._previewMode=this.options.DefaultPreviewMode||"off",this._lastPreviewLayout="bottom",this._segmentTabStates={},this._hiddenPreviewSegments={},this._imagePreviewTimers={},this._richPreviewTimers={},this._richPreviewGenerations={},this._contentProvider=null,this._renderedViewActive=!1,this._renderedViewGeneration=0,a.attach(this),s.attach(this),l.attach(this),d.attach(this),c.attach(this)}onBeforeInitialize(){return super.onBeforeInitialize(),this.targetElement=!1,super.onBeforeInitialize()}connectCodeMirrorModules(t){if(!t||"object"!=typeof t||"function"!=typeof t.EditorView||"function"!=typeof t.EditorState)return"undefined"!=typeof window&&window.CodeMirrorModules&&"function"==typeof window.CodeMirrorModules.EditorView?(this.log.trace("PICT-MarkdownEditor Found CodeMirror modules on window.CodeMirrorModules."),void(this._codeMirrorModules=window.CodeMirrorModules)):(this.log.error("PICT-MarkdownEditor No CodeMirror modules found. Provide them via connectCodeMirrorModules() or set window.CodeMirrorModules."),!1);this._codeMirrorModules=t}onAfterRender(t){return this.initialRenderComplete||(this.onAfterInitialRender(),this.initialRenderComplete=!0),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}onAfterInitialRender(){if(this._codeMirrorModules||this.connectCodeMirrorModules(),!this._codeMirrorModules)return this.log.error("PICT-MarkdownEditor Cannot initialize; no CodeMirror modules available."),!1;if(this.options.EnableRichPreview){let t=o.default_configuration;t&&t.CSS&&this.pict.CSSMap.addCSS("Pict-Content-View",t.CSS)}let t=this.services.ContentAssignment.getElement(this.options.TargetElementAddress);if(!t||t.length<1)return this.log.error(`PICT-MarkdownEditor Could not find target element [${this.options.TargetElementAddress}]!`),this.targetElement=!1,!1;this.targetElement=t[0],this._viewCallIdentifier=this._resolveViewCallIdentifier(),this._buildEditorUI()}_resolveViewCallIdentifier(){let t=this.pict.views;for(let e in t)if(t[e]===this)return`_Pict.views.${e}`;return`_Pict.servicesMap.PictView['${this.Hash}']`}_getContainerElement(){if(this.targetElement){let t=this.targetElement.querySelector(".pict-mde");if(t)return t}return this.targetElement||null}_resolveImageURL(t){if(!t||!this.options.ImageBaseURL)return t;if(t.startsWith("/")||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:"))return t;let e=this.options.ImageBaseURL;return e&&!e.endsWith("/")&&(e+="/"),e+t}_buildEditorUI(){let t=this._getContainerElement();t&&!t.classList.contains("pict-mde")&&t.classList.add("pict-mde");for(let t in this._segmentEditors)this._segmentEditors[t]&&this._segmentEditors[t].destroy();t.innerHTML="",t.classList.remove("pict-mde-preview-off","pict-mde-preview-bottom","pict-mde-preview-side","pict-mde-preview-tabbed","pict-mde-previews-hidden"),t.classList.add("pict-mde-preview-"+this._previewMode),this._controlsVisible?t.classList.add("pict-mde-controls-on"):t.classList.add("pict-mde-controls-hidden");let e=this._getSegmentsFromData();e&&0!==e.length||(e=[{Content:""}],this._setSegmentsToData(e)),this._segmentCounter=0,this._segmentEditors={};for(let i=0;i<e.length;i++)this._renderSegment(t,i,e[i].Content||"");this._renderAddButton(t)}_renderSegment(t,e,i){let n=this._segmentCounter++,o={SegmentIndex:n,SegmentDisplayIndex:e+1,ViewIdentifier:this._viewCallIdentifier},r=this.pict.parseTemplateByHash("MarkdownEditor-Segment",o),a=document.createElement("div");a.innerHTML=r;let s=a.firstElementChild;if(t.appendChild(s),this._buildQuadrantButtons(s,n),this._hiddenPreviewSegments[e]&&s.classList.add("pict-mde-preview-hidden"),"tabbed"===this._previewMode&&"preview"===this._segmentTabStates[e]){s.classList.add("pict-mde-tab-showing-preview");let t=s.querySelector(".pict-mde-tab-bar");if(t){let e=t.querySelector('[data-tab="editor"]'),i=t.querySelector('[data-tab="preview"]');e&&e.classList.remove("pict-mde-tab-active"),i&&i.classList.add("pict-mde-tab-active")}}this._wireSegmentDragEvents(s,n);let l=document.getElementById(`PictMDE-SegmentEditor-${n}`);l&&(this._createEditorInContainer(l,n,i),this._wireImageDragEvents(l,n),i&&(this._updateImagePreviews(n),this._updateRichPreviews(n)))}_buildQuadrantButtons(t,e){let i=[{key:"ButtonsTL",selector:".pict-mde-quadrant-tl",baseClass:"pict-mde-left-btn"},{key:"ButtonsBL",selector:".pict-mde-quadrant-bl",baseClass:"pict-mde-left-btn"},{key:"ButtonsTR",selector:".pict-mde-quadrant-tr",baseClass:"pict-mde-sidebar-btn"},{key:"ButtonsBR",selector:".pict-mde-quadrant-br",baseClass:"pict-mde-sidebar-btn"}],n=this;for(let o=0;o<i.length;o++){let r=i[o],a=t.querySelector(r.selector);if(!a)continue;let s=this.options[r.key];if(Array.isArray(s))for(let t=0;t<s.length;t++){let i=s[t],o=document.createElement("button");o.type="button",o.className=r.baseClass,i.Class&&(o.className+=" "+i.Class),o.innerHTML=i.HTML||"",o.title=i.Title||"";let l=i.Action||"",d=l,c=null,p=l.indexOf(":");p>=0&&(d=l.substring(0,p),c=l.substring(p+1)),function(t,e,i){o.addEventListener("click",()=>{"function"==typeof n[t]?null!==e?n[t](i,e):n[t](i):n.log.warn(`PICT-MarkdownEditor _buildQuadrantButtons: method "${t}" not found.`)})}(d,c,e),a.appendChild(o)}}}customConfigureExtensions(t,e){return t}_renderAddButton(t){let e={ViewIdentifier:this._viewCallIdentifier},i=this.pict.parseTemplateByHash("MarkdownEditor-AddSegment",e),n=document.createElement("div");n.innerHTML=i;let o=n.firstElementChild;t.appendChild(o)}onImageUpload(t,e,i){return!1}toggleControls(t,e){let i=e;"boolean"==typeof t&&(i=t),this._controlsVisible="boolean"==typeof i?i:!this._controlsVisible;let n=this._getContainerElement();n&&(this._controlsVisible?(n.classList.add("pict-mde-controls-on"),n.classList.remove("pict-mde-controls-hidden")):(n.classList.remove("pict-mde-controls-on"),n.classList.add("pict-mde-controls-hidden")))}toggleLineNumbers(t){this.toggleControls(t)}togglePreview(t){"boolean"==typeof t?t?this.setPreviewMode(this._lastPreviewLayout||"bottom"):this.setPreviewMode("off"):"off"===this._previewMode?this.setPreviewMode(this._lastPreviewLayout||"bottom"):this.setPreviewMode("off")}setPreviewMode(t){if(["off","bottom","side","tabbed"].indexOf(t)<0)return void this.log.warn(`PICT-MarkdownEditor setPreviewMode: unknown mode "${t}".`);"off"!==t&&(this._lastPreviewLayout=t),this._previewMode=t;let e=this._getContainerElement();if(e&&(e.classList.remove("pict-mde-preview-off","pict-mde-preview-bottom","pict-mde-preview-side","pict-mde-preview-tabbed","pict-mde-previews-hidden"),e.classList.add("pict-mde-preview-"+t)),"off"!==t){let t=this._getOrderedSegmentIndices();for(let e=0;e<t.length;e++)this._updateRichPreviews(t[e]),this._updateImagePreviews(t[e])}}cyclePreviewMode(t){let e=["off","bottom","side","tabbed"],i=(e.indexOf(this._previewMode)+1)%e.length;this.setPreviewMode(e[i])}switchSegmentTab(t,e){let i=this._getLogicalIndex(t);if(i<0)return;this._segmentTabStates[i]=e;let n=document.getElementById(`PictMDE-Segment-${t}`);if(!n)return;"preview"===e?(n.classList.add("pict-mde-tab-showing-preview"),this._updateRichPreviews(t),this._updateImagePreviews(t)):n.classList.remove("pict-mde-tab-showing-preview");let o=document.getElementById(`PictMDE-TabBar-${t}`);if(o){let t=o.querySelectorAll(".pict-mde-tab");for(let i=0;i<t.length;i++)t[i].getAttribute("data-tab")===e?t[i].classList.add("pict-mde-tab-active"):t[i].classList.remove("pict-mde-tab-active")}}toggleSegmentPreview(t,e){let i=this._getLogicalIndex(t);if(i<0)return;let n=!!this._hiddenPreviewSegments[i];n="boolean"==typeof e?!e:!n,n?this._hiddenPreviewSegments[i]=!0:delete this._hiddenPreviewSegments[i];let o=document.getElementById(`PictMDE-Segment-${t}`);o&&(n?o.classList.add("pict-mde-preview-hidden"):(o.classList.remove("pict-mde-preview-hidden"),this._updateRichPreviews(t),this._updateImagePreviews(t)))}_getSegmentsFromData(){if(!this.options.ContentDataAddress)return null;const t={Fable:this.fable,Pict:this.fable,AppData:this.AppData,Bundle:this.Bundle,Options:this.options};let e=this.fable.manifest.getValueByHash(t,this.options.ContentDataAddress);return Array.isArray(e)?e:null}_setSegmentsToData(t){if(!this.options.ContentDataAddress)return;const e={Fable:this.fable,Pict:this.fable,AppData:this.AppData,Bundle:this.Bundle,Options:this.options};this.fable.manifest.setValueByHash(e,this.options.ContentDataAddress,t)}_onSegmentContentChange(t,e){let i=this._getLogicalIndex(t);if(i<0)return;let n=this._getSegmentsFromData();if(!n)return;i<n.length&&(n[i].Content=e),this.onContentChange(i,e);let o=this;this._imagePreviewTimers[t]&&clearTimeout(this._imagePreviewTimers[t]),this._imagePreviewTimers[t]=setTimeout(()=>{o._updateImagePreviews(t),delete o._imagePreviewTimers[t]},500),this._richPreviewTimers[t]&&clearTimeout(this._richPreviewTimers[t]),this._richPreviewTimers[t]=setTimeout(()=>{o._updateRichPreviews(t),delete o._richPreviewTimers[t]},500)}onContentChange(t,e){}_getLogicalIndex(t){let e=this._getContainerElement();if(!e)return-1;let i=e.querySelectorAll(".pict-mde-segment");for(let e=0;e<i.length;e++){if(parseInt(i[e].getAttribute("data-segment-index"),10)===t)return e}return-1}_getOrderedSegmentIndices(){let t=this._getContainerElement();if(!t)return[];let e=t.querySelectorAll(".pict-mde-segment"),i=[];for(let t=0;t<e.length;t++)i.push(parseInt(e[t].getAttribute("data-segment-index"),10));return i}addSegment(t){let e="string"==typeof t?t:"",i=this._getSegmentsFromData();i||(i=[]),i.push({Content:e}),this._setSegmentsToData(i),this._buildEditorUI()}removeSegment(t){let e=this._getLogicalIndex(t);if(e<0)return void this.log.warn(`PICT-MarkdownEditor removeSegment: segment index ${t} not found.`);let i=this._getSegmentsFromData();if(!i||i.length<=1)return void this.log.warn("PICT-MarkdownEditor removeSegment: cannot remove the last segment.");this._segmentEditors[t]&&(this._segmentEditors[t].destroy(),delete this._segmentEditors[t]),i.splice(e,1),this._setSegmentsToData(i);let n={};for(let t in this._hiddenPreviewSegments){let i=parseInt(t,10);i<e?n[i]=!0:i>e&&(n[i-1]=!0)}this._hiddenPreviewSegments=n;let o={};for(let t in this._segmentTabStates){let i=parseInt(t,10);i<e?o[i]=this._segmentTabStates[t]:i>e&&(o[i-1]=this._segmentTabStates[t])}this._segmentTabStates=o,this._buildEditorUI()}moveSegmentUp(t){let e=this._getLogicalIndex(t);if(e<=0)return;this._marshalAllEditorsToData();let i=this._getSegmentsFromData();if(!i)return;let n=i[e];i[e]=i[e-1],i[e-1]=n,this._swapHiddenPreviewState(e,e-1),this._swapSegmentTabStates(e,e-1),this._buildEditorUI()}moveSegmentDown(t){let e=this._getLogicalIndex(t),i=this._getSegmentsFromData();if(!i||e<0||e>=i.length-1)return;this._marshalAllEditorsToData();let n=i[e];i[e]=i[e+1],i[e+1]=n,this._swapHiddenPreviewState(e,e+1),this._swapSegmentTabStates(e,e+1),this._buildEditorUI()}getSegmentContent(t){let e=this._getOrderedSegmentIndices();if(t<0||t>=e.length)return"";let i=e[t],n=this._segmentEditors[i];return n?n.state.doc.toString():""}setSegmentContent(t,e){let i=this._getOrderedSegmentIndices();if(t<0||t>=i.length)return void this.log.warn(`PICT-MarkdownEditor setSegmentContent: index ${t} out of range.`);let n=i[t],o=this._segmentEditors[n];o&&o.dispatch({changes:{from:0,to:o.state.doc.length,insert:e}})}getSegmentCount(){return this._getOrderedSegmentIndices().length}getAllContent(t){let e="string"==typeof t?t:"\n\n",i=this._getOrderedSegmentIndices(),n=[];for(let t=0;t<i.length;t++){let e=this._segmentEditors[i[t]];e&&n.push(e.state.doc.toString())}return n.join(e)}_marshalAllEditorsToData(){let t=this._getSegmentsFromData();if(!t)return;let e=this._getOrderedSegmentIndices();for(let i=0;i<e.length;i++){let n=this._segmentEditors[e[i]];n&&i<t.length&&(t[i].Content=n.state.doc.toString())}}setReadOnly(t){this.options.ReadOnly=t,this.initialRenderComplete&&(this._marshalAllEditorsToData(),this._buildEditorUI())}marshalToView(){super.marshalToView(),this.initialRenderComplete&&this.options.ContentDataAddress&&this._buildEditorUI()}marshalFromView(){super.marshalFromView(),this._marshalAllEditorsToData()}destroy(){for(let t in this._segmentEditors)this._segmentEditors[t]&&this._segmentEditors[t].destroy();this._segmentEditors={};for(let t in this._richPreviewTimers)clearTimeout(this._richPreviewTimers[t]);this._richPreviewTimers={},this._richPreviewGenerations={},this._segmentTabStates={}}},e.exports.default_configuration=r},{"./Pict-MDE-CodeMirror.js":86,"./Pict-MDE-DragAndReorder.js":87,"./Pict-MDE-Formatting.js":88,"./Pict-MDE-ImageHandling.js":89,"./Pict-MDE-RichPreview.js":90,"./Pict-Section-MarkdownEditor-DefaultConfiguration.js":91,"pict-section-content":62,"pict-view":102}],93:[function(t,e,i){e.exports=class{constructor(t){this._modal=t}confirm(t,e){let i=Object.assign({},this._modal.options.DefaultConfirmOptions,e);return new Promise(e=>{let n=this._buildDialog(i.title,t,e,i);this._showDialog(n,e)})}doubleConfirm(t,e){let i=Object.assign({},this._modal.options.DefaultDoubleConfirmOptions,e);return new Promise(e=>{let n=this._buildDoubleConfirmDialog(i.title,t,e,i);this._showDialog(n,e)})}_buildDialog(t,e,i,n){let o=this._modal._nextId(),r=n.dangerous?"danger":"primary",a=document.createElement("div");a.className="pict-modal-dialog",a.id="pict-modal-"+o,a.setAttribute("role","dialog"),a.setAttribute("aria-modal","true"),a.style.width="420px",a.innerHTML='<div class="pict-modal-dialog-header"><span class="pict-modal-dialog-title">'+this._escapeHTML(t)+'</span><button class="pict-modal-dialog-close" aria-label="Close">×</button></div><div class="pict-modal-dialog-body"><p>'+this._escapeHTML(e)+'</p></div><div class="pict-modal-dialog-footer"><button class="pict-modal-btn" data-action="cancel">'+this._escapeHTML(n.cancelLabel)+'</button><button class="pict-modal-btn pict-modal-btn--'+r+'" data-action="confirm">'+this._escapeHTML(n.confirmLabel)+"</button></div>";let s=a.querySelector(".pict-modal-dialog-close"),l=a.querySelector('[data-action="cancel"]'),d=a.querySelector('[data-action="confirm"]'),c=t=>{this._dismissDialog(a,t,i)};return s.addEventListener("click",()=>{c(!1)}),l.addEventListener("click",()=>{c(!1)}),d.addEventListener("click",()=>{c(!0)}),a._dismiss=c,a._focusTarget=l,a}_buildDoubleConfirmDialog(t,e,i,n){let o=this._modal._nextId(),r="string"==typeof n.confirmPhrase&&n.confirmPhrase.length>0,a=document.createElement("div");a.className="pict-modal-dialog",a.id="pict-modal-"+o,a.setAttribute("role","dialog"),a.setAttribute("aria-modal","true"),a.style.width="420px";let s="<p>"+this._escapeHTML(e)+"</p>";if(r){let t=n.phrasePrompt.replace("{phrase}",n.confirmPhrase);s+='<div class="pict-modal-confirm-prompt">'+this._escapeHTML(t)+'</div><input type="text" class="pict-modal-confirm-input" autocomplete="off" spellcheck="false" />'}a.innerHTML='<div class="pict-modal-dialog-header"><span class="pict-modal-dialog-title">'+this._escapeHTML(t)+'</span><button class="pict-modal-dialog-close" aria-label="Close">×</button></div><div class="pict-modal-dialog-body">'+s+'</div><div class="pict-modal-dialog-footer"><button class="pict-modal-btn" data-action="cancel">'+this._escapeHTML(n.cancelLabel)+'</button><button class="pict-modal-btn pict-modal-btn--danger" data-action="confirm" disabled>'+this._escapeHTML(n.confirmLabel)+"</button></div>";let l=a.querySelector(".pict-modal-dialog-close"),d=a.querySelector('[data-action="cancel"]'),c=a.querySelector('[data-action="confirm"]'),p=t=>{this._dismissDialog(a,t,i)};if(l.addEventListener("click",()=>{p(!1)}),d.addEventListener("click",()=>{p(!1)}),r){let t=a.querySelector(".pict-modal-confirm-input");t.addEventListener("input",()=>{c.disabled=t.value!==n.confirmPhrase}),c.addEventListener("click",()=>{c.disabled||p(!0)}),a._focusTarget=t}else{let t=0;n.confirmLabel;c.disabled=!1,c.addEventListener("click",()=>{t++,1===t?c.textContent="Click again to confirm":p(!0)}),a._focusTarget=d}return a._dismiss=p,a}_showDialog(t,e){let i={element:t,dismiss:t._dismiss,type:"confirm"},n=null;this._modal.options.OverlayClickDismisses&&(n=()=>{t._dismiss(!1)}),this._modal._overlay.show(n),document.body.appendChild(t),this._modal._activeModals.push(i),t.offsetHeight,t.classList.add("pict-modal-visible"),t._focusTarget&&t._focusTarget.focus(),t._keyHandler=e=>{"Escape"===e.key&&t._dismiss(!1)},document.addEventListener("keydown",t._keyHandler)}_dismissDialog(t,e,i){if(!t._dismissed){if(t._dismissed=!0,t._keyHandler&&document.removeEventListener("keydown",t._keyHandler),t.classList.remove("pict-modal-visible"),this._modal._activeModals=this._modal._activeModals.filter(e=>e.element!==t),this._modal._activeModals.length>0){let t=this._modal._activeModals[this._modal._activeModals.length-1];this._modal._overlay.updateClickHandler(this._modal.options.OverlayClickDismisses?t.dismiss:null)}this._modal._overlay.hide(),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t)},220),i(e)}}_escapeHTML(t){return"string"!=typeof t?"":t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}}},{}],94:[function(t,e,i){e.exports=class{constructor(t){this._modal=t,this._element=null,this._refCount=0}show(t){this._refCount++,this._element||(this._element=document.createElement("div"),this._element.className="pict-modal-overlay",document.body.appendChild(this._element),this._element.offsetHeight,this._element.classList.add("pict-modal-visible")),t&&(this._currentClickHandler=t,this._element.onclick=t=>{t.target===this._element&&this._currentClickHandler&&this._currentClickHandler()})}updateClickHandler(t){this._currentClickHandler=t||null}hide(){if(this._refCount--,this._refCount<=0&&(this._refCount=0,this._element)){this._element.classList.remove("pict-modal-visible");let t=this._element;setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t)},220),this._element=null,this._currentClickHandler=null}}destroy(){this._refCount=0,this._element&&this._element.parentNode&&this._element.parentNode.removeChild(this._element),this._element=null,this._currentClickHandler=null}}},{}],95:[function(t,e,i){e.exports=class{constructor(t){this._modal=t,this._panels=[]}create(t,e){let i=this._modal&&this._modal.options&&this._modal.options.DefaultPanelOptions||{},n=Object.assign({},{position:"right",width:340,minWidth:200,maxWidth:600,collapsible:!0,collapsed:!1,persist:!1,persistKey:"",onResize:null,onToggle:null},i,e);if("undefined"==typeof document)return this._nullHandle();let o=document.querySelector(t);if(!o)return this._nullHandle();let r=this._modal._nextId(),a="right"===n.position,s=!1,l=n.width,d=!1;if(n.persist&&n.persistKey)try{let t=localStorage.getItem("pict-panel-"+n.persistKey);if(t){let e=JSON.parse(t);"number"==typeof e.width&&(l=e.width),"boolean"==typeof e.collapsed&&(n.collapsed=e.collapsed)}}catch(t){}o.classList.add("pict-panel"),o.classList.add(a?"pict-panel-right":"pict-panel-left"),o.style.width=l+"px","none"===o.style.display&&(o.style.display="");let c=document.createElement("div");c.className="pict-panel-edge "+(a?"pict-panel-edge-right":"pict-panel-edge-left");let p=document.createElement("div");p.className="pict-panel-resize",c.appendChild(p);let h=null;n.collapsible&&(h=document.createElement("div"),h.className="pict-panel-tab",h.title="Toggle panel",c.appendChild(h)),o.parentNode?a?o.parentNode.insertBefore(c,o):o.parentNode.insertBefore(c,o.nextSibling):o.insertBefore(c,o.firstChild);let u='<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6,3 11,8 6,13"/></svg>',m='<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="10,3 5,8 10,13"/></svg>',g=()=>{h&&(h.innerHTML=a?s?m:u:s?u:m)},f=()=>{if(n.persist&&n.persistKey)try{localStorage.setItem("pict-panel-"+n.persistKey,JSON.stringify({width:l,collapsed:s}))}catch(t){}},v=()=>{s||d||(s=!0,o.classList.add("pict-panel-collapsed"),c.classList.add("pict-panel-edge-collapsed"),g(),f(),"function"==typeof n.onToggle&&n.onToggle(!0))},b=()=>{s&&!d&&(s=!1,c.classList.remove("pict-panel-edge-collapsed"),o.classList.remove("pict-panel-collapsed"),o.style.width=l+"px",g(),f(),"function"==typeof n.onToggle&&n.onToggle(!1))},y=()=>{s?b():v()};h&&h.addEventListener("click",t=>{t.stopPropagation(),y()});let w=t=>{if(s)return;t.preventDefault();let e=t.clientX,i=o.offsetWidth;p.classList.add("dragging"),o.style.transition="none",document.body.style.userSelect="none",document.body.style.cursor="col-resize";let r=t=>{let r=a?e-t.clientX:t.clientX-e,s=Math.max(n.minWidth,Math.min(n.maxWidth,i+r));o.style.width=s+"px"},d=t=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",d),p.classList.remove("dragging"),o.style.transition="",document.body.style.userSelect="",document.body.style.cursor="",l=o.offsetWidth,f(),"function"==typeof n.onResize&&n.onResize(l)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",d)};p.addEventListener("mousedown",w),g(),n.collapsed&&(s=!0,o.classList.add("pict-panel-collapsed"),c.classList.add("pict-panel-edge-collapsed"),g());let C={id:r,collapse:v,expand:b,toggle:y,setWidth:t=>{if(d)return;let e=Math.max(n.minWidth,Math.min(n.maxWidth,t));l=e,s||(o.style.width=e+"px"),f(),"function"==typeof n.onResize&&n.onResize(e)},destroy:()=>{if(d)return;d=!0,p.removeEventListener("mousedown",w),c.parentNode&&c.remove(),o.classList.remove("pict-panel","pict-panel-right","pict-panel-left","pict-panel-collapsed"),o.style.width="",o.style.transition="";let t=this._panels.indexOf(C);t>=0&&this._panels.splice(t,1)}};return this._panels.push(C),C}_nullHandle(){return{id:0,collapse:()=>{},expand:()=>{},toggle:()=>{},setWidth:()=>{},destroy:()=>{}}}destroyAll(){let t=this._panels.slice();for(let e=0;e<t.length;e++)t[e].destroy()}}},{}],96:[function(t,e,i){e.exports=class{constructor(t){this._modal=t,this._containers={}}toast(t,e){let i=Object.assign({},this._modal.options.DefaultToastOptions,e),n=this._getContainer(i.position),o=this._modal._nextId(),r=document.createElement("div");r.className="pict-modal-toast pict-modal-toast--"+i.type,r.id="pict-modal-toast-"+o;let a='<span class="pict-modal-toast-message">'+this._escapeHTML(t)+"</span>";i.dismissible&&(a+='<button class="pict-modal-toast-dismiss" aria-label="Dismiss">×</button>'),r.innerHTML=a;let s=!1,l=null,d=()=>{s||(s=!0,l&&clearTimeout(l),r.classList.remove("pict-modal-visible"),r.classList.add("pict-modal-toast-exit"),this._modal._activeToasts=this._modal._activeToasts.filter(t=>t.element!==r),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),this._cleanupContainer(i.position)},220))},c={dismiss:d};if(i.dismissible){let t=r.querySelector(".pict-modal-toast-dismiss");t&&t.addEventListener("click",d)}n.appendChild(r);let p={element:r,dismiss:d,handle:c};return this._modal._activeToasts.push(p),r.offsetHeight,r.classList.add("pict-modal-visible"),i.duration>0&&(l=setTimeout(d,i.duration)),c}_getContainer(t){if(this._containers[t])return this._containers[t];let e=document.createElement("div");return e.className="pict-modal-toast-container pict-modal-toast-container--"+t,document.body.appendChild(e),this._containers[t]=e,e}_cleanupContainer(t){let e=this._containers[t];e&&0===e.children.length&&(e.parentNode&&e.parentNode.removeChild(e),delete this._containers[t])}dismissAll(){let t=this._modal._activeToasts.slice();for(let e=0;e<t.length;e++)t[e].dismiss()}destroy(){this.dismissAll();let t=Object.keys(this._containers);for(let e=0;e<t.length;e++){let i=this._containers[t[e]];i&&i.parentNode&&i.parentNode.removeChild(i)}this._containers={}}_escapeHTML(t){return"string"!=typeof t?"":t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}}},{}],97:[function(t,e,i){e.exports=class{constructor(t){this._modal=t}tooltip(t,e,i){let n=Object.assign({},this._modal.options.DefaultTooltipOptions,i);return this._attachTooltip(t,e,!1,n)}richTooltip(t,e,i){let n=Object.assign({},this._modal.options.DefaultTooltipOptions,i);return this._attachTooltip(t,e,!0,n)}_attachTooltip(t,e,i,n){let o=null,r=null,a=null,s=!1,l=this._modal._nextId(),d=()=>{if(s||o)return;o=document.createElement("div"),o.className="pict-modal-tooltip pict-modal-tooltip--"+n.position,o.id="pict-modal-tooltip-"+l,o.setAttribute("role","tooltip"),o.style.maxWidth=n.maxWidth,n.interactive&&o.classList.add("pict-modal-tooltip-interactive");let r=document.createElement("div");r.className="pict-modal-tooltip-arrow";let d=document.createElement("div");i?d.innerHTML=e:d.textContent=e,o.appendChild(r),o.appendChild(d),document.body.appendChild(o),t.setAttribute("aria-describedby",o.id),this._positionTooltip(o,t,n.position),o.offsetHeight,o.classList.add("pict-modal-visible"),this._modal._activeTooltips.push({element:o,targetElement:t,destroy:g}),n.interactive&&o&&(o.addEventListener("mouseenter",()=>{a&&(clearTimeout(a),a=null)}),o.addEventListener("mouseleave",()=>{c()}))},c=()=>{if(!o)return;o.classList.remove("pict-modal-visible");let e=o;o=null,t.removeAttribute("aria-describedby"),this._modal._activeTooltips=this._modal._activeTooltips.filter(t=>t.element!==e),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e)},220)},p=()=>{a&&(clearTimeout(a),a=null),r=setTimeout(d,n.delay)},h=()=>{r&&(clearTimeout(r),r=null),n.interactive?a=setTimeout(c,100):c()},u=()=>{r=setTimeout(d,n.delay)},m=()=>{r&&(clearTimeout(r),r=null),c()};t.addEventListener("mouseenter",p),t.addEventListener("mouseleave",h),t.addEventListener("focusin",u),t.addEventListener("focusout",m);let g=()=>{s||(s=!0,r&&clearTimeout(r),a&&clearTimeout(a),c(),t.removeEventListener("mouseenter",p),t.removeEventListener("mouseleave",h),t.removeEventListener("focusin",u),t.removeEventListener("focusout",m))};return{destroy:g}}_positionTooltip(t,e,i){let n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=i;"top"===r&&n.top<o.height+8?r="bottom":"bottom"===r&&window.innerHeight-n.bottom<o.height+8?r="top":"left"===r&&n.left<o.width+8?r="right":"right"===r&&window.innerWidth-n.right<o.width+8&&(r="left"),t.className=t.className.replace(/pict-modal-tooltip--\w+/,"pict-modal-tooltip--"+r);let a=0,s=0;switch(r){case"top":a=n.top-o.height-8,s=n.left+n.width/2-o.width/2;break;case"bottom":a=n.bottom+8,s=n.left+n.width/2-o.width/2;break;case"left":a=n.top+n.height/2-o.height/2,s=n.left-o.width-8;break;case"right":a=n.top+n.height/2-o.height/2,s=n.right+8}s=Math.max(4,Math.min(s,window.innerWidth-o.width-4)),a=Math.max(4,Math.min(a,window.innerHeight-o.height-4)),t.style.top=a+"px",t.style.left=s+"px"}dismissAll(){let t=this._modal._activeTooltips.slice();for(let e=0;e<t.length;e++)t[e].destroy()}}},{}],98:[function(t,e,i){e.exports=class{constructor(t){this._modal=t}show(t){let e=Object.assign({},this._modal.options.DefaultModalOptions,t);return new Promise(t=>{let i=this._buildDialog(e,t);this._showDialog(i,e,t)})}_buildDialog(t,e){let i=this._modal._nextId(),n=document.createElement("div");n.className="pict-modal-dialog",n.id="pict-modal-"+i,n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.style.width=t.width;let o="";(t.title||t.closeable)&&(o='<div class="pict-modal-dialog-header">',o+='<span class="pict-modal-dialog-title">'+this._escapeHTML(t.title)+"</span>",t.closeable&&(o+='<button class="pict-modal-dialog-close" aria-label="Close">×</button>'),o+="</div>");let r='<div class="pict-modal-dialog-body">'+(t.content||"")+"</div>",a="";if(t.buttons&&t.buttons.length>0){a='<div class="pict-modal-dialog-footer">';for(let e=0;e<t.buttons.length;e++){let i=t.buttons[e],n="pict-modal-btn";i.Style&&(n+=" pict-modal-btn--"+i.Style),a+='<button class="'+n+'" data-hash="'+this._escapeHTML(i.Hash)+'">'+this._escapeHTML(i.Label)+"</button>"}a+="</div>"}n.innerHTML=o+r+a;let s=i=>{this._dismissDialog(n,i,e,t)};if(t.closeable){let t=n.querySelector(".pict-modal-dialog-close");t&&t.addEventListener("click",()=>{s(null)})}let l=n.querySelectorAll("[data-hash]");for(let t=0;t<l.length;t++){let e=l[t];e.addEventListener("click",()=>{s(e.getAttribute("data-hash"))})}return n._dismiss=s,n}_showDialog(t,e,i){let n={element:t,dismiss:t._dismiss,type:"window"},o=null;this._modal.options.OverlayClickDismisses&&e.closeable&&(o=()=>{t._dismiss(null)}),this._modal._overlay.show(o),document.body.appendChild(t),this._modal._activeModals.push(n),t.offsetHeight,t.classList.add("pict-modal-visible");let r=t.querySelector(".pict-modal-btn")||t.querySelector(".pict-modal-dialog-close");r&&r.focus(),t._keyHandler=i=>{"Escape"===i.key&&e.closeable&&t._dismiss(null)},document.addEventListener("keydown",t._keyHandler),"function"==typeof e.onOpen&&e.onOpen(t)}_dismissDialog(t,e,i,n){if(!t._dismissed){if(t._dismissed=!0,t._keyHandler&&document.removeEventListener("keydown",t._keyHandler),t.classList.remove("pict-modal-visible"),this._modal._activeModals=this._modal._activeModals.filter(e=>e.element!==t),this._modal._activeModals.length>0){let t=this._modal._activeModals[this._modal._activeModals.length-1];this._modal._overlay.updateClickHandler(this._modal.options.OverlayClickDismisses?t.dismiss:null)}this._modal._overlay.hide(),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t)},220),"function"==typeof n.onClose&&n.onClose(e),i(e)}}_escapeHTML(t){return"string"!=typeof t?"":t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}}},{}],99:[function(t,e,i){e.exports={AutoInitialize:!0,AutoRender:!1,AutoSolveWithApp:!1,ViewIdentifier:"Pict-Section-Modal",OverlayClickDismisses:!0,DefaultConfirmOptions:{title:"Confirm",confirmLabel:"OK",cancelLabel:"Cancel",dangerous:!1},DefaultDoubleConfirmOptions:{title:"Are you sure?",confirmLabel:"Confirm",cancelLabel:"Cancel",phrasePrompt:'Type "{phrase}" to confirm:',confirmPhrase:""},DefaultModalOptions:{title:"",content:"",buttons:[],closeable:!0,width:"480px"},DefaultTooltipOptions:{position:"top",delay:200,maxWidth:"300px",interactive:!1},DefaultToastOptions:{type:"info",duration:3e3,position:"top-right",dismissible:!0},DefaultPanelOptions:{position:"right",width:340,minWidth:200,maxWidth:600,collapsible:!0,collapsed:!1,persist:!1,persistKey:""},Templates:[],Renderables:[],CSS:"\n/* pict-section-modal */\n.pict-modal-root\n{\n\t/* Overlay */\n\t--pict-modal-overlay-bg: rgba(0, 0, 0, 0.5);\n\n\t/* Dialog */\n\t--pict-modal-bg: #ffffff;\n\t--pict-modal-fg: #1a1a1a;\n\t--pict-modal-border: #e0e0e0;\n\t--pict-modal-border-radius: 8px;\n\t--pict-modal-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);\n\t--pict-modal-header-bg: #f5f5f5;\n\t--pict-modal-header-fg: #1a1a1a;\n\t--pict-modal-header-border: #e0e0e0;\n\n\t/* Buttons */\n\t--pict-modal-btn-bg: #e0e0e0;\n\t--pict-modal-btn-fg: #1a1a1a;\n\t--pict-modal-btn-hover-bg: #d0d0d0;\n\t--pict-modal-btn-primary-bg: #2563eb;\n\t--pict-modal-btn-primary-fg: #ffffff;\n\t--pict-modal-btn-primary-hover-bg: #1d4ed8;\n\t--pict-modal-btn-danger-bg: #dc2626;\n\t--pict-modal-btn-danger-fg: #ffffff;\n\t--pict-modal-btn-danger-hover-bg: #b91c1c;\n\t--pict-modal-btn-border-radius: 4px;\n\n\t/* Toast */\n\t--pict-modal-toast-bg: #333333;\n\t--pict-modal-toast-fg: #ffffff;\n\t--pict-modal-toast-success-bg: #16a34a;\n\t--pict-modal-toast-warning-bg: #d97706;\n\t--pict-modal-toast-error-bg: #dc2626;\n\t--pict-modal-toast-info-bg: #2563eb;\n\t--pict-modal-toast-border-radius: 6px;\n\t--pict-modal-toast-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);\n\n\t/* Tooltip */\n\t--pict-modal-tooltip-bg: #1a1a1a;\n\t--pict-modal-tooltip-fg: #ffffff;\n\t--pict-modal-tooltip-border-radius: 4px;\n\t--pict-modal-tooltip-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n\n\t/* Typography */\n\t--pict-modal-font-family: system-ui, -apple-system, sans-serif;\n\t--pict-modal-font-size: 14px;\n\t--pict-modal-title-font-size: 16px;\n\n\t/* Animation */\n\t--pict-modal-transition-duration: 200ms;\n}\n\n/* Overlay */\n.pict-modal-overlay\n{\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n\tz-index: 1000;\n\tbackground: var(--pict-modal-overlay-bg);\n\topacity: 0;\n\ttransition: opacity var(--pict-modal-transition-duration) ease;\n}\n\n.pict-modal-overlay.pict-modal-visible\n{\n\topacity: 1;\n}\n\n/* Dialog */\n.pict-modal-dialog\n{\n\tposition: fixed;\n\tz-index: 1010;\n\ttop: 50%;\n\tleft: 50%;\n\ttransform: translate(-50%, -50%) translateY(-20px);\n\topacity: 0;\n\ttransition: opacity var(--pict-modal-transition-duration) ease,\n\t transform var(--pict-modal-transition-duration) ease;\n\n\tmax-width: 90vw;\n\tmax-height: 90vh;\n\tdisplay: flex;\n\tflex-direction: column;\n\n\tbackground: var(--pict-modal-bg);\n\tcolor: var(--pict-modal-fg);\n\tborder: 1px solid var(--pict-modal-border);\n\tborder-radius: var(--pict-modal-border-radius);\n\tbox-shadow: var(--pict-modal-shadow);\n\tfont-family: var(--pict-modal-font-family);\n\tfont-size: var(--pict-modal-font-size);\n}\n\n.pict-modal-dialog.pict-modal-visible\n{\n\topacity: 1;\n\ttransform: translate(-50%, -50%) translateY(0);\n}\n\n.pict-modal-dialog-header\n{\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 12px 16px;\n\tbackground: var(--pict-modal-header-bg);\n\tcolor: var(--pict-modal-header-fg);\n\tborder-bottom: 1px solid var(--pict-modal-header-border);\n\tborder-radius: var(--pict-modal-border-radius) var(--pict-modal-border-radius) 0 0;\n}\n\n.pict-modal-dialog-title\n{\n\tfont-size: var(--pict-modal-title-font-size);\n\tfont-weight: 600;\n}\n\n.pict-modal-dialog-close\n{\n\tbackground: none;\n\tborder: none;\n\tfont-size: 20px;\n\tcursor: pointer;\n\tcolor: var(--pict-modal-fg);\n\tpadding: 0 4px;\n\tline-height: 1;\n\topacity: 0.6;\n}\n\n.pict-modal-dialog-close:hover\n{\n\topacity: 1;\n}\n\n.pict-modal-dialog-body\n{\n\tpadding: 16px;\n\toverflow-y: auto;\n\tflex: 1;\n}\n\n.pict-modal-dialog-footer\n{\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tgap: 8px;\n\tpadding: 12px 16px;\n\tborder-top: 1px solid var(--pict-modal-border);\n}\n\n/* Buttons */\n.pict-modal-btn\n{\n\tpadding: 8px 16px;\n\tborder: none;\n\tborder-radius: var(--pict-modal-btn-border-radius);\n\tfont-family: var(--pict-modal-font-family);\n\tfont-size: var(--pict-modal-font-size);\n\tcursor: pointer;\n\tbackground: var(--pict-modal-btn-bg);\n\tcolor: var(--pict-modal-btn-fg);\n\ttransition: background var(--pict-modal-transition-duration) ease;\n}\n\n.pict-modal-btn:hover\n{\n\tbackground: var(--pict-modal-btn-hover-bg);\n}\n\n.pict-modal-btn:disabled\n{\n\topacity: 0.5;\n\tcursor: not-allowed;\n}\n\n.pict-modal-btn--primary\n{\n\tbackground: var(--pict-modal-btn-primary-bg);\n\tcolor: var(--pict-modal-btn-primary-fg);\n}\n\n.pict-modal-btn--primary:hover\n{\n\tbackground: var(--pict-modal-btn-primary-hover-bg);\n}\n\n.pict-modal-btn--danger\n{\n\tbackground: var(--pict-modal-btn-danger-bg);\n\tcolor: var(--pict-modal-btn-danger-fg);\n}\n\n.pict-modal-btn--danger:hover\n{\n\tbackground: var(--pict-modal-btn-danger-hover-bg);\n}\n\n/* Double confirm input */\n.pict-modal-confirm-input\n{\n\twidth: 100%;\n\tpadding: 8px 12px;\n\tmargin-top: 12px;\n\tborder: 1px solid var(--pict-modal-border);\n\tborder-radius: var(--pict-modal-btn-border-radius);\n\tfont-family: var(--pict-modal-font-family);\n\tfont-size: var(--pict-modal-font-size);\n\tbox-sizing: border-box;\n}\n\n.pict-modal-confirm-input:focus\n{\n\toutline: 2px solid var(--pict-modal-btn-primary-bg);\n\toutline-offset: -1px;\n}\n\n.pict-modal-confirm-prompt\n{\n\tmargin-top: 12px;\n\tfont-size: 13px;\n\tcolor: var(--pict-modal-fg);\n\topacity: 0.7;\n}\n\n/* Toast container */\n.pict-modal-toast-container\n{\n\tposition: fixed;\n\tz-index: 1030;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\tpointer-events: none;\n\tmax-width: 400px;\n}\n\n.pict-modal-toast-container--top-right\n{\n\ttop: 16px;\n\tright: 16px;\n}\n\n.pict-modal-toast-container--top-left\n{\n\ttop: 16px;\n\tleft: 16px;\n}\n\n.pict-modal-toast-container--bottom-right\n{\n\tbottom: 16px;\n\tright: 16px;\n}\n\n.pict-modal-toast-container--bottom-left\n{\n\tbottom: 16px;\n\tleft: 16px;\n}\n\n.pict-modal-toast-container--top-center\n{\n\ttop: 16px;\n\tleft: 50%;\n\ttransform: translateX(-50%);\n}\n\n.pict-modal-toast-container--bottom-center\n{\n\tbottom: 16px;\n\tleft: 50%;\n\ttransform: translateX(-50%);\n}\n\n/* Toast */\n.pict-modal-toast\n{\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tpadding: 12px 16px;\n\tborder-radius: var(--pict-modal-toast-border-radius);\n\tbox-shadow: var(--pict-modal-toast-shadow);\n\tfont-family: var(--pict-modal-font-family);\n\tfont-size: var(--pict-modal-font-size);\n\tbackground: var(--pict-modal-toast-bg);\n\tcolor: var(--pict-modal-toast-fg);\n\tpointer-events: auto;\n\topacity: 0;\n\ttransform: translateX(100%);\n\ttransition: opacity var(--pict-modal-transition-duration) ease,\n\t transform var(--pict-modal-transition-duration) ease;\n}\n\n.pict-modal-toast.pict-modal-visible\n{\n\topacity: 1;\n\ttransform: translateX(0);\n}\n\n.pict-modal-toast.pict-modal-toast-exit\n{\n\topacity: 0;\n\ttransform: translateX(100%);\n}\n\n.pict-modal-toast--info\n{\n\tbackground: var(--pict-modal-toast-info-bg);\n}\n\n.pict-modal-toast--success\n{\n\tbackground: var(--pict-modal-toast-success-bg);\n}\n\n.pict-modal-toast--warning\n{\n\tbackground: var(--pict-modal-toast-warning-bg);\n}\n\n.pict-modal-toast--error\n{\n\tbackground: var(--pict-modal-toast-error-bg);\n}\n\n.pict-modal-toast-message\n{\n\tflex: 1;\n}\n\n.pict-modal-toast-dismiss\n{\n\tbackground: none;\n\tborder: none;\n\tcolor: inherit;\n\tfont-size: 18px;\n\tcursor: pointer;\n\tpadding: 0 2px;\n\tline-height: 1;\n\topacity: 0.7;\n}\n\n.pict-modal-toast-dismiss:hover\n{\n\topacity: 1;\n}\n\n/* Tooltip */\n.pict-modal-tooltip\n{\n\tposition: fixed;\n\tz-index: 1020;\n\tpadding: 6px 10px;\n\tborder-radius: var(--pict-modal-tooltip-border-radius);\n\tbox-shadow: var(--pict-modal-tooltip-shadow);\n\tbackground: var(--pict-modal-tooltip-bg);\n\tcolor: var(--pict-modal-tooltip-fg);\n\tfont-family: var(--pict-modal-font-family);\n\tfont-size: 13px;\n\tpointer-events: none;\n\topacity: 0;\n\ttransition: opacity var(--pict-modal-transition-duration) ease;\n\twhite-space: normal;\n\tword-wrap: break-word;\n}\n\n.pict-modal-tooltip.pict-modal-tooltip-interactive\n{\n\tpointer-events: auto;\n}\n\n.pict-modal-tooltip.pict-modal-visible\n{\n\topacity: 1;\n}\n\n.pict-modal-tooltip-arrow\n{\n\tposition: absolute;\n\twidth: 8px;\n\theight: 8px;\n\tbackground: var(--pict-modal-tooltip-bg);\n\ttransform: rotate(45deg);\n}\n\n.pict-modal-tooltip--top .pict-modal-tooltip-arrow\n{\n\tbottom: -4px;\n\tleft: 50%;\n\tmargin-left: -4px;\n}\n\n.pict-modal-tooltip--bottom .pict-modal-tooltip-arrow\n{\n\ttop: -4px;\n\tleft: 50%;\n\tmargin-left: -4px;\n}\n\n.pict-modal-tooltip--left .pict-modal-tooltip-arrow\n{\n\tright: -4px;\n\ttop: 50%;\n\tmargin-top: -4px;\n}\n\n.pict-modal-tooltip--right .pict-modal-tooltip-arrow\n{\n\tleft: -4px;\n\ttop: 50%;\n\tmargin-top: -4px;\n}\n\n/* ── Resizable / Collapsible Panels ──────────────── */\n.pict-panel\n{\n\tposition: relative;\n\ttransition: width 0.2s ease;\n\tflex-shrink: 0;\n\toverflow: visible;\n}\n.pict-panel-collapsed\n{\n\twidth: 0 !important;\n\tmin-width: 0 !important;\n\toverflow: visible;\n}\n.pict-panel-collapsed > *:not(.pict-panel-edge)\n{\n\tdisplay: none;\n}\n\n/* Edge container — zero-width flex sibling of the panel.\n Sits next to the panel in the flex layout; children\n use absolute positioning to overlap the panel boundary. */\n.pict-panel-edge\n{\n\tposition: relative;\n\twidth: 0;\n\tflex-shrink: 0;\n\tz-index: 50;\n\toverflow: visible;\n}\n\n/* Resize handle — thin strip on the panel boundary */\n.pict-panel-resize\n{\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\twidth: 4px;\n\tcursor: col-resize;\n\tbackground: transparent;\n\ttransition: background 0.15s, width 0.15s;\n}\n.pict-panel-edge-right .pict-panel-resize\n{\n\tright: 0;\n\tborder-right: 1px solid var(--pict-panel-border, #DDD6CA);\n}\n.pict-panel-edge-left .pict-panel-resize\n{\n\tleft: 0;\n\tborder-left: 1px solid var(--pict-panel-border, #DDD6CA);\n}\n.pict-panel-resize:hover,\n.pict-panel-edge:hover .pict-panel-resize\n{\n\twidth: 5px;\n\tbackground: var(--pict-panel-accent, #2E7D74);\n\topacity: 0.5;\n}\n.pict-panel-resize.dragging\n{\n\twidth: 5px;\n\tbackground: var(--pict-panel-accent, #2E7D74);\n\topacity: 1;\n\ttransition: none;\n}\n.pict-panel-edge-collapsed .pict-panel-resize\n{\n\tdisplay: none;\n}\n\n/* Collapse tab — tucked sliver at rest, slides out on hover */\n.pict-panel-tab\n{\n\tposition: absolute;\n\ttop: 8px;\n\twidth: 8px;\n\theight: 24px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\toverflow: hidden;\n\tbackground: var(--pict-panel-border, #DDD6CA);\n\tborder: 1px solid var(--pict-panel-border, #DDD6CA);\n\tcursor: pointer;\n\tcolor: var(--pict-panel-fg, #8A7F72);\n\tfont-size: 10px;\n\tline-height: 1;\n\topacity: 0.5;\n\ttransition: opacity 0.25s, width 0.2s ease, height 0.2s ease, left 0.2s ease, right 0.2s ease, background 0.2s;\n\tz-index: 51;\n}\n.pict-panel-edge:hover .pict-panel-tab,\n.pict-panel-tab:hover\n{\n\twidth: 20px;\n\theight: 32px;\n\topacity: 1;\n\toverflow: visible;\n\tbackground: var(--pict-panel-bg, #FAF8F4);\n}\n/* Right panel: tab to the left of the edge */\n.pict-panel-edge-right .pict-panel-tab\n{\n\tright: 0;\n\tborder-right: none;\n\tborder-radius: 4px 0 0 4px;\n}\n.pict-panel-edge-right:hover .pict-panel-tab,\n.pict-panel-edge-right .pict-panel-tab:hover\n{\n\tright: 0;\n}\n/* Left panel: tab to the right of the edge */\n.pict-panel-edge-left .pict-panel-tab\n{\n\tleft: 0;\n\tborder-left: none;\n\tborder-radius: 0 4px 4px 0;\n}\n.pict-panel-edge-left:hover .pict-panel-tab,\n.pict-panel-edge-left .pict-panel-tab:hover\n{\n\tleft: 0;\n}\n/* When collapsed — more visible */\n.pict-panel-edge-collapsed .pict-panel-tab\n{\n\twidth: 10px;\n\theight: 28px;\n\topacity: 0.6;\n}\n.pict-panel-edge-collapsed .pict-panel-tab:hover,\n.pict-panel-edge-collapsed:hover .pict-panel-tab\n{\n\twidth: 20px;\n\theight: 32px;\n\topacity: 1;\n\toverflow: visible;\n\tbackground: var(--pict-panel-bg, #FAF8F4);\n}\n"}},{}],100:[function(t,e,i){const n=t("pict-view"),o=t("./Pict-Modal-Overlay.js"),r=t("./Pict-Modal-Confirm.js"),a=t("./Pict-Modal-Window.js"),s=t("./Pict-Modal-Toast.js"),l=t("./Pict-Modal-Tooltip.js"),d=t("./Pict-Modal-Panel.js"),c=t("./Pict-Section-Modal-DefaultConfiguration.js");e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},c,e),i),this._activeModals=[],this._activeTooltips=[],this._activeToasts=[],this._idCounter=0,this._overlay=new o(this),this._confirm=new r(this),this._window=new a(this),this._toast=new s(this),this._tooltip=new l(this),this._panel=new d(this)}onBeforeInitialize(){return super.onBeforeInitialize(),"undefined"!=typeof document&&document.body&&(document.body.classList.contains("pict-modal-root")||document.body.classList.add("pict-modal-root")),super.onBeforeInitialize()}_nextId(){return this._idCounter++,this._idCounter}confirm(t,e){return this._confirm.confirm(t,e)}doubleConfirm(t,e){return this._confirm.doubleConfirm(t,e)}show(t){return this._window.show(t)}tooltip(t,e,i){return this._tooltip.tooltip(t,e,i)}richTooltip(t,e,i){return this._tooltip.richTooltip(t,e,i)}toast(t,e){return this._toast.toast(t,e)}panel(t,e){return this._panel.create(t,e)}dismissModals(){let t=this._activeModals.slice();for(let e=t.length-1;e>=0;e--)t[e].dismiss(null)}dismissTooltips(){this._tooltip.dismissAll()}dismissToasts(){this._toast.dismissAll()}dismissAll(){this.dismissModals(),this.dismissTooltips(),this.dismissToasts()}destroyPanels(){this._panel.destroyAll()}destroy(){if(this.dismissAll(),this.destroyPanels(),this._overlay.destroy(),this._toast.destroy(),"function"==typeof super.destroy)return super.destroy()}},e.exports.default_configuration=c},{"./Pict-Modal-Confirm.js":93,"./Pict-Modal-Overlay.js":94,"./Pict-Modal-Panel.js":95,"./Pict-Modal-Toast.js":96,"./Pict-Modal-Tooltip.js":97,"./Pict-Modal-Window.js":98,"./Pict-Section-Modal-DefaultConfiguration.js":99,"pict-view":102}],101:[function(t,e,i){e.exports={name:"pict-view",version:"1.0.68",description:"Pict View Base Class",main:"source/Pict-View.js",scripts:{test:"npx quack test",tests:"npx quack test -g",start:"node source/Pict-View.js",coverage:"npx quack coverage",build:"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-view-image:local","docker-dev-run":'docker run -it -d --name pict-view-dev -p 30001:8080 -p 38086:8086 -v "$PWD/.config:/home/coder/.config" -v "$PWD:/home/coder/pict-view" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" pict-view-image:local',"docker-dev-shell":"docker exec -it pict-view-dev /bin/bash",types:"tsc -p .",lint:"eslint source/**"},types:"types/source/Pict-View.d.ts",repository:{type:"git",url:"git+https://github.com/stevenvelozo/pict-view.git"},author:"steven velozo <steven@velozo.com>",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/pict-view/issues"},homepage:"https://github.com/stevenvelozo/pict-view#readme",devDependencies:{"@eslint/js":"^9.39.1","browser-env":"^3.3.0",eslint:"^9.39.1",pict:"^1.0.363",quackage:"^1.0.65",typescript:"^5.9.3"},mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},dependencies:{fable:"^3.1.67","fable-serviceproviderbase":"^3.0.19"}}},{}],102:[function(t,e,i){const n=t("fable-serviceproviderbase"),o=t("../package.json"),r={DefaultRenderable:!1,DefaultDestinationAddress:!1,DefaultTemplateRecordAddress:!1,ViewIdentifier:!1,AutoInitialize:!0,AutoInitializeOrdinal:0,AutoRender:!0,AutoRenderOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0,CSSHash:!1,CSS:!1,CSSProvider:!1,CSSPriority:500,Templates:[],DefaultTemplates:[],Renderables:[],Manifests:{}};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},JSON.parse(JSON.stringify(r)),e),i),this.fable,this.options,this.UUID,this.Hash,this.log;const n=this.Hash===this.UUID;this.UUID=`V-${this.UUID}`,n&&(this.Hash=this.UUID),this.options.ViewIdentifier||(this.options.ViewIdentifier=`AutoViewID-${this.fable.getUUID()}`),this.serviceType="PictView",this._Package=o,this.pict=this.fable,this.AppData=this.pict.AppData,this.Bundle=this.pict.Bundle,this.initializeTimestamp=!1,this.lastSolvedTimestamp=!1,this.lastRenderedTimestamp=!1,this.lastMarshalFromViewTimestamp=!1,this.lastMarshalToViewTimestamp=!1,this.pict.instantiateServiceProviderIfNotExists("TransactionTracking");for(let t=0;t<this.options.Templates.length;t++){let e=this.options.Templates[t];"Hash"in e&&"Template"in e?(e.Source||(e.Source=`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} options object.`),this.pict.TemplateProvider.addTemplate(e.Hash,e.Template,e.Source)):this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not load Template ${t} in the options array.`,e)}for(let t=0;t<this.options.DefaultTemplates.length;t++){let e=this.options.DefaultTemplates[t];"Postfix"in e&&"Template"in e?(e.Source||(e.Source=`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} options object.`),this.pict.TemplateProvider.addDefaultTemplate(e.Prefix,e.Postfix,e.Template,e.Source)):this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not load Default Template ${t} in the options array.`,e)}if(this.options.CSS){let t=this.options.CSSHash?this.options.CSSHash:`View-${this.options.ViewIdentifier}`,e=this.options.CSSProvider?this.options.CSSProvider:t;this.pict.CSSMap.addCSS(t,this.options.CSS,e,this.options.CSSPriority)}this.renderables={};for(let t=0;t<this.options.Renderables.length;t++){let e=this.options.Renderables[t];this.addRenderable(e)}}addRenderable(t,e,i,n,o){let r;if("object"==typeof t)r=t;else{r={RenderableHash:t,TemplateHash:e,DefaultTemplateRecordAddress:i,ContentDestinationAddress:n,RenderMethod:"string"!=typeof o?o:"replace"}}"string"!=typeof r.RenderableHash||"string"!=typeof r.TemplateHash?this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not load Renderable; RenderableHash or TemplateHash are invalid.`,r):(this.pict.LogNoisiness>0&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} adding renderable [${r.RenderableHash}] pointed to template ${r.TemplateHash}.`),this.renderables[r.RenderableHash]=r)}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeInitialize:`),!0}onBeforeInitializeAsync(t){return this.onBeforeInitialize(),t()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onInitialize:`),!0}onInitializeAsync(t){return this.onInitialize(),t()}initialize(){return this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow VIEW [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initialize:`),this.initializeTimestamp?(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initialize called but initialization is already completed. Aborting.`),!1):(this.onBeforeInitialize(),this.onInitialize(),this.onAfterInitialize(),this.initializeTimestamp=this.pict.log.getTimeStamp(),!0)}initializeAsync(t){if(this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow VIEW [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initializeAsync:`),this.initializeTimestamp)return this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} async initialize called but initialization is already completed. Aborting.`),t();{let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate");this.pict.LogNoisiness>0&&this.log.info(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} beginning initialization...`),e.anticipate(this.onBeforeInitializeAsync.bind(this)),e.anticipate(this.onInitializeAsync.bind(this)),e.anticipate(this.onAfterInitializeAsync.bind(this)),e.wait(e=>(e&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initialization failed: ${e.message||e}`,{stack:e.stack}),this.initializeTimestamp=this.pict.log.getTimeStamp(),this.pict.LogNoisiness>0&&this.log.info(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initialization complete.`),t()))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterInitialize:`),!0}onAfterInitializeAsync(t){return this.onAfterInitialize(),t()}onBeforeRender(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeRender:`),!0}onBeforeRenderAsync(t,e){return this.onBeforeRender(e),t()}onBeforeProject(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeProject:`),!0}onBeforeProjectAsync(t,e){return this.onBeforeProject(e),t()}buildRenderOptions(t,e,i){let n={Valid:!0};return n.RenderableHash="string"==typeof t?t:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable,n.RenderableHash||(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not find a suitable RenderableHash ${n.RenderableHash} (param ${t}because it is not a valid renderable.`),n.Valid=!1),n.Renderable=this.renderables[n.RenderableHash],n.Renderable||(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${n.RenderableHash} (param ${t}) because it does not exist.`),n.Valid=!1),n.DestinationAddress="string"==typeof e?e:"string"==typeof n.Renderable.ContentDestinationAddress?n.Renderable.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress&&this.options.DefaultDestinationAddress,n.DestinationAddress||(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${n.RenderableHash} (param ${t}) because it does not have a valid destination address (param ${e}).`),n.Valid=!1),"object"==typeof i?(n.RecordAddress="Passed in as object",n.Record=i):(n.RecordAddress="string"==typeof i?i:"string"==typeof n.Renderable.DefaultTemplateRecordAddress?n.Renderable.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,n.Record="string"==typeof n.RecordAddress?this.pict.DataProvider.getDataByAddress(n.RecordAddress):void 0),n}assignRenderContent(t,e,i){return this.pict.ContentAssignment.projectContent(t.RenderMethod,e,i,t.TestAddress)}render(t,e,i,n){return this.renderWithScope(this,t,e,i,n)}renderWithScope(t,e,i,n,o){let r,a,s,l="string"==typeof e?e:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable;return l?("__Virtual"==l?r={RenderableHash:"__Virtual",TemplateHash:this.renderables[this.options.DefaultRenderable].TemplateHash,ContentDestinationAddress:"string"==typeof i?i:"string"==typeof r.ContentDestinationAddress?r.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null,RenderMethod:"virtual-assignment",TransactionHash:o&&o.TransactionHash,RootRenderableViewHash:o&&o.RootRenderableViewHash}:(r=Object.assign({},this.renderables[l]),r.ContentDestinationAddress="string"==typeof i?i:"string"==typeof r.ContentDestinationAddress?r.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null),r.TransactionHash||(r.TransactionHash=`ViewRender-V-${this.options.ViewIdentifier}-R-${l}-U-${this.pict.getUUID()}`,r.RootRenderableViewHash=this.Hash,this.pict.TransactionTracking.registerTransaction(r.TransactionHash)),r?r.ContentDestinationAddress?("object"==typeof n?(s=n,a="Passed in as object"):(a="string"==typeof n?n:"string"==typeof r.DefaultTemplateRecordAddress?r.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,s="string"==typeof a?this.pict.DataProvider.getDataByAddress(a):void 0),this.onBeforeRender(r),this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow VIEW [${this.UUID}]::[${this.Hash}] Renderable[${l}] Destination[${r.ContentDestinationAddress}] TemplateRecordAddress[${a}] render:`),this.pict.LogNoisiness>0&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} Beginning Render of Renderable[${l}] to Destination [${r.ContentDestinationAddress}]...`),r.Content=this.pict.parseTemplateByHash(r.TemplateHash,s,null,[this],t,{RootRenderable:"object"==typeof o?o:r}),this.pict.LogNoisiness>0&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} Assigning Renderable[${l}] content length ${r.Content.length} to Destination [${r.ContentDestinationAddress}] using render method [${r.RenderMethod}].`),this.onBeforeProject(r),this.onProject(r),"virtual-assignment"!==r.RenderMethod&&(this.onAfterProject(r),this.onAfterRender(r)),!0):(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${l} (param ${e}) because it does not have a valid destination address.`),!1):(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${l} (param ${e}) because it does not exist.`),!1)):(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${l} (param ${e}) because it is not a valid renderable.`),!1)}renderAsync(t,e,i,n,o){return this.renderWithScopeAsync(this,t,e,i,n,o)}renderWithScopeAsync(t,e,i,n,o,r){let a,s,l,d="string"==typeof e?e:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable,c="function"==typeof r?r:"function"==typeof n?n:"function"==typeof i?i:"function"==typeof e?e:"function"==typeof o?o:null;if(c||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),c=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAsync Auto Callback Error: ${t}`,t)}),!d)return this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not asynchronously render ${d} (param ${e}because it is not a valid renderable.`),c(new Error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not asynchronously render ${d} (param ${e}because it is not a valid renderable.`));if("__Virtual"==d?a={RenderableHash:"__Virtual",TemplateHash:this.renderables[this.options.DefaultRenderable].TemplateHash,ContentDestinationAddress:"string"==typeof i?i:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null,RenderMethod:"virtual-assignment",TransactionHash:o&&"function"!=typeof o&&o.TransactionHash,RootRenderableViewHash:o&&"function"!=typeof o&&o.RootRenderableViewHash}:(a=Object.assign({},this.renderables[d]),a.ContentDestinationAddress="string"==typeof i?i:"string"==typeof a.ContentDestinationAddress?a.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null),a.TransactionHash||(a.TransactionHash=`ViewRender-V-${this.options.ViewIdentifier}-R-${d}-U-${this.pict.getUUID()}`,a.RootRenderableViewHash=this.Hash,this.pict.TransactionTracking.registerTransaction(a.TransactionHash)),!a)return this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${d} (param ${e}) because it does not exist.`),c(new Error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${d} (param ${e}) because it does not exist.`));if(!a.ContentDestinationAddress)return this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${d} (param ${e}) because it does not have a valid destination address.`),c(new Error(`Could not render ${d}`));"object"==typeof n?(l=n,s="Passed in as object"):(s="string"==typeof n?n:"string"==typeof a.DefaultTemplateRecordAddress?a.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,l="string"==typeof s?this.pict.DataProvider.getDataByAddress(s):void 0),this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow VIEW [${this.UUID}]::[${this.Hash}] Renderable[${d}] Destination[${a.ContentDestinationAddress}] TemplateRecordAddress[${s}] renderAsync:`),this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} Beginning Asynchronous Render (callback-style)...`);let p=this.fable.newAnticipate();p.anticipate(t=>{this.onBeforeRenderAsync(t,a)}),p.anticipate(i=>{this.pict.parseTemplateByHash(a.TemplateHash,l,(t,n)=>t?(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render (asynchronously) ${d} (param ${e}) because it did not parse the template.`,t),i(t)):(a.Content=n,i()),[this],t,{RootRenderable:"object"==typeof o?o:a})}),p.anticipate(t=>{this.onBeforeProjectAsync(t,a)}),p.anticipate(t=>{this.onProjectAsync(t,a)}),"virtual-assignment"!==a.RenderMethod&&(p.anticipate(t=>{this.onAfterProjectAsync(t,a)}),p.anticipate(t=>{this.onAfterRenderAsync(t,a)})),p.wait(c)}renderDefaultAsync(t){this.renderAsync(t)}basicRender(t,e,i){return this.basicRenderWithScope(this,t,e,i)}basicRenderWithScope(t,e,i,n){let o=this.buildRenderOptions(e,i,n);return o.Valid?(this.assignRenderContent(o.Renderable,o.DestinationAddress,this.pict.parseTemplateByHash(o.Renderable.TemplateHash,o.Record,null,[this],t,{RootRenderable:o.Renderable})),!0):(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not perform a basic render of ${o.RenderableHash} because it is not valid.`),!1)}basicRenderAsync(t,e,i,n){return this.basicRenderWithScopeAsync(this,t,e,i,n)}basicRenderWithScopeAsync(t,e,i,n,o){let r="function"==typeof o?o:"function"==typeof n?n:"function"==typeof i?i:"function"==typeof e?e:null;r||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} basicRenderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),r=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} basicRenderAsync Auto Callback Error: ${t}`,t)});const a=this.buildRenderOptions(e,i,n);if(!a.Valid){let t=`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not perform a basic render of ${a.RenderableHash} because it is not valid.`;return this.log.error(t),r(new Error(t))}this.pict.parseTemplateByHash(a.Renderable.TemplateHash,a.Record,(t,e)=>t?(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render (asynchronously) ${a.RenderableHash} because it did not parse the template.`,t),r(t)):(this.assignRenderContent(a.Renderable,a.DestinationAddress,e),r()),[this],t,{RootRenderable:a.Renderable})}onProject(t){this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onProject:`),"virtual-assignment"===t.RenderMethod&&this.pict.TransactionTracking.pushToTransactionQueue(t.TransactionHash,{ViewHash:this.Hash,Renderable:t},"Deferred-Post-Content-Assignment"),this.pict.LogNoisiness>0&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} Assigning Renderable[${t.RenderableHash}] content length ${t.Content.length} to Destination [${t.ContentDestinationAddress}] using Async render method ${t.RenderMethod}.`),this.pict.ContentAssignment.projectContent(t.RenderMethod,t.ContentDestinationAddress,t.Content,t.TestAddress),this.lastRenderedTimestamp=this.pict.log.getTimeStamp()}onProjectAsync(t,e){return this.onProject(e),t()}onAfterRender(t){if(this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterRender:`),t&&t.RootRenderableViewHash===this.Hash){const e=this.pict.TransactionTracking.clearTransactionQueue(t.TransactionHash)||[];for(const i of e){const e=this.pict.views[i.Data.ViewHash];e?(e.onAfterProject(),e.onAfterRender(i.Data.Renderable)):this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterRender: Could not find view for transaction hash ${t.TransactionHash} and ViewHash ${i.Data.ViewHash}.`)}this.pict.TransactionTracking.unregisterTransaction(t.TransactionHash)}return!0}onAfterRenderAsync(t,e){this.onAfterRender(e);const i=this.fable.newAnticipate(),n=e&&e.RootRenderableViewHash===this.Hash;if(n){const t=this.pict.TransactionTracking.clearTransactionQueue(e.TransactionHash)||[];for(const n of t){const t=this.pict.views[n.Data.ViewHash];t?(i.anticipate(t.onAfterProjectAsync.bind(t)),i.anticipate(e=>{t.onAfterRenderAsync(e,n.Data.Renderable)})):this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterRenderAsync: Could not find view for transaction hash ${e.TransactionHash} and ViewHash ${n.Data.ViewHash}.`)}}return i.wait(i=>(n&&e&&e.TransactionHash&&this.pict.TransactionTracking.unregisterTransaction(e.TransactionHash),t(i)))}onAfterProject(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterProject:`),!0}onAfterProjectAsync(t,e){return t()}onBeforeSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeSolve:`),!0}onBeforeSolveAsync(t){return this.onBeforeSolve(),t()}onSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onSolve:`),!0}onSolveAsync(t){return this.onSolve(),t()}solve(){return this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} executing solve() function...`),this.onBeforeSolve(),this.onSolve(),this.onAfterSolve(),this.lastSolvedTimestamp=this.pict.log.getTimeStamp(),!0}solveAsync(t){let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t?t:null;i||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeSolveAsync.bind(this)),e.anticipate(this.onSolveAsync.bind(this)),e.anticipate(this.onAfterSolveAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} solveAsync() complete.`),this.lastSolvedTimestamp=this.pict.log.getTimeStamp(),i(t)))}onAfterSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterSolve:`),!0}onAfterSolveAsync(t){return this.onAfterSolve(),t()}onBeforeMarshalFromView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeMarshalFromView:`),!0}onBeforeMarshalFromViewAsync(t){return this.onBeforeMarshalFromView(),t()}onMarshalFromView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onMarshalFromView:`),!0}onMarshalFromViewAsync(t){return this.onMarshalFromView(),t()}marshalFromView(){return this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} executing solve() function...`),this.onBeforeMarshalFromView(),this.onMarshalFromView(),this.onAfterMarshalFromView(),this.lastMarshalFromViewTimestamp=this.pict.log.getTimeStamp(),!0}marshalFromViewAsync(t){let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t?t:null;i||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeMarshalFromViewAsync.bind(this)),e.anticipate(this.onMarshalFromViewAsync.bind(this)),e.anticipate(this.onAfterMarshalFromViewAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} marshalFromViewAsync() complete.`),this.lastMarshalFromViewTimestamp=this.pict.log.getTimeStamp(),i(t)))}onAfterMarshalFromView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterMarshalFromView:`),!0}onAfterMarshalFromViewAsync(t){return this.onAfterMarshalFromView(),t()}onBeforeMarshalToView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeMarshalToView:`),!0}onBeforeMarshalToViewAsync(t){return this.onBeforeMarshalToView(),t()}onMarshalToView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onMarshalToView:`),!0}onMarshalToViewAsync(t){return this.onMarshalToView(),t()}marshalToView(){return this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} executing solve() function...`),this.onBeforeMarshalToView(),this.onMarshalToView(),this.onAfterMarshalToView(),this.lastMarshalToViewTimestamp=this.pict.log.getTimeStamp(),!0}marshalToViewAsync(t){let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t?t:null;i||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeMarshalToViewAsync.bind(this)),e.anticipate(this.onMarshalToViewAsync.bind(this)),e.anticipate(this.onAfterMarshalToViewAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} marshalToViewAsync() complete.`),this.lastMarshalToViewTimestamp=this.pict.log.getTimeStamp(),i(t)))}onAfterMarshalToView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterMarshalToView:`),!0}onAfterMarshalToViewAsync(t){return this.onAfterMarshalToView(),t()}get isPictView(){return!0}}},{"../package.json":101,"fable-serviceproviderbase":20}],103:[function(t,e,i){var n,o,r=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(t){if(n===setTimeout)return setTimeout(t,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(t){n=a}try{o="function"==typeof clearTimeout?clearTimeout:s}catch(t){o=s}}();var d,c=[],p=!1,h=-1;function u(){p&&d&&(p=!1,d.length?c=d.concat(c):h=-1,c.length&&m())}function m(){if(!p){var t=l(u);p=!0;for(var e=c.length;e;){for(d=c,c=[];++h<e;)d&&d[h].run();h=-1,e=c.length}d=null,p=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===s||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{return o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function f(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];c.push(new g(t,e)),1!==c.length||p||l(m)},g.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=f,r.addListener=f,r.once=f,r.off=f,r.removeListener=f,r.removeAllListeners=f,r.emit=f,r.prependListener=f,r.prependOnceListener=f,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},{}],104:[function(t,e,i){(function(t){(function(){!function(n){var o="object"==typeof i&&i&&!i.nodeType&&i,r="object"==typeof e&&e&&!e.nodeType&&e,a="object"==typeof t&&t;a.global!==a&&a.window!==a&&a.self!==a||(n=a);var s,l,d=2147483647,c=36,p=/^xn--/,h=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=Math.floor,f=String.fromCharCode;function v(t){throw new RangeError(m[t])}function b(t,e){for(var i=t.length,n=[];i--;)n[i]=e(t[i]);return n}function y(t,e){var i=t.split("@"),n="";return i.length>1&&(n=i[0]+"@",t=i[1]),n+b((t=t.replace(u,".")).split("."),e).join(".")}function w(t){for(var e,i,n=[],o=0,r=t.length;o<r;)(e=t.charCodeAt(o++))>=55296&&e<=56319&&o<r?56320==(64512&(i=t.charCodeAt(o++)))?n.push(((1023&e)<<10)+(1023&i)+65536):(n.push(e),o--):n.push(e);return n}function C(t){return b(t,function(t){var e="";return t>65535&&(e+=f((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=f(t)}).join("")}function x(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:c}function R(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function _(t,e,i){var n=0;for(t=i?g(t/700):t>>1,t+=g(t/e);t>455;n+=c)t=g(t/35);return g(n+36*t/(t+38))}function D(t){var e,i,n,o,r,a,s,l,p,h,u=[],m=t.length,f=0,b=128,y=72;for((i=t.lastIndexOf("-"))<0&&(i=0),n=0;n<i;++n)t.charCodeAt(n)>=128&&v("not-basic"),u.push(t.charCodeAt(n));for(o=i>0?i+1:0;o<m;){for(r=f,a=1,s=c;o>=m&&v("invalid-input"),((l=x(t.charCodeAt(o++)))>=c||l>g((d-f)/a))&&v("overflow"),f+=l*a,!(l<(p=s<=y?1:s>=y+26?26:s-y));s+=c)a>g(d/(h=c-p))&&v("overflow"),a*=h;y=_(f-r,e=u.length+1,0==r),g(f/e)>d-b&&v("overflow"),b+=g(f/e),f%=e,u.splice(f++,0,b)}return C(u)}function E(t){var e,i,n,o,r,a,s,l,p,h,u,m,b,y,C,x=[];for(m=(t=w(t)).length,e=128,i=0,r=72,a=0;a<m;++a)(u=t[a])<128&&x.push(f(u));for(n=o=x.length,o&&x.push("-");n<m;){for(s=d,a=0;a<m;++a)(u=t[a])>=e&&u<s&&(s=u);for(s-e>g((d-i)/(b=n+1))&&v("overflow"),i+=(s-e)*b,e=s,a=0;a<m;++a)if((u=t[a])<e&&++i>d&&v("overflow"),u==e){for(l=i,p=c;!(l<(h=p<=r?1:p>=r+26?26:p-r));p+=c)C=l-h,y=c-h,x.push(f(R(h+C%y,0))),l=g(C/y);x.push(f(R(l,0))),r=_(i,b,n==o),i=0,++n}++i,++e}return x.join("")}if(s={version:"1.4.1",ucs2:{decode:w,encode:C},decode:D,encode:E,toASCII:function(t){return y(t,function(t){return h.test(t)?"xn--"+E(t):t})},toUnicode:function(t){return y(t,function(t){return p.test(t)?D(t.slice(4).toLowerCase()):t})}},o&&r)if(e.exports==o)r.exports=s;else for(l in s)s.hasOwnProperty(l)&&(o[l]=s[l]);else n.punycode=s}(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],105:[function(t,e,i){var n=String.prototype.replace,o=/%20/g,r="RFC1738",a="RFC3986";e.exports={default:a,formatters:{RFC1738:function(t){return n.call(t,o,"+")},RFC3986:function(t){return String(t)}},RFC1738:r,RFC3986:a}},{}],106:[function(t,e,i){var n=t("./stringify"),o=t("./parse"),r=t("./formats");e.exports={formats:r,parse:o,stringify:n}},{"./formats":105,"./parse":107,"./stringify":108}],107:[function(t,e,i){var n=t("./utils"),o=Object.prototype.hasOwnProperty,r=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},s=function(t){return t.replace(/&#(\d+);/g,function(t,e){return String.fromCharCode(parseInt(e,10))})},l=function(t,e,i){if(t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&i>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(1===e.arrayLimit?"":"s")+" allowed in an array.");return t},d=function(t,e,i,r){if(t){var a=function(t,e){var i=e.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t;if(e.depth<=0){if(!e.plainObjects&&o.call(Object.prototype,i)&&!e.allowPrototypes)return;return[i]}var n=/(\[[^[\]]*])/g,r=/(\[[^[\]]*])/.exec(i),a=r?i.slice(0,r.index):i,s=[];if(a){if(!e.plainObjects&&o.call(Object.prototype,a)&&!e.allowPrototypes)return;s[s.length]=a}for(var l=0;null!==(r=n.exec(i))&&l<e.depth;){l+=1;var d=r[1].slice(1,-1);if(!e.plainObjects&&o.call(Object.prototype,d)&&!e.allowPrototypes)return;s[s.length]=r[1]}if(r){if(!0===e.strictDepth)throw new RangeError("Input depth exceeded depth option of "+e.depth+" and strictDepth is true");s[s.length]="["+i.slice(r.index)+"]"}return s}(t,i);if(a)return function(t,e,i,o){var r=0;if(t.length>0&&"[]"===t[t.length-1]){var a=t.slice(0,-1).join("");r=Array.isArray(e)&&e[a]?e[a].length:0}for(var s=o?e:l(e,i,r),d=t.length-1;d>=0;--d){var c,p=t[d];if("[]"===p&&i.parseArrays)c=n.isOverflow(s)?s:i.allowEmptyArrays&&(""===s||i.strictNullHandling&&null===s)?[]:n.combine([],s,i.arrayLimit,i.plainObjects);else{c=i.plainObjects?{__proto__:null}:{};var h="["===p.charAt(0)&&"]"===p.charAt(p.length-1)?p.slice(1,-1):p,u=i.decodeDotInKeys?h.replace(/%2E/g,"."):h,m=parseInt(u,10),g=!isNaN(m)&&p!==u&&String(m)===u&&m>=0&&i.parseArrays;if(i.parseArrays||""!==u)if(g&&m<i.arrayLimit)(c=[])[m]=s;else{if(g&&i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(1===i.arrayLimit?"":"s")+" allowed in an array.");g?(c[m]=s,n.markOverflow(c,m)):"__proto__"!==u&&(c[u]=s)}else c={0:s}}s=c}return s}(a,e,i,r)}};e.exports=function(t,e){var i=function(t){if(!t)return a;if(void 0!==t.allowEmptyArrays&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==t.decodeDotInKeys&&"boolean"!=typeof t.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==t.throwOnLimitExceeded&&"boolean"!=typeof t.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var e=void 0===t.charset?a.charset:t.charset,i=void 0===t.duplicates?a.duplicates:t.duplicates;if("combine"!==i&&"first"!==i&&"last"!==i)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===t.allowDots?!0===t.decodeDotInKeys||a.allowDots:!!t.allowDots,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:a.allowEmptyArrays,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:a.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:a.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:a.comma,decodeDotInKeys:"boolean"==typeof t.decodeDotInKeys?t.decodeDotInKeys:a.decodeDotInKeys,decoder:"function"==typeof t.decoder?t.decoder:a.decoder,delimiter:"string"==typeof t.delimiter||n.isRegExp(t.delimiter)?t.delimiter:a.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:a.depth,duplicates:i,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:a.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:a.plainObjects,strictDepth:"boolean"==typeof t.strictDepth?!!t.strictDepth:a.strictDepth,strictMerge:"boolean"==typeof t.strictMerge?!!t.strictMerge:a.strictMerge,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:a.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof t.throwOnLimitExceeded&&t.throwOnLimitExceeded}}(e);if(""===t||null==t)return i.plainObjects?{__proto__:null}:{};for(var c="string"==typeof t?function(t,e){var i={__proto__:null},d=e.ignoreQueryPrefix?t.replace(/^\?/,""):t;d=d.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var c=e.parameterLimit===1/0?void 0:e.parameterLimit,p=d.split(e.delimiter,e.throwOnLimitExceeded?c+1:c);if(e.throwOnLimitExceeded&&p.length>c)throw new RangeError("Parameter limit exceeded. Only "+c+" parameter"+(1===c?"":"s")+" allowed.");var h,u=-1,m=e.charset;if(e.charsetSentinel)for(h=0;h<p.length;++h)0===p[h].indexOf("utf8=")&&("utf8=%E2%9C%93"===p[h]?m="utf-8":"utf8=%26%2310003%3B"===p[h]&&(m="iso-8859-1"),u=h,h=p.length);for(h=0;h<p.length;++h)if(h!==u){var g,f,v=p[h],b=v.indexOf("]="),y=-1===b?v.indexOf("="):b+1;if(-1===y?(g=e.decoder(v,a.decoder,m,"key"),f=e.strictNullHandling?null:""):null!==(g=e.decoder(v.slice(0,y),a.decoder,m,"key"))&&(f=n.maybeMap(l(v.slice(y+1),e,r(i[g])?i[g].length:0),function(t){return e.decoder(t,a.decoder,m,"value")})),f&&e.interpretNumericEntities&&"iso-8859-1"===m&&(f=s(String(f))),v.indexOf("[]=")>-1&&(f=r(f)?[f]:f),e.comma&&r(f)&&f.length>e.arrayLimit){if(e.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(1===e.arrayLimit?"":"s")+" allowed in an array.");f=n.combine([],f,e.arrayLimit,e.plainObjects)}if(null!==g){var w=o.call(i,g);w&&("combine"===e.duplicates||v.indexOf("[]=")>-1)?i[g]=n.combine(i[g],f,e.arrayLimit,e.plainObjects):w&&"last"!==e.duplicates||(i[g]=f)}}return i}(t,i):t,p=i.plainObjects?{__proto__:null}:{},h=Object.keys(c),u=0;u<h.length;++u){var m=h[u],g=d(m,c[m],i,"string"==typeof t);p=n.merge(p,g,i)}return!0===i.allowSparse?p:n.compact(p)}},{"./utils":109}],108:[function(t,e,i){var n=t("side-channel"),o=t("./utils"),r=t("./formats"),a=Object.prototype.hasOwnProperty,s={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},l=Array.isArray,d=Array.prototype.push,c=function(t,e){d.apply(t,l(e)?e:[e])},p=Date.prototype.toISOString,h=r.default,u={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:o.encode,encodeValuesOnly:!1,filter:void 0,format:h,formatter:r.formatters[h],indices:!1,serializeDate:function(t){return p.call(t)},skipNulls:!1,strictNullHandling:!1},m={},g=function t(e,i,r,a,s,d,p,h,g,f,v,b,y,w,C,x,R,_){for(var D,E=e,A=_,T=0,S=!1;void 0!==(A=A.get(m))&&!S;){var P=A.get(e);if(T+=1,void 0!==P){if(P===T)throw new RangeError("Cyclic object value");S=!0}void 0===A.get(m)&&(T=0)}if("function"==typeof f?E=f(i,E):E instanceof Date?E=y(E):"comma"===r&&l(E)&&(E=o.maybeMap(E,function(t){return t instanceof Date?y(t):t})),null===E){if(d)return g&&!x?g(i,u.encoder,R,"key",w):i;E=""}if("string"==typeof(D=E)||"number"==typeof D||"boolean"==typeof D||"symbol"==typeof D||"bigint"==typeof D||o.isBuffer(E))return g?[C(x?i:g(i,u.encoder,R,"key",w))+"="+C(g(E,u.encoder,R,"value",w))]:[C(i)+"="+C(String(E))];var k,F=[];if(void 0===E)return F;if("comma"===r&&l(E))x&&g&&(E=o.maybeMap(E,g)),k=[{value:E.length>0?E.join(",")||null:void 0}];else if(l(f))k=f;else{var I=Object.keys(E);k=v?I.sort(v):I}var L=h?String(i).replace(/\./g,"%2E"):String(i),M=a&&l(E)&&1===E.length?L+"[]":L;if(s&&l(E)&&0===E.length)return M+"[]";for(var B=0;B<k.length;++B){var H=k[B],V="object"==typeof H&&H&&void 0!==H.value?H.value:E[H];if(!p||null!==V){var O=b&&h?String(H).replace(/\./g,"%2E"):String(H),N=l(E)?"function"==typeof r?r(M,O):M:M+(b?"."+O:"["+O+"]");_.set(e,T);var z=n();z.set(m,_),c(F,t(V,N,r,a,s,d,p,h,"comma"===r&&x&&l(E)?null:g,f,v,b,y,w,C,x,R,z))}}return F};e.exports=function(t,e){var i,o=t,d=function(t){if(!t)return u;if(void 0!==t.allowEmptyArrays&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==t.encodeDotInKeys&&"boolean"!=typeof t.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||u.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=r.default;if(void 0!==t.format){if(!a.call(r.formatters,t.format))throw new TypeError("Unknown format option provided.");i=t.format}var n,o=r.formatters[i],d=u.filter;if(("function"==typeof t.filter||l(t.filter))&&(d=t.filter),n=t.arrayFormat in s?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":u.arrayFormat,"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=void 0===t.allowDots?!0===t.encodeDotInKeys||u.allowDots:!!t.allowDots;return{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:u.addQueryPrefix,allowDots:c,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:u.allowEmptyArrays,arrayFormat:n,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:u.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:void 0===t.delimiter?u.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:u.encode,encodeDotInKeys:"boolean"==typeof t.encodeDotInKeys?t.encodeDotInKeys:u.encodeDotInKeys,encoder:"function"==typeof t.encoder?t.encoder:u.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:u.encodeValuesOnly,filter:d,format:i,formatter:o,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:u.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:u.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:u.strictNullHandling}}(e);"function"==typeof d.filter?o=(0,d.filter)("",o):l(d.filter)&&(i=d.filter);var p=[];if("object"!=typeof o||null===o)return"";var h=s[d.arrayFormat],m="comma"===h&&d.commaRoundTrip;i||(i=Object.keys(o)),d.sort&&i.sort(d.sort);for(var f=n(),v=0;v<i.length;++v){var b=i[v],y=o[b];d.skipNulls&&null===y||c(p,g(y,b,h,m,d.allowEmptyArrays,d.strictNullHandling,d.skipNulls,d.encodeDotInKeys,d.encode?d.encoder:null,d.filter,d.sort,d.allowDots,d.serializeDate,d.format,d.formatter,d.encodeValuesOnly,d.charset,f))}var w=p.join(d.delimiter),C=!0===d.addQueryPrefix?"?":"";return d.charsetSentinel&&("iso-8859-1"===d.charset?C+="utf8=%26%2310003%3B&":C+="utf8=%E2%9C%93&"),w.length>0?C+w:""}},{"./formats":105,"./utils":109,"side-channel":126}],109:[function(t,e,i){var n=t("./formats"),o=t("side-channel"),r=Object.prototype.hasOwnProperty,a=Array.isArray,s=o(),l=function(t,e){return s.set(t,e),t},d=function(t){return s.has(t)},c=function(t){return s.get(t)},p=function(t,e){s.set(t,e)},h=function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t}(),u=function(t,e){for(var i=e&&e.plainObjects?{__proto__:null}:{},n=0;n<t.length;++n)void 0!==t[n]&&(i[n]=t[n]);return i},m=1024;e.exports={arrayToObject:u,assign:function(t,e){return Object.keys(e).reduce(function(t,i){return t[i]=e[i],t},t)},combine:function(t,e,i,n){if(d(t)){var o=c(t)+1;return t[o]=e,p(t,o),t}var r=[].concat(t,e);return r.length>i?l(u(r,{plainObjects:n}),r.length-1):r},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],i=[],n=0;n<e.length;++n)for(var o=e[n],r=o.obj[o.prop],s=Object.keys(r),l=0;l<s.length;++l){var d=s[l],c=r[d];"object"==typeof c&&null!==c&&-1===i.indexOf(c)&&(e[e.length]={obj:r,prop:d},i[i.length]=c)}return function(t){for(;t.length>1;){var e=t.pop(),i=e.obj[e.prop];if(a(i)){for(var n=[],o=0;o<i.length;++o)void 0!==i[o]&&(n[n.length]=i[o]);e.obj[e.prop]=n}}}(e),t},decode:function(t,e,i){var n=t.replace(/\+/g," ");if("iso-8859-1"===i)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(t){return n}},encode:function(t,e,i,o,r){if(0===t.length)return t;var a=t;if("symbol"==typeof t?a=Symbol.prototype.toString.call(t):"string"!=typeof t&&(a=String(t)),"iso-8859-1"===i)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"});for(var s="",l=0;l<a.length;l+=m){for(var d=a.length>=m?a.slice(l,l+m):a,c=[],p=0;p<d.length;++p){var u=d.charCodeAt(p);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||r===n.RFC1738&&(40===u||41===u)?c[c.length]=d.charAt(p):u<128?c[c.length]=h[u]:u<2048?c[c.length]=h[192|u>>6]+h[128|63&u]:u<55296||u>=57344?c[c.length]=h[224|u>>12]+h[128|u>>6&63]+h[128|63&u]:(p+=1,u=65536+((1023&u)<<10|1023&d.charCodeAt(p)),c[c.length]=h[240|u>>18]+h[128|u>>12&63]+h[128|u>>6&63]+h[128|63&u])}s+=c.join("")}return s},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isOverflow:d,isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},markOverflow:l,maybeMap:function(t,e){if(a(t)){for(var i=[],n=0;n<t.length;n+=1)i[i.length]=e(t[n]);return i}return e(t)},merge:function t(e,i,n){if(!i)return e;if("object"!=typeof i&&"function"!=typeof i){if(a(e)){var o=e.length;if(n&&"number"==typeof n.arrayLimit&&o>n.arrayLimit)return l(u(e.concat(i),n),o);e[o]=i}else{if(!e||"object"!=typeof e)return[e,i];if(d(e)){var s=c(e)+1;e[s]=i,p(e,s)}else{if(n&&n.strictMerge)return[e,i];(n&&(n.plainObjects||n.allowPrototypes)||!r.call(Object.prototype,i))&&(e[i]=!0)}}return e}if(!e||"object"!=typeof e){if(d(i)){for(var h=Object.keys(i),m=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},g=0;g<h.length;g++){m[parseInt(h[g],10)+1]=i[h[g]]}return l(m,c(i)+1)}var f=[e].concat(i);return n&&"number"==typeof n.arrayLimit&&f.length>n.arrayLimit?l(u(f,n),f.length-1):f}var v=e;return a(e)&&!a(i)&&(v=u(e,n)),a(e)&&a(i)?(i.forEach(function(i,o){if(r.call(e,o)){var a=e[o];a&&"object"==typeof a&&i&&"object"==typeof i?e[o]=t(a,i,n):e[e.length]=i}else e[o]=i}),e):Object.keys(i).reduce(function(e,o){var a=i[o];if(r.call(e,o)?e[o]=t(e[o],a,n):e[o]=a,d(i)&&!d(e)&&l(e,c(i)),d(e)){var s=parseInt(o,10);String(s)===o&&s>=0&&s>c(e)&&p(e,s)}return e},v)}}},{"./formats":105,"side-channel":126}],110:[function(t,e,i){e.exports={Name:"Retold Content Editor",Hash:"ContentEditor",MainViewportViewIdentifier:"ContentEditor-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1,pict_configuration:{Product:"ContentEditor-Pict-Application"}}},{}],111:[function(t,e,i){const n=t("pict-application"),o=t("pict-section-filebrowser"),r=t("pict-provider-vocabulary"),a=t("pict-section-inlinedocumentation"),s=t("pict-section-modal"),l=t("pict-section-content"),d=t("./providers/Pict-Provider-ContentEditor.js"),c=t("./views/PictView-Editor-Layout.js"),p=t("./views/PictView-Editor-TopBar.js"),h=t("./views/PictView-Editor-MarkdownEditor.js"),u=t("./views/PictView-Editor-CodeEditor.js"),m=t("./views/PictView-Editor-SettingsPanel.js"),g=t("./views/PictView-Editor-MarkdownReference.js"),f=t("./views/PictView-Editor-Topics.js");e.exports=class extends n{constructor(t,e,i){super(t,e,i),this.pict.addProvider("ContentEditor-Provider",d.default_configuration,d),this.pict.addProvider("Vocabulary",r.default_configuration,r);let n=this.pict;this.pict.addView("ContentEditor-Vocabulary",Object.assign({},r.VocabularyManagerView.default_configuration,{DefaultDestinationAddress:"#ContentEditor-Vocabulary-Container",VocabularyRoute:"#/vocabulary",VocabularyFolderPath:"vocabulary/",onEditTerm:function(t,e){n&&n.PictApplication&&"function"==typeof n.PictApplication.navigateToFile&&n.PictApplication.navigateToFile(e)}}),r.VocabularyManagerView),this.pict.addProvider("Pict-InlineDocumentation",a.default_configuration,a),this.pict.addProvider("Pict-Content",l.PictContentProvider.default_configuration,l.PictContentProvider),this.pict.addView("Pict-Section-Modal",s.default_configuration,s),this.pict.addView("ContentEditor-Layout",c.default_configuration,c),this.pict.addView("ContentEditor-TopBar",p.default_configuration,p),this.pict.addView("ContentEditor-MarkdownEditor",h.default_configuration,h),this.pict.addView("ContentEditor-CodeEditor",u.default_configuration,u),this.pict.addView("ContentEditor-SettingsPanel",m.default_configuration,m),this.pict.addView("ContentEditor-MarkdownReference",g.default_configuration,g),this.pict.addView("ContentEditor-Topics",f.default_configuration,f);let v=JSON.parse(JSON.stringify(o.default_configuration));v.DefaultDestinationAddress="#ContentEditor-Sidebar-Container",v.DefaultState.Layout="list-only",this.pict.addView("Pict-FileBrowser",v,o);let b=JSON.parse(JSON.stringify(o.PictViewListDetail.default_configuration));for(let t=0;t<b.Templates.length;t++)"FileBrowser-ListDetail-Container-Template"===b.Templates[t].Hash&&(b.Templates[t].Template='\n<div class="pict-fb-detail" id="Pict-FileBrowser-DetailList">\n\t<div class="pict-fb-breadcrumb-bar">\n\t\t<div class="pict-fb-breadcrumb" id="Pict-FileBrowser-Breadcrumb"></div>\n\t\t<button class="pict-fb-breadcrumb-addfolder" onclick="pict.PictApplication.promptNewFolder()" title="New folder">+</button>\n\t</div>\n\t<div class="pict-fb-detail-header">\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-name" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Name\')">Name</div>\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-size" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Size\')">Size</div>\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-modified" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Modified\')">Modified</div>\n\t</div>\n\t<div id="Pict-FileBrowser-DetailRows"></div>\n</div>\n'),"FileBrowser-ListDetail-Row-Template"===b.Templates[t].Hash&&(b.Templates[t].Template='\n<div class="pict-fb-detail-row{~D:Record.SelectedClass~}" data-index="{~D:Record.Index~}" data-name="{~D:Record.Name~}" onclick="{~D:Record.ClickHandler~}" ondblclick="{~D:Record.DblClickHandler~}">\n\t<span class="pict-fb-detail-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-detail-name">{~D:Record.Name~}</span>\n\t<span class="pict-fb-detail-size">{~D:Record.SizeFormatted~}</span>\n\t<span class="pict-fb-detail-modified">{~D:Record.ModifiedFormatted~}</span>\n\t<button class="pict-fb-insert-btn" onclick="event.stopPropagation(); pict.PictApplication.insertFileReference(this.parentElement.getAttribute(\'data-name\'))" title="Insert into editor">+</button>\n</div>\n');this.pict.addView("Pict-FileBrowser-ListDetail",b,o.PictViewListDetail)}onAfterInitializeAsync(t){if("undefined"!=typeof window){window.pict=this.pict;let t=this.pict;window.addEventListener("beforeunload",function(e){t.AppData.ContentEditor&&t.AppData.ContentEditor.IsDirty&&(e.preventDefault(),e.returnValue="")})}this.pict.AppData.ContentEditor={CurrentFile:"",ActiveEditor:"markdown",IsDirty:!1,IsSaving:!1,IsLoading:!1,Files:[],Document:{Segments:[{Content:""}]},CodeContent:"",SaveStatus:"",SaveStatusClass:"",AutoSegmentMarkdown:!1,AutoSegmentDepth:1,ContentPreviewMode:"off",MarkdownEditingControls:!0,MarkdownWordWrap:!0,CodeWordWrap:!1,SidebarCollapsed:!1,SidebarWidth:250,AutoPreviewImages:!0,AutoPreviewVideo:!1,AutoPreviewAudio:!1,ShowHiddenFiles:!1,TopicsFilePath:".pict_documentation_topics.json"},this._loadSettings(),this.pict.views["ContentEditor-Layout"].render();let e=this,i=this.pict.providers["Pict-FileBrowser-List"];if(i){let t=i.selectFile.bind(i);i.selectFile=function(i){t(i),i&&"file"===i.Type&&e.navigateToFile(i.Path)}}let n=this.pict.providers["Pict-FileBrowser-Browse"];if(n){let t=n.navigateToFolder.bind(n);n.navigateToFolder=function(i){t(i),e.loadFileList(i)}}this.syncHiddenFilesSetting(()=>{e.loadFileList(null,()=>{e.resolveHash()})});let o=this.pict.AppData.ContentEditor.TopicsFilePath;if(o){let t=this.pict.views["ContentEditor-Topics"];t&&t.loadTopicsFile(o,()=>{})}let r=this.pict.providers&&this.pict.providers.Vocabulary;r&&r.loadFromURL("/api/vocabulary/index");let a=this.pict.providers&&this.pict.providers["Pict-InlineDocumentation"];if(a&&"function"==typeof a.initializeDocumentation){let t=this;a.initializeDocumentation({DocsBaseURL:"/content/",ContainerAddress:"#ContentEditor-Documentation-Panel",SearchIndexURL:"/content/retold-keyword-index.json",ExternalDocBaseURL:"https://stevenvelozo.github.io/retold/#/doc/",EditEnabled:!1,TopicManagerEnabled:!1},function(){let e=t.pict.views["Pict-Section-Modal"];e&&"function"==typeof e.panel&&(t._docPanel=e.panel("#ContentEditor-Documentation-Panel",{position:"right",width:340,minWidth:260,maxWidth:600,collapsible:!0,collapsed:!0,persist:!0,persistKey:"ContentEditor-DocPanel"}));let i=t.pict.providers["Pict-InlineDocumentation"];if(i&&"function"==typeof i.loadDocument){let t="README.md";try{let e=localStorage.getItem("ContentEditor-DocPanel-LastDoc");e&&(t=e)}catch(t){}i.loadDocument(t);let e=i.loadDocument.bind(i);i.loadDocument=function(t,i){try{localStorage.setItem("ContentEditor-DocPanel-LastDoc",t)}catch(t){}return e(t,i)}}})}return super.onAfterInitializeAsync(t)}syncHiddenFilesSetting(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.ContentEditor.ShowHiddenFiles;fetch("/api/filebrowser/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({IncludeHiddenFiles:!!i})}).then(()=>e()).catch(()=>e())}loadFileList(t,e){let i="function"==typeof e?e:"function"==typeof t?t:()=>{},n=this,o="string"==typeof t?t:null;null===o&&this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(o=this.pict.AppData.PictFileBrowser.CurrentLocation);let r="/api/filebrowser/list";o&&o.length>0&&(r+="?path="+encodeURIComponent(o)),fetch(r).then(t=>t.json()).then(t=>{n.pict.AppData.PictFileBrowser=n.pict.AppData.PictFileBrowser||{},n.pict.AppData.PictFileBrowser.FileList=t||[];let e=n.pict.views["Pict-FileBrowser"];e&&e.render();let o=n.pict.views["Pict-FileBrowser-ListDetail"];return o&&o.render(),i()}).catch(t=>(n.log.error(`Failed to load file list: ${t.message}`),i()))}resolveHash(){let t=(window.location.hash||"").replace(/^#\/?/,"");if(!t)return;let e=t.split("/");if("edit"===e[0]&&e.length>=2){let t=e.slice(1).join("/");if(this.pict.AppData.ContentEditor.CurrentFile===t)return;this.navigateToFile(t)}}getEditorTypeForFile(t){if(!t)return"markdown";let e=t.replace(/^.*\./,"").toLowerCase();if("md"===e||"markdown"===e)return"markdown";return{png:!0,jpg:!0,jpeg:!0,gif:!0,bmp:!0,webp:!0,ico:!0,svg:!0,tiff:!0,tif:!0,avif:!0,heic:!0,heif:!0,mp3:!0,wav:!0,ogg:!0,flac:!0,aac:!0,m4a:!0,wma:!0,mp4:!0,avi:!0,mkv:!0,mov:!0,wmv:!0,webm:!0,flv:!0,m4v:!0,pdf:!0,doc:!0,docx:!0,xls:!0,xlsx:!0,ppt:!0,pptx:!0,odt:!0,ods:!0,odp:!0,zip:!0,tar:!0,gz:!0,bz2:!0,xz:!0,"7z":!0,rar:!0,ttf:!0,otf:!0,woff:!0,woff2:!0,eot:!0,exe:!0,dll:!0,so:!0,dylib:!0,o:!0,class:!0,pyc:!0,wasm:!0}[e]?"binary":"code"}_cleanupEditors(){let t=this.pict.views["ContentEditor-CodeEditor"];t&&(t.codeJar&&t.destroy(),t.initialRenderComplete=!1);let e=this.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");e&&e[0]&&(e[0].innerHTML="")}_formatFileSize(t){if(0===t)return"0 B";let e=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(t)/Math.log(1024));return i>=e.length&&(i=e.length-1),(t/Math.pow(1024,i)).toFixed(0===i?0:1)+" "+e[i]}_getMediaType(t){return{png:!0,jpg:!0,jpeg:!0,gif:!0,webp:!0,svg:!0,bmp:!0,ico:!0,avif:!0}[t]?"image":{mp4:!0,webm:!0,mov:!0,mkv:!0,avi:!0,wmv:!0,flv:!0,m4v:!0,ogv:!0}[t]?"video":{mp3:!0,wav:!0,ogg:!0,flac:!0,aac:!0,m4a:!0,wma:!0,oga:!0}[t]?"audio":"other"}_buildMediaPreviewHTML(t,e,i){return"image"===t?'<div class="binary-preview-image-wrap"><div class="binary-preview-image"><img src="'+e+'" alt="'+i+'"></div></div>':"video"===t?'<div class="binary-preview-media-wrap"><video class="binary-preview-video" controls preload="metadata"><source src="'+e+'">Your browser does not support the video tag.</video></div>':"audio"===t?'<div class="binary-preview-media-wrap"><audio class="binary-preview-audio" controls preload="metadata"><source src="'+e+'">Your browser does not support the audio tag.</audio></div>':""}loadMediaPreview(t,e,i){let n=this.pict.ContentAssignment.getElement("#ContentEditor-MediaPreviewPlaceholder")[0];n&&(n.innerHTML=this._buildMediaPreviewHTML(t,e,i))}_showBinaryPreview(t){let e=this,i=t.replace(/^.*\//,""),n=t.replace(/^.*\./,"").toLowerCase(),o="/content/"+encodeURIComponent(t),r=this._getMediaType(n),a=this.pict.AppData.ContentEditor,s=!1;"image"===r&&(s=a.AutoPreviewImages),"video"===r&&(s=a.AutoPreviewVideo),"audio"===r&&(s=a.AutoPreviewAudio),fetch("/api/filebrowser/info?path="+encodeURIComponent(t)).then(t=>t.json()).then(t=>{let a=t&&"number"==typeof t.Size?e._formatFileSize(t.Size):"Unknown",l=t&&t.Modified?new Date(t.Modified).toLocaleString():"Unknown",d=e.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");if(!d||!d[0])return;let c="";"other"!==r&&(s?c+=e._buildMediaPreviewHTML(r,o,i):(c+='<div id="ContentEditor-MediaPreviewPlaceholder">',c+='<button class="binary-preview-btn binary-preview-btn-preview"',c+=' onclick="pict.PictApplication.loadMediaPreview(',c+="'"+r+"','"+o+"','"+i.replace(/'/g,"\\'")+"'",c+=')">Preview '+r.charAt(0).toUpperCase()+r.slice(1)+"</button>",c+="</div>")),c+='<div class="binary-preview-card">',c+='<div class="binary-preview-icon">'+n.toUpperCase()+"</div>",c+='<div class="binary-preview-info">',c+='<div class="binary-preview-name">'+i+"</div>",c+='<div class="binary-preview-meta">Size: '+a+"</div>",c+='<div class="binary-preview-meta">Modified: '+l+"</div>",c+='<div class="binary-preview-meta">Type: .'+n+"</div>",c+="</div>",c+='<div class="binary-preview-actions">',c+='<a class="binary-preview-btn" href="'+o+'" download="'+i+'">Download</a>',c+='<a class="binary-preview-btn binary-preview-btn-secondary" href="'+o+'" target="_blank">Open in New Tab</a>',c+="</div>",c+="</div>",d[0].innerHTML=c}).catch(()=>{let t=e.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");t&&t[0]&&(t[0].innerHTML='<div class="binary-preview-card"><div class="binary-preview-icon">'+n.toUpperCase()+'</div><div class="binary-preview-info"><div class="binary-preview-name">'+i+'</div><div class="binary-preview-meta">Binary file — cannot be edited in the browser</div></div><div class="binary-preview-actions"><a class="binary-preview-btn" href="'+o+'" download="'+i+'">Download</a><a class="binary-preview-btn binary-preview-btn-secondary" href="'+o+'" target="_blank">Open in New Tab</a></div></div>')})}segmentMarkdownContent(t){let e=this.pict.AppData.ContentEditor;if(!e.AutoSegmentMarkdown||!t)return[{Content:t||""}];let i=parseInt(e.AutoSegmentDepth,10)||1;if(1===i){let e=t.split("\n"),i=[],n=[],o=!1;for(let t=0;t<e.length;t++){let r=e[t];/^(`{3,}|~{3,})/.test(r.trim())?(o=!o,n.push(r)):o||""!==r.trim()?n.push(r):n.length>0&&(i.push({Content:n.join("\n")}),n=[])}return n.length>0&&i.push({Content:n.join("\n")}),i.length>0?i:[{Content:""}]}let n=new RegExp("^(#{1,"+i+"})\\s"),o=t.split("\n"),r=[],a=[];for(let t=0;t<o.length;t++){let e=o[t];n.test(e.trim())&&a.length>0&&(r.push({Content:a.join("\n")}),a=[]),a.push(e)}return a.length>0&&r.push({Content:a.join("\n")}),r.length>0?r:[{Content:""}]}navigateToFile(t){if(!t)return;if(this.pict.AppData.ContentEditor.IsDirty){let e=this,i=this.pict.views["Pict-Section-Modal"];if(i&&"function"==typeof i.confirm)return void i.confirm("You have unsaved changes to "+this.pict.AppData.ContentEditor.CurrentFile+". Discard and open a different file?",{title:"Unsaved Changes",confirmLabel:"Discard",dangerous:!0}).then(function(i){i&&(e.pict.AppData.ContentEditor.IsDirty=!1,e.navigateToFile(t))});if("undefined"!=typeof confirm&&!confirm("You have unsaved changes. Discard and open a different file?"))return;this.pict.AppData.ContentEditor.IsDirty=!1}let e=this,i=this.getEditorTypeForFile(t);if(this.pict.AppData.ContentEditor.SaveStatus="",this.pict.AppData.ContentEditor.SaveStatusClass="",window.location.hash="#/edit/"+t,this.pict.AppData.ContentEditor.CurrentFile=t,this.pict.AppData.ContentEditor.IsDirty=!1,this.pict.AppData.ContentEditor.ActiveEditor=i,this._cleanupEditors(),this.pict.views["ContentEditor-TopBar"].render(),"binary"===i)return this._showBinaryPreview(t),void this.updateStats();let n=this.pict.providers["ContentEditor-Provider"];this.pict.AppData.ContentEditor.IsLoading=!0,n.loadFile(t,(n,o)=>{if(e.pict.AppData.ContentEditor.IsLoading=!1,n)return e.pict.AppData.ContentEditor.SaveStatus="Error loading file: "+n,e.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-error",void e.pict.views["ContentEditor-TopBar"].render();if("markdown"===i){e.pict.AppData.ContentEditor.Document.Segments=e.segmentMarkdownContent(o);let i=e.pict.views["ContentEditor-MarkdownEditor"];if(i){let n="/content/",o=t.lastIndexOf("/");o>0&&(n="/content/"+t.substring(0,o)+"/"),i.options.ImageBaseURL=n,i.render(),i.marshalToView(),i.setPreviewMode(e.pict.AppData.ContentEditor.ContentPreviewMode||"off"),i.toggleControls(e.pict.AppData.ContentEditor.MarkdownEditingControls)}e.updateStats()}else{e.pict.AppData.ContentEditor.CodeContent=o;let i=t.replace(/^.*\./,"").toLowerCase(),n=u.getLanguageForExtension?u.getLanguageForExtension(i):u.ExtensionLanguageMap[i]||"plaintext",r=e.pict.views["ContentEditor-CodeEditor"];r&&(r.initialRenderComplete=!1,r._language=n,r._suppressNextDirty=!0,r.render(),r.marshalToView(),e.pict.AppData.ContentEditor.CodeWordWrap&&r._editorElement&&(r._editorElement.style.whiteSpace="pre-wrap",r._editorElement.style.overflowWrap="break-word")),e.updateStats()}})}saveCurrentFile(){let t=this.pict.AppData.ContentEditor.CurrentFile;if(!t)return;let e=this.pict.providers["ContentEditor-Provider"],i=this,n="";if("code"===this.pict.AppData.ContentEditor.ActiveEditor){let t=this.pict.views["ContentEditor-CodeEditor"];t&&t.marshalFromView(),n=this.pict.AppData.ContentEditor.CodeContent||""}else{let t=this.pict.views["ContentEditor-MarkdownEditor"];t&&t.marshalFromView();let e=this.pict.AppData.ContentEditor.Document.Segments;if(e&&e.length>0){let t=[];for(let i=0;i<e.length;i++)t.push(e[i].Content||"");n=t.join("\n\n")}}this.pict.AppData.ContentEditor.IsSaving=!0,this.pict.AppData.ContentEditor.SaveStatus="Saving...",this.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-saving",this.pict.views["ContentEditor-TopBar"].render(),e.saveFile(t,n,t=>{i.pict.AppData.ContentEditor.IsSaving=!1,t?(i.pict.AppData.ContentEditor.SaveStatus="Error: "+t,i.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-error"):(i.pict.AppData.ContentEditor.IsDirty=!1,i.pict.AppData.ContentEditor.SaveStatus="Saved",i.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-saved",i.loadFileList(),setTimeout(()=>{"Saved"===i.pict.AppData.ContentEditor.SaveStatus&&(i.pict.AppData.ContentEditor.SaveStatus="",i.pict.AppData.ContentEditor.SaveStatusClass="",i.pict.views["ContentEditor-TopBar"].render())},3e3)),i.pict.views["ContentEditor-TopBar"].render()})}closeCurrentFile(){this.pict.AppData.ContentEditor.CurrentFile&&(this.pict.AppData.ContentEditor.IsDirty?this._showCloseConfirmation():this._doCloseFile())}_doCloseFile(){this._hideCloseConfirmation(),this._cleanupEditors(),this.pict.AppData.ContentEditor.CurrentFile="",this.pict.AppData.ContentEditor.ActiveEditor="markdown",this.pict.AppData.ContentEditor.IsDirty=!1,this.pict.AppData.ContentEditor.SaveStatus="",this.pict.AppData.ContentEditor.SaveStatusClass="",this.pict.AppData.ContentEditor.Document.Segments=[{Content:""}],this.pict.AppData.ContentEditor.CodeContent="",window.location.hash="",this.pict.views["ContentEditor-TopBar"].render();let t=this.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");t&&t[0]&&(t[0].innerHTML='<div style="display:flex;align-items:center;justify-content:center;height:100%;color:#8A7F72;font-size:1.1em;">Select a file from the sidebar to begin editing</div>'),this.updateStats()}confirmCloseFile(){this._doCloseFile()}cancelCloseFile(){this._hideCloseConfirmation()}_showCloseConfirmation(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-ConfirmOverlay")[0];if(t&&t.classList.add("open"),!this._confirmKeyHandler){let t=this;this._confirmKeyHandler=e=>{let i=e.key.toLowerCase();"y"===i?(e.preventDefault(),t.confirmCloseFile()):"n"!==i&&"Escape"!==e.key||(e.preventDefault(),t.cancelCloseFile())}}window.addEventListener("keydown",this._confirmKeyHandler)}_hideCloseConfirmation(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-ConfirmOverlay")[0];t&&t.classList.remove("open"),this._confirmKeyHandler&&window.removeEventListener("keydown",this._confirmKeyHandler)}createNewFile(t){if(!t)return;t.replace(/^.*\//,"").indexOf(".")<0&&(t+=".md");let e=this.pict.providers["ContentEditor-Provider"],i=this,n="";n=t.endsWith(".md")?"# "+t.replace(/\.[^.]+$/,"").replace(/^.*\//,"")+"\n\n":"// "+t.replace(/^.*\//,"")+"\n",e.saveFile(t,n,e=>{e||i.loadFileList(null,()=>{i.navigateToFile(t)})})}promptNewFile(){let t=prompt("Enter a name for the new file (e.g. my-page.md, script.js, style.css):");t&&t.trim()&&this.createNewFile(t.trim())}promptNewFolder(){let t=prompt("Enter a name for the new folder:");if(!t||!t.trim())return;t=t.trim();let e="";this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(e=this.pict.AppData.PictFileBrowser.CurrentLocation);let i=e?e+"/"+t:t,n=this;fetch("/api/content/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({Path:i})}).then(t=>t.json()).then(t=>{t&&t.Success?(n.log.info(`Folder created: ${i}`),n.loadFileList()):alert("Could not create folder: "+(t?t.Error:"Unknown error"))}).catch(t=>{alert("Error creating folder: "+t.message)})}insertFileReference(t){if(!t)return;let e=this.pict.views["ContentEditor-MarkdownEditor"];if(!e||"markdown"!==this.pict.AppData.ContentEditor.ActiveEditor)return;let i=e._activeSegmentIndex;if(i<0){let t=e._getOrderedSegmentIndices();t.length>0&&(i=t[0])}if(i<0)return;let n=t.replace(/\.[^.]+$/,"");n=n.replace(/^\d{10,}-/,""),n=n.replace(/[-_]+/g," ").trim()||"image";let o=t.substring(t.lastIndexOf(".")).toLowerCase();if([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".avif",".apng",".ico",".tiff",".tif",".jfif"].indexOf(o)>=0)e._insertImageMarkdown(i,t,n);else{let o=e._segmentEditors[i];if(o){let e="["+n+"]("+t+")",i=o.state.selection.main.head;o.dispatch({changes:{from:i,insert:e},selection:{anchor:i+e.length}}),o.focus()}}}handleF4TopicAction(){let t=this.pict.views["ContentEditor-Layout"],e=this.pict.views["ContentEditor-Topics"];if(!t||!e)return;let i=this.pict.AppData.ContentEditor,n=i.ActiveEditor,o=i.CurrentFile,r=0,a=!1;if("markdown"===n&&o){let t=this.pict.views["ContentEditor-MarkdownEditor"];if(t&&t._segmentEditors){let e=0;for(let i in t._segmentEditors){let n=t._segmentEditors[i];if(n&&n.hasFocus){let t=n.state.selection.main.head;r=e+n.state.doc.lineAt(t).number,a=!0;break}n&&n.state&&(e+=n.state.doc.lines)}}}if(i.SidebarCollapsed&&t.toggleSidebar(),t.switchSidebarTab("topics"),a&&o){let t={TopicCode:"New-Topic",TopicHelpFilePath:o,TopicTitle:this._extractFirstHeading()||"New Topic"};r>0&&(t.RelevantMarkdownLine=r),e.addTopic(t)}}_extractFirstHeading(){let t=this.pict.views["ContentEditor-MarkdownEditor"];if(!t||!t._segmentEditors)return"";let e=7,i="";for(let n in t._segmentEditors){let o=t._segmentEditors[n];if(!o||!o.state||!o.state.doc)continue;let r=o.state.doc;for(let t=1;t<=r.lines;t++){let n=r.line(t).text.match(/^(#{1,6})\s+(.+)/);if(n){let t=n[1].length;if(t<e&&(e=t,i=n[2].trim(),1===e))return i}}}return i}updateStats(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-Stats")[0];if(!t)return;let e=this.pict.AppData.ContentEditor.ActiveEditor,i=0,n=0,o=0;if("markdown"===e){let t=this.pict.views["ContentEditor-MarkdownEditor"];if(t&&t._segmentEditors)for(let e in t._segmentEditors){let r=t._segmentEditors[e];if(r&&r.state&&r.state.doc){i+=r.state.doc.lines,n+=r.state.doc.length;let t=r.state.doc.toString().match(/\S+/g);t&&(o+=t.length)}}}else{if("code"!==e)return void(t.textContent="");{let t=this.pict.views["ContentEditor-CodeEditor"];if(t&&t.codeJar){let e=t.codeJar.toString();n=e.length,i=e.split("\n").length;let r=e.match(/\S+/g);r&&(o=r.length)}}}t.textContent=i+" lines · "+o+" words · "+n+" chars"}markDirty(){this.pict.AppData.ContentEditor.IsDirty||(this.pict.AppData.ContentEditor.IsDirty=!0,this.pict.views["ContentEditor-TopBar"].render())}get _settingsKey(){return"retold-content-editor-settings"}saveSettings(){if("undefined"==typeof window||!window.localStorage)return;let t=this.pict.AppData.ContentEditor,e={AutoSegmentMarkdown:t.AutoSegmentMarkdown,AutoSegmentDepth:t.AutoSegmentDepth,ContentPreviewMode:t.ContentPreviewMode,MarkdownEditingControls:t.MarkdownEditingControls,MarkdownWordWrap:t.MarkdownWordWrap,CodeWordWrap:t.CodeWordWrap,SidebarCollapsed:t.SidebarCollapsed,SidebarWidth:t.SidebarWidth,AutoPreviewImages:t.AutoPreviewImages,AutoPreviewVideo:t.AutoPreviewVideo,AutoPreviewAudio:t.AutoPreviewAudio,ShowHiddenFiles:t.ShowHiddenFiles,TopicsFilePath:t.TopicsFilePath};try{window.localStorage.setItem(this._settingsKey,JSON.stringify(e))}catch(t){this.log.warn("Failed to save settings: "+t.message)}}_loadSettings(){if("undefined"!=typeof window&&window.localStorage)try{let t=window.localStorage.getItem(this._settingsKey);if(!t)return;let e=JSON.parse(t),i=this.pict.AppData.ContentEditor;"boolean"==typeof e.AutoSegmentMarkdown&&(i.AutoSegmentMarkdown=e.AutoSegmentMarkdown),"number"==typeof e.AutoSegmentDepth&&(i.AutoSegmentDepth=e.AutoSegmentDepth),"string"==typeof e.ContentPreviewMode?i.ContentPreviewMode=e.ContentPreviewMode:"boolean"==typeof e.AutoContentPreview&&(i.ContentPreviewMode=e.AutoContentPreview?"bottom":"off"),"boolean"==typeof e.MarkdownEditingControls&&(i.MarkdownEditingControls=e.MarkdownEditingControls),"boolean"==typeof e.MarkdownWordWrap&&(i.MarkdownWordWrap=e.MarkdownWordWrap),"boolean"==typeof e.CodeWordWrap&&(i.CodeWordWrap=e.CodeWordWrap),"boolean"==typeof e.SidebarCollapsed&&(i.SidebarCollapsed=e.SidebarCollapsed),"number"==typeof e.SidebarWidth&&(i.SidebarWidth=e.SidebarWidth),"boolean"==typeof e.AutoPreviewImages&&(i.AutoPreviewImages=e.AutoPreviewImages),"boolean"==typeof e.AutoPreviewVideo&&(i.AutoPreviewVideo=e.AutoPreviewVideo),"boolean"==typeof e.AutoPreviewAudio&&(i.AutoPreviewAudio=e.AutoPreviewAudio),"boolean"==typeof e.ShowHiddenFiles&&(i.ShowHiddenFiles=e.ShowHiddenFiles),"string"==typeof e.TopicsFilePath&&(i.TopicsFilePath=e.TopicsFilePath)}catch(t){this.log.warn("Failed to load settings: "+t.message)}}},e.exports.default_configuration=t("./Pict-Application-ContentEditor-Configuration.json")},{"./Pict-Application-ContentEditor-Configuration.json":110,"./providers/Pict-Provider-ContentEditor.js":115,"./views/PictView-Editor-CodeEditor.js":116,"./views/PictView-Editor-Layout.js":117,"./views/PictView-Editor-MarkdownEditor.js":118,"./views/PictView-Editor-MarkdownReference.js":119,"./views/PictView-Editor-SettingsPanel.js":120,"./views/PictView-Editor-TopBar.js":121,"./views/PictView-Editor-Topics.js":122,"pict-application":44,"pict-provider-vocabulary":55,"pict-section-content":62,"pict-section-filebrowser":66,"pict-section-inlinedocumentation":80,"pict-section-modal":100}],112:[function(t,e,i){e.exports={Name:"Retold Content Reader",Hash:"ContentReader",MainViewportViewIdentifier:"Docuserve-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1,pict_configuration:{Product:"ContentReader-Pict-Application"}}},{}],113:[function(t,e,i){const n=t("pict-docuserve");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onAfterInitializeAsync(t){this.pict.AppData.Docuserve={CatalogLoaded:!1,Catalog:null,CoverLoaded:!1,Cover:null,SidebarLoaded:!1,SidebarGroups:[],TopBarLoaded:!1,TopBar:null,ErrorPageLoaded:!1,ErrorPageHTML:null,KeywordIndexLoaded:!1,KeywordDocumentCount:0,CurrentGroup:"",CurrentModule:"",CurrentPath:"",SidebarVisible:!0,DocsBaseURL:"/content/",CatalogURL:"/content/retold-catalog.json"},this.pict.providers["Docuserve-Documentation"].loadCatalog(()=>{let e=this.pict.AppData.Docuserve;return e.CoverLoaded&&e.Cover&&e.Cover.Title?document.title=e.Cover.Title.replace(/<[^>]*>/g,""):e.TopBarLoaded&&e.TopBar&&e.TopBar.Brand&&(document.title=e.TopBar.Brand.replace(/<[^>]*>/g,"")),e.TopBar?(Array.isArray(e.TopBar.ExternalLinks)||(e.TopBar.ExternalLinks=[]),e.TopBar.ExternalLinks.push({Text:"Edit",Href:"/"})):(e.TopBarLoaded=!0,e.TopBar={Brand:"Content System",NavLinks:[],ExternalLinks:[{Text:"Edit",Href:"/"}]}),this.pict.views["Docuserve-Layout"].render(),t()})}},e.exports.default_configuration=t("./Pict-Application-ContentReader-Configuration.json")},{"./Pict-Application-ContentReader-Configuration.json":112,"pict-docuserve":46}],114:[function(t,e,i){e.exports={PictContentReader:t("./Pict-Application-ContentReader.js"),PictContentEditor:t("./Pict-Application-ContentEditor.js")},"undefined"!=typeof window&&(window.PictContentReader=e.exports.PictContentReader,window.PictContentEditor=e.exports.PictContentEditor)},{"./Pict-Application-ContentEditor.js":111,"./Pict-Application-ContentReader.js":113}],115:[function(t,e,i){const n=t("pict-provider");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}loadFile(t,e){let i="function"==typeof e?e:()=>{};if(!t)return i("No file path specified","");fetch("/api/content/read/"+t.split("/").map(encodeURIComponent).join("/")).then(t=>t.ok?t.json():i("File not found: "+t.status,"")).then(t=>t&&t.Success?i(null,t.Content||""):i(t?t.Error:"Unknown error","")).catch(e=>(this.log.warn(`ContentEditor: Error loading file [${t}]: ${e}`),i(e.message,"")))}saveFile(t,e,i){let n="function"==typeof i?i:()=>{};if(!t)return n("No file path specified");fetch("/api/content/save/"+t.split("/").map(encodeURIComponent).join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({Content:e})}).then(t=>t.ok?t.json():n("Save failed: "+t.status)).then(t=>t&&t.Success?n(null):n(t?t.Error:"Unknown error")).catch(e=>(this.log.warn(`ContentEditor: Error saving file [${t}]: ${e}`),n(e.message)))}uploadImage(t,e){let i="function"==typeof e?e:()=>{},n="",o=this.pict.AppData.ContentEditor.CurrentFile;if(o){let t=o.lastIndexOf("/");t>0&&(n=o.substring(0,t))}else this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(n=this.pict.AppData.PictFileBrowser.CurrentLocation);let r={"Content-Type":t.type,"x-filename":t.name};n&&(r["x-upload-path"]=n),fetch("/api/content/upload-image",{method:"POST",body:t,headers:r}).then(t=>t.json()).then(t=>t&&t.Success&&t.URL?i(null,t.URL):i(t?t.Error:"Upload failed")).catch(t=>(this.log.warn(`ContentEditor: Image upload failed: ${t}`),i(t.message)))}},e.exports.default_configuration={ProviderIdentifier:"ContentEditor-Provider",AutoInitialize:!0,AutoInitializeOrdinal:0}},{"pict-provider":58}],116:[function(t,e,i){const n=t("pict-section-code"),o={js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",json:"json",html:"xml",htm:"xml",xml:"xml",svg:"xml",css:"css",scss:"scss",sass:"scss",less:"less",sql:"sql",py:"python",rb:"ruby",java:"java",kt:"kotlin",kts:"kotlin",go:"go",rs:"rust",c:"c",h:"c",cpp:"cpp",cc:"cpp",hpp:"cpp",cs:"csharp",swift:"swift",php:"php",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",yml:"yaml",yaml:"yaml",toml:"ini",ini:"ini",cfg:"ini",conf:"ini",dockerfile:"dockerfile",docker:"dockerfile",makefile:"makefile",mk:"makefile",md:"markdown",markdown:"markdown",lua:"lua",r:"r",pl:"perl",pm:"perl",ex:"elixir",exs:"elixir",erl:"erlang",hrl:"erlang",hs:"haskell",clj:"clojure",scala:"scala",dart:"dart",groovy:"groovy",gradle:"groovy",tf:"terraform",vim:"vim",diff:"diff",patch:"diff",log:"accesslog",txt:"plaintext"};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._suppressNextDirty=!1}onAfterInitialRender(){if("undefined"!=typeof window&&window.CodeJarModules&&window.CodeJarModules.CodeJar&&this.connectCodeJarPrototype(window.CodeJarModules.CodeJar),"undefined"!=typeof window&&window.CodeJarModules&&window.CodeJarModules.hljs){let t=window.CodeJarModules.hljs,e=this._language;this._highlightFunction=function(i){i.removeAttribute("data-highlighted"),delete i.dataset.highlighted,i.className=i.className.replace(/\bhljs\b/g,"").replace(/\blanguage-\S+/g,"").trim(),i.classList.add("hljs"),e&&"plaintext"!==e&&i.classList.add("language-"+e),t.highlightElement(i)}}return super.onAfterInitialRender()}setLanguage(t){if(this._language=t,"undefined"!=typeof window&&window.CodeJarModules&&window.CodeJarModules.hljs){let e=window.CodeJarModules.hljs,i=t;this._highlightFunction=function(t){t.removeAttribute("data-highlighted"),delete t.dataset.highlighted,t.className=t.className.replace(/\bhljs\b/g,"").replace(/\blanguage-\S+/g,"").trim(),t.classList.add("hljs"),i&&"plaintext"!==i&&t.classList.add("language-"+i),e.highlightElement(t)}}if(this._editorElement&&(this._editorElement.className="pict-code-editor language-"+t,this.options.LineNumbers||(this._editorElement.className+=" pict-code-no-line-numbers")),this.codeJar){let t=this.codeJar.toString();this.codeJar.destroy(),this.codeJar=this._codeJarPrototype(this._editorElement,this._highlightFunction,{tab:this.options.Tab,catchTab:this.options.CatchTab,addClosing:this.options.AddClosing}),this.codeJar.updateCode(t),this.codeJar.onUpdate(t=>{this._updateLineNumbers(),this.onCodeChange(t)})}}onCodeChange(t){super.onCodeChange(t),this._suppressNextDirty?this._suppressNextDirty=!1:this.pict.PictApplication&&(this.pict.PictApplication.markDirty(),this.pict.PictApplication.updateStats())}static getLanguageForExtension(t){if(!t)return"plaintext";let e=t.toLowerCase();return o[e]||"plaintext"}},e.exports.default_configuration={ViewIdentifier:"ContentEditor-CodeEditor",DefaultRenderable:"CodeEditor-Wrap",DefaultDestinationAddress:"#ContentEditor-Editor-Container",TargetElementAddress:"#ContentEditor-Editor-Container",CodeDataAddress:"AppData.ContentEditor.CodeContent",ReadOnly:!1,LineNumbers:!0,Language:"javascript",Tab:"\t",AutoRender:!1,Renderables:[{RenderableHash:"CodeEditor-Wrap",TemplateHash:"CodeEditor-Container",DestinationAddress:"#ContentEditor-Editor-Container"}]},e.exports.ExtensionLanguageMap=o},{"pict-section-code":61}],117:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"ContentEditor-Layout",DefaultRenderable:"ContentEditor-Layout-Shell",DefaultDestinationAddress:"#ContentEditor-Application-Container",AutoRender:!1,CSS:'\n\t\t#ContentEditor-Application-Container\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100vh;\n\t\t\tbackground: #F5F3EE;\n\t\t}\n\t\t#ContentEditor-TopBar-Container\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-body\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex: 1;\n\t\t\tmin-height: 0;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t/* Sidebar wrapper holds the sidebar content + collapse toggle */\n\t\t.content-editor-sidebar-wrap\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 0;\n\t\t\tposition: relative;\n\t\t\ttransition: width 0.2s ease;\n\t\t}\n\t\t/* Inner wrapper: vertical flex for tab bar + panes */\n\t\t.content-editor-sidebar-inner\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\tmin-height: 0;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t/* Sidebar tab bar */\n\t\t.content-editor-sidebar-tabs\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 0;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tbackground: #F5F0EA;\n\t\t}\n\t\t.content-editor-sidebar-tab\n\t\t{\n\t\t\tflex: 1;\n\t\t\tpadding: 7px 0;\n\t\t\tborder: none;\n\t\t\tbackground: transparent;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\tborder-bottom: 2px solid transparent;\n\t\t\ttransition: color 0.15s, border-color 0.15s;\n\t\t}\n\t\t.content-editor-sidebar-tab:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.content-editor-sidebar-tab.active\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t\tborder-bottom-color: #2E7D74;\n\t\t}\n\t\t.content-editor-sidebar-addfile\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 30px;\n\t\t\tborder: none;\n\t\t\tbackground: transparent;\n\t\t\tfont-size: 1.1rem;\n\t\t\tfont-weight: 400;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tborder-bottom: 2px solid transparent;\n\t\t\ttransition: color 0.15s, background 0.15s;\n\t\t}\n\t\t.content-editor-sidebar-addfile:hover\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t/* Sidebar panes */\n\t\t.content-editor-sidebar-pane\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\toverflow-x: hidden;\n\t\t\tmin-width: 0;\n\t\t\tmin-height: 0;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container\n\t\t{\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t/* Vocabulary panel: map the provider\'s CSS custom\n\t\t properties to the CMS light-theme palette so the\n\t\t shared vocabulary module renders consistently. */\n\t\t#ContentEditor-Vocabulary-Container\n\t\t{\n\t\t\t--bg-primary: #FAF8F4;\n\t\t\t--bg-secondary: #F5F0EA;\n\t\t\t--bg-hover: #EDE9E3;\n\t\t\t--border-color: #DDD6CA;\n\t\t\t--accent: #2E7D74;\n\t\t\t--text-primary: #3D3229;\n\t\t\t--text-secondary: #5E5549;\n\t\t\t--text-muted: #8A7F72;\n\t\t}\n\t\t/* File browser layout overrides for sidebar use */\n\t\t#ContentEditor-Sidebar-Container .pict-filebrowser\n\t\t{\n\t\t\tborder: none;\n\t\t\tborder-radius: 0;\n\t\t\tbackground: transparent;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-filebrowser-browse-pane\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-filebrowser-view-pane\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Hide size/date columns — the sidebar is too narrow for them */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-col-size,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-col-modified,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-size,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-modified\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Hide the column header bar in sidebar mode */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-header\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Breadcrumb bar: flex wrapper with create-folder button */\n\t\t.pict-fb-breadcrumb-bar\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t}\n\t\t.pict-fb-breadcrumb-bar .pict-fb-breadcrumb\n\t\t{\n\t\t\tflex: 1;\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t.pict-fb-breadcrumb-addfolder\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tfont-size: 1.1rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 4px 10px;\n\t\t\tline-height: 1;\n\t\t\tborder-radius: 4px;\n\t\t\tmargin-right: 4px;\n\t\t}\n\t\t.pict-fb-breadcrumb-addfolder:hover\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t\tbackground: #EAE3D8;\n\t\t}\n\t\t#ContentEditor-Editor-Container\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tpadding: 44px 16px 16px 16px;\n\t\t}\n\t\t/* Right-side inline documentation panel */\n\t\t.content-editor-doc-panel\n\t\t{\n\t\t\twidth: 340px;\n\t\t\tmin-width: 260px;\n\t\t\tmax-width: 500px;\n\t\t\tborder-left: 1px solid #DDD6CA;\n\t\t\toverflow-y: auto;\n\t\t\tbackground: #FAF8F4;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-doc-toggle\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 6px;\n\t\t\tright: 8px;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tpadding: 3px 8px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #5E5549;\n\t\t\tcursor: pointer;\n\t\t\tz-index: 5;\n\t\t}\n\t\t.content-editor-doc-toggle:hover\n\t\t{\n\t\t\tbackground: #EAE3D8;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t/* Code editor: fill the container and remove outer border */\n\t\t#ContentEditor-Editor-Container .pict-code-editor-wrap\n\t\t{\n\t\t\theight: calc(100% - 4px);\n\t\t\tborder: none;\n\t\t\tborder-radius: 0;\n\t\t}\n\t\t#ContentEditor-Editor-Container .pict-code-editor\n\t\t{\n\t\t\tmin-height: unset;\n\t\t\theight: 100%;\n\t\t\tbackground: #FAFAFA;\n\t\t}\n\t\t/* Binary file preview */\n\t\t.binary-preview-image-wrap\n\t\t{\n\t\t\tmargin-bottom: 20px;\n\t\t}\n\t\t.binary-preview-image\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 6px;\n\t\t\tpadding: 24px;\n\t\t}\n\t\t.binary-preview-image img\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 400px;\n\t\t\tobject-fit: contain;\n\t\t\tborder-radius: 4px;\n\t\t}\n\t\t.binary-preview-card\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 20px;\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 6px;\n\t\t\tpadding: 24px;\n\t\t\tmax-width: 600px;\n\t\t}\n\t\t.binary-preview-icon\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 64px;\n\t\t\theight: 64px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder-radius: 8px;\n\t\t\tfont-size: 0.75rem;\n\t\t\tfont-weight: 700;\n\t\t\tcolor: #5E5549;\n\t\t\tletter-spacing: 0.5px;\n\t\t}\n\t\t.binary-preview-info\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.binary-preview-name\n\t\t{\n\t\t\tfont-size: 1rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-bottom: 6px;\n\t\t\tword-break: break-all;\n\t\t}\n\t\t.binary-preview-meta\n\t\t{\n\t\t\tfont-size: 0.8rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tline-height: 1.6;\n\t\t}\n\t\t.binary-preview-actions\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tgap: 8px;\n\t\t}\n\t\t.binary-preview-btn\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 8px 16px;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.8rem;\n\t\t\tfont-weight: 600;\n\t\t\ttext-decoration: none;\n\t\t\ttext-align: center;\n\t\t\tcursor: pointer;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t}\n\t\t.binary-preview-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.binary-preview-btn-secondary\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t}\n\t\t.binary-preview-btn-secondary:hover\n\t\t{\n\t\t\tborder-color: #8A7F72;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.binary-preview-btn-preview\n\t\t{\n\t\t\tpadding: 10px 20px;\n\t\t\tfont-size: 0.85rem;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tbackground: #FAF8F4;\n\t\t\tcolor: #3D3229;\n\t\t\tcursor: pointer;\n\t\t\tborder-radius: 6px;\n\t\t\ttransition: background 0.15s, border-color 0.15s;\n\t\t}\n\t\t.binary-preview-btn-preview:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder-color: #8A7F72;\n\t\t}\n\t\t#ContentEditor-MediaPreviewPlaceholder\n\t\t{\n\t\t\tmargin-bottom: 20px;\n\t\t}\n\t\t.binary-preview-media-wrap\n\t\t{\n\t\t\tmargin-bottom: 20px;\n\t\t}\n\t\t.binary-preview-video\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 500px;\n\t\t\tborder-radius: 6px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tbackground: #000;\n\t\t}\n\t\t.binary-preview-audio\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tmax-width: 500px;\n\t\t}\n\t\t/* Image upload overlay */\n\t\t.content-editor-upload-overlay\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t\tz-index: 1099;\n\t\t\tbackground: rgba(0, 0, 0, 0.35);\n\t\t}\n\t\t.content-editor-upload-overlay.open\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.content-editor-upload-panel\n\t\t{\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 10px;\n\t\t\tbox-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);\n\t\t\twidth: 420px;\n\t\t\tmax-width: 90vw;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.content-editor-upload-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tpadding: 14px 18px;\n\t\t\tborder-bottom: 1px solid #EDE9E3;\n\t\t}\n\t\t.content-editor-upload-title\n\t\t{\n\t\t\tfont-size: 0.95rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.content-editor-upload-close\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tfont-size: 1.2rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 2px 6px;\n\t\t\tline-height: 1;\n\t\t\tborder-radius: 4px;\n\t\t}\n\t\t.content-editor-upload-close:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #F0EDE8;\n\t\t}\n\t\t.content-editor-upload-body\n\t\t{\n\t\t\tpadding: 18px;\n\t\t}\n\t\t.content-editor-upload-dropzone\n\t\t{\n\t\t\tborder: 2px dashed #DDD6CA;\n\t\t\tborder-radius: 8px;\n\t\t\tpadding: 28px 16px;\n\t\t\ttext-align: center;\n\t\t\tcursor: pointer;\n\t\t\ttransition: border-color 0.15s, background 0.15s;\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t.content-editor-upload-dropzone:hover,\n\t\t.content-editor-upload-dropzone.dragover\n\t\t{\n\t\t\tborder-color: #2E7D74;\n\t\t\tbackground: #F0FAF8;\n\t\t}\n\t\t.content-editor-upload-dropzone-icon\n\t\t{\n\t\t\tfont-size: 2rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.content-editor-upload-dropzone-text\n\t\t{\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.content-editor-upload-dropzone-hint\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-top: 4px;\n\t\t}\n\t\t.content-editor-upload-file-input\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t.content-editor-upload-status\n\t\t{\n\t\t\tmargin-top: 12px;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t\tmin-height: 20px;\n\t\t}\n\t\t.content-editor-upload-status-error\n\t\t{\n\t\t\tcolor: #D9534F;\n\t\t}\n\t\t.content-editor-upload-status-success\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.content-editor-upload-result\n\t\t{\n\t\t\tmargin-top: 12px;\n\t\t\tpadding: 10px 12px;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 6px;\n\t\t}\n\t\t.content-editor-upload-result-label\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 4px;\n\t\t}\n\t\t.content-editor-upload-result-url\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 6px;\n\t\t}\n\t\t.content-editor-upload-result-text\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-family: monospace;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: #3D3229;\n\t\t\tword-break: break-all;\n\t\t}\n\t\t.content-editor-upload-result-copy\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tpadding: 4px 10px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.content-editor-upload-result-copy:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.content-editor-upload-kbd\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 1px 5px;\n\t\t\tfont-size: 0.68rem;\n\t\t\tfont-family: monospace;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.content-editor-upload-footer\n\t\t{\n\t\t\tpadding: 10px 18px;\n\t\t\tborder-top: 1px solid #EDE9E3;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-align: center;\n\t\t}\n\n\t\t/* File browser row insert button — hidden by default, shown on\n\t\t hover for image file rows via CSS attribute selectors. */\n\t\t.pict-fb-insert-btn\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tposition: absolute;\n\t\t\tright: 6px;\n\t\t\ttop: 50%;\n\t\t\ttransform: translateY(-50%);\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 700;\n\t\t\tline-height: 1;\n\t\t\tpadding: 2px 7px;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.pict-fb-insert-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t/* Make the row position:relative so the button can be absolutely placed */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row\n\t\t{\n\t\t\tposition: relative;\n\t\t}\n\t\t/* Show the insert button on hover for image file extensions.\n\t\t CSS attribute selector [data-name$=".ext" i] matches\n\t\t the end of the data-name attribute, case-insensitive. */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".png" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".jpg" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".jpeg" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".gif" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".webp" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".svg" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".bmp" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".avif" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".apng" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".ico" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".tiff" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".tif" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".jfif" i]:hover .pict-fb-insert-btn\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Tablet / Phone (max-width: 768px)\n\t\t ============================================ */\n\t\t@media (max-width: 768px)\n\t\t{\n\t\t\t/* Prevent horizontal scroll on the whole app */\n\t\t\t#ContentEditor-Application-Container\n\t\t\t{\n\t\t\t\toverflow-x: hidden;\n\t\t\t\twidth: 100%;\n\t\t\t\tmax-width: 100vw;\n\t\t\t}\n\n\t\t\t/* Stack sidebar ABOVE editor instead of side-by-side */\n\t\t\t.content-editor-body\n\t\t\t{\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\t/* Both panels become full-width horizontal strips */\n\t\t\t.content-editor-sidebar-wrap,\n\t\t\t.content-editor-doc-panel\n\t\t\t{\n\t\t\t\twidth: 100% !important;\n\t\t\t\tmax-height: 40vh;\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tborder-right: none;\n\t\t\t}\n\t\t\t.content-editor-sidebar-wrap\n\t\t\t{\n\t\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\t}\n\t\t\t.content-editor-doc-panel\n\t\t\t{\n\t\t\t\tborder-left: none;\n\t\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\t}\n\n\t\t\t/* Give the Reference and Topics tabs much more room on mobile\n\t\t\t since they contain long scrollable content */\n\t\t\t.content-editor-sidebar-wrap.sidebar-expanded-pane\n\t\t\t{\n\t\t\t\tmax-height: 70vh;\n\t\t\t}\n\n\t\t\t/* When panels are collapsed on mobile, zero height instead of\n\t\t\t zero width since the layout is stacked vertically */\n\t\t\t.content-editor-sidebar-wrap.pict-panel-collapsed,\n\t\t\t.content-editor-doc-panel.pict-panel-collapsed\n\t\t\t{\n\t\t\t\twidth: 100% !important;\n\t\t\t\tmax-height: 0;\n\t\t\t}\n\t\t\t.content-editor-sidebar-wrap.pict-panel-collapsed .content-editor-sidebar-inner\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t/* Reduce editor container padding (less gutters) */\n\t\t\t#ContentEditor-Editor-Container\n\t\t\t{\n\t\t\t\tpadding: 24px 8px 8px 8px;\n\t\t\t}\n\n\t\t\t/* Reduce binary preview padding */\n\t\t\t.binary-preview-image\n\t\t\t{\n\t\t\t\tpadding: 12px;\n\t\t\t}\n\t\t\t.binary-preview-card\n\t\t\t{\n\t\t\t\tpadding: 12px;\n\t\t\t\tgap: 12px;\n\t\t\t}\n\n\t\t\t/* Upload panel: fill more of the screen */\n\t\t\t.content-editor-upload-panel\n\t\t\t{\n\t\t\t\twidth: 95vw;\n\t\t\t\tmax-width: 95vw;\n\t\t\t}\n\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Small phone (max-width: 480px)\n\t\t ============================================ */\n\t\t@media (max-width: 480px)\n\t\t{\n\t\t\t/* Even tighter editor padding */\n\t\t\t#ContentEditor-Editor-Container\n\t\t\t{\n\t\t\t\tpadding: 20px 4px 4px 4px;\n\t\t\t}\n\n\t\t\t/* Sidebar gets a smaller max height */\n\t\t\t.content-editor-sidebar-wrap\n\t\t\t{\n\t\t\t\tmax-height: 35vh;\n\t\t\t}\n\t\t\t.content-editor-sidebar-wrap.sidebar-expanded-pane\n\t\t\t{\n\t\t\t\tmax-height: 65vh;\n\t\t\t}\n\t\t}\n\t',Templates:[{Hash:"ContentEditor-Layout-Shell-Template",Template:'\n<div id="ContentEditor-TopBar-Container"></div>\n<div class="content-editor-body">\n\t<div class="content-editor-sidebar-wrap" id="ContentEditor-SidebarWrap">\n\t\t<div class="content-editor-sidebar-inner">\n\t\t\t<div class="content-editor-sidebar-tabs">\n\t\t\t\t<button class="content-editor-sidebar-tab active" id="ContentEditor-SidebarTab-Files"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].switchSidebarTab(\'files\')">Files</button>\n\t\t\t\t<button class="content-editor-sidebar-tab" id="ContentEditor-SidebarTab-Reference"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].switchSidebarTab(\'reference\')">Reference</button>\n\t\t\t\t<button class="content-editor-sidebar-tab" id="ContentEditor-SidebarTab-Topics"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].switchSidebarTab(\'topics\')">Topics</button>\n\t\t\t\t<button class="content-editor-sidebar-tab" id="ContentEditor-SidebarTab-Vocabulary"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].switchSidebarTab(\'vocabulary\')">Vocab</button>\n\t\t\t\t<button class="content-editor-sidebar-addfile" id="ContentEditor-SidebarAddBtn" title="New file"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].onSidebarAddClick()">+</button>\n\t\t\t</div>\n\t\t\t<div id="ContentEditor-Sidebar-Container" class="content-editor-sidebar-pane"></div>\n\t\t\t<div id="ContentEditor-SidebarReference-Container" class="content-editor-sidebar-pane" style="display:none"></div>\n\t\t\t<div id="ContentEditor-SidebarTopics-Container" class="content-editor-sidebar-pane" style="display:none"></div>\n\t\t\t<div id="ContentEditor-Vocabulary-Container" class="content-editor-sidebar-pane" style="display:none"></div>\n\t\t</div>\n\t</div>\n\t<div id="ContentEditor-Editor-Container"></div>\n\t<div id="ContentEditor-Documentation-Panel" class="content-editor-doc-panel"></div>\n</div>\n<div class="content-editor-upload-overlay" id="ContentEditor-UploadOverlay"\n\tonclick="{~P~}.views[\'ContentEditor-Layout\'].onUploadOverlayClick(event)">\n\t<div class="content-editor-upload-panel">\n\t\t<div class="content-editor-upload-header">\n\t\t\t<span class="content-editor-upload-title">Upload Image</span>\n\t\t\t<button class="content-editor-upload-close"\n\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].toggleUploadForm()">×</button>\n\t\t</div>\n\t\t<div class="content-editor-upload-body">\n\t\t\t<div class="content-editor-upload-dropzone" id="ContentEditor-UploadDropzone"\n\t\t\t\tonclick="{~P~}.ContentAssignment.getElement(\'#ContentEditor-UploadFileInput\')[0].click()">\n\t\t\t\t<div class="content-editor-upload-dropzone-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M2 5h2l1.5-2h5L12 5h2a1 1 0 011 1v6a1 1 0 01-1 1H2a1 1 0 01-1-1V6a1 1 0 011-1z"/><circle cx="8" cy="9" r="2.5"/></svg></div>\n\t\t\t\t<div class="content-editor-upload-dropzone-text">Drop an image here or click to browse</div>\n\t\t\t\t<div class="content-editor-upload-dropzone-hint">PNG, JPG, GIF, WebP, SVG, BMP</div>\n\t\t\t</div>\n\t\t\t<input type="file" class="content-editor-upload-file-input" id="ContentEditor-UploadFileInput"\n\t\t\t\taccept="image/png,image/jpeg,image/gif,image/webp,image/svg+xml,image/bmp"\n\t\t\t\tonchange="{~P~}.views[\'ContentEditor-Layout\'].onUploadFileSelected(this)">\n\t\t\t<div class="content-editor-upload-status" id="ContentEditor-UploadStatus"></div>\n\t\t\t<div id="ContentEditor-UploadResult"></div>\n\t\t</div>\n\t\t<div class="content-editor-upload-footer">\n\t\t\t<span class="content-editor-upload-kbd">F3</span> or\n\t\t\t<span class="content-editor-upload-kbd">Ctrl+Shift+U</span> to toggle\n\t\t</div>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-Layout-Shell",TemplateHash:"ContentEditor-Layout-Shell-Template",DestinationAddress:"#ContentEditor-Application-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._minSidebarWidth=140,this._maxSidebarWidth=600}onAfterRender(t,e,i,n){this.pict.views["ContentEditor-TopBar"].render();let o=this.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");o&&o[0]&&!this.pict.AppData.ContentEditor.CurrentFile&&this.pict.ContentAssignment.assignContent("#ContentEditor-Editor-Container",'<div style="display:flex;align-items:center;justify-content:center;height:100%;color:#8A7F72;font-size:1.1em;">Select a file from the sidebar to begin editing</div>'),this.pict.CSSMap.injectCSS();let r=this,a=this.pict.AppData.ContentEditor,s=this.pict.views["Pict-Section-Modal"];if(s&&"function"==typeof s.panel){let t=window.innerWidth<=768;this._sidebarPanel=s.panel("#ContentEditor-SidebarWrap",{position:"left",width:a.SidebarWidth||250,minWidth:140,maxWidth:600,collapsible:!0,collapsed:a.SidebarCollapsed||t,persist:!0,persistKey:"ContentEditor-Sidebar",onResize:t=>{a.SidebarWidth=t,r.pict.PictApplication.saveSettings()},onToggle:t=>{a.SidebarCollapsed=t,r.pict.PictApplication.saveSettings()}})}return window.addEventListener("hashchange",()=>{r.pict.PictApplication.resolveHash()}),window.addEventListener("keydown",t=>{if((t.metaKey||t.ctrlKey)&&"s"===t.key)return t.preventDefault(),void r.pict.PictApplication.saveCurrentFile();if("F1"===t.key)return t.preventDefault(),void r._handleF1();if("F2"===t.key)return t.preventDefault(),void r.toggleSidebar();if("F3"===t.key)return t.preventDefault(),void r.toggleUploadForm();if((t.metaKey||t.ctrlKey)&&t.shiftKey&&("u"===t.key||"U"===t.key))return t.preventDefault(),void r.toggleUploadForm();if("F4"===t.key)return t.preventDefault(),void r.pict.PictApplication.handleF4TopicAction();if((t.metaKey||t.ctrlKey)&&t.shiftKey&&("t"===t.key||"T"===t.key))return t.preventDefault(),void r.pict.PictApplication.handleF4TopicAction();if("Escape"===t.key){let e=r.pict.ContentAssignment.getElement("#ContentEditor-UploadOverlay")[0];if(e&&e.classList.contains("open"))return void r.closeUploadForm();let i=r.pict.ContentAssignment.getElement("#ContentEditor-ConfirmOverlay")[0];if(i&&i.classList.contains("open"))return;if(r.pict.AppData.ContentEditor.CurrentFile)return t.preventDefault(),void r.pict.PictApplication.closeCurrentFile()}}),super.onAfterRender(t,e,i,n)}onSidebarAddClick(){if("vocabulary"===this.getActiveSidebarTab()){let t=this.pict.views["ContentEditor-Vocabulary"];t&&"function"==typeof t.createTerm&&t.createTerm()}else this.pict.PictApplication.promptNewFile()}toggleDocPanel(){if(this.pict.PictApplication._docPanel){this.pict.PictApplication._docPanel.toggle();let t=this.pict.ContentAssignment.getElement("#ContentEditor-Documentation-Panel")[0];if(t&&!t._initialized){t._initialized=!0;let e=this.pict.providers&&this.pict.providers["Pict-InlineDocumentation"];e&&"function"==typeof e.loadDocument&&e.loadDocument("README.md")}return}let t=this.pict.ContentAssignment.getElement("#ContentEditor-Documentation-Panel")[0];if(!t)return;let e="none"!==t.style.display;if(t.style.display=e?"none":"",!e){let e=this.pict.providers&&this.pict.providers["Pict-InlineDocumentation"];e&&!t._initialized&&(t._initialized=!0,"function"==typeof e.loadDocument&&e.loadDocument("README.md"))}}toggleSidebar(){this._sidebarPanel&&this._sidebarPanel.toggle()}switchSidebarTab(t){let e={files:this.pict.ContentAssignment.getElement("#ContentEditor-Sidebar-Container")[0],reference:this.pict.ContentAssignment.getElement("#ContentEditor-SidebarReference-Container")[0],topics:this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTopics-Container")[0],vocabulary:this.pict.ContentAssignment.getElement("#ContentEditor-Vocabulary-Container")[0]},i={files:this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTab-Files")[0],reference:this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTab-Reference")[0],topics:this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTab-Topics")[0],vocabulary:this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTab-Vocabulary")[0]};for(let t in e)e[t]&&(e[t].style.display="none"),i[t]&&i[t].classList.remove("active");e[t]&&(e[t].style.display=""),i[t]&&i[t].classList.add("active");let n=this.pict.ContentAssignment.getElement("#ContentEditor-SidebarWrap")[0];n&&("reference"===t||"topics"===t||"vocabulary"===t?n.classList.add("sidebar-expanded-pane"):n.classList.remove("sidebar-expanded-pane"));let o=this.pict.ContentAssignment.getElement("#ContentEditor-SidebarAddBtn")[0];if(o&&(o.title="vocabulary"===t?"New vocabulary term":"New file"),"reference"===t){let t=this.pict.views["ContentEditor-MarkdownReference"];t&&!t._hasRendered&&t.render()}if("topics"===t){let t=this.pict.views["ContentEditor-Topics"];t&&!t._hasRendered&&t.render()}if("vocabulary"===t){let t=this.pict.views["ContentEditor-Vocabulary"];t&&t.refreshTermList()}}_handleF1(){if(this.pict.AppData.ContentEditor.SidebarCollapsed)return this.toggleSidebar(),void this.switchSidebarTab("reference");let t=this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTab-Reference")[0];t&&t.classList.contains("active")?this.switchSidebarTab("files"):this.switchSidebarTab("reference")}getActiveSidebarTab(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTab-Reference")[0],e=this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTab-Topics")[0],i=this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTab-Vocabulary")[0];return t&&t.classList.contains("active")?"reference":e&&e.classList.contains("active")?"topics":i&&i.classList.contains("active")?"vocabulary":"files"}toggleUploadForm(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-UploadOverlay")[0];t&&(t.classList.contains("open")?this.closeUploadForm():this.openUploadForm())}openUploadForm(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-UploadOverlay")[0];t&&t.classList.add("open"),this._wireUploadDropzone()}closeUploadForm(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-UploadOverlay")[0];t&&t.classList.remove("open");let e=this.pict.ContentAssignment.getElement("#ContentEditor-UploadFileInput")[0];e&&(e.value=""),this.pict.ContentAssignment.assignContent("#ContentEditor-UploadStatus",""),this.pict.ContentAssignment.assignContent("#ContentEditor-UploadResult","")}onUploadOverlayClick(t){"ContentEditor-UploadOverlay"===t.target.id&&this.closeUploadForm()}onUploadFileSelected(t){t.files&&t.files.length>0&&this._uploadFile(t.files[0])}_wireUploadDropzone(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-UploadDropzone")[0];if(!t||t._wired)return;t._wired=!0;let e=this;t.addEventListener("dragover",e=>{e.preventDefault(),e.stopPropagation(),t.classList.add("dragover")}),t.addEventListener("dragleave",e=>{e.preventDefault(),e.stopPropagation(),t.classList.remove("dragover")}),t.addEventListener("drop",i=>{i.preventDefault(),i.stopPropagation(),t.classList.remove("dragover"),i.dataTransfer&&i.dataTransfer.files&&i.dataTransfer.files.length>0&&e._uploadFile(i.dataTransfer.files[0])})}_uploadFile(t){if(!t)return;if(!t.type.startsWith("image/"))return void this.pict.ContentAssignment.assignContent("#ContentEditor-UploadStatus",'<span class="content-editor-upload-status-error">Only image files are supported.</span>');this.pict.ContentAssignment.assignContent("#ContentEditor-UploadStatus","Uploading <strong>"+t.name+"</strong>..."),this.pict.ContentAssignment.assignContent("#ContentEditor-UploadResult","");let e=this,i=this.pict.providers["ContentEditor-Provider"];i?i.uploadImage(t,(i,n)=>{if(i)return void e.pict.ContentAssignment.assignContent("#ContentEditor-UploadStatus",'<span class="content-editor-upload-status-error">Upload failed: '+i+"</span>");e.pict.ContentAssignment.assignContent("#ContentEditor-UploadStatus",'<span class="content-editor-upload-status-success">Uploaded successfully!</span>');let o="";e.pict.ContentAssignment.assignContent("#ContentEditor-UploadResult",'<div class="content-editor-upload-result"><div class="content-editor-upload-result-label">Markdown</div><div class="content-editor-upload-result-url"><span class="content-editor-upload-result-text">'+o+'</span><button class="content-editor-upload-result-copy" onclick="navigator.clipboard.writeText(\''+o.replace(/'/g,"\\'")+'\').then(function(){this.textContent=\'Copied!\'}.bind(this))">Copy</button></div><div class="content-editor-upload-result-label" style="margin-top:8px">URL</div><div class="content-editor-upload-result-url"><span class="content-editor-upload-result-text">'+n+'</span><button class="content-editor-upload-result-copy" onclick="navigator.clipboard.writeText(\''+n.replace(/'/g,"\\'")+"').then(function(){this.textContent='Copied!'}.bind(this))\">Copy</button></div></div>"),e.pict.PictApplication.loadFileList()}):this.pict.ContentAssignment.assignContent("#ContentEditor-UploadStatus",'<span class="content-editor-upload-status-error">Provider not available.</span>')}},e.exports.default_configuration=o},{"pict-view":102}],118:[function(t,e,i){const n=t("pict-section-markdowneditor");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onImageUpload(t,e,i){let n=this.pict.providers["ContentEditor-Provider"];return!!n&&(n.uploadImage(t,(t,e)=>{t?i(t):i(null,e)}),!0)}customConfigureExtensions(t,e){if(this.pict.AppData.ContentEditor&&this.pict.AppData.ContentEditor.MarkdownWordWrap){let e=this._codeMirrorModules;e&&e.EditorView&&e.EditorView.lineWrapping&&t.push(e.EditorView.lineWrapping)}return t}onContentChange(t,e){this.pict.PictApplication&&(this.pict.PictApplication.markDirty(),this.pict.PictApplication.updateStats())}},e.exports.default_configuration={ViewIdentifier:"ContentEditor-MarkdownEditor",DefaultRenderable:"MarkdownEditor-Wrap",DefaultDestinationAddress:"#ContentEditor-Editor-Container",TargetElementAddress:"#ContentEditor-Editor-Container",ContentDataAddress:"AppData.ContentEditor.Document.Segments",ReadOnly:!1,EnableRichPreview:!0,AutoRender:!1,Renderables:[{RenderableHash:"MarkdownEditor-Wrap",TemplateHash:"MarkdownEditor-Container",DestinationAddress:"#ContentEditor-Editor-Container"}]}},{"pict-section-markdowneditor":92}],119:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"ContentEditor-MarkdownReference",DefaultRenderable:"ContentEditor-MarkdownReference-Display",DefaultDestinationAddress:"#ContentEditor-SidebarReference-Container",AutoRender:!1,CSS:"\n\t\t.md-ref-container\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t.md-ref-search-bar\n\t\t{\n\t\t\tposition: sticky;\n\t\t\ttop: 0;\n\t\t\tz-index: 5;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t\tpadding: 6px 8px;\n\t\t\tbackground: #F5F0EA;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.md-ref-search-input\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\tpadding: 5px 8px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.8rem;\n\t\t\tbackground: #FFF;\n\t\t\tcolor: #3D3229;\n\t\t\toutline: none;\n\t\t}\n\t\t.md-ref-search-input:focus\n\t\t{\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.md-ref-search-nav\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\twidth: 26px;\n\t\t\theight: 26px;\n\t\t\tcursor: pointer;\n\t\t\tcolor: #5E5549;\n\t\t\tfont-size: 0.7rem;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.md-ref-search-nav:hover\n\t\t{\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t.md-ref-search-nav:disabled\n\t\t{\n\t\t\topacity: 0.3;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.md-ref-search-count\n\t\t{\n\t\t\tfont-size: 0.7rem;\n\t\t\tcolor: #8A7F72;\n\t\t\twhite-space: nowrap;\n\t\t\tmin-width: 32px;\n\t\t\ttext-align: center;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.md-ref-content\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tpadding: 12px;\n\t\t\tfont-size: 0.82rem;\n\t\t\tline-height: 1.6;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.md-ref-content h2\n\t\t{\n\t\t\tfont-size: 0.95rem;\n\t\t\tmargin: 20px 0 8px 0;\n\t\t\tpadding-bottom: 4px;\n\t\t\tborder-bottom: 1px solid #EDE9E3;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.md-ref-content h2:first-child\n\t\t{\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t.md-ref-content h3\n\t\t{\n\t\t\tfont-size: 0.85rem;\n\t\t\tmargin: 14px 0 6px 0;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.md-ref-content p\n\t\t{\n\t\t\tmargin: 6px 0;\n\t\t}\n\t\t.md-ref-content code\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tpadding: 1px 4px;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-family: monospace;\n\t\t}\n\t\t.md-ref-content pre\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tpadding: 8px 10px;\n\t\t\toverflow-x: auto;\n\t\t\tfont-size: 0.76rem;\n\t\t\tline-height: 1.5;\n\t\t\tmargin: 6px 0;\n\t\t\tposition: relative;\n\t\t}\n\t\t.md-ref-content pre code\n\t\t{\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.md-ref-copy-btn\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 4px;\n\t\t\tright: 4px;\n\t\t\tbackground: #FAF8F4;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 2px 6px;\n\t\t\tfont-size: 0.65rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\topacity: 0;\n\t\t\ttransition: opacity 0.15s;\n\t\t}\n\t\t.md-ref-content pre:hover .md-ref-copy-btn\n\t\t{\n\t\t\topacity: 1;\n\t\t}\n\t\t.md-ref-copy-btn:hover\n\t\t{\n\t\t\tbackground: #EDE9E3;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.md-ref-docs-link\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tgap: 6px;\n\t\t\tpadding: 8px 10px;\n\t\t\tbackground: #F0FAF8;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tfont-size: 0.8rem;\n\t\t\tfont-weight: 600;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.md-ref-docs-link a\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.md-ref-docs-link a:hover\n\t\t{\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t/* Search highlight */\n\t\tmark.md-ref-highlight\n\t\t{\n\t\t\tbackground: #FFEAA7;\n\t\t\tcolor: inherit;\n\t\t\tpadding: 0;\n\t\t\tborder-radius: 2px;\n\t\t}\n\t\tmark.md-ref-highlight-active\n\t\t{\n\t\t\tbackground: #E8A94D;\n\t\t\tcolor: #FFF;\n\t\t}\n\t",Templates:[{Hash:"ContentEditor-MarkdownReference-Template",Template:'\n<div class="md-ref-container">\n\t<div class="md-ref-docs-link">\n\t\t<span><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3C6.5 1.5 4 1 1 1.5v11c3-.5 5.5 0 7 1.5 1.5-1.5 4-2 7-1.5v-11c-3-.5-5.5 0-7 1.5z"/><line x1="8" y1="3" x2="8" y2="14"/></svg></span>\n\t\t<a href="#" onclick="event.preventDefault();pict.views[\'ContentEditor-Layout\'].toggleDocPanel()">Full Documentation</a>\n\t</div>\n\t<div class="md-ref-search-bar">\n\t\t<input type="text" class="md-ref-search-input"\n\t\t\tid="ContentEditor-MdRef-SearchInput"\n\t\t\tplaceholder="Search reference..."\n\t\t\toninput="{~P~}.views[\'ContentEditor-MarkdownReference\'].onSearchInput(this.value)"\n\t\t\tonkeydown="{~P~}.views[\'ContentEditor-MarkdownReference\'].onSearchKeydown(event)">\n\t\t<span class="md-ref-search-count" id="ContentEditor-MdRef-SearchCount"></span>\n\t\t<button class="md-ref-search-nav" id="ContentEditor-MdRef-SearchPrev"\n\t\t\tonclick="{~P~}.views[\'ContentEditor-MarkdownReference\'].navigateMatch(-1)" disabled>▲</button>\n\t\t<button class="md-ref-search-nav" id="ContentEditor-MdRef-SearchNext"\n\t\t\tonclick="{~P~}.views[\'ContentEditor-MarkdownReference\'].navigateMatch(1)" disabled>▼</button>\n\t</div>\n\t<div class="md-ref-content" id="ContentEditor-MdRef-Content">\n\n<h2>Headings</h2>\n<p>Use <code>#</code> through <code>######</code> for heading levels 1–6.</p>\n<pre><code># Heading 1\n## Heading 2\n### Heading 3\n#### Heading 4\n##### Heading 5\n###### Heading 6</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Emphasis</h2>\n<p>Bold, italic, strikethrough, and combinations.</p>\n<pre><code>**bold text**\n*italic text*\n***bold and italic***\n~~strikethrough~~\n**bold and ~~strikethrough~~**</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Inline Code</h2>\n<p>Wrap text in backticks for inline code.</p>\n<pre><code>Use `console.log()` to debug.\nUse ``double backticks for `literal` backticks``.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Links</h2>\n<p>Inline links, reference links, and autolinks.</p>\n<pre><code>[Link text](https://example.com)\n[Link with title](https://example.com "Title text")\n\n[Reference link][1]\n[1]: https://example.com\n\nAutolink: https://example.com\nEmail: user@example.com</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Images</h2>\n<pre><code>\n\n\n[](https://example.com)</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Unordered Lists</h2>\n<p>Use <code>-</code>, <code>*</code>, or <code>+</code> for bullet items.</p>\n<pre><code>- Item one\n- Item two\n - Nested item\n - Another nested\n - Deeply nested\n- Item three</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Ordered Lists</h2>\n<pre><code>1. First item\n2. Second item\n3. Third item\n 1. Sub-item A\n 2. Sub-item B</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Task Lists</h2>\n<pre><code>- [x] Completed task\n- [ ] Incomplete task\n- [ ] Another task</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Blockquotes</h2>\n<pre><code>> This is a blockquote.\n>\n> It can span multiple paragraphs.\n>\n>> Nested blockquote.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Code Blocks</h2>\n<p>Use triple backticks with an optional language identifier.</p>\n<pre><code>```javascript\nfunction hello()\n{\n console.log("Hello, world!");\n}\n```\n\n```python\ndef hello():\n print("Hello, world!")\n```\n\n```css\n.container {\n display: flex;\n gap: 16px;\n}\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Tables</h2>\n<p>Use pipes and hyphens. Colons control alignment.</p>\n<pre><code>| Left Align | Center Align | Right Align |\n|:-----------|:------------:|------------:|\n| Cell 1 | Cell 2 | Cell 3 |\n| Cell 4 | Cell 5 | Cell 6 |</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Horizontal Rules</h2>\n<p>Three or more hyphens, asterisks, or underscores.</p>\n<pre><code>---\n\n***\n\n___</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Footnotes</h2>\n<pre><code>Here is a footnote reference[^1] and another[^note].\n\n[^1]: This is the footnote content.\n[^note]: Footnotes can have any label.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>HTML in Markdown</h2>\n<p>Raw HTML is allowed in GitHub-Flavored Markdown.</p>\n<pre><code><details>\n<summary>Click to expand</summary>\n\nHidden content here.\n\n</details>\n\n<kbd>Ctrl</kbd> + <kbd>S</kbd> to save.\n\n<mark>Highlighted text</mark>\n\n<sup>superscript</sup> and <sub>subscript</sub></code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Escaping Characters</h2>\n<p>Backslash-escape special markdown characters.</p>\n<pre><code>\\*not italic\\*\n\\# not a heading\n\\[not a link\\](url)\n\\`not code\\`</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Line Breaks</h2>\n<pre><code>End a line with two spaces\nto create a line break.\n\nOr use a blank line\n\nfor a new paragraph.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>KaTeX — Inline Math</h2>\n<p>Wrap expressions with single dollar signs for inline math.</p>\n<pre><code>The equation $E = mc^2$ is famous.\n\nThe quadratic formula is $x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}$.\n\nGreek letters: $\\alpha$, $\\beta$, $\\gamma$, $\\delta$, $\\theta$, $\\pi$.\n\nSubscripts and superscripts: $x_i^2$ and $a_{n+1}$.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>KaTeX — Display Math</h2>\n<p>Use double dollar signs on their own lines for display (block) math.</p>\n\n<h3>Integral</h3>\n<pre><code>$$\n\\int_{-\\infty}^{\\infty} e^{-x^2} \\, dx = \\sqrt{\\pi}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Summation</h3>\n<pre><code>$$\n\\sum_{n=1}^{\\infty} \\frac{1}{n^2} = \\frac{\\pi^2}{6}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Matrix</h3>\n<pre><code>$$\n\\begin{bmatrix}\na & b \\\\\nc & d\n\\end{bmatrix}\n\\begin{bmatrix}\nx \\\\\ny\n\\end{bmatrix}\n=\n\\begin{bmatrix}\nax + by \\\\\ncx + dy\n\\end{bmatrix}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Aligned Equations</h3>\n<pre><code>$$\n\\begin{aligned}\nf(x) &= x^2 + 2x + 1 \\\\\n &= (x + 1)^2\n\\end{aligned}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Cases (Piecewise)</h3>\n<pre><code>$$\nf(x) = \\begin{cases}\nx^2 & \\text{if } x \\geq 0 \\\\\n-x^2 & \\text{if } x < 0\n\\end{cases}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Fractions & Limits</h3>\n<pre><code>$$\n\\lim_{x \\to 0} \\frac{\\sin x}{x} = 1\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — Flowchart</h2>\n<pre><code>```mermaid\ngraph TD\n A[Start] --> B{Decision}\n B -->|Yes| C[Do something]\n B -->|No| D[Do something else]\n C --> E[End]\n D --> E\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — Sequence Diagram</h2>\n<pre><code>```mermaid\nsequenceDiagram\n participant A as Alice\n participant B as Bob\n A->>B: Hello Bob\n B-->>A: Hi Alice\n A->>B: How are you?\n B-->>A: Great!\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — Gantt Chart</h2>\n<pre><code>```mermaid\ngantt\n title Project Timeline\n dateFormat YYYY-MM-DD\n section Phase 1\n Research :a1, 2024-01-01, 30d\n Design :a2, after a1, 20d\n section Phase 2\n Development :b1, after a2, 40d\n Testing :b2, after b1, 15d\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — Class Diagram</h2>\n<pre><code>```mermaid\nclassDiagram\n Animal <|-- Duck\n Animal <|-- Fish\n Animal : +int age\n Animal : +String gender\n Animal : +swim()\n Duck : +String beakColor\n Duck : +quack()\n Fish : +int sizeInFeet\n Fish : +canEat()\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — State Diagram</h2>\n<pre><code>```mermaid\nstateDiagram-v2\n [*] --> Idle\n Idle --> Processing : Start\n Processing --> Done : Complete\n Processing --> Error : Fail\n Error --> Idle : Reset\n Done --> [*]\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-MarkdownReference-Display",TemplateHash:"ContentEditor-MarkdownReference-Template",DestinationAddress:"#ContentEditor-SidebarReference-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._hasRendered=!1,this._searchMatches=[],this._currentMatchIndex=-1,this._originalContent=""}onAfterRender(t,e,i,n){this._hasRendered=!0;let o=this.pict.ContentAssignment.getElement("#ContentEditor-MdRef-Content")[0];return o&&(this._originalContent=o.innerHTML),this.pict.CSSMap.injectCSS(),super.onAfterRender(t,e,i,n)}copyCodeBlock(t){let e=t.closest("pre");if(!e)return;let i=e.querySelector("code");if(!i)return;let n=i.textContent;navigator.clipboard&&navigator.clipboard.writeText(n).then(()=>{t.textContent="Copied!",setTimeout(()=>{t.textContent="Copy"},1500)})}onSearchInput(t){this._performSearch(t)}onSearchKeydown(t){"Enter"===t.key&&(t.preventDefault(),t.shiftKey?this.navigateMatch(-1):this.navigateMatch(1)),"Escape"===t.key&&(t.target.value="",this._clearSearch())}navigateMatch(t){if(0===this._searchMatches.length)return;this._currentMatchIndex>=0&&this._searchMatches[this._currentMatchIndex]&&this._searchMatches[this._currentMatchIndex].classList.remove("md-ref-highlight-active"),this._currentMatchIndex+=t,this._currentMatchIndex>=this._searchMatches.length&&(this._currentMatchIndex=0),this._currentMatchIndex<0&&(this._currentMatchIndex=this._searchMatches.length-1);let e=this._searchMatches[this._currentMatchIndex];e.classList.add("md-ref-highlight-active"),e.scrollIntoView({behavior:"smooth",block:"center"}),this._updateSearchCount()}_performSearch(t){let e=this.pict.ContentAssignment.getElement("#ContentEditor-MdRef-Content")[0];if(!e)return;if(e.innerHTML=this._originalContent,this._searchMatches=[],this._currentMatchIndex=-1,!t||t.length<2)return this._updateSearchCount(),void this._updateNavButtons();let i,n=t.toLowerCase(),o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),r=[];for(;i=o.nextNode();)i.nodeValue.toLowerCase().indexOf(n)>=0&&r.push(i);for(let t=0;t<r.length;t++)this._highlightTextNode(r[t],n);this._searchMatches=Array.from(e.querySelectorAll("mark.md-ref-highlight")),this._searchMatches.length>0&&(this._currentMatchIndex=0,this._searchMatches[0].classList.add("md-ref-highlight-active"),this._searchMatches[0].scrollIntoView({behavior:"smooth",block:"center"})),this._updateSearchCount(),this._updateNavButtons()}_highlightTextNode(t,e){let i=t.nodeValue,n=i.toLowerCase(),o=t.parentNode,r=document.createDocumentFragment(),a=0,s=n.indexOf(e);for(;s>=0;){s>a&&r.appendChild(document.createTextNode(i.substring(a,s)));let t=document.createElement("mark");t.className="md-ref-highlight",t.textContent=i.substring(s,s+e.length),r.appendChild(t),a=s+e.length,s=n.indexOf(e,a)}a<i.length&&r.appendChild(document.createTextNode(i.substring(a))),o.replaceChild(r,t)}_updateSearchCount(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-MdRef-SearchCount")[0];if(t)if(0===this._searchMatches.length){let e=this.pict.ContentAssignment.getElement("#ContentEditor-MdRef-SearchInput")[0];e&&e.value&&e.value.length>=2?t.textContent="0":t.textContent=""}else t.textContent=this._currentMatchIndex+1+"/"+this._searchMatches.length}_updateNavButtons(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-MdRef-SearchPrev")[0],e=this.pict.ContentAssignment.getElement("#ContentEditor-MdRef-SearchNext")[0],i=this._searchMatches.length>0;t&&(t.disabled=!i),e&&(e.disabled=!i)}_clearSearch(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-MdRef-Content")[0];t&&this._originalContent&&(t.innerHTML=this._originalContent),this._searchMatches=[],this._currentMatchIndex=-1,this._updateSearchCount(),this._updateNavButtons()}},e.exports.default_configuration=o},{"pict-view":102}],120:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"ContentEditor-SettingsPanel",DefaultRenderable:"ContentEditor-SettingsPanel-Display",DefaultDestinationAddress:"#ContentEditor-SettingsPanel-Container",AutoRender:!1,CSS:"\n\t\t.content-editor-settings-wrap\n\t\t{\n\t\t\tposition: relative;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t}\n\t\t.content-editor-settings-gear\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 6px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tborder-radius: 4px;\n\t\t\tcolor: #B8AFA4;\n\t\t\ttransition: color 0.15s;\n\t\t}\n\t\t.content-editor-settings-gear:hover,\n\t\t.content-editor-settings-gear.active\n\t\t{\n\t\t\tcolor: #E8E0D4;\n\t\t}\n\t\t.content-editor-settings-gear svg\n\t\t{\n\t\t\twidth: 20px;\n\t\t\theight: 20px;\n\t\t\tfill: currentColor;\n\t\t}\n\t\t/* Flyout overlay — covers viewport to catch clicks outside */\n\t\t.content-editor-settings-overlay\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t\tz-index: 999;\n\t\t}\n\t\t.content-editor-settings-overlay.open\n\t\t{\n\t\t\tdisplay: block;\n\t\t}\n\t\t/* Flyout panel */\n\t\t.content-editor-settings-flyout\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 44px;\n\t\t\tright: 0;\n\t\t\twidth: 270px;\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 8px;\n\t\t\tbox-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);\n\t\t\tz-index: 1000;\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(-4px);\n\t\t\tpointer-events: none;\n\t\t\ttransition: opacity 0.15s ease, transform 0.15s ease;\n\t\t}\n\t\t.content-editor-settings-flyout.open\n\t\t{\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t\tpointer-events: auto;\n\t\t}\n\t\t/* Speech bubble arrow */\n\t\t.content-editor-settings-flyout::before\n\t\t{\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\ttop: -7px;\n\t\t\tright: 12px;\n\t\t\twidth: 12px;\n\t\t\theight: 12px;\n\t\t\tbackground: #FFF;\n\t\t\tborder-left: 1px solid #DDD6CA;\n\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\ttransform: rotate(45deg);\n\t\t}\n\t\t.content-editor-settings-flyout-body\n\t\t{\n\t\t\tpadding: 8px;\n\t\t}\n\t\t.content-editor-settings-flyout-link\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 10px 12px;\n\t\t\tborder-radius: 6px;\n\t\t\ttext-decoration: none;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-size: 0.85rem;\n\t\t\tfont-weight: 500;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.content-editor-settings-flyout-link:hover\n\t\t{\n\t\t\tbackground: #F5F3EE;\n\t\t}\n\t\t.content-editor-settings-flyout-link svg\n\t\t{\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\tflex-shrink: 0;\n\t\t\tfill: #8A7F72;\n\t\t}\n\t\t.content-editor-settings-divider\n\t\t{\n\t\t\theight: 1px;\n\t\t\tbackground: #EDE9E3;\n\t\t\tmargin: 4px 8px;\n\t\t}\n\t\t/* Settings controls */\n\t\t.content-editor-settings-section\n\t\t{\n\t\t\tpadding: 8px 12px;\n\t\t}\n\t\t.content-editor-settings-label\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.5px;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 8px;\n\t\t}\n\t\t.content-editor-settings-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tgap: 8px;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.content-editor-settings-row:last-child\n\t\t{\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t\t.content-editor-settings-checkbox\n\t\t{\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\taccent-color: #2E7D74;\n\t\t\tcursor: pointer;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-settings-checkbox-label\n\t\t{\n\t\t\tfont: inherit;\n\t\t\tfont-size: 0.85rem;\n\t\t\tcolor: #3D3229;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.content-editor-settings-select\n\t\t{\n\t\t\twidth: 140px;\n\t\t\tpadding: 5px 8px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: #FFF;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #3D3229;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.content-editor-settings-select:disabled\n\t\t{\n\t\t\topacity: 0.45;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.content-editor-settings-select-label\n\t\t{\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Tablet / Phone (max-width: 768px)\n\t\t ============================================ */\n\t\t@media (max-width: 768px)\n\t\t{\n\t\t\t/* Settings flyout: position from left edge for more room */\n\t\t\t.content-editor-settings-flyout\n\t\t\t{\n\t\t\t\tright: -8px;\n\t\t\t\twidth: 260px;\n\t\t\t}\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Small phone (max-width: 480px)\n\t\t ============================================ */\n\t\t@media (max-width: 480px)\n\t\t{\n\t\t\t/* Full-width settings flyout on small phones */\n\t\t\t.content-editor-settings-flyout\n\t\t\t{\n\t\t\t\tposition: fixed;\n\t\t\t\ttop: 48px;\n\t\t\t\tright: 0;\n\t\t\t\tleft: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\tborder-radius: 0 0 8px 8px;\n\t\t\t}\n\t\t\t.content-editor-settings-flyout::before\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t}\n\t",Templates:[{Hash:"ContentEditor-SettingsPanel-Template",Template:'\n<div class="content-editor-settings-wrap">\n\t<button class="content-editor-settings-gear" id="ContentEditor-SettingsGear"\n\t\tonclick="{~P~}.views[\'ContentEditor-SettingsPanel\'].togglePanel()">\n\t\t<svg viewBox="0 0 24 24"><path d="M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.49.49 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.48.48 0 0 0-.48-.41h-3.84a.48.48 0 0 0-.48.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96a.49.49 0 0 0-.59.22L2.74 8.87a.48.48 0 0 0 .12.61l2.03 1.58c-.05.3-.07.62-.07.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.26.41.48.41h3.84c.24 0 .44-.17.48-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6A3.6 3.6 0 1 1 12 8.4a3.6 3.6 0 0 1 0 7.2z"/></svg>\n\t</button>\n\t<div class="content-editor-settings-overlay" id="ContentEditor-SettingsOverlay"\n\t\tonclick="{~P~}.views[\'ContentEditor-SettingsPanel\'].closePanel()"></div>\n\t<div class="content-editor-settings-flyout" id="ContentEditor-SettingsFlyout">\n\t\t<div class="content-editor-settings-flyout-body">\n\t\t\t<a class="content-editor-settings-flyout-link"\n\t\t\t\thref="/preview.html{~D:AppData.ContentEditor.ViewerHash~}" target="_blank">\n\t\t\t\t<svg viewBox="0 0 24 24"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>\n\t\t\t\tDocuserve Preview\n\t\t\t</a>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">Word Wrap</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-MarkdownWordWrap">Markdown Word Wrap</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-MarkdownWordWrap"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onMarkdownWordWrapChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-CodeWordWrap">Code Word Wrap</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-CodeWordWrap"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onCodeWordWrapChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">Markdown Editor</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-EditingControls">Editing Controls</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-EditingControls"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onEditingControlsChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<span class="content-editor-settings-select-label">Content Preview</span>\n\t\t\t\t\t<select class="content-editor-settings-select"\n\t\t\t\t\t\tid="ContentEditor-Setting-ContentPreviewMode"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onContentPreviewModeChanged(this.value)">\n\t\t\t\t\t\t<option value="off">Off</option>\n\t\t\t\t\t\t<option value="bottom">Underneath</option>\n\t\t\t\t\t\t<option value="side">Beside</option>\n\t\t\t\t\t\t<option value="tabbed">Tab</option>\n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoSegment">Auto Segment Markdown</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoSegment"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoSegmentChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<span class="content-editor-settings-select-label">Segment Depth</span>\n\t\t\t\t\t<select class="content-editor-settings-select"\n\t\t\t\t\t\tid="ContentEditor-Setting-SegmentDepth"\n\t\t\t\t\t\tdisabled\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onSegmentDepthChanged(this.value)">\n\t\t\t\t\t\t<option value="1">Depth 1: Blocks</option>\n\t\t\t\t\t\t<option value="2">Depth 2: ##</option>\n\t\t\t\t\t\t<option value="3">Depth 3: ###</option>\n\t\t\t\t\t\t<option value="4">Depth 4: ####</option>\n\t\t\t\t\t\t<option value="5">Depth 5: #####</option>\n\t\t\t\t\t\t<option value="6">Depth 6: ######</option>\n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">Media Preview</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoPreviewImages">Auto-Preview Images</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoPreviewImages"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoPreviewImagesChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoPreviewVideo">Auto-Preview Video</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoPreviewVideo"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoPreviewVideoChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoPreviewAudio">Auto-Preview Audio</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoPreviewAudio"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoPreviewAudioChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">File Browser</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-ShowHiddenFiles">Show Hidden Files</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-ShowHiddenFiles"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onShowHiddenFilesChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-SettingsPanel-Display",TemplateHash:"ContentEditor-SettingsPanel-Template",DestinationAddress:"#ContentEditor-SettingsPanel-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._isOpen=!1}onAfterRender(t,e,i,n){let o=this.pict.AppData.ContentEditor,r=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-MarkdownWordWrap");r&&r[0]&&(r[0].checked=o.MarkdownWordWrap);let a=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-CodeWordWrap");a&&a[0]&&(a[0].checked=o.CodeWordWrap);let s=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-EditingControls");s&&s[0]&&(s[0].checked=o.MarkdownEditingControls);let l=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-ContentPreviewMode");l&&l[0]&&(l[0].value=o.ContentPreviewMode||"off");let d=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoSegment");d&&d[0]&&(d[0].checked=o.AutoSegmentMarkdown);let c=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-SegmentDepth");c&&c[0]&&(c[0].value=String(o.AutoSegmentDepth),c[0].disabled=!o.AutoSegmentMarkdown);let p=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoPreviewImages");p&&p[0]&&(p[0].checked=o.AutoPreviewImages);let h=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoPreviewVideo");h&&h[0]&&(h[0].checked=o.AutoPreviewVideo);let u=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoPreviewAudio");u&&u[0]&&(u[0].checked=o.AutoPreviewAudio);let m=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-ShowHiddenFiles");return m&&m[0]&&(m[0].checked=o.ShowHiddenFiles),super.onAfterRender(t,e,i,n)}togglePanel(){this._isOpen?this.closePanel():this.openPanel()}openPanel(){this._isOpen=!0;let t=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsFlyout"),e=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsOverlay"),i=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsGear");t&&t[0]&&t[0].classList.add("open"),e&&e[0]&&e[0].classList.add("open"),i&&i[0]&&i[0].classList.add("active")}closePanel(){this._isOpen=!1;let t=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsFlyout"),e=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsOverlay"),i=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsGear");t&&t[0]&&t[0].classList.remove("open"),e&&e[0]&&e[0].classList.remove("open"),i&&i[0]&&i[0].classList.remove("active")}onMarkdownWordWrapChanged(t){this.pict.AppData.ContentEditor.MarkdownWordWrap=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-MarkdownEditor"];if(e&&"markdown"===this.pict.AppData.ContentEditor.ActiveEditor&&e._segmentEditors)for(let i in e._segmentEditors){let n=e._segmentEditors[i];n&&n.contentDOM&&(t?n.contentDOM.classList.add("cm-lineWrapping"):n.contentDOM.classList.remove("cm-lineWrapping"))}}onCodeWordWrapChanged(t){this.pict.AppData.ContentEditor.CodeWordWrap=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-CodeEditor"];e&&e._editorElement&&"code"===this.pict.AppData.ContentEditor.ActiveEditor&&(t?(e._editorElement.style.whiteSpace="pre-wrap",e._editorElement.style.overflowWrap="break-word"):(e._editorElement.style.whiteSpace="pre",e._editorElement.style.overflowWrap="normal"))}onEditingControlsChanged(t){this.pict.AppData.ContentEditor.MarkdownEditingControls=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-MarkdownEditor"];e&&"markdown"===this.pict.AppData.ContentEditor.ActiveEditor&&e.toggleControls(t)}onContentPreviewModeChanged(t){this.pict.AppData.ContentEditor.ContentPreviewMode=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-MarkdownEditor"];e&&"markdown"===this.pict.AppData.ContentEditor.ActiveEditor&&e.setPreviewMode(t)}onAutoSegmentChanged(t){this.pict.AppData.ContentEditor.AutoSegmentMarkdown=t,this.pict.PictApplication.saveSettings();let e=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-SegmentDepth");e&&e[0]&&(e[0].disabled=!t)}onSegmentDepthChanged(t){this.pict.AppData.ContentEditor.AutoSegmentDepth=parseInt(t,10)||1,this.pict.PictApplication.saveSettings()}onAutoPreviewImagesChanged(t){this.pict.AppData.ContentEditor.AutoPreviewImages=t,this.pict.PictApplication.saveSettings()}onAutoPreviewVideoChanged(t){this.pict.AppData.ContentEditor.AutoPreviewVideo=t,this.pict.PictApplication.saveSettings()}onAutoPreviewAudioChanged(t){this.pict.AppData.ContentEditor.AutoPreviewAudio=t,this.pict.PictApplication.saveSettings()}onShowHiddenFilesChanged(t){this.pict.AppData.ContentEditor.ShowHiddenFiles=t,this.pict.PictApplication.saveSettings();let e=this;this.pict.PictApplication.syncHiddenFilesSetting(()=>{e.pict.PictApplication.loadFileList()})}},e.exports.default_configuration=o},{"pict-view":102}],121:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"ContentEditor-TopBar",DefaultRenderable:"ContentEditor-TopBar-Display",DefaultDestinationAddress:"#ContentEditor-TopBar-Container",AutoRender:!1,CSS:"\n\t\t.content-editor-topbar\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 0;\n\t\t\theight: 48px;\n\t\t\tborder-bottom: 3px solid #2E7D74;\n\t\t\tposition: relative;\n\t\t}\n\t\t.content-editor-topbar-brand\n\t\t{\n\t\t\tpadding: 0 16px;\n\t\t\tfont-size: 1rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #E8E0D4;\n\t\t\twhite-space: nowrap;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t/* Centered file name — absolutely positioned so it stays\n\t\t centered in the full bar regardless of left/right content */\n\t\t.content-editor-topbar-file\n\t\t{\n\t\t\tposition: absolute;\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t\tmax-width: 50%;\n\t\t\ttext-align: center;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\tpointer-events: none;\n\t\t}\n\t\t.content-editor-topbar-filename\n\t\t{\n\t\t\tfont-size: 0.9rem;\n\t\t\tfont-weight: 500;\n\t\t\tcolor: #E8E0D4;\n\t\t\tletter-spacing: 0.2px;\n\t\t}\n\t\t.content-editor-topbar-file .content-editor-dirty-indicator\n\t\t{\n\t\t\tcolor: #E8A94D;\n\t\t\tfont-weight: bold;\n\t\t}\n\t\t/* Left spacer pushes actions to the right */\n\t\t.content-editor-topbar-spacer\n\t\t{\n\t\t\tflex: 1;\n\t\t}\n\t\t.content-editor-topbar-status\n\t\t{\n\t\t\tpadding: 0 12px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-status-saving\n\t\t{\n\t\t\tcolor: #E8A94D;\n\t\t}\n\t\t.content-editor-status-saved\n\t\t{\n\t\t\tcolor: #7BC47F;\n\t\t}\n\t\t.content-editor-status-error\n\t\t{\n\t\t\tcolor: #D9534F;\n\t\t}\n\t\t.content-editor-topbar-stats\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\twhite-space: nowrap;\n\t\t\tpadding: 0 8px;\n\t\t\tflex-shrink: 0;\n\t\t\tletter-spacing: 0.2px;\n\t\t}\n\t\t.content-editor-topbar-actions\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 0 12px;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-topbar-btn\n\t\t{\n\t\t\tpadding: 6px 14px;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.8rem;\n\t\t\tfont-weight: 600;\n\t\t}\n\t\t.content-editor-topbar-btn-save\n\t\t{\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t}\n\t\t.content-editor-topbar-btn-save:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.content-editor-topbar-btn-save:disabled\n\t\t{\n\t\t\tbackground: #5E5549;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.content-editor-topbar-btn-close\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #B8AFA4;\n\t\t\tborder: 1px solid #5E5549;\n\t\t}\n\t\t.content-editor-topbar-btn-close:hover\n\t\t{\n\t\t\tcolor: #E8E0D4;\n\t\t\tborder-color: #8A7F72;\n\t\t\tbackground: rgba(255, 255, 255, 0.05);\n\t\t}\n\t\t/* Close-file confirmation overlay */\n\t\t.content-editor-confirm-overlay\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t\tz-index: 1099;\n\t\t\tbackground: rgba(0, 0, 0, 0.35);\n\t\t}\n\t\t.content-editor-confirm-overlay.open\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.content-editor-confirm-panel\n\t\t{\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 10px;\n\t\t\tbox-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);\n\t\t\twidth: 360px;\n\t\t\tmax-width: 90vw;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.content-editor-confirm-body\n\t\t{\n\t\t\tpadding: 24px 22px 16px;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.content-editor-confirm-icon\n\t\t{\n\t\t\tfont-size: 2rem;\n\t\t\tmargin-bottom: 8px;\n\t\t\tcolor: #E8A94D;\n\t\t}\n\t\t.content-editor-confirm-title\n\t\t{\n\t\t\tfont-size: 0.95rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.content-editor-confirm-message\n\t\t{\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t\tmargin-bottom: 16px;\n\t\t\tline-height: 1.5;\n\t\t}\n\t\t.content-editor-confirm-actions\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 10px;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.content-editor-confirm-btn\n\t\t{\n\t\t\tpadding: 8px 20px;\n\t\t\tborder: none;\n\t\t\tborder-radius: 5px;\n\t\t\tfont-size: 0.82rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.content-editor-confirm-btn-discard\n\t\t{\n\t\t\tbackground: #D9534F;\n\t\t\tcolor: #FFF;\n\t\t}\n\t\t.content-editor-confirm-btn-discard:hover\n\t\t{\n\t\t\tbackground: #C9302C;\n\t\t}\n\t\t.content-editor-confirm-btn-cancel\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t}\n\t\t.content-editor-confirm-btn-cancel:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t}\n\t\t.content-editor-confirm-footer\n\t\t{\n\t\t\tpadding: 10px 22px;\n\t\t\tborder-top: 1px solid #EDE9E3;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.content-editor-confirm-kbd\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 1px 5px;\n\t\t\tfont-size: 0.68rem;\n\t\t\tfont-family: monospace;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tcolor: #5E5549;\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Tablet / Phone (max-width: 768px)\n\t\t ============================================ */\n\t\t@media (max-width: 768px)\n\t\t{\n\t\t\t.content-editor-topbar\n\t\t\t{\n\t\t\t\theight: auto;\n\t\t\t\tmin-height: 44px;\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tpadding: 4px 0;\n\t\t\t}\n\n\t\t\t/* Brand text: shrink */\n\t\t\t.content-editor-topbar-brand\n\t\t\t{\n\t\t\t\tpadding: 0 8px;\n\t\t\t\tfont-size: 0.85rem;\n\t\t\t}\n\n\t\t\t/* File name: switch from absolute centering to flow layout */\n\t\t\t.content-editor-topbar-file\n\t\t\t{\n\t\t\t\tposition: static;\n\t\t\t\ttransform: none;\n\t\t\t\tmax-width: none;\n\t\t\t\tflex: 1;\n\t\t\t\tmin-width: 0;\n\t\t\t\tpadding: 0 4px;\n\t\t\t}\n\n\t\t\t/* Hide the spacer (not needed when file is in-flow) */\n\t\t\t.content-editor-topbar-spacer\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t/* Hide word/line count stats on mobile to save space */\n\t\t\t.content-editor-topbar-stats\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t/* Compact action buttons */\n\t\t\t.content-editor-topbar-actions\n\t\t\t{\n\t\t\t\tgap: 4px;\n\t\t\t\tpadding: 0 6px;\n\t\t\t}\n\n\t\t\t.content-editor-topbar-btn\n\t\t\t{\n\t\t\t\tpadding: 5px 10px;\n\t\t\t\tfont-size: 0.75rem;\n\t\t\t}\n\n\t\t\t/* Status text */\n\t\t\t.content-editor-topbar-status\n\t\t\t{\n\t\t\t\tpadding: 0 6px;\n\t\t\t\tfont-size: 0.72rem;\n\t\t\t}\n\n\t\t\t/* Confirm dialog: tighter for mobile */\n\t\t\t.content-editor-confirm-panel\n\t\t\t{\n\t\t\t\twidth: 95vw;\n\t\t\t\tmax-width: 95vw;\n\t\t\t}\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Small phone (max-width: 480px)\n\t\t ============================================ */\n\t\t@media (max-width: 480px)\n\t\t{\n\t\t\t/* Hide brand text entirely on very small screens */\n\t\t\t.content-editor-topbar-brand\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t.content-editor-topbar-filename\n\t\t\t{\n\t\t\t\tfont-size: 0.8rem;\n\t\t\t}\n\n\t\t\t.content-editor-topbar-actions\n\t\t\t{\n\t\t\t\tpadding: 0 4px;\n\t\t\t}\n\t\t}\n\t",Templates:[{Hash:"ContentEditor-TopBar-Template",Template:'\n<div class="content-editor-topbar">\n\t<div class="content-editor-topbar-brand">Content Editor</div>\n\t<div class="content-editor-topbar-file">\n\t\t<span class="content-editor-topbar-filename">{~D:AppData.ContentEditor.CurrentFile~}</span>{~D:AppData.ContentEditor.DirtyIndicatorHTML~}\n\t</div>\n\t<div class="content-editor-topbar-spacer"></div>\n\t<div class="content-editor-topbar-status {~D:AppData.ContentEditor.SaveStatusClass~}">\n\t\t{~D:AppData.ContentEditor.SaveStatus~}\n\t</div>\n\t<span class="content-editor-topbar-stats" id="ContentEditor-Stats"></span>\n\t<div class="content-editor-topbar-actions">\n\t\t<button class="content-editor-topbar-btn content-editor-topbar-btn-save"\n\t\t\tonclick="{~P~}.PictApplication.saveCurrentFile()"\n\t\t\t{~D:AppData.ContentEditor.SaveDisabledAttr~} {~D:AppData.ContentEditor.SaveVisibilityAttr~}>Save</button>\n\t\t<button class="content-editor-topbar-btn content-editor-topbar-btn-close"\n\t\t\tonclick="{~P~}.PictApplication.closeCurrentFile()"\n\t\t\t{~D:AppData.ContentEditor.CloseVisibilityAttr~}>Close</button>\n\t\t<button class="content-editor-topbar-btn" id="ContentEditor-DocsToggle"\n\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].toggleDocPanel()"\n\t\t\ttitle="Toggle documentation panel (right side)">Docs</button>\n\t\t<div id="ContentEditor-SettingsPanel-Container"></div>\n\t</div>\n</div>\n<div class="content-editor-confirm-overlay" id="ContentEditor-ConfirmOverlay"\n\tonclick="{~P~}.PictApplication.cancelCloseFile()">\n\t<div class="content-editor-confirm-panel" onclick="event.stopPropagation()">\n\t\t<div class="content-editor-confirm-body">\n\t\t\t<div class="content-editor-confirm-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M8 1L1 14h14z"/><line x1="8" y1="6" x2="8" y2="9"/><circle cx="8" cy="11.5" r="0.5" fill="currentColor" stroke="none"/></svg></div>\n\t\t\t<div class="content-editor-confirm-title">Unsaved Changes</div>\n\t\t\t<div class="content-editor-confirm-message">\n\t\t\t\tThis file has unsaved changes.<br>Close without saving?\n\t\t\t</div>\n\t\t\t<div class="content-editor-confirm-actions">\n\t\t\t\t<button class="content-editor-confirm-btn content-editor-confirm-btn-discard"\n\t\t\t\t\tonclick="{~P~}.PictApplication.confirmCloseFile()">Discard & Close</button>\n\t\t\t\t<button class="content-editor-confirm-btn content-editor-confirm-btn-cancel"\n\t\t\t\t\tonclick="{~P~}.PictApplication.cancelCloseFile()">Cancel</button>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="content-editor-confirm-footer">\n\t\t\t<span class="content-editor-confirm-kbd">Y</span> to discard ·\n\t\t\t<span class="content-editor-confirm-kbd">N</span> or\n\t\t\t<span class="content-editor-confirm-kbd">Esc</span> to cancel\n\t\t</div>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-TopBar-Display",TemplateHash:"ContentEditor-TopBar-Template",DestinationAddress:"#ContentEditor-TopBar-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onBeforeRender(t,e,i){let n=this.pict.AppData.ContentEditor;if(n.DirtyIndicatorHTML=n.IsDirty?' <span class="content-editor-dirty-indicator">*</span>':"",n.SaveDisabledAttr=!n.CurrentFile||n.IsSaving?"disabled":"",n.SaveVisibilityAttr=n.IsDirty||n.IsSaving||n.SaveStatus?"":'style="display:none"',n.CloseVisibilityAttr=n.CurrentFile?"":'style="display:none"',n.CurrentFile){let t=n.CurrentFile.replace(/\.md$/,"");n.ViewerHash="#/page/"+t}else n.ViewerHash="";return super.onBeforeRender(t,e,i)}onAfterRender(t,e,i,n){let o=this.pict.views["ContentEditor-SettingsPanel"];return o&&o.render(),super.onAfterRender(t,e,i,n)}},e.exports.default_configuration=o},{"pict-view":102}],122:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"ContentEditor-Topics",DefaultRenderable:"Topics-Wrap",DefaultDestinationAddress:"#ContentEditor-SidebarTopics-Container",AutoRender:!1,CSS:"\n\t\t.topics-container\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.topics-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 6px;\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-bottom: 1px solid #EDE9E3;\n\t\t\tbackground: #FAF8F4;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.topics-header-title\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: #5E5549;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.topics-header-btn\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tpadding: 2px 6px;\n\t\t\tborder-radius: 3px;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.topics-header-btn:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t.topics-list\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\toverflow-x: hidden;\n\t\t}\n\t\t.topics-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: flex-start;\n\t\t\tgap: 6px;\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-bottom: 1px solid #F0EDE8;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.topics-row:hover\n\t\t{\n\t\t\tbackground: #F5F0EA;\n\t\t}\n\t\t.topics-row-info\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.topics-row-code\n\t\t{\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: #2E7D74;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.topics-row-title\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #5E5549;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\tmargin-top: 1px;\n\t\t}\n\t\t.topics-row-path\n\t\t{\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: #8A7F72;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\tmargin-top: 1px;\n\t\t}\n\t\t.topics-row-actions\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tdisplay: flex;\n\t\t\tgap: 2px;\n\t\t\tpadding-top: 1px;\n\t\t}\n\t\t.topics-row-btn\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tpadding: 2px 4px;\n\t\t\tborder-radius: 3px;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.topics-row-btn:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t.topics-row-btn-delete:hover\n\t\t{\n\t\t\tcolor: #D9534F;\n\t\t\tbackground: #FDF0EF;\n\t\t}\n\t\t/* Inline edit form */\n\t\t.topics-edit\n\t\t{\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tbackground: #FFF9F0;\n\t\t}\n\t\t.topics-edit-field\n\t\t{\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.topics-edit-label\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tfont-size: 0.68rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 2px;\n\t\t}\n\t\t.topics-edit-input\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t\tpadding: 4px 6px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: #FFF;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.topics-edit-input:focus\n\t\t{\n\t\t\toutline: none;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.topics-edit-actions\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 6px;\n\t\t\tmargin-top: 8px;\n\t\t}\n\t\t.topics-edit-save\n\t\t{\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 4px 12px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.topics-edit-save:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.topics-edit-cancel\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 4px 12px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.topics-edit-cancel:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t}\n\t\t/* Footer add button */\n\t\t.topics-footer\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-top: 1px solid #EDE9E3;\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t.topics-add-btn\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tpadding: 6px 0;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.topics-add-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t/* Empty state */\n\t\t.topics-empty\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 32px 16px;\n\t\t\ttext-align: center;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 0.82rem;\n\t\t}\n\t\t.topics-empty-icon\n\t\t{\n\t\t\tfont-size: 2rem;\n\t\t\tcolor: #C4BDB3;\n\t\t}\n\t\t.topics-empty-btn\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 6px 14px;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.topics-empty-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.topics-empty-btn-secondary\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t}\n\t\t.topics-empty-btn-secondary:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder-color: #8A7F72;\n\t\t}\n\t",Templates:[{Hash:"Topics-Container-Template",Template:'\n<div class="topics-container" id="ContentEditor-Topics-Container">\n\t<div class="topics-header">\n\t\t<span class="topics-header-title" id="ContentEditor-Topics-HeaderTitle">Topics</span>\n\t\t<button class="topics-header-btn" title="Close topics file"\n\t\t\tonclick="pict.views[\'ContentEditor-Topics\'].closeTopicsFile()">×</button>\n\t</div>\n\t<div class="topics-list" id="ContentEditor-Topics-List"></div>\n\t<div class="topics-footer" id="ContentEditor-Topics-Footer">\n\t\t<button class="topics-add-btn"\n\t\t\tonclick="pict.views[\'ContentEditor-Topics\'].addTopic()">+ Add Topic</button>\n\t</div>\n</div>\n'},{Hash:"Topics-Row-Template",Template:'\n<div class="topics-row" ondblclick="{~P~}.views[\'{~D:Record.ViewHash~}\'].startEditTopic(\'{~D:Record.CodeEscaped~}\')">\n <div class="topics-row-info">\n <div class="topics-row-code">{~D:Record.Code~}</div>\n <div class="topics-row-title">{~D:Record.Title~}</div>\n <div class="topics-row-path">{~D:Record.PathDisplay~}</div>\n </div>\n <div class="topics-row-actions">\n <button class="topics-row-btn" title="Edit" onclick="event.stopPropagation();{~P~}.views[\'{~D:Record.ViewHash~}\'].startEditTopic(\'{~D:Record.CodeEscaped~}\')"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M11.5 1.5l3 3L5 14H2v-3z"/><line x1="9" y1="4" x2="12" y2="7"/></svg></button>\n <button class="topics-row-btn topics-row-btn-delete" title="Delete" onclick="event.stopPropagation();{~P~}.views[\'{~D:Record.ViewHash~}\'].removeTopic(\'{~D:Record.CodeEscaped~}\')"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg></button>\n {~D:Record.NavigateButton~}\n </div>\n</div>\n'},{Hash:"Topics-EditForm-Template",Template:'\n<div class="topics-edit">\n <div class="topics-edit-field">\n <label class="topics-edit-label">Topic Code</label>\n <input class="topics-edit-input" id="topics-edit-code" type="text" value="{~D:Record.Code~}" placeholder="My-Topic-Code">\n </div>\n <div class="topics-edit-field">\n <label class="topics-edit-label">Title</label>\n <input class="topics-edit-input" id="topics-edit-title" type="text" value="{~D:Record.Title~}" placeholder="Topic title">\n </div>\n <div class="topics-edit-field">\n <label class="topics-edit-label">Help File Path</label>\n <input class="topics-edit-input" id="topics-edit-path" type="text" value="{~D:Record.Path~}" placeholder="path/to/file.md">\n </div>\n <div class="topics-edit-field">\n <label class="topics-edit-label">Line Number (optional)</label>\n <input class="topics-edit-input" id="topics-edit-line" type="number" value="{~D:Record.Line~}" placeholder="e.g. 23" min="1">\n </div>\n <div class="topics-edit-actions">\n <button class="topics-edit-save" onclick="{~P~}.views[\'{~D:Record.ViewHash~}\'].saveEditTopic(\'{~D:Record.OriginalCode~}\')">Save</button>\n <button class="topics-edit-cancel" onclick="{~P~}.views[\'{~D:Record.ViewHash~}\'].cancelEditTopic()">Cancel</button>\n </div>\n</div>\n'},{Hash:"Topics-Empty-Template",Template:'\n<div class="topics-empty">\n <div class="topics-empty-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M4 1h5l4 4v9a1 1 0 01-1 1H4a1 1 0 01-1-1V2a1 1 0 011-1z"/><path d="M9 1v4h4"/><line x1="5" y1="8" x2="11" y2="8"/><line x1="5" y1="11" x2="9" y2="11"/></svg></div>\n <div>No topics file loaded</div>\n <button class="topics-empty-btn" onclick="{~P~}.views[\'{~D:Record.ViewHash~}\'].loadDefaultTopicsFile()">Load .pict_documentation_topics.json</button>\n <button class="topics-empty-btn topics-empty-btn-secondary" onclick="{~P~}.views[\'{~D:Record.ViewHash~}\'].promptSelectTopicsFile()">Select file...</button>\n</div>\n'},{Hash:"Topics-EmptyList-Template",Template:'\n<div style="padding:16px;text-align:center;color:#8A7F72;font-size:0.78rem;">No topics yet. Click "+ Add Topic" to create one.</div>\n'}],Renderables:[{RenderableHash:"Topics-Wrap",TemplateHash:"Topics-Container-Template",DestinationAddress:"#ContentEditor-SidebarTopics-Container"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._topics={},this._topicsFilePath="",this._hasRendered=!1,this._editingTopicCode=null}onAfterRender(t,e,i,n){return this._hasRendered=!0,this.pict.CSSMap.injectCSS(),this._topicsFilePath?(this._updateHeaderTitle(),this.renderTopicList()):this._showEmptyState(),super.onAfterRender(t,e,i,n)}loadTopicsFile(t,e){let i="function"==typeof e?e:()=>{},n=this;if(!t)return i("No path specified");let o=this.pict.providers["ContentEditor-Provider"];if(!o)return i("Provider not available");o.loadFile(t,(e,o)=>{if(e)return n._topics={},n._topicsFilePath="",n._hasRendered&&n._showEmptyState(),i(e);try{let t=JSON.parse(o);"object"!=typeof t||null===t||Array.isArray(t)?n._topics={}:n._topics=t}catch(t){n._topics={},n.log.warn("ContentEditor-Topics: Failed to parse topics JSON: "+t.message)}return n._topicsFilePath=t,n.pict.AppData.ContentEditor.TopicsFilePath=t,n.pict.PictApplication.saveSettings(),n._hasRendered&&(n._updateHeaderTitle(),n.renderTopicList(),n._showFooter(!0)),i(null)})}saveTopicsFile(t){let e="function"==typeof t?t:()=>{};if(!this._topicsFilePath)return e("No topics file loaded");let i=this.pict.providers["ContentEditor-Provider"];if(!i)return e("Provider not available");let n=JSON.stringify(this._topics,null,"\t");i.saveFile(this._topicsFilePath,n,e)}closeTopicsFile(){this._topics={},this._topicsFilePath="",this._editingTopicCode=null,this.pict.AppData.ContentEditor.TopicsFilePath="",this.pict.PictApplication.saveSettings(),this._hasRendered&&this._showEmptyState()}addTopic(t){if(!this._topicsFilePath)return void this._createDefaultTopicsFile(()=>{this.addTopic(t)});let e=t||{},i=e.TopicCode||this._generateUniqueCode("New-Topic"),n={TopicCode:i,TopicHelpFilePath:e.TopicHelpFilePath||"",TopicTitle:e.TopicTitle||""};"number"==typeof e.RelevantMarkdownLine&&(n.RelevantMarkdownLine=e.RelevantMarkdownLine),this._topics[i]=n;let o=this;this.saveTopicsFile(()=>{o.renderTopicList(),o.startEditTopic(i)})}removeTopic(t){if(!t||!this._topics[t])return;if(!confirm('Remove topic "'+t+'"?'))return;delete this._topics[t],this._editingTopicCode=null;let e=this;this.saveTopicsFile(()=>{e.renderTopicList()})}startEditTopic(t){if(!t||!this._topics[t])return;this._editingTopicCode=t,this.renderTopicList();let e=this.pict.ContentAssignment.getElement("#topics-edit-code")[0];e&&(e.focus(),e.select())}saveEditTopic(t){if(!t||!this._topics[t])return;let e=this.pict.ContentAssignment.getElement("#topics-edit-code")[0],i=this.pict.ContentAssignment.getElement("#topics-edit-title")[0],n=this.pict.ContentAssignment.getElement("#topics-edit-path")[0],o=this.pict.ContentAssignment.getElement("#topics-edit-line")[0];if(!e)return;let r=e.value.trim(),a=i?i.value.trim():"",s=n?n.value.trim():"",l=o?parseInt(o.value,10):NaN;if(!r)return void(e.style.borderColor="#D9534F");if(r!==t&&this._topics[r])return e.style.borderColor="#D9534F",void alert('A topic with code "'+r+'" already exists.');r!==t&&delete this._topics[t];let d={TopicCode:r,TopicHelpFilePath:s,TopicTitle:a};!isNaN(l)&&l>0&&(d.RelevantMarkdownLine=l),this._topics[r]=d,this._editingTopicCode=null;let c=this;this.saveTopicsFile(()=>{c.renderTopicList()})}cancelEditTopic(){this._editingTopicCode=null,this.renderTopicList()}navigateToTopic(t){if(!t||!this._topics[t])return;let e=this._topics[t],i=e.TopicHelpFilePath;if(i&&(this.pict.PictApplication.navigateToFile(i),"number"==typeof e.RelevantMarkdownLine&&e.RelevantMarkdownLine>0)){let t=e.RelevantMarkdownLine;setTimeout(()=>{let e=this.pict.views["ContentEditor-MarkdownEditor"];if(e&&e._segmentEditors){let i=0;for(let n in e._segmentEditors){let o=e._segmentEditors[n];if(o&&o.state&&o.state.doc){let e=o.state.doc.lines;if(i+e>=t){let n=t-i;n<1&&(n=1),n>e&&(n=e);let r=o.state.doc.line(n);o.dispatch({selection:{anchor:r.from},scrollIntoView:!0}),o.focus();break}i+=e}}}},500)}}renderTopicList(){if(!this.pict.ContentAssignment.getElement("#ContentEditor-Topics-List")[0])return;let t=Object.keys(this._topics);if(0===t.length)return void this.pict.ContentAssignment.assignContent("#ContentEditor-Topics-List",this.pict.parseTemplateByHash("Topics-EmptyList-Template",{}));let e="",i=this.pict.PictApplication.pict_configuration.Pict+".views['"+this.Hash+"']";for(let n=0;n<t.length;n++){let o=t[n],r=this._topics[o],a=this._escapeHTML(r.TopicCode||""),s=this._escapeAttr(r.TopicCode||""),l=this._escapeHTML(r.TopicTitle||""),d=this._escapeHTML(r.TopicHelpFilePath||""),c="number"==typeof r.RelevantMarkdownLine?r.RelevantMarkdownLine:"",p="number"==typeof r.RelevantMarkdownLine?" :"+r.RelevantMarkdownLine:"",h=this._escapeAttr(r.TopicHelpFilePath||""),u=this._escapeAttr(r.TopicCode||""),m="";r.TopicHelpFilePath&&(m='<button class="topics-row-btn" title="Go to file" onclick="event.stopPropagation();'+i+".navigateToTopic('"+s+'\')"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="8" x2="13" y2="8"/><polyline points="9,4 13,8 9,12"/></svg></button>');let g={ViewHash:this.Hash,Code:a,CodeEscaped:s,Title:l,PathDisplay:d+p,Path:h,Line:c,OriginalCode:u,NavigateButton:m};this._editingTopicCode===o?e+=this.pict.parseTemplateByHash("Topics-EditForm-Template",g):e+=this.pict.parseTemplateByHash("Topics-Row-Template",g)}this.pict.ContentAssignment.assignContent("#ContentEditor-Topics-List",e)}_showEmptyState(){if(!this.pict.ContentAssignment.getElement("#ContentEditor-Topics-Container")[0]){return void(this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTopics-Container")[0]&&this.pict.ContentAssignment.assignContent("#ContentEditor-SidebarTopics-Container",this.pict.parseTemplateByHash("Topics-Empty-Template",{ViewHash:this.Hash})))}this.pict.ContentAssignment.assignContent("#ContentEditor-Topics-Container",this.pict.parseTemplateByHash("Topics-Empty-Template",{ViewHash:this.Hash}))}loadDefaultTopicsFile(){let t=this;this.loadTopicsFile(".pict_documentation_topics.json",e=>{e&&t._createDefaultTopicsFile()})}promptSelectTopicsFile(){let t=prompt("Enter the path to a topics JSON file:",".pict_documentation_topics.json");if(t&&t.trim()){let e=this;this.loadTopicsFile(t.trim(),i=>{i&&confirm('File not found. Create "'+t.trim()+'"?')&&(e._topicsFilePath=t.trim(),e._topics={},e.pict.AppData.ContentEditor.TopicsFilePath=t.trim(),e.pict.PictApplication.saveSettings(),e.saveTopicsFile(()=>{e._hasRendered&&e.render()}))})}}_createDefaultTopicsFile(t){let e="function"==typeof t?t:()=>{},i=this,n=".pict_documentation_topics.json";this._topicsFilePath=n,this._topics={},this.pict.AppData.ContentEditor.TopicsFilePath=n,this.pict.PictApplication.saveSettings(),this.saveTopicsFile(()=>{i._hasRendered&&i.render(),e()})}_updateHeaderTitle(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-Topics-HeaderTitle")[0];if(t){let e=this._topicsFilePath.replace(/^.*\//,"");t.textContent=e||"Topics",t.title=this._topicsFilePath}}_showFooter(t){let e=this.pict.ContentAssignment.getElement("#ContentEditor-Topics-Footer")[0];e&&(e.style.display=t?"":"none")}_generateUniqueCode(t){if(!this._topics[t])return t;let e=2;for(;this._topics[t+"-"+e];)e++;return t+"-"+e}_escapeHTML(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}_escapeAttr(t){return String(t).replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}},e.exports.default_configuration=o},{"pict-view":102}],123:[function(t,e,i){var n=t("object-inspect"),o=t("es-errors/type"),r=function(t,e,i){for(var n,o=t;null!=(n=o.next);o=n)if(n.key===e)return o.next=n.next,i||(n.next=t.next,t.next=n),n};e.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new o("Side channel does not contain "+n(t))},delete:function(e){var i=t&&t.next,n=function(t,e){if(t)return r(t,e,!0)}(t,e);return n&&i&&i===n&&(t=void 0),!!n},get:function(e){return function(t,e){if(t){var i=r(t,e);return i&&i.value}}(t,e)},has:function(e){return function(t,e){return!!t&&!!r(t,e)}(t,e)},set:function(e,i){t||(t={next:void 0}),function(t,e,i){var n=r(t,e);n?n.value=i:t.next={key:e,next:t.next,value:i}}(t,e,i)}};return e}},{"es-errors/type":16,"object-inspect":41}],124:[function(t,e,i){var n=t("get-intrinsic"),o=t("call-bound"),r=t("object-inspect"),a=t("es-errors/type"),s=n("%Map%",!0),l=o("Map.prototype.get",!0),d=o("Map.prototype.set",!0),c=o("Map.prototype.has",!0),p=o("Map.prototype.delete",!0),h=o("Map.prototype.size",!0);e.exports=!!s&&function(){var t,e={assert:function(t){if(!e.has(t))throw new a("Side channel does not contain "+r(t))},delete:function(e){if(t){var i=p(t,e);return 0===h(t)&&(t=void 0),i}return!1},get:function(e){if(t)return l(t,e)},has:function(e){return!!t&&c(t,e)},set:function(e,i){t||(t=new s),d(t,e,i)}};return e}},{"call-bound":8,"es-errors/type":16,"get-intrinsic":23,"object-inspect":41}],125:[function(t,e,i){var n=t("get-intrinsic"),o=t("call-bound"),r=t("object-inspect"),a=t("side-channel-map"),s=t("es-errors/type"),l=n("%WeakMap%",!0),d=o("WeakMap.prototype.get",!0),c=o("WeakMap.prototype.set",!0),p=o("WeakMap.prototype.has",!0),h=o("WeakMap.prototype.delete",!0);e.exports=l?function(){var t,e,i={assert:function(t){if(!i.has(t))throw new s("Side channel does not contain "+r(t))},delete:function(i){if(l&&i&&("object"==typeof i||"function"==typeof i)){if(t)return h(t,i)}else if(a&&e)return e.delete(i);return!1},get:function(i){return l&&i&&("object"==typeof i||"function"==typeof i)&&t?d(t,i):e&&e.get(i)},has:function(i){return l&&i&&("object"==typeof i||"function"==typeof i)&&t?p(t,i):!!e&&e.has(i)},set:function(i,n){l&&i&&("object"==typeof i||"function"==typeof i)?(t||(t=new l),c(t,i,n)):a&&(e||(e=a()),e.set(i,n))}};return i}:a},{"call-bound":8,"es-errors/type":16,"get-intrinsic":23,"object-inspect":41,"side-channel-map":124}],126:[function(t,e,i){var n=t("es-errors/type"),o=t("object-inspect"),r=t("side-channel-list"),a=t("side-channel-map"),s=t("side-channel-weakmap")||a||r;e.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new n("Side channel does not contain "+o(t))},delete:function(e){return!!t&&t.delete(e)},get:function(e){return t&&t.get(e)},has:function(e){return!!t&&t.has(e)},set:function(e,i){t||(t=s()),t.set(e,i)}};return e}},{"es-errors/type":16,"object-inspect":41,"side-channel-list":123,"side-channel-map":124,"side-channel-weakmap":125}],127:[function(t,e,i){var n=t("punycode/");function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),d=["'"].concat(l),c=["%","/","?",";","#"].concat(d),p=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,u=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},f={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=t("qs");function b(t,e,i){if(t&&"object"==typeof t&&t instanceof o)return t;var n=new o;return n.parse(t,e,i),n}o.prototype.parse=function(t,e,i){if("string"!=typeof t)throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o<t.indexOf("#")?"?":"#",l=t.split(a);l[0]=l[0].replace(/\\/g,"/");var b=t=l.join(a);if(b=b.trim(),!i&&1===t.split("#").length){var y=s.exec(b);if(y)return this.path=b,this.href=b,this.pathname=y[1],y[2]?(this.search=y[2],this.query=e?v.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var w=r.exec(b);if(w){var C=(w=w[0]).toLowerCase();this.protocol=C,b=b.substr(w.length)}if(i||w||b.match(/^\/\/[^@/]+@[^@/]+/)){var x="//"===b.substr(0,2);!x||w&&g[w]||(b=b.substr(2),this.slashes=!0)}if(!g[w]&&(x||w&&!f[w])){for(var R,_,D=-1,E=0;E<p.length;E++){-1!==(A=b.indexOf(p[E]))&&(-1===D||A<D)&&(D=A)}-1!==(_=-1===D?b.lastIndexOf("@"):b.lastIndexOf("@",D))&&(R=b.slice(0,_),b=b.slice(_+1),this.auth=decodeURIComponent(R)),D=-1;for(E=0;E<c.length;E++){var A;-1!==(A=b.indexOf(c[E]))&&(-1===D||A<D)&&(D=A)}-1===D&&(D=b.length),this.host=b.slice(0,D),b=b.slice(D),this.parseHost(),this.hostname=this.hostname||"";var T="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!T)for(var S=this.hostname.split(/\./),P=(E=0,S.length);E<P;E++){var k=S[E];if(k&&!k.match(h)){for(var F="",I=0,L=k.length;I<L;I++)k.charCodeAt(I)>127?F+="x":F+=k[I];if(!F.match(h)){var M=S.slice(0,E),B=S.slice(E+1),H=k.match(u);H&&(M.push(H[1]),B.unshift(H[2])),B.length&&(b="/"+B.join(".")+b),this.hostname=M.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=n.toASCII(this.hostname));var V=this.port?":"+this.port:"",O=this.hostname||"";this.host=O+V,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[C])for(E=0,P=d.length;E<P;E++){var N=d[E];if(-1!==b.indexOf(N)){var z=encodeURIComponent(N);z===N&&(z=escape(N)),b=b.split(N).join(z)}}var j=b.indexOf("#");-1!==j&&(this.hash=b.substr(j),b=b.slice(0,j));var U=b.indexOf("?");if(-1!==U?(this.search=b.substr(U),this.query=b.substr(U+1),e&&(this.query=v.parse(this.query)),b=b.slice(0,U)):e&&(this.search="",this.query={}),b&&(this.pathname=b),f[C]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){V=this.pathname||"";var $=this.search||"";this.path=V+$}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",i=this.pathname||"",n=this.hash||"",o=!1,r="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(r=v.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var a=this.search||r&&"?"+r||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||f[e])&&!1!==o?(o="//"+(o||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),e+o+(i=i.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(a=a.replace("#","%23"))+n},o.prototype.resolve=function(t){return this.resolveObject(b(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if("string"==typeof t){var e=new o;e.parse(t,!1,!0),t=e}for(var i=new o,n=Object.keys(this),r=0;r<n.length;r++){var a=n[r];i[a]=this[a]}if(i.hash=t.hash,""===t.href)return i.href=i.format(),i;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),l=0;l<s.length;l++){var d=s[l];"protocol"!==d&&(i[d]=t[d])}return f[i.protocol]&&i.hostname&&!i.pathname&&(i.pathname="/",i.path=i.pathname),i.href=i.format(),i}if(t.protocol&&t.protocol!==i.protocol){if(!f[t.protocol]){for(var c=Object.keys(t),p=0;p<c.length;p++){var h=c[p];i[h]=t[h]}return i.href=i.format(),i}if(i.protocol=t.protocol,t.host||g[t.protocol])i.pathname=t.pathname;else{for(var u=(t.pathname||"").split("/");u.length&&!(t.host=u.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==u[0]&&u.unshift(""),u.length<2&&u.unshift(""),i.pathname=u.join("/")}if(i.search=t.search,i.query=t.query,i.host=t.host||"",i.auth=t.auth,i.hostname=t.hostname||t.host,i.port=t.port,i.pathname||i.search){var m=i.pathname||"",v=i.search||"";i.path=m+v}return i.slashes=i.slashes||t.slashes,i.href=i.format(),i}var b=i.pathname&&"/"===i.pathname.charAt(0),y=t.host||t.pathname&&"/"===t.pathname.charAt(0),w=y||b||i.host&&t.pathname,C=w,x=i.pathname&&i.pathname.split("/")||[],R=(u=t.pathname&&t.pathname.split("/")||[],i.protocol&&!f[i.protocol]);if(R&&(i.hostname="",i.port=null,i.host&&(""===x[0]?x[0]=i.host:x.unshift(i.host)),i.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===u[0]?u[0]=t.host:u.unshift(t.host)),t.host=null),w=w&&(""===u[0]||""===x[0])),y)i.host=t.host||""===t.host?t.host:i.host,i.hostname=t.hostname||""===t.hostname?t.hostname:i.hostname,i.search=t.search,i.query=t.query,x=u;else if(u.length)x||(x=[]),x.pop(),x=x.concat(u),i.search=t.search,i.query=t.query;else if(null!=t.search){if(R)i.host=x.shift(),i.hostname=i.host,(T=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=T.shift(),i.hostname=T.shift(),i.host=i.hostname);return i.search=t.search,i.query=t.query,null===i.pathname&&null===i.search||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!x.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var _=x.slice(-1)[0],D=(i.host||t.host||x.length>1)&&("."===_||".."===_)||""===_,E=0,A=x.length;A>=0;A--)"."===(_=x[A])?x.splice(A,1):".."===_?(x.splice(A,1),E++):E&&(x.splice(A,1),E--);if(!w&&!C)for(;E--;E)x.unshift("..");!w||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),D&&"/"!==x.join("/").substr(-1)&&x.push("");var T,S=""===x[0]||x[0]&&"/"===x[0].charAt(0);R&&(i.hostname=S?"":x.length?x.shift():"",i.host=i.hostname,(T=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=T.shift(),i.hostname=T.shift(),i.host=i.hostname));return(w=w||i.host&&x.length)&&!S&&x.unshift(""),x.length>0?i.pathname=x.join("/"):(i.pathname=null,i.path=null),null===i.pathname&&null===i.search||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},i.parse=b,i.resolve=function(t,e){return b(t,!1,!0).resolve(e)},i.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},i.format=function(t){return"string"==typeof t&&(t=b(t)),t instanceof o?t.format():o.prototype.format.call(t)},i.Url=o},{"punycode/":104,qs:106}],128:[function(t,e,i){e.exports={Name:"Retold Remote",MainViewportViewIdentifier:"ContentEditor-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1}},{}],129:[function(t,e,i){const n=t("retold-content-system").PictContentEditor,o=(t("pict-section-filebrowser"),t("./providers/Pict-Provider-RetoldRemote.js")),r=t("./providers/Pict-Provider-GalleryNavigation.js"),a=t("./providers/Pict-Provider-GalleryFilterSort.js"),s=t("./providers/Pict-Provider-RetoldRemoteIcons.js"),l=t("./providers/Pict-Provider-RetoldRemoteTheme.js"),d=t("./providers/Pict-Provider-FormattingUtilities.js"),c=t("./providers/Pict-Provider-ToastNotification.js"),p=t("./providers/Pict-Provider-OperationStatus.js"),h=t("./providers/Pict-Provider-CollectionManager.js"),u=t("./providers/Pict-Provider-AISortManager.js"),m=t("./RetoldRemote-ExtensionMaps.js"),g=t("./views/PictView-Remote-Layout.js"),f=t("./views/PictView-Remote-TopBar.js"),v=t("./views/PictView-Remote-SettingsPanel.js"),b=t("./views/PictView-Remote-Gallery.js"),y=t("./views/PictView-Remote-MediaViewer.js"),w=t("./views/PictView-Remote-ImageViewer.js"),C=t("./views/PictView-Remote-VideoExplorer.js"),x=t("./views/PictView-Remote-AudioExplorer.js"),R=t("./views/PictView-Remote-ImageExplorer.js"),_=t("./views/PictView-Remote-VLCSetup.js"),D=t("./views/PictView-Remote-CollectionsPanel.js"),E=t("./views/PictView-Remote-FileInfoPanel.js"),A=t("./views/PictView-Remote-SubimagesPanel.js"),T=t("./views/PictView-Remote-RegionsBrowser.js"),S=t("./Pict-Application-RetoldRemote-Configuration.json");e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},S,e),i),this.pict.addView("ContentEditor-Layout",g.default_configuration,g),this.pict.addView("ContentEditor-TopBar",f.default_configuration,f),this.pict.addView("RetoldRemote-Gallery",b.default_configuration,b),this.pict.addView("RetoldRemote-MediaViewer",y.default_configuration,y),this.pict.addView("RetoldRemote-ImageViewer",w.default_configuration,w),this.pict.addView("RetoldRemote-SettingsPanel",v.default_configuration,v),this.pict.addView("RetoldRemote-VideoExplorer",C.default_configuration,C),this.pict.addView("RetoldRemote-AudioExplorer",x.default_configuration,x),this.pict.addView("RetoldRemote-ImageExplorer",R.default_configuration,R),this.pict.addView("RetoldRemote-VLCSetup",_.default_configuration,_),this.pict.addView("RetoldRemote-CollectionsPanel",D.default_configuration,D),this.pict.addView("RetoldRemote-FileInfoPanel",E.default_configuration,E),this.pict.addView("RetoldRemote-SubimagesPanel",A.default_configuration,A),this.pict.addView("RetoldRemote-RegionsBrowser",T.default_configuration,T),this.pict.addProvider("RetoldRemote-Provider",o.default_configuration,o),this.pict.addProvider("RetoldRemote-GalleryNavigation",r.default_configuration,r),this.pict.addProvider("RetoldRemote-GalleryFilterSort",a.default_configuration,a),this.pict.addProvider("RetoldRemote-Icons",s.default_configuration,s),this.pict.addProvider("RetoldRemote-Theme",l.default_configuration,l),this.pict.addProvider("RetoldRemote-FormattingUtilities",d.default_configuration,d),this.pict.addProvider("RetoldRemote-ToastNotification",c.default_configuration,c),this.pict.addProvider("RetoldRemote-OperationStatus",p.default_configuration,p),this.pict.addProvider("RetoldRemote-CollectionManager",h.default_configuration,h),this.pict.addProvider("RetoldRemote-AISortManager",u.default_configuration,u)}onAfterInitializeAsync(t){"undefined"!=typeof window&&(window.pict=this.pict),this.pict.AppData.RetoldRemote={ActiveMode:"gallery",Theme:"twilight",ViewMode:"list",ThumbnailSize:"medium",RawFileList:[],GalleryItems:[],GalleryCursorIndex:0,FolderCursorHistory:{},GalleryFilter:"all",SearchQuery:"",SearchCaseSensitive:!1,SearchRegex:!1,ServerCapabilities:{},FolderSummary:null,CurrentViewerFile:"",CurrentViewerMediaType:"",HashedFilenames:!0,ShowHiddenFiles:!1,DistractionFreeShowNav:!1,ImageFitMode:"fit",SidebarCollapsed:!1,SidebarWidth:250,AutoplayVideo:!1,AutoplayAudio:!1,ListShowExtension:!0,ListShowSize:!0,ListShowDate:!0,FilterState:{MediaType:"all",Extensions:[],SizeMin:null,SizeMax:null,DateModifiedAfter:null,DateModifiedBefore:null,DateCreatedAfter:null,DateCreatedBefore:null},SortField:"folder-first",SortDirection:"asc",FilterBarVisible:!1,FilterPanelOpen:!1,FilterPresets:[],Collections:[],CollectionsPanelOpen:!1,CollectionsPanelWidth:300,CollectionsPanelMode:"list",ActiveCollectionGUID:null,ActiveCollection:null,CollectionSearchQuery:"",LastUsedCollectionGUID:null,BrowsingCollection:!1,BrowsingCollectionIndex:-1,FavoritesGUID:null,FavoritesCollection:null,FavoritesPathSet:{},CurrentFileMetadata:null,AISortSettings:{AIEndpoint:"http://localhost:11434",AIModel:"llama3.1",AIProvider:"ollama",NamingTemplate:"{artist}/{album}/{track} - {title}"}},this._loadRemoteSettings();let e=this.pict.providers["RetoldRemote-Theme"];e&&e.applyTheme(this.pict.AppData.RetoldRemote.Theme),this.pict.AppData.ContentEditor={CurrentFile:"",ActiveEditor:"markdown",IsDirty:!1,IsSaving:!1,IsLoading:!1,Files:[],Document:{Segments:[{Content:""}]},CodeContent:"",SaveStatus:"",SaveStatusClass:"",AutoSegmentMarkdown:!1,AutoSegmentDepth:1,AutoContentPreview:!1,MarkdownEditingControls:!0,MarkdownWordWrap:!0,CodeWordWrap:!1,SidebarCollapsed:this.pict.AppData.RetoldRemote.SidebarCollapsed,SidebarWidth:this.pict.AppData.RetoldRemote.SidebarWidth,AutoPreviewImages:!0,AutoPreviewVideo:!1,AutoPreviewAudio:!1,ShowHiddenFiles:this.pict.AppData.RetoldRemote.ShowHiddenFiles,TopicsFilePath:""},this.pict.views["ContentEditor-Layout"].render(),this.pict.views["ContentEditor-TopBar"].render(),this.pict.views["RetoldRemote-CollectionsPanel"].render();let i=this.pict.providers["RetoldRemote-CollectionManager"];i&&i.fetchCollections(()=>{i.ensureFavoritesCollection()});let n=this.pict.views["ContentEditor-TopBar"];n&&"function"==typeof n.updateCollectionsIcon&&n.updateCollectionsIcon();let o=this,r=this.pict.providers["Pict-FileBrowser-List"];if(r){let t=r.selectFile.bind(r);r.selectFile=function(e){if(t(e),e&&"file"===e.Type)o.navigateToFile(e.Path);else if(e&&("folder"===e.Type||"archive"===e.Type)){let t=o.pict.AppData.PictFileBrowser&&o.pict.AppData.PictFileBrowser.CurrentLocation||"",i=t?t+"/"+e.Name:e.Name;o.loadFileList(i)}}}let a=this.pict.providers["Pict-FileBrowser-Browse"];if(a){let t=a.navigateToFolder.bind(a);a.navigateToFolder=function(e){t(e),o.loadFileList(e)}}let s=this.pict.providers["RetoldRemote-Provider"];s&&(s.fetchCapabilities((t,e)=>{!t&&e&&(o.pict.AppData.RetoldRemote.ServerCapabilities=e)}),s.fetchRemoteSettings((t,e)=>{!t&&e&&(o.pict.AppData.RetoldRemote.HashedFilenames=!!e.HashedFilenames)}));let l=this.pict.providers["RetoldRemote-GalleryNavigation"];l&&l.bindKeyboardNavigation();let d=window.location.hash||"";if(this.syncHiddenFilesSetting(()=>{o.loadFileList(null,()=>{d&&"#"!==d&&"#/"!==d&&"#/browse/"!==d&&"#/browse"!==d?window.location.hash=d:o.resolveHash()})}),"function"==typeof t)return t()}_getMediaType(t){return{js:!0,mjs:!0,cjs:!0,ts:!0,tsx:!0,jsx:!0,py:!0,rb:!0,java:!0,c:!0,cpp:!0,h:!0,hpp:!0,cs:!0,go:!0,rs:!0,php:!0,sh:!0,bash:!0,zsh:!0,pl:!0,r:!0,swift:!0,kt:!0,scala:!0,lua:!0,json:!0,xml:!0,yaml:!0,yml:!0,toml:!0,ini:!0,cfg:!0,conf:!0,env:!0,properties:!0,md:!0,markdown:!0,txt:!0,csv:!0,tsv:!0,log:!0,html:!0,htm:!0,css:!0,scss:!0,sass:!0,less:!0,sql:!0,graphql:!0,gql:!0,makefile:!0,dockerfile:!0,gitignore:!0,editorconfig:!0,htaccess:!0,npmrc:!0,eslintrc:!0,prettierrc:!0}[t]?"text":m.getCategory(t)}navigateToFile(t){if(!t)return;let e=this.getEditorTypeForFile(t),i=t.replace(/^.*\./,"").toLowerCase(),n=this._getMediaType(i),o=(this.pict.AppData.RetoldRemote,this.pict.providers["RetoldRemote-Provider"]),r=o?o.getFragmentIdentifier(t):t;if(window.location.hash="#/view/"+r,this.pict.AppData.ContentEditor.CurrentFile=t,this.pict.AppData.ContentEditor.ActiveEditor=e,"binary"===e){let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,n)}else if("text"===n){let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,"text")}else if("other"===n){let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,"document")}else{let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,n)}let a=this.pict.views["ContentEditor-TopBar"];a&&(a.updateInfo(),"function"==typeof a.updateFavoritesIcon&&a.updateFavoritesIcon())}navigateToFileAs(t,e){if(!t)return;this.pict.AppData.RetoldRemote;let i=this.pict.providers["RetoldRemote-Provider"],n=i?i.getFragmentIdentifier(t):t;window.location.hash="#/view/"+n,this.pict.AppData.ContentEditor.CurrentFile=t,this.pict.AppData.ContentEditor.ActiveEditor="binary";let o=this.pict.views["RetoldRemote-MediaViewer"];o&&o.showMedia(t,e);let r=this.pict.views["ContentEditor-TopBar"];r&&(r.updateInfo(),"function"==typeof r.updateFavoritesIcon&&r.updateFavoritesIcon())}loadFileList(t,e){let i="function"==typeof e?e:"function"==typeof t?t:()=>{},n=this,o="string"==typeof t?t:null;null===o&&this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(o=this.pict.AppData.PictFileBrowser.CurrentLocation);let r=n.pict.views["RetoldRemote-Gallery"];r&&"function"==typeof r.showLoadingState&&r.showLoadingState(o||""),r&&"function"==typeof r.cancelActiveRender&&r.cancelActiveRender();let a="/api/filebrowser/list";if(o&&o.length>0){let t=n.pict.providers["RetoldRemote-Provider"];a+=t?"?path="+t._getPathParam(o):"?path="+encodeURIComponent(o)}fetch(a).then(t=>{let e=t.headers.get("X-Retold-Folder-Hash");if(e&&o){let t=n.pict.providers["RetoldRemote-Provider"];t&&t.registerHash(o,e)}return t.json()}).then(e=>{n.pict.AppData.PictFileBrowser=n.pict.AppData.PictFileBrowser||{},n.pict.AppData.PictFileBrowser.FileList=e||[],n.pict.AppData.PictFileBrowser.CurrentLocation="string"==typeof t?t:n.pict.AppData.PictFileBrowser.CurrentLocation||"";let o=n.pict.providers["RetoldRemote-Provider"];if(o&&Array.isArray(e))for(let t=0;t<e.length;t++)e[t].Hash&&e[t].Path&&o.registerHash(e[t].Path,e[t].Hash);let r=n.pict.views["Pict-FileBrowser"];r&&r.render();let a=n.pict.views["Pict-FileBrowser-ListDetail"];a&&a.render(),n._injectSidebarAddFolderButton();let s=n.pict.AppData.RetoldRemote;s.RawFileList=e||[],s.ActiveMode="gallery",s.SearchQuery="",s.FilterState={MediaType:s.FilterState.MediaType,Extensions:[],SizeMin:null,SizeMax:null,DateModifiedAfter:null,DateModifiedBefore:null,DateCreatedAfter:null,DateCreatedBefore:null};let l=document.getElementById("RetoldRemote-Gallery-Container"),d=document.getElementById("RetoldRemote-Viewer-Container");l&&(l.style.display=""),d&&(d.style.display="none");let c=n.pict.providers["RetoldRemote-GalleryFilterSort"];if(c)c.applyFilterSort();else{s.GalleryItems=e||[];let t=s.FolderCursorHistory&&s.FolderCursorHistory[n.pict.AppData.PictFileBrowser.CurrentLocation||""];s.GalleryCursorIndex="number"==typeof t&&t<(e||[]).length?t:0;let i=n.pict.views["RetoldRemote-Gallery"];i&&i.renderGallery()}let p=n.pict.AppData.PictFileBrowser.CurrentLocation||"",h=n.pict.providers["RetoldRemote-Provider"],u=h&&p?h.getFragmentIdentifier(p):p;window.location.hash=u?"#/browse/"+u:"#/browse/";let m=n.pict.providers["RetoldRemote-Provider"],g=/\.(zip|7z|rar|tar|tgz|cbz|cbr|tar\.gz|tar\.bz2|tar\.xz)(\/|$)/i.test(p);if(m&&!g)m.fetchFolderSummary(p,(t,e)=>{if(!t&&e){s.FolderSummary=e;let t=n.pict.views["ContentEditor-TopBar"];t&&(t.updateLocation(),t.updateInfo())}});else{let t=n.pict.views["ContentEditor-TopBar"];t&&(t.updateLocation(),t.updateInfo())}return i()}).catch(t=>(n.log.error(`Failed to load file list: ${t.message}`),i()))}resolveHash(){let t=decodeURIComponent((window.location.hash||"").replace(/^#\/?/,""));if(!t)return;let e=t.split("/"),i=this.pict.providers["RetoldRemote-Provider"],n=this,o=e[0];if(["browse","view","explore","explore-audio","explore-image","edit"].indexOf(o)>=0&&e.length>=2){let t=e.slice(1).join("/"),r=i?i.resolveFragmentIdentifier(t):t;if(/^[a-f0-9]{10}$/.test(r))return void n._resolveHashFromServer(r,t=>{n._executeRoute(o,t||r)});this._executeRoute(o,r)}else if("collection"===o&&e.length>=2){let t=e[1],i=this.pict.providers["RetoldRemote-CollectionManager"];if(i){this.pict.AppData.RetoldRemote.CollectionsPanelMode="detail",i.openPanel(),i.fetchCollection(t)}}}_executeRoute(t,e){let i=this.pict.AppData.RetoldRemote.ActiveMode||"gallery";switch(t){case"browse":e===(this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"")&&"gallery"===i||this.loadFileList(e);break;case"view":case"edit":this.pict.AppData.ContentEditor.CurrentFile===e&&"gallery"!==i||this.navigateToFile(e);break;case"explore":{let t=this.pict.views["RetoldRemote-VideoExplorer"];t&&t.showExplorer(e);break}case"explore-audio":{let t=this.pict.views["RetoldRemote-AudioExplorer"];t&&t.showExplorer(e);break}case"explore-image":{let t=this.pict.views["RetoldRemote-ImageExplorer"];t&&t.showExplorer(e);break}}}_resolveHashFromServer(t,e){let i=this;fetch("/api/resolve-hash/"+t).then(t=>t.ok?t.json():e(null)).then(n=>{if(n&&n.Success&&n.Path){let o=i.pict.providers["RetoldRemote-Provider"];o&&o.registerHash(n.Path,t);let r=n.Path.replace(/\/[^/]+$/,"")||"";return i.loadFileList(r),e(n.Path)}return e(null)}).catch(()=>e(null))}_injectSidebarAddFolderButton(){let t=document.getElementById("Pict-FileBrowser-DetailRows");if(!t)return;let e=t.parentElement.querySelector(".retold-remote-sidebar-addfolder");e&&e.parentElement.removeChild(e);let i=document.createElement("button");i.className="retold-remote-sidebar-addfolder",i.textContent="+ New Folder",i.title="Create a new folder here",i.onclick=function(){pict.PictApplication.promptNewFolder()},t.parentElement.appendChild(i)}saveSettings(){try{let t=this.pict.AppData.RetoldRemote,e={Theme:t.Theme,ViewMode:t.ViewMode,ThumbnailSize:t.ThumbnailSize,GalleryFilter:t.GalleryFilter,ShowHiddenFiles:t.ShowHiddenFiles,DistractionFreeShowNav:t.DistractionFreeShowNav,ImageFitMode:t.ImageFitMode,SidebarCollapsed:t.SidebarCollapsed,SidebarWidth:t.SidebarWidth,SortField:t.SortField,SortDirection:t.SortDirection,FilterPresets:t.FilterPresets,FilterPanelOpen:t.FilterPanelOpen,AutoplayVideo:t.AutoplayVideo,AutoplayAudio:t.AutoplayAudio,ListShowExtension:t.ListShowExtension,ListShowSize:t.ListShowSize,ListShowDate:t.ListShowDate,CollectionsPanelOpen:t.CollectionsPanelOpen,CollectionsPanelWidth:t.CollectionsPanelWidth,LastUsedCollectionGUID:t.LastUsedCollectionGUID,FavoritesGUID:t.FavoritesGUID,AISortSettings:t.AISortSettings};localStorage.setItem("retold-remote-settings",JSON.stringify(e))}catch(t){}}_loadRemoteSettings(){try{let t=localStorage.getItem("retold-remote-settings");if(t){let e=JSON.parse(t),i=this.pict.AppData.RetoldRemote;e.Theme&&(i.Theme=e.Theme),e.ViewMode&&(i.ViewMode=e.ViewMode),e.ThumbnailSize&&(i.ThumbnailSize=e.ThumbnailSize),e.GalleryFilter&&(i.GalleryFilter=e.GalleryFilter,i.FilterState.MediaType=e.GalleryFilter),"boolean"==typeof e.ShowHiddenFiles&&(i.ShowHiddenFiles=e.ShowHiddenFiles),"boolean"==typeof e.DistractionFreeShowNav&&(i.DistractionFreeShowNav=e.DistractionFreeShowNav),e.ImageFitMode&&(i.ImageFitMode=e.ImageFitMode),"boolean"==typeof e.SidebarCollapsed&&(i.SidebarCollapsed=e.SidebarCollapsed),e.SidebarWidth&&(i.SidebarWidth=e.SidebarWidth),e.SortField&&(i.SortField=e.SortField),e.SortDirection&&(i.SortDirection=e.SortDirection),Array.isArray(e.FilterPresets)&&(i.FilterPresets=e.FilterPresets),"boolean"==typeof e.FilterPanelOpen&&(i.FilterPanelOpen=e.FilterPanelOpen),"boolean"==typeof e.AutoplayVideo&&(i.AutoplayVideo=e.AutoplayVideo),"boolean"==typeof e.AutoplayAudio&&(i.AutoplayAudio=e.AutoplayAudio),"boolean"==typeof e.ListShowExtension&&(i.ListShowExtension=e.ListShowExtension),"boolean"==typeof e.ListShowSize&&(i.ListShowSize=e.ListShowSize),"boolean"==typeof e.ListShowDate&&(i.ListShowDate=e.ListShowDate),"boolean"==typeof e.CollectionsPanelOpen&&(i.CollectionsPanelOpen=e.CollectionsPanelOpen),e.CollectionsPanelWidth&&(i.CollectionsPanelWidth=e.CollectionsPanelWidth),e.LastUsedCollectionGUID&&(i.LastUsedCollectionGUID=e.LastUsedCollectionGUID),e.FavoritesGUID&&(i.FavoritesGUID=e.FavoritesGUID),e.AISortSettings&&"object"==typeof e.AISortSettings&&(e.AISortSettings.AIEndpoint&&(i.AISortSettings.AIEndpoint=e.AISortSettings.AIEndpoint),e.AISortSettings.AIModel&&(i.AISortSettings.AIModel=e.AISortSettings.AIModel),e.AISortSettings.AIProvider&&(i.AISortSettings.AIProvider=e.AISortSettings.AIProvider),e.AISortSettings.NamingTemplate&&(i.AISortSettings.NamingTemplate=e.AISortSettings.NamingTemplate))}}catch(t){}}}},{"./Pict-Application-RetoldRemote-Configuration.json":128,"./RetoldRemote-ExtensionMaps.js":131,"./providers/Pict-Provider-AISortManager.js":135,"./providers/Pict-Provider-CollectionManager.js":136,"./providers/Pict-Provider-FormattingUtilities.js":137,"./providers/Pict-Provider-GalleryFilterSort.js":138,"./providers/Pict-Provider-GalleryNavigation.js":139,"./providers/Pict-Provider-OperationStatus.js":140,"./providers/Pict-Provider-RetoldRemote.js":141,"./providers/Pict-Provider-RetoldRemoteIcons.js":142,"./providers/Pict-Provider-RetoldRemoteTheme.js":143,"./providers/Pict-Provider-ToastNotification.js":144,"./views/PictView-Remote-AudioExplorer.js":155,"./views/PictView-Remote-CollectionsPanel.js":156,"./views/PictView-Remote-FileInfoPanel.js":157,"./views/PictView-Remote-Gallery.js":158,"./views/PictView-Remote-ImageExplorer.js":159,"./views/PictView-Remote-ImageViewer.js":160,"./views/PictView-Remote-Layout.js":161,"./views/PictView-Remote-MediaViewer.js":162,"./views/PictView-Remote-RegionsBrowser.js":163,"./views/PictView-Remote-SettingsPanel.js":164,"./views/PictView-Remote-SubimagesPanel.js":165,"./views/PictView-Remote-TopBar.js":166,"./views/PictView-Remote-VLCSetup.js":167,"./views/PictView-Remote-VideoExplorer.js":168,"pict-section-filebrowser":66,"retold-content-system":114}],130:[function(t,e,i){e.exports={RetoldRemoteApplication:t("./Pict-Application-RetoldRemote.js")},"undefined"!=typeof window&&(window.RetoldRemoteApplication=e.exports.RetoldRemoteApplication)},{"./Pict-Application-RetoldRemote.js":129}],131:[function(t,e,i){const n={nef:!0,nrw:!0,cr2:!0,cr3:!0,crw:!0,arw:!0,srf:!0,sr2:!0,raf:!0,orf:!0,rw2:!0,rwl:!0,pef:!0,srw:!0,x3f:!0,"3fr":!0,fff:!0,iiq:!0,dcr:!0,kdc:!0,mrw:!0,erf:!0,raw:!0,dng:!0,heic:!0,heif:!0},o={png:!0,jpg:!0,jpeg:!0,gif:!0,webp:!0,svg:!0,bmp:!0,ico:!0,avif:!0,tiff:!0,tif:!0,heic:!0,heif:!0};for(let t in n)o[t]=!0;const r={mp4:!0,webm:!0,mov:!0,mkv:!0,avi:!0,wmv:!0,flv:!0,m4v:!0,ogv:!0,mpg:!0,mpeg:!0,mpe:!0,mpv:!0,m2v:!0,ts:!0,mts:!0,m2ts:!0,vob:!0,"3gp":!0,"3g2":!0,f4v:!0,rm:!0,rmvb:!0,divx:!0,asf:!0,mxf:!0,dv:!0,nsv:!0,nuv:!0,y4m:!0,wtv:!0,swf:!0,dat:!0},a={mp3:!0,wav:!0,ogg:!0,flac:!0,aac:!0,m4a:!0,wma:!0,oga:!0},s={pdf:!0,epub:!0,mobi:!0,doc:!0,docx:!0,rtf:!0,odt:!0,wpd:!0,wps:!0,pages:!0,odp:!0,ppt:!0,pptx:!0,ods:!0,xls:!0,xlsx:!0};e.exports.RawImageExtensions=n,e.exports.ImageExtensions=o,e.exports.VideoExtensions=r,e.exports.AudioExtensions=a,e.exports.DocumentExtensions=s,e.exports.getCategory=function(t){let e=(t||"").replace(/^\./,"").toLowerCase();return o[e]?"image":r[e]?"video":a[e]?"audio":s[e]?"document":"other"},e.exports.isRawImage=function(t){let e=(t||"").replace(/^\./,"").toLowerCase();return!!n[e]}},{}],132:[function(t,e,i){
|
|
127
|
+
const n=t("fable-serviceproviderbase"),o=t("path"),r=t("fs"),a=t("url"),s={BasePath:".",APIRoutePrefix:"/api/filebrowser",WebAppRoute:"/filebrowser/*",WebAppRouteStrip:"/filebrowser/",ServeWebApp:!0,IncludeHiddenFiles:!1,MaxTreeDepth:2};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this.serviceType="PictFileBrowserService";for(let t in s)t in this.options||(this.options[t]=s[t]);this.basePath=o.resolve(this.options.BasePath)}connectRoutes(){if(!this.fable.Orator||!this.fable.Orator.serviceServer)return this.log.error("PictFileBrowserService: Orator service server is not available. Initialize Orator first."),!1;let t=this.fable.Orator.serviceServer,e=this.options.APIRoutePrefix;if(t.get(e+"/list",(t,e,i)=>{let n=this.parseQueryParams(t).path||"";this.listDirectory(n,(t,n)=>t?(e.send(400,{Error:t.message}),i()):(e.send(n),i()))}),t.get(e+"/tree",(t,e,i)=>{let n=this.parseQueryParams(t),o=this.options.MaxTreeDepth;n.depth&&(o=parseInt(n.depth)||this.options.MaxTreeDepth),this.buildFolderTree("",o,(t,n)=>t?(e.send(400,{Error:t.message}),i()):(e.send(n),i()))}),t.get(e+"/info",(t,e,i)=>{let n=this.parseQueryParams(t).path||"";this.getFileInfo(n,(t,n)=>t?(e.send(400,{Error:t.message}),i()):(e.send(n),i()))}),t.get(e+"/children",(t,e,i)=>{let n=this.parseQueryParams(t).path||"";this.listChildFolders(n,(t,n)=>t?(e.send(400,{Error:t.message}),i()):(e.send(n),i()))}),this.options.ServeWebApp){let t=o.join(i,"..","www");this.fable.Orator.addStaticRoute(t,"index.html",this.options.WebAppRoute,this.options.WebAppRouteStrip)}return this.log.info("PictFileBrowserService: Routes connected. Browsing path: "+this.basePath),!0}parseQueryParams(t){if(t.query&&"object"==typeof t.query)return t.query;return a.parse(t.url,!0).query||{}}resolveSafePath(t){let e=(t||"").replace(/\.\./g,"").replace(/\/\//g,"/"),i=o.resolve(this.basePath,e);return 0!==i.indexOf(this.basePath)?null:i}listDirectory(t,e){let i=this.resolveSafePath(t);if(!i)return e(new Error("Invalid path"));r.readdir(i,{withFileTypes:!0},(n,a)=>{if(n)return"ENOENT"===n.code?e(new Error("Path not found")):"ENOTDIR"===n.code?e(new Error("Path is not a directory")):e(n);let s=[],l=a.length;if(0===l)return e(null,s);for(let n=0;n<a.length;n++){let d=a[n],c=d.name;if(!this.options.IncludeHiddenFiles&&"."===c.charAt(0)){if(l--,0===l)return e(null,s);continue}let p=o.join(i,c),h=t?t+"/"+c:c;r.stat(p,((t,i,n)=>(r,a)=>{let d={Name:t,Path:i,Type:n?"folder":"file"};if(a&&!r&&(d.Size=a.size,d.Modified=a.mtime,d.Created=a.birthtime,n||(d.Extension=o.extname(t))),s.push(d),l--,0===l)return e(null,s)})(c,h,d.isDirectory()))}})}listChildFolders(t,e){let i=this.resolveSafePath(t);if(!i)return e(new Error("Invalid path"));r.readdir(i,{withFileTypes:!0},(n,a)=>{if(n)return"ENOENT"===n.code?e(new Error("Path not found")):"ENOTDIR"===n.code?e(new Error("Path is not a directory")):e(n);let s=[];for(let t=0;t<a.length;t++){if(!a[t].isDirectory())continue;let e=a[t].name;(this.options.IncludeHiddenFiles||"."!==e.charAt(0))&&s.push(e)}if(s.sort((t,e)=>t.localeCompare(e)),0===s.length)return e(null,[]);let l=[],d=s.length;for(let n=0;n<s.length;n++){let a=s[n],c=o.join(i,a),p=t?t+"/"+a:a;r.readdir(c,{withFileTypes:!0},((t,i)=>(n,o)=>{let r=!1;if(!n&&o)for(let t=0;t<o.length;t++)if(o[t].isDirectory()){let e=o[t].name;if(this.options.IncludeHiddenFiles||"."!==e.charAt(0)){r=!0;break}}if(l.push({Name:t,Path:i,HasChildren:r}),d--,0===d)return l.sort((t,e)=>t.Name.localeCompare(e.Name)),e(null,l)})(a,p))}})}buildFolderTree(t,e,i){let n=this.resolveSafePath(t);if(!n)return i(new Error("Invalid path"));this._buildTreeRecursive(n,t,e,0,i)}_buildTreeRecursive(t,e,i,n,a){if(i>0&&n>=i)return a(null,[]);r.readdir(t,{withFileTypes:!0},(r,s)=>{if(r)return a(null,[]);let l=[];for(let t=0;t<s.length;t++)if(s[t].isDirectory()){let e=s[t].name;if(!this.options.IncludeHiddenFiles&&"."===e.charAt(0))continue;l.push(e)}if(0===l.length)return a(null,[]);let d=[],c=l.length;for(let r=0;r<l.length;r++){let s=l[r],p=o.join(t,s),h=e?e+"/"+s:s;this._buildTreeRecursive(p,h,i,n+1,((t,e)=>(i,n)=>{if(d.push({Name:t,Path:e,Children:n||[]}),c--,0===c)return d.sort((t,e)=>t.Name.localeCompare(e.Name)),a(null,d)})(s,h))}})}getFileInfo(t,e){let i=this.resolveSafePath(t);if(!i)return e(new Error("Invalid path"));r.stat(i,(n,r)=>{if(n)return"ENOENT"===n.code?e(new Error("Path not found")):e(n);let a=o.basename(i),s={Name:a,Path:t||a,Type:r.isDirectory()?"folder":"file",Size:r.size,Modified:r.mtime,Created:r.birthtime};return r.isDirectory()||(s.Extension=o.extname(a)),e(null,s)})}},e.exports.default_configuration=s}).call(this)}).call(this,"/node_modules/pict-section-filebrowser/source/services")},{"fable-serviceproviderbase":20,fs:2,path:42,url:127}],73:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Pict-FileBrowser-BrowseSearch",DefaultRenderable:"BrowseSearch-Container",DefaultDestinationAddress:"#Pict-FileBrowser-BrowsePane",AutoRender:!1,Templates:[{Hash:"FileBrowser-BrowseSearch-Container-Template",Template:'\n<div class="pict-fb-search">\n\t<input type="text" class="pict-fb-search-input"\n\t\tid="Pict-FileBrowser-SearchInput"\n\t\tplaceholder="Search files..."\n\t\toninput="pict.views[\'{~D:Record.ViewHash~}\'].onSearchInput(this.value)" />\n\t<div class="pict-fb-search-results" id="Pict-FileBrowser-SearchResults"></div>\n</div>\n'},{Hash:"FileBrowser-BrowseSearch-Result-Template",Template:'\n<div class="pict-fb-search-result" onclick="{~D:Record.ClickHandler~}">\n\t<span class="pict-fb-search-result-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-search-result-name">{~D:Record.Name~}</span>\n\t<span class="pict-fb-search-result-path">{~D:Record.Path~}</span>\n</div>\n'},{Hash:"FileBrowser-BrowseSearch-Empty-Template",Template:'<div class="pict-fb-empty">{~D:Record.Message~}</div>'}],Renderables:[{RenderableHash:"BrowseSearch-Container",TemplateHash:"FileBrowser-BrowseSearch-Container-Template",DestinationAddress:"#Pict-FileBrowser-BrowsePane",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},o,e),i),this.lastQuery="",this.debounceTimer=null}onAfterRender(t){let e=this.pict.parseTemplateByHash("FileBrowser-BrowseSearch-Container-Template",{ViewHash:this.Hash});return this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-BrowsePane",e),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}onSearchInput(t){this.lastQuery=t||"",this.debounceTimer&&clearTimeout(this.debounceTimer),this.debounceTimer=setTimeout(()=>{this.performSearch(this.lastQuery)},150)}performSearch(t){let e="#Pict-FileBrowser-SearchResults";if(!t||t.length<1)return void this.pict.ContentAssignment.assignContent(e,"");let i=this.pict.providers["Pict-FileBrowser-Browse"];if(!i)return;let n=i.searchFiles(t),o=this.pict.providers["Pict-FileBrowser-List"];if(0===n.length){let t=this.pict.parseTemplateByHash("FileBrowser-BrowseSearch-Empty-Template",{Message:"No results found"});return void this.pict.ContentAssignment.assignContent(e,t)}let r="";for(let t=0;t<n.length&&t<50;t++){let e=n[t],i=o?o.getEntryIcon(e):"📄",a=e.Path||"",s={Name:e.Name,Path:a,Icon:i,ClickHandler:"pict.views['"+this.Hash+"'].selectResult("+t+")"};r+=this.pict.parseTemplateByHash("FileBrowser-BrowseSearch-Result-Template",s)}this.pict.ContentAssignment.assignContent(e,r),this._lastResults=n}selectResult(t){if(!this._lastResults||t>=this._lastResults.length)return;let e=this._lastResults[t],i=this.pict.providers["Pict-FileBrowser-List"];i&&i.openEntry(e)}},e.exports.default_configuration=o},{"pict-view":102}],74:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Pict-FileBrowser-BrowseTree",DefaultRenderable:"BrowseTree-Container",DefaultDestinationAddress:"#Pict-FileBrowser-BrowsePane",AutoRender:!1,Templates:[{Hash:"FileBrowser-BrowseTree-Container-Template",Template:'<div class="pict-fb-tree" id="Pict-FileBrowser-Tree"></div>'},{Hash:"FileBrowser-BrowseTree-Node-Template",Template:'\n<div class="pict-fb-tree-node{~D:Record.SelectedClass~}" style="padding-left: {~D:Record.Indent~}px;" data-path="{~D:Record.Path~}" onclick="{~D:Record.ClickHandler~}">\n\t<span class="{~D:Record.ToggleClass~}" onclick="{~D:Record.ToggleHandler~}">{~D:Record.ToggleIcon~}</span>\n\t<span class="pict-fb-tree-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-tree-label">{~D:Record.Name~}</span>\n</div>\n<div class="pict-fb-tree-children{~D:Record.ExpandedClass~}" id="Pict-FB-TreeChildren-{~D:Record.NodeID~}">\n{~D:Record.ChildrenHTML~}\n</div>\n'}],Renderables:[{RenderableHash:"BrowseTree-Container",TemplateHash:"FileBrowser-BrowseTree-Container-Template",DestinationAddress:"#Pict-FileBrowser-BrowsePane",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},o,e),i),this.expandedPaths={}}onAfterRender(t){return this.rebuildTree(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildTree(){if(!this.pict.providers["Pict-FileBrowser-Browse"])return;let t=this.getCurrentLocation(),e=this.renderTreeLevel("",0,t);this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-Tree",e)}renderTreeLevel(t,e,i){let n=this.pict.providers["Pict-FileBrowser-Browse"];if(!n)return"";let o=n.getChildFolders(t);if(!o)return this.expandedPaths[t]?'<div class="pict-fb-tree-loading" style="padding-left: '+(24+16*e)+'px;">Loading...</div>':"";let r="";for(let t=0;t<o.length;t++){let a=o[t],s=a.Path,l=s.replace(/[^a-zA-Z0-9]/g,"_"),d=!!this.expandedPaths[s],c=s===i,p=n.getChildFolders(s),h=a.HasChildren||p&&p.length>0,u="";d&&(u=this.renderTreeLevel(s,e+1,i));let m=this.pict.providers["Pict-FileBrowser-Icons"],g=m?m.getIcon("folder",16):"📁",f="";h&&(f=m?d?m.getIcon("chevron-down",10):m.getIcon("chevron-right",10):d?"▾":"▸");let v={Name:a.Name,Path:s,NodeID:l,Indent:8+16*e,Icon:g,ToggleIcon:f,ToggleClass:h?"pict-fb-tree-toggle":"pict-fb-tree-toggle-empty",ToggleHandler:h?"event.stopPropagation(); pict.views['"+this.Hash+"'].toggleNode('"+s+"')":"",ClickHandler:"pict.views['"+this.Hash+"'].selectFolder('"+s+"')",SelectedClass:c?" selected":"",ExpandedClass:d?" expanded":"",ChildrenHTML:u};r+=this.pict.parseTemplateByHash("FileBrowser-BrowseTree-Node-Template",v)}return r}toggleNode(t){if(this.expandedPaths[t]=!this.expandedPaths[t],this.expandedPaths[t]){let e=this.pict.providers["Pict-FileBrowser-Browse"];if(e){e.getChildFolders(t)||"function"==typeof this.onRequestChildren&&this.onRequestChildren(t)}}this.rebuildTree()}onRequestChildren(t){}selectFolder(t){this.expandedPaths[t]=!0;let e=this.pict.providers["Pict-FileBrowser-Browse"];if(e){e.getChildFolders(t)||"function"==typeof this.onRequestChildren&&this.onRequestChildren(t),e.navigateToFolder(t)}this.rebuildTree()}getCurrentLocation(){let t=(this.options.StateAddresses||{}).CurrentLocation||"AppData.PictFileBrowser.CurrentLocation";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||""}},e.exports.default_configuration=o},{"pict-view":102}],75:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Pict-FileBrowser-ListDetail",DefaultRenderable:"ListDetail-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ListPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ListDetail-Container-Template",Template:'\n<div class="pict-fb-detail" id="Pict-FileBrowser-DetailList">\n\t<div class="pict-fb-breadcrumb" id="Pict-FileBrowser-Breadcrumb"></div>\n\t<div class="pict-fb-detail-header">\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-name" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Name\')">Name</div>\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-size" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Size\')">Size</div>\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-modified" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Modified\')">Modified</div>\n\t</div>\n\t<div id="Pict-FileBrowser-DetailRows"></div>\n</div>\n'},{Hash:"FileBrowser-ListDetail-Row-Template",Template:'\n<div class="pict-fb-detail-row{~D:Record.SelectedClass~}" data-index="{~D:Record.Index~}" onclick="{~D:Record.ClickHandler~}" ondblclick="{~D:Record.DblClickHandler~}">\n\t<span class="pict-fb-detail-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-detail-name">{~D:Record.Name~}</span>\n\t<span class="pict-fb-detail-size">{~D:Record.SizeFormatted~}</span>\n\t<span class="pict-fb-detail-modified">{~D:Record.ModifiedFormatted~}</span>\n</div>\n'},{Hash:"FileBrowser-ListDetail-Empty-Template",Template:'<div class="pict-fb-empty">{~D:Record.Message~}</div>'},{Hash:"FileBrowser-Breadcrumb-Segment-Template",Template:'<span class="pict-fb-breadcrumb-segment" onclick="{~D:Record.ClickHandler~}">{~D:Record.Label~}</span>'},{Hash:"FileBrowser-Breadcrumb-Separator-Template",Template:'<span class="pict-fb-breadcrumb-separator">/</span>'},{Hash:"FileBrowser-Breadcrumb-Current-Template",Template:'<span class="pict-fb-breadcrumb-current">{~D:Record.Label~}</span>'}],Renderables:[{RenderableHash:"ListDetail-Container",TemplateHash:"FileBrowser-ListDetail-Container-Template",DestinationAddress:"#Pict-FileBrowser-ListPane",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},o,e),i),this._cachedFileList=[]}onAfterRender(t){let e=this.pict.parseTemplateByHash("FileBrowser-ListDetail-Container-Template",{ViewHash:this.Hash});return this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ListPane",e),this.rebuildList(),this.rebuildBreadcrumb(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildList(){let t=this.pict.providers["Pict-FileBrowser-List"];if(!t)return;let e=t.getSortedFileList();this._cachedFileList=e;let i=t.getSelectedFile();if(0===e.length){let t=this.pict.parseTemplateByHash("FileBrowser-ListDetail-Empty-Template",{Message:"This folder is empty"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-DetailRows",t)}let n="";for(let o=0;o<e.length;o++){let r=e[o],a=i&&i.Name===r.Name&&i.Path===r.Path,s={Index:o,Name:r.Name,Icon:t.getEntryIcon(r),SizeFormatted:"folder"===r.Type?"--":t.formatFileSize(r.Size),ModifiedFormatted:t.formatDate(r.Modified),SelectedClass:a?" selected":"",ClickHandler:"pict.views['"+this.Hash+"'].selectEntry("+o+")",DblClickHandler:"pict.views['"+this.Hash+"'].openEntry("+o+")"};n+=this.pict.parseTemplateByHash("FileBrowser-ListDetail-Row-Template",s)}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-DetailRows",n)}rebuildBreadcrumb(){let t=this.getCurrentLocation(),e="",i=this.pict.providers["Pict-FileBrowser-Icons"],n=i?i.getIcon("home",16):"🏠";if(e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:n,ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('')"}),t){let i=t.split("/"),n="";for(let t=0;t<i.length;t++)if(n=n?n+"/"+i[t]:i[t],e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Separator-Template",{}),t===i.length-1)e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Current-Template",{Label:i[t]});else{let o=n;e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:i[t],ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('"+o+"')"})}}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-Breadcrumb",e)}selectEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.selectFile(this._cachedFileList[t]),this.rebuildList()}openEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.openEntry(this._cachedFileList[t]),this.rebuildList(),this.rebuildBreadcrumb()}sortBy(t){let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.setSortField(t),this.rebuildList()}navigateToPath(t){let e=this.pict.providers["Pict-FileBrowser-Browse"];e&&e.navigateToFolder(t),this.rebuildList(),this.rebuildBreadcrumb()}getCurrentLocation(){let t=(this.options.StateAddresses||{}).CurrentLocation||"AppData.PictFileBrowser.CurrentLocation";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||""}},e.exports.default_configuration=o},{"pict-view":102}],76:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Pict-FileBrowser-ListIcons",DefaultRenderable:"ListIcons-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ListPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ListIcons-Container-Template",Template:'\n<div id="Pict-FileBrowser-IconList">\n\t<div class="pict-fb-breadcrumb" id="Pict-FileBrowser-IconBreadcrumb"></div>\n\t<div class="pict-fb-icons" id="Pict-FileBrowser-IconGrid"></div>\n</div>\n'},{Hash:"FileBrowser-ListIcons-Item-Template",Template:'\n<div class="pict-fb-icon-item{~D:Record.SelectedClass~}" data-index="{~D:Record.Index~}" onclick="{~D:Record.ClickHandler~}" ondblclick="{~D:Record.DblClickHandler~}">\n\t<div class="pict-fb-icon-graphic">{~D:Record.Icon~}</div>\n\t<div class="pict-fb-icon-label">{~D:Record.Name~}</div>\n</div>\n'},{Hash:"FileBrowser-ListIcons-Empty-Template",Template:'<div class="pict-fb-empty">{~D:Record.Message~}</div>'}],Renderables:[{RenderableHash:"ListIcons-Container",TemplateHash:"FileBrowser-ListIcons-Container-Template",DestinationAddress:"#Pict-FileBrowser-ListPane",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},o,e),i),this._cachedFileList=[]}onAfterRender(t){return this.rebuildGrid(),this.rebuildBreadcrumb(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildGrid(){let t=this.pict.providers["Pict-FileBrowser-List"];if(!t)return;let e=t.getSortedFileList();this._cachedFileList=e;let i=t.getSelectedFile();if(0===e.length){let t=this.pict.parseTemplateByHash("FileBrowser-ListIcons-Empty-Template",{Message:"This folder is empty"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-IconGrid",t)}let n="";for(let o=0;o<e.length;o++){let r=e[o],a=i&&i.Name===r.Name&&i.Path===r.Path,s={Index:o,Name:r.Name,Icon:t.getEntryIcon(r),SelectedClass:a?" selected":"",ClickHandler:"pict.views['"+this.Hash+"'].selectEntry("+o+")",DblClickHandler:"pict.views['"+this.Hash+"'].openEntry("+o+")"};n+=this.pict.parseTemplateByHash("FileBrowser-ListIcons-Item-Template",s)}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-IconGrid",n)}rebuildBreadcrumb(){let t=this.getCurrentLocation(),e="";if(e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:"🏠",ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('')"}),t){let i=t.split("/"),n="";for(let t=0;t<i.length;t++)if(n=n?n+"/"+i[t]:i[t],e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Separator-Template",{}),t===i.length-1)e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Current-Template",{Label:i[t]});else{let o=n;e+=this.pict.parseTemplateByHash("FileBrowser-Breadcrumb-Segment-Template",{Label:i[t],ClickHandler:"pict.views['"+this.Hash+"'].navigateToPath('"+o+"')"})}}this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-IconBreadcrumb",e)}selectEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.selectFile(this._cachedFileList[t]),this.rebuildGrid()}openEntry(t){if(t<0||t>=this._cachedFileList.length)return;let e=this.pict.providers["Pict-FileBrowser-List"];e&&e.openEntry(this._cachedFileList[t]),this.rebuildGrid(),this.rebuildBreadcrumb()}navigateToPath(t){let e=this.pict.providers["Pict-FileBrowser-Browse"];e&&e.navigateToFolder(t),this.rebuildGrid(),this.rebuildBreadcrumb()}getCurrentLocation(){let t=(this.options.StateAddresses||{}).CurrentLocation||"AppData.PictFileBrowser.CurrentLocation";return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},t)||""}},e.exports.default_configuration=o},{"pict-view":102}],77:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Pict-FileBrowser-ViewFileInfo",DefaultRenderable:"ViewFileInfo-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ViewPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ViewFileInfo-Container-Template",Template:'<div class="pict-fb-fileinfo" id="Pict-FileBrowser-FileInfo"></div>'},{Hash:"FileBrowser-ViewFileInfo-Detail-Template",Template:'\n<div class="pict-fb-fileinfo-title">{~D:Record.Name~}</div>\n<table class="pict-fb-fileinfo-table">\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Type</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.TypeDescription~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Size</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.SizeFormatted~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Modified</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.ModifiedFormatted~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Extension</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.Extension~}</td>\n\t</tr>\n\t<tr>\n\t\t<td class="pict-fb-fileinfo-label">Path</td>\n\t\t<td class="pict-fb-fileinfo-value">{~D:Record.Path~}</td>\n\t</tr>\n</table>\n'},{Hash:"FileBrowser-ViewFileInfo-Empty-Template",Template:'<div class="pict-fb-fileinfo-none">No file selected</div>'}],Renderables:[{RenderableHash:"ViewFileInfo-Container",TemplateHash:"FileBrowser-ViewFileInfo-Container-Template",DestinationAddress:"#Pict-FileBrowser-ViewPane",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},o,e),i)}onAfterRender(t){return this.rebuildFileInfo(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildFileInfo(){let t=this.pict.providers["Pict-FileBrowser-View"],e=this.pict.providers["Pict-FileBrowser-List"],i=t?t.getCurrentFile():null;if(!i){let t=this.pict.parseTemplateByHash("FileBrowser-ViewFileInfo-Empty-Template",{});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-FileInfo",t)}let n={Name:i.Name||"Unknown",TypeDescription:t?t.getFileTypeDescription(i):"File",SizeFormatted:e?e.formatFileSize(i.Size):i.Size||"--",ModifiedFormatted:e?e.formatDate(i.Modified):i.Modified||"--",Extension:i.Extension||"--",Path:i.Path||"--"},o=this.pict.parseTemplateByHash("FileBrowser-ViewFileInfo-Detail-Template",n);this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-FileInfo",o)}},e.exports.default_configuration=o},{"pict-view":102}],78:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"Pict-FileBrowser-ViewImage",DefaultRenderable:"ViewImage-Container",DefaultDestinationAddress:"#Pict-FileBrowser-ViewPane",AutoRender:!1,Templates:[{Hash:"FileBrowser-ViewImage-Container-Template",Template:'<div class="pict-fb-image-viewer" id="Pict-FileBrowser-ImageViewer"></div>'},{Hash:"FileBrowser-ViewImage-Display-Template",Template:'<img src="{~D:Record.ImageURL~}" alt="{~D:Record.Name~}" />'},{Hash:"FileBrowser-ViewImage-NoImage-Template",Template:'<div class="pict-fb-image-viewer-none">{~D:Record.Message~}</div>'}],Renderables:[{RenderableHash:"ViewImage-Container",TemplateHash:"FileBrowser-ViewImage-Container-Template",DestinationAddress:"#Pict-FileBrowser-ViewPane",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},o,e),i)}onAfterRender(t){return this.rebuildImageView(),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}rebuildImageView(){let t=this.pict.providers["Pict-FileBrowser-View"],e=t?t.getCurrentFile():null;if(!e){let t=this.pict.parseTemplateByHash("FileBrowser-ViewImage-NoImage-Template",{Message:"No file selected"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",t)}if(!(!!t&&t.isImage(e))){let t=this.pict.parseTemplateByHash("FileBrowser-ViewImage-NoImage-Template",{Message:"Selected file is not an image"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",t)}let i=t?t.getImageURL(e):null;if(!i){let t=this.pict.parseTemplateByHash("FileBrowser-ViewImage-NoImage-Template",{Message:"No image URL available"});return void this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",t)}let n=this.pict.parseTemplateByHash("FileBrowser-ViewImage-Display-Template",{ImageURL:i,Name:e.Name||"Image"});this.pict.ContentAssignment.assignContent("#Pict-FileBrowser-ImageViewer",n)}},e.exports.default_configuration=o},{"pict-view":102}],79:[function(t,e,i){const n=t("pict-view"),o=t("../Pict-Section-FileBrowser-DefaultConfiguration.js"),r=t("../providers/Pict-Provider-FileBrowserBrowse.js"),a=t("../providers/Pict-Provider-FileBrowserList.js"),s=t("../providers/Pict-Provider-FileBrowserView.js"),l=t("../providers/Pict-Provider-FileBrowserLayout.js"),d=t("../providers/Pict-Provider-FileBrowserIcons.js");e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},JSON.parse(JSON.stringify(o)),e),i),this.pict.providers["Pict-FileBrowser-Browse"]||this.pict.addProvider("Pict-FileBrowser-Browse",r.default_configuration,r),this.pict.providers["Pict-FileBrowser-List"]||this.pict.addProvider("Pict-FileBrowser-List",a.default_configuration,a),this.pict.providers["Pict-FileBrowser-View"]||this.pict.addProvider("Pict-FileBrowser-View",s.default_configuration,s),this.pict.providers["Pict-FileBrowser-Layout"]||this.pict.addProvider("Pict-FileBrowser-Layout",l.default_configuration,l),this.pict.providers["Pict-FileBrowser-Icons"]||this.pict.addProvider("Pict-FileBrowser-Icons",d.default_configuration,d),this.ensureDefaultState()}ensureDefaultState(){let t=this.options.DefaultState||{},e=this.options.StateAddresses||{},i={AppData:this.pict.AppData,Pict:this.pict};this.pict.AppData.PictFileBrowser||(this.pict.AppData.PictFileBrowser={});for(let n in e){let o=e[n],r=this.pict.manifest.getValueByHash(i,o);if(null==r){let e=t[n];void 0!==e&&this.pict.manifest.setValueByHash(i,o,e)}}this.pict.AppData.PictFileBrowser.FileList||(this.pict.AppData.PictFileBrowser.FileList=[]),this.pict.AppData.PictFileBrowser.FolderTree||(this.pict.AppData.PictFileBrowser.FolderTree=[])}onAfterRender(t){return this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}getState(t){let e=(this.options.StateAddresses||{})[t];if(e)return this.pict.manifest.getValueByHash({AppData:this.pict.AppData,Pict:this.pict},e)}setState(t,e){let i=(this.options.StateAddresses||{})[t];i&&this.pict.manifest.setValueByHash({AppData:this.pict.AppData,Pict:this.pict},i,e)}},e.exports.default_configuration=o},{"../Pict-Section-FileBrowser-DefaultConfiguration.js":65,"../providers/Pict-Provider-FileBrowserBrowse.js":67,"../providers/Pict-Provider-FileBrowserIcons.js":68,"../providers/Pict-Provider-FileBrowserLayout.js":69,"../providers/Pict-Provider-FileBrowserList.js":70,"../providers/Pict-Provider-FileBrowserView.js":71,"pict-view":102}],80:[function(t,e,i){e.exports=t("./providers/Pict-Provider-InlineDocumentation.js"),e.exports.InlineDocumentationLayoutView=t("./views/Pict-View-InlineDocumentation-Layout.js"),e.exports.InlineDocumentationContentView=t("./views/Pict-View-InlineDocumentation-Content.js"),e.exports.InlineDocumentationNavView=t("./views/Pict-View-InlineDocumentation-Nav.js"),e.exports.InlineDocumentationTopicManagerView=t("./views/Pict-View-InlineDocumentation-TopicManager.js")},{"./providers/Pict-Provider-InlineDocumentation.js":81,"./views/Pict-View-InlineDocumentation-Content.js":82,"./views/Pict-View-InlineDocumentation-Layout.js":83,"./views/Pict-View-InlineDocumentation-Nav.js":84,"./views/Pict-View-InlineDocumentation-TopicManager.js":85}],81:[function(t,e,i){const n=t("pict-provider"),o=t("pict-section-content").PictContentProvider,r=t("pict-section-modal"),a=t("pict-section-markdowneditor"),s=t("lunr"),l=t("../views/Pict-View-InlineDocumentation-Layout.js"),d=t("../views/Pict-View-InlineDocumentation-Content.js"),c=t("../views/Pict-View-InlineDocumentation-Nav.js"),p=t("../views/Pict-View-InlineDocumentation-TopicManager.js");const h={ProviderIdentifier:"Pict-InlineDocumentation",AutoInitialize:!0,AutoInitializeOrdinal:0};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},JSON.parse(JSON.stringify(h)),e),i),this._ContentCache={},this._ActiveTooltipBindings=[],this._tooltipHelpLinkHandler=null,this._ContentProvider=this.pict.addProviderSingleton("Pict-Content",o.default_configuration,o),this.pict.addViewSingleton("InlineDoc-Layout",l.default_configuration,l),this.pict.addViewSingleton("InlineDoc-Content",d.default_configuration,d),this.pict.addViewSingleton("InlineDoc-Nav",c.default_configuration,c),this.pict.addViewSingleton("InlineDoc-TopicManager",p.default_configuration,p),this.pict.views["Pict-Section-Modal"]||this.pict.addViewSingleton("Pict-Section-Modal",r.default_configuration,r);let n=JSON.parse(JSON.stringify(a.default_configuration));n.DefaultDestinationAddress="#InlineDoc-Editor-Container",n.TargetElementAddress="#InlineDoc-Editor-Container",n.ContentDataAddress="AppData.InlineDocumentation.EditorSegments",n.DefaultPreviewMode="off",n.Renderables=[{RenderableHash:"MarkdownEditor-Wrap",TemplateHash:"MarkdownEditor-Container",ContentDestinationAddress:"#InlineDoc-Editor-Container"}],this.pict.addViewSingleton("InlineDoc-MarkdownEditor",n,a)}initializeDocumentation(t,e){let i="function"==typeof e?e:()=>{},n=t||{};this.pict.AppData.InlineDocumentation||(this.pict.AppData.InlineDocumentation={});let o=this.pict.AppData.InlineDocumentation;if(o.DocsBaseURL=n.DocsBaseURL||o.DocsBaseURL||"",o.CurrentPath="",o.CurrentRoute="",o.SidebarGroups=o.SidebarGroups||[],o.Topic=null,o.Topics=o.Topics||{},o.NavigationHistory=[],o.NavCollapsed=!0,o.CollapsedGroups={},o.ActiveDocumentHeadings=[],o.NavFilterText="",o.SearchIndexLoaded=!1,o.SearchQuery="",o.SearchResults=[],o.ExternalDocBaseURL=n.ExternalDocBaseURL||"",void 0!==n.EditEnabled?o.EditEnabled=!!n.EditEnabled:o.EditEnabled=o.EditEnabled||!1,o.Editing=!1,o.EditingPath="",o.EditingContent="",o.TooltipEditMode=!1,"function"==typeof n.onSave&&(this._onSave=n.onSave),"function"==typeof n.onTopicsSave&&(this._onTopicsSave=n.onTopicsSave),"function"==typeof n.onImageUpload&&(this._onImageUpload=n.onImageUpload,this._wireEditorImageUpload()),void 0!==n.TopicManagerEnabled?(o.TopicManagerEnabled=!!n.TopicManagerEnabled,this._topicManagerExplicitlySet=!0):(o.TopicManagerEnabled=o.EditEnabled||!1,this._topicManagerExplicitlySet=!1),n.ContainerAddress){let t=this.pict.views["InlineDoc-Layout"];if(t&&t.options&&t.options.Renderables)for(let e=0;e<t.options.Renderables.length;e++)t.options.Renderables[e].ContentDestinationAddress=n.ContainerAddress}let r=2;n.SearchIndexURL&&r++;let a=this,s=()=>{if(r--,r<=0)return a._markExternalSidebarItems(),a.pict.views["InlineDoc-Layout"].render(),a.pict.views["InlineDoc-Nav"].render(),i()};this._loadSidebar(s),this._loadTopics(n.TopicsURL,s),n.SearchIndexURL&&this._loadSearchIndex(n.SearchIndexURL,s)}loadDocument(t,e){let i="function"==typeof e?e:()=>{};if(!t)return i("No document path provided");let n=this.pict.AppData.InlineDocumentation,o=this.pict.views["InlineDoc-Content"],r="",a=t,s=a.indexOf("#");s>=0&&(r=a.substring(s+1),a=a.substring(0,s)),a.match(/\.md$/)||(a+=".md"),n.CurrentPath=a,n.NavigationHistory.push(a),o.render(),o.showLoading();let l=(n.DocsBaseURL||"")+a;this._fetchDocument(l,(t,e)=>t?(o.displayContent(this._getErrorPageHTML(a)),i(t)):(o.displayContent(e),r&&this._scrollToAnchor(r),n.NavCollapsed=!0,n.NavFilterText="",n.SearchQuery="",n.SearchResults=[],this.pict.views["InlineDoc-Nav"].render(),i(null,e)))}setTopic(t){let e=this.pict.AppData.InlineDocumentation;t&&e.Topics&&e.Topics[t]?(e.Topic=t,this.pict.views["InlineDoc-Nav"].render()):this.log.warn(`InlineDocumentation: Topic [${t}] not found.`)}loadTopicDocument(t,e){let i=this.pict.AppData.InlineDocumentation;if(!t||!i.Topics||!i.Topics[t])return this.log.warn(`InlineDocumentation: Topic [${t}] not found.`),"function"==typeof e?e("Topic not found"):void 0;let n=i.Topics[t];i.Topic=t,this.pict.views["InlineDoc-Nav"].render();let o=n.TopicHelpFilePath||"";o&&this.loadDocument(o,e)}clearTopic(){this.pict.AppData.InlineDocumentation.Topic=null,this.pict.views["InlineDoc-Nav"].render()}addTopic(t,e){let i=this.pict.AppData.InlineDocumentation;if(!t)return void this.log.warn("InlineDocumentation: addTopic requires a TopicCode.");i.Topics||(i.Topics={});let n=Object.assign({TopicCode:t},e||{});i.Topics[t]=n}addRouteToTopic(t,e){let i=this.pict.AppData.InlineDocumentation;if(!t||!i.Topics||!i.Topics[t])return void this.log.warn(`InlineDocumentation: Topic [${t}] not found for addRouteToTopic.`);let n=i.Topics[t];n.Routes||(n.Routes=[]),n.Routes.indexOf(e)<0&&n.Routes.push(e)}getTopicList(){let t=this.pict.AppData.InlineDocumentation,e=[];if(!t||!t.Topics)return e;let i=Object.keys(t.Topics);for(let n=0;n<i.length;n++){let o=t.Topics[i[n]];e.push({TopicCode:i[n],TopicTitle:o.TopicTitle||o.Name||i[n],TopicHelpFilePath:o.TopicHelpFilePath||"",RouteCount:o.Routes&&Array.isArray(o.Routes)?o.Routes.length:0})}return e}updateTopic(t,e){let i=this.pict.AppData.InlineDocumentation;if(!t||!i.Topics||!i.Topics[t])return!1;let n=i.Topics[t],o=e||{};return o.hasOwnProperty("TopicTitle")&&(n.TopicTitle=o.TopicTitle),o.hasOwnProperty("TopicHelpFilePath")&&(n.TopicHelpFilePath=o.TopicHelpFilePath),o.hasOwnProperty("Routes")&&(n.Routes=o.Routes),!0}removeTopic(t){let e=this.pict.AppData.InlineDocumentation;return!!(t&&e.Topics&&e.Topics[t])&&(delete e.Topics[t],e.Topic===t&&(e.Topic=null),!0)}removeRouteFromTopic(t,e){let i=this.pict.AppData.InlineDocumentation;if(!t||!i.Topics||!i.Topics[t])return!1;let n=i.Topics[t];if(!n.Routes||!Array.isArray(n.Routes))return!1;let o=n.Routes.indexOf(e);return!(o<0)&&(n.Routes.splice(o,1),!0)}saveTopics(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.InlineDocumentation;if("function"!=typeof this._onTopicsSave)return e(null);this._onTopicsSave(i.Topics,t=>t?(this.log.warn(`InlineDocumentation: Topics save failed: ${t}`),e(t)):e(null))}setTopicManagerEnabled(t){this.pict.AppData.InlineDocumentation.TopicManagerEnabled=!!t;let e=this.pict.views["InlineDoc-Nav"];e&&e.render()}getRouteSegments(t){if(!t||"string"!=typeof t)return[];let e=t.replace(/^\//,"");if(!e)return[];let i=e.split("/"),n=[];for(let t=0;t<i.length;t++){let e="/"+i.slice(0,t+1).join("/");n.push({Segment:i[t],Path:e,WildcardPattern:e+"/*",Index:t})}return n}buildWildcardPattern(t,e){let i=this.getRouteSegments(t);return i.length<1||e<0||e>=i.length?"":i[e].WildcardPattern}getTopicsForRoute(t){let e=this.pict.AppData.InlineDocumentation,i=[];if(!t||!e.Topics)return i;let n=Object.keys(e.Topics);for(let o=0;o<n.length;o++){let r=e.Topics[n[o]];if(r.Routes&&Array.isArray(r.Routes))for(let e=0;e<r.Routes.length;e++){let a=r.Routes[e];if(!a)continue;let s=0,l=!1;if(a.endsWith("/*")){let e=a.slice(0,-2);t!==e&&0!==t.indexOf(e+"/")||(l=!0,s=e.length)}else t===a&&(l=!0,s=a.length);l&&i.push({TopicCode:n[o],Pattern:a,MatchLength:s})}}return i.sort((t,e)=>e.MatchLength-t.MatchLength),i}setDocsBaseURL(t){this.pict.AppData.InlineDocumentation||(this.pict.AppData.InlineDocumentation={}),this.pict.AppData.InlineDocumentation.DocsBaseURL=t||"",this._ContentCache={}}getNavigationHistory(){let t=this.pict.AppData.InlineDocumentation;return t&&t.NavigationHistory?t.NavigationHistory:[]}navigateBack(t){let e=this.getNavigationHistory();if(e.length<2)return;e.pop();let i=e.pop();this.loadDocument(i,t)}setEditEnabled(t){let e=this.pict.AppData.InlineDocumentation;if(e.EditEnabled=!!t,!this._topicManagerExplicitlySet){e.TopicManagerEnabled=!!t;let i=this.pict.views["InlineDoc-Nav"];i&&i.render()}let i=this.pict.views["InlineDoc-Content"];i&&i.renderEditToolbar()}toggleEdit(){this.pict.AppData.InlineDocumentation.Editing?this.cancelEdit():this.beginEdit()}beginEdit(){let t=this.pict.AppData.InlineDocumentation;if(!t.EditEnabled||!t.CurrentPath)return;let e=(t.DocsBaseURL||"")+t.CurrentPath,i=this._ContentCache[e],n=i&&i.markdown?i.markdown:"";t.Editing=!0,t.EditingPath=t.CurrentPath,t.EditingContent=n;let o=this.pict.views["InlineDoc-Content"];o&&o.showEditor(n)}cancelEdit(){let t=this.pict.AppData.InlineDocumentation;t.Editing=!1,t.EditingPath="",t.EditingContent="",t.EditorSegments=[];let e=this.pict.views["InlineDoc-Content"];if(e){e.hideEditor();let i=(t.DocsBaseURL||"")+t.CurrentPath,n=this._ContentCache[i];n&&n.html&&e.displayContent(n.html)}}saveEdit(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.InlineDocumentation,n=this.pict.views["InlineDoc-Content"];if(!i.Editing)return e("Not in edit mode");let o="",r=this.pict.views["InlineDoc-MarkdownEditor"];r&&"function"==typeof r.marshalFromView&&r.marshalFromView(),i.EditorSegments&&i.EditorSegments.length>0&&(o=i.EditorSegments[0].Content||"");let a=i.EditingPath,s=(i.DocsBaseURL||"")+a,l={Path:a,Content:o},d=()=>{let t=this._ContentProvider.parseMarkdown(o,this._createLinkResolver(),this._createImageResolver(s));return this._ContentCache[s]={html:t,markdown:o},i.Editing=!1,i.EditingPath="",i.EditingContent="",i.EditorSegments=[],n&&(n.hideEditor(),n.displayContent(t)),e(null)};"function"==typeof this._onSave?this._onSave(l,t=>{if(t)return this.log.warn(`InlineDocumentation: Save failed: ${t}`),e(t);d()}):d()}resolveHelpForRoute(t){let e=this.pict.AppData.InlineDocumentation;if(!t||!e.Topics)return null;let i=null,n=-1,o=Object.keys(e.Topics);for(let r=0;r<o.length;r++){let a=e.Topics[o[r]];if(a.Routes&&Array.isArray(a.Routes))for(let e=0;e<a.Routes.length;e++){let s=a.Routes[e];if(!s)continue;let l=!1,d=0;if(s.endsWith("/*")){let e=s.slice(0,-2);t!==e&&0!==t.indexOf(e+"/")||(l=!0,d=e.length)}else t===s&&(l=!0,d=s.length);l&&d>n&&(i=o[r],n=d)}}return i}navigateToRoute(t,e){this.pict.AppData.InlineDocumentation.CurrentRoute=t||"";let i=this.resolveHelpForRoute(t);return!!i&&(this.loadTopicDocument(i,e),!0)}setTooltipEditMode(t){let e=this.pict.AppData.InlineDocumentation;e&&(e.TooltipEditMode=!!t,this.scanTooltips())}getTooltipContent(t){let e=this.pict.AppData.InlineDocumentation;if(!(t&&e&&e.Topic&&e.Topics))return null;let i=e.Topics[e.Topic];return i&&i.Tooltips&&i.Tooltips[t]&&i.Tooltips[t].Content||null}setTooltipContent(t,e){let i=this.pict.AppData.InlineDocumentation;if(!(t&&i&&i.Topic&&i.Topics))return!1;let n=i.Topics[i.Topic];return!!n&&(e?(n.Tooltips||(n.Tooltips={}),n.Tooltips[t]={Content:e},!0):(n.Tooltips&&n.Tooltips[t]&&delete n.Tooltips[t],!0))}clearTooltipBindings(){for(let t=0;t<this._ActiveTooltipBindings.length;t++){let e=this._ActiveTooltipBindings[t];e.TooltipHandle&&"function"==typeof e.TooltipHandle.destroy&&e.TooltipHandle.destroy(),e.ClickHandler&&e.Element&&e.Element.removeEventListener("click",e.ClickHandler),e.InjectedIcon&&e.InjectedIcon.parentNode&&e.InjectedIcon.parentNode.removeChild(e.InjectedIcon),e.Element&&e.Element.classList.remove("pict-inline-doc-tooltip-edit-target","pict-inline-doc-tooltip-empty"),void 0!==e.OriginalDisplay&&e.Element&&(e.Element.style.display=e.OriginalDisplay)}this._ActiveTooltipBindings=[],this._tooltipHelpLinkHandler&&"undefined"!=typeof document&&(document.removeEventListener("click",this._tooltipHelpLinkHandler),this._tooltipHelpLinkHandler=null)}scanTooltips(){if(this.clearTooltipBindings(),"undefined"==typeof document)return;let t=this.pict.AppData.InlineDocumentation;if(!t)return;let e=this.pict.views["Pict-Section-Modal"],i=document.querySelectorAll("[data-d-tooltip]"),n=t.TooltipEditMode||!1;for(let t=0;t<i.length;t++){let o=i[t],r=o.getAttribute("data-d-tooltip");if(!r)continue;let a=this.getTooltipContent(r),s=o.hasAttribute("data-d-tooltip-icon"),l={Element:o,Key:r,Type:s?"icon":"attribute",TooltipHandle:null,ClickHandler:null,InjectedIcon:null,OriginalDisplay:void 0};n?this._wireTooltipEditMode(o,r,a,s,l,e):this._wireTooltipNormalMode(o,r,a,s,l,e),this._ActiveTooltipBindings.push(l)}this._installTooltipHelpLinkHandler()}_installTooltipHelpLinkHandler(){if("undefined"==typeof document)return;this._tooltipHelpLinkHandler&&document.removeEventListener("click",this._tooltipHelpLinkHandler);let t=this;this._tooltipHelpLinkHandler=e=>{let i=e.target;for(;i&&i!==document;){if("A"===i.tagName&&i.getAttribute("rel")&&0===i.getAttribute("rel").indexOf("pict-inline-doc-help:")){e.preventDefault(),e.stopPropagation();let n=i.getAttribute("rel").replace("pict-inline-doc-help:","");return void t.loadDocument(n)}i=i.parentNode}},document.addEventListener("click",this._tooltipHelpLinkHandler)}_wireTooltipNormalMode(t,e,i,n,o,r){if(n)if(i){let e=this._createTooltipIcon(t);if(o.InjectedIcon=e,r&&r.richTooltip){let e=this._ContentProvider.parseMarkdown(i,this._createTooltipLinkResolver());o.TooltipHandle=r.richTooltip(t,e,{interactive:!0,maxWidth:"350px"})}}else o.OriginalDisplay=t.style.display,t.style.display="none";else if(i&&r&&r.richTooltip){let e=this._ContentProvider.parseMarkdown(i,this._createTooltipLinkResolver());o.TooltipHandle=r.richTooltip(t,e,{interactive:!0,maxWidth:"350px"})}}_wireTooltipEditMode(t,e,i,n,o,r){if(t.classList.add("pict-inline-doc-tooltip-edit-target"),n){let e=this._createTooltipIcon(t);o.InjectedIcon=e,i||t.classList.add("pict-inline-doc-tooltip-empty")}let a=this,s=t=>{t.preventDefault(),t.stopPropagation(),a._showTooltipEditor(e)};t.addEventListener("click",s),o.ClickHandler=s}_createTooltipIcon(t){let e=document.createElement("span");e.className="pict-inline-doc-tooltip-icon";let i=t.getAttribute("data-d-tooltip-icon");return i&&""!==i?e.className+=" "+i:e.innerHTML="❓",t.appendChild(e),e}_showTooltipEditor(t){let e=this.pict.views["Pict-Section-Modal"];if(!e)return;let i=this.getTooltipContent(t)||"",n=this,o='<div class="pict-inline-doc-tm-form-group">';o+='<label class="pict-inline-doc-tm-form-label">Tooltip Key</label>',o+='<div style="font-family:monospace;font-size:0.85em;color:#8A7F72;padding:0.3em 0;">'+this._escapeTooltipHTML(t)+"</div>",o+="</div>",o+='<div class="pict-inline-doc-tm-form-group">',o+='<label class="pict-inline-doc-tm-form-label">Content (Markdown)</label>',o+='<textarea class="pict-inline-doc-tooltip-editor-textarea" id="InlineDoc-Tooltip-Editor-Textarea">'+this._escapeTooltipHTML(i)+"</textarea>",o+="</div>",o+='<div class="pict-inline-doc-tooltip-preview-label">Preview</div>',o+='<div class="pict-inline-doc-tooltip-preview" id="InlineDoc-Tooltip-Editor-Preview"></div>',e.show({title:"Edit Tooltip",content:o,closeable:!0,width:"480px",buttons:[{Hash:"cancel",Label:"Cancel"},{Hash:"save",Label:"Save",Style:"primary"}],onOpen:t=>{let e=document.getElementById("InlineDoc-Tooltip-Editor-Textarea"),o=document.getElementById("InlineDoc-Tooltip-Editor-Preview");if(e&&o){let t=n._createTooltipLinkResolver(),r=i?n._ContentProvider.parseMarkdown(i,t):'<span style="color:#8A7F72;">No content yet.</span>';o.innerHTML=r,e.addEventListener("input",()=>{let i=e.value.trim();o.innerHTML=i?n._ContentProvider.parseMarkdown(i,t):'<span style="color:#8A7F72;">No content yet.</span>'}),e.focus()}}}).then(i=>{if("save"===i){let i=document.getElementById("InlineDoc-Tooltip-Editor-Textarea"),o=i?i.value.trim():"";n.setTooltipContent(t,o||null),n.saveTopics(),n.scanTooltips(),e.toast&&e.toast("Tooltip saved.",{type:"success"})}})}_escapeTooltipHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}_wireEditorImageUpload(){let t=this,e=this.pict.views["InlineDoc-MarkdownEditor"];e&&(e.onImageUpload=(e,i,n)=>{if("function"!=typeof t._onImageUpload)return!1;let o=t.pict.AppData.InlineDocumentation,r=o&&o.EditingPath?o.EditingPath:"";return t._onImageUpload(e,r,(e,i)=>{e&&t.log.warn(`InlineDocumentation: Image upload failed: ${e}`),n(e,i)}),!0})}_scrollToAnchor(t){"undefined"!=typeof document&&t&&setTimeout(()=>{let e=document.getElementById("InlineDoc-Content-Body");if(!e)return;let i=t.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-"),n=e.querySelector("#"+CSS.escape(i));if(!n){let t=e.querySelectorAll("h1, h2, h3, h4, h5, h6");for(let e=0;e<t.length;e++){if((t[e].textContent||"").toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-")===i){n=t[e];break}}}n&&n.scrollIntoView({behavior:"smooth",block:"start"})},50)}_loadSearchIndex(t,e){let i="function"==typeof e?e:()=>{},n=this;if("undefined"==typeof fetch)return i();fetch(t).then(t=>t.ok?t.json():null).then(t=>{if(!t||!t.LunrIndex||!t.Documents)return n.log&&n.log.info("InlineDocumentation: No keyword index found; search unavailable."),i();try{n._LunrIndex=s.Index.load(t.LunrIndex),n._SearchDocuments=t.Documents;let e=n.pict.AppData.InlineDocumentation;e&&(e.SearchIndexLoaded=!0),n.log&&n.log.info("InlineDocumentation: Search index loaded ("+(t.DocumentCount||0)+" documents).")}catch(t){n.log&&n.log.warn("InlineDocumentation: Error hydrating lunr index: "+t)}return i()}).catch(t=>(n.log&&n.log.warn("InlineDocumentation: Error loading search index: "+t),i()))}search(t){if(!(this._LunrIndex&&this._SearchDocuments&&t&&t.trim()))return[];let e=[];try{let i=this._LunrIndex.search(t);for(let t=0;t<i.length;t++){let n=i[t].ref,o=i[t].score,r=this._SearchDocuments[n];r&&e.push({Key:n,Title:r.Title||n,Group:r.Group||"",Module:r.Module||"",DocPath:r.DocPath||n,Score:o})}}catch(t){this.log&&this.log.warn("InlineDocumentation: Search error: "+t)}return e}isExternalPath(t){if(!t)return!1;let e=this.pict.AppData.InlineDocumentation;return!(!e||!e.ExternalDocBaseURL)&&t.replace(/^\.\//,"").replace(/^\//,"").split("/").filter(t=>t.length>0).length>=2}resolveExternalURL(t){if(!this.isExternalPath(t))return null;let e=this.pict.AppData.InlineDocumentation,i=e&&e.ExternalDocBaseURL||"";return i?i+t.replace(/^\.\//,"").replace(/^\//,""):null}_markExternalSidebarItems(){let t=this.pict.AppData.InlineDocumentation;if(!t||!t.ExternalDocBaseURL)return;let e=t.SidebarGroups||[];for(let t=0;t<e.length;t++){let i=e[t].Items||[];for(let t=0;t<i.length;t++){let e=i[t];this.isExternalPath(e.Path)&&(e.External=!0,e.ExternalURL=this.resolveExternalURL(e.Path))}}}_extractHeadings(){let t=[];if("undefined"==typeof document)return t;let e=document.getElementById("InlineDoc-Content-Body");if(!e)return t;let i=e.querySelectorAll("h2, h3");for(let e=0;e<i.length;e++){let n=i[e],o=(n.textContent||"").trim(),r=parseInt(n.tagName.substring(1),10),a=o.toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-");n.id||(n.id=a),t.push({Text:o,Slug:a,Level:r})}let n=this.pict.AppData.InlineDocumentation;return n&&(n.ActiveDocumentHeadings=t),t}_fetchDocument(t,e){let i="function"==typeof e?e:()=>{};return t?this._ContentCache[t]?i(null,this._ContentCache[t].html):void fetch(t).then(t=>t.ok?t.text():null).then(e=>{if(!e)return i("Document not found","");let n=this._ContentProvider.parseMarkdown(e,this._createLinkResolver(),this._createImageResolver(t));return this._ContentCache[t]={html:n,markdown:e},i(null,n)}).catch(e=>(this.log.warn(`InlineDocumentation: Error fetching [${t}]: ${e}`),i(e,""))):i("No URL provided","")}_createLinkResolver(){return(t,e)=>{if(t.match(/^https?:\/\//))return{href:t,target:"_blank",rel:"noopener"};if(t.match(/^help:/)){return{href:"javascript:void(0)",target:"",rel:"pict-inline-doc-link:"+t.replace(/^help:/,"")}}return{href:"javascript:void(0)",target:"",rel:"pict-inline-doc-link:"+t.replace(/^\.\//,"").replace(/^\//,"")}}}_createTooltipLinkResolver(){return(t,e)=>{if(t.match(/^https?:\/\//))return{href:t,target:"_blank",rel:"noopener"};let i=t.replace(/^help:/,"");return i=i.replace(/^\.\//,"").replace(/^\//,""),{href:"javascript:void(0)",target:"",rel:"pict-inline-doc-help:"+i}}}_createImageResolver(t){let e="";if(t){let i=t.lastIndexOf("/");i>=0&&(e=t.substring(0,i+1))}return(t,i)=>t.match(/^https?:\/\//)||t.match(/^data:/)||t.match(/^\//)?t:e+t}_loadSidebar(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.InlineDocumentation,n=i.DocsBaseURL||"";fetch(n+"_sidebar.md").then(t=>t.ok?t.text():null).then(t=>t?(i.SidebarGroups=this._parseSidebarMarkdown(t),e()):(this.log.info("InlineDocumentation: No _sidebar.md found."),e())).catch(t=>(this.log.warn(`InlineDocumentation: Error loading _sidebar.md: ${t}`),e()))}_loadTopics(t,e){let i="function"==typeof e?e:()=>{},n=this.pict.AppData.InlineDocumentation,o=n.DocsBaseURL||"";fetch(t||o+"_topics.json").then(t=>t.ok?t.json():null).then(t=>(t?(n.Topics=t,this.log.info(`InlineDocumentation: Topics loaded (${Object.keys(t).length} topics).`)):this.log.info("InlineDocumentation: No _topics.json found."),i())).catch(t=>(this.log.info(`InlineDocumentation: No topics loaded (${t}).`),i()))}_parseSidebarMarkdown(t){let e=[],i=null,n=t.split("\n");for(let t=0;t<n.length;t++){let o=n[t];if(!o.trim())continue;let r=o.match(/^(\s*)/),a=r?r[1].length:0,s=o.trim().match(/^[-*+]\s+(.*)/);if(!s)continue;let l=s[1].trim(),d=l.match(/^\[([^\]]+)\]\(([^)]+)\)/);if(a<2)if(d){let t=d[1].trim(),n=d[2].trim();i={Name:t,Key:t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),Path:this._normalizePath(n),Items:[]},e.push(i)}else i={Name:l,Key:l.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),Path:"",Items:[]},e.push(i);else i&&(d?i.Items.push({Name:d[1].trim(),Path:this._normalizePath(d[2].trim())}):i.Items.push({Name:l,Path:""}))}return e}_normalizePath(t){return t?t.replace(/^\.\//,"").replace(/^\//,""):""}_getErrorPageHTML(t){return'<div class="pict-inline-doc-not-found"><h2>Page Not Found</h2><p>The document <code>'+this._ContentProvider.escapeHTML(t||"unknown")+"</code> could not be loaded.</p></div>"}},e.exports.default_configuration=h},{"../views/Pict-View-InlineDocumentation-Content.js":82,"../views/Pict-View-InlineDocumentation-Layout.js":83,"../views/Pict-View-InlineDocumentation-Nav.js":84,"../views/Pict-View-InlineDocumentation-TopicManager.js":85,lunr:32,"pict-provider":58,"pict-section-content":62,"pict-section-markdowneditor":92,"pict-section-modal":100}],82:[function(t,e,i){const n=t("pict-section-content"),o={ViewIdentifier:"InlineDoc-Content",DefaultRenderable:"InlineDoc-Content-Display",DefaultContentDestinationAddress:"#InlineDoc-Content-Container",AutoRender:!1,CSS:"\n\t\t.pict-inline-doc-content {\n\t\t\tpadding: 1em 1.25em;\n\t\t\tmax-width: 100%;\n\t\t\tword-wrap: break-word;\n\t\t\toverflow-wrap: break-word;\n\t\t}\n\t\t.pict-inline-doc-content-loading {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tmin-height: 150px;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 0.95em;\n\t\t}\n\t\t.pict-inline-doc-content h1 {\n\t\t\tfont-size: 1.75em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tpadding-bottom: 0.3em;\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t.pict-inline-doc-content h2 {\n\t\t\tfont-size: 1.35em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tpadding-bottom: 0.2em;\n\t\t\tmargin-top: 1.25em;\n\t\t}\n\t\t.pict-inline-doc-content h3 {\n\t\t\tfont-size: 1.15em;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-top: 1em;\n\t\t}\n\t\t.pict-inline-doc-content h4, .pict-inline-doc-content h5, .pict-inline-doc-content h6 {\n\t\t\tcolor: #5E5549;\n\t\t\tmargin-top: 0.8em;\n\t\t}\n\t\t.pict-inline-doc-content p {\n\t\t\tline-height: 1.65;\n\t\t\tcolor: #423D37;\n\t\t\tmargin: 0.6em 0;\n\t\t}\n\t\t.pict-inline-doc-content a {\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.pict-inline-doc-content a:hover {\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t.pict-inline-doc-content pre {\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 1em;\n\t\t\tborder-radius: 5px;\n\t\t\toverflow-x: auto;\n\t\t\tline-height: 1.5;\n\t\t\tfont-size: 0.85em;\n\t\t\tmax-width: 100%;\n\t\t}\n\t\t.pict-inline-doc-content code {\n\t\t\tbackground: #F0ECE4;\n\t\t\tpadding: 0.15em 0.35em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.85em;\n\t\t\tcolor: #9E6B47;\n\t\t}\n\t\t.pict-inline-doc-content pre code {\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tcolor: inherit;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.pict-inline-doc-content blockquote {\n\t\t\tborder-left: 3px solid #2E7D74;\n\t\t\tmargin: 0.8em 0;\n\t\t\tpadding: 0.4em 0.8em;\n\t\t\tbackground: #F7F5F0;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.pict-inline-doc-content blockquote p {\n\t\t\tmargin: 0.2em 0;\n\t\t}\n\t\t.pict-inline-doc-content ul, .pict-inline-doc-content ol {\n\t\t\tpadding-left: 1.8em;\n\t\t\tline-height: 1.7;\n\t\t}\n\t\t.pict-inline-doc-content li {\n\t\t\tmargin: 0.2em 0;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-inline-doc-content hr {\n\t\t\tborder: none;\n\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\tmargin: 1.5em 0;\n\t\t}\n\t\t.pict-inline-doc-content table {\n\t\t\twidth: 100%;\n\t\t\tborder-collapse: collapse;\n\t\t\tmargin: 0.8em 0;\n\t\t\tdisplay: block;\n\t\t\toverflow-x: auto;\n\t\t}\n\t\t.pict-inline-doc-content table th {\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.5em 0.7em;\n\t\t\ttext-align: left;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-inline-doc-content table td {\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tpadding: 0.4em 0.7em;\n\t\t\tcolor: #423D37;\n\t\t}\n\t\t.pict-inline-doc-content table tr:nth-child(even) {\n\t\t\tbackground: #F7F5F0;\n\t\t}\n\t\t.pict-inline-doc-content img {\n\t\t\tmax-width: 100%;\n\t\t\theight: auto;\n\t\t}\n\t\t.pict-inline-doc-not-found {\n\t\t\ttext-align: center;\n\t\t\tpadding: 2em 1em;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.pict-inline-doc-not-found h2 {\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1.3em;\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t.pict-inline-doc-not-found code {\n\t\t\tbackground: #F0ECE4;\n\t\t\tpadding: 0.15em 0.35em;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.85em;\n\t\t\tcolor: #9E6B47;\n\t\t}\n\t\t/* Code block action buttons (copy, fullscreen) from pict-section-content */\n\t\t.pict-content-code-actions {\n\t\t\tposition: sticky;\n\t\t\ttop: 64px;\n\t\t\talign-self: flex-start;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tgap: 6px;\n\t\t\tflex: 0 0 auto;\n\t\t\tpadding-top: 6px;\n\t\t\topacity: 0;\n\t\t\ttransform: translateX(-4px);\n\t\t\ttransition: opacity 0.15s ease, transform 0.15s ease;\n\t\t\tpointer-events: none;\n\t\t}\n\t\t.pict-content-code-container:hover .pict-content-code-actions,\n\t\t.pict-content-code-container:focus-within .pict-content-code-actions {\n\t\t\topacity: 1;\n\t\t\ttransform: translateX(0);\n\t\t\tpointer-events: auto;\n\t\t}\n\t\t.pict-content-code-action-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 28px;\n\t\t\theight: 28px;\n\t\t\tpadding: 0;\n\t\t\tbackground: #FFFFFF;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 6px;\n\t\t\tcursor: pointer;\n\t\t\tbox-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);\n\t\t\ttransition: background-color 0.15s ease, color 0.15s ease;\n\t\t}\n\t\t.pict-content-code-action-btn svg {\n\t\t\tdisplay: block;\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t\tstroke: currentColor;\n\t\t\tfill: none;\n\t\t\tstroke-width: 1.6;\n\t\t\tstroke-linecap: round;\n\t\t\tstroke-linejoin: round;\n\t\t}\n\t\t.pict-content-code-action-btn:hover {\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFFFFF;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-content-code-action-btn.is-copied {\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFFFFF;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-edit-toolbar {\n\t\t\tdisplay: none;\n\t\t\talign-items: center;\n\t\t\tgap: 0.4em;\n\t\t\tpadding: 0.4em 0.6em;\n\t\t\tmargin-bottom: 0.5em;\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder: 1px solid #E5DED4;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.8em;\n\t\t}\n\t\t.pict-inline-doc-edit-toolbar.visible {\n\t\t\tdisplay: flex;\n\t\t}\n\t\t.pict-inline-doc-edit-toolbar .edit-label {\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-right: auto;\n\t\t}\n\t\t.pict-inline-doc-edit-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tpadding: 0.25em 0.6em;\n\t\t\tborder: 1px solid #D4A373;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: #fff;\n\t\t\tcolor: #5E5549;\n\t\t\tfont-size: 0.9em;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.pict-inline-doc-edit-btn:hover {\n\t\t\tbackground: #F0ECE4;\n\t\t}\n\t\t.pict-inline-doc-edit-btn.primary {\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #fff;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-edit-btn.primary:hover {\n\t\t\tbackground: #266D65;\n\t\t}\n\t\t.pict-inline-doc-edit-btn .btn-icon {\n\t\t\tmargin-right: 0.3em;\n\t\t}\n\t\t#InlineDoc-Editor-Container {\n\t\t\tmin-height: 300px;\n\t\t}\n\t\t/* Tooltip placeholder: edit mode indicators */\n\t\t[data-d-tooltip].pict-inline-doc-tooltip-edit-target {\n\t\t\toutline: 1px dashed #2E7D74;\n\t\t\toutline-offset: 2px;\n\t\t\tcursor: pointer;\n\t\t\tposition: relative;\n\t\t}\n\t\t[data-d-tooltip].pict-inline-doc-tooltip-edit-target:not([data-d-tooltip-icon])::after {\n\t\t\tcontent: '?';\n\t\t\tposition: absolute;\n\t\t\ttop: -6px;\n\t\t\tright: -6px;\n\t\t\twidth: 14px;\n\t\t\theight: 14px;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #fff;\n\t\t\tborder-radius: 50%;\n\t\t\tfont-size: 9px;\n\t\t\tline-height: 14px;\n\t\t\ttext-align: center;\n\t\t\tfont-weight: 700;\n\t\t\tpointer-events: none;\n\t\t}\n\t\t/* Tooltip placeholder: default icon */\n\t\t.pict-inline-doc-tooltip-icon {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\tfont-size: 12px;\n\t\t\tcolor: #2E7D74;\n\t\t\tcursor: pointer;\n\t\t\tvertical-align: middle;\n\t\t}\n\t\t/* Empty icon tooltip in edit mode */\n\t\t.pict-inline-doc-tooltip-empty .pict-inline-doc-tooltip-icon {\n\t\t\topacity: 0.4;\n\t\t\toutline: 1px dashed #8A7F72;\n\t\t\toutline-offset: 1px;\n\t\t\tborder-radius: 50%;\n\t\t}\n\t\t/* Tooltip editor textarea in modal */\n\t\t.pict-inline-doc-tooltip-editor-textarea {\n\t\t\twidth: 100%;\n\t\t\tmin-height: 120px;\n\t\t\tpadding: 0.6em;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace;\n\t\t\tfont-size: 0.85em;\n\t\t\tline-height: 1.5;\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #FDFCFA;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tresize: vertical;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.pict-inline-doc-tooltip-editor-textarea:focus {\n\t\t\toutline: none;\n\t\t\tborder-color: #2E7D74;\n\t\t\tbox-shadow: 0 0 0 2px rgba(46, 125, 116, 0.15);\n\t\t}\n\t\t.pict-inline-doc-tooltip-preview {\n\t\t\tmargin-top: 0.5em;\n\t\t\tpadding: 0.5em 0.7em;\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder: 1px solid #E5DED4;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.9em;\n\t\t\tmin-height: 2em;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-inline-doc-tooltip-preview-label {\n\t\t\tfont-size: 0.75em;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t\tmargin-bottom: 0.3em;\n\t\t}\n\t",Templates:[{Hash:"InlineDoc-Content-Template",Template:'\n<div class="pict-inline-doc-edit-toolbar" id="InlineDoc-Edit-Toolbar">\n\t<span class="edit-label" id="InlineDoc-Edit-Label">View mode</span>\n\t<button class="pict-inline-doc-edit-btn" id="InlineDoc-Edit-Toggle" title="Edit this document"><span class="btn-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M11.5 1.5l3 3L5 14H2v-3z"/><line x1="9" y1="4" x2="12" y2="7"/></svg></span> Edit</button>\n\t<button class="pict-inline-doc-edit-btn primary" id="InlineDoc-Edit-Save" style="display:none"><span class="btn-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="3,8 6.5,11.5 13,4.5"/></svg></span> Save</button>\n\t<button class="pict-inline-doc-edit-btn" id="InlineDoc-Edit-Cancel" style="display:none"><span class="btn-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg></span> Cancel</button>\n</div>\n<div class="pict-inline-doc-content pict-content" id="InlineDoc-Content-Body">\n\t<div class="pict-inline-doc-content-loading">Loading...</div>\n</div>\n'}],Renderables:[{RenderableHash:"InlineDoc-Content-Display",TemplateHash:"InlineDoc-Content-Template",ContentDestinationAddress:"#InlineDoc-Content-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(){return this.renderEditToolbar(),super.onAfterRender()}displayContent(t){super.displayContent(t,"InlineDoc-Content-Body"),this._wireInternalLinks(),this.renderEditToolbar()}showLoading(){super.showLoading("Loading...","InlineDoc-Content-Body")}renderEditToolbar(){if("undefined"==typeof document)return;let t=document.getElementById("InlineDoc-Edit-Toolbar");if(!t)return;let e=this.pict.AppData.InlineDocumentation;if(!e)return;e.EditEnabled&&e.CurrentPath?t.classList.add("visible"):t.classList.remove("visible");let i=document.getElementById("InlineDoc-Edit-Toggle"),n=document.getElementById("InlineDoc-Edit-Save"),o=document.getElementById("InlineDoc-Edit-Cancel"),r=document.getElementById("InlineDoc-Edit-Label");e.Editing?(i&&(i.style.display="none"),n&&(n.style.display=""),o&&(o.style.display=""),r&&(r.textContent="Editing: "+(e.EditingPath||""))):(i&&(i.style.display=""),n&&(n.style.display="none"),o&&(o.style.display="none"),r&&(r.textContent=e.CurrentPath||"View mode")),this._wireEditToolbar()}showEditor(t){if("undefined"==typeof document)return;let e=document.getElementById("InlineDoc-Content-Body");if(!e)return;e.innerHTML='<div id="InlineDoc-Editor-Container"></div>',this.pict.AppData.InlineDocumentation||(this.pict.AppData.InlineDocumentation={}),this.pict.AppData.InlineDocumentation.EditorSegments=[{Content:t||""}];let i=this.pict.views["InlineDoc-MarkdownEditor"];i&&i.render(),this.renderEditToolbar()}hideEditor(){this.renderEditToolbar()}_wireEditToolbar(){if("undefined"==typeof document)return;let t=this.pict.providers["Pict-InlineDocumentation"],e=document.getElementById("InlineDoc-Edit-Toggle");e&&e.addEventListener("click",()=>{t&&t.beginEdit()});let i=document.getElementById("InlineDoc-Edit-Save");i&&i.addEventListener("click",()=>{t&&t.saveEdit()});let n=document.getElementById("InlineDoc-Edit-Cancel");n&&n.addEventListener("click",()=>{t&&t.cancelEdit()})}_wireInternalLinks(){if("undefined"==typeof document)return;let t=document.getElementById("InlineDoc-Content-Body");if(!t)return;let e=t.querySelectorAll('a[rel^="pict-inline-doc-link:"]'),i=this.pict.providers["Pict-InlineDocumentation"];for(let t=0;t<e.length;t++){let n=e[t],o=n.getAttribute("rel").replace("pict-inline-doc-link:","");if(i&&"function"==typeof i.isExternalPath&&i.isExternalPath(o)){let t=i.resolveExternalURL(o);if(t){n.setAttribute("href",t),n.setAttribute("target","_blank"),n.setAttribute("rel","noopener");continue}}n.addEventListener("click",t=>{t.preventDefault(),i&&i.loadDocument(o)})}}},e.exports.default_configuration=o},{"pict-section-content":62}],83:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"InlineDoc-Layout",DefaultRenderable:"InlineDoc-Layout-Container",DefaultContentDestinationAddress:"#InlineDoc-Container",AutoRender:!1,CSS:"\n\t\t.pict-inline-doc {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: row;\n\t\t\twidth: 100%;\n\t\t\theight: 100%;\n\t\t\tmin-height: 300px;\n\t\t\tfont-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n\t\t\tfont-size: 15px;\n\t\t\tcolor: #423D37;\n\t\t\tbackground: #FDFCFA;\n\t\t\tborder: 1px solid #E5DED4;\n\t\t\tborder-radius: 6px;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.pict-inline-doc-nav-container {\n\t\t\twidth: 240px;\n\t\t\tmin-width: 200px;\n\t\t\tmax-width: 300px;\n\t\t\tborder-right: 1px solid #E5DED4;\n\t\t\tbackground: #F7F5F0;\n\t\t\toverflow-y: auto;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.pict-inline-doc-content-container {\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\toverflow-x: hidden;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.pict-inline-doc-nav-container.pict-inline-doc-nav-hidden {\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Compact mode: stack nav above content when container is narrow */\n\t\t.pict-inline-doc.pict-inline-doc-compact {\n\t\t\tflex-direction: column;\n\t\t}\n\t\t.pict-inline-doc.pict-inline-doc-compact .pict-inline-doc-nav-container {\n\t\t\twidth: 100%;\n\t\t\tmin-width: 0;\n\t\t\tmax-width: none;\n\t\t\tborder-right: none;\n\t\t\tborder-bottom: 1px solid #E5DED4;\n\t\t\toverflow-y: visible;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t",Templates:[{Hash:"InlineDoc-Layout-Template",Template:'\n<div class="pict-inline-doc">\n\t<div class="pict-inline-doc-nav-container" id="InlineDoc-Nav-Container"></div>\n\t<div class="pict-inline-doc-content-container" id="InlineDoc-Content-Container"></div>\n</div>\n'}],Renderables:[{RenderableHash:"InlineDoc-Layout-Container",TemplateHash:"InlineDoc-Layout-Template",ContentDestinationAddress:"#InlineDoc-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(){return this.pict.CSSMap.injectCSS(),this._setupCompactModeObserver(),super.onAfterRender()}_setupCompactModeObserver(){if("undefined"==typeof document||"undefined"==typeof ResizeObserver)return;let t=document.querySelector(".pict-inline-doc");if(!t)return;this._resizeObserver&&this._resizeObserver.disconnect();this._resizeObserver=new ResizeObserver(e=>{for(let i=0;i<e.length;i++){e[i].contentRect.width<550?t.classList.add("pict-inline-doc-compact"):t.classList.remove("pict-inline-doc-compact")}}),this._resizeObserver.observe(t);let e=t.offsetWidth;e>0&&e<550&&t.classList.add("pict-inline-doc-compact")}},e.exports.default_configuration=o},{"pict-view":102}],84:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"InlineDoc-Nav",DefaultRenderable:"InlineDoc-Nav-Display",DefaultContentDestinationAddress:"#InlineDoc-Nav-Container",AutoRender:!1,CSS:"\n\t\t.pict-inline-doc-nav {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t}\n\t\t.pict-inline-doc-nav-collapsed-header {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 0.5em 0.8em;\n\t\t\tcursor: pointer;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tbackground: #F7F5F0;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.pict-inline-doc-nav-collapsed-header:hover {\n\t\t\tbackground: #EDE8DF;\n\t\t}\n\t\t.pict-inline-doc-nav-chevron {\n\t\t\tfont-size: 0.6em;\n\t\t\ttransition: transform 0.2s ease;\n\t\t\tcolor: #8A7F72;\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tmargin-right: 0.5em;\n\t\t}\n\t\t.pict-inline-doc-nav-chevron.expanded {\n\t\t\ttransform: rotate(90deg);\n\t\t}\n\t\t.pict-inline-doc-nav-current-title {\n\t\t\tfont-size: 0.9em;\n\t\t\tfont-weight: 500;\n\t\t\tcolor: #3D3229;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\tflex: 1;\n\t\t}\n\t\t.pict-inline-doc-nav-outline {\n\t\t\tdisplay: none;\n\t\t\toverflow-y: auto;\n\t\t}\n\t\t.pict-inline-doc-nav-outline.expanded {\n\t\t\tdisplay: block;\n\t\t}\n\t\t.pict-inline-doc-nav-filter {\n\t\t\tpadding: 0.3em 0.6em;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t}\n\t\t.pict-inline-doc-nav-filter input {\n\t\t\twidth: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t\tpadding: 0.3em 0.5em;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.85em;\n\t\t\toutline: none;\n\t\t}\n\t\t.pict-inline-doc-nav-filter input:focus {\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-nav-group {\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t\t.pict-inline-doc-nav-group-header {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 0.4em 0.8em;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.7em;\n\t\t\tcolor: #5E5549;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.pict-inline-doc-nav-group-header:hover {\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #F0ECE4;\n\t\t}\n\t\t.pict-inline-doc-nav-group-toggle {\n\t\t\tmargin-right: 0.35em;\n\t\t\tfont-size: 0.65em;\n\t\t\ttransition: transform 0.15s ease;\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t}\n\t\t.pict-inline-doc-nav-group-toggle.collapsed {\n\t\t\ttransform: rotate(-90deg);\n\t\t}\n\t\t.pict-inline-doc-nav-group.collapsed .pict-inline-doc-nav-group-items {\n\t\t\tdisplay: none;\n\t\t}\n\t\t.pict-inline-doc-nav-item {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.25em 0.8em 0.25em 1.6em;\n\t\t\tcolor: #5E5549;\n\t\t\ttext-decoration: none;\n\t\t\tfont-size: 0.85em;\n\t\t\tcursor: pointer;\n\t\t\tborder-left: 3px solid transparent;\n\t\t\ttransition: background 0.1s ease, border-color 0.1s ease;\n\t\t}\n\t\t.pict-inline-doc-nav-item:hover {\n\t\t\tbackground: #EDE8DF;\n\t\t}\n\t\t.pict-inline-doc-nav-item.active {\n\t\t\tbackground: #E8E3D8;\n\t\t\tcolor: #2E7D74;\n\t\t\tborder-left-color: #2E7D74;\n\t\t\tfont-weight: 500;\n\t\t}\n\t\t.pict-inline-doc-nav-heading {\n\t\t\tdisplay: block;\n\t\t\tpadding: 0.15em 0.8em 0.15em 2.4em;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 0.78em;\n\t\t\tcursor: pointer;\n\t\t\tborder-left: 3px solid transparent;\n\t\t\ttransition: background 0.1s ease, color 0.1s ease;\n\t\t}\n\t\t.pict-inline-doc-nav-heading:hover {\n\t\t\tbackground: #EDE8DF;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.pict-inline-doc-nav-heading.h3 {\n\t\t\tpadding-left: 3.2em;\n\t\t\tfont-size: 0.72em;\n\t\t}\n\t\t/* Search icon in collapsed header */\n\t\t.pict-inline-doc-nav-search-icon {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tcolor: #8A7F72;\n\t\t\topacity: 0.5;\n\t\t\ttransition: opacity 0.2s;\n\t\t\tflex-shrink: 0;\n\t\t\tmargin-left: 0.3em;\n\t\t}\n\t\t.pict-inline-doc-nav-search-icon:hover {\n\t\t\topacity: 1;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t/* Search results section */\n\t\t.pict-inline-doc-nav-search-results {\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tpadding: 0.3em 0;\n\t\t}\n\t\t.pict-inline-doc-nav-search-status {\n\t\t\tpadding: 0.2em 0.8em;\n\t\t\tfont-size: 0.7em;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t}\n\t\t.pict-inline-doc-nav-search-result {\n\t\t\tdisplay: flex;\n\t\t\talign-items: baseline;\n\t\t\tpadding: 0.25em 0.8em 0.25em 1.2em;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.82em;\n\t\t\tcolor: #3D3229;\n\t\t\ttext-decoration: none;\n\t\t\ttransition: background 0.1s ease;\n\t\t\tgap: 0.5em;\n\t\t}\n\t\t.pict-inline-doc-nav-search-result:hover {\n\t\t\tbackground: #EDE8DF;\n\t\t}\n\t\t.pict-inline-doc-nav-search-result-title {\n\t\t\tflex: 1;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.pict-inline-doc-nav-search-result-group {\n\t\t\tfont-size: 0.75em;\n\t\t\tcolor: #8A7F72;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t/* External link indicator */\n\t\t.pict-inline-doc-nav-item-external {\n\t\t\tcolor: #8A7F72;\n\t\t}\n\t\t.pict-inline-doc-nav-item-external:hover {\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-nav-external-icon {\n\t\t\tdisplay: inline;\n\t\t\tmargin-left: 0.3em;\n\t\t\topacity: 0.5;\n\t\t\tvertical-align: -0.05em;\n\t\t}\n\t\t.pict-inline-doc-nav-topic-badge {\n\t\t\tdisplay: inline-block;\n\t\t\tmargin: 0.5em 1em;\n\t\t\tpadding: 0.3em 0.7em;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #fff;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.8em;\n\t\t\tfont-weight: 500;\n\t\t}\n\t\t.pict-inline-doc-nav-topic-clear {\n\t\t\tmargin-left: 0.5em;\n\t\t\tcursor: pointer;\n\t\t\topacity: 0.8;\n\t\t}\n\t\t.pict-inline-doc-nav-topic-clear:hover {\n\t\t\topacity: 1;\n\t\t}\n\t\t.pict-inline-doc-nav-toolbar {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 0.3em;\n\t\t\tpadding: 0.3em 1em;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t}\n\t\t.pict-inline-doc-nav-toolbar-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 28px;\n\t\t\theight: 28px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: #fff;\n\t\t\tcolor: #5E5549;\n\t\t\tfont-size: 0.9em;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s, border-color 0.1s;\n\t\t}\n\t\t.pict-inline-doc-nav-toolbar-btn:hover {\n\t\t\tbackground: #F0ECE4;\n\t\t\tborder-color: #C4BDB3;\n\t\t}\n\t\t.pict-inline-doc-nav-toolbar-btn.accent {\n\t\t\tborder-color: #2E7D74;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-nav-toolbar-btn.accent:hover {\n\t\t\tbackground: #F0F9F7;\n\t\t}\n\t\t.pict-inline-doc-nav-toolbar-btn.active {\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #fff;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-nav-toolbar-btn.active:hover {\n\t\t\tbackground: #266D65;\n\t\t}\n\t\t.pict-inline-doc-nav-toolbar-spacer {\n\t\t\tflex: 1;\n\t\t}\n\t",Templates:[{Hash:"InlineDoc-Nav-Template",Template:'<div class="pict-inline-doc-nav" id="InlineDoc-Nav-Body"></div>'}],Renderables:[{RenderableHash:"InlineDoc-Nav-Display",TemplateHash:"InlineDoc-Nav-Template",ContentDestinationAddress:"#InlineDoc-Nav-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(){return this._renderNavigation(),super.onAfterRender()}_renderNavigation(){if("undefined"==typeof document)return;let t=document.getElementById("InlineDoc-Nav-Body");if(!t)return;let e=this.pict.AppData.InlineDocumentation;if(!e)return;let i=this.pict.providers["Pict-InlineDocumentation"],n=[];i&&"function"==typeof i._extractHeadings&&(n=i._extractHeadings());let o=e.CurrentPath||"",r=!1!==e.NavCollapsed,a=e.NavFilterText||"",s=this._resolveCurrentDocName(e,o),l="",d=e.SearchQuery||"",c=e.SearchResults||[];if(l+='<div class="pict-inline-doc-nav-collapsed-header">',l+='<span class="'+("pict-inline-doc-nav-chevron"+(r?"":" expanded"))+'" id="InlineDoc-Nav-CollapseToggle">',l+='<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6,3 11,8 6,13"/></svg>',l+="</span>",l+='<span class="pict-inline-doc-nav-current-title" id="InlineDoc-Nav-TitleToggle">'+this._escapeHTML(s)+"</span>",l+='<span class="pict-inline-doc-nav-search-icon" id="InlineDoc-Nav-SearchBtn" title="Search documentation">',l+='<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="7" cy="7" r="4.5"/><line x1="10.5" y1="10.5" x2="14" y2="14"/></svg>',l+="</span>",l+="</div>",l+='<div class="'+("pict-inline-doc-nav-outline"+(r?"":" expanded"))+'" id="InlineDoc-Nav-Outline">',l+='<div class="pict-inline-doc-nav-filter">',l+='<input type="text" id="InlineDoc-Nav-FilterInput" placeholder="'+(e.SearchIndexLoaded?"Search documentation...":"Filter...")+'" value="'+this._escapeHTML(d||a)+'" />',l+="</div>",c.length>0&&d){l+='<div class="pict-inline-doc-nav-search-results">',l+='<div class="pict-inline-doc-nav-search-status">'+c.length+" result"+(1!==c.length?"s":"")+"</div>";for(let t=0;t<c.length&&t<15;t++){let e=c[t];l+='<a class="pict-inline-doc-nav-search-result" data-search-path="'+this._escapeHTML(e.DocPath)+'">',l+='<span class="pict-inline-doc-nav-search-result-title">'+this._escapeHTML(e.Title)+"</span>",e.Group&&(l+='<span class="pict-inline-doc-nav-search-result-group">'+this._escapeHTML(e.Group)+"</span>"),l+="</a>"}l+="</div>"}l+=this._renderTopicBadge(e),l+=this._renderToolbar(e),l+=this._renderGroupTree(e,o,n,a),l+="</div>",t.innerHTML=l,this._wireClickHandlers(t)}_resolveCurrentDocName(t,e){if(!e)return"Documentation";let i=t.SidebarGroups||[];for(let t=0;t<i.length;t++){let n=i[t];if(n.Path&&n.Path===e)return n.Name||e;let o=n.Items||[];for(let t=0;t<o.length;t++)if(o[t].Path===e)return o[t].Name||e}return e}_renderTopicBadge(t){let e=t.Topic;if(!e||!t.Topics||!t.Topics[e])return"";let i=t.Topics[e],n=i.TopicTitle||i.Name||e;return'<div class="pict-inline-doc-nav-topic-badge">'+this._escapeHTML(n)+'<span class="pict-inline-doc-nav-topic-clear" id="InlineDoc-Nav-ClearTopic"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg></span></div>'}_renderToolbar(t){if(!t.TopicManagerEnabled)return"";let e='<div class="pict-inline-doc-nav-toolbar">';return e+='<button class="pict-inline-doc-nav-toolbar-btn" id="InlineDoc-Nav-ManageTopics" title="Manage Topics"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="8" cy="8" r="2.5"/><path d="M8 1v2M8 13v2M1 8h2M13 8h2M3.05 3.05l1.41 1.41M11.54 11.54l1.41 1.41M3.05 12.95l1.41-1.41M11.54 4.46l1.41-1.41"/></svg></button>',t.CurrentRoute&&(e+='<button class="pict-inline-doc-nav-toolbar-btn accent" id="InlineDoc-Nav-BindTopic" title="Bind topic to current route"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M6.5 9.5a3.5 3.5 0 005 0l2-2a3.5 3.5 0 00-5-5l-1 1"/><path d="M9.5 6.5a3.5 3.5 0 00-5 0l-2 2a3.5 3.5 0 005 5l1-1"/></svg></button>'),e+='<button class="pict-inline-doc-nav-toolbar-btn'+(t.TooltipEditMode?" active":"")+'" id="InlineDoc-Nav-TooltipEditMode" title="Toggle tooltip edit mode"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M14 10a1.5 1.5 0 01-1.5 1.5H4l-3 3V3A1.5 1.5 0 012.5 1.5h10A1.5 1.5 0 0114 3z"/></svg></button>',e+='<span class="pict-inline-doc-nav-toolbar-spacer"></span>',e+="</div>",e}_renderGroupTree(t,e,i,n){let o="",r=t.SidebarGroups||[],a=t.Topic,s=null,l=(n||"").toLowerCase();if(a&&t.Topics&&t.Topics[a]){let e=t.Topics[a];s=e.TopicHelpFilePath?[e.TopicHelpFilePath]:e.Documents?e.Documents:[]}for(let n=0;n<r.length;n++){let a=r[n],d=a.Items||[];if(s){d=d.filter(t=>s.indexOf(t.Path)>=0);let t=s.indexOf(a.Path)>=0;if(d.length<1&&!t)continue}if(l){d=d.filter(t=>{if((t.Name||"").toLowerCase().indexOf(l)>=0)return!0;if(t.Path===e&&i.length>0)for(let t=0;t<i.length;t++)if((i[t].Text||"").toLowerCase().indexOf(l)>=0)return!0;return!1});let t=(a.Name||"").toLowerCase().indexOf(l)>=0;if(d.length<1&&!t)continue}let c=a.Key||a.Name||"group-"+n,p=t.CollapsedGroups&&t.CollapsedGroups[c],h="pict-inline-doc-nav-group-toggle"+(p?" collapsed":"");if(o+='<div class="'+("pict-inline-doc-nav-group"+(p?" collapsed":""))+'" data-group="'+this._escapeHTML(c)+'">',o+='<div class="pict-inline-doc-nav-group-header">',o+='<span class="'+h+'">▼</span>',o+=this._escapeHTML(a.Name),o+="</div>",o+='<div class="pict-inline-doc-nav-group-items">',a.Path){o+='<a class="pict-inline-doc-nav-item'+(e===a.Path?" active":"")+'" data-doc-path="'+this._escapeHTML(a.Path)+'">'+this._escapeHTML(a.Name)+"</a>",e===a.Path&&(o+=this._renderHeadingSubItems(i,l))}for(let t=0;t<d.length;t++){let n=d[t];if(n.Path)if(n.External&&n.ExternalURL)o+='<a class="pict-inline-doc-nav-item pict-inline-doc-nav-item-external" data-external-url="'+this._escapeHTML(n.ExternalURL)+'">'+this._escapeHTML(n.Name)+'<svg class="pict-inline-doc-nav-external-icon" width="0.75em" height="0.75em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M12 9v4a1 1 0 01-1 1H3a1 1 0 01-1-1V5a1 1 0 011-1h4"/><polyline points="8,2 14,2 14,8"/><line x1="14" y1="2" x2="7" y2="9"/></svg></a>';else{o+='<a class="pict-inline-doc-nav-item'+(e===n.Path?" active":"")+'" data-doc-path="'+this._escapeHTML(n.Path)+'">'+this._escapeHTML(n.Name)+"</a>",e===n.Path&&(o+=this._renderHeadingSubItems(i,l))}else o+='<span class="pict-inline-doc-nav-item">'+this._escapeHTML(n.Name)+"</span>"}o+="</div>",o+="</div>"}return o}_renderHeadingSubItems(t,e){if(!t||t.length<1)return"";let i="";for(let n=0;n<t.length;n++){let o=t[n],r=o.Text||"";e&&r.toLowerCase().indexOf(e)<0||(i+='<a class="pict-inline-doc-nav-heading'+(3===o.Level?" h3":"")+'" data-heading-slug="'+this._escapeHTML(o.Slug)+'">'+this._escapeHTML(r)+"</a>")}return i}_wireClickHandlers(t){let e=this.pict.providers["Pict-InlineDocumentation"],i=this.pict.AppData.InlineDocumentation,n=this,o=t.querySelector("#InlineDoc-Nav-CollapseToggle");o&&o.addEventListener("click",()=>{i&&(i.NavCollapsed=!i.NavCollapsed),n._renderNavigation()});let r=t.querySelector("#InlineDoc-Nav-TitleToggle");r&&r.addEventListener("click",()=>{i&&(i.NavCollapsed=!i.NavCollapsed),n._renderNavigation()});let a=t.querySelector("#InlineDoc-Nav-SearchBtn");a&&a.addEventListener("click",t=>{t.stopPropagation(),i&&(i.NavCollapsed=!1),n._renderNavigation();let e=document.getElementById("InlineDoc-Nav-FilterInput");e&&e.focus()});let s=t.querySelector("#InlineDoc-Nav-FilterInput");if(s){let t=null;s.addEventListener("input",o=>{let r=o.target.value||"";if(i&&(i.NavFilterText=r),i&&i.SearchIndexLoaded&&e&&"function"==typeof e.search)t&&clearTimeout(t),t=setTimeout(()=>{i.SearchQuery=r,i.SearchResults=r.trim()?e.search(r):[],n._renderNavigation();let t=document.getElementById("InlineDoc-Nav-FilterInput");if(t){t.focus();let e=t.value.length;t.setSelectionRange(e,e)}},250);else{n._renderNavigation();let t=document.getElementById("InlineDoc-Nav-FilterInput");if(t){t.focus();let e=t.value.length;t.setSelectionRange(e,e)}}})}let l=t.querySelectorAll(".pict-inline-doc-nav-search-result[data-search-path]");for(let t=0;t<l.length;t++){let n=l[t];n.addEventListener("click",t=>{t.preventDefault();let o=n.getAttribute("data-search-path");e&&o&&(i&&(i.SearchQuery="",i.SearchResults=[],i.NavFilterText=""),e.loadDocument(o))})}let d=t.querySelectorAll("[data-external-url]");for(let t=0;t<d.length;t++){let e=d[t];e.addEventListener("click",t=>{t.preventDefault();let i=e.getAttribute("data-external-url");i&&window.open(i,"_blank")})}let c=t.querySelectorAll(".pict-inline-doc-nav-item[data-doc-path]");for(let t=0;t<c.length;t++){let n=c[t];n.addEventListener("click",t=>{t.preventDefault();let o=n.getAttribute("data-doc-path");e&&o&&(i&&(i.NavFilterText=""),e.loadDocument(o))})}let p=t.querySelectorAll(".pict-inline-doc-nav-heading[data-heading-slug]");for(let t=0;t<p.length;t++){let i=p[t];i.addEventListener("click",t=>{t.preventDefault();let n=i.getAttribute("data-heading-slug");e&&n&&e._scrollToAnchor(n)})}let h=t.querySelectorAll(".pict-inline-doc-nav-group-header");for(let t=0;t<h.length;t++){let e=h[t];e.addEventListener("click",()=>{let t=e.parentElement;if(t){t.classList.toggle("collapsed");let e=t.getAttribute("data-group");if(i&&e){i.CollapsedGroups||(i.CollapsedGroups={});let n=t.querySelector(".pict-inline-doc-nav-group-toggle");t.classList.contains("collapsed")?(i.CollapsedGroups[e]=!0,n&&n.classList.add("collapsed")):(delete i.CollapsedGroups[e],n&&n.classList.remove("collapsed"))}}})}let u=t.querySelector("#InlineDoc-Nav-ClearTopic");u&&e&&u.addEventListener("click",t=>{t.stopPropagation(),e.clearTopic()});let m=t.querySelector("#InlineDoc-Nav-ManageTopics");m&&m.addEventListener("click",t=>{t.stopPropagation();let e=this.pict.views["InlineDoc-TopicManager"];e&&e.showTopicManager()});let g=t.querySelector("#InlineDoc-Nav-TooltipEditMode");g&&g.addEventListener("click",t=>{t.stopPropagation();let e=this.pict.providers["Pict-InlineDocumentation"];if(e){let t=this.pict.AppData.InlineDocumentation;e.setTooltipEditMode(!t.TooltipEditMode)}});let f=t.querySelector("#InlineDoc-Nav-BindTopic");f&&f.addEventListener("click",t=>{t.stopPropagation();let e=this.pict.views["InlineDoc-TopicManager"];e&&e.showBindTopicToRoute()})}_escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}},e.exports.default_configuration=o},{"pict-view":102}],85:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"InlineDoc-TopicManager",AutoRender:!1,CSS:"\n\t\t.pict-inline-doc-tm-topic-list {\n\t\t\tmax-height: 400px;\n\t\t\toverflow-y: auto;\n\t\t\tmargin: 0 -0.5em;\n\t\t}\n\t\t.pict-inline-doc-tm-topic-item {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 0.6em 0.8em;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.pict-inline-doc-tm-topic-item:hover {\n\t\t\tbackground: #F5F0E8;\n\t\t}\n\t\t.pict-inline-doc-tm-topic-item:last-child {\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t.pict-inline-doc-tm-topic-info {\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.pict-inline-doc-tm-topic-title {\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-size: 0.95em;\n\t\t}\n\t\t.pict-inline-doc-tm-topic-meta {\n\t\t\tfont-size: 0.8em;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-top: 0.15em;\n\t\t}\n\t\t.pict-inline-doc-tm-topic-actions {\n\t\t\tdisplay: flex;\n\t\t\tgap: 0.3em;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.pict-inline-doc-tm-action-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\twidth: 28px;\n\t\t\theight: 28px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: #fff;\n\t\t\tcolor: #5E5549;\n\t\t\tfont-size: 0.85em;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s, border-color 0.1s;\n\t\t}\n\t\t.pict-inline-doc-tm-action-btn:hover {\n\t\t\tbackground: #F0ECE4;\n\t\t\tborder-color: #C4BDB3;\n\t\t}\n\t\t.pict-inline-doc-tm-action-btn.danger:hover {\n\t\t\tbackground: #FDE8E8;\n\t\t\tborder-color: #E57373;\n\t\t\tcolor: #C62828;\n\t\t}\n\t\t.pict-inline-doc-tm-new-topic {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tpadding: 0.7em;\n\t\t\tmargin-top: 0.5em;\n\t\t\tborder: 1px dashed #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tcolor: #2E7D74;\n\t\t\tfont-size: 0.9em;\n\t\t\tfont-weight: 500;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s, border-color 0.1s;\n\t\t}\n\t\t.pict-inline-doc-tm-new-topic:hover {\n\t\t\tbackground: #F0F9F7;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-tm-empty {\n\t\t\ttext-align: center;\n\t\t\tpadding: 2em 1em;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 0.9em;\n\t\t}\n\t\t.pict-inline-doc-tm-form-group {\n\t\t\tmargin-bottom: 0.8em;\n\t\t}\n\t\t.pict-inline-doc-tm-form-label {\n\t\t\tdisplay: block;\n\t\t\tfont-size: 0.8em;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #5E5549;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t\tmargin-bottom: 0.3em;\n\t\t}\n\t\t.pict-inline-doc-tm-form-input {\n\t\t\twidth: 100%;\n\t\t\tpadding: 0.45em 0.6em;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #FDFCFA;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tbox-sizing: border-box;\n\t\t}\n\t\t.pict-inline-doc-tm-form-input:focus {\n\t\t\toutline: none;\n\t\t\tborder-color: #2E7D74;\n\t\t\tbox-shadow: 0 0 0 2px rgba(46, 125, 116, 0.15);\n\t\t}\n\t\t.pict-inline-doc-tm-form-input[readonly] {\n\t\t\tbackground: #F5F0E8;\n\t\t\tcolor: #8A7F72;\n\t\t}\n\t\t.pict-inline-doc-tm-form-hint {\n\t\t\tfont-size: 0.75em;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-top: 0.2em;\n\t\t}\n\t\t.pict-inline-doc-tm-routes-section {\n\t\t\tmargin-top: 0.5em;\n\t\t}\n\t\t.pict-inline-doc-tm-route-chips {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tgap: 0.3em;\n\t\t\tmargin-bottom: 0.5em;\n\t\t}\n\t\t.pict-inline-doc-tm-route-chip {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 0.2em 0.5em;\n\t\t\tbackground: #E8E3D8;\n\t\t\tborder-radius: 12px;\n\t\t\tfont-size: 0.82em;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace;\n\t\t}\n\t\t.pict-inline-doc-tm-route-chip-remove {\n\t\t\tmargin-left: 0.4em;\n\t\t\tcursor: pointer;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 0.9em;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.pict-inline-doc-tm-route-chip-remove:hover {\n\t\t\tcolor: #C62828;\n\t\t}\n\t\t.pict-inline-doc-tm-route-actions {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tgap: 0.3em;\n\t\t}\n\t\t.pict-inline-doc-tm-route-action-btn {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 0.25em 0.5em;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: #fff;\n\t\t\tcolor: #5E5549;\n\t\t\tfont-size: 0.8em;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.pict-inline-doc-tm-route-action-btn:hover {\n\t\t\tbackground: #F0ECE4;\n\t\t}\n\t\t.pict-inline-doc-tm-route-action-btn.accent {\n\t\t\tborder-color: #2E7D74;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-tm-route-action-btn.accent:hover {\n\t\t\tbackground: #F0F9F7;\n\t\t}\n\t\t.pict-inline-doc-tm-route-input-row {\n\t\t\tdisplay: none;\n\t\t\talign-items: center;\n\t\t\tgap: 0.3em;\n\t\t\tmargin-top: 0.4em;\n\t\t}\n\t\t.pict-inline-doc-tm-route-input-row.visible {\n\t\t\tdisplay: flex;\n\t\t}\n\t\t.pict-inline-doc-tm-route-input {\n\t\t\tflex: 1;\n\t\t\tpadding: 0.35em 0.5em;\n\t\t\tfont-size: 0.85em;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace;\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #FDFCFA;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t}\n\t\t.pict-inline-doc-tm-route-input:focus {\n\t\t\toutline: none;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-container {\n\t\t\tpadding: 0.5em 0;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-label {\n\t\t\tfont-size: 0.85em;\n\t\t\tcolor: #5E5549;\n\t\t\tmargin-bottom: 0.6em;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-segments {\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\talign-items: center;\n\t\t\tgap: 0.15em;\n\t\t\tmargin-bottom: 0.8em;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-slash {\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 1.1em;\n\t\t\tfont-weight: 300;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-segment {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 0.4em 0.7em;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: #fff;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace;\n\t\t\tfont-size: 0.9em;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.15s, border-color 0.15s, opacity 0.15s;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-segment:hover {\n\t\t\tborder-color: #2E7D74;\n\t\t\tbackground: #F0F9F7;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-segment.selected {\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #fff;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-segment.after-wildcard {\n\t\t\topacity: 0.35;\n\t\t\tborder-style: dashed;\n\t\t\tcursor: default;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-segment.after-wildcard:hover {\n\t\t\tborder-color: #DDD6CA;\n\t\t\tbackground: #fff;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-wildcard-star {\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 0.4em 0.6em;\n\t\t\tcolor: #2E7D74;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace;\n\t\t\tfont-size: 1.1em;\n\t\t\tfont-weight: 700;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-preview {\n\t\t\tpadding: 0.5em 0.7em;\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder: 1px solid #E5DED4;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.pict-inline-doc-tm-wc-preview-label {\n\t\t\tfont-size: 0.75em;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.03em;\n\t\t\tmargin-bottom: 0.3em;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-route-display {\n\t\t\tpadding: 0.5em 0.7em;\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder: 1px solid #E5DED4;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-bottom: 0.8em;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-topic-list {\n\t\t\tmax-height: 250px;\n\t\t\toverflow-y: auto;\n\t\t\tmargin-bottom: 0.6em;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-topic-option {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tpadding: 0.5em 0.6em;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-topic-option:hover {\n\t\t\tbackground: #F5F0E8;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-topic-option.selected {\n\t\t\tbackground: #F0F9F7;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-radio {\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\tborder: 2px solid #DDD6CA;\n\t\t\tborder-radius: 50%;\n\t\t\tmargin-right: 0.6em;\n\t\t\tflex-shrink: 0;\n\t\t\tposition: relative;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-topic-option.selected .pict-inline-doc-tm-bind-radio {\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-topic-option.selected .pict-inline-doc-tm-bind-radio::after {\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\ttop: 3px;\n\t\t\tleft: 3px;\n\t\t\twidth: 6px;\n\t\t\theight: 6px;\n\t\t\tbackground: #2E7D74;\n\t\t\tborder-radius: 50%;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-route-type {\n\t\t\tdisplay: flex;\n\t\t\tgap: 0.5em;\n\t\t\tmargin-bottom: 0.5em;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-route-type-btn {\n\t\t\tflex: 1;\n\t\t\tpadding: 0.5em;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: #fff;\n\t\t\tcolor: #5E5549;\n\t\t\tfont-size: 0.85em;\n\t\t\ttext-align: center;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s, border-color 0.1s;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-route-type-btn:hover {\n\t\t\tbackground: #F0ECE4;\n\t\t}\n\t\t.pict-inline-doc-tm-bind-route-type-btn.selected {\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #fff;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.pict-inline-doc-tm-sidebar-list {\n\t\t\tmax-height: 300px;\n\t\t\toverflow-y: auto;\n\t\t}\n\t\t.pict-inline-doc-tm-sidebar-item {\n\t\t\tpadding: 0.4em 0.6em;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.9em;\n\t\t\tcolor: #3D3229;\n\t\t\tborder-bottom: 1px solid #EAE3D8;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.pict-inline-doc-tm-sidebar-item:hover {\n\t\t\tbackground: #F5F0E8;\n\t\t}\n\t\t.pict-inline-doc-tm-sidebar-item .path {\n\t\t\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', monospace;\n\t\t\tfont-size: 0.85em;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-left: 0.5em;\n\t\t}\n\t\t.pict-inline-doc-tm-validation-error {\n\t\t\tcolor: #C62828;\n\t\t\tfont-size: 0.8em;\n\t\t\tmargin-top: 0.3em;\n\t\t}\n\t",Templates:[],Renderables:[]};e.exports=class extends n{constructor(t,e,i){super(t,e,i)}_getModal(){return this.pict.views.PictSectionModal||this.pict.views["Pict-Section-Modal"]||null}_getProvider(){return this.pict.providers["Pict-InlineDocumentation"]||null}showTopicManager(){let t=this._getModal(),e=this._getProvider();if(!t)return void this.log.warn("InlineDocumentation TopicManager: Pict-Section-Modal view is not registered.");if(!e)return;let i=e.getTopicList(),n=this._buildTopicListHTML(i);t.show({title:"Manage Topics",content:n,closeable:!0,width:"520px",buttons:[{Hash:"close",Label:"Close",Style:"primary"}],onOpen:t=>{this._wireTopicListHandlers(t)}})}_buildTopicListHTML(t){if(!t||t.length<1)return'<div class="pict-inline-doc-tm-empty">No topics defined yet.</div><div class="pict-inline-doc-tm-new-topic" data-action="new-topic">+ New Topic</div>';let e='<div class="pict-inline-doc-tm-topic-list">';for(let i=0;i<t.length;i++){let n=t[i];e+='<div class="pict-inline-doc-tm-topic-item" data-topic-code="'+this._escapeHTML(n.TopicCode)+'">',e+='<div class="pict-inline-doc-tm-topic-info">',e+='<div class="pict-inline-doc-tm-topic-title">'+this._escapeHTML(n.TopicTitle)+"</div>",e+='<div class="pict-inline-doc-tm-topic-meta">',e+=this._escapeHTML(n.TopicCode),n.TopicHelpFilePath&&(e+=" · "+this._escapeHTML(n.TopicHelpFilePath)),e+=" · "+n.RouteCount+" route"+(1!==n.RouteCount?"s":""),e+="</div>",e+="</div>",e+='<div class="pict-inline-doc-tm-topic-actions">',e+='<button class="pict-inline-doc-tm-action-btn" data-action="edit" data-topic-code="'+this._escapeHTML(n.TopicCode)+'" title="Edit"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M11.5 1.5l3 3L5 14H2v-3z"/><line x1="9" y1="4" x2="12" y2="7"/></svg></button>',e+='<button class="pict-inline-doc-tm-action-btn danger" data-action="delete" data-topic-code="'+this._escapeHTML(n.TopicCode)+'" title="Delete"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg></button>',e+="</div>",e+="</div>"}return e+="</div>",e+='<div class="pict-inline-doc-tm-new-topic" data-action="new-topic">+ New Topic</div>',e}_wireTopicListHandlers(t){let e=this,i=this._getModal(),n=this._getProvider(),o=t.querySelectorAll('[data-action="edit"]');for(let t=0;t<o.length;t++)o[t].addEventListener("click",n=>{n.stopPropagation();let r=o[t].getAttribute("data-topic-code");i&&i.dismissModals&&i.dismissModals(),setTimeout(()=>{e.showTopicEditor(r)},250)});let r=t.querySelectorAll('[data-action="delete"]');for(let t=0;t<r.length;t++)r[t].addEventListener("click",o=>{o.stopPropagation();let a=r[t].getAttribute("data-topic-code");i&&i.confirm&&i.confirm('Are you sure you want to delete the topic "'+a+'"?',{title:"Delete Topic",dangerous:!0}).then(t=>{if(t&&n){n.removeTopic(a),n.saveTopics();let t=e.pict.views["InlineDoc-Nav"];t&&t.render(),i.toast&&i.toast("Topic deleted.",{type:"success"}),setTimeout(()=>{e.showTopicManager()},250)}})});let a=t.querySelector('[data-action="new-topic"]');a&&a.addEventListener("click",()=>{i&&i.dismissModals&&i.dismissModals(),setTimeout(()=>{e.showTopicEditor(null)},250)})}showTopicEditor(t){let e=this._getModal(),i=this._getProvider();if(!e||!i)return;let n=this.pict.AppData.InlineDocumentation,o=!t,r=null;r=t&&n.Topics&&n.Topics[t]?JSON.parse(JSON.stringify(n.Topics[t])):{TopicCode:"",TopicTitle:"",TopicHelpFilePath:"",Routes:[]};let a=this._buildTopicEditorHTML(r,o),s=r.Routes?r.Routes.slice():[];e.show({title:o?"New Topic":"Edit Topic",content:a,closeable:!0,width:"500px",buttons:[{Hash:"cancel",Label:"Cancel"},{Hash:"save",Label:"Save",Style:"primary"}],onOpen:t=>{this._wireTopicEditorHandlers(t,r,o,s)}}).then(t=>{"save"===t?this._handleTopicEditorSave(r,o,s):setTimeout(()=>{this.showTopicManager()},250)})}_buildTopicEditorHTML(t,e){let i="";i+='<div class="pict-inline-doc-tm-form-group">',i+='<label class="pict-inline-doc-tm-form-label">Topic Code</label>',e?(i+='<input type="text" class="pict-inline-doc-tm-form-input" id="tm-editor-code" value="" placeholder="MY-TOPIC-CODE" />',i+='<div class="pict-inline-doc-tm-form-hint">Uppercase letters, numbers, and hyphens only.</div>'):i+='<input type="text" class="pict-inline-doc-tm-form-input" id="tm-editor-code" value="'+this._escapeHTML(t.TopicCode)+'" readonly />',i+='<div class="pict-inline-doc-tm-validation-error" id="tm-editor-code-error"></div>',i+="</div>",i+='<div class="pict-inline-doc-tm-form-group">',i+='<label class="pict-inline-doc-tm-form-label">Title</label>',i+='<input type="text" class="pict-inline-doc-tm-form-input" id="tm-editor-title" value="'+this._escapeHTML(t.TopicTitle||t.Name||"")+'" placeholder="My Topic Title" />',i+='<div class="pict-inline-doc-tm-validation-error" id="tm-editor-title-error"></div>',i+="</div>",i+='<div class="pict-inline-doc-tm-form-group">',i+='<label class="pict-inline-doc-tm-form-label">Help Document</label>',i+='<div style="display:flex;gap:0.3em;align-items:center;">',i+='<input type="text" class="pict-inline-doc-tm-form-input" id="tm-editor-helpfile" value="'+this._escapeHTML(t.TopicHelpFilePath||"")+'" placeholder="help-topic.md" style="flex:1;" />',i+='<button class="pict-inline-doc-tm-route-action-btn" id="tm-editor-browse-sidebar" title="Browse sidebar documents">Browse</button>',i+="</div>",i+="</div>",i+='<div class="pict-inline-doc-tm-form-group">',i+='<label class="pict-inline-doc-tm-form-label">Routes</label>',i+='<div class="pict-inline-doc-tm-routes-section">',i+='<div class="pict-inline-doc-tm-route-chips" id="tm-editor-route-chips">',i+=this._buildRouteChipsHTML(t.Routes||[]),i+="</div>",i+='<div class="pict-inline-doc-tm-route-actions">',i+='<button class="pict-inline-doc-tm-route-action-btn" id="tm-editor-add-route">+ Add Route</button>';let n=this.pict.AppData.InlineDocumentation;return n&&n.CurrentRoute&&(i+='<button class="pict-inline-doc-tm-route-action-btn accent" id="tm-editor-add-current-route">+ Current Route</button>',i+='<button class="pict-inline-doc-tm-route-action-btn accent" id="tm-editor-build-wildcard">Build Wildcard</button>'),i+="</div>",i+='<div class="pict-inline-doc-tm-route-input-row" id="tm-editor-route-input-row">',i+='<input type="text" class="pict-inline-doc-tm-route-input" id="tm-editor-route-input" placeholder="/my/route" />',i+='<button class="pict-inline-doc-tm-route-action-btn accent" id="tm-editor-route-input-add">Add</button>',i+="</div>",i+="</div>",i+="</div>",i}_buildRouteChipsHTML(t){if(!t||t.length<1)return'<span style="font-size:0.8em;color:#8A7F72;">No routes bound.</span>';let e="";for(let i=0;i<t.length;i++)e+='<span class="pict-inline-doc-tm-route-chip">',e+=this._escapeHTML(t[i]),e+='<span class="pict-inline-doc-tm-route-chip-remove" data-route="'+this._escapeHTML(t[i])+'">×</span>',e+="</span>";return e}_refreshRouteChips(t){if("undefined"==typeof document)return;let e=document.getElementById("tm-editor-route-chips");e&&(e.innerHTML=this._buildRouteChipsHTML(t),this._wireRouteChipRemoveHandlers(t))}_wireRouteChipRemoveHandlers(t){if("undefined"==typeof document)return;let e=this,i=document.querySelectorAll(".pict-inline-doc-tm-route-chip-remove");for(let n=0;n<i.length;n++)i[n].addEventListener("click",o=>{o.stopPropagation();let r=i[n].getAttribute("data-route"),a=t.indexOf(r);a>=0&&t.splice(a,1),e._refreshRouteChips(t)})}_wireTopicEditorHandlers(t,e,i,n){let o=this,r=this._getProvider(),a=this.pict.AppData.InlineDocumentation;this._wireRouteChipRemoveHandlers(n);let s=document.getElementById("tm-editor-add-route");s&&s.addEventListener("click",()=>{let t=document.getElementById("tm-editor-route-input-row");if(t){t.classList.toggle("visible");let e=document.getElementById("tm-editor-route-input");e&&e.focus()}});let l=document.getElementById("tm-editor-route-input-add");l&&l.addEventListener("click",()=>{let t=document.getElementById("tm-editor-route-input");if(t&&t.value.trim()){let e=t.value.trim();"/"!==e.charAt(0)&&(e="/"+e),n.indexOf(e)<0&&(n.push(e),o._refreshRouteChips(n)),t.value=""}});let d=document.getElementById("tm-editor-route-input");d&&d.addEventListener("keydown",t=>{"Enter"===t.key&&(t.preventDefault(),l&&l.click())});let c=document.getElementById("tm-editor-add-current-route");c&&a&&a.CurrentRoute&&c.addEventListener("click",()=>{let t=a.CurrentRoute;n.indexOf(t)<0&&(n.push(t),o._refreshRouteChips(n))});let p=document.getElementById("tm-editor-build-wildcard");p&&r&&a&&a.CurrentRoute&&p.addEventListener("click",()=>{let t=o._getModal();t&&t.dismissModals&&t.dismissModals(),setTimeout(()=>{o.showWildcardBuilder(a.CurrentRoute,t=>{t&&n.indexOf(t)<0&&n.push(t),o._reopenEditorAfterSubflow(e,i,n)})},250)});let h=document.getElementById("tm-editor-browse-sidebar");h&&h.addEventListener("click",()=>{let t=o._getModal();t&&t.dismissModals&&t.dismissModals(),setTimeout(()=>{o._showSidebarPicker(t=>{t&&(e.TopicHelpFilePath=t),o._reopenEditorAfterSubflow(e,i,n)})},250)})}_reopenEditorAfterSubflow(t,e,i){let n=this._getModal(),o=this._getProvider();if(!n||!o)return;let r=this._buildTopicEditorHTML({TopicCode:t.TopicCode,TopicTitle:t.TopicTitle,TopicHelpFilePath:t.TopicHelpFilePath,Routes:i},e);n.show({title:e?"New Topic":"Edit Topic",content:r,closeable:!0,width:"500px",buttons:[{Hash:"cancel",Label:"Cancel"},{Hash:"save",Label:"Save",Style:"primary"}],onOpen:n=>{this._wireTopicEditorHandlers(n,t,e,i)}}).then(n=>{"save"===n?this._handleTopicEditorSave(t,e,i):setTimeout(()=>{this.showTopicManager()},250)})}_handleTopicEditorSave(t,e,i){let n=this._getProvider(),o=this._getModal(),r=this.pict.AppData.InlineDocumentation;if(!n)return;let a="",s="",l="";if("undefined"!=typeof document){let t=document.getElementById("tm-editor-code"),e=document.getElementById("tm-editor-title"),i=document.getElementById("tm-editor-helpfile");t&&(a=t.value.trim()),e&&(s=e.value.trim()),i&&(l=i.value.trim())}let d=[];if(e?a?/^[A-Z0-9][A-Z0-9-]*$/.test(a)?r.Topics&&r.Topics[a]&&d.push('A topic with code "'+a+'" already exists.'):d.push("Topic Code must use uppercase letters, numbers, and hyphens only."):d.push("Topic Code is required."):a=t.TopicCode,s||d.push("Title is required."),d.length>0)return o&&o.toast&&o.toast(d.join(" "),{type:"error"}),t.TopicTitle=s,t.TopicHelpFilePath=l,e&&(t.TopicCode=a),void setTimeout(()=>{this._reopenEditorAfterSubflow(t,e,i)},300);e?n.addTopic(a,{TopicCode:a,TopicTitle:s,TopicHelpFilePath:l,Routes:i}):n.updateTopic(a,{TopicTitle:s,TopicHelpFilePath:l,Routes:i}),n.saveTopics();let c=this.pict.views["InlineDoc-Nav"];c&&c.render(),o&&o.toast&&o.toast("Topic saved.",{type:"success"}),setTimeout(()=>{this.showTopicManager()},300)}showWildcardBuilder(t,e){let i=this._getModal(),n=this._getProvider();if(!i||!n)return void("function"==typeof e&&e(null));let o=n.getRouteSegments(t);if(o.length<1)return i.toast&&i.toast("No route segments to build a wildcard from.",{type:"error"}),void("function"==typeof e&&e(null));let r=Math.max(0,o.length-2),a=this._buildWildcardBuilderHTML(o,t,r);i.show({title:"Build Wildcard Pattern",content:a,closeable:!0,width:"520px",buttons:[{Hash:"cancel",Label:"Cancel"},{Hash:"exact",Label:"Use Exact Route"},{Hash:"pattern",Label:"Use Pattern",Style:"primary"}],onOpen:t=>{this._wireWildcardBuilderHandlers(t,o,r)}}).then(i=>{if("pattern"===i){let t="undefined"!=typeof document?document.getElementById("tm-wc-preview-value"):null,i=t?t.textContent:o[r].WildcardPattern;"function"==typeof e&&e(i)}else"exact"===i?"function"==typeof e&&e(t):"function"==typeof e&&e(null)})}_buildWildcardBuilderHTML(t,e,i){let n='<div class="pict-inline-doc-tm-wc-container">';n+='<div class="pict-inline-doc-tm-wc-label">Click a segment to set the wildcard boundary. Everything after the selected segment will match any path.</div>',n+='<div class="pict-inline-doc-tm-wc-segments" id="tm-wc-segments">';for(let e=0;e<t.length;e++){let o="pict-inline-doc-tm-wc-segment";e===i?o+=" selected":e>i&&(o+=" after-wildcard"),n+='<span class="pict-inline-doc-tm-wc-slash">/</span>',n+='<span class="'+o+'" data-segment-index="'+e+'">',n+=this._escapeHTML(t[e].Segment),n+="</span>"}return n+='<span class="pict-inline-doc-tm-wc-slash">/</span>',n+='<span class="pict-inline-doc-tm-wc-wildcard-star" id="tm-wc-star">*</span>',n+="</div>",n+='<div class="pict-inline-doc-tm-wc-preview-label">Pattern</div>',n+='<div class="pict-inline-doc-tm-wc-preview" id="tm-wc-preview-value">',n+=this._escapeHTML(t[i].WildcardPattern),n+="</div>",n+="</div>",n}_wireWildcardBuilderHandlers(t,e,i){let n=i,o=i=>{n=i;let o=t.querySelectorAll(".pict-inline-doc-tm-wc-segment");for(let t=0;t<o.length;t++){let e=parseInt(o[t].getAttribute("data-segment-index"),10);o[t].classList.remove("selected","after-wildcard"),e===i?o[t].classList.add("selected"):e>i&&o[t].classList.add("after-wildcard")}let r=t.querySelector("#tm-wc-preview-value");r&&(r.textContent=e[i].WildcardPattern)},r=t.querySelectorAll(".pict-inline-doc-tm-wc-segment");for(let t=0;t<r.length;t++)r[t].addEventListener("click",()=>{let e=parseInt(r[t].getAttribute("data-segment-index"),10);o(e)})}showBindTopicToRoute(){let t=this._getModal(),e=this._getProvider();if(!t||!e)return;let i=this.pict.AppData.InlineDocumentation;if(!i||!i.CurrentRoute)return void(t.toast&&t.toast("No current route to bind to.",{type:"error"}));let n=i.CurrentRoute,o=e.getTopicList(),r=this._buildBindHTML(n,o),a=null,s="exact";t.show({title:"Bind Topic to Route",content:r,closeable:!0,width:"480px",buttons:[{Hash:"cancel",Label:"Cancel"},{Hash:"bind",Label:"Bind Route",Style:"primary"}],onOpen:t=>{this._wireBindHandlers(t,o,n,t=>{a=t},t=>{s=t})}}).then(i=>{if("bind"===i&&a)if("__NEW__"!==a)if("wildcard"===s)this.showWildcardBuilder(n,i=>{if(i){e.addRouteToTopic(a,i),e.saveTopics();let n=this.pict.views["InlineDoc-Nav"];n&&n.render(),t.toast&&t.toast("Route bound to topic.",{type:"success"})}});else{e.addRouteToTopic(a,n),e.saveTopics();let i=this.pict.views["InlineDoc-Nav"];i&&i.render(),t.toast&&t.toast("Route bound to topic.",{type:"success"})}else this.showTopicEditor(null)})}_buildBindHTML(t,e){let i="";i+='<div class="pict-inline-doc-tm-bind-route-display">'+this._escapeHTML(t)+"</div>",i+='<div class="pict-inline-doc-tm-form-group">',i+='<label class="pict-inline-doc-tm-form-label">Route Match Type</label>',i+='<div class="pict-inline-doc-tm-bind-route-type">',i+='<div class="pict-inline-doc-tm-bind-route-type-btn selected" data-route-type="exact">Exact Match</div>',i+='<div class="pict-inline-doc-tm-bind-route-type-btn" data-route-type="wildcard">Wildcard Pattern</div>',i+="</div>",i+="</div>",i+='<div class="pict-inline-doc-tm-form-group">',i+='<label class="pict-inline-doc-tm-form-label">Select Topic</label>',i+='<div class="pict-inline-doc-tm-bind-topic-list">';for(let t=0;t<e.length;t++){let n=e[t];i+='<div class="pict-inline-doc-tm-bind-topic-option" data-topic-code="'+this._escapeHTML(n.TopicCode)+'">',i+='<div class="pict-inline-doc-tm-bind-radio"></div>',i+='<div class="pict-inline-doc-tm-topic-info">',i+='<div class="pict-inline-doc-tm-topic-title">'+this._escapeHTML(n.TopicTitle)+"</div>",i+='<div class="pict-inline-doc-tm-topic-meta">'+this._escapeHTML(n.TopicCode)+"</div>",i+="</div>",i+="</div>"}return i+='<div class="pict-inline-doc-tm-bind-topic-option" data-topic-code="__NEW__">',i+='<div class="pict-inline-doc-tm-bind-radio"></div>',i+='<div class="pict-inline-doc-tm-topic-info">',i+='<div class="pict-inline-doc-tm-topic-title" style="color:#2E7D74;">+ Create New Topic</div>',i+="</div>",i+="</div>",i+="</div>",i+="</div>",i}_wireBindHandlers(t,e,i,n,o){let r=t.querySelectorAll(".pict-inline-doc-tm-bind-topic-option");for(let t=0;t<r.length;t++)r[t].addEventListener("click",()=>{for(let t=0;t<r.length;t++)r[t].classList.remove("selected");r[t].classList.add("selected"),n(r[t].getAttribute("data-topic-code"))});let a=t.querySelectorAll(".pict-inline-doc-tm-bind-route-type-btn");for(let t=0;t<a.length;t++)a[t].addEventListener("click",()=>{for(let t=0;t<a.length;t++)a[t].classList.remove("selected");a[t].classList.add("selected"),o(a[t].getAttribute("data-route-type"))})}_showSidebarPicker(t){let e=this._getModal(),i=this.pict.AppData.InlineDocumentation;if(!e)return void("function"==typeof t&&t(null));let n=i&&i.SidebarGroups?i.SidebarGroups:[],o=this._buildSidebarPickerHTML(n);e.show({title:"Select Document",content:o,closeable:!0,width:"400px",buttons:[{Hash:"cancel",Label:"Cancel"}],onOpen:i=>{let n=i.querySelectorAll(".pict-inline-doc-tm-sidebar-item");for(let i=0;i<n.length;i++)n[i].addEventListener("click",()=>{let o=n[i].getAttribute("data-path");e.dismissModals&&e.dismissModals(),"function"==typeof t&&t(o)})}}).then(e=>{"cancel"!==e&&null!==e||"function"==typeof t&&t(null)})}_buildSidebarPickerHTML(t){let e='<div class="pict-inline-doc-tm-sidebar-list">',i=!1;for(let n=0;n<t.length;n++){let o=t[n];o.Path&&(i=!0,e+='<div class="pict-inline-doc-tm-sidebar-item" data-path="'+this._escapeHTML(o.Path)+'">',e+=this._escapeHTML(o.Name),e+='<span class="path">'+this._escapeHTML(o.Path)+"</span>",e+="</div>");let r=o.Items||[];for(let t=0;t<r.length;t++)r[t].Path&&(i=!0,e+='<div class="pict-inline-doc-tm-sidebar-item" data-path="'+this._escapeHTML(r[t].Path)+'">',e+=this._escapeHTML(r[t].Name),e+='<span class="path">'+this._escapeHTML(r[t].Path)+"</span>",e+="</div>")}return i||(e+='<div class="pict-inline-doc-tm-empty">No sidebar documents found.</div>'),e+="</div>",e}_escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}},e.exports.default_configuration=o},{"pict-view":102}],86:[function(t,e,i){e.exports.attach=function(t){t._createEditorInContainer=function(e,i,n){let o=t._codeMirrorModules,r=[];r.push(o.EditorView.domEventHandlers({keydown:(e,n)=>(e.ctrlKey||e.metaKey)&&"b"===e.key?(e.preventDefault(),t.applyFormatting(i,"bold"),!0):(e.ctrlKey||e.metaKey)&&"i"===e.key?(e.preventDefault(),t.applyFormatting(i,"italic"),!0):(e.ctrlKey||e.metaKey)&&"e"===e.key?(e.preventDefault(),t.applyFormatting(i,"code"),!0):void 0,paste:(e,n)=>{let o=e.clipboardData&&e.clipboardData.items;if(!o)return!1;for(let n=0;n<o.length;n++)if(o[n].type.startsWith("image/")){e.preventDefault();let r=o[n].getAsFile();return r&&t._processImageFile(r,i),!0}return!1},drop:(e,n)=>{if(t._dragSourceIndex>=0)return!1;if(!e.dataTransfer||!e.dataTransfer.files||e.dataTransfer.files.length<1)return!1;let o=e.dataTransfer.files[0];if(o.type&&o.type.startsWith("image/")){e.preventDefault(),e.stopPropagation(),t._processImageFile(o,i);let r=n.dom.closest(".pict-mde-segment-editor");return r&&r.classList.remove("pict-mde-image-dragover"),!0}return!1}})),o.extensions&&Array.isArray(o.extensions)&&(r=r.concat(o.extensions)),r.push(o.EditorView.updateListener.of(e=>{e.docChanged&&t._onSegmentContentChange(i,e.state.doc.toString()),e.focusChanged&&(e.view.hasFocus?(t._setActiveSegment(i),t._updateSidebarPosition(i)):setTimeout(()=>{if(t._activeSegmentIndex===i){let e=document.getElementById(`PictMDE-Segment-${i}`);e&&!e.contains(document.activeElement)&&(t._clearActiveSegment(i),t._resetSidebarPosition(i))}},100)),e.selectionSet&&e.view.hasFocus&&t._updateSidebarPosition(i)}));let a=t._buildDataURICollapseExtension();a&&r.push(a),t.options.ReadOnly&&(r.push(o.EditorState.readOnly.of(!0)),r.push(o.EditorView.editable.of(!1))),r=t.customConfigureExtensions(r,i);let s=o.EditorState.create({doc:n||"",extensions:r}),l=new o.EditorView({state:s,parent:e});t._segmentEditors[i]=l,l.contentDOM.addEventListener("keydown",function(e){if("ArrowDown"!==e.key&&"ArrowUp"!==e.key)return;if(e.shiftKey||e.ctrlKey||e.metaKey||e.altKey)return;let n=l.state,o=n.selection.main.head,r=n.doc.lineAt(o),a=o-r.from;if("ArrowDown"===e.key){if(r.to<n.doc.length)return;let o=t._getOrderedSegmentIndices(),s=t._getLogicalIndex(i);if(s<0||s>=o.length-1)return;let l=o[s+1],d=t._segmentEditors[l];if(!d)return;e.preventDefault(),e.stopPropagation();let c=d.state.doc.line(1),p=Math.min(a,c.to-c.from);d.focus(),d.dispatch({selection:{anchor:c.from+p}}),t._setActiveSegment(l)}else if("ArrowUp"===e.key){if(r.number>1)return;let n=t._getOrderedSegmentIndices(),o=t._getLogicalIndex(i);if(o<=0)return;let s=n[o-1],l=t._segmentEditors[s];if(!l)return;e.preventDefault(),e.stopPropagation();let d=l.state.doc.line(l.state.doc.lines),c=Math.min(a,d.to-d.from);l.focus(),l.dispatch({selection:{anchor:d.from+c}}),t._setActiveSegment(s)}},!0),l.contentDOM.addEventListener("drop",function(e){if(t._dragSourceIndex>=0)return;if(!e.dataTransfer||!e.dataTransfer.files||e.dataTransfer.files.length<1)return;let n=e.dataTransfer.files[0];if(n.type&&n.type.startsWith("image/")){e.preventDefault(),e.stopPropagation(),t._processImageFile(n,i);let o=document.getElementById(`PictMDE-SegmentEditor-${i}`);o&&o.classList.remove("pict-mde-image-dragover")}},!0)},t._buildDataURICollapseExtension=function(){let e=t._codeMirrorModules;if(!(e&&e.Decoration&&e.ViewPlugin&&e.WidgetType))return null;let i=e.Decoration,n=e.ViewPlugin,o=e.WidgetType;class r extends o{constructor(t){super(),this.label=t}toDOM(){let t=document.createElement("span");return t.className="pict-mde-data-uri-collapsed",t.textContent=this.label,t.title="Data URI (click to expand in image preview below)",t}eq(t){return this.label===t.label}}function a(t){let e=[],n=t.state.doc;for(let o of t.visibleRanges){let t,a=o.from,s=o.to,l=n.sliceString(a,s),d=/!\[[^\]]*\]\(data:([^;]+);base64,/g;for(;null!==(t=d.exec(l));){let o=a+t.index+t[0].length,s=-1,l=o,d=n.length,c=Math.min(d,l+5242880),p=4096;for(let t=l;t<c;t+=p){let e=Math.min(t+p,c),i=n.sliceString(t,e).indexOf(")");if(i>=0){s=t+i;break}}if(s<0)continue;let h=s-o;if(h<200)continue;let u,m=Math.round(.75*h);u=m>=1048576?(m/1048576).toFixed(1)+"MB":m>=1024?Math.round(m/1024)+"KB":m+"B";t[1];let g=`…${u})`,f=i.replace({widget:new r(g)});e.push(f.range(o,s+1))}}return i.set(e,!0)}return n.fromClass(class{constructor(t){this.decorations=a(t)}update(t){(t.docChanged||t.viewportChanged)&&(this.decorations=a(t.view))}},{decorations:t=>t.decorations})}}},{}],87:[function(t,e,i){e.exports.attach=function(t){t._wireSegmentDragEvents=function(e,i){let n=e.querySelector(".pict-mde-drag-handle");n&&(n.addEventListener("dragstart",n=>{t._dragSourceIndex=i,n.dataTransfer.effectAllowed="move",n.dataTransfer.setData("text/plain",String(i));let o=t._getContainerElement();o&&o.classList.add("pict-mde-dragging"),setTimeout(()=>{e.style.opacity="0.4"},0)}),n.addEventListener("dragend",()=>{e.style.opacity="",t._dragSourceIndex=-1,t._clearAllDropIndicators();let i=t._getContainerElement();i&&i.classList.remove("pict-mde-dragging")}),e.addEventListener("dragover",i=>{i.preventDefault(),i.dataTransfer.dropEffect="move",t._clearAllDropIndicators();let n=e.getBoundingClientRect(),o=n.top+n.height/2;i.clientY<o?e.classList.add("pict-mde-drag-over-top"):e.classList.add("pict-mde-drag-over-bottom")}),e.addEventListener("dragleave",t=>{e.contains(t.relatedTarget)||(e.classList.remove("pict-mde-drag-over-top"),e.classList.remove("pict-mde-drag-over-bottom"))}),e.addEventListener("drop",n=>{n.preventDefault();let o=e.classList.contains("pict-mde-drag-over-bottom");t._clearAllDropIndicators();let r=t._dragSourceIndex;r<0||r===i||t._reorderSegment(r,i,o)}))},t._clearAllDropIndicators=function(){let e=t._getContainerElement();if(!e)return;let i=e.querySelectorAll(".pict-mde-segment");for(let t=0;t<i.length;t++)i[t].classList.remove("pict-mde-drag-over-top"),i[t].classList.remove("pict-mde-drag-over-bottom")},t._reorderSegment=function(e,i,n){let o=t._getLogicalIndex(e),r=t._getLogicalIndex(i);if(o<0||r<0)return void t.log.warn(`PICT-MarkdownEditor _reorderSegment: could not resolve logical indices (from=${o}, to=${r}).`);if(o===r)return;t._marshalAllEditorsToData();let a=t._getSegmentsFromData();if(!a||a.length<2)return;let s=n?r+1:r;if(o<s&&s--,s===o)return;let l=a.splice(o,1)[0];a.splice(s,0,l),t._setSegmentsToData(a),t._reorderHiddenPreviewState(o,s),t._reorderSegmentTabStates(o,s),t._buildEditorUI()},t._reorderHiddenPreviewState=function(e,i){if(e===i)return;let n=Object.keys(t._hiddenPreviewSegments).map(t=>parseInt(t,10));if(0===n.length)return;let o=Math.max(...n,e,i),r=[];for(let e=0;e<=o;e++)r.push(!!t._hiddenPreviewSegments[e]);let a=r.splice(e,1)[0];r.splice(i,0,a),t._hiddenPreviewSegments={};for(let e=0;e<r.length;e++)r[e]&&(t._hiddenPreviewSegments[e]=!0)},t._swapHiddenPreviewState=function(e,i){let n=!!t._hiddenPreviewSegments[e];!!t._hiddenPreviewSegments[i]?t._hiddenPreviewSegments[e]=!0:delete t._hiddenPreviewSegments[e],n?t._hiddenPreviewSegments[i]=!0:delete t._hiddenPreviewSegments[i]},t._reorderSegmentTabStates=function(e,i){if(e===i)return;let n=Object.keys(t._segmentTabStates).map(t=>parseInt(t,10));if(0===n.length)return;let o=Math.max(...n,e,i),r=[];for(let e=0;e<=o;e++)r.push(t._segmentTabStates[e]||"editor");let a=r.splice(e,1)[0];r.splice(i,0,a),t._segmentTabStates={};for(let e=0;e<r.length;e++)"editor"!==r[e]&&(t._segmentTabStates[e]=r[e])},t._swapSegmentTabStates=function(e,i){let n=t._segmentTabStates[e]||"editor",o=t._segmentTabStates[i]||"editor";"editor"!==o?t._segmentTabStates[e]=o:delete t._segmentTabStates[e],"editor"!==n?t._segmentTabStates[i]=n:delete t._segmentTabStates[i]},t._setActiveSegment=function(e){if(t._activeSegmentIndex>=0&&t._activeSegmentIndex!==e){let e=document.getElementById(`PictMDE-Segment-${t._activeSegmentIndex}`);e&&e.classList.remove("pict-mde-active")}t._activeSegmentIndex=e;let i=document.getElementById(`PictMDE-Segment-${e}`);i&&i.classList.add("pict-mde-active")},t._clearActiveSegment=function(e){t._activeSegmentIndex===e&&(t._activeSegmentIndex=-1);let i=document.getElementById(`PictMDE-Segment-${e}`);i&&i.classList.remove("pict-mde-active"),t._resetSidebarPosition(e)},t._updateSidebarPosition=function(e){let i=document.getElementById(`PictMDE-Segment-${e}`);if(!i)return;let n=i.querySelector(".pict-mde-quadrant-tr");if(!n)return;let o=t._segmentEditors[e];if(!o)return;let r=o.state.selection.main.head,a=o.coordsAtPos(r);if(!a)return void t._resetSidebarPosition(e);let s=i.getBoundingClientRect(),l=a.top-s.top,d=n.offsetHeight||0,c=i.offsetHeight||0,p=Math.max(0,c-d);l=Math.max(0,Math.min(l,p)),n.classList.add("pict-mde-sidebar-at-cursor"),n.style.setProperty("--pict-mde-sidebar-top",`${l}px`)},t._resetSidebarPosition=function(t){let e=document.getElementById(`PictMDE-Segment-${t}`);if(!e)return;let i=e.querySelector(".pict-mde-quadrant-tr");i&&(i.classList.remove("pict-mde-sidebar-at-cursor"),i.style.removeProperty("--pict-mde-sidebar-top"))}}},{}],88:[function(t,e,i){const n={bold:{wrap:"**"},italic:{wrap:"*"},code:{wrap:"`"},heading:{prefix:"# "},link:{before:"[",after:"](url)"}};e.exports.attach=function(t){t.applyFormatting=function(e,i){let o=t._segmentEditors[e];if(!o)return void t.log.warn(`PICT-MarkdownEditor applyFormatting: no editor for segment ${e}.`);let r=n[i];if(!r)return void t.log.warn(`PICT-MarkdownEditor applyFormatting: unknown format type "${i}".`);let a,s,l=o.state,d=l.selection.main,c=d.from,p=d.to,h=c!==p,u=h?l.sliceDoc(c,p):"";if(r.wrap){let t=r.wrap;if(h){let e=l.sliceDoc(Math.max(0,c-t.length),c),i=l.sliceDoc(p,Math.min(l.doc.length,p+t.length));if(e===t&&i===t)return a=[{from:c-t.length,to:c,insert:""},{from:p,to:p+t.length,insert:""}],s=c-t.length,void o.dispatch({changes:a,selection:{anchor:s,head:s+u.length}});a={from:c,to:p,insert:t+u+t},s=c+t.length,o.dispatch({changes:a,selection:{anchor:s,head:s+u.length}})}else{a={from:c,insert:t+t},s=c+t.length,o.dispatch({changes:a,selection:{anchor:s}})}}else if(r.prefix){let t=l.doc.lineAt(c);a=t.text.startsWith(r.prefix)?{from:t.from,to:t.from+r.prefix.length,insert:""}:{from:t.from,insert:r.prefix},o.dispatch({changes:a})}else if(r.before&&r.after)if(h){a={from:c,to:p,insert:r.before+u+r.after},s=c+r.before.length+u.length+2,o.dispatch({changes:a,selection:{anchor:s,head:s+3}})}else{a={from:c,insert:r.before+r.after},s=c+r.before.length,o.dispatch({changes:a,selection:{anchor:s}})}o.focus()}}},{}],89:[function(t,e,i){e.exports.attach=function(t){t.openImagePicker=function(e){let i=document.getElementById(`PictMDE-ImageInput-${e}`);i?(i.onchange=()=>{i.files&&i.files.length>0&&t._processImageFile(i.files[0],e),i.value=""},i.click()):t.log.warn(`PICT-MarkdownEditor openImagePicker: file input not found for segment ${e}.`)},t._processImageFile=function(e,i){if(!e||!e.type||!e.type.startsWith("image/"))return void t.log.warn(`PICT-MarkdownEditor _processImageFile: not an image file (type: ${e?e.type:"null"}).`);let n=e.name?e.name.replace(/\.[^.]+$/,""):"image";if(t.onImageUpload(e,i,(e,o)=>{e?t.log.error(`PICT-MarkdownEditor image upload error: ${e}`):o&&t._insertImageMarkdown(i,o,n)}))return;if("undefined"==typeof FileReader)return void t.log.error("PICT-MarkdownEditor _processImageFile: FileReader not available in this environment.");let o=new FileReader;o.onload=()=>{t._insertImageMarkdown(i,o.result,n)},o.onerror=()=>{t.log.error("PICT-MarkdownEditor _processImageFile: FileReader error.")},o.readAsDataURL(e)},t._insertImageMarkdown=function(e,i,n){let o=t._segmentEditors[e];if(!o)return void t.log.warn(`PICT-MarkdownEditor _insertImageMarkdown: no editor for segment ${e}.`);let r=``,a=o.state.selection.main.head;o.dispatch({changes:{from:a,insert:r},selection:{anchor:a+r.length}}),o.focus(),t._updateImagePreviews(e)},t._updateImagePreviews=function(e){let i=document.getElementById(`PictMDE-ImagePreview-${e}`);if(!i)return;let n=t._segmentEditors[e];if(!n)return i.innerHTML="",void i.classList.remove("pict-mde-has-images");let o,r=n.state.doc.toString(),a=/!\[([^\]]*)\]\(([^)]+)\)/g,s=[];for(;null!==(o=a.exec(r));)s.push({alt:o[1]||"image",url:o[2]});if(0===s.length)return i.innerHTML="",void i.classList.remove("pict-mde-has-images");let l="";for(let e=0;e<s.length;e++){let i=s[e].alt.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""");l+=`<div class="pict-mde-image-preview-item"><img src="${t._resolveImageURL(s[e].url).replace(/&/g,"&").replace(/"/g,""")}" alt="${i}" /><span class="pict-mde-image-preview-label">${i}</span></div>`}i.innerHTML=l,i.classList.add("pict-mde-has-images")},t._wireImageDragEvents=function(e,i){e.addEventListener("dragover",i=>{t._dragSourceIndex>=0||!i.dataTransfer||!i.dataTransfer.types||i.dataTransfer.types.indexOf("Files")<0||(i.preventDefault(),i.dataTransfer.dropEffect="copy",e.classList.add("pict-mde-image-dragover"))}),e.addEventListener("dragleave",t=>{e.contains(t.relatedTarget)||e.classList.remove("pict-mde-image-dragover")}),e.addEventListener("drop",n=>{if(e.classList.remove("pict-mde-image-dragover"),t._dragSourceIndex>=0)return;if(!n.dataTransfer||!n.dataTransfer.files||n.dataTransfer.files.length<1)return;let o=n.dataTransfer.files[0];o.type&&o.type.startsWith("image/")&&(n.preventDefault(),n.stopPropagation(),t._processImageFile(o,i))})}}},{}],90:[function(t,e,i){const n=t("pict-section-content").PictContentProvider;e.exports.attach=function(t){t._getContentProvider=function(){return t._contentProvider||(t._contentProvider=new n(t.fable,{},"Pict-Content-Provider-MDE")),t._contentProvider},t._updateRichPreviews=function(e){if(!t.options.EnableRichPreview)return;let i=document.getElementById(`PictMDE-RichPreview-${e}`);if(!i)return;let n=t._segmentEditors[e];if(!n)return i.innerHTML="",void i.classList.remove("pict-mde-has-rich-preview");let o=n.state.doc.toString();if(!o||0===o.trim().length)return i.innerHTML="",void i.classList.remove("pict-mde-has-rich-preview");let r=t._getContentProvider(),a=null;t.pict&&t.pict.providers&&t.pict.providers.Vocabulary&&"function"==typeof t.pict.providers.Vocabulary.getResolver&&(a=t.pict.providers.Vocabulary.getResolver());let s=r.parseMarkdown(o,null,null,a);if(!s||0===s.trim().length)return i.innerHTML="",void i.classList.remove("pict-mde-has-rich-preview");let l=`PictMDE-RichPreviewBody-${e}`;if(i.innerHTML=`<div class="pict-content" id="${l}">${s}</div>`,i.classList.add("pict-mde-has-rich-preview"),t.pict&&t.pict.providers&&t.pict.providers.Vocabulary&&"function"==typeof t.pict.providers.Vocabulary.wirePopovers&&t.pict.providers.Vocabulary.wirePopovers("#"+l),t.options.ImageBaseURL){let e=i.querySelectorAll("img");for(let i=0;i<e.length;i++){let n=e[i].getAttribute("src");if(n){let o=t._resolveImageURL(n);o!==n&&e[i].setAttribute("src",o)}}}let d=(t._richPreviewGenerations[e]||0)+1;t._richPreviewGenerations[e]=d,t._postRenderMermaid(l,e,d),t._postRenderKaTeX(l)},t._postRenderMermaid=function(e,i,n){if("undefined"==typeof mermaid)return;let o=document.getElementById(e);if(!o)return;let r=o.querySelectorAll("pre.mermaid");if(!(r.length<1))try{let e=mermaid.run({nodes:r});e&&"function"==typeof e.catch&&e.catch(e=>{(-1===i?t._renderedViewGeneration:t._richPreviewGenerations[i])===n&&t.log.warn(`PICT-MarkdownEditor mermaid render error: ${e.message||e}`)})}catch(e){t.log.warn(`PICT-MarkdownEditor mermaid render error: ${e.message||e}`)}},t._postRenderKaTeX=function(e){if("undefined"==typeof katex)return;let i=document.getElementById(e);if(!i)return;let n=i.querySelectorAll(".pict-content-katex-inline");for(let e=0;e<n.length;e++)try{katex.render(n[e].textContent,n[e],{throwOnError:!1,displayMode:!1})}catch(e){t.log.warn(`PICT-MarkdownEditor KaTeX inline error: ${e.message||e}`)}let o=i.querySelectorAll(".pict-content-katex-display");for(let e=0;e<o.length;e++)try{katex.render(o[e].textContent,o[e],{throwOnError:!1,displayMode:!0})}catch(e){t.log.warn(`PICT-MarkdownEditor KaTeX display error: ${e.message||e}`)}},t._escapeHTMLForPreview=function(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")},t.toggleRenderedView=function(e){t._renderedViewActive="boolean"==typeof e?e:!t._renderedViewActive,t._renderedViewActive?t._renderRenderedView():t._restoreEditingView()},t._renderRenderedView=function(){let e=t._getContainerElement();if(!e)return;t._marshalAllEditorsToData();let i=t._getSegmentsFromData(),n="";if(i&&i.length>0){let t=[];for(let e=0;e<i.length;e++)t.push(i[e].Content||"");n=t.join("\n\n")}for(let e in t._segmentEditors)t._segmentEditors[e]&&t._segmentEditors[e].destroy();t._segmentEditors={};let o=t._getContentProvider().parseMarkdown(n),r="PictMDE-RenderedView";if(e.innerHTML=`<div class="pict-mde-rendered-view" id="${r}"><div class="pict-content">${o||""}</div></div>`,e.classList.add("pict-mde-rendered-mode"),t.options.ImageBaseURL){let i=e.querySelectorAll(".pict-mde-rendered-view img");for(let e=0;e<i.length;e++){let n=i[e].getAttribute("src");if(n){let o=t._resolveImageURL(n);o!==n&&i[e].setAttribute("src",o)}}}t._renderedViewGeneration++;let a=t._renderedViewGeneration,s=e.querySelector(`#${r} .pict-content`);if(s){let e="PictMDE-RenderedViewContent";s.id=e,t._postRenderMermaid(e,-1,a),t._postRenderKaTeX(e)}},t._restoreEditingView=function(){let e=t._getContainerElement();e&&(e.classList.remove("pict-mde-rendered-mode"),t._buildEditorUI())}}},{"pict-section-content":62}],91:[function(t,e,i){e.exports={DefaultRenderable:"MarkdownEditor-Wrap",DefaultDestinationAddress:"#MarkdownEditor-Container-Div",Templates:[{Hash:"MarkdownEditor-Container",Template:'<div class="pict-mde" id="PictMDE-Container"></div>'},{Hash:"MarkdownEditor-Segment",Template:'<div class="pict-mde-segment" id="PictMDE-Segment-{~D:Record.SegmentIndex~}" data-segment-index="{~D:Record.SegmentIndex~}">\n\t<div class="pict-mde-left-controls">\n\t\t<div class="pict-mde-quadrant-tl"></div>\n\t\t<div class="pict-mde-quadrant-bl"></div>\n\t</div>\n\t<div class="pict-mde-drag-handle" draggable="true" title="Drag to reorder"></div>\n\t<div class="pict-mde-segment-body">\n\t\t<div class="pict-mde-tab-bar" id="PictMDE-TabBar-{~D:Record.SegmentIndex~}">\n\t\t\t<button type="button" class="pict-mde-tab pict-mde-tab-active" data-tab="editor" onclick="{~D:Record.ViewIdentifier~}.switchSegmentTab({~D:Record.SegmentIndex~}, \'editor\')">Edit</button>\n\t\t\t<button type="button" class="pict-mde-tab" data-tab="preview" onclick="{~D:Record.ViewIdentifier~}.switchSegmentTab({~D:Record.SegmentIndex~}, \'preview\')">Preview</button>\n\t\t</div>\n\t\t<div class="pict-mde-segment-editor" id="PictMDE-SegmentEditor-{~D:Record.SegmentIndex~}"></div>\n\t\t<div class="pict-mde-preview-pane" id="PictMDE-PreviewPane-{~D:Record.SegmentIndex~}">\n\t\t\t<div class="pict-mde-image-preview" id="PictMDE-ImagePreview-{~D:Record.SegmentIndex~}"></div>\n\t\t\t<div class="pict-mde-rich-preview" id="PictMDE-RichPreview-{~D:Record.SegmentIndex~}"></div>\n\t\t</div>\n\t</div>\n\t<div class="pict-mde-sidebar" id="PictMDE-Sidebar-{~D:Record.SegmentIndex~}">\n\t\t<div class="pict-mde-quadrant-tr"></div>\n\t\t<div class="pict-mde-quadrant-br"></div>\n\t\t<input type="file" accept="image/*" class="pict-mde-image-input" id="PictMDE-ImageInput-{~D:Record.SegmentIndex~}" style="display:none" />\n\t</div>\n</div>'},{Hash:"MarkdownEditor-AddSegment",Template:'<div class="pict-mde-add-segment">\n\t<button type="button" class="pict-mde-btn-add" onclick="{~D:Record.ViewIdentifier~}.addSegment()">+ Add Segment</button>\n</div>'}],Renderables:[{RenderableHash:"MarkdownEditor-Wrap",TemplateHash:"MarkdownEditor-Container",DestinationAddress:"#MarkdownEditor-Container-Div"}],TargetElementAddress:"#MarkdownEditor-Container-Div",ContentDataAddress:!1,ReadOnly:!1,EnableRichPreview:!0,DefaultPreviewMode:"off",ImageBaseURL:"",ButtonsTL:[{HTML:"×",Action:"removeSegment",Class:"pict-mde-btn-remove",Title:"Remove Segment"}],ButtonsBL:[{HTML:"↑",Action:"moveSegmentUp",Class:"pict-mde-btn-move",Title:"Move Up"},{HTML:"↓",Action:"moveSegmentDown",Class:"pict-mde-btn-move",Title:"Move Down"},{HTML:"⊞",Action:"toggleControls",Class:"pict-mde-btn-linenums",Title:"Toggle Controls"},{HTML:"◎",Action:"cyclePreviewMode",Class:"pict-mde-btn-preview",Title:"Cycle Preview Mode"}],ButtonsTR:[{HTML:"<b>B</b>",Action:"applyFormatting:bold",Class:"",Title:"Bold (Ctrl+B)"},{HTML:"<i>I</i>",Action:"applyFormatting:italic",Class:"",Title:"Italic (Ctrl+I)"},{HTML:"<code><></code>",Action:"applyFormatting:code",Class:"",Title:"Inline Code (Ctrl+E)"},{HTML:"#",Action:"applyFormatting:heading",Class:"",Title:"Heading"},{HTML:"[ ]",Action:"applyFormatting:link",Class:"",Title:"Link"},{HTML:"▣",Action:"openImagePicker",Class:"pict-mde-sidebar-btn-image",Title:"Insert Image"}],ButtonsBR:[],CSS:"\n/* ---- Container ---- */\n.pict-mde\n{\n\tfont-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;\n\tfont-size: 14px;\n}\n\n/* ---- Segment row: left-controls | drag-handle | editor body | sidebar ---- */\n.pict-mde-segment\n{\n\tposition: relative;\n\tdisplay: flex;\n\tflex-direction: row;\n\talign-items: stretch;\n\tmargin-bottom: 6px;\n\tmin-height: 48px;\n\ttransition: background-color 0.15s ease;\n}\n\n/* ---- Left controls column ---- */\n.pict-mde-left-controls\n{\n\tflex: 0 0 22px;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 2px 0;\n}\n\n/* ---- Left-side quadrants ---- */\n.pict-mde-quadrant-tl\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tposition: sticky;\n\ttop: 2px;\n\tz-index: 2;\n}\n.pict-mde-quadrant-bl\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 1px;\n\tposition: sticky;\n\tbottom: 2px;\n\tz-index: 2;\n}\n\n/* ---- Left-side buttons (shared base) ---- */\n.pict-mde-left-btn\n{\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 20px;\n\theight: 20px;\n\tborder: none;\n\tbackground: transparent;\n\tcursor: pointer;\n\tfont-size: 12px;\n\tpadding: 0;\n\tcolor: #888;\n\tline-height: 1;\n\tfont-family: inherit;\n\topacity: 0;\n\ttransition: opacity 0.15s ease;\n}\n.pict-mde-segment:hover .pict-mde-left-btn,\n.pict-mde-segment.pict-mde-active .pict-mde-left-btn\n{\n\topacity: 1;\n}\n.pict-mde-left-btn:hover\n{\n\tcolor: #222;\n}\n.pict-mde-btn-remove:hover\n{\n\tcolor: #CC3333;\n}\n.pict-mde-btn-linenums\n{\n\tfont-size: 11px;\n\tfont-weight: 600;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', monospace;\n}\n/* Highlight when controls are active */\n.pict-mde.pict-mde-controls-on .pict-mde-btn-linenums\n{\n\tcolor: #4A90D9;\n}\n.pict-mde-btn-preview\n{\n\tfont-size: 11px;\n}\n/* Preview button: highlight when any preview mode is active */\n.pict-mde.pict-mde-preview-bottom .pict-mde-btn-preview,\n.pict-mde.pict-mde-preview-side .pict-mde-btn-preview,\n.pict-mde.pict-mde-preview-tabbed .pict-mde-btn-preview\n{\n\tcolor: #4A90D9;\n}\n/* Dim preview button when mode is off */\n.pict-mde.pict-mde-preview-off .pict-mde-btn-preview\n{\n\tcolor: #CCC;\n}\n\n/* ---- Drag handle (simple grey bar) ---- */\n.pict-mde-drag-handle\n{\n\tflex: 0 0 8px;\n\tcursor: grab;\n\tbackground: #EDEDED;\n\ttransition: background-color 0.15s ease;\n\tuser-select: none;\n}\n.pict-mde-drag-handle:active\n{\n\tcursor: grabbing;\n}\n.pict-mde-drag-handle:hover\n{\n\tbackground: #C8C8C8;\n}\n\n/* ---- Editor body (middle column) ---- */\n.pict-mde-segment-body\n{\n\tflex: 1 1 0%;\n\tmin-width: 0;\n\toverflow: hidden;\n\tbackground: #FFFFFF;\n\ttransition: background-color 0.15s ease;\n}\n.pict-mde-segment-editor\n{\n\tmin-height: 48px;\n}\n\n/* ---- Image preview area below the editor ---- */\n.pict-mde-image-preview\n{\n\tdisplay: none;\n}\n.pict-mde-image-preview.pict-mde-has-images\n{\n\tdisplay: flex;\n\tflex-wrap: wrap;\n\tgap: 8px;\n\tpadding: 8px 12px;\n\tborder-top: 1px solid #EDEDED;\n}\n.pict-mde-image-preview img\n{\n\tmax-width: 200px;\n\tmax-height: 150px;\n\tborder-radius: 3px;\n\tborder: 1px solid #E0E0E0;\n\tobject-fit: contain;\n\tbackground: #F8F8F8;\n}\n.pict-mde-image-preview-item\n{\n\tposition: relative;\n\tdisplay: inline-block;\n}\n.pict-mde-image-preview-label\n{\n\tdisplay: block;\n\tfont-size: 10px;\n\tcolor: #999;\n\tmargin-top: 2px;\n\tmax-width: 200px;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\twhite-space: nowrap;\n}\n\n/* ---- Rich content preview area (rendered via pict-section-content) ---- */\n.pict-mde-rich-preview\n{\n\tdisplay: none;\n}\n.pict-mde-rich-preview.pict-mde-has-rich-preview\n{\n\tdisplay: block;\n\tborder-top: 1px solid #EDEDED;\n\tbackground: #FCFCFC;\n\toverflow: hidden;\n}\n/* Constrain images in the rich preview even if pict-section-content CSS loads late */\n.pict-mde-rich-preview img\n{\n\tmax-width: 100%;\n\theight: auto;\n}\n/* ---- Preview layout modes ---- */\n\n/* Tab bar: hidden by default, shown only in tabbed mode */\n.pict-mde-tab-bar\n{\n\tdisplay: none;\n}\n.pict-mde.pict-mde-preview-tabbed .pict-mde-tab-bar\n{\n\tdisplay: flex;\n\tgap: 0;\n\tborder-bottom: 1px solid #EDEDED;\n\tbackground: #F8F8F8;\n}\n.pict-mde-tab\n{\n\tpadding: 4px 12px;\n\tborder: none;\n\tbackground: transparent;\n\tcursor: pointer;\n\tfont-size: 12px;\n\tcolor: #888;\n\tborder-bottom: 2px solid transparent;\n\tfont-family: inherit;\n}\n.pict-mde-tab:hover\n{\n\tcolor: #222;\n}\n.pict-mde-tab.pict-mde-tab-active\n{\n\tcolor: #4A90D9;\n\tborder-bottom-color: #4A90D9;\n}\n\n/* Off mode: hide all preview panes and tab bars */\n.pict-mde.pict-mde-preview-off .pict-mde-preview-pane\n{\n\tdisplay: none;\n}\n.pict-mde.pict-mde-preview-off .pict-mde-tab-bar\n{\n\tdisplay: none;\n}\n/* Legacy class alias for backward compatibility */\n.pict-mde.pict-mde-previews-hidden .pict-mde-preview-pane\n{\n\tdisplay: none;\n}\n\n/* Bottom mode: vertical stacking (default flex-column behavior) */\n.pict-mde.pict-mde-preview-bottom .pict-mde-segment-body\n{\n\tdisplay: flex;\n\tflex-direction: column;\n}\n\n/* Side-by-side mode: editor and preview side by side */\n.pict-mde.pict-mde-preview-side .pict-mde-segment-body\n{\n\tdisplay: flex;\n\tflex-direction: row;\n}\n.pict-mde.pict-mde-preview-side .pict-mde-segment-editor\n{\n\tflex: 1 1 50%;\n\tmin-width: 0;\n\toverflow: hidden;\n}\n.pict-mde.pict-mde-preview-side .pict-mde-preview-pane\n{\n\tflex: 1 1 50%;\n\tmin-width: 0;\n\toverflow: auto;\n\tborder-left: 1px solid #EDEDED;\n}\n/* Side-by-side: remove top borders since preview is beside, not below */\n.pict-mde.pict-mde-preview-side .pict-mde-rich-preview.pict-mde-has-rich-preview\n{\n\tborder-top: none;\n}\n.pict-mde.pict-mde-preview-side .pict-mde-image-preview.pict-mde-has-images\n{\n\tborder-top: none;\n}\n\n/* Tabbed mode: default hides preview, shows editor */\n.pict-mde.pict-mde-preview-tabbed .pict-mde-segment-body\n{\n\tdisplay: flex;\n\tflex-direction: column;\n}\n.pict-mde.pict-mde-preview-tabbed .pict-mde-preview-pane\n{\n\tdisplay: none;\n}\n/* Tabbed mode: when showing preview, hide editor and show preview */\n.pict-mde.pict-mde-preview-tabbed .pict-mde-segment.pict-mde-tab-showing-preview .pict-mde-segment-editor\n{\n\tdisplay: none;\n}\n.pict-mde.pict-mde-preview-tabbed .pict-mde-segment.pict-mde-tab-showing-preview .pict-mde-preview-pane\n{\n\tdisplay: block;\n}\n\n/* Per-segment preview hide: only applies in bottom and side modes */\n.pict-mde.pict-mde-preview-bottom .pict-mde-segment.pict-mde-preview-hidden .pict-mde-preview-pane,\n.pict-mde.pict-mde-preview-side .pict-mde-segment.pict-mde-preview-hidden .pict-mde-preview-pane\n{\n\tdisplay: none;\n}\n/* Constrain the pict-content inside the preview to fit the segment */\n.pict-mde-rich-preview .pict-content\n{\n\tpadding: 12px;\n\tmax-width: none;\n\tmargin: 0;\n\tfont-size: 13px;\n}\n/* Reduce heading sizes in the preview to be proportional */\n.pict-mde-rich-preview .pict-content h1\n{\n\tfont-size: 1.4em;\n\tmargin-top: 0;\n}\n.pict-mde-rich-preview .pict-content h2\n{\n\tfont-size: 1.2em;\n\tmargin-top: 0.75em;\n}\n.pict-mde-rich-preview .pict-content h3\n{\n\tfont-size: 1.1em;\n\tmargin-top: 0.6em;\n}\n\n/* ---- Rendered view (full document preview mode) ---- */\n.pict-mde-rendered-view\n{\n\tpadding: 16px 20px;\n\tbackground: #FFFFFF;\n\tmin-height: 120px;\n}\n.pict-mde-rendered-view .pict-content\n{\n\tmax-width: none;\n\tmargin: 0;\n}\n/* Hide the add-segment button in rendered mode */\n.pict-mde.pict-mde-rendered-mode .pict-mde-add-segment\n{\n\tdisplay: none;\n}\n\n/* Focused / active editor gets subtle warm background */\n.pict-mde-segment.pict-mde-active .pict-mde-segment-body\n{\n\tbackground: #FAFAF5;\n}\n.pict-mde-segment.pict-mde-active .pict-mde-drag-handle\n{\n\tbackground: #9CB4C8;\n}\n\n/* ---- Right sidebar column ---- */\n.pict-mde-sidebar\n{\n\tflex: 0 0 30px;\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: flex-start;\n\tjustify-content: space-between;\n\tposition: relative;\n}\n\n/* ---- Right-side quadrants ---- */\n.pict-mde-quadrant-tr\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 1px;\n\tpadding: 4px 0;\n\twidth: 100%;\n\topacity: 0;\n\ttransition: opacity 0.15s ease, top 0.1s ease;\n\tposition: sticky;\n\ttop: 0;\n}\n.pict-mde-quadrant-br\n{\n\tdisplay: flex;\n\tflex-direction: column;\n\talign-items: center;\n\tgap: 1px;\n\tpadding: 4px 0;\n\twidth: 100%;\n\topacity: 0;\n\ttransition: opacity 0.15s ease;\n\tposition: sticky;\n\tbottom: 0;\n}\n\n/* Active segment always shows its right-side quadrants */\n.pict-mde-segment.pict-mde-active .pict-mde-quadrant-tr,\n.pict-mde-segment.pict-mde-active .pict-mde-quadrant-br\n{\n\topacity: 1;\n}\n/* When no segment is active, hovering shows both left + right controls */\n.pict-mde:not(:has(.pict-mde-active)) .pict-mde-segment:hover .pict-mde-quadrant-tr,\n.pict-mde:not(:has(.pict-mde-active)) .pict-mde-segment:hover .pict-mde-quadrant-br\n{\n\topacity: 1;\n}\n\n/* ---- Controls-hidden mode: right quadrants show faintly on hover ---- */\n.pict-mde.pict-mde-controls-hidden .pict-mde-quadrant-tr,\n.pict-mde.pict-mde-controls-hidden .pict-mde-quadrant-br\n{\n\topacity: 0;\n}\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment:hover .pict-mde-quadrant-tr,\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment:hover .pict-mde-quadrant-br\n{\n\topacity: 0.3;\n}\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment.pict-mde-active .pict-mde-quadrant-tr,\n.pict-mde.pict-mde-controls-hidden .pict-mde-segment.pict-mde-active .pict-mde-quadrant-br\n{\n\topacity: 0.3;\n}\n\n/* When JS sets a cursor-relative offset, switch TR from sticky to absolute positioning */\n.pict-mde-quadrant-tr.pict-mde-sidebar-at-cursor\n{\n\tposition: absolute;\n\ttop: var(--pict-mde-sidebar-top, 0px);\n}\n\n/* ---- Right-side buttons (shared base) ---- */\n.pict-mde-sidebar-btn\n{\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\twidth: 24px;\n\theight: 22px;\n\tborder: none;\n\tbackground: transparent;\n\tcursor: pointer;\n\tfont-size: 12px;\n\tpadding: 0;\n\tborder-radius: 3px;\n\tcolor: #666;\n\tline-height: 1;\n\tfont-family: inherit;\n}\n.pict-mde-sidebar-btn:hover\n{\n\tcolor: #222;\n}\n.pict-mde-sidebar-btn b\n{\n\tfont-size: 13px;\n\tfont-weight: 700;\n}\n.pict-mde-sidebar-btn i\n{\n\tfont-size: 13px;\n\tfont-style: italic;\n}\n.pict-mde-sidebar-btn code\n{\n\tfont-size: 10px;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', monospace;\n}\n\n/* ---- Add segment button ---- */\n.pict-mde-add-segment\n{\n\tmargin-top: 6px;\n\tpadding-left: 30px;\n}\n.pict-mde-btn-add\n{\n\tdisplay: block;\n\twidth: 100%;\n\tpadding: 7px;\n\tborder: 2px dashed #D0D0D0;\n\tborder-radius: 4px;\n\tbackground: transparent;\n\tcolor: #999;\n\tfont-size: 12px;\n\tfont-weight: 600;\n\tcursor: pointer;\n\ttransition: all 0.15s ease;\n}\n.pict-mde-btn-add:hover\n{\n\tborder-color: #4A90D9;\n\tcolor: #4A90D9;\n\tbackground: rgba(74, 144, 217, 0.04);\n}\n\n/* ---- Image drag-over indicator ---- */\n.pict-mde-segment-editor.pict-mde-image-dragover\n{\n\toutline: 2px dashed #4A90D9;\n\toutline-offset: -2px;\n}\n\n/* ---- Drag-in-progress: prevent CodeMirror from intercepting drop events ---- */\n.pict-mde.pict-mde-dragging .pict-mde-segment-editor\n{\n\tpointer-events: none;\n}\n\n/* ---- Drop target indicators for drag reorder ---- */\n.pict-mde-segment.pict-mde-drag-over-top\n{\n\tbox-shadow: 0 -2px 0 0 #4A90D9;\n}\n.pict-mde-segment.pict-mde-drag-over-bottom\n{\n\tbox-shadow: 0 2px 0 0 #4A90D9;\n}\n\n/* ---- CodeMirror overrides inside segments ---- */\n.pict-mde-segment-editor .cm-editor\n{\n\tborder: none;\n}\n.pict-mde-segment-editor .cm-editor .cm-scroller\n{\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', 'Consolas', 'Liberation Mono', 'Courier New', monospace;\n\tfont-size: 14px;\n\tline-height: 1.6;\n}\n.pict-mde-segment-editor .cm-editor.cm-focused\n{\n\toutline: none;\n}\n.pict-mde-segment-editor .cm-editor .cm-content\n{\n\tpadding: 8px 12px;\n\tmin-height: 36px;\n}\n.pict-mde-segment-editor .cm-editor .cm-gutters\n{\n\tbackground: #F8F8F8;\n\tborder-right: 1px solid #E8E8E8;\n\tcolor: #BBB;\n}\n\n/* ---- Collapsed data URI widget ---- */\n.pict-mde-data-uri-collapsed\n{\n\tdisplay: inline;\n\tbackground: #F0F0F0;\n\tcolor: #888;\n\tfont-size: 11px;\n\tpadding: 1px 4px;\n\tborder-radius: 3px;\n\tborder: 1px solid #E0E0E0;\n\tfont-family: 'SFMono-Regular', 'SF Mono', 'Menlo', monospace;\n\tcursor: default;\n\twhite-space: nowrap;\n}\n\n/* ---- Line number / controls toggle: gutters hidden by default ---- */\n.pict-mde .cm-editor .cm-gutters\n{\n\tdisplay: none;\n}\n.pict-mde.pict-mde-controls-on .cm-editor .cm-gutters\n{\n\tdisplay: flex;\n}\n\n/* ============================================\n RESPONSIVE: Tablet / Phone (max-width: 768px)\n ============================================ */\n@media (max-width: 768px)\n{\n\t/* Prevent any horizontal overflow in the editor */\n\t.pict-mde\n\t{\n\t\toverflow-x: hidden;\n\t\tmax-width: 100%;\n\t}\n\n\t/* Reduce the left controls column width */\n\t.pict-mde-left-controls\n\t{\n\t\tflex: 0 0 16px;\n\t}\n\t.pict-mde-left-btn\n\t{\n\t\twidth: 16px;\n\t\theight: 18px;\n\t\tfont-size: 10px;\n\t}\n\n\t/* Make left-side buttons always visible on touch (no hover) */\n\t.pict-mde-left-btn\n\t{\n\t\topacity: 0.6;\n\t}\n\n\t/* Narrow the drag handle */\n\t.pict-mde-drag-handle\n\t{\n\t\tflex: 0 0 5px;\n\t}\n\n\t/* Shrink the right sidebar column */\n\t.pict-mde-sidebar\n\t{\n\t\tflex: 0 0 24px;\n\t}\n\t.pict-mde-sidebar-btn\n\t{\n\t\twidth: 20px;\n\t\theight: 20px;\n\t\tfont-size: 11px;\n\t}\n\n\t/* Make right sidebar buttons always visible (touch devices) */\n\t.pict-mde-quadrant-tr,\n\t.pict-mde-quadrant-br\n\t{\n\t\topacity: 0.7;\n\t}\n\t.pict-mde-segment.pict-mde-active .pict-mde-quadrant-tr,\n\t.pict-mde-segment.pict-mde-active .pict-mde-quadrant-br\n\t{\n\t\topacity: 1;\n\t}\n\n\t/* Reduce CodeMirror content padding */\n\t.pict-mde-segment-editor .cm-editor .cm-content\n\t{\n\t\tpadding: 6px 6px;\n\t}\n\n\t/* Reduce font size slightly for more content on screen */\n\t.pict-mde-segment-editor .cm-editor .cm-scroller\n\t{\n\t\tfont-size: 13px;\n\t}\n\n\t/* Add segment button: reduce left margin */\n\t.pict-mde-add-segment\n\t{\n\t\tpadding-left: 21px;\n\t}\n\n\t/* Side-by-side: fall back to vertical stacking on narrow screens */\n\t.pict-mde.pict-mde-preview-side .pict-mde-segment-body\n\t{\n\t\tflex-direction: column;\n\t}\n\t.pict-mde.pict-mde-preview-side .pict-mde-preview-pane\n\t{\n\t\tborder-left: none;\n\t\tborder-top: 1px solid #EDEDED;\n\t}\n\n\t/* Tab bar: smaller on tablet */\n\t.pict-mde-tab\n\t{\n\t\tpadding: 3px 8px;\n\t\tfont-size: 11px;\n\t}\n\n\t/* Rich preview: less padding */\n\t.pict-mde-rich-preview .pict-content\n\t{\n\t\tpadding: 8px;\n\t\tfont-size: 12px;\n\t}\n\n\t/* Image previews: smaller max dimensions */\n\t.pict-mde-image-preview img\n\t{\n\t\tmax-width: 120px;\n\t\tmax-height: 100px;\n\t}\n\n\t/* Rendered view: less padding */\n\t.pict-mde-rendered-view\n\t{\n\t\tpadding: 10px 8px;\n\t}\n}\n\n/* ============================================\n RESPONSIVE: Small phone (max-width: 480px)\n ============================================ */\n@media (max-width: 480px)\n{\n\t/* Wrap segment so left controls flow to the top as a horizontal bar */\n\t.pict-mde-segment\n\t{\n\t\tflex-wrap: wrap;\n\t}\n\n\t/* Left controls become a horizontal toolbar at the top of the segment */\n\t.pict-mde-left-controls\n\t{\n\t\tflex: 0 0 100%;\n\t\tflex-direction: row;\n\t\tjustify-content: flex-start;\n\t\tgap: 2px;\n\t\tpadding: 3px 4px;\n\t\torder: -1;\n\t\tbackground: #F5F5F5;\n\t\tborder-bottom: 1px solid #EDEDED;\n\t}\n\t.pict-mde-left-btn\n\t{\n\t\twidth: 24px;\n\t\theight: 24px;\n\t\tfont-size: 12px;\n\t\topacity: 0.7;\n\t}\n\n\t/* Left quadrants flow horizontally */\n\t.pict-mde-quadrant-tl,\n\t.pict-mde-quadrant-bl\n\t{\n\t\tflex-direction: row;\n\t\tgap: 2px;\n\t\tposition: static;\n\t}\n\n\t/* Segment body: explicit basis so it fills the wrapped row */\n\t.pict-mde-segment-body\n\t{\n\t\tflex: 1 1 calc(100% - 20px);\n\t}\n\n\t/* Hide drag handle on very small screens */\n\t.pict-mde-drag-handle\n\t{\n\t\tdisplay: none;\n\t}\n\n\t/* Right sidebar: further shrink */\n\t.pict-mde-sidebar\n\t{\n\t\tflex: 0 0 20px;\n\t}\n\t.pict-mde-sidebar-btn\n\t{\n\t\twidth: 18px;\n\t\theight: 18px;\n\t\tfont-size: 10px;\n\t}\n\n\t/* Add segment: no left offset since controls are at top */\n\t.pict-mde-add-segment\n\t{\n\t\tpadding-left: 0;\n\t}\n\n\t/* Even tighter CodeMirror padding */\n\t.pict-mde-segment-editor .cm-editor .cm-content\n\t{\n\t\tpadding: 4px 4px;\n\t}\n}\n"}},{}],92:[function(t,e,i){const n=t("pict-view"),o=t("pict-section-content"),r=t("./Pict-Section-MarkdownEditor-DefaultConfiguration.js"),a=t("./Pict-MDE-Formatting.js"),s=t("./Pict-MDE-ImageHandling.js"),l=t("./Pict-MDE-DragAndReorder.js"),d=t("./Pict-MDE-RichPreview.js"),c=t("./Pict-MDE-CodeMirror.js");e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},r,e),i),this.initialRenderComplete=!1,this._codeMirrorModules=null,this._segmentEditors={},this._segmentCounter=0,this._viewCallIdentifier=!1,this._activeSegmentIndex=-1,this._dragSourceIndex=-1,this._controlsVisible=!0,this._previewMode=this.options.DefaultPreviewMode||"off",this._lastPreviewLayout="bottom",this._segmentTabStates={},this._hiddenPreviewSegments={},this._imagePreviewTimers={},this._richPreviewTimers={},this._richPreviewGenerations={},this._contentProvider=null,this._renderedViewActive=!1,this._renderedViewGeneration=0,a.attach(this),s.attach(this),l.attach(this),d.attach(this),c.attach(this)}onBeforeInitialize(){return super.onBeforeInitialize(),this.targetElement=!1,super.onBeforeInitialize()}connectCodeMirrorModules(t){if(!t||"object"!=typeof t||"function"!=typeof t.EditorView||"function"!=typeof t.EditorState)return"undefined"!=typeof window&&window.CodeMirrorModules&&"function"==typeof window.CodeMirrorModules.EditorView?(this.log.trace("PICT-MarkdownEditor Found CodeMirror modules on window.CodeMirrorModules."),void(this._codeMirrorModules=window.CodeMirrorModules)):(this.log.error("PICT-MarkdownEditor No CodeMirror modules found. Provide them via connectCodeMirrorModules() or set window.CodeMirrorModules."),!1);this._codeMirrorModules=t}onAfterRender(t){return this.initialRenderComplete||(this.onAfterInitialRender(),this.initialRenderComplete=!0),this.pict.CSSMap.injectCSS(),super.onAfterRender(t)}onAfterInitialRender(){if(this._codeMirrorModules||this.connectCodeMirrorModules(),!this._codeMirrorModules)return this.log.error("PICT-MarkdownEditor Cannot initialize; no CodeMirror modules available."),!1;if(this.options.EnableRichPreview){let t=o.default_configuration;t&&t.CSS&&this.pict.CSSMap.addCSS("Pict-Content-View",t.CSS)}let t=this.services.ContentAssignment.getElement(this.options.TargetElementAddress);if(!t||t.length<1)return this.log.error(`PICT-MarkdownEditor Could not find target element [${this.options.TargetElementAddress}]!`),this.targetElement=!1,!1;this.targetElement=t[0],this._viewCallIdentifier=this._resolveViewCallIdentifier(),this._buildEditorUI()}_resolveViewCallIdentifier(){let t=this.pict.views;for(let e in t)if(t[e]===this)return`_Pict.views.${e}`;return`_Pict.servicesMap.PictView['${this.Hash}']`}_getContainerElement(){if(this.targetElement){let t=this.targetElement.querySelector(".pict-mde");if(t)return t}return this.targetElement||null}_resolveImageURL(t){if(!t||!this.options.ImageBaseURL)return t;if(t.startsWith("/")||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:"))return t;let e=this.options.ImageBaseURL;return e&&!e.endsWith("/")&&(e+="/"),e+t}_buildEditorUI(){let t=this._getContainerElement();t&&!t.classList.contains("pict-mde")&&t.classList.add("pict-mde");for(let t in this._segmentEditors)this._segmentEditors[t]&&this._segmentEditors[t].destroy();t.innerHTML="",t.classList.remove("pict-mde-preview-off","pict-mde-preview-bottom","pict-mde-preview-side","pict-mde-preview-tabbed","pict-mde-previews-hidden"),t.classList.add("pict-mde-preview-"+this._previewMode),this._controlsVisible?t.classList.add("pict-mde-controls-on"):t.classList.add("pict-mde-controls-hidden");let e=this._getSegmentsFromData();e&&0!==e.length||(e=[{Content:""}],this._setSegmentsToData(e)),this._segmentCounter=0,this._segmentEditors={};for(let i=0;i<e.length;i++)this._renderSegment(t,i,e[i].Content||"");this._renderAddButton(t)}_renderSegment(t,e,i){let n=this._segmentCounter++,o={SegmentIndex:n,SegmentDisplayIndex:e+1,ViewIdentifier:this._viewCallIdentifier},r=this.pict.parseTemplateByHash("MarkdownEditor-Segment",o),a=document.createElement("div");a.innerHTML=r;let s=a.firstElementChild;if(t.appendChild(s),this._buildQuadrantButtons(s,n),this._hiddenPreviewSegments[e]&&s.classList.add("pict-mde-preview-hidden"),"tabbed"===this._previewMode&&"preview"===this._segmentTabStates[e]){s.classList.add("pict-mde-tab-showing-preview");let t=s.querySelector(".pict-mde-tab-bar");if(t){let e=t.querySelector('[data-tab="editor"]'),i=t.querySelector('[data-tab="preview"]');e&&e.classList.remove("pict-mde-tab-active"),i&&i.classList.add("pict-mde-tab-active")}}this._wireSegmentDragEvents(s,n);let l=document.getElementById(`PictMDE-SegmentEditor-${n}`);l&&(this._createEditorInContainer(l,n,i),this._wireImageDragEvents(l,n),i&&(this._updateImagePreviews(n),this._updateRichPreviews(n)))}_buildQuadrantButtons(t,e){let i=[{key:"ButtonsTL",selector:".pict-mde-quadrant-tl",baseClass:"pict-mde-left-btn"},{key:"ButtonsBL",selector:".pict-mde-quadrant-bl",baseClass:"pict-mde-left-btn"},{key:"ButtonsTR",selector:".pict-mde-quadrant-tr",baseClass:"pict-mde-sidebar-btn"},{key:"ButtonsBR",selector:".pict-mde-quadrant-br",baseClass:"pict-mde-sidebar-btn"}],n=this;for(let o=0;o<i.length;o++){let r=i[o],a=t.querySelector(r.selector);if(!a)continue;let s=this.options[r.key];if(Array.isArray(s))for(let t=0;t<s.length;t++){let i=s[t],o=document.createElement("button");o.type="button",o.className=r.baseClass,i.Class&&(o.className+=" "+i.Class),o.innerHTML=i.HTML||"",o.title=i.Title||"";let l=i.Action||"",d=l,c=null,p=l.indexOf(":");p>=0&&(d=l.substring(0,p),c=l.substring(p+1)),function(t,e,i){o.addEventListener("click",()=>{"function"==typeof n[t]?null!==e?n[t](i,e):n[t](i):n.log.warn(`PICT-MarkdownEditor _buildQuadrantButtons: method "${t}" not found.`)})}(d,c,e),a.appendChild(o)}}}customConfigureExtensions(t,e){return t}_renderAddButton(t){let e={ViewIdentifier:this._viewCallIdentifier},i=this.pict.parseTemplateByHash("MarkdownEditor-AddSegment",e),n=document.createElement("div");n.innerHTML=i;let o=n.firstElementChild;t.appendChild(o)}onImageUpload(t,e,i){return!1}toggleControls(t,e){let i=e;"boolean"==typeof t&&(i=t),this._controlsVisible="boolean"==typeof i?i:!this._controlsVisible;let n=this._getContainerElement();n&&(this._controlsVisible?(n.classList.add("pict-mde-controls-on"),n.classList.remove("pict-mde-controls-hidden")):(n.classList.remove("pict-mde-controls-on"),n.classList.add("pict-mde-controls-hidden")))}toggleLineNumbers(t){this.toggleControls(t)}togglePreview(t){"boolean"==typeof t?t?this.setPreviewMode(this._lastPreviewLayout||"bottom"):this.setPreviewMode("off"):"off"===this._previewMode?this.setPreviewMode(this._lastPreviewLayout||"bottom"):this.setPreviewMode("off")}setPreviewMode(t){if(["off","bottom","side","tabbed"].indexOf(t)<0)return void this.log.warn(`PICT-MarkdownEditor setPreviewMode: unknown mode "${t}".`);"off"!==t&&(this._lastPreviewLayout=t),this._previewMode=t;let e=this._getContainerElement();if(e&&(e.classList.remove("pict-mde-preview-off","pict-mde-preview-bottom","pict-mde-preview-side","pict-mde-preview-tabbed","pict-mde-previews-hidden"),e.classList.add("pict-mde-preview-"+t)),"off"!==t){let t=this._getOrderedSegmentIndices();for(let e=0;e<t.length;e++)this._updateRichPreviews(t[e]),this._updateImagePreviews(t[e])}}cyclePreviewMode(t){let e=["off","bottom","side","tabbed"],i=(e.indexOf(this._previewMode)+1)%e.length;this.setPreviewMode(e[i])}switchSegmentTab(t,e){let i=this._getLogicalIndex(t);if(i<0)return;this._segmentTabStates[i]=e;let n=document.getElementById(`PictMDE-Segment-${t}`);if(!n)return;"preview"===e?(n.classList.add("pict-mde-tab-showing-preview"),this._updateRichPreviews(t),this._updateImagePreviews(t)):n.classList.remove("pict-mde-tab-showing-preview");let o=document.getElementById(`PictMDE-TabBar-${t}`);if(o){let t=o.querySelectorAll(".pict-mde-tab");for(let i=0;i<t.length;i++)t[i].getAttribute("data-tab")===e?t[i].classList.add("pict-mde-tab-active"):t[i].classList.remove("pict-mde-tab-active")}}toggleSegmentPreview(t,e){let i=this._getLogicalIndex(t);if(i<0)return;let n=!!this._hiddenPreviewSegments[i];n="boolean"==typeof e?!e:!n,n?this._hiddenPreviewSegments[i]=!0:delete this._hiddenPreviewSegments[i];let o=document.getElementById(`PictMDE-Segment-${t}`);o&&(n?o.classList.add("pict-mde-preview-hidden"):(o.classList.remove("pict-mde-preview-hidden"),this._updateRichPreviews(t),this._updateImagePreviews(t)))}_getSegmentsFromData(){if(!this.options.ContentDataAddress)return null;const t={Fable:this.fable,Pict:this.fable,AppData:this.AppData,Bundle:this.Bundle,Options:this.options};let e=this.fable.manifest.getValueByHash(t,this.options.ContentDataAddress);return Array.isArray(e)?e:null}_setSegmentsToData(t){if(!this.options.ContentDataAddress)return;const e={Fable:this.fable,Pict:this.fable,AppData:this.AppData,Bundle:this.Bundle,Options:this.options};this.fable.manifest.setValueByHash(e,this.options.ContentDataAddress,t)}_onSegmentContentChange(t,e){let i=this._getLogicalIndex(t);if(i<0)return;let n=this._getSegmentsFromData();if(!n)return;i<n.length&&(n[i].Content=e),this.onContentChange(i,e);let o=this;this._imagePreviewTimers[t]&&clearTimeout(this._imagePreviewTimers[t]),this._imagePreviewTimers[t]=setTimeout(()=>{o._updateImagePreviews(t),delete o._imagePreviewTimers[t]},500),this._richPreviewTimers[t]&&clearTimeout(this._richPreviewTimers[t]),this._richPreviewTimers[t]=setTimeout(()=>{o._updateRichPreviews(t),delete o._richPreviewTimers[t]},500)}onContentChange(t,e){}_getLogicalIndex(t){let e=this._getContainerElement();if(!e)return-1;let i=e.querySelectorAll(".pict-mde-segment");for(let e=0;e<i.length;e++){if(parseInt(i[e].getAttribute("data-segment-index"),10)===t)return e}return-1}_getOrderedSegmentIndices(){let t=this._getContainerElement();if(!t)return[];let e=t.querySelectorAll(".pict-mde-segment"),i=[];for(let t=0;t<e.length;t++)i.push(parseInt(e[t].getAttribute("data-segment-index"),10));return i}addSegment(t){let e="string"==typeof t?t:"",i=this._getSegmentsFromData();i||(i=[]),i.push({Content:e}),this._setSegmentsToData(i),this._buildEditorUI()}removeSegment(t){let e=this._getLogicalIndex(t);if(e<0)return void this.log.warn(`PICT-MarkdownEditor removeSegment: segment index ${t} not found.`);let i=this._getSegmentsFromData();if(!i||i.length<=1)return void this.log.warn("PICT-MarkdownEditor removeSegment: cannot remove the last segment.");this._segmentEditors[t]&&(this._segmentEditors[t].destroy(),delete this._segmentEditors[t]),i.splice(e,1),this._setSegmentsToData(i);let n={};for(let t in this._hiddenPreviewSegments){let i=parseInt(t,10);i<e?n[i]=!0:i>e&&(n[i-1]=!0)}this._hiddenPreviewSegments=n;let o={};for(let t in this._segmentTabStates){let i=parseInt(t,10);i<e?o[i]=this._segmentTabStates[t]:i>e&&(o[i-1]=this._segmentTabStates[t])}this._segmentTabStates=o,this._buildEditorUI()}moveSegmentUp(t){let e=this._getLogicalIndex(t);if(e<=0)return;this._marshalAllEditorsToData();let i=this._getSegmentsFromData();if(!i)return;let n=i[e];i[e]=i[e-1],i[e-1]=n,this._swapHiddenPreviewState(e,e-1),this._swapSegmentTabStates(e,e-1),this._buildEditorUI()}moveSegmentDown(t){let e=this._getLogicalIndex(t),i=this._getSegmentsFromData();if(!i||e<0||e>=i.length-1)return;this._marshalAllEditorsToData();let n=i[e];i[e]=i[e+1],i[e+1]=n,this._swapHiddenPreviewState(e,e+1),this._swapSegmentTabStates(e,e+1),this._buildEditorUI()}getSegmentContent(t){let e=this._getOrderedSegmentIndices();if(t<0||t>=e.length)return"";let i=e[t],n=this._segmentEditors[i];return n?n.state.doc.toString():""}setSegmentContent(t,e){let i=this._getOrderedSegmentIndices();if(t<0||t>=i.length)return void this.log.warn(`PICT-MarkdownEditor setSegmentContent: index ${t} out of range.`);let n=i[t],o=this._segmentEditors[n];o&&o.dispatch({changes:{from:0,to:o.state.doc.length,insert:e}})}getSegmentCount(){return this._getOrderedSegmentIndices().length}getAllContent(t){let e="string"==typeof t?t:"\n\n",i=this._getOrderedSegmentIndices(),n=[];for(let t=0;t<i.length;t++){let e=this._segmentEditors[i[t]];e&&n.push(e.state.doc.toString())}return n.join(e)}_marshalAllEditorsToData(){let t=this._getSegmentsFromData();if(!t)return;let e=this._getOrderedSegmentIndices();for(let i=0;i<e.length;i++){let n=this._segmentEditors[e[i]];n&&i<t.length&&(t[i].Content=n.state.doc.toString())}}setReadOnly(t){this.options.ReadOnly=t,this.initialRenderComplete&&(this._marshalAllEditorsToData(),this._buildEditorUI())}marshalToView(){super.marshalToView(),this.initialRenderComplete&&this.options.ContentDataAddress&&this._buildEditorUI()}marshalFromView(){super.marshalFromView(),this._marshalAllEditorsToData()}destroy(){for(let t in this._segmentEditors)this._segmentEditors[t]&&this._segmentEditors[t].destroy();this._segmentEditors={};for(let t in this._richPreviewTimers)clearTimeout(this._richPreviewTimers[t]);this._richPreviewTimers={},this._richPreviewGenerations={},this._segmentTabStates={}}},e.exports.default_configuration=r},{"./Pict-MDE-CodeMirror.js":86,"./Pict-MDE-DragAndReorder.js":87,"./Pict-MDE-Formatting.js":88,"./Pict-MDE-ImageHandling.js":89,"./Pict-MDE-RichPreview.js":90,"./Pict-Section-MarkdownEditor-DefaultConfiguration.js":91,"pict-section-content":62,"pict-view":102}],93:[function(t,e,i){e.exports=class{constructor(t){this._modal=t}confirm(t,e){let i=Object.assign({},this._modal.options.DefaultConfirmOptions,e);return new Promise(e=>{let n=this._buildDialog(i.title,t,e,i);this._showDialog(n,e)})}doubleConfirm(t,e){let i=Object.assign({},this._modal.options.DefaultDoubleConfirmOptions,e);return new Promise(e=>{let n=this._buildDoubleConfirmDialog(i.title,t,e,i);this._showDialog(n,e)})}_buildDialog(t,e,i,n){let o=this._modal._nextId(),r=n.dangerous?"danger":"primary",a=document.createElement("div");a.className="pict-modal-dialog",a.id="pict-modal-"+o,a.setAttribute("role","dialog"),a.setAttribute("aria-modal","true"),a.style.width="420px",a.innerHTML='<div class="pict-modal-dialog-header"><span class="pict-modal-dialog-title">'+this._escapeHTML(t)+'</span><button class="pict-modal-dialog-close" aria-label="Close">×</button></div><div class="pict-modal-dialog-body"><p>'+this._escapeHTML(e)+'</p></div><div class="pict-modal-dialog-footer"><button class="pict-modal-btn" data-action="cancel">'+this._escapeHTML(n.cancelLabel)+'</button><button class="pict-modal-btn pict-modal-btn--'+r+'" data-action="confirm">'+this._escapeHTML(n.confirmLabel)+"</button></div>";let s=a.querySelector(".pict-modal-dialog-close"),l=a.querySelector('[data-action="cancel"]'),d=a.querySelector('[data-action="confirm"]'),c=t=>{this._dismissDialog(a,t,i)};return s.addEventListener("click",()=>{c(!1)}),l.addEventListener("click",()=>{c(!1)}),d.addEventListener("click",()=>{c(!0)}),a._dismiss=c,a._focusTarget=l,a}_buildDoubleConfirmDialog(t,e,i,n){let o=this._modal._nextId(),r="string"==typeof n.confirmPhrase&&n.confirmPhrase.length>0,a=document.createElement("div");a.className="pict-modal-dialog",a.id="pict-modal-"+o,a.setAttribute("role","dialog"),a.setAttribute("aria-modal","true"),a.style.width="420px";let s="<p>"+this._escapeHTML(e)+"</p>";if(r){let t=n.phrasePrompt.replace("{phrase}",n.confirmPhrase);s+='<div class="pict-modal-confirm-prompt">'+this._escapeHTML(t)+'</div><input type="text" class="pict-modal-confirm-input" autocomplete="off" spellcheck="false" />'}a.innerHTML='<div class="pict-modal-dialog-header"><span class="pict-modal-dialog-title">'+this._escapeHTML(t)+'</span><button class="pict-modal-dialog-close" aria-label="Close">×</button></div><div class="pict-modal-dialog-body">'+s+'</div><div class="pict-modal-dialog-footer"><button class="pict-modal-btn" data-action="cancel">'+this._escapeHTML(n.cancelLabel)+'</button><button class="pict-modal-btn pict-modal-btn--danger" data-action="confirm" disabled>'+this._escapeHTML(n.confirmLabel)+"</button></div>";let l=a.querySelector(".pict-modal-dialog-close"),d=a.querySelector('[data-action="cancel"]'),c=a.querySelector('[data-action="confirm"]'),p=t=>{this._dismissDialog(a,t,i)};if(l.addEventListener("click",()=>{p(!1)}),d.addEventListener("click",()=>{p(!1)}),r){let t=a.querySelector(".pict-modal-confirm-input");t.addEventListener("input",()=>{c.disabled=t.value!==n.confirmPhrase}),c.addEventListener("click",()=>{c.disabled||p(!0)}),a._focusTarget=t}else{let t=0;n.confirmLabel;c.disabled=!1,c.addEventListener("click",()=>{t++,1===t?c.textContent="Click again to confirm":p(!0)}),a._focusTarget=d}return a._dismiss=p,a}_showDialog(t,e){let i={element:t,dismiss:t._dismiss,type:"confirm"},n=null;this._modal.options.OverlayClickDismisses&&(n=()=>{t._dismiss(!1)}),this._modal._overlay.show(n),document.body.appendChild(t),this._modal._activeModals.push(i),t.offsetHeight,t.classList.add("pict-modal-visible"),t._focusTarget&&t._focusTarget.focus(),t._keyHandler=e=>{"Escape"===e.key&&t._dismiss(!1)},document.addEventListener("keydown",t._keyHandler)}_dismissDialog(t,e,i){if(!t._dismissed){if(t._dismissed=!0,t._keyHandler&&document.removeEventListener("keydown",t._keyHandler),t.classList.remove("pict-modal-visible"),this._modal._activeModals=this._modal._activeModals.filter(e=>e.element!==t),this._modal._activeModals.length>0){let t=this._modal._activeModals[this._modal._activeModals.length-1];this._modal._overlay.updateClickHandler(this._modal.options.OverlayClickDismisses?t.dismiss:null)}this._modal._overlay.hide(),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t)},220),i(e)}}_escapeHTML(t){return"string"!=typeof t?"":t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}}},{}],94:[function(t,e,i){e.exports=class{constructor(t){this._modal=t,this._element=null,this._refCount=0}show(t){this._refCount++,this._element||(this._element=document.createElement("div"),this._element.className="pict-modal-overlay",document.body.appendChild(this._element),this._element.offsetHeight,this._element.classList.add("pict-modal-visible")),t&&(this._currentClickHandler=t,this._element.onclick=t=>{t.target===this._element&&this._currentClickHandler&&this._currentClickHandler()})}updateClickHandler(t){this._currentClickHandler=t||null}hide(){if(this._refCount--,this._refCount<=0&&(this._refCount=0,this._element)){this._element.classList.remove("pict-modal-visible");let t=this._element;setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t)},220),this._element=null,this._currentClickHandler=null}}destroy(){this._refCount=0,this._element&&this._element.parentNode&&this._element.parentNode.removeChild(this._element),this._element=null,this._currentClickHandler=null}}},{}],95:[function(t,e,i){e.exports=class{constructor(t){this._modal=t,this._panels=[]}create(t,e){let i=this._modal&&this._modal.options&&this._modal.options.DefaultPanelOptions||{},n=Object.assign({},{position:"right",width:340,minWidth:200,maxWidth:600,collapsible:!0,collapsed:!1,persist:!1,persistKey:"",onResize:null,onToggle:null},i,e);if("undefined"==typeof document)return this._nullHandle();let o=document.querySelector(t);if(!o)return this._nullHandle();let r=this._modal._nextId(),a="right"===n.position,s=!1,l=n.width,d=!1;if(n.persist&&n.persistKey)try{let t=localStorage.getItem("pict-panel-"+n.persistKey);if(t){let e=JSON.parse(t);"number"==typeof e.width&&(l=e.width),"boolean"==typeof e.collapsed&&(n.collapsed=e.collapsed)}}catch(t){}o.classList.add("pict-panel"),o.classList.add(a?"pict-panel-right":"pict-panel-left"),o.style.width=l+"px","none"===o.style.display&&(o.style.display="");let c=document.createElement("div");c.className="pict-panel-edge "+(a?"pict-panel-edge-right":"pict-panel-edge-left");let p=document.createElement("div");p.className="pict-panel-resize",c.appendChild(p);let h=null;n.collapsible&&(h=document.createElement("div"),h.className="pict-panel-tab",h.title="Toggle panel",c.appendChild(h)),o.parentNode?a?o.parentNode.insertBefore(c,o):o.parentNode.insertBefore(c,o.nextSibling):o.insertBefore(c,o.firstChild);let u='<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6,3 11,8 6,13"/></svg>',m='<svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="10,3 5,8 10,13"/></svg>',g=()=>{h&&(h.innerHTML=a?s?m:u:s?u:m)},f=()=>{if(n.persist&&n.persistKey)try{localStorage.setItem("pict-panel-"+n.persistKey,JSON.stringify({width:l,collapsed:s}))}catch(t){}},v=()=>{s||d||(s=!0,o.classList.add("pict-panel-collapsed"),c.classList.add("pict-panel-edge-collapsed"),g(),f(),"function"==typeof n.onToggle&&n.onToggle(!0))},b=()=>{s&&!d&&(s=!1,c.classList.remove("pict-panel-edge-collapsed"),o.classList.remove("pict-panel-collapsed"),o.style.width=l+"px",g(),f(),"function"==typeof n.onToggle&&n.onToggle(!1))},y=()=>{s?b():v()};h&&h.addEventListener("click",t=>{t.stopPropagation(),y()});let w=t=>{if(s)return;t.preventDefault();let e=t.clientX,i=o.offsetWidth;p.classList.add("dragging"),o.style.transition="none",document.body.style.userSelect="none",document.body.style.cursor="col-resize";let r=t=>{let r=a?e-t.clientX:t.clientX-e,s=Math.max(n.minWidth,Math.min(n.maxWidth,i+r));o.style.width=s+"px"},d=t=>{document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",d),p.classList.remove("dragging"),o.style.transition="",document.body.style.userSelect="",document.body.style.cursor="",l=o.offsetWidth,f(),"function"==typeof n.onResize&&n.onResize(l)};document.addEventListener("mousemove",r),document.addEventListener("mouseup",d)};p.addEventListener("mousedown",w),g(),n.collapsed&&(s=!0,o.classList.add("pict-panel-collapsed"),c.classList.add("pict-panel-edge-collapsed"),g());let C={id:r,collapse:v,expand:b,toggle:y,setWidth:t=>{if(d)return;let e=Math.max(n.minWidth,Math.min(n.maxWidth,t));l=e,s||(o.style.width=e+"px"),f(),"function"==typeof n.onResize&&n.onResize(e)},destroy:()=>{if(d)return;d=!0,p.removeEventListener("mousedown",w),c.parentNode&&c.remove(),o.classList.remove("pict-panel","pict-panel-right","pict-panel-left","pict-panel-collapsed"),o.style.width="",o.style.transition="";let t=this._panels.indexOf(C);t>=0&&this._panels.splice(t,1)}};return this._panels.push(C),C}_nullHandle(){return{id:0,collapse:()=>{},expand:()=>{},toggle:()=>{},setWidth:()=>{},destroy:()=>{}}}destroyAll(){let t=this._panels.slice();for(let e=0;e<t.length;e++)t[e].destroy()}}},{}],96:[function(t,e,i){e.exports=class{constructor(t){this._modal=t,this._containers={}}toast(t,e){let i=Object.assign({},this._modal.options.DefaultToastOptions,e),n=this._getContainer(i.position),o=this._modal._nextId(),r=document.createElement("div");r.className="pict-modal-toast pict-modal-toast--"+i.type,r.id="pict-modal-toast-"+o;let a='<span class="pict-modal-toast-message">'+this._escapeHTML(t)+"</span>";i.dismissible&&(a+='<button class="pict-modal-toast-dismiss" aria-label="Dismiss">×</button>'),r.innerHTML=a;let s=!1,l=null,d=()=>{s||(s=!0,l&&clearTimeout(l),r.classList.remove("pict-modal-visible"),r.classList.add("pict-modal-toast-exit"),this._modal._activeToasts=this._modal._activeToasts.filter(t=>t.element!==r),setTimeout(()=>{r.parentNode&&r.parentNode.removeChild(r),this._cleanupContainer(i.position)},220))},c={dismiss:d};if(i.dismissible){let t=r.querySelector(".pict-modal-toast-dismiss");t&&t.addEventListener("click",d)}n.appendChild(r);let p={element:r,dismiss:d,handle:c};return this._modal._activeToasts.push(p),r.offsetHeight,r.classList.add("pict-modal-visible"),i.duration>0&&(l=setTimeout(d,i.duration)),c}_getContainer(t){if(this._containers[t])return this._containers[t];let e=document.createElement("div");return e.className="pict-modal-toast-container pict-modal-toast-container--"+t,document.body.appendChild(e),this._containers[t]=e,e}_cleanupContainer(t){let e=this._containers[t];e&&0===e.children.length&&(e.parentNode&&e.parentNode.removeChild(e),delete this._containers[t])}dismissAll(){let t=this._modal._activeToasts.slice();for(let e=0;e<t.length;e++)t[e].dismiss()}destroy(){this.dismissAll();let t=Object.keys(this._containers);for(let e=0;e<t.length;e++){let i=this._containers[t[e]];i&&i.parentNode&&i.parentNode.removeChild(i)}this._containers={}}_escapeHTML(t){return"string"!=typeof t?"":t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}}},{}],97:[function(t,e,i){e.exports=class{constructor(t){this._modal=t}tooltip(t,e,i){let n=Object.assign({},this._modal.options.DefaultTooltipOptions,i);return this._attachTooltip(t,e,!1,n)}richTooltip(t,e,i){let n=Object.assign({},this._modal.options.DefaultTooltipOptions,i);return this._attachTooltip(t,e,!0,n)}_attachTooltip(t,e,i,n){let o=null,r=null,a=null,s=!1,l=this._modal._nextId(),d=()=>{if(s||o)return;o=document.createElement("div"),o.className="pict-modal-tooltip pict-modal-tooltip--"+n.position,o.id="pict-modal-tooltip-"+l,o.setAttribute("role","tooltip"),o.style.maxWidth=n.maxWidth,n.interactive&&o.classList.add("pict-modal-tooltip-interactive");let r=document.createElement("div");r.className="pict-modal-tooltip-arrow";let d=document.createElement("div");i?d.innerHTML=e:d.textContent=e,o.appendChild(r),o.appendChild(d),document.body.appendChild(o),t.setAttribute("aria-describedby",o.id),this._positionTooltip(o,t,n.position),o.offsetHeight,o.classList.add("pict-modal-visible"),this._modal._activeTooltips.push({element:o,targetElement:t,destroy:g}),n.interactive&&o&&(o.addEventListener("mouseenter",()=>{a&&(clearTimeout(a),a=null)}),o.addEventListener("mouseleave",()=>{c()}))},c=()=>{if(!o)return;o.classList.remove("pict-modal-visible");let e=o;o=null,t.removeAttribute("aria-describedby"),this._modal._activeTooltips=this._modal._activeTooltips.filter(t=>t.element!==e),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e)},220)},p=()=>{a&&(clearTimeout(a),a=null),r=setTimeout(d,n.delay)},h=()=>{r&&(clearTimeout(r),r=null),n.interactive?a=setTimeout(c,100):c()},u=()=>{r=setTimeout(d,n.delay)},m=()=>{r&&(clearTimeout(r),r=null),c()};t.addEventListener("mouseenter",p),t.addEventListener("mouseleave",h),t.addEventListener("focusin",u),t.addEventListener("focusout",m);let g=()=>{s||(s=!0,r&&clearTimeout(r),a&&clearTimeout(a),c(),t.removeEventListener("mouseenter",p),t.removeEventListener("mouseleave",h),t.removeEventListener("focusin",u),t.removeEventListener("focusout",m))};return{destroy:g}}_positionTooltip(t,e,i){let n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=i;"top"===r&&n.top<o.height+8?r="bottom":"bottom"===r&&window.innerHeight-n.bottom<o.height+8?r="top":"left"===r&&n.left<o.width+8?r="right":"right"===r&&window.innerWidth-n.right<o.width+8&&(r="left"),t.className=t.className.replace(/pict-modal-tooltip--\w+/,"pict-modal-tooltip--"+r);let a=0,s=0;switch(r){case"top":a=n.top-o.height-8,s=n.left+n.width/2-o.width/2;break;case"bottom":a=n.bottom+8,s=n.left+n.width/2-o.width/2;break;case"left":a=n.top+n.height/2-o.height/2,s=n.left-o.width-8;break;case"right":a=n.top+n.height/2-o.height/2,s=n.right+8}s=Math.max(4,Math.min(s,window.innerWidth-o.width-4)),a=Math.max(4,Math.min(a,window.innerHeight-o.height-4)),t.style.top=a+"px",t.style.left=s+"px"}dismissAll(){let t=this._modal._activeTooltips.slice();for(let e=0;e<t.length;e++)t[e].destroy()}}},{}],98:[function(t,e,i){e.exports=class{constructor(t){this._modal=t}show(t){let e=Object.assign({},this._modal.options.DefaultModalOptions,t);return new Promise(t=>{let i=this._buildDialog(e,t);this._showDialog(i,e,t)})}_buildDialog(t,e){let i=this._modal._nextId(),n=document.createElement("div");n.className="pict-modal-dialog",n.id="pict-modal-"+i,n.setAttribute("role","dialog"),n.setAttribute("aria-modal","true"),n.style.width=t.width;let o="";(t.title||t.closeable)&&(o='<div class="pict-modal-dialog-header">',o+='<span class="pict-modal-dialog-title">'+this._escapeHTML(t.title)+"</span>",t.closeable&&(o+='<button class="pict-modal-dialog-close" aria-label="Close">×</button>'),o+="</div>");let r='<div class="pict-modal-dialog-body">'+(t.content||"")+"</div>",a="";if(t.buttons&&t.buttons.length>0){a='<div class="pict-modal-dialog-footer">';for(let e=0;e<t.buttons.length;e++){let i=t.buttons[e],n="pict-modal-btn";i.Style&&(n+=" pict-modal-btn--"+i.Style),a+='<button class="'+n+'" data-hash="'+this._escapeHTML(i.Hash)+'">'+this._escapeHTML(i.Label)+"</button>"}a+="</div>"}n.innerHTML=o+r+a;let s=i=>{this._dismissDialog(n,i,e,t)};if(t.closeable){let t=n.querySelector(".pict-modal-dialog-close");t&&t.addEventListener("click",()=>{s(null)})}let l=n.querySelectorAll("[data-hash]");for(let t=0;t<l.length;t++){let e=l[t];e.addEventListener("click",()=>{s(e.getAttribute("data-hash"))})}return n._dismiss=s,n}_showDialog(t,e,i){let n={element:t,dismiss:t._dismiss,type:"window"},o=null;this._modal.options.OverlayClickDismisses&&e.closeable&&(o=()=>{t._dismiss(null)}),this._modal._overlay.show(o),document.body.appendChild(t),this._modal._activeModals.push(n),t.offsetHeight,t.classList.add("pict-modal-visible");let r=t.querySelector(".pict-modal-btn")||t.querySelector(".pict-modal-dialog-close");r&&r.focus(),t._keyHandler=i=>{"Escape"===i.key&&e.closeable&&t._dismiss(null)},document.addEventListener("keydown",t._keyHandler),"function"==typeof e.onOpen&&e.onOpen(t)}_dismissDialog(t,e,i,n){if(!t._dismissed){if(t._dismissed=!0,t._keyHandler&&document.removeEventListener("keydown",t._keyHandler),t.classList.remove("pict-modal-visible"),this._modal._activeModals=this._modal._activeModals.filter(e=>e.element!==t),this._modal._activeModals.length>0){let t=this._modal._activeModals[this._modal._activeModals.length-1];this._modal._overlay.updateClickHandler(this._modal.options.OverlayClickDismisses?t.dismiss:null)}this._modal._overlay.hide(),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t)},220),"function"==typeof n.onClose&&n.onClose(e),i(e)}}_escapeHTML(t){return"string"!=typeof t?"":t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}}},{}],99:[function(t,e,i){e.exports={AutoInitialize:!0,AutoRender:!1,AutoSolveWithApp:!1,ViewIdentifier:"Pict-Section-Modal",OverlayClickDismisses:!0,DefaultConfirmOptions:{title:"Confirm",confirmLabel:"OK",cancelLabel:"Cancel",dangerous:!1},DefaultDoubleConfirmOptions:{title:"Are you sure?",confirmLabel:"Confirm",cancelLabel:"Cancel",phrasePrompt:'Type "{phrase}" to confirm:',confirmPhrase:""},DefaultModalOptions:{title:"",content:"",buttons:[],closeable:!0,width:"480px"},DefaultTooltipOptions:{position:"top",delay:200,maxWidth:"300px",interactive:!1},DefaultToastOptions:{type:"info",duration:3e3,position:"top-right",dismissible:!0},DefaultPanelOptions:{position:"right",width:340,minWidth:200,maxWidth:600,collapsible:!0,collapsed:!1,persist:!1,persistKey:""},Templates:[],Renderables:[],CSS:"\n/* pict-section-modal */\n.pict-modal-root\n{\n\t/* Overlay */\n\t--pict-modal-overlay-bg: rgba(0, 0, 0, 0.5);\n\n\t/* Dialog */\n\t--pict-modal-bg: #ffffff;\n\t--pict-modal-fg: #1a1a1a;\n\t--pict-modal-border: #e0e0e0;\n\t--pict-modal-border-radius: 8px;\n\t--pict-modal-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);\n\t--pict-modal-header-bg: #f5f5f5;\n\t--pict-modal-header-fg: #1a1a1a;\n\t--pict-modal-header-border: #e0e0e0;\n\n\t/* Buttons */\n\t--pict-modal-btn-bg: #e0e0e0;\n\t--pict-modal-btn-fg: #1a1a1a;\n\t--pict-modal-btn-hover-bg: #d0d0d0;\n\t--pict-modal-btn-primary-bg: #2563eb;\n\t--pict-modal-btn-primary-fg: #ffffff;\n\t--pict-modal-btn-primary-hover-bg: #1d4ed8;\n\t--pict-modal-btn-danger-bg: #dc2626;\n\t--pict-modal-btn-danger-fg: #ffffff;\n\t--pict-modal-btn-danger-hover-bg: #b91c1c;\n\t--pict-modal-btn-border-radius: 4px;\n\n\t/* Toast */\n\t--pict-modal-toast-bg: #333333;\n\t--pict-modal-toast-fg: #ffffff;\n\t--pict-modal-toast-success-bg: #16a34a;\n\t--pict-modal-toast-warning-bg: #d97706;\n\t--pict-modal-toast-error-bg: #dc2626;\n\t--pict-modal-toast-info-bg: #2563eb;\n\t--pict-modal-toast-border-radius: 6px;\n\t--pict-modal-toast-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);\n\n\t/* Tooltip */\n\t--pict-modal-tooltip-bg: #1a1a1a;\n\t--pict-modal-tooltip-fg: #ffffff;\n\t--pict-modal-tooltip-border-radius: 4px;\n\t--pict-modal-tooltip-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n\n\t/* Typography */\n\t--pict-modal-font-family: system-ui, -apple-system, sans-serif;\n\t--pict-modal-font-size: 14px;\n\t--pict-modal-title-font-size: 16px;\n\n\t/* Animation */\n\t--pict-modal-transition-duration: 200ms;\n}\n\n/* Overlay */\n.pict-modal-overlay\n{\n\tposition: fixed;\n\ttop: 0;\n\tleft: 0;\n\twidth: 100%;\n\theight: 100%;\n\tz-index: 1000;\n\tbackground: var(--pict-modal-overlay-bg);\n\topacity: 0;\n\ttransition: opacity var(--pict-modal-transition-duration) ease;\n}\n\n.pict-modal-overlay.pict-modal-visible\n{\n\topacity: 1;\n}\n\n/* Dialog */\n.pict-modal-dialog\n{\n\tposition: fixed;\n\tz-index: 1010;\n\ttop: 50%;\n\tleft: 50%;\n\ttransform: translate(-50%, -50%) translateY(-20px);\n\topacity: 0;\n\ttransition: opacity var(--pict-modal-transition-duration) ease,\n\t transform var(--pict-modal-transition-duration) ease;\n\n\tmax-width: 90vw;\n\tmax-height: 90vh;\n\tdisplay: flex;\n\tflex-direction: column;\n\n\tbackground: var(--pict-modal-bg);\n\tcolor: var(--pict-modal-fg);\n\tborder: 1px solid var(--pict-modal-border);\n\tborder-radius: var(--pict-modal-border-radius);\n\tbox-shadow: var(--pict-modal-shadow);\n\tfont-family: var(--pict-modal-font-family);\n\tfont-size: var(--pict-modal-font-size);\n}\n\n.pict-modal-dialog.pict-modal-visible\n{\n\topacity: 1;\n\ttransform: translate(-50%, -50%) translateY(0);\n}\n\n.pict-modal-dialog-header\n{\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\tpadding: 12px 16px;\n\tbackground: var(--pict-modal-header-bg);\n\tcolor: var(--pict-modal-header-fg);\n\tborder-bottom: 1px solid var(--pict-modal-header-border);\n\tborder-radius: var(--pict-modal-border-radius) var(--pict-modal-border-radius) 0 0;\n}\n\n.pict-modal-dialog-title\n{\n\tfont-size: var(--pict-modal-title-font-size);\n\tfont-weight: 600;\n}\n\n.pict-modal-dialog-close\n{\n\tbackground: none;\n\tborder: none;\n\tfont-size: 20px;\n\tcursor: pointer;\n\tcolor: var(--pict-modal-fg);\n\tpadding: 0 4px;\n\tline-height: 1;\n\topacity: 0.6;\n}\n\n.pict-modal-dialog-close:hover\n{\n\topacity: 1;\n}\n\n.pict-modal-dialog-body\n{\n\tpadding: 16px;\n\toverflow-y: auto;\n\tflex: 1;\n}\n\n.pict-modal-dialog-footer\n{\n\tdisplay: flex;\n\tjustify-content: flex-end;\n\tgap: 8px;\n\tpadding: 12px 16px;\n\tborder-top: 1px solid var(--pict-modal-border);\n}\n\n/* Buttons */\n.pict-modal-btn\n{\n\tpadding: 8px 16px;\n\tborder: none;\n\tborder-radius: var(--pict-modal-btn-border-radius);\n\tfont-family: var(--pict-modal-font-family);\n\tfont-size: var(--pict-modal-font-size);\n\tcursor: pointer;\n\tbackground: var(--pict-modal-btn-bg);\n\tcolor: var(--pict-modal-btn-fg);\n\ttransition: background var(--pict-modal-transition-duration) ease;\n}\n\n.pict-modal-btn:hover\n{\n\tbackground: var(--pict-modal-btn-hover-bg);\n}\n\n.pict-modal-btn:disabled\n{\n\topacity: 0.5;\n\tcursor: not-allowed;\n}\n\n.pict-modal-btn--primary\n{\n\tbackground: var(--pict-modal-btn-primary-bg);\n\tcolor: var(--pict-modal-btn-primary-fg);\n}\n\n.pict-modal-btn--primary:hover\n{\n\tbackground: var(--pict-modal-btn-primary-hover-bg);\n}\n\n.pict-modal-btn--danger\n{\n\tbackground: var(--pict-modal-btn-danger-bg);\n\tcolor: var(--pict-modal-btn-danger-fg);\n}\n\n.pict-modal-btn--danger:hover\n{\n\tbackground: var(--pict-modal-btn-danger-hover-bg);\n}\n\n/* Double confirm input */\n.pict-modal-confirm-input\n{\n\twidth: 100%;\n\tpadding: 8px 12px;\n\tmargin-top: 12px;\n\tborder: 1px solid var(--pict-modal-border);\n\tborder-radius: var(--pict-modal-btn-border-radius);\n\tfont-family: var(--pict-modal-font-family);\n\tfont-size: var(--pict-modal-font-size);\n\tbox-sizing: border-box;\n}\n\n.pict-modal-confirm-input:focus\n{\n\toutline: 2px solid var(--pict-modal-btn-primary-bg);\n\toutline-offset: -1px;\n}\n\n.pict-modal-confirm-prompt\n{\n\tmargin-top: 12px;\n\tfont-size: 13px;\n\tcolor: var(--pict-modal-fg);\n\topacity: 0.7;\n}\n\n/* Toast container */\n.pict-modal-toast-container\n{\n\tposition: fixed;\n\tz-index: 1030;\n\tdisplay: flex;\n\tflex-direction: column;\n\tgap: 8px;\n\tpointer-events: none;\n\tmax-width: 400px;\n}\n\n.pict-modal-toast-container--top-right\n{\n\ttop: 16px;\n\tright: 16px;\n}\n\n.pict-modal-toast-container--top-left\n{\n\ttop: 16px;\n\tleft: 16px;\n}\n\n.pict-modal-toast-container--bottom-right\n{\n\tbottom: 16px;\n\tright: 16px;\n}\n\n.pict-modal-toast-container--bottom-left\n{\n\tbottom: 16px;\n\tleft: 16px;\n}\n\n.pict-modal-toast-container--top-center\n{\n\ttop: 16px;\n\tleft: 50%;\n\ttransform: translateX(-50%);\n}\n\n.pict-modal-toast-container--bottom-center\n{\n\tbottom: 16px;\n\tleft: 50%;\n\ttransform: translateX(-50%);\n}\n\n/* Toast */\n.pict-modal-toast\n{\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 10px;\n\tpadding: 12px 16px;\n\tborder-radius: var(--pict-modal-toast-border-radius);\n\tbox-shadow: var(--pict-modal-toast-shadow);\n\tfont-family: var(--pict-modal-font-family);\n\tfont-size: var(--pict-modal-font-size);\n\tbackground: var(--pict-modal-toast-bg);\n\tcolor: var(--pict-modal-toast-fg);\n\tpointer-events: auto;\n\topacity: 0;\n\ttransform: translateX(100%);\n\ttransition: opacity var(--pict-modal-transition-duration) ease,\n\t transform var(--pict-modal-transition-duration) ease;\n}\n\n.pict-modal-toast.pict-modal-visible\n{\n\topacity: 1;\n\ttransform: translateX(0);\n}\n\n.pict-modal-toast.pict-modal-toast-exit\n{\n\topacity: 0;\n\ttransform: translateX(100%);\n}\n\n.pict-modal-toast--info\n{\n\tbackground: var(--pict-modal-toast-info-bg);\n}\n\n.pict-modal-toast--success\n{\n\tbackground: var(--pict-modal-toast-success-bg);\n}\n\n.pict-modal-toast--warning\n{\n\tbackground: var(--pict-modal-toast-warning-bg);\n}\n\n.pict-modal-toast--error\n{\n\tbackground: var(--pict-modal-toast-error-bg);\n}\n\n.pict-modal-toast-message\n{\n\tflex: 1;\n}\n\n.pict-modal-toast-dismiss\n{\n\tbackground: none;\n\tborder: none;\n\tcolor: inherit;\n\tfont-size: 18px;\n\tcursor: pointer;\n\tpadding: 0 2px;\n\tline-height: 1;\n\topacity: 0.7;\n}\n\n.pict-modal-toast-dismiss:hover\n{\n\topacity: 1;\n}\n\n/* Tooltip */\n.pict-modal-tooltip\n{\n\tposition: fixed;\n\tz-index: 1020;\n\tpadding: 6px 10px;\n\tborder-radius: var(--pict-modal-tooltip-border-radius);\n\tbox-shadow: var(--pict-modal-tooltip-shadow);\n\tbackground: var(--pict-modal-tooltip-bg);\n\tcolor: var(--pict-modal-tooltip-fg);\n\tfont-family: var(--pict-modal-font-family);\n\tfont-size: 13px;\n\tpointer-events: none;\n\topacity: 0;\n\ttransition: opacity var(--pict-modal-transition-duration) ease;\n\twhite-space: normal;\n\tword-wrap: break-word;\n}\n\n.pict-modal-tooltip.pict-modal-tooltip-interactive\n{\n\tpointer-events: auto;\n}\n\n.pict-modal-tooltip.pict-modal-visible\n{\n\topacity: 1;\n}\n\n.pict-modal-tooltip-arrow\n{\n\tposition: absolute;\n\twidth: 8px;\n\theight: 8px;\n\tbackground: var(--pict-modal-tooltip-bg);\n\ttransform: rotate(45deg);\n}\n\n.pict-modal-tooltip--top .pict-modal-tooltip-arrow\n{\n\tbottom: -4px;\n\tleft: 50%;\n\tmargin-left: -4px;\n}\n\n.pict-modal-tooltip--bottom .pict-modal-tooltip-arrow\n{\n\ttop: -4px;\n\tleft: 50%;\n\tmargin-left: -4px;\n}\n\n.pict-modal-tooltip--left .pict-modal-tooltip-arrow\n{\n\tright: -4px;\n\ttop: 50%;\n\tmargin-top: -4px;\n}\n\n.pict-modal-tooltip--right .pict-modal-tooltip-arrow\n{\n\tleft: -4px;\n\ttop: 50%;\n\tmargin-top: -4px;\n}\n\n/* ── Resizable / Collapsible Panels ──────────────── */\n.pict-panel\n{\n\tposition: relative;\n\ttransition: width 0.2s ease;\n\tflex-shrink: 0;\n\toverflow: visible;\n}\n.pict-panel-collapsed\n{\n\twidth: 0 !important;\n\tmin-width: 0 !important;\n\toverflow: visible;\n}\n.pict-panel-collapsed > *:not(.pict-panel-edge)\n{\n\tdisplay: none;\n}\n\n/* Edge container — zero-width flex sibling of the panel.\n Sits next to the panel in the flex layout; children\n use absolute positioning to overlap the panel boundary. */\n.pict-panel-edge\n{\n\tposition: relative;\n\twidth: 0;\n\tflex-shrink: 0;\n\tz-index: 50;\n\toverflow: visible;\n}\n\n/* Resize handle — thin strip on the panel boundary */\n.pict-panel-resize\n{\n\tposition: absolute;\n\ttop: 0;\n\tbottom: 0;\n\twidth: 4px;\n\tcursor: col-resize;\n\tbackground: transparent;\n\ttransition: background 0.15s, width 0.15s;\n}\n.pict-panel-edge-right .pict-panel-resize\n{\n\tright: 0;\n\tborder-right: 1px solid var(--pict-panel-border, #DDD6CA);\n}\n.pict-panel-edge-left .pict-panel-resize\n{\n\tleft: 0;\n\tborder-left: 1px solid var(--pict-panel-border, #DDD6CA);\n}\n.pict-panel-resize:hover,\n.pict-panel-edge:hover .pict-panel-resize\n{\n\twidth: 5px;\n\tbackground: var(--pict-panel-accent, #2E7D74);\n\topacity: 0.5;\n}\n.pict-panel-resize.dragging\n{\n\twidth: 5px;\n\tbackground: var(--pict-panel-accent, #2E7D74);\n\topacity: 1;\n\ttransition: none;\n}\n.pict-panel-edge-collapsed .pict-panel-resize\n{\n\tdisplay: none;\n}\n\n/* Collapse tab — tucked sliver at rest, slides out on hover */\n.pict-panel-tab\n{\n\tposition: absolute;\n\ttop: 8px;\n\twidth: 8px;\n\theight: 24px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\toverflow: hidden;\n\tbackground: var(--pict-panel-border, #DDD6CA);\n\tborder: 1px solid var(--pict-panel-border, #DDD6CA);\n\tcursor: pointer;\n\tcolor: var(--pict-panel-fg, #8A7F72);\n\tfont-size: 10px;\n\tline-height: 1;\n\topacity: 0.5;\n\ttransition: opacity 0.25s, width 0.2s ease, height 0.2s ease, left 0.2s ease, right 0.2s ease, background 0.2s;\n\tz-index: 51;\n}\n.pict-panel-edge:hover .pict-panel-tab,\n.pict-panel-tab:hover\n{\n\twidth: 20px;\n\theight: 32px;\n\topacity: 1;\n\toverflow: visible;\n\tbackground: var(--pict-panel-bg, #FAF8F4);\n}\n/* Right panel: tab to the left of the edge */\n.pict-panel-edge-right .pict-panel-tab\n{\n\tright: 0;\n\tborder-right: none;\n\tborder-radius: 4px 0 0 4px;\n}\n.pict-panel-edge-right:hover .pict-panel-tab,\n.pict-panel-edge-right .pict-panel-tab:hover\n{\n\tright: 0;\n}\n/* Left panel: tab to the right of the edge */\n.pict-panel-edge-left .pict-panel-tab\n{\n\tleft: 0;\n\tborder-left: none;\n\tborder-radius: 0 4px 4px 0;\n}\n.pict-panel-edge-left:hover .pict-panel-tab,\n.pict-panel-edge-left .pict-panel-tab:hover\n{\n\tleft: 0;\n}\n/* When collapsed — more visible */\n.pict-panel-edge-collapsed .pict-panel-tab\n{\n\twidth: 10px;\n\theight: 28px;\n\topacity: 0.6;\n}\n.pict-panel-edge-collapsed .pict-panel-tab:hover,\n.pict-panel-edge-collapsed:hover .pict-panel-tab\n{\n\twidth: 20px;\n\theight: 32px;\n\topacity: 1;\n\toverflow: visible;\n\tbackground: var(--pict-panel-bg, #FAF8F4);\n}\n"}},{}],100:[function(t,e,i){const n=t("pict-view"),o=t("./Pict-Modal-Overlay.js"),r=t("./Pict-Modal-Confirm.js"),a=t("./Pict-Modal-Window.js"),s=t("./Pict-Modal-Toast.js"),l=t("./Pict-Modal-Tooltip.js"),d=t("./Pict-Modal-Panel.js"),c=t("./Pict-Section-Modal-DefaultConfiguration.js");e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},c,e),i),this._activeModals=[],this._activeTooltips=[],this._activeToasts=[],this._idCounter=0,this._overlay=new o(this),this._confirm=new r(this),this._window=new a(this),this._toast=new s(this),this._tooltip=new l(this),this._panel=new d(this)}onBeforeInitialize(){return super.onBeforeInitialize(),"undefined"!=typeof document&&document.body&&(document.body.classList.contains("pict-modal-root")||document.body.classList.add("pict-modal-root")),super.onBeforeInitialize()}_nextId(){return this._idCounter++,this._idCounter}confirm(t,e){return this._confirm.confirm(t,e)}doubleConfirm(t,e){return this._confirm.doubleConfirm(t,e)}show(t){return this._window.show(t)}tooltip(t,e,i){return this._tooltip.tooltip(t,e,i)}richTooltip(t,e,i){return this._tooltip.richTooltip(t,e,i)}toast(t,e){return this._toast.toast(t,e)}panel(t,e){return this._panel.create(t,e)}dismissModals(){let t=this._activeModals.slice();for(let e=t.length-1;e>=0;e--)t[e].dismiss(null)}dismissTooltips(){this._tooltip.dismissAll()}dismissToasts(){this._toast.dismissAll()}dismissAll(){this.dismissModals(),this.dismissTooltips(),this.dismissToasts()}destroyPanels(){this._panel.destroyAll()}destroy(){if(this.dismissAll(),this.destroyPanels(),this._overlay.destroy(),this._toast.destroy(),"function"==typeof super.destroy)return super.destroy()}},e.exports.default_configuration=c},{"./Pict-Modal-Confirm.js":93,"./Pict-Modal-Overlay.js":94,"./Pict-Modal-Panel.js":95,"./Pict-Modal-Toast.js":96,"./Pict-Modal-Tooltip.js":97,"./Pict-Modal-Window.js":98,"./Pict-Section-Modal-DefaultConfiguration.js":99,"pict-view":102}],101:[function(t,e,i){e.exports={name:"pict-view",version:"1.0.68",description:"Pict View Base Class",main:"source/Pict-View.js",scripts:{test:"npx quack test",tests:"npx quack test -g",start:"node source/Pict-View.js",coverage:"npx quack coverage",build:"npx quack build","docker-dev-build":"docker build ./ -f Dockerfile_LUXURYCode -t pict-view-image:local","docker-dev-run":'docker run -it -d --name pict-view-dev -p 30001:8080 -p 38086:8086 -v "$PWD/.config:/home/coder/.config" -v "$PWD:/home/coder/pict-view" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" pict-view-image:local',"docker-dev-shell":"docker exec -it pict-view-dev /bin/bash",types:"tsc -p .",lint:"eslint source/**"},types:"types/source/Pict-View.d.ts",repository:{type:"git",url:"git+https://github.com/stevenvelozo/pict-view.git"},author:"steven velozo <steven@velozo.com>",license:"MIT",bugs:{url:"https://github.com/stevenvelozo/pict-view/issues"},homepage:"https://github.com/stevenvelozo/pict-view#readme",devDependencies:{"@eslint/js":"^9.39.1","browser-env":"^3.3.0",eslint:"^9.39.1",pict:"^1.0.363",quackage:"^1.0.65",typescript:"^5.9.3"},mocha:{diff:!0,extension:["js"],package:"./package.json",reporter:"spec",slow:"75",timeout:"5000",ui:"tdd","watch-files":["source/**/*.js","test/**/*.js"],"watch-ignore":["lib/vendor"]},dependencies:{fable:"^3.1.67","fable-serviceproviderbase":"^3.0.19"}}},{}],102:[function(t,e,i){const n=t("fable-serviceproviderbase"),o=t("../package.json"),r={DefaultRenderable:!1,DefaultDestinationAddress:!1,DefaultTemplateRecordAddress:!1,ViewIdentifier:!1,AutoInitialize:!0,AutoInitializeOrdinal:0,AutoRender:!0,AutoRenderOrdinal:0,AutoSolveWithApp:!0,AutoSolveOrdinal:0,CSSHash:!1,CSS:!1,CSSProvider:!1,CSSPriority:500,Templates:[],DefaultTemplates:[],Renderables:[],Manifests:{}};e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},JSON.parse(JSON.stringify(r)),e),i),this.fable,this.options,this.UUID,this.Hash,this.log;const n=this.Hash===this.UUID;this.UUID=`V-${this.UUID}`,n&&(this.Hash=this.UUID),this.options.ViewIdentifier||(this.options.ViewIdentifier=`AutoViewID-${this.fable.getUUID()}`),this.serviceType="PictView",this._Package=o,this.pict=this.fable,this.AppData=this.pict.AppData,this.Bundle=this.pict.Bundle,this.initializeTimestamp=!1,this.lastSolvedTimestamp=!1,this.lastRenderedTimestamp=!1,this.lastMarshalFromViewTimestamp=!1,this.lastMarshalToViewTimestamp=!1,this.pict.instantiateServiceProviderIfNotExists("TransactionTracking");for(let t=0;t<this.options.Templates.length;t++){let e=this.options.Templates[t];"Hash"in e&&"Template"in e?(e.Source||(e.Source=`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} options object.`),this.pict.TemplateProvider.addTemplate(e.Hash,e.Template,e.Source)):this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not load Template ${t} in the options array.`,e)}for(let t=0;t<this.options.DefaultTemplates.length;t++){let e=this.options.DefaultTemplates[t];"Postfix"in e&&"Template"in e?(e.Source||(e.Source=`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} options object.`),this.pict.TemplateProvider.addDefaultTemplate(e.Prefix,e.Postfix,e.Template,e.Source)):this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not load Default Template ${t} in the options array.`,e)}if(this.options.CSS){let t=this.options.CSSHash?this.options.CSSHash:`View-${this.options.ViewIdentifier}`,e=this.options.CSSProvider?this.options.CSSProvider:t;this.pict.CSSMap.addCSS(t,this.options.CSS,e,this.options.CSSPriority)}this.renderables={};for(let t=0;t<this.options.Renderables.length;t++){let e=this.options.Renderables[t];this.addRenderable(e)}}addRenderable(t,e,i,n,o){let r;if("object"==typeof t)r=t;else{r={RenderableHash:t,TemplateHash:e,DefaultTemplateRecordAddress:i,ContentDestinationAddress:n,RenderMethod:"string"!=typeof o?o:"replace"}}"string"!=typeof r.RenderableHash||"string"!=typeof r.TemplateHash?this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not load Renderable; RenderableHash or TemplateHash are invalid.`,r):(this.pict.LogNoisiness>0&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} adding renderable [${r.RenderableHash}] pointed to template ${r.TemplateHash}.`),this.renderables[r.RenderableHash]=r)}onBeforeInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeInitialize:`),!0}onBeforeInitializeAsync(t){return this.onBeforeInitialize(),t()}onInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onInitialize:`),!0}onInitializeAsync(t){return this.onInitialize(),t()}initialize(){return this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow VIEW [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initialize:`),this.initializeTimestamp?(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initialize called but initialization is already completed. Aborting.`),!1):(this.onBeforeInitialize(),this.onInitialize(),this.onAfterInitialize(),this.initializeTimestamp=this.pict.log.getTimeStamp(),!0)}initializeAsync(t){if(this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow VIEW [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initializeAsync:`),this.initializeTimestamp)return this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} async initialize called but initialization is already completed. Aborting.`),t();{let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate");this.pict.LogNoisiness>0&&this.log.info(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} beginning initialization...`),e.anticipate(this.onBeforeInitializeAsync.bind(this)),e.anticipate(this.onInitializeAsync.bind(this)),e.anticipate(this.onAfterInitializeAsync.bind(this)),e.wait(e=>(e&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initialization failed: ${e.message||e}`,{stack:e.stack}),this.initializeTimestamp=this.pict.log.getTimeStamp(),this.pict.LogNoisiness>0&&this.log.info(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} initialization complete.`),t()))}}onAfterInitialize(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterInitialize:`),!0}onAfterInitializeAsync(t){return this.onAfterInitialize(),t()}onBeforeRender(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeRender:`),!0}onBeforeRenderAsync(t,e){return this.onBeforeRender(e),t()}onBeforeProject(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeProject:`),!0}onBeforeProjectAsync(t,e){return this.onBeforeProject(e),t()}buildRenderOptions(t,e,i){let n={Valid:!0};return n.RenderableHash="string"==typeof t?t:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable,n.RenderableHash||(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not find a suitable RenderableHash ${n.RenderableHash} (param ${t}because it is not a valid renderable.`),n.Valid=!1),n.Renderable=this.renderables[n.RenderableHash],n.Renderable||(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${n.RenderableHash} (param ${t}) because it does not exist.`),n.Valid=!1),n.DestinationAddress="string"==typeof e?e:"string"==typeof n.Renderable.ContentDestinationAddress?n.Renderable.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress&&this.options.DefaultDestinationAddress,n.DestinationAddress||(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${n.RenderableHash} (param ${t}) because it does not have a valid destination address (param ${e}).`),n.Valid=!1),"object"==typeof i?(n.RecordAddress="Passed in as object",n.Record=i):(n.RecordAddress="string"==typeof i?i:"string"==typeof n.Renderable.DefaultTemplateRecordAddress?n.Renderable.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,n.Record="string"==typeof n.RecordAddress?this.pict.DataProvider.getDataByAddress(n.RecordAddress):void 0),n}assignRenderContent(t,e,i){return this.pict.ContentAssignment.projectContent(t.RenderMethod,e,i,t.TestAddress)}render(t,e,i,n){return this.renderWithScope(this,t,e,i,n)}renderWithScope(t,e,i,n,o){let r,a,s,l="string"==typeof e?e:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable;return l?("__Virtual"==l?r={RenderableHash:"__Virtual",TemplateHash:this.renderables[this.options.DefaultRenderable].TemplateHash,ContentDestinationAddress:"string"==typeof i?i:"string"==typeof r.ContentDestinationAddress?r.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null,RenderMethod:"virtual-assignment",TransactionHash:o&&o.TransactionHash,RootRenderableViewHash:o&&o.RootRenderableViewHash}:(r=Object.assign({},this.renderables[l]),r.ContentDestinationAddress="string"==typeof i?i:"string"==typeof r.ContentDestinationAddress?r.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null),r.TransactionHash||(r.TransactionHash=`ViewRender-V-${this.options.ViewIdentifier}-R-${l}-U-${this.pict.getUUID()}`,r.RootRenderableViewHash=this.Hash,this.pict.TransactionTracking.registerTransaction(r.TransactionHash)),r?r.ContentDestinationAddress?("object"==typeof n?(s=n,a="Passed in as object"):(a="string"==typeof n?n:"string"==typeof r.DefaultTemplateRecordAddress?r.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,s="string"==typeof a?this.pict.DataProvider.getDataByAddress(a):void 0),this.onBeforeRender(r),this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow VIEW [${this.UUID}]::[${this.Hash}] Renderable[${l}] Destination[${r.ContentDestinationAddress}] TemplateRecordAddress[${a}] render:`),this.pict.LogNoisiness>0&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} Beginning Render of Renderable[${l}] to Destination [${r.ContentDestinationAddress}]...`),r.Content=this.pict.parseTemplateByHash(r.TemplateHash,s,null,[this],t,{RootRenderable:"object"==typeof o?o:r}),this.pict.LogNoisiness>0&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} Assigning Renderable[${l}] content length ${r.Content.length} to Destination [${r.ContentDestinationAddress}] using render method [${r.RenderMethod}].`),this.onBeforeProject(r),this.onProject(r),"virtual-assignment"!==r.RenderMethod&&(this.onAfterProject(r),this.onAfterRender(r)),!0):(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${l} (param ${e}) because it does not have a valid destination address.`),!1):(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${l} (param ${e}) because it does not exist.`),!1)):(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${l} (param ${e}) because it is not a valid renderable.`),!1)}renderAsync(t,e,i,n,o){return this.renderWithScopeAsync(this,t,e,i,n,o)}renderWithScopeAsync(t,e,i,n,o,r){let a,s,l,d="string"==typeof e?e:"string"==typeof this.options.DefaultRenderable&&this.options.DefaultRenderable,c="function"==typeof r?r:"function"==typeof n?n:"function"==typeof i?i:"function"==typeof e?e:"function"==typeof o?o:null;if(c||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),c=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} renderAsync Auto Callback Error: ${t}`,t)}),!d)return this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not asynchronously render ${d} (param ${e}because it is not a valid renderable.`),c(new Error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not asynchronously render ${d} (param ${e}because it is not a valid renderable.`));if("__Virtual"==d?a={RenderableHash:"__Virtual",TemplateHash:this.renderables[this.options.DefaultRenderable].TemplateHash,ContentDestinationAddress:"string"==typeof i?i:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null,RenderMethod:"virtual-assignment",TransactionHash:o&&"function"!=typeof o&&o.TransactionHash,RootRenderableViewHash:o&&"function"!=typeof o&&o.RootRenderableViewHash}:(a=Object.assign({},this.renderables[d]),a.ContentDestinationAddress="string"==typeof i?i:"string"==typeof a.ContentDestinationAddress?a.ContentDestinationAddress:"string"==typeof this.options.DefaultDestinationAddress?this.options.DefaultDestinationAddress:null),a.TransactionHash||(a.TransactionHash=`ViewRender-V-${this.options.ViewIdentifier}-R-${d}-U-${this.pict.getUUID()}`,a.RootRenderableViewHash=this.Hash,this.pict.TransactionTracking.registerTransaction(a.TransactionHash)),!a)return this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${d} (param ${e}) because it does not exist.`),c(new Error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${d} (param ${e}) because it does not exist.`));if(!a.ContentDestinationAddress)return this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render ${d} (param ${e}) because it does not have a valid destination address.`),c(new Error(`Could not render ${d}`));"object"==typeof n?(l=n,s="Passed in as object"):(s="string"==typeof n?n:"string"==typeof a.DefaultTemplateRecordAddress?a.DefaultTemplateRecordAddress:"string"==typeof this.options.DefaultTemplateRecordAddress&&this.options.DefaultTemplateRecordAddress,l="string"==typeof s?this.pict.DataProvider.getDataByAddress(s):void 0),this.pict.LogControlFlow&&this.log.trace(`PICT-ControlFlow VIEW [${this.UUID}]::[${this.Hash}] Renderable[${d}] Destination[${a.ContentDestinationAddress}] TemplateRecordAddress[${s}] renderAsync:`),this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} Beginning Asynchronous Render (callback-style)...`);let p=this.fable.newAnticipate();p.anticipate(t=>{this.onBeforeRenderAsync(t,a)}),p.anticipate(i=>{this.pict.parseTemplateByHash(a.TemplateHash,l,(t,n)=>t?(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render (asynchronously) ${d} (param ${e}) because it did not parse the template.`,t),i(t)):(a.Content=n,i()),[this],t,{RootRenderable:"object"==typeof o?o:a})}),p.anticipate(t=>{this.onBeforeProjectAsync(t,a)}),p.anticipate(t=>{this.onProjectAsync(t,a)}),"virtual-assignment"!==a.RenderMethod&&(p.anticipate(t=>{this.onAfterProjectAsync(t,a)}),p.anticipate(t=>{this.onAfterRenderAsync(t,a)})),p.wait(c)}renderDefaultAsync(t){this.renderAsync(t)}basicRender(t,e,i){return this.basicRenderWithScope(this,t,e,i)}basicRenderWithScope(t,e,i,n){let o=this.buildRenderOptions(e,i,n);return o.Valid?(this.assignRenderContent(o.Renderable,o.DestinationAddress,this.pict.parseTemplateByHash(o.Renderable.TemplateHash,o.Record,null,[this],t,{RootRenderable:o.Renderable})),!0):(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not perform a basic render of ${o.RenderableHash} because it is not valid.`),!1)}basicRenderAsync(t,e,i,n){return this.basicRenderWithScopeAsync(this,t,e,i,n)}basicRenderWithScopeAsync(t,e,i,n,o){let r="function"==typeof o?o:"function"==typeof n?n:"function"==typeof i?i:"function"==typeof e?e:null;r||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} basicRenderAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),r=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} basicRenderAsync Auto Callback Error: ${t}`,t)});const a=this.buildRenderOptions(e,i,n);if(!a.Valid){let t=`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not perform a basic render of ${a.RenderableHash} because it is not valid.`;return this.log.error(t),r(new Error(t))}this.pict.parseTemplateByHash(a.Renderable.TemplateHash,a.Record,(t,e)=>t?(this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} could not render (asynchronously) ${a.RenderableHash} because it did not parse the template.`,t),r(t)):(this.assignRenderContent(a.Renderable,a.DestinationAddress,e),r()),[this],t,{RootRenderable:a.Renderable})}onProject(t){this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onProject:`),"virtual-assignment"===t.RenderMethod&&this.pict.TransactionTracking.pushToTransactionQueue(t.TransactionHash,{ViewHash:this.Hash,Renderable:t},"Deferred-Post-Content-Assignment"),this.pict.LogNoisiness>0&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} Assigning Renderable[${t.RenderableHash}] content length ${t.Content.length} to Destination [${t.ContentDestinationAddress}] using Async render method ${t.RenderMethod}.`),this.pict.ContentAssignment.projectContent(t.RenderMethod,t.ContentDestinationAddress,t.Content,t.TestAddress),this.lastRenderedTimestamp=this.pict.log.getTimeStamp()}onProjectAsync(t,e){return this.onProject(e),t()}onAfterRender(t){if(this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterRender:`),t&&t.RootRenderableViewHash===this.Hash){const e=this.pict.TransactionTracking.clearTransactionQueue(t.TransactionHash)||[];for(const i of e){const e=this.pict.views[i.Data.ViewHash];e?(e.onAfterProject(),e.onAfterRender(i.Data.Renderable)):this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterRender: Could not find view for transaction hash ${t.TransactionHash} and ViewHash ${i.Data.ViewHash}.`)}this.pict.TransactionTracking.unregisterTransaction(t.TransactionHash)}return!0}onAfterRenderAsync(t,e){this.onAfterRender(e);const i=this.fable.newAnticipate(),n=e&&e.RootRenderableViewHash===this.Hash;if(n){const t=this.pict.TransactionTracking.clearTransactionQueue(e.TransactionHash)||[];for(const n of t){const t=this.pict.views[n.Data.ViewHash];t?(i.anticipate(t.onAfterProjectAsync.bind(t)),i.anticipate(e=>{t.onAfterRenderAsync(e,n.Data.Renderable)})):this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterRenderAsync: Could not find view for transaction hash ${e.TransactionHash} and ViewHash ${n.Data.ViewHash}.`)}}return i.wait(i=>(n&&e&&e.TransactionHash&&this.pict.TransactionTracking.unregisterTransaction(e.TransactionHash),t(i)))}onAfterProject(t){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterProject:`),!0}onAfterProjectAsync(t,e){return t()}onBeforeSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeSolve:`),!0}onBeforeSolveAsync(t){return this.onBeforeSolve(),t()}onSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onSolve:`),!0}onSolveAsync(t){return this.onSolve(),t()}solve(){return this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} executing solve() function...`),this.onBeforeSolve(),this.onSolve(),this.onAfterSolve(),this.lastSolvedTimestamp=this.pict.log.getTimeStamp(),!0}solveAsync(t){let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t?t:null;i||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} solveAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeSolveAsync.bind(this)),e.anticipate(this.onSolveAsync.bind(this)),e.anticipate(this.onAfterSolveAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} solveAsync() complete.`),this.lastSolvedTimestamp=this.pict.log.getTimeStamp(),i(t)))}onAfterSolve(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterSolve:`),!0}onAfterSolveAsync(t){return this.onAfterSolve(),t()}onBeforeMarshalFromView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeMarshalFromView:`),!0}onBeforeMarshalFromViewAsync(t){return this.onBeforeMarshalFromView(),t()}onMarshalFromView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onMarshalFromView:`),!0}onMarshalFromViewAsync(t){return this.onMarshalFromView(),t()}marshalFromView(){return this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} executing solve() function...`),this.onBeforeMarshalFromView(),this.onMarshalFromView(),this.onAfterMarshalFromView(),this.lastMarshalFromViewTimestamp=this.pict.log.getTimeStamp(),!0}marshalFromViewAsync(t){let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t?t:null;i||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalFromViewAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeMarshalFromViewAsync.bind(this)),e.anticipate(this.onMarshalFromViewAsync.bind(this)),e.anticipate(this.onAfterMarshalFromViewAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} marshalFromViewAsync() complete.`),this.lastMarshalFromViewTimestamp=this.pict.log.getTimeStamp(),i(t)))}onAfterMarshalFromView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterMarshalFromView:`),!0}onAfterMarshalFromViewAsync(t){return this.onAfterMarshalFromView(),t()}onBeforeMarshalToView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onBeforeMarshalToView:`),!0}onBeforeMarshalToViewAsync(t){return this.onBeforeMarshalToView(),t()}onMarshalToView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onMarshalToView:`),!0}onMarshalToViewAsync(t){return this.onMarshalToView(),t()}marshalToView(){return this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} executing solve() function...`),this.onBeforeMarshalToView(),this.onMarshalToView(),this.onAfterMarshalToView(),this.lastMarshalToViewTimestamp=this.pict.log.getTimeStamp(),!0}marshalToViewAsync(t){let e=this.pict.instantiateServiceProviderWithoutRegistration("Anticipate"),i="function"==typeof t?t:null;i||(this.log.warn(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewAsync was called without a valid callback. A callback will be generated but this could lead to race conditions.`),i=t=>{t&&this.log.error(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.Name} marshalToViewAsync Auto Callback Error: ${t}`,t)}),e.anticipate(this.onBeforeMarshalToViewAsync.bind(this)),e.anticipate(this.onMarshalToViewAsync.bind(this)),e.anticipate(this.onAfterMarshalToViewAsync.bind(this)),e.wait(t=>(this.pict.LogNoisiness>2&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} marshalToViewAsync() complete.`),this.lastMarshalToViewTimestamp=this.pict.log.getTimeStamp(),i(t)))}onAfterMarshalToView(){return this.pict.LogNoisiness>3&&this.log.trace(`PictView [${this.UUID}]::[${this.Hash}] ${this.options.ViewIdentifier} onAfterMarshalToView:`),!0}onAfterMarshalToViewAsync(t){return this.onAfterMarshalToView(),t()}get isPictView(){return!0}}},{"../package.json":101,"fable-serviceproviderbase":20}],103:[function(t,e,i){var n,o,r=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(t){if(n===setTimeout)return setTimeout(t,0);if((n===a||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:a}catch(t){n=a}try{o="function"==typeof clearTimeout?clearTimeout:s}catch(t){o=s}}();var d,c=[],p=!1,h=-1;function u(){p&&d&&(p=!1,d.length?c=d.concat(c):h=-1,c.length&&m())}function m(){if(!p){var t=l(u);p=!0;for(var e=c.length;e;){for(d=c,c=[];++h<e;)d&&d[h].run();h=-1,e=c.length}d=null,p=!1,function(t){if(o===clearTimeout)return clearTimeout(t);if((o===s||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{return o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}(t)}}function g(t,e){this.fun=t,this.array=e}function f(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];c.push(new g(t,e)),1!==c.length||p||l(m)},g.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=f,r.addListener=f,r.once=f,r.off=f,r.removeListener=f,r.removeAllListeners=f,r.emit=f,r.prependListener=f,r.prependOnceListener=f,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},{}],104:[function(t,e,i){(function(t){(function(){!function(n){var o="object"==typeof i&&i&&!i.nodeType&&i,r="object"==typeof e&&e&&!e.nodeType&&e,a="object"==typeof t&&t;a.global!==a&&a.window!==a&&a.self!==a||(n=a);var s,l,d=2147483647,c=36,p=/^xn--/,h=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=Math.floor,f=String.fromCharCode;function v(t){throw new RangeError(m[t])}function b(t,e){for(var i=t.length,n=[];i--;)n[i]=e(t[i]);return n}function y(t,e){var i=t.split("@"),n="";return i.length>1&&(n=i[0]+"@",t=i[1]),n+b((t=t.replace(u,".")).split("."),e).join(".")}function w(t){for(var e,i,n=[],o=0,r=t.length;o<r;)(e=t.charCodeAt(o++))>=55296&&e<=56319&&o<r?56320==(64512&(i=t.charCodeAt(o++)))?n.push(((1023&e)<<10)+(1023&i)+65536):(n.push(e),o--):n.push(e);return n}function C(t){return b(t,function(t){var e="";return t>65535&&(e+=f((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+=f(t)}).join("")}function x(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:c}function R(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function _(t,e,i){var n=0;for(t=i?g(t/700):t>>1,t+=g(t/e);t>455;n+=c)t=g(t/35);return g(n+36*t/(t+38))}function D(t){var e,i,n,o,r,a,s,l,p,h,u=[],m=t.length,f=0,b=128,y=72;for((i=t.lastIndexOf("-"))<0&&(i=0),n=0;n<i;++n)t.charCodeAt(n)>=128&&v("not-basic"),u.push(t.charCodeAt(n));for(o=i>0?i+1:0;o<m;){for(r=f,a=1,s=c;o>=m&&v("invalid-input"),((l=x(t.charCodeAt(o++)))>=c||l>g((d-f)/a))&&v("overflow"),f+=l*a,!(l<(p=s<=y?1:s>=y+26?26:s-y));s+=c)a>g(d/(h=c-p))&&v("overflow"),a*=h;y=_(f-r,e=u.length+1,0==r),g(f/e)>d-b&&v("overflow"),b+=g(f/e),f%=e,u.splice(f++,0,b)}return C(u)}function E(t){var e,i,n,o,r,a,s,l,p,h,u,m,b,y,C,x=[];for(m=(t=w(t)).length,e=128,i=0,r=72,a=0;a<m;++a)(u=t[a])<128&&x.push(f(u));for(n=o=x.length,o&&x.push("-");n<m;){for(s=d,a=0;a<m;++a)(u=t[a])>=e&&u<s&&(s=u);for(s-e>g((d-i)/(b=n+1))&&v("overflow"),i+=(s-e)*b,e=s,a=0;a<m;++a)if((u=t[a])<e&&++i>d&&v("overflow"),u==e){for(l=i,p=c;!(l<(h=p<=r?1:p>=r+26?26:p-r));p+=c)C=l-h,y=c-h,x.push(f(R(h+C%y,0))),l=g(C/y);x.push(f(R(l,0))),r=_(i,b,n==o),i=0,++n}++i,++e}return x.join("")}if(s={version:"1.4.1",ucs2:{decode:w,encode:C},decode:D,encode:E,toASCII:function(t){return y(t,function(t){return h.test(t)?"xn--"+E(t):t})},toUnicode:function(t){return y(t,function(t){return p.test(t)?D(t.slice(4).toLowerCase()):t})}},o&&r)if(e.exports==o)r.exports=s;else for(l in s)s.hasOwnProperty(l)&&(o[l]=s[l]);else n.punycode=s}(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],105:[function(t,e,i){var n=String.prototype.replace,o=/%20/g,r="RFC1738",a="RFC3986";e.exports={default:a,formatters:{RFC1738:function(t){return n.call(t,o,"+")},RFC3986:function(t){return String(t)}},RFC1738:r,RFC3986:a}},{}],106:[function(t,e,i){var n=t("./stringify"),o=t("./parse"),r=t("./formats");e.exports={formats:r,parse:o,stringify:n}},{"./formats":105,"./parse":107,"./stringify":108}],107:[function(t,e,i){var n=t("./utils"),o=Object.prototype.hasOwnProperty,r=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},s=function(t){return t.replace(/&#(\d+);/g,function(t,e){return String.fromCharCode(parseInt(e,10))})},l=function(t,e,i){if(t&&"string"==typeof t&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&i>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(1===e.arrayLimit?"":"s")+" allowed in an array.");return t},d=function(t,e,i,r){if(t){var a=function(t,e){var i=e.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t;if(e.depth<=0){if(!e.plainObjects&&o.call(Object.prototype,i)&&!e.allowPrototypes)return;return[i]}var n=/(\[[^[\]]*])/g,r=/(\[[^[\]]*])/.exec(i),a=r?i.slice(0,r.index):i,s=[];if(a){if(!e.plainObjects&&o.call(Object.prototype,a)&&!e.allowPrototypes)return;s[s.length]=a}for(var l=0;null!==(r=n.exec(i))&&l<e.depth;){l+=1;var d=r[1].slice(1,-1);if(!e.plainObjects&&o.call(Object.prototype,d)&&!e.allowPrototypes)return;s[s.length]=r[1]}if(r){if(!0===e.strictDepth)throw new RangeError("Input depth exceeded depth option of "+e.depth+" and strictDepth is true");s[s.length]="["+i.slice(r.index)+"]"}return s}(t,i);if(a)return function(t,e,i,o){var r=0;if(t.length>0&&"[]"===t[t.length-1]){var a=t.slice(0,-1).join("");r=Array.isArray(e)&&e[a]?e[a].length:0}for(var s=o?e:l(e,i,r),d=t.length-1;d>=0;--d){var c,p=t[d];if("[]"===p&&i.parseArrays)c=n.isOverflow(s)?s:i.allowEmptyArrays&&(""===s||i.strictNullHandling&&null===s)?[]:n.combine([],s,i.arrayLimit,i.plainObjects);else{c=i.plainObjects?{__proto__:null}:{};var h="["===p.charAt(0)&&"]"===p.charAt(p.length-1)?p.slice(1,-1):p,u=i.decodeDotInKeys?h.replace(/%2E/g,"."):h,m=parseInt(u,10),g=!isNaN(m)&&p!==u&&String(m)===u&&m>=0&&i.parseArrays;if(i.parseArrays||""!==u)if(g&&m<i.arrayLimit)(c=[])[m]=s;else{if(g&&i.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+i.arrayLimit+" element"+(1===i.arrayLimit?"":"s")+" allowed in an array.");g?(c[m]=s,n.markOverflow(c,m)):"__proto__"!==u&&(c[u]=s)}else c={0:s}}s=c}return s}(a,e,i,r)}};e.exports=function(t,e){var i=function(t){if(!t)return a;if(void 0!==t.allowEmptyArrays&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==t.decodeDotInKeys&&"boolean"!=typeof t.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.decoder&&void 0!==t.decoder&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==t.throwOnLimitExceeded&&"boolean"!=typeof t.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var e=void 0===t.charset?a.charset:t.charset,i=void 0===t.duplicates?a.duplicates:t.duplicates;if("combine"!==i&&"first"!==i&&"last"!==i)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===t.allowDots?!0===t.decodeDotInKeys||a.allowDots:!!t.allowDots,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:a.allowEmptyArrays,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:a.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:a.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:a.arrayLimit,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:a.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:a.comma,decodeDotInKeys:"boolean"==typeof t.decodeDotInKeys?t.decodeDotInKeys:a.decodeDotInKeys,decoder:"function"==typeof t.decoder?t.decoder:a.decoder,delimiter:"string"==typeof t.delimiter||n.isRegExp(t.delimiter)?t.delimiter:a.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:a.depth,duplicates:i,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:a.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:a.plainObjects,strictDepth:"boolean"==typeof t.strictDepth?!!t.strictDepth:a.strictDepth,strictMerge:"boolean"==typeof t.strictMerge?!!t.strictMerge:a.strictMerge,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:a.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof t.throwOnLimitExceeded&&t.throwOnLimitExceeded}}(e);if(""===t||null==t)return i.plainObjects?{__proto__:null}:{};for(var c="string"==typeof t?function(t,e){var i={__proto__:null},d=e.ignoreQueryPrefix?t.replace(/^\?/,""):t;d=d.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var c=e.parameterLimit===1/0?void 0:e.parameterLimit,p=d.split(e.delimiter,e.throwOnLimitExceeded?c+1:c);if(e.throwOnLimitExceeded&&p.length>c)throw new RangeError("Parameter limit exceeded. Only "+c+" parameter"+(1===c?"":"s")+" allowed.");var h,u=-1,m=e.charset;if(e.charsetSentinel)for(h=0;h<p.length;++h)0===p[h].indexOf("utf8=")&&("utf8=%E2%9C%93"===p[h]?m="utf-8":"utf8=%26%2310003%3B"===p[h]&&(m="iso-8859-1"),u=h,h=p.length);for(h=0;h<p.length;++h)if(h!==u){var g,f,v=p[h],b=v.indexOf("]="),y=-1===b?v.indexOf("="):b+1;if(-1===y?(g=e.decoder(v,a.decoder,m,"key"),f=e.strictNullHandling?null:""):null!==(g=e.decoder(v.slice(0,y),a.decoder,m,"key"))&&(f=n.maybeMap(l(v.slice(y+1),e,r(i[g])?i[g].length:0),function(t){return e.decoder(t,a.decoder,m,"value")})),f&&e.interpretNumericEntities&&"iso-8859-1"===m&&(f=s(String(f))),v.indexOf("[]=")>-1&&(f=r(f)?[f]:f),e.comma&&r(f)&&f.length>e.arrayLimit){if(e.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(1===e.arrayLimit?"":"s")+" allowed in an array.");f=n.combine([],f,e.arrayLimit,e.plainObjects)}if(null!==g){var w=o.call(i,g);w&&("combine"===e.duplicates||v.indexOf("[]=")>-1)?i[g]=n.combine(i[g],f,e.arrayLimit,e.plainObjects):w&&"last"!==e.duplicates||(i[g]=f)}}return i}(t,i):t,p=i.plainObjects?{__proto__:null}:{},h=Object.keys(c),u=0;u<h.length;++u){var m=h[u],g=d(m,c[m],i,"string"==typeof t);p=n.merge(p,g,i)}return!0===i.allowSparse?p:n.compact(p)}},{"./utils":109}],108:[function(t,e,i){var n=t("side-channel"),o=t("./utils"),r=t("./formats"),a=Object.prototype.hasOwnProperty,s={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,e){return t+"["+e+"]"},repeat:function(t){return t}},l=Array.isArray,d=Array.prototype.push,c=function(t,e){d.apply(t,l(e)?e:[e])},p=Date.prototype.toISOString,h=r.default,u={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:o.encode,encodeValuesOnly:!1,filter:void 0,format:h,formatter:r.formatters[h],indices:!1,serializeDate:function(t){return p.call(t)},skipNulls:!1,strictNullHandling:!1},m={},g=function t(e,i,r,a,s,d,p,h,g,f,v,b,y,w,C,x,R,_){for(var D,E=e,A=_,S=0,T=!1;void 0!==(A=A.get(m))&&!T;){var P=A.get(e);if(S+=1,void 0!==P){if(P===S)throw new RangeError("Cyclic object value");T=!0}void 0===A.get(m)&&(S=0)}if("function"==typeof f?E=f(i,E):E instanceof Date?E=y(E):"comma"===r&&l(E)&&(E=o.maybeMap(E,function(t){return t instanceof Date?y(t):t})),null===E){if(d)return g&&!x?g(i,u.encoder,R,"key",w):i;E=""}if("string"==typeof(D=E)||"number"==typeof D||"boolean"==typeof D||"symbol"==typeof D||"bigint"==typeof D||o.isBuffer(E))return g?[C(x?i:g(i,u.encoder,R,"key",w))+"="+C(g(E,u.encoder,R,"value",w))]:[C(i)+"="+C(String(E))];var k,F=[];if(void 0===E)return F;if("comma"===r&&l(E))x&&g&&(E=o.maybeMap(E,g)),k=[{value:E.length>0?E.join(",")||null:void 0}];else if(l(f))k=f;else{var I=Object.keys(E);k=v?I.sort(v):I}var L=h?String(i).replace(/\./g,"%2E"):String(i),M=a&&l(E)&&1===E.length?L+"[]":L;if(s&&l(E)&&0===E.length)return M+"[]";for(var B=0;B<k.length;++B){var H=k[B],V="object"==typeof H&&H&&void 0!==H.value?H.value:E[H];if(!p||null!==V){var O=b&&h?String(H).replace(/\./g,"%2E"):String(H),N=l(E)?"function"==typeof r?r(M,O):M:M+(b?"."+O:"["+O+"]");_.set(e,S);var z=n();z.set(m,_),c(F,t(V,N,r,a,s,d,p,h,"comma"===r&&x&&l(E)?null:g,f,v,b,y,w,C,x,R,z))}}return F};e.exports=function(t,e){var i,o=t,d=function(t){if(!t)return u;if(void 0!==t.allowEmptyArrays&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==t.encodeDotInKeys&&"boolean"!=typeof t.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.encoder&&void 0!==t.encoder&&"function"!=typeof t.encoder)throw new TypeError("Encoder has to be a function.");var e=t.charset||u.charset;if(void 0!==t.charset&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=r.default;if(void 0!==t.format){if(!a.call(r.formatters,t.format))throw new TypeError("Unknown format option provided.");i=t.format}var n,o=r.formatters[i],d=u.filter;if(("function"==typeof t.filter||l(t.filter))&&(d=t.filter),n=t.arrayFormat in s?t.arrayFormat:"indices"in t?t.indices?"indices":"repeat":u.arrayFormat,"commaRoundTrip"in t&&"boolean"!=typeof t.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var c=void 0===t.allowDots?!0===t.encodeDotInKeys||u.allowDots:!!t.allowDots;return{addQueryPrefix:"boolean"==typeof t.addQueryPrefix?t.addQueryPrefix:u.addQueryPrefix,allowDots:c,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:u.allowEmptyArrays,arrayFormat:n,charset:e,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:u.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:void 0===t.delimiter?u.delimiter:t.delimiter,encode:"boolean"==typeof t.encode?t.encode:u.encode,encodeDotInKeys:"boolean"==typeof t.encodeDotInKeys?t.encodeDotInKeys:u.encodeDotInKeys,encoder:"function"==typeof t.encoder?t.encoder:u.encoder,encodeValuesOnly:"boolean"==typeof t.encodeValuesOnly?t.encodeValuesOnly:u.encodeValuesOnly,filter:d,format:i,formatter:o,serializeDate:"function"==typeof t.serializeDate?t.serializeDate:u.serializeDate,skipNulls:"boolean"==typeof t.skipNulls?t.skipNulls:u.skipNulls,sort:"function"==typeof t.sort?t.sort:null,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:u.strictNullHandling}}(e);"function"==typeof d.filter?o=(0,d.filter)("",o):l(d.filter)&&(i=d.filter);var p=[];if("object"!=typeof o||null===o)return"";var h=s[d.arrayFormat],m="comma"===h&&d.commaRoundTrip;i||(i=Object.keys(o)),d.sort&&i.sort(d.sort);for(var f=n(),v=0;v<i.length;++v){var b=i[v],y=o[b];d.skipNulls&&null===y||c(p,g(y,b,h,m,d.allowEmptyArrays,d.strictNullHandling,d.skipNulls,d.encodeDotInKeys,d.encode?d.encoder:null,d.filter,d.sort,d.allowDots,d.serializeDate,d.format,d.formatter,d.encodeValuesOnly,d.charset,f))}var w=p.join(d.delimiter),C=!0===d.addQueryPrefix?"?":"";return d.charsetSentinel&&("iso-8859-1"===d.charset?C+="utf8=%26%2310003%3B&":C+="utf8=%E2%9C%93&"),w.length>0?C+w:""}},{"./formats":105,"./utils":109,"side-channel":126}],109:[function(t,e,i){var n=t("./formats"),o=t("side-channel"),r=Object.prototype.hasOwnProperty,a=Array.isArray,s=o(),l=function(t,e){return s.set(t,e),t},d=function(t){return s.has(t)},c=function(t){return s.get(t)},p=function(t,e){s.set(t,e)},h=function(){for(var t=[],e=0;e<256;++e)t[t.length]="%"+((e<16?"0":"")+e.toString(16)).toUpperCase();return t}(),u=function(t,e){for(var i=e&&e.plainObjects?{__proto__:null}:{},n=0;n<t.length;++n)void 0!==t[n]&&(i[n]=t[n]);return i},m=1024;e.exports={arrayToObject:u,assign:function(t,e){return Object.keys(e).reduce(function(t,i){return t[i]=e[i],t},t)},combine:function(t,e,i,n){if(d(t)){var o=c(t)+1;return t[o]=e,p(t,o),t}var r=[].concat(t,e);return r.length>i?l(u(r,{plainObjects:n}),r.length-1):r},compact:function(t){for(var e=[{obj:{o:t},prop:"o"}],i=[],n=0;n<e.length;++n)for(var o=e[n],r=o.obj[o.prop],s=Object.keys(r),l=0;l<s.length;++l){var d=s[l],c=r[d];"object"==typeof c&&null!==c&&-1===i.indexOf(c)&&(e[e.length]={obj:r,prop:d},i[i.length]=c)}return function(t){for(;t.length>1;){var e=t.pop(),i=e.obj[e.prop];if(a(i)){for(var n=[],o=0;o<i.length;++o)void 0!==i[o]&&(n[n.length]=i[o]);e.obj[e.prop]=n}}}(e),t},decode:function(t,e,i){var n=t.replace(/\+/g," ");if("iso-8859-1"===i)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(t){return n}},encode:function(t,e,i,o,r){if(0===t.length)return t;var a=t;if("symbol"==typeof t?a=Symbol.prototype.toString.call(t):"string"!=typeof t&&(a=String(t)),"iso-8859-1"===i)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(t){return"%26%23"+parseInt(t.slice(2),16)+"%3B"});for(var s="",l=0;l<a.length;l+=m){for(var d=a.length>=m?a.slice(l,l+m):a,c=[],p=0;p<d.length;++p){var u=d.charCodeAt(p);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||r===n.RFC1738&&(40===u||41===u)?c[c.length]=d.charAt(p):u<128?c[c.length]=h[u]:u<2048?c[c.length]=h[192|u>>6]+h[128|63&u]:u<55296||u>=57344?c[c.length]=h[224|u>>12]+h[128|u>>6&63]+h[128|63&u]:(p+=1,u=65536+((1023&u)<<10|1023&d.charCodeAt(p)),c[c.length]=h[240|u>>18]+h[128|u>>12&63]+h[128|u>>6&63]+h[128|63&u])}s+=c.join("")}return s},isBuffer:function(t){return!(!t||"object"!=typeof t)&&!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},isOverflow:d,isRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},markOverflow:l,maybeMap:function(t,e){if(a(t)){for(var i=[],n=0;n<t.length;n+=1)i[i.length]=e(t[n]);return i}return e(t)},merge:function t(e,i,n){if(!i)return e;if("object"!=typeof i&&"function"!=typeof i){if(a(e)){var o=e.length;if(n&&"number"==typeof n.arrayLimit&&o>n.arrayLimit)return l(u(e.concat(i),n),o);e[o]=i}else{if(!e||"object"!=typeof e)return[e,i];if(d(e)){var s=c(e)+1;e[s]=i,p(e,s)}else{if(n&&n.strictMerge)return[e,i];(n&&(n.plainObjects||n.allowPrototypes)||!r.call(Object.prototype,i))&&(e[i]=!0)}}return e}if(!e||"object"!=typeof e){if(d(i)){for(var h=Object.keys(i),m=n&&n.plainObjects?{__proto__:null,0:e}:{0:e},g=0;g<h.length;g++){m[parseInt(h[g],10)+1]=i[h[g]]}return l(m,c(i)+1)}var f=[e].concat(i);return n&&"number"==typeof n.arrayLimit&&f.length>n.arrayLimit?l(u(f,n),f.length-1):f}var v=e;return a(e)&&!a(i)&&(v=u(e,n)),a(e)&&a(i)?(i.forEach(function(i,o){if(r.call(e,o)){var a=e[o];a&&"object"==typeof a&&i&&"object"==typeof i?e[o]=t(a,i,n):e[e.length]=i}else e[o]=i}),e):Object.keys(i).reduce(function(e,o){var a=i[o];if(r.call(e,o)?e[o]=t(e[o],a,n):e[o]=a,d(i)&&!d(e)&&l(e,c(i)),d(e)){var s=parseInt(o,10);String(s)===o&&s>=0&&s>c(e)&&p(e,s)}return e},v)}}},{"./formats":105,"side-channel":126}],110:[function(t,e,i){e.exports={Name:"Retold Content Editor",Hash:"ContentEditor",MainViewportViewIdentifier:"ContentEditor-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1,pict_configuration:{Product:"ContentEditor-Pict-Application"}}},{}],111:[function(t,e,i){const n=t("pict-application"),o=t("pict-section-filebrowser"),r=t("pict-provider-vocabulary"),a=t("pict-section-inlinedocumentation"),s=t("pict-section-modal"),l=t("pict-section-content"),d=t("./providers/Pict-Provider-ContentEditor.js"),c=t("./views/PictView-Editor-Layout.js"),p=t("./views/PictView-Editor-TopBar.js"),h=t("./views/PictView-Editor-MarkdownEditor.js"),u=t("./views/PictView-Editor-CodeEditor.js"),m=t("./views/PictView-Editor-SettingsPanel.js"),g=t("./views/PictView-Editor-MarkdownReference.js"),f=t("./views/PictView-Editor-Topics.js");e.exports=class extends n{constructor(t,e,i){super(t,e,i),this.pict.addProvider("ContentEditor-Provider",d.default_configuration,d),this.pict.addProvider("Vocabulary",r.default_configuration,r);let n=this.pict;this.pict.addView("ContentEditor-Vocabulary",Object.assign({},r.VocabularyManagerView.default_configuration,{DefaultDestinationAddress:"#ContentEditor-Vocabulary-Container",VocabularyRoute:"#/vocabulary",VocabularyFolderPath:"vocabulary/",onEditTerm:function(t,e){n&&n.PictApplication&&"function"==typeof n.PictApplication.navigateToFile&&n.PictApplication.navigateToFile(e)}}),r.VocabularyManagerView),this.pict.addProvider("Pict-InlineDocumentation",a.default_configuration,a),this.pict.addProvider("Pict-Content",l.PictContentProvider.default_configuration,l.PictContentProvider),this.pict.addView("Pict-Section-Modal",s.default_configuration,s),this.pict.addView("ContentEditor-Layout",c.default_configuration,c),this.pict.addView("ContentEditor-TopBar",p.default_configuration,p),this.pict.addView("ContentEditor-MarkdownEditor",h.default_configuration,h),this.pict.addView("ContentEditor-CodeEditor",u.default_configuration,u),this.pict.addView("ContentEditor-SettingsPanel",m.default_configuration,m),this.pict.addView("ContentEditor-MarkdownReference",g.default_configuration,g),this.pict.addView("ContentEditor-Topics",f.default_configuration,f);let v=JSON.parse(JSON.stringify(o.default_configuration));v.DefaultDestinationAddress="#ContentEditor-Sidebar-Container",v.DefaultState.Layout="list-only",this.pict.addView("Pict-FileBrowser",v,o);let b=JSON.parse(JSON.stringify(o.PictViewListDetail.default_configuration));for(let t=0;t<b.Templates.length;t++)"FileBrowser-ListDetail-Container-Template"===b.Templates[t].Hash&&(b.Templates[t].Template='\n<div class="pict-fb-detail" id="Pict-FileBrowser-DetailList">\n\t<div class="pict-fb-breadcrumb-bar">\n\t\t<div class="pict-fb-breadcrumb" id="Pict-FileBrowser-Breadcrumb"></div>\n\t\t<button class="pict-fb-breadcrumb-addfolder" onclick="pict.PictApplication.promptNewFolder()" title="New folder">+</button>\n\t</div>\n\t<div class="pict-fb-detail-header">\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-name" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Name\')">Name</div>\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-size" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Size\')">Size</div>\n\t\t<div class="pict-fb-detail-header-cell pict-fb-detail-col-modified" onclick="pict.views[\'{~D:Record.ViewHash~}\'].sortBy(\'Modified\')">Modified</div>\n\t</div>\n\t<div id="Pict-FileBrowser-DetailRows"></div>\n</div>\n'),"FileBrowser-ListDetail-Row-Template"===b.Templates[t].Hash&&(b.Templates[t].Template='\n<div class="pict-fb-detail-row{~D:Record.SelectedClass~}" data-index="{~D:Record.Index~}" data-name="{~D:Record.Name~}" onclick="{~D:Record.ClickHandler~}" ondblclick="{~D:Record.DblClickHandler~}">\n\t<span class="pict-fb-detail-icon">{~D:Record.Icon~}</span>\n\t<span class="pict-fb-detail-name">{~D:Record.Name~}</span>\n\t<span class="pict-fb-detail-size">{~D:Record.SizeFormatted~}</span>\n\t<span class="pict-fb-detail-modified">{~D:Record.ModifiedFormatted~}</span>\n\t<button class="pict-fb-insert-btn" onclick="event.stopPropagation(); pict.PictApplication.insertFileReference(this.parentElement.getAttribute(\'data-name\'))" title="Insert into editor">+</button>\n</div>\n');this.pict.addView("Pict-FileBrowser-ListDetail",b,o.PictViewListDetail)}onAfterInitializeAsync(t){if("undefined"!=typeof window){window.pict=this.pict;let t=this.pict;window.addEventListener("beforeunload",function(e){t.AppData.ContentEditor&&t.AppData.ContentEditor.IsDirty&&(e.preventDefault(),e.returnValue="")})}this.pict.AppData.ContentEditor={CurrentFile:"",ActiveEditor:"markdown",IsDirty:!1,IsSaving:!1,IsLoading:!1,Files:[],Document:{Segments:[{Content:""}]},CodeContent:"",SaveStatus:"",SaveStatusClass:"",AutoSegmentMarkdown:!1,AutoSegmentDepth:1,ContentPreviewMode:"off",MarkdownEditingControls:!0,MarkdownWordWrap:!0,CodeWordWrap:!1,SidebarCollapsed:!1,SidebarWidth:250,AutoPreviewImages:!0,AutoPreviewVideo:!1,AutoPreviewAudio:!1,ShowHiddenFiles:!1,TopicsFilePath:".pict_documentation_topics.json"},this._loadSettings(),this.pict.views["ContentEditor-Layout"].render();let e=this,i=this.pict.providers["Pict-FileBrowser-List"];if(i){let t=i.selectFile.bind(i);i.selectFile=function(i){t(i),i&&"file"===i.Type&&e.navigateToFile(i.Path)}}let n=this.pict.providers["Pict-FileBrowser-Browse"];if(n){let t=n.navigateToFolder.bind(n);n.navigateToFolder=function(i){t(i),e.loadFileList(i)}}this.syncHiddenFilesSetting(()=>{e.loadFileList(null,()=>{e.resolveHash()})});let o=this.pict.AppData.ContentEditor.TopicsFilePath;if(o){let t=this.pict.views["ContentEditor-Topics"];t&&t.loadTopicsFile(o,()=>{})}let r=this.pict.providers&&this.pict.providers.Vocabulary;r&&r.loadFromURL("/api/vocabulary/index");let a=this.pict.providers&&this.pict.providers["Pict-InlineDocumentation"];if(a&&"function"==typeof a.initializeDocumentation){let t=this;a.initializeDocumentation({DocsBaseURL:"/content/",ContainerAddress:"#ContentEditor-Documentation-Panel",SearchIndexURL:"/content/retold-keyword-index.json",ExternalDocBaseURL:"https://stevenvelozo.github.io/retold/#/doc/",EditEnabled:!1,TopicManagerEnabled:!1},function(){let e=t.pict.views["Pict-Section-Modal"];e&&"function"==typeof e.panel&&(t._docPanel=e.panel("#ContentEditor-Documentation-Panel",{position:"right",width:340,minWidth:260,maxWidth:600,collapsible:!0,collapsed:!0,persist:!0,persistKey:"ContentEditor-DocPanel"}));let i=t.pict.providers["Pict-InlineDocumentation"];if(i&&"function"==typeof i.loadDocument){let t="README.md";try{let e=localStorage.getItem("ContentEditor-DocPanel-LastDoc");e&&(t=e)}catch(t){}i.loadDocument(t);let e=i.loadDocument.bind(i);i.loadDocument=function(t,i){try{localStorage.setItem("ContentEditor-DocPanel-LastDoc",t)}catch(t){}return e(t,i)}}})}return super.onAfterInitializeAsync(t)}syncHiddenFilesSetting(t){let e="function"==typeof t?t:()=>{},i=this.pict.AppData.ContentEditor.ShowHiddenFiles;fetch("/api/filebrowser/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({IncludeHiddenFiles:!!i})}).then(()=>e()).catch(()=>e())}loadFileList(t,e){let i="function"==typeof e?e:"function"==typeof t?t:()=>{},n=this,o="string"==typeof t?t:null;null===o&&this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(o=this.pict.AppData.PictFileBrowser.CurrentLocation);let r="/api/filebrowser/list";o&&o.length>0&&(r+="?path="+encodeURIComponent(o)),fetch(r).then(t=>t.json()).then(t=>{n.pict.AppData.PictFileBrowser=n.pict.AppData.PictFileBrowser||{},n.pict.AppData.PictFileBrowser.FileList=t||[];let e=n.pict.views["Pict-FileBrowser"];e&&e.render();let o=n.pict.views["Pict-FileBrowser-ListDetail"];return o&&o.render(),i()}).catch(t=>(n.log.error(`Failed to load file list: ${t.message}`),i()))}resolveHash(){let t=(window.location.hash||"").replace(/^#\/?/,"");if(!t)return;let e=t.split("/");if("edit"===e[0]&&e.length>=2){let t=e.slice(1).join("/");if(this.pict.AppData.ContentEditor.CurrentFile===t)return;this.navigateToFile(t)}}getEditorTypeForFile(t){if(!t)return"markdown";let e=t.replace(/^.*\./,"").toLowerCase();if("md"===e||"markdown"===e)return"markdown";return{png:!0,jpg:!0,jpeg:!0,gif:!0,bmp:!0,webp:!0,ico:!0,svg:!0,tiff:!0,tif:!0,avif:!0,heic:!0,heif:!0,mp3:!0,wav:!0,ogg:!0,flac:!0,aac:!0,m4a:!0,wma:!0,mp4:!0,avi:!0,mkv:!0,mov:!0,wmv:!0,webm:!0,flv:!0,m4v:!0,pdf:!0,doc:!0,docx:!0,xls:!0,xlsx:!0,ppt:!0,pptx:!0,odt:!0,ods:!0,odp:!0,zip:!0,tar:!0,gz:!0,bz2:!0,xz:!0,"7z":!0,rar:!0,ttf:!0,otf:!0,woff:!0,woff2:!0,eot:!0,exe:!0,dll:!0,so:!0,dylib:!0,o:!0,class:!0,pyc:!0,wasm:!0}[e]?"binary":"code"}_cleanupEditors(){let t=this.pict.views["ContentEditor-CodeEditor"];t&&(t.codeJar&&t.destroy(),t.initialRenderComplete=!1);let e=this.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");e&&e[0]&&(e[0].innerHTML="")}_formatFileSize(t){if(0===t)return"0 B";let e=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(t)/Math.log(1024));return i>=e.length&&(i=e.length-1),(t/Math.pow(1024,i)).toFixed(0===i?0:1)+" "+e[i]}_getMediaType(t){return{png:!0,jpg:!0,jpeg:!0,gif:!0,webp:!0,svg:!0,bmp:!0,ico:!0,avif:!0}[t]?"image":{mp4:!0,webm:!0,mov:!0,mkv:!0,avi:!0,wmv:!0,flv:!0,m4v:!0,ogv:!0}[t]?"video":{mp3:!0,wav:!0,ogg:!0,flac:!0,aac:!0,m4a:!0,wma:!0,oga:!0}[t]?"audio":"other"}_buildMediaPreviewHTML(t,e,i){return"image"===t?'<div class="binary-preview-image-wrap"><div class="binary-preview-image"><img src="'+e+'" alt="'+i+'"></div></div>':"video"===t?'<div class="binary-preview-media-wrap"><video class="binary-preview-video" controls preload="metadata"><source src="'+e+'">Your browser does not support the video tag.</video></div>':"audio"===t?'<div class="binary-preview-media-wrap"><audio class="binary-preview-audio" controls preload="metadata"><source src="'+e+'">Your browser does not support the audio tag.</audio></div>':""}loadMediaPreview(t,e,i){let n=this.pict.ContentAssignment.getElement("#ContentEditor-MediaPreviewPlaceholder")[0];n&&(n.innerHTML=this._buildMediaPreviewHTML(t,e,i))}_showBinaryPreview(t){let e=this,i=t.replace(/^.*\//,""),n=t.replace(/^.*\./,"").toLowerCase(),o="/content/"+encodeURIComponent(t),r=this._getMediaType(n),a=this.pict.AppData.ContentEditor,s=!1;"image"===r&&(s=a.AutoPreviewImages),"video"===r&&(s=a.AutoPreviewVideo),"audio"===r&&(s=a.AutoPreviewAudio),fetch("/api/filebrowser/info?path="+encodeURIComponent(t)).then(t=>t.json()).then(t=>{let a=t&&"number"==typeof t.Size?e._formatFileSize(t.Size):"Unknown",l=t&&t.Modified?new Date(t.Modified).toLocaleString():"Unknown",d=e.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");if(!d||!d[0])return;let c="";"other"!==r&&(s?c+=e._buildMediaPreviewHTML(r,o,i):(c+='<div id="ContentEditor-MediaPreviewPlaceholder">',c+='<button class="binary-preview-btn binary-preview-btn-preview"',c+=' onclick="pict.PictApplication.loadMediaPreview(',c+="'"+r+"','"+o+"','"+i.replace(/'/g,"\\'")+"'",c+=')">Preview '+r.charAt(0).toUpperCase()+r.slice(1)+"</button>",c+="</div>")),c+='<div class="binary-preview-card">',c+='<div class="binary-preview-icon">'+n.toUpperCase()+"</div>",c+='<div class="binary-preview-info">',c+='<div class="binary-preview-name">'+i+"</div>",c+='<div class="binary-preview-meta">Size: '+a+"</div>",c+='<div class="binary-preview-meta">Modified: '+l+"</div>",c+='<div class="binary-preview-meta">Type: .'+n+"</div>",c+="</div>",c+='<div class="binary-preview-actions">',c+='<a class="binary-preview-btn" href="'+o+'" download="'+i+'">Download</a>',c+='<a class="binary-preview-btn binary-preview-btn-secondary" href="'+o+'" target="_blank">Open in New Tab</a>',c+="</div>",c+="</div>",d[0].innerHTML=c}).catch(()=>{let t=e.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");t&&t[0]&&(t[0].innerHTML='<div class="binary-preview-card"><div class="binary-preview-icon">'+n.toUpperCase()+'</div><div class="binary-preview-info"><div class="binary-preview-name">'+i+'</div><div class="binary-preview-meta">Binary file — cannot be edited in the browser</div></div><div class="binary-preview-actions"><a class="binary-preview-btn" href="'+o+'" download="'+i+'">Download</a><a class="binary-preview-btn binary-preview-btn-secondary" href="'+o+'" target="_blank">Open in New Tab</a></div></div>')})}segmentMarkdownContent(t){let e=this.pict.AppData.ContentEditor;if(!e.AutoSegmentMarkdown||!t)return[{Content:t||""}];let i=parseInt(e.AutoSegmentDepth,10)||1;if(1===i){let e=t.split("\n"),i=[],n=[],o=!1;for(let t=0;t<e.length;t++){let r=e[t];/^(`{3,}|~{3,})/.test(r.trim())?(o=!o,n.push(r)):o||""!==r.trim()?n.push(r):n.length>0&&(i.push({Content:n.join("\n")}),n=[])}return n.length>0&&i.push({Content:n.join("\n")}),i.length>0?i:[{Content:""}]}let n=new RegExp("^(#{1,"+i+"})\\s"),o=t.split("\n"),r=[],a=[];for(let t=0;t<o.length;t++){let e=o[t];n.test(e.trim())&&a.length>0&&(r.push({Content:a.join("\n")}),a=[]),a.push(e)}return a.length>0&&r.push({Content:a.join("\n")}),r.length>0?r:[{Content:""}]}navigateToFile(t){if(!t)return;if(this.pict.AppData.ContentEditor.IsDirty){let e=this,i=this.pict.views["Pict-Section-Modal"];if(i&&"function"==typeof i.confirm)return void i.confirm("You have unsaved changes to "+this.pict.AppData.ContentEditor.CurrentFile+". Discard and open a different file?",{title:"Unsaved Changes",confirmLabel:"Discard",dangerous:!0}).then(function(i){i&&(e.pict.AppData.ContentEditor.IsDirty=!1,e.navigateToFile(t))});if("undefined"!=typeof confirm&&!confirm("You have unsaved changes. Discard and open a different file?"))return;this.pict.AppData.ContentEditor.IsDirty=!1}let e=this,i=this.getEditorTypeForFile(t);if(this.pict.AppData.ContentEditor.SaveStatus="",this.pict.AppData.ContentEditor.SaveStatusClass="",window.location.hash="#/edit/"+t,this.pict.AppData.ContentEditor.CurrentFile=t,this.pict.AppData.ContentEditor.IsDirty=!1,this.pict.AppData.ContentEditor.ActiveEditor=i,this._cleanupEditors(),this.pict.views["ContentEditor-TopBar"].render(),"binary"===i)return this._showBinaryPreview(t),void this.updateStats();let n=this.pict.providers["ContentEditor-Provider"];this.pict.AppData.ContentEditor.IsLoading=!0,n.loadFile(t,(n,o)=>{if(e.pict.AppData.ContentEditor.IsLoading=!1,n)return e.pict.AppData.ContentEditor.SaveStatus="Error loading file: "+n,e.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-error",void e.pict.views["ContentEditor-TopBar"].render();if("markdown"===i){e.pict.AppData.ContentEditor.Document.Segments=e.segmentMarkdownContent(o);let i=e.pict.views["ContentEditor-MarkdownEditor"];if(i){let n="/content/",o=t.lastIndexOf("/");o>0&&(n="/content/"+t.substring(0,o)+"/"),i.options.ImageBaseURL=n,i.render(),i.marshalToView(),i.setPreviewMode(e.pict.AppData.ContentEditor.ContentPreviewMode||"off"),i.toggleControls(e.pict.AppData.ContentEditor.MarkdownEditingControls)}e.updateStats()}else{e.pict.AppData.ContentEditor.CodeContent=o;let i=t.replace(/^.*\./,"").toLowerCase(),n=u.getLanguageForExtension?u.getLanguageForExtension(i):u.ExtensionLanguageMap[i]||"plaintext",r=e.pict.views["ContentEditor-CodeEditor"];r&&(r.initialRenderComplete=!1,r._language=n,r._suppressNextDirty=!0,r.render(),r.marshalToView(),e.pict.AppData.ContentEditor.CodeWordWrap&&r._editorElement&&(r._editorElement.style.whiteSpace="pre-wrap",r._editorElement.style.overflowWrap="break-word")),e.updateStats()}})}saveCurrentFile(){let t=this.pict.AppData.ContentEditor.CurrentFile;if(!t)return;let e=this.pict.providers["ContentEditor-Provider"],i=this,n="";if("code"===this.pict.AppData.ContentEditor.ActiveEditor){let t=this.pict.views["ContentEditor-CodeEditor"];t&&t.marshalFromView(),n=this.pict.AppData.ContentEditor.CodeContent||""}else{let t=this.pict.views["ContentEditor-MarkdownEditor"];t&&t.marshalFromView();let e=this.pict.AppData.ContentEditor.Document.Segments;if(e&&e.length>0){let t=[];for(let i=0;i<e.length;i++)t.push(e[i].Content||"");n=t.join("\n\n")}}this.pict.AppData.ContentEditor.IsSaving=!0,this.pict.AppData.ContentEditor.SaveStatus="Saving...",this.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-saving",this.pict.views["ContentEditor-TopBar"].render(),e.saveFile(t,n,t=>{i.pict.AppData.ContentEditor.IsSaving=!1,t?(i.pict.AppData.ContentEditor.SaveStatus="Error: "+t,i.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-error"):(i.pict.AppData.ContentEditor.IsDirty=!1,i.pict.AppData.ContentEditor.SaveStatus="Saved",i.pict.AppData.ContentEditor.SaveStatusClass="content-editor-status-saved",i.loadFileList(),setTimeout(()=>{"Saved"===i.pict.AppData.ContentEditor.SaveStatus&&(i.pict.AppData.ContentEditor.SaveStatus="",i.pict.AppData.ContentEditor.SaveStatusClass="",i.pict.views["ContentEditor-TopBar"].render())},3e3)),i.pict.views["ContentEditor-TopBar"].render()})}closeCurrentFile(){this.pict.AppData.ContentEditor.CurrentFile&&(this.pict.AppData.ContentEditor.IsDirty?this._showCloseConfirmation():this._doCloseFile())}_doCloseFile(){this._hideCloseConfirmation(),this._cleanupEditors(),this.pict.AppData.ContentEditor.CurrentFile="",this.pict.AppData.ContentEditor.ActiveEditor="markdown",this.pict.AppData.ContentEditor.IsDirty=!1,this.pict.AppData.ContentEditor.SaveStatus="",this.pict.AppData.ContentEditor.SaveStatusClass="",this.pict.AppData.ContentEditor.Document.Segments=[{Content:""}],this.pict.AppData.ContentEditor.CodeContent="",window.location.hash="",this.pict.views["ContentEditor-TopBar"].render();let t=this.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");t&&t[0]&&(t[0].innerHTML='<div style="display:flex;align-items:center;justify-content:center;height:100%;color:#8A7F72;font-size:1.1em;">Select a file from the sidebar to begin editing</div>'),this.updateStats()}confirmCloseFile(){this._doCloseFile()}cancelCloseFile(){this._hideCloseConfirmation()}_showCloseConfirmation(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-ConfirmOverlay")[0];if(t&&t.classList.add("open"),!this._confirmKeyHandler){let t=this;this._confirmKeyHandler=e=>{let i=e.key.toLowerCase();"y"===i?(e.preventDefault(),t.confirmCloseFile()):"n"!==i&&"Escape"!==e.key||(e.preventDefault(),t.cancelCloseFile())}}window.addEventListener("keydown",this._confirmKeyHandler)}_hideCloseConfirmation(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-ConfirmOverlay")[0];t&&t.classList.remove("open"),this._confirmKeyHandler&&window.removeEventListener("keydown",this._confirmKeyHandler)}createNewFile(t){if(!t)return;t.replace(/^.*\//,"").indexOf(".")<0&&(t+=".md");let e=this.pict.providers["ContentEditor-Provider"],i=this,n="";n=t.endsWith(".md")?"# "+t.replace(/\.[^.]+$/,"").replace(/^.*\//,"")+"\n\n":"// "+t.replace(/^.*\//,"")+"\n",e.saveFile(t,n,e=>{e||i.loadFileList(null,()=>{i.navigateToFile(t)})})}promptNewFile(){let t=prompt("Enter a name for the new file (e.g. my-page.md, script.js, style.css):");t&&t.trim()&&this.createNewFile(t.trim())}promptNewFolder(){let t=prompt("Enter a name for the new folder:");if(!t||!t.trim())return;t=t.trim();let e="";this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(e=this.pict.AppData.PictFileBrowser.CurrentLocation);let i=e?e+"/"+t:t,n=this;fetch("/api/content/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({Path:i})}).then(t=>t.json()).then(t=>{t&&t.Success?(n.log.info(`Folder created: ${i}`),n.loadFileList()):alert("Could not create folder: "+(t?t.Error:"Unknown error"))}).catch(t=>{alert("Error creating folder: "+t.message)})}insertFileReference(t){if(!t)return;let e=this.pict.views["ContentEditor-MarkdownEditor"];if(!e||"markdown"!==this.pict.AppData.ContentEditor.ActiveEditor)return;let i=e._activeSegmentIndex;if(i<0){let t=e._getOrderedSegmentIndices();t.length>0&&(i=t[0])}if(i<0)return;let n=t.replace(/\.[^.]+$/,"");n=n.replace(/^\d{10,}-/,""),n=n.replace(/[-_]+/g," ").trim()||"image";let o=t.substring(t.lastIndexOf(".")).toLowerCase();if([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".avif",".apng",".ico",".tiff",".tif",".jfif"].indexOf(o)>=0)e._insertImageMarkdown(i,t,n);else{let o=e._segmentEditors[i];if(o){let e="["+n+"]("+t+")",i=o.state.selection.main.head;o.dispatch({changes:{from:i,insert:e},selection:{anchor:i+e.length}}),o.focus()}}}handleF4TopicAction(){let t=this.pict.views["ContentEditor-Layout"],e=this.pict.views["ContentEditor-Topics"];if(!t||!e)return;let i=this.pict.AppData.ContentEditor,n=i.ActiveEditor,o=i.CurrentFile,r=0,a=!1;if("markdown"===n&&o){let t=this.pict.views["ContentEditor-MarkdownEditor"];if(t&&t._segmentEditors){let e=0;for(let i in t._segmentEditors){let n=t._segmentEditors[i];if(n&&n.hasFocus){let t=n.state.selection.main.head;r=e+n.state.doc.lineAt(t).number,a=!0;break}n&&n.state&&(e+=n.state.doc.lines)}}}if(i.SidebarCollapsed&&t.toggleSidebar(),t.switchSidebarTab("topics"),a&&o){let t={TopicCode:"New-Topic",TopicHelpFilePath:o,TopicTitle:this._extractFirstHeading()||"New Topic"};r>0&&(t.RelevantMarkdownLine=r),e.addTopic(t)}}_extractFirstHeading(){let t=this.pict.views["ContentEditor-MarkdownEditor"];if(!t||!t._segmentEditors)return"";let e=7,i="";for(let n in t._segmentEditors){let o=t._segmentEditors[n];if(!o||!o.state||!o.state.doc)continue;let r=o.state.doc;for(let t=1;t<=r.lines;t++){let n=r.line(t).text.match(/^(#{1,6})\s+(.+)/);if(n){let t=n[1].length;if(t<e&&(e=t,i=n[2].trim(),1===e))return i}}}return i}updateStats(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-Stats")[0];if(!t)return;let e=this.pict.AppData.ContentEditor.ActiveEditor,i=0,n=0,o=0;if("markdown"===e){let t=this.pict.views["ContentEditor-MarkdownEditor"];if(t&&t._segmentEditors)for(let e in t._segmentEditors){let r=t._segmentEditors[e];if(r&&r.state&&r.state.doc){i+=r.state.doc.lines,n+=r.state.doc.length;let t=r.state.doc.toString().match(/\S+/g);t&&(o+=t.length)}}}else{if("code"!==e)return void(t.textContent="");{let t=this.pict.views["ContentEditor-CodeEditor"];if(t&&t.codeJar){let e=t.codeJar.toString();n=e.length,i=e.split("\n").length;let r=e.match(/\S+/g);r&&(o=r.length)}}}t.textContent=i+" lines · "+o+" words · "+n+" chars"}markDirty(){this.pict.AppData.ContentEditor.IsDirty||(this.pict.AppData.ContentEditor.IsDirty=!0,this.pict.views["ContentEditor-TopBar"].render())}get _settingsKey(){return"retold-content-editor-settings"}saveSettings(){if("undefined"==typeof window||!window.localStorage)return;let t=this.pict.AppData.ContentEditor,e={AutoSegmentMarkdown:t.AutoSegmentMarkdown,AutoSegmentDepth:t.AutoSegmentDepth,ContentPreviewMode:t.ContentPreviewMode,MarkdownEditingControls:t.MarkdownEditingControls,MarkdownWordWrap:t.MarkdownWordWrap,CodeWordWrap:t.CodeWordWrap,SidebarCollapsed:t.SidebarCollapsed,SidebarWidth:t.SidebarWidth,AutoPreviewImages:t.AutoPreviewImages,AutoPreviewVideo:t.AutoPreviewVideo,AutoPreviewAudio:t.AutoPreviewAudio,ShowHiddenFiles:t.ShowHiddenFiles,TopicsFilePath:t.TopicsFilePath};try{window.localStorage.setItem(this._settingsKey,JSON.stringify(e))}catch(t){this.log.warn("Failed to save settings: "+t.message)}}_loadSettings(){if("undefined"!=typeof window&&window.localStorage)try{let t=window.localStorage.getItem(this._settingsKey);if(!t)return;let e=JSON.parse(t),i=this.pict.AppData.ContentEditor;"boolean"==typeof e.AutoSegmentMarkdown&&(i.AutoSegmentMarkdown=e.AutoSegmentMarkdown),"number"==typeof e.AutoSegmentDepth&&(i.AutoSegmentDepth=e.AutoSegmentDepth),"string"==typeof e.ContentPreviewMode?i.ContentPreviewMode=e.ContentPreviewMode:"boolean"==typeof e.AutoContentPreview&&(i.ContentPreviewMode=e.AutoContentPreview?"bottom":"off"),"boolean"==typeof e.MarkdownEditingControls&&(i.MarkdownEditingControls=e.MarkdownEditingControls),"boolean"==typeof e.MarkdownWordWrap&&(i.MarkdownWordWrap=e.MarkdownWordWrap),"boolean"==typeof e.CodeWordWrap&&(i.CodeWordWrap=e.CodeWordWrap),"boolean"==typeof e.SidebarCollapsed&&(i.SidebarCollapsed=e.SidebarCollapsed),"number"==typeof e.SidebarWidth&&(i.SidebarWidth=e.SidebarWidth),"boolean"==typeof e.AutoPreviewImages&&(i.AutoPreviewImages=e.AutoPreviewImages),"boolean"==typeof e.AutoPreviewVideo&&(i.AutoPreviewVideo=e.AutoPreviewVideo),"boolean"==typeof e.AutoPreviewAudio&&(i.AutoPreviewAudio=e.AutoPreviewAudio),"boolean"==typeof e.ShowHiddenFiles&&(i.ShowHiddenFiles=e.ShowHiddenFiles),"string"==typeof e.TopicsFilePath&&(i.TopicsFilePath=e.TopicsFilePath)}catch(t){this.log.warn("Failed to load settings: "+t.message)}}},e.exports.default_configuration=t("./Pict-Application-ContentEditor-Configuration.json")},{"./Pict-Application-ContentEditor-Configuration.json":110,"./providers/Pict-Provider-ContentEditor.js":115,"./views/PictView-Editor-CodeEditor.js":116,"./views/PictView-Editor-Layout.js":117,"./views/PictView-Editor-MarkdownEditor.js":118,"./views/PictView-Editor-MarkdownReference.js":119,"./views/PictView-Editor-SettingsPanel.js":120,"./views/PictView-Editor-TopBar.js":121,"./views/PictView-Editor-Topics.js":122,"pict-application":44,"pict-provider-vocabulary":55,"pict-section-content":62,"pict-section-filebrowser":66,"pict-section-inlinedocumentation":80,"pict-section-modal":100}],112:[function(t,e,i){e.exports={Name:"Retold Content Reader",Hash:"ContentReader",MainViewportViewIdentifier:"Docuserve-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1,pict_configuration:{Product:"ContentReader-Pict-Application"}}},{}],113:[function(t,e,i){const n=t("pict-docuserve");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onAfterInitializeAsync(t){this.pict.AppData.Docuserve={CatalogLoaded:!1,Catalog:null,CoverLoaded:!1,Cover:null,SidebarLoaded:!1,SidebarGroups:[],TopBarLoaded:!1,TopBar:null,ErrorPageLoaded:!1,ErrorPageHTML:null,KeywordIndexLoaded:!1,KeywordDocumentCount:0,CurrentGroup:"",CurrentModule:"",CurrentPath:"",SidebarVisible:!0,DocsBaseURL:"/content/",CatalogURL:"/content/retold-catalog.json"},this.pict.providers["Docuserve-Documentation"].loadCatalog(()=>{let e=this.pict.AppData.Docuserve;return e.CoverLoaded&&e.Cover&&e.Cover.Title?document.title=e.Cover.Title.replace(/<[^>]*>/g,""):e.TopBarLoaded&&e.TopBar&&e.TopBar.Brand&&(document.title=e.TopBar.Brand.replace(/<[^>]*>/g,"")),e.TopBar?(Array.isArray(e.TopBar.ExternalLinks)||(e.TopBar.ExternalLinks=[]),e.TopBar.ExternalLinks.push({Text:"Edit",Href:"/"})):(e.TopBarLoaded=!0,e.TopBar={Brand:"Content System",NavLinks:[],ExternalLinks:[{Text:"Edit",Href:"/"}]}),this.pict.views["Docuserve-Layout"].render(),t()})}},e.exports.default_configuration=t("./Pict-Application-ContentReader-Configuration.json")},{"./Pict-Application-ContentReader-Configuration.json":112,"pict-docuserve":46}],114:[function(t,e,i){e.exports={PictContentReader:t("./Pict-Application-ContentReader.js"),PictContentEditor:t("./Pict-Application-ContentEditor.js")},"undefined"!=typeof window&&(window.PictContentReader=e.exports.PictContentReader,window.PictContentEditor=e.exports.PictContentEditor)},{"./Pict-Application-ContentEditor.js":111,"./Pict-Application-ContentReader.js":113}],115:[function(t,e,i){const n=t("pict-provider");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}loadFile(t,e){let i="function"==typeof e?e:()=>{};if(!t)return i("No file path specified","");fetch("/api/content/read/"+t.split("/").map(encodeURIComponent).join("/")).then(t=>t.ok?t.json():i("File not found: "+t.status,"")).then(t=>t&&t.Success?i(null,t.Content||""):i(t?t.Error:"Unknown error","")).catch(e=>(this.log.warn(`ContentEditor: Error loading file [${t}]: ${e}`),i(e.message,"")))}saveFile(t,e,i){let n="function"==typeof i?i:()=>{};if(!t)return n("No file path specified");fetch("/api/content/save/"+t.split("/").map(encodeURIComponent).join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({Content:e})}).then(t=>t.ok?t.json():n("Save failed: "+t.status)).then(t=>t&&t.Success?n(null):n(t?t.Error:"Unknown error")).catch(e=>(this.log.warn(`ContentEditor: Error saving file [${t}]: ${e}`),n(e.message)))}uploadImage(t,e){let i="function"==typeof e?e:()=>{},n="",o=this.pict.AppData.ContentEditor.CurrentFile;if(o){let t=o.lastIndexOf("/");t>0&&(n=o.substring(0,t))}else this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(n=this.pict.AppData.PictFileBrowser.CurrentLocation);let r={"Content-Type":t.type,"x-filename":t.name};n&&(r["x-upload-path"]=n),fetch("/api/content/upload-image",{method:"POST",body:t,headers:r}).then(t=>t.json()).then(t=>t&&t.Success&&t.URL?i(null,t.URL):i(t?t.Error:"Upload failed")).catch(t=>(this.log.warn(`ContentEditor: Image upload failed: ${t}`),i(t.message)))}},e.exports.default_configuration={ProviderIdentifier:"ContentEditor-Provider",AutoInitialize:!0,AutoInitializeOrdinal:0}},{"pict-provider":58}],116:[function(t,e,i){const n=t("pict-section-code"),o={js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",json:"json",html:"xml",htm:"xml",xml:"xml",svg:"xml",css:"css",scss:"scss",sass:"scss",less:"less",sql:"sql",py:"python",rb:"ruby",java:"java",kt:"kotlin",kts:"kotlin",go:"go",rs:"rust",c:"c",h:"c",cpp:"cpp",cc:"cpp",hpp:"cpp",cs:"csharp",swift:"swift",php:"php",sh:"bash",bash:"bash",zsh:"bash",fish:"bash",yml:"yaml",yaml:"yaml",toml:"ini",ini:"ini",cfg:"ini",conf:"ini",dockerfile:"dockerfile",docker:"dockerfile",makefile:"makefile",mk:"makefile",md:"markdown",markdown:"markdown",lua:"lua",r:"r",pl:"perl",pm:"perl",ex:"elixir",exs:"elixir",erl:"erlang",hrl:"erlang",hs:"haskell",clj:"clojure",scala:"scala",dart:"dart",groovy:"groovy",gradle:"groovy",tf:"terraform",vim:"vim",diff:"diff",patch:"diff",log:"accesslog",txt:"plaintext"};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._suppressNextDirty=!1}onAfterInitialRender(){if("undefined"!=typeof window&&window.CodeJarModules&&window.CodeJarModules.CodeJar&&this.connectCodeJarPrototype(window.CodeJarModules.CodeJar),"undefined"!=typeof window&&window.CodeJarModules&&window.CodeJarModules.hljs){let t=window.CodeJarModules.hljs,e=this._language;this._highlightFunction=function(i){i.removeAttribute("data-highlighted"),delete i.dataset.highlighted,i.className=i.className.replace(/\bhljs\b/g,"").replace(/\blanguage-\S+/g,"").trim(),i.classList.add("hljs"),e&&"plaintext"!==e&&i.classList.add("language-"+e),t.highlightElement(i)}}return super.onAfterInitialRender()}setLanguage(t){if(this._language=t,"undefined"!=typeof window&&window.CodeJarModules&&window.CodeJarModules.hljs){let e=window.CodeJarModules.hljs,i=t;this._highlightFunction=function(t){t.removeAttribute("data-highlighted"),delete t.dataset.highlighted,t.className=t.className.replace(/\bhljs\b/g,"").replace(/\blanguage-\S+/g,"").trim(),t.classList.add("hljs"),i&&"plaintext"!==i&&t.classList.add("language-"+i),e.highlightElement(t)}}if(this._editorElement&&(this._editorElement.className="pict-code-editor language-"+t,this.options.LineNumbers||(this._editorElement.className+=" pict-code-no-line-numbers")),this.codeJar){let t=this.codeJar.toString();this.codeJar.destroy(),this.codeJar=this._codeJarPrototype(this._editorElement,this._highlightFunction,{tab:this.options.Tab,catchTab:this.options.CatchTab,addClosing:this.options.AddClosing}),this.codeJar.updateCode(t),this.codeJar.onUpdate(t=>{this._updateLineNumbers(),this.onCodeChange(t)})}}onCodeChange(t){super.onCodeChange(t),this._suppressNextDirty?this._suppressNextDirty=!1:this.pict.PictApplication&&(this.pict.PictApplication.markDirty(),this.pict.PictApplication.updateStats())}static getLanguageForExtension(t){if(!t)return"plaintext";let e=t.toLowerCase();return o[e]||"plaintext"}},e.exports.default_configuration={ViewIdentifier:"ContentEditor-CodeEditor",DefaultRenderable:"CodeEditor-Wrap",DefaultDestinationAddress:"#ContentEditor-Editor-Container",TargetElementAddress:"#ContentEditor-Editor-Container",CodeDataAddress:"AppData.ContentEditor.CodeContent",ReadOnly:!1,LineNumbers:!0,Language:"javascript",Tab:"\t",AutoRender:!1,Renderables:[{RenderableHash:"CodeEditor-Wrap",TemplateHash:"CodeEditor-Container",DestinationAddress:"#ContentEditor-Editor-Container"}]},e.exports.ExtensionLanguageMap=o},{"pict-section-code":61}],117:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"ContentEditor-Layout",DefaultRenderable:"ContentEditor-Layout-Shell",DefaultDestinationAddress:"#ContentEditor-Application-Container",AutoRender:!1,CSS:'\n\t\t#ContentEditor-Application-Container\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100vh;\n\t\t\tbackground: #F5F3EE;\n\t\t}\n\t\t#ContentEditor-TopBar-Container\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-body\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex: 1;\n\t\t\tmin-height: 0;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t/* Sidebar wrapper holds the sidebar content + collapse toggle */\n\t\t.content-editor-sidebar-wrap\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 0;\n\t\t\tposition: relative;\n\t\t\ttransition: width 0.2s ease;\n\t\t}\n\t\t/* Inner wrapper: vertical flex for tab bar + panes */\n\t\t.content-editor-sidebar-inner\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\tmin-height: 0;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t/* Sidebar tab bar */\n\t\t.content-editor-sidebar-tabs\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-shrink: 0;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tbackground: #F5F0EA;\n\t\t}\n\t\t.content-editor-sidebar-tab\n\t\t{\n\t\t\tflex: 1;\n\t\t\tpadding: 7px 0;\n\t\t\tborder: none;\n\t\t\tbackground: transparent;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\tborder-bottom: 2px solid transparent;\n\t\t\ttransition: color 0.15s, border-color 0.15s;\n\t\t}\n\t\t.content-editor-sidebar-tab:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.content-editor-sidebar-tab.active\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t\tborder-bottom-color: #2E7D74;\n\t\t}\n\t\t.content-editor-sidebar-addfile\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 30px;\n\t\t\tborder: none;\n\t\t\tbackground: transparent;\n\t\t\tfont-size: 1.1rem;\n\t\t\tfont-weight: 400;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tborder-bottom: 2px solid transparent;\n\t\t\ttransition: color 0.15s, background 0.15s;\n\t\t}\n\t\t.content-editor-sidebar-addfile:hover\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t/* Sidebar panes */\n\t\t.content-editor-sidebar-pane\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\toverflow-x: hidden;\n\t\t\tmin-width: 0;\n\t\t\tmin-height: 0;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container\n\t\t{\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t/* Vocabulary panel: map the provider\'s CSS custom\n\t\t properties to the CMS light-theme palette so the\n\t\t shared vocabulary module renders consistently. */\n\t\t#ContentEditor-Vocabulary-Container\n\t\t{\n\t\t\t--bg-primary: #FAF8F4;\n\t\t\t--bg-secondary: #F5F0EA;\n\t\t\t--bg-hover: #EDE9E3;\n\t\t\t--border-color: #DDD6CA;\n\t\t\t--accent: #2E7D74;\n\t\t\t--text-primary: #3D3229;\n\t\t\t--text-secondary: #5E5549;\n\t\t\t--text-muted: #8A7F72;\n\t\t}\n\t\t/* File browser layout overrides for sidebar use */\n\t\t#ContentEditor-Sidebar-Container .pict-filebrowser\n\t\t{\n\t\t\tborder: none;\n\t\t\tborder-radius: 0;\n\t\t\tbackground: transparent;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-filebrowser-browse-pane\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t#ContentEditor-Sidebar-Container .pict-filebrowser-view-pane\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Hide size/date columns — the sidebar is too narrow for them */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-col-size,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-col-modified,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-size,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-modified\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Hide the column header bar in sidebar mode */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-header\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t/* Breadcrumb bar: flex wrapper with create-folder button */\n\t\t.pict-fb-breadcrumb-bar\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tbackground: #F5F0E8;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t}\n\t\t.pict-fb-breadcrumb-bar .pict-fb-breadcrumb\n\t\t{\n\t\t\tflex: 1;\n\t\t\tborder-bottom: none;\n\t\t}\n\t\t.pict-fb-breadcrumb-addfolder\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tfont-size: 1.1rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 4px 10px;\n\t\t\tline-height: 1;\n\t\t\tborder-radius: 4px;\n\t\t\tmargin-right: 4px;\n\t\t}\n\t\t.pict-fb-breadcrumb-addfolder:hover\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t\tbackground: #EAE3D8;\n\t\t}\n\t\t#ContentEditor-Editor-Container\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tpadding: 44px 16px 16px 16px;\n\t\t}\n\t\t/* Right-side inline documentation panel */\n\t\t.content-editor-doc-panel\n\t\t{\n\t\t\twidth: 340px;\n\t\t\tmin-width: 260px;\n\t\t\tmax-width: 500px;\n\t\t\tborder-left: 1px solid #DDD6CA;\n\t\t\toverflow-y: auto;\n\t\t\tbackground: #FAF8F4;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-doc-toggle\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 6px;\n\t\t\tright: 8px;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tpadding: 3px 8px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #5E5549;\n\t\t\tcursor: pointer;\n\t\t\tz-index: 5;\n\t\t}\n\t\t.content-editor-doc-toggle:hover\n\t\t{\n\t\t\tbackground: #EAE3D8;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t/* Code editor: fill the container and remove outer border */\n\t\t#ContentEditor-Editor-Container .pict-code-editor-wrap\n\t\t{\n\t\t\theight: calc(100% - 4px);\n\t\t\tborder: none;\n\t\t\tborder-radius: 0;\n\t\t}\n\t\t#ContentEditor-Editor-Container .pict-code-editor\n\t\t{\n\t\t\tmin-height: unset;\n\t\t\theight: 100%;\n\t\t\tbackground: #FAFAFA;\n\t\t}\n\t\t/* Binary file preview */\n\t\t.binary-preview-image-wrap\n\t\t{\n\t\t\tmargin-bottom: 20px;\n\t\t}\n\t\t.binary-preview-image\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 6px;\n\t\t\tpadding: 24px;\n\t\t}\n\t\t.binary-preview-image img\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 400px;\n\t\t\tobject-fit: contain;\n\t\t\tborder-radius: 4px;\n\t\t}\n\t\t.binary-preview-card\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 20px;\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 6px;\n\t\t\tpadding: 24px;\n\t\t\tmax-width: 600px;\n\t\t}\n\t\t.binary-preview-icon\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\twidth: 64px;\n\t\t\theight: 64px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder-radius: 8px;\n\t\t\tfont-size: 0.75rem;\n\t\t\tfont-weight: 700;\n\t\t\tcolor: #5E5549;\n\t\t\tletter-spacing: 0.5px;\n\t\t}\n\t\t.binary-preview-info\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.binary-preview-name\n\t\t{\n\t\t\tfont-size: 1rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-bottom: 6px;\n\t\t\tword-break: break-all;\n\t\t}\n\t\t.binary-preview-meta\n\t\t{\n\t\t\tfont-size: 0.8rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tline-height: 1.6;\n\t\t}\n\t\t.binary-preview-actions\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\tgap: 8px;\n\t\t}\n\t\t.binary-preview-btn\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 8px 16px;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.8rem;\n\t\t\tfont-weight: 600;\n\t\t\ttext-decoration: none;\n\t\t\ttext-align: center;\n\t\t\tcursor: pointer;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t}\n\t\t.binary-preview-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.binary-preview-btn-secondary\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t}\n\t\t.binary-preview-btn-secondary:hover\n\t\t{\n\t\t\tborder-color: #8A7F72;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.binary-preview-btn-preview\n\t\t{\n\t\t\tpadding: 10px 20px;\n\t\t\tfont-size: 0.85rem;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tbackground: #FAF8F4;\n\t\t\tcolor: #3D3229;\n\t\t\tcursor: pointer;\n\t\t\tborder-radius: 6px;\n\t\t\ttransition: background 0.15s, border-color 0.15s;\n\t\t}\n\t\t.binary-preview-btn-preview:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder-color: #8A7F72;\n\t\t}\n\t\t#ContentEditor-MediaPreviewPlaceholder\n\t\t{\n\t\t\tmargin-bottom: 20px;\n\t\t}\n\t\t.binary-preview-media-wrap\n\t\t{\n\t\t\tmargin-bottom: 20px;\n\t\t}\n\t\t.binary-preview-video\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tmax-width: 100%;\n\t\t\tmax-height: 500px;\n\t\t\tborder-radius: 6px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tbackground: #000;\n\t\t}\n\t\t.binary-preview-audio\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tmax-width: 500px;\n\t\t}\n\t\t/* Image upload overlay */\n\t\t.content-editor-upload-overlay\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t\tz-index: 1099;\n\t\t\tbackground: rgba(0, 0, 0, 0.35);\n\t\t}\n\t\t.content-editor-upload-overlay.open\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.content-editor-upload-panel\n\t\t{\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 10px;\n\t\t\tbox-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);\n\t\t\twidth: 420px;\n\t\t\tmax-width: 90vw;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.content-editor-upload-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tpadding: 14px 18px;\n\t\t\tborder-bottom: 1px solid #EDE9E3;\n\t\t}\n\t\t.content-editor-upload-title\n\t\t{\n\t\t\tfont-size: 0.95rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.content-editor-upload-close\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tfont-size: 1.2rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 2px 6px;\n\t\t\tline-height: 1;\n\t\t\tborder-radius: 4px;\n\t\t}\n\t\t.content-editor-upload-close:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #F0EDE8;\n\t\t}\n\t\t.content-editor-upload-body\n\t\t{\n\t\t\tpadding: 18px;\n\t\t}\n\t\t.content-editor-upload-dropzone\n\t\t{\n\t\t\tborder: 2px dashed #DDD6CA;\n\t\t\tborder-radius: 8px;\n\t\t\tpadding: 28px 16px;\n\t\t\ttext-align: center;\n\t\t\tcursor: pointer;\n\t\t\ttransition: border-color 0.15s, background 0.15s;\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t.content-editor-upload-dropzone:hover,\n\t\t.content-editor-upload-dropzone.dragover\n\t\t{\n\t\t\tborder-color: #2E7D74;\n\t\t\tbackground: #F0FAF8;\n\t\t}\n\t\t.content-editor-upload-dropzone-icon\n\t\t{\n\t\t\tfont-size: 2rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.content-editor-upload-dropzone-text\n\t\t{\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.content-editor-upload-dropzone-hint\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-top: 4px;\n\t\t}\n\t\t.content-editor-upload-file-input\n\t\t{\n\t\t\tdisplay: none;\n\t\t}\n\t\t.content-editor-upload-status\n\t\t{\n\t\t\tmargin-top: 12px;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t\tmin-height: 20px;\n\t\t}\n\t\t.content-editor-upload-status-error\n\t\t{\n\t\t\tcolor: #D9534F;\n\t\t}\n\t\t.content-editor-upload-status-success\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.content-editor-upload-result\n\t\t{\n\t\t\tmargin-top: 12px;\n\t\t\tpadding: 10px 12px;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 6px;\n\t\t}\n\t\t.content-editor-upload-result-label\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 4px;\n\t\t}\n\t\t.content-editor-upload-result-url\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 6px;\n\t\t}\n\t\t.content-editor-upload-result-text\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-family: monospace;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: #3D3229;\n\t\t\tword-break: break-all;\n\t\t}\n\t\t.content-editor-upload-result-copy\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tpadding: 4px 10px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.content-editor-upload-result-copy:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.content-editor-upload-kbd\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 1px 5px;\n\t\t\tfont-size: 0.68rem;\n\t\t\tfont-family: monospace;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.content-editor-upload-footer\n\t\t{\n\t\t\tpadding: 10px 18px;\n\t\t\tborder-top: 1px solid #EDE9E3;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-align: center;\n\t\t}\n\n\t\t/* File browser row insert button — hidden by default, shown on\n\t\t hover for image file rows via CSS attribute selectors. */\n\t\t.pict-fb-insert-btn\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tposition: absolute;\n\t\t\tright: 6px;\n\t\t\ttop: 50%;\n\t\t\ttransform: translateY(-50%);\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 700;\n\t\t\tline-height: 1;\n\t\t\tpadding: 2px 7px;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.pict-fb-insert-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t/* Make the row position:relative so the button can be absolutely placed */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row\n\t\t{\n\t\t\tposition: relative;\n\t\t}\n\t\t/* Show the insert button on hover for image file extensions.\n\t\t CSS attribute selector [data-name$=".ext" i] matches\n\t\t the end of the data-name attribute, case-insensitive. */\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".png" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".jpg" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".jpeg" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".gif" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".webp" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".svg" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".bmp" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".avif" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".apng" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".ico" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".tiff" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".tif" i]:hover .pict-fb-insert-btn,\n\t\t#ContentEditor-Sidebar-Container .pict-fb-detail-row[data-name$=".jfif" i]:hover .pict-fb-insert-btn\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Tablet / Phone (max-width: 768px)\n\t\t ============================================ */\n\t\t@media (max-width: 768px)\n\t\t{\n\t\t\t/* Prevent horizontal scroll on the whole app */\n\t\t\t#ContentEditor-Application-Container\n\t\t\t{\n\t\t\t\toverflow-x: hidden;\n\t\t\t\twidth: 100%;\n\t\t\t\tmax-width: 100vw;\n\t\t\t}\n\n\t\t\t/* Stack sidebar ABOVE editor instead of side-by-side */\n\t\t\t.content-editor-body\n\t\t\t{\n\t\t\t\tflex-direction: column;\n\t\t\t}\n\n\t\t\t/* Both panels become full-width horizontal strips */\n\t\t\t.content-editor-sidebar-wrap,\n\t\t\t.content-editor-doc-panel\n\t\t\t{\n\t\t\t\twidth: 100% !important;\n\t\t\t\tmax-height: 40vh;\n\t\t\t\tflex-shrink: 0;\n\t\t\t\tborder-right: none;\n\t\t\t}\n\t\t\t.content-editor-sidebar-wrap\n\t\t\t{\n\t\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\t}\n\t\t\t.content-editor-doc-panel\n\t\t\t{\n\t\t\t\tborder-left: none;\n\t\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\t}\n\n\t\t\t/* Give the Reference and Topics tabs much more room on mobile\n\t\t\t since they contain long scrollable content */\n\t\t\t.content-editor-sidebar-wrap.sidebar-expanded-pane\n\t\t\t{\n\t\t\t\tmax-height: 70vh;\n\t\t\t}\n\n\t\t\t/* When panels are collapsed on mobile, zero height instead of\n\t\t\t zero width since the layout is stacked vertically */\n\t\t\t.content-editor-sidebar-wrap.pict-panel-collapsed,\n\t\t\t.content-editor-doc-panel.pict-panel-collapsed\n\t\t\t{\n\t\t\t\twidth: 100% !important;\n\t\t\t\tmax-height: 0;\n\t\t\t}\n\t\t\t.content-editor-sidebar-wrap.pict-panel-collapsed .content-editor-sidebar-inner\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t/* Reduce editor container padding (less gutters) */\n\t\t\t#ContentEditor-Editor-Container\n\t\t\t{\n\t\t\t\tpadding: 24px 8px 8px 8px;\n\t\t\t}\n\n\t\t\t/* Reduce binary preview padding */\n\t\t\t.binary-preview-image\n\t\t\t{\n\t\t\t\tpadding: 12px;\n\t\t\t}\n\t\t\t.binary-preview-card\n\t\t\t{\n\t\t\t\tpadding: 12px;\n\t\t\t\tgap: 12px;\n\t\t\t}\n\n\t\t\t/* Upload panel: fill more of the screen */\n\t\t\t.content-editor-upload-panel\n\t\t\t{\n\t\t\t\twidth: 95vw;\n\t\t\t\tmax-width: 95vw;\n\t\t\t}\n\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Small phone (max-width: 480px)\n\t\t ============================================ */\n\t\t@media (max-width: 480px)\n\t\t{\n\t\t\t/* Even tighter editor padding */\n\t\t\t#ContentEditor-Editor-Container\n\t\t\t{\n\t\t\t\tpadding: 20px 4px 4px 4px;\n\t\t\t}\n\n\t\t\t/* Sidebar gets a smaller max height */\n\t\t\t.content-editor-sidebar-wrap\n\t\t\t{\n\t\t\t\tmax-height: 35vh;\n\t\t\t}\n\t\t\t.content-editor-sidebar-wrap.sidebar-expanded-pane\n\t\t\t{\n\t\t\t\tmax-height: 65vh;\n\t\t\t}\n\t\t}\n\t',Templates:[{Hash:"ContentEditor-Layout-Shell-Template",Template:'\n<div id="ContentEditor-TopBar-Container"></div>\n<div class="content-editor-body">\n\t<div class="content-editor-sidebar-wrap" id="ContentEditor-SidebarWrap">\n\t\t<div class="content-editor-sidebar-inner">\n\t\t\t<div class="content-editor-sidebar-tabs">\n\t\t\t\t<button class="content-editor-sidebar-tab active" id="ContentEditor-SidebarTab-Files"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].switchSidebarTab(\'files\')">Files</button>\n\t\t\t\t<button class="content-editor-sidebar-tab" id="ContentEditor-SidebarTab-Reference"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].switchSidebarTab(\'reference\')">Reference</button>\n\t\t\t\t<button class="content-editor-sidebar-tab" id="ContentEditor-SidebarTab-Topics"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].switchSidebarTab(\'topics\')">Topics</button>\n\t\t\t\t<button class="content-editor-sidebar-tab" id="ContentEditor-SidebarTab-Vocabulary"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].switchSidebarTab(\'vocabulary\')">Vocab</button>\n\t\t\t\t<button class="content-editor-sidebar-addfile" id="ContentEditor-SidebarAddBtn" title="New file"\n\t\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].onSidebarAddClick()">+</button>\n\t\t\t</div>\n\t\t\t<div id="ContentEditor-Sidebar-Container" class="content-editor-sidebar-pane"></div>\n\t\t\t<div id="ContentEditor-SidebarReference-Container" class="content-editor-sidebar-pane" style="display:none"></div>\n\t\t\t<div id="ContentEditor-SidebarTopics-Container" class="content-editor-sidebar-pane" style="display:none"></div>\n\t\t\t<div id="ContentEditor-Vocabulary-Container" class="content-editor-sidebar-pane" style="display:none"></div>\n\t\t</div>\n\t</div>\n\t<div id="ContentEditor-Editor-Container"></div>\n\t<div id="ContentEditor-Documentation-Panel" class="content-editor-doc-panel"></div>\n</div>\n<div class="content-editor-upload-overlay" id="ContentEditor-UploadOverlay"\n\tonclick="{~P~}.views[\'ContentEditor-Layout\'].onUploadOverlayClick(event)">\n\t<div class="content-editor-upload-panel">\n\t\t<div class="content-editor-upload-header">\n\t\t\t<span class="content-editor-upload-title">Upload Image</span>\n\t\t\t<button class="content-editor-upload-close"\n\t\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].toggleUploadForm()">×</button>\n\t\t</div>\n\t\t<div class="content-editor-upload-body">\n\t\t\t<div class="content-editor-upload-dropzone" id="ContentEditor-UploadDropzone"\n\t\t\t\tonclick="{~P~}.ContentAssignment.getElement(\'#ContentEditor-UploadFileInput\')[0].click()">\n\t\t\t\t<div class="content-editor-upload-dropzone-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M2 5h2l1.5-2h5L12 5h2a1 1 0 011 1v6a1 1 0 01-1 1H2a1 1 0 01-1-1V6a1 1 0 011-1z"/><circle cx="8" cy="9" r="2.5"/></svg></div>\n\t\t\t\t<div class="content-editor-upload-dropzone-text">Drop an image here or click to browse</div>\n\t\t\t\t<div class="content-editor-upload-dropzone-hint">PNG, JPG, GIF, WebP, SVG, BMP</div>\n\t\t\t</div>\n\t\t\t<input type="file" class="content-editor-upload-file-input" id="ContentEditor-UploadFileInput"\n\t\t\t\taccept="image/png,image/jpeg,image/gif,image/webp,image/svg+xml,image/bmp"\n\t\t\t\tonchange="{~P~}.views[\'ContentEditor-Layout\'].onUploadFileSelected(this)">\n\t\t\t<div class="content-editor-upload-status" id="ContentEditor-UploadStatus"></div>\n\t\t\t<div id="ContentEditor-UploadResult"></div>\n\t\t</div>\n\t\t<div class="content-editor-upload-footer">\n\t\t\t<span class="content-editor-upload-kbd">F3</span> or\n\t\t\t<span class="content-editor-upload-kbd">Ctrl+Shift+U</span> to toggle\n\t\t</div>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-Layout-Shell",TemplateHash:"ContentEditor-Layout-Shell-Template",DestinationAddress:"#ContentEditor-Application-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._minSidebarWidth=140,this._maxSidebarWidth=600}onAfterRender(t,e,i,n){this.pict.views["ContentEditor-TopBar"].render();let o=this.pict.ContentAssignment.getElement("#ContentEditor-Editor-Container");o&&o[0]&&!this.pict.AppData.ContentEditor.CurrentFile&&this.pict.ContentAssignment.assignContent("#ContentEditor-Editor-Container",'<div style="display:flex;align-items:center;justify-content:center;height:100%;color:#8A7F72;font-size:1.1em;">Select a file from the sidebar to begin editing</div>'),this.pict.CSSMap.injectCSS();let r=this,a=this.pict.AppData.ContentEditor,s=this.pict.views["Pict-Section-Modal"];if(s&&"function"==typeof s.panel){let t=window.innerWidth<=768;this._sidebarPanel=s.panel("#ContentEditor-SidebarWrap",{position:"left",width:a.SidebarWidth||250,minWidth:140,maxWidth:600,collapsible:!0,collapsed:a.SidebarCollapsed||t,persist:!0,persistKey:"ContentEditor-Sidebar",onResize:t=>{a.SidebarWidth=t,r.pict.PictApplication.saveSettings()},onToggle:t=>{a.SidebarCollapsed=t,r.pict.PictApplication.saveSettings()}})}return window.addEventListener("hashchange",()=>{r.pict.PictApplication.resolveHash()}),window.addEventListener("keydown",t=>{if((t.metaKey||t.ctrlKey)&&"s"===t.key)return t.preventDefault(),void r.pict.PictApplication.saveCurrentFile();if("F1"===t.key)return t.preventDefault(),void r._handleF1();if("F2"===t.key)return t.preventDefault(),void r.toggleSidebar();if("F3"===t.key)return t.preventDefault(),void r.toggleUploadForm();if((t.metaKey||t.ctrlKey)&&t.shiftKey&&("u"===t.key||"U"===t.key))return t.preventDefault(),void r.toggleUploadForm();if("F4"===t.key)return t.preventDefault(),void r.pict.PictApplication.handleF4TopicAction();if((t.metaKey||t.ctrlKey)&&t.shiftKey&&("t"===t.key||"T"===t.key))return t.preventDefault(),void r.pict.PictApplication.handleF4TopicAction();if("Escape"===t.key){let e=r.pict.ContentAssignment.getElement("#ContentEditor-UploadOverlay")[0];if(e&&e.classList.contains("open"))return void r.closeUploadForm();let i=r.pict.ContentAssignment.getElement("#ContentEditor-ConfirmOverlay")[0];if(i&&i.classList.contains("open"))return;if(r.pict.AppData.ContentEditor.CurrentFile)return t.preventDefault(),void r.pict.PictApplication.closeCurrentFile()}}),super.onAfterRender(t,e,i,n)}onSidebarAddClick(){if("vocabulary"===this.getActiveSidebarTab()){let t=this.pict.views["ContentEditor-Vocabulary"];t&&"function"==typeof t.createTerm&&t.createTerm()}else this.pict.PictApplication.promptNewFile()}toggleDocPanel(){if(this.pict.PictApplication._docPanel){this.pict.PictApplication._docPanel.toggle();let t=this.pict.ContentAssignment.getElement("#ContentEditor-Documentation-Panel")[0];if(t&&!t._initialized){t._initialized=!0;let e=this.pict.providers&&this.pict.providers["Pict-InlineDocumentation"];e&&"function"==typeof e.loadDocument&&e.loadDocument("README.md")}return}let t=this.pict.ContentAssignment.getElement("#ContentEditor-Documentation-Panel")[0];if(!t)return;let e="none"!==t.style.display;if(t.style.display=e?"none":"",!e){let e=this.pict.providers&&this.pict.providers["Pict-InlineDocumentation"];e&&!t._initialized&&(t._initialized=!0,"function"==typeof e.loadDocument&&e.loadDocument("README.md"))}}toggleSidebar(){this._sidebarPanel&&this._sidebarPanel.toggle()}switchSidebarTab(t){let e={files:this.pict.ContentAssignment.getElement("#ContentEditor-Sidebar-Container")[0],reference:this.pict.ContentAssignment.getElement("#ContentEditor-SidebarReference-Container")[0],topics:this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTopics-Container")[0],vocabulary:this.pict.ContentAssignment.getElement("#ContentEditor-Vocabulary-Container")[0]},i={files:this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTab-Files")[0],reference:this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTab-Reference")[0],topics:this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTab-Topics")[0],vocabulary:this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTab-Vocabulary")[0]};for(let t in e)e[t]&&(e[t].style.display="none"),i[t]&&i[t].classList.remove("active");e[t]&&(e[t].style.display=""),i[t]&&i[t].classList.add("active");let n=this.pict.ContentAssignment.getElement("#ContentEditor-SidebarWrap")[0];n&&("reference"===t||"topics"===t||"vocabulary"===t?n.classList.add("sidebar-expanded-pane"):n.classList.remove("sidebar-expanded-pane"));let o=this.pict.ContentAssignment.getElement("#ContentEditor-SidebarAddBtn")[0];if(o&&(o.title="vocabulary"===t?"New vocabulary term":"New file"),"reference"===t){let t=this.pict.views["ContentEditor-MarkdownReference"];t&&!t._hasRendered&&t.render()}if("topics"===t){let t=this.pict.views["ContentEditor-Topics"];t&&!t._hasRendered&&t.render()}if("vocabulary"===t){let t=this.pict.views["ContentEditor-Vocabulary"];t&&t.refreshTermList()}}_handleF1(){if(this.pict.AppData.ContentEditor.SidebarCollapsed)return this.toggleSidebar(),void this.switchSidebarTab("reference");let t=this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTab-Reference")[0];t&&t.classList.contains("active")?this.switchSidebarTab("files"):this.switchSidebarTab("reference")}getActiveSidebarTab(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTab-Reference")[0],e=this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTab-Topics")[0],i=this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTab-Vocabulary")[0];return t&&t.classList.contains("active")?"reference":e&&e.classList.contains("active")?"topics":i&&i.classList.contains("active")?"vocabulary":"files"}toggleUploadForm(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-UploadOverlay")[0];t&&(t.classList.contains("open")?this.closeUploadForm():this.openUploadForm())}openUploadForm(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-UploadOverlay")[0];t&&t.classList.add("open"),this._wireUploadDropzone()}closeUploadForm(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-UploadOverlay")[0];t&&t.classList.remove("open");let e=this.pict.ContentAssignment.getElement("#ContentEditor-UploadFileInput")[0];e&&(e.value=""),this.pict.ContentAssignment.assignContent("#ContentEditor-UploadStatus",""),this.pict.ContentAssignment.assignContent("#ContentEditor-UploadResult","")}onUploadOverlayClick(t){"ContentEditor-UploadOverlay"===t.target.id&&this.closeUploadForm()}onUploadFileSelected(t){t.files&&t.files.length>0&&this._uploadFile(t.files[0])}_wireUploadDropzone(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-UploadDropzone")[0];if(!t||t._wired)return;t._wired=!0;let e=this;t.addEventListener("dragover",e=>{e.preventDefault(),e.stopPropagation(),t.classList.add("dragover")}),t.addEventListener("dragleave",e=>{e.preventDefault(),e.stopPropagation(),t.classList.remove("dragover")}),t.addEventListener("drop",i=>{i.preventDefault(),i.stopPropagation(),t.classList.remove("dragover"),i.dataTransfer&&i.dataTransfer.files&&i.dataTransfer.files.length>0&&e._uploadFile(i.dataTransfer.files[0])})}_uploadFile(t){if(!t)return;if(!t.type.startsWith("image/"))return void this.pict.ContentAssignment.assignContent("#ContentEditor-UploadStatus",'<span class="content-editor-upload-status-error">Only image files are supported.</span>');this.pict.ContentAssignment.assignContent("#ContentEditor-UploadStatus","Uploading <strong>"+t.name+"</strong>..."),this.pict.ContentAssignment.assignContent("#ContentEditor-UploadResult","");let e=this,i=this.pict.providers["ContentEditor-Provider"];i?i.uploadImage(t,(i,n)=>{if(i)return void e.pict.ContentAssignment.assignContent("#ContentEditor-UploadStatus",'<span class="content-editor-upload-status-error">Upload failed: '+i+"</span>");e.pict.ContentAssignment.assignContent("#ContentEditor-UploadStatus",'<span class="content-editor-upload-status-success">Uploaded successfully!</span>');let o="";e.pict.ContentAssignment.assignContent("#ContentEditor-UploadResult",'<div class="content-editor-upload-result"><div class="content-editor-upload-result-label">Markdown</div><div class="content-editor-upload-result-url"><span class="content-editor-upload-result-text">'+o+'</span><button class="content-editor-upload-result-copy" onclick="navigator.clipboard.writeText(\''+o.replace(/'/g,"\\'")+'\').then(function(){this.textContent=\'Copied!\'}.bind(this))">Copy</button></div><div class="content-editor-upload-result-label" style="margin-top:8px">URL</div><div class="content-editor-upload-result-url"><span class="content-editor-upload-result-text">'+n+'</span><button class="content-editor-upload-result-copy" onclick="navigator.clipboard.writeText(\''+n.replace(/'/g,"\\'")+"').then(function(){this.textContent='Copied!'}.bind(this))\">Copy</button></div></div>"),e.pict.PictApplication.loadFileList()}):this.pict.ContentAssignment.assignContent("#ContentEditor-UploadStatus",'<span class="content-editor-upload-status-error">Provider not available.</span>')}},e.exports.default_configuration=o},{"pict-view":102}],118:[function(t,e,i){const n=t("pict-section-markdowneditor");e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onImageUpload(t,e,i){let n=this.pict.providers["ContentEditor-Provider"];return!!n&&(n.uploadImage(t,(t,e)=>{t?i(t):i(null,e)}),!0)}customConfigureExtensions(t,e){if(this.pict.AppData.ContentEditor&&this.pict.AppData.ContentEditor.MarkdownWordWrap){let e=this._codeMirrorModules;e&&e.EditorView&&e.EditorView.lineWrapping&&t.push(e.EditorView.lineWrapping)}return t}onContentChange(t,e){this.pict.PictApplication&&(this.pict.PictApplication.markDirty(),this.pict.PictApplication.updateStats())}},e.exports.default_configuration={ViewIdentifier:"ContentEditor-MarkdownEditor",DefaultRenderable:"MarkdownEditor-Wrap",DefaultDestinationAddress:"#ContentEditor-Editor-Container",TargetElementAddress:"#ContentEditor-Editor-Container",ContentDataAddress:"AppData.ContentEditor.Document.Segments",ReadOnly:!1,EnableRichPreview:!0,AutoRender:!1,Renderables:[{RenderableHash:"MarkdownEditor-Wrap",TemplateHash:"MarkdownEditor-Container",DestinationAddress:"#ContentEditor-Editor-Container"}]}},{"pict-section-markdowneditor":92}],119:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"ContentEditor-MarkdownReference",DefaultRenderable:"ContentEditor-MarkdownReference-Display",DefaultDestinationAddress:"#ContentEditor-SidebarReference-Container",AutoRender:!1,CSS:"\n\t\t.md-ref-container\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t.md-ref-search-bar\n\t\t{\n\t\t\tposition: sticky;\n\t\t\ttop: 0;\n\t\t\tz-index: 5;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 4px;\n\t\t\tpadding: 6px 8px;\n\t\t\tbackground: #F5F0EA;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.md-ref-search-input\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t\tpadding: 5px 8px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.8rem;\n\t\t\tbackground: #FFF;\n\t\t\tcolor: #3D3229;\n\t\t\toutline: none;\n\t\t}\n\t\t.md-ref-search-input:focus\n\t\t{\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.md-ref-search-nav\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\twidth: 26px;\n\t\t\theight: 26px;\n\t\t\tcursor: pointer;\n\t\t\tcolor: #5E5549;\n\t\t\tfont-size: 0.7rem;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.md-ref-search-nav:hover\n\t\t{\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t.md-ref-search-nav:disabled\n\t\t{\n\t\t\topacity: 0.3;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.md-ref-search-count\n\t\t{\n\t\t\tfont-size: 0.7rem;\n\t\t\tcolor: #8A7F72;\n\t\t\twhite-space: nowrap;\n\t\t\tmin-width: 32px;\n\t\t\ttext-align: center;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.md-ref-content\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tpadding: 12px;\n\t\t\tfont-size: 0.82rem;\n\t\t\tline-height: 1.6;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.md-ref-content h2\n\t\t{\n\t\t\tfont-size: 0.95rem;\n\t\t\tmargin: 20px 0 8px 0;\n\t\t\tpadding-bottom: 4px;\n\t\t\tborder-bottom: 1px solid #EDE9E3;\n\t\t\tcolor: #2E7D74;\n\t\t}\n\t\t.md-ref-content h2:first-child\n\t\t{\n\t\t\tmargin-top: 0;\n\t\t}\n\t\t.md-ref-content h3\n\t\t{\n\t\t\tfont-size: 0.85rem;\n\t\t\tmargin: 14px 0 6px 0;\n\t\t\tcolor: #5E5549;\n\t\t}\n\t\t.md-ref-content p\n\t\t{\n\t\t\tmargin: 6px 0;\n\t\t}\n\t\t.md-ref-content code\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tpadding: 1px 4px;\n\t\t\tborder-radius: 3px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-family: monospace;\n\t\t}\n\t\t.md-ref-content pre\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tpadding: 8px 10px;\n\t\t\toverflow-x: auto;\n\t\t\tfont-size: 0.76rem;\n\t\t\tline-height: 1.5;\n\t\t\tmargin: 6px 0;\n\t\t\tposition: relative;\n\t\t}\n\t\t.md-ref-content pre code\n\t\t{\n\t\t\tbackground: none;\n\t\t\tpadding: 0;\n\t\t\tfont-size: inherit;\n\t\t}\n\t\t.md-ref-copy-btn\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 4px;\n\t\t\tright: 4px;\n\t\t\tbackground: #FAF8F4;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 2px 6px;\n\t\t\tfont-size: 0.65rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: pointer;\n\t\t\topacity: 0;\n\t\t\ttransition: opacity 0.15s;\n\t\t}\n\t\t.md-ref-content pre:hover .md-ref-copy-btn\n\t\t{\n\t\t\topacity: 1;\n\t\t}\n\t\t.md-ref-copy-btn:hover\n\t\t{\n\t\t\tbackground: #EDE9E3;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.md-ref-docs-link\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tgap: 6px;\n\t\t\tpadding: 8px 10px;\n\t\t\tbackground: #F0FAF8;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tfont-size: 0.8rem;\n\t\t\tfont-weight: 600;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.md-ref-docs-link a\n\t\t{\n\t\t\tcolor: #2E7D74;\n\t\t\ttext-decoration: none;\n\t\t}\n\t\t.md-ref-docs-link a:hover\n\t\t{\n\t\t\ttext-decoration: underline;\n\t\t}\n\t\t/* Search highlight */\n\t\tmark.md-ref-highlight\n\t\t{\n\t\t\tbackground: #FFEAA7;\n\t\t\tcolor: inherit;\n\t\t\tpadding: 0;\n\t\t\tborder-radius: 2px;\n\t\t}\n\t\tmark.md-ref-highlight-active\n\t\t{\n\t\t\tbackground: #E8A94D;\n\t\t\tcolor: #FFF;\n\t\t}\n\t",Templates:[{Hash:"ContentEditor-MarkdownReference-Template",Template:'\n<div class="md-ref-container">\n\t<div class="md-ref-docs-link">\n\t\t<span><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3C6.5 1.5 4 1 1 1.5v11c3-.5 5.5 0 7 1.5 1.5-1.5 4-2 7-1.5v-11c-3-.5-5.5 0-7 1.5z"/><line x1="8" y1="3" x2="8" y2="14"/></svg></span>\n\t\t<a href="#" onclick="event.preventDefault();pict.views[\'ContentEditor-Layout\'].toggleDocPanel()">Full Documentation</a>\n\t</div>\n\t<div class="md-ref-search-bar">\n\t\t<input type="text" class="md-ref-search-input"\n\t\t\tid="ContentEditor-MdRef-SearchInput"\n\t\t\tplaceholder="Search reference..."\n\t\t\toninput="{~P~}.views[\'ContentEditor-MarkdownReference\'].onSearchInput(this.value)"\n\t\t\tonkeydown="{~P~}.views[\'ContentEditor-MarkdownReference\'].onSearchKeydown(event)">\n\t\t<span class="md-ref-search-count" id="ContentEditor-MdRef-SearchCount"></span>\n\t\t<button class="md-ref-search-nav" id="ContentEditor-MdRef-SearchPrev"\n\t\t\tonclick="{~P~}.views[\'ContentEditor-MarkdownReference\'].navigateMatch(-1)" disabled>▲</button>\n\t\t<button class="md-ref-search-nav" id="ContentEditor-MdRef-SearchNext"\n\t\t\tonclick="{~P~}.views[\'ContentEditor-MarkdownReference\'].navigateMatch(1)" disabled>▼</button>\n\t</div>\n\t<div class="md-ref-content" id="ContentEditor-MdRef-Content">\n\n<h2>Headings</h2>\n<p>Use <code>#</code> through <code>######</code> for heading levels 1–6.</p>\n<pre><code># Heading 1\n## Heading 2\n### Heading 3\n#### Heading 4\n##### Heading 5\n###### Heading 6</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Emphasis</h2>\n<p>Bold, italic, strikethrough, and combinations.</p>\n<pre><code>**bold text**\n*italic text*\n***bold and italic***\n~~strikethrough~~\n**bold and ~~strikethrough~~**</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Inline Code</h2>\n<p>Wrap text in backticks for inline code.</p>\n<pre><code>Use `console.log()` to debug.\nUse ``double backticks for `literal` backticks``.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Links</h2>\n<p>Inline links, reference links, and autolinks.</p>\n<pre><code>[Link text](https://example.com)\n[Link with title](https://example.com "Title text")\n\n[Reference link][1]\n[1]: https://example.com\n\nAutolink: https://example.com\nEmail: user@example.com</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Images</h2>\n<pre><code>\n\n\n[](https://example.com)</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Unordered Lists</h2>\n<p>Use <code>-</code>, <code>*</code>, or <code>+</code> for bullet items.</p>\n<pre><code>- Item one\n- Item two\n - Nested item\n - Another nested\n - Deeply nested\n- Item three</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Ordered Lists</h2>\n<pre><code>1. First item\n2. Second item\n3. Third item\n 1. Sub-item A\n 2. Sub-item B</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Task Lists</h2>\n<pre><code>- [x] Completed task\n- [ ] Incomplete task\n- [ ] Another task</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Blockquotes</h2>\n<pre><code>> This is a blockquote.\n>\n> It can span multiple paragraphs.\n>\n>> Nested blockquote.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Code Blocks</h2>\n<p>Use triple backticks with an optional language identifier.</p>\n<pre><code>```javascript\nfunction hello()\n{\n console.log("Hello, world!");\n}\n```\n\n```python\ndef hello():\n print("Hello, world!")\n```\n\n```css\n.container {\n display: flex;\n gap: 16px;\n}\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Tables</h2>\n<p>Use pipes and hyphens. Colons control alignment.</p>\n<pre><code>| Left Align | Center Align | Right Align |\n|:-----------|:------------:|------------:|\n| Cell 1 | Cell 2 | Cell 3 |\n| Cell 4 | Cell 5 | Cell 6 |</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Horizontal Rules</h2>\n<p>Three or more hyphens, asterisks, or underscores.</p>\n<pre><code>---\n\n***\n\n___</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Footnotes</h2>\n<pre><code>Here is a footnote reference[^1] and another[^note].\n\n[^1]: This is the footnote content.\n[^note]: Footnotes can have any label.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>HTML in Markdown</h2>\n<p>Raw HTML is allowed in GitHub-Flavored Markdown.</p>\n<pre><code><details>\n<summary>Click to expand</summary>\n\nHidden content here.\n\n</details>\n\n<kbd>Ctrl</kbd> + <kbd>S</kbd> to save.\n\n<mark>Highlighted text</mark>\n\n<sup>superscript</sup> and <sub>subscript</sub></code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Escaping Characters</h2>\n<p>Backslash-escape special markdown characters.</p>\n<pre><code>\\*not italic\\*\n\\# not a heading\n\\[not a link\\](url)\n\\`not code\\`</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Line Breaks</h2>\n<pre><code>End a line with two spaces\nto create a line break.\n\nOr use a blank line\n\nfor a new paragraph.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>KaTeX — Inline Math</h2>\n<p>Wrap expressions with single dollar signs for inline math.</p>\n<pre><code>The equation $E = mc^2$ is famous.\n\nThe quadratic formula is $x = \\frac{-b \\pm \\sqrt{b^2 - 4ac}}{2a}$.\n\nGreek letters: $\\alpha$, $\\beta$, $\\gamma$, $\\delta$, $\\theta$, $\\pi$.\n\nSubscripts and superscripts: $x_i^2$ and $a_{n+1}$.</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>KaTeX — Display Math</h2>\n<p>Use double dollar signs on their own lines for display (block) math.</p>\n\n<h3>Integral</h3>\n<pre><code>$$\n\\int_{-\\infty}^{\\infty} e^{-x^2} \\, dx = \\sqrt{\\pi}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Summation</h3>\n<pre><code>$$\n\\sum_{n=1}^{\\infty} \\frac{1}{n^2} = \\frac{\\pi^2}{6}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Matrix</h3>\n<pre><code>$$\n\\begin{bmatrix}\na & b \\\\\nc & d\n\\end{bmatrix}\n\\begin{bmatrix}\nx \\\\\ny\n\\end{bmatrix}\n=\n\\begin{bmatrix}\nax + by \\\\\ncx + dy\n\\end{bmatrix}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Aligned Equations</h3>\n<pre><code>$$\n\\begin{aligned}\nf(x) &= x^2 + 2x + 1 \\\\\n &= (x + 1)^2\n\\end{aligned}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Cases (Piecewise)</h3>\n<pre><code>$$\nf(x) = \\begin{cases}\nx^2 & \\text{if } x \\geq 0 \\\\\n-x^2 & \\text{if } x < 0\n\\end{cases}\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h3>Fractions & Limits</h3>\n<pre><code>$$\n\\lim_{x \\to 0} \\frac{\\sin x}{x} = 1\n$$</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — Flowchart</h2>\n<pre><code>```mermaid\ngraph TD\n A[Start] --> B{Decision}\n B -->|Yes| C[Do something]\n B -->|No| D[Do something else]\n C --> E[End]\n D --> E\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — Sequence Diagram</h2>\n<pre><code>```mermaid\nsequenceDiagram\n participant A as Alice\n participant B as Bob\n A->>B: Hello Bob\n B-->>A: Hi Alice\n A->>B: How are you?\n B-->>A: Great!\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — Gantt Chart</h2>\n<pre><code>```mermaid\ngantt\n title Project Timeline\n dateFormat YYYY-MM-DD\n section Phase 1\n Research :a1, 2024-01-01, 30d\n Design :a2, after a1, 20d\n section Phase 2\n Development :b1, after a2, 40d\n Testing :b2, after b1, 15d\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — Class Diagram</h2>\n<pre><code>```mermaid\nclassDiagram\n Animal <|-- Duck\n Animal <|-- Fish\n Animal : +int age\n Animal : +String gender\n Animal : +swim()\n Duck : +String beakColor\n Duck : +quack()\n Fish : +int sizeInFeet\n Fish : +canEat()\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n<h2>Mermaid — State Diagram</h2>\n<pre><code>```mermaid\nstateDiagram-v2\n [*] --> Idle\n Idle --> Processing : Start\n Processing --> Done : Complete\n Processing --> Error : Fail\n Error --> Idle : Reset\n Done --> [*]\n```</code><button class="md-ref-copy-btn" onclick="pict.views[\'ContentEditor-MarkdownReference\'].copyCodeBlock(this)">Copy</button></pre>\n\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-MarkdownReference-Display",TemplateHash:"ContentEditor-MarkdownReference-Template",DestinationAddress:"#ContentEditor-SidebarReference-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._hasRendered=!1,this._searchMatches=[],this._currentMatchIndex=-1,this._originalContent=""}onAfterRender(t,e,i,n){this._hasRendered=!0;let o=this.pict.ContentAssignment.getElement("#ContentEditor-MdRef-Content")[0];return o&&(this._originalContent=o.innerHTML),this.pict.CSSMap.injectCSS(),super.onAfterRender(t,e,i,n)}copyCodeBlock(t){let e=t.closest("pre");if(!e)return;let i=e.querySelector("code");if(!i)return;let n=i.textContent;navigator.clipboard&&navigator.clipboard.writeText(n).then(()=>{t.textContent="Copied!",setTimeout(()=>{t.textContent="Copy"},1500)})}onSearchInput(t){this._performSearch(t)}onSearchKeydown(t){"Enter"===t.key&&(t.preventDefault(),t.shiftKey?this.navigateMatch(-1):this.navigateMatch(1)),"Escape"===t.key&&(t.target.value="",this._clearSearch())}navigateMatch(t){if(0===this._searchMatches.length)return;this._currentMatchIndex>=0&&this._searchMatches[this._currentMatchIndex]&&this._searchMatches[this._currentMatchIndex].classList.remove("md-ref-highlight-active"),this._currentMatchIndex+=t,this._currentMatchIndex>=this._searchMatches.length&&(this._currentMatchIndex=0),this._currentMatchIndex<0&&(this._currentMatchIndex=this._searchMatches.length-1);let e=this._searchMatches[this._currentMatchIndex];e.classList.add("md-ref-highlight-active"),e.scrollIntoView({behavior:"smooth",block:"center"}),this._updateSearchCount()}_performSearch(t){let e=this.pict.ContentAssignment.getElement("#ContentEditor-MdRef-Content")[0];if(!e)return;if(e.innerHTML=this._originalContent,this._searchMatches=[],this._currentMatchIndex=-1,!t||t.length<2)return this._updateSearchCount(),void this._updateNavButtons();let i,n=t.toLowerCase(),o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),r=[];for(;i=o.nextNode();)i.nodeValue.toLowerCase().indexOf(n)>=0&&r.push(i);for(let t=0;t<r.length;t++)this._highlightTextNode(r[t],n);this._searchMatches=Array.from(e.querySelectorAll("mark.md-ref-highlight")),this._searchMatches.length>0&&(this._currentMatchIndex=0,this._searchMatches[0].classList.add("md-ref-highlight-active"),this._searchMatches[0].scrollIntoView({behavior:"smooth",block:"center"})),this._updateSearchCount(),this._updateNavButtons()}_highlightTextNode(t,e){let i=t.nodeValue,n=i.toLowerCase(),o=t.parentNode,r=document.createDocumentFragment(),a=0,s=n.indexOf(e);for(;s>=0;){s>a&&r.appendChild(document.createTextNode(i.substring(a,s)));let t=document.createElement("mark");t.className="md-ref-highlight",t.textContent=i.substring(s,s+e.length),r.appendChild(t),a=s+e.length,s=n.indexOf(e,a)}a<i.length&&r.appendChild(document.createTextNode(i.substring(a))),o.replaceChild(r,t)}_updateSearchCount(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-MdRef-SearchCount")[0];if(t)if(0===this._searchMatches.length){let e=this.pict.ContentAssignment.getElement("#ContentEditor-MdRef-SearchInput")[0];e&&e.value&&e.value.length>=2?t.textContent="0":t.textContent=""}else t.textContent=this._currentMatchIndex+1+"/"+this._searchMatches.length}_updateNavButtons(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-MdRef-SearchPrev")[0],e=this.pict.ContentAssignment.getElement("#ContentEditor-MdRef-SearchNext")[0],i=this._searchMatches.length>0;t&&(t.disabled=!i),e&&(e.disabled=!i)}_clearSearch(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-MdRef-Content")[0];t&&this._originalContent&&(t.innerHTML=this._originalContent),this._searchMatches=[],this._currentMatchIndex=-1,this._updateSearchCount(),this._updateNavButtons()}},e.exports.default_configuration=o},{"pict-view":102}],120:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"ContentEditor-SettingsPanel",DefaultRenderable:"ContentEditor-SettingsPanel-Display",DefaultDestinationAddress:"#ContentEditor-SettingsPanel-Container",AutoRender:!1,CSS:"\n\t\t.content-editor-settings-wrap\n\t\t{\n\t\t\tposition: relative;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t}\n\t\t.content-editor-settings-gear\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\tpadding: 6px;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tborder-radius: 4px;\n\t\t\tcolor: #B8AFA4;\n\t\t\ttransition: color 0.15s;\n\t\t}\n\t\t.content-editor-settings-gear:hover,\n\t\t.content-editor-settings-gear.active\n\t\t{\n\t\t\tcolor: #E8E0D4;\n\t\t}\n\t\t.content-editor-settings-gear svg\n\t\t{\n\t\t\twidth: 20px;\n\t\t\theight: 20px;\n\t\t\tfill: currentColor;\n\t\t}\n\t\t/* Flyout overlay — covers viewport to catch clicks outside */\n\t\t.content-editor-settings-overlay\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t\tz-index: 999;\n\t\t}\n\t\t.content-editor-settings-overlay.open\n\t\t{\n\t\t\tdisplay: block;\n\t\t}\n\t\t/* Flyout panel */\n\t\t.content-editor-settings-flyout\n\t\t{\n\t\t\tposition: absolute;\n\t\t\ttop: 44px;\n\t\t\tright: 0;\n\t\t\twidth: 270px;\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 8px;\n\t\t\tbox-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);\n\t\t\tz-index: 1000;\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(-4px);\n\t\t\tpointer-events: none;\n\t\t\ttransition: opacity 0.15s ease, transform 0.15s ease;\n\t\t}\n\t\t.content-editor-settings-flyout.open\n\t\t{\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t\tpointer-events: auto;\n\t\t}\n\t\t/* Speech bubble arrow */\n\t\t.content-editor-settings-flyout::before\n\t\t{\n\t\t\tcontent: '';\n\t\t\tposition: absolute;\n\t\t\ttop: -7px;\n\t\t\tright: 12px;\n\t\t\twidth: 12px;\n\t\t\theight: 12px;\n\t\t\tbackground: #FFF;\n\t\t\tborder-left: 1px solid #DDD6CA;\n\t\t\tborder-top: 1px solid #DDD6CA;\n\t\t\ttransform: rotate(45deg);\n\t\t}\n\t\t.content-editor-settings-flyout-body\n\t\t{\n\t\t\tpadding: 8px;\n\t\t}\n\t\t.content-editor-settings-flyout-link\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 10px 12px;\n\t\t\tborder-radius: 6px;\n\t\t\ttext-decoration: none;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-size: 0.85rem;\n\t\t\tfont-weight: 500;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.content-editor-settings-flyout-link:hover\n\t\t{\n\t\t\tbackground: #F5F3EE;\n\t\t}\n\t\t.content-editor-settings-flyout-link svg\n\t\t{\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\tflex-shrink: 0;\n\t\t\tfill: #8A7F72;\n\t\t}\n\t\t.content-editor-settings-divider\n\t\t{\n\t\t\theight: 1px;\n\t\t\tbackground: #EDE9E3;\n\t\t\tmargin: 4px 8px;\n\t\t}\n\t\t/* Settings controls */\n\t\t.content-editor-settings-section\n\t\t{\n\t\t\tpadding: 8px 12px;\n\t\t}\n\t\t.content-editor-settings-label\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\ttext-transform: uppercase;\n\t\t\tletter-spacing: 0.5px;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 8px;\n\t\t}\n\t\t.content-editor-settings-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\tgap: 8px;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.content-editor-settings-row:last-child\n\t\t{\n\t\t\tmargin-bottom: 0;\n\t\t}\n\t\t.content-editor-settings-checkbox\n\t\t{\n\t\t\twidth: 16px;\n\t\t\theight: 16px;\n\t\t\taccent-color: #2E7D74;\n\t\t\tcursor: pointer;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-settings-checkbox-label\n\t\t{\n\t\t\tfont: inherit;\n\t\t\tfont-size: 0.85rem;\n\t\t\tcolor: #3D3229;\n\t\t\tcursor: pointer;\n\t\t\tuser-select: none;\n\t\t}\n\t\t.content-editor-settings-select\n\t\t{\n\t\t\twidth: 140px;\n\t\t\tpadding: 5px 8px;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 4px;\n\t\t\tbackground: #FFF;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #3D3229;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.content-editor-settings-select:disabled\n\t\t{\n\t\t\topacity: 0.45;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.content-editor-settings-select-label\n\t\t{\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t\twhite-space: nowrap;\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Tablet / Phone (max-width: 768px)\n\t\t ============================================ */\n\t\t@media (max-width: 768px)\n\t\t{\n\t\t\t/* Settings flyout: position from left edge for more room */\n\t\t\t.content-editor-settings-flyout\n\t\t\t{\n\t\t\t\tright: -8px;\n\t\t\t\twidth: 260px;\n\t\t\t}\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Small phone (max-width: 480px)\n\t\t ============================================ */\n\t\t@media (max-width: 480px)\n\t\t{\n\t\t\t/* Full-width settings flyout on small phones */\n\t\t\t.content-editor-settings-flyout\n\t\t\t{\n\t\t\t\tposition: fixed;\n\t\t\t\ttop: 48px;\n\t\t\t\tright: 0;\n\t\t\t\tleft: 0;\n\t\t\t\twidth: 100%;\n\t\t\t\tborder-radius: 0 0 8px 8px;\n\t\t\t}\n\t\t\t.content-editor-settings-flyout::before\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t}\n\t",Templates:[{Hash:"ContentEditor-SettingsPanel-Template",Template:'\n<div class="content-editor-settings-wrap">\n\t<button class="content-editor-settings-gear" id="ContentEditor-SettingsGear"\n\t\tonclick="{~P~}.views[\'ContentEditor-SettingsPanel\'].togglePanel()">\n\t\t<svg viewBox="0 0 24 24"><path d="M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58a.49.49 0 0 0 .12-.61l-1.92-3.32a.49.49 0 0 0-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.48.48 0 0 0-.48-.41h-3.84a.48.48 0 0 0-.48.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96a.49.49 0 0 0-.59.22L2.74 8.87a.48.48 0 0 0 .12.61l2.03 1.58c-.05.3-.07.62-.07.94s.02.64.07.94l-2.03 1.58a.49.49 0 0 0-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.26.41.48.41h3.84c.24 0 .44-.17.48-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6A3.6 3.6 0 1 1 12 8.4a3.6 3.6 0 0 1 0 7.2z"/></svg>\n\t</button>\n\t<div class="content-editor-settings-overlay" id="ContentEditor-SettingsOverlay"\n\t\tonclick="{~P~}.views[\'ContentEditor-SettingsPanel\'].closePanel()"></div>\n\t<div class="content-editor-settings-flyout" id="ContentEditor-SettingsFlyout">\n\t\t<div class="content-editor-settings-flyout-body">\n\t\t\t<a class="content-editor-settings-flyout-link"\n\t\t\t\thref="/preview.html{~D:AppData.ContentEditor.ViewerHash~}" target="_blank">\n\t\t\t\t<svg viewBox="0 0 24 24"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>\n\t\t\t\tDocuserve Preview\n\t\t\t</a>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">Word Wrap</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-MarkdownWordWrap">Markdown Word Wrap</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-MarkdownWordWrap"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onMarkdownWordWrapChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-CodeWordWrap">Code Word Wrap</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-CodeWordWrap"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onCodeWordWrapChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">Markdown Editor</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-EditingControls">Editing Controls</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-EditingControls"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onEditingControlsChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<span class="content-editor-settings-select-label">Content Preview</span>\n\t\t\t\t\t<select class="content-editor-settings-select"\n\t\t\t\t\t\tid="ContentEditor-Setting-ContentPreviewMode"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onContentPreviewModeChanged(this.value)">\n\t\t\t\t\t\t<option value="off">Off</option>\n\t\t\t\t\t\t<option value="bottom">Underneath</option>\n\t\t\t\t\t\t<option value="side">Beside</option>\n\t\t\t\t\t\t<option value="tabbed">Tab</option>\n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoSegment">Auto Segment Markdown</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoSegment"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoSegmentChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<span class="content-editor-settings-select-label">Segment Depth</span>\n\t\t\t\t\t<select class="content-editor-settings-select"\n\t\t\t\t\t\tid="ContentEditor-Setting-SegmentDepth"\n\t\t\t\t\t\tdisabled\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onSegmentDepthChanged(this.value)">\n\t\t\t\t\t\t<option value="1">Depth 1: Blocks</option>\n\t\t\t\t\t\t<option value="2">Depth 2: ##</option>\n\t\t\t\t\t\t<option value="3">Depth 3: ###</option>\n\t\t\t\t\t\t<option value="4">Depth 4: ####</option>\n\t\t\t\t\t\t<option value="5">Depth 5: #####</option>\n\t\t\t\t\t\t<option value="6">Depth 6: ######</option>\n\t\t\t\t\t</select>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">Media Preview</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoPreviewImages">Auto-Preview Images</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoPreviewImages"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoPreviewImagesChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoPreviewVideo">Auto-Preview Video</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoPreviewVideo"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoPreviewVideoChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-AutoPreviewAudio">Auto-Preview Audio</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-AutoPreviewAudio"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onAutoPreviewAudioChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div class="content-editor-settings-divider"></div>\n\t\t\t<div class="content-editor-settings-section">\n\t\t\t\t<div class="content-editor-settings-label">File Browser</div>\n\t\t\t\t<div class="content-editor-settings-row">\n\t\t\t\t\t<label class="content-editor-settings-checkbox-label"\n\t\t\t\t\t\tfor="ContentEditor-Setting-ShowHiddenFiles">Show Hidden Files</label>\n\t\t\t\t\t<input type="checkbox" class="content-editor-settings-checkbox"\n\t\t\t\t\t\tid="ContentEditor-Setting-ShowHiddenFiles"\n\t\t\t\t\t\tonchange="{~P~}.views[\'ContentEditor-SettingsPanel\'].onShowHiddenFilesChanged(this.checked)">\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-SettingsPanel-Display",TemplateHash:"ContentEditor-SettingsPanel-Template",DestinationAddress:"#ContentEditor-SettingsPanel-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._isOpen=!1}onAfterRender(t,e,i,n){let o=this.pict.AppData.ContentEditor,r=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-MarkdownWordWrap");r&&r[0]&&(r[0].checked=o.MarkdownWordWrap);let a=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-CodeWordWrap");a&&a[0]&&(a[0].checked=o.CodeWordWrap);let s=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-EditingControls");s&&s[0]&&(s[0].checked=o.MarkdownEditingControls);let l=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-ContentPreviewMode");l&&l[0]&&(l[0].value=o.ContentPreviewMode||"off");let d=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoSegment");d&&d[0]&&(d[0].checked=o.AutoSegmentMarkdown);let c=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-SegmentDepth");c&&c[0]&&(c[0].value=String(o.AutoSegmentDepth),c[0].disabled=!o.AutoSegmentMarkdown);let p=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoPreviewImages");p&&p[0]&&(p[0].checked=o.AutoPreviewImages);let h=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoPreviewVideo");h&&h[0]&&(h[0].checked=o.AutoPreviewVideo);let u=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-AutoPreviewAudio");u&&u[0]&&(u[0].checked=o.AutoPreviewAudio);let m=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-ShowHiddenFiles");return m&&m[0]&&(m[0].checked=o.ShowHiddenFiles),super.onAfterRender(t,e,i,n)}togglePanel(){this._isOpen?this.closePanel():this.openPanel()}openPanel(){this._isOpen=!0;let t=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsFlyout"),e=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsOverlay"),i=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsGear");t&&t[0]&&t[0].classList.add("open"),e&&e[0]&&e[0].classList.add("open"),i&&i[0]&&i[0].classList.add("active")}closePanel(){this._isOpen=!1;let t=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsFlyout"),e=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsOverlay"),i=this.pict.ContentAssignment.getElement("#ContentEditor-SettingsGear");t&&t[0]&&t[0].classList.remove("open"),e&&e[0]&&e[0].classList.remove("open"),i&&i[0]&&i[0].classList.remove("active")}onMarkdownWordWrapChanged(t){this.pict.AppData.ContentEditor.MarkdownWordWrap=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-MarkdownEditor"];if(e&&"markdown"===this.pict.AppData.ContentEditor.ActiveEditor&&e._segmentEditors)for(let i in e._segmentEditors){let n=e._segmentEditors[i];n&&n.contentDOM&&(t?n.contentDOM.classList.add("cm-lineWrapping"):n.contentDOM.classList.remove("cm-lineWrapping"))}}onCodeWordWrapChanged(t){this.pict.AppData.ContentEditor.CodeWordWrap=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-CodeEditor"];e&&e._editorElement&&"code"===this.pict.AppData.ContentEditor.ActiveEditor&&(t?(e._editorElement.style.whiteSpace="pre-wrap",e._editorElement.style.overflowWrap="break-word"):(e._editorElement.style.whiteSpace="pre",e._editorElement.style.overflowWrap="normal"))}onEditingControlsChanged(t){this.pict.AppData.ContentEditor.MarkdownEditingControls=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-MarkdownEditor"];e&&"markdown"===this.pict.AppData.ContentEditor.ActiveEditor&&e.toggleControls(t)}onContentPreviewModeChanged(t){this.pict.AppData.ContentEditor.ContentPreviewMode=t,this.pict.PictApplication.saveSettings();let e=this.pict.views["ContentEditor-MarkdownEditor"];e&&"markdown"===this.pict.AppData.ContentEditor.ActiveEditor&&e.setPreviewMode(t)}onAutoSegmentChanged(t){this.pict.AppData.ContentEditor.AutoSegmentMarkdown=t,this.pict.PictApplication.saveSettings();let e=this.pict.ContentAssignment.getElement("#ContentEditor-Setting-SegmentDepth");e&&e[0]&&(e[0].disabled=!t)}onSegmentDepthChanged(t){this.pict.AppData.ContentEditor.AutoSegmentDepth=parseInt(t,10)||1,this.pict.PictApplication.saveSettings()}onAutoPreviewImagesChanged(t){this.pict.AppData.ContentEditor.AutoPreviewImages=t,this.pict.PictApplication.saveSettings()}onAutoPreviewVideoChanged(t){this.pict.AppData.ContentEditor.AutoPreviewVideo=t,this.pict.PictApplication.saveSettings()}onAutoPreviewAudioChanged(t){this.pict.AppData.ContentEditor.AutoPreviewAudio=t,this.pict.PictApplication.saveSettings()}onShowHiddenFilesChanged(t){this.pict.AppData.ContentEditor.ShowHiddenFiles=t,this.pict.PictApplication.saveSettings();let e=this;this.pict.PictApplication.syncHiddenFilesSetting(()=>{e.pict.PictApplication.loadFileList()})}},e.exports.default_configuration=o},{"pict-view":102}],121:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"ContentEditor-TopBar",DefaultRenderable:"ContentEditor-TopBar-Display",DefaultDestinationAddress:"#ContentEditor-TopBar-Container",AutoRender:!1,CSS:"\n\t\t.content-editor-topbar\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tbackground: #3D3229;\n\t\t\tcolor: #E8E0D4;\n\t\t\tpadding: 0;\n\t\t\theight: 48px;\n\t\t\tborder-bottom: 3px solid #2E7D74;\n\t\t\tposition: relative;\n\t\t}\n\t\t.content-editor-topbar-brand\n\t\t{\n\t\t\tpadding: 0 16px;\n\t\t\tfont-size: 1rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #E8E0D4;\n\t\t\twhite-space: nowrap;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t/* Centered file name — absolutely positioned so it stays\n\t\t centered in the full bar regardless of left/right content */\n\t\t.content-editor-topbar-file\n\t\t{\n\t\t\tposition: absolute;\n\t\t\tleft: 50%;\n\t\t\ttransform: translateX(-50%);\n\t\t\tmax-width: 50%;\n\t\t\ttext-align: center;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t\tpointer-events: none;\n\t\t}\n\t\t.content-editor-topbar-filename\n\t\t{\n\t\t\tfont-size: 0.9rem;\n\t\t\tfont-weight: 500;\n\t\t\tcolor: #E8E0D4;\n\t\t\tletter-spacing: 0.2px;\n\t\t}\n\t\t.content-editor-topbar-file .content-editor-dirty-indicator\n\t\t{\n\t\t\tcolor: #E8A94D;\n\t\t\tfont-weight: bold;\n\t\t}\n\t\t/* Left spacer pushes actions to the right */\n\t\t.content-editor-topbar-spacer\n\t\t{\n\t\t\tflex: 1;\n\t\t}\n\t\t.content-editor-topbar-status\n\t\t{\n\t\t\tpadding: 0 12px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-status-saving\n\t\t{\n\t\t\tcolor: #E8A94D;\n\t\t}\n\t\t.content-editor-status-saved\n\t\t{\n\t\t\tcolor: #7BC47F;\n\t\t}\n\t\t.content-editor-status-error\n\t\t{\n\t\t\tcolor: #D9534F;\n\t\t}\n\t\t.content-editor-topbar-stats\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\twhite-space: nowrap;\n\t\t\tpadding: 0 8px;\n\t\t\tflex-shrink: 0;\n\t\t\tletter-spacing: 0.2px;\n\t\t}\n\t\t.content-editor-topbar-actions\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t\tpadding: 0 12px;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.content-editor-topbar-btn\n\t\t{\n\t\t\tpadding: 6px 14px;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.8rem;\n\t\t\tfont-weight: 600;\n\t\t}\n\t\t.content-editor-topbar-btn-save\n\t\t{\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t}\n\t\t.content-editor-topbar-btn-save:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.content-editor-topbar-btn-save:disabled\n\t\t{\n\t\t\tbackground: #5E5549;\n\t\t\tcolor: #8A7F72;\n\t\t\tcursor: not-allowed;\n\t\t}\n\t\t.content-editor-topbar-btn-close\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #B8AFA4;\n\t\t\tborder: 1px solid #5E5549;\n\t\t}\n\t\t.content-editor-topbar-btn-close:hover\n\t\t{\n\t\t\tcolor: #E8E0D4;\n\t\t\tborder-color: #8A7F72;\n\t\t\tbackground: rgba(255, 255, 255, 0.05);\n\t\t}\n\t\t/* Close-file confirmation overlay */\n\t\t.content-editor-confirm-overlay\n\t\t{\n\t\t\tdisplay: none;\n\t\t\tposition: fixed;\n\t\t\ttop: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tbottom: 0;\n\t\t\tz-index: 1099;\n\t\t\tbackground: rgba(0, 0, 0, 0.35);\n\t\t}\n\t\t.content-editor-confirm-overlay.open\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.content-editor-confirm-panel\n\t\t{\n\t\t\tbackground: #FFF;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 10px;\n\t\t\tbox-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);\n\t\t\twidth: 360px;\n\t\t\tmax-width: 90vw;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.content-editor-confirm-body\n\t\t{\n\t\t\tpadding: 24px 22px 16px;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.content-editor-confirm-icon\n\t\t{\n\t\t\tfont-size: 2rem;\n\t\t\tmargin-bottom: 8px;\n\t\t\tcolor: #E8A94D;\n\t\t}\n\t\t.content-editor-confirm-title\n\t\t{\n\t\t\tfont-size: 0.95rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #3D3229;\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.content-editor-confirm-message\n\t\t{\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #5E5549;\n\t\t\tmargin-bottom: 16px;\n\t\t\tline-height: 1.5;\n\t\t}\n\t\t.content-editor-confirm-actions\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 10px;\n\t\t\tjustify-content: center;\n\t\t}\n\t\t.content-editor-confirm-btn\n\t\t{\n\t\t\tpadding: 8px 20px;\n\t\t\tborder: none;\n\t\t\tborder-radius: 5px;\n\t\t\tfont-size: 0.82rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.content-editor-confirm-btn-discard\n\t\t{\n\t\t\tbackground: #D9534F;\n\t\t\tcolor: #FFF;\n\t\t}\n\t\t.content-editor-confirm-btn-discard:hover\n\t\t{\n\t\t\tbackground: #C9302C;\n\t\t}\n\t\t.content-editor-confirm-btn-cancel\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t}\n\t\t.content-editor-confirm-btn-cancel:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t}\n\t\t.content-editor-confirm-footer\n\t\t{\n\t\t\tpadding: 10px 22px;\n\t\t\tborder-top: 1px solid #EDE9E3;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.content-editor-confirm-kbd\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 1px 5px;\n\t\t\tfont-size: 0.68rem;\n\t\t\tfont-family: monospace;\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tcolor: #5E5549;\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Tablet / Phone (max-width: 768px)\n\t\t ============================================ */\n\t\t@media (max-width: 768px)\n\t\t{\n\t\t\t.content-editor-topbar\n\t\t\t{\n\t\t\t\theight: auto;\n\t\t\t\tmin-height: 44px;\n\t\t\t\tflex-wrap: wrap;\n\t\t\t\tpadding: 4px 0;\n\t\t\t}\n\n\t\t\t/* Brand text: shrink */\n\t\t\t.content-editor-topbar-brand\n\t\t\t{\n\t\t\t\tpadding: 0 8px;\n\t\t\t\tfont-size: 0.85rem;\n\t\t\t}\n\n\t\t\t/* File name: switch from absolute centering to flow layout */\n\t\t\t.content-editor-topbar-file\n\t\t\t{\n\t\t\t\tposition: static;\n\t\t\t\ttransform: none;\n\t\t\t\tmax-width: none;\n\t\t\t\tflex: 1;\n\t\t\t\tmin-width: 0;\n\t\t\t\tpadding: 0 4px;\n\t\t\t}\n\n\t\t\t/* Hide the spacer (not needed when file is in-flow) */\n\t\t\t.content-editor-topbar-spacer\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t/* Hide word/line count stats on mobile to save space */\n\t\t\t.content-editor-topbar-stats\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t/* Compact action buttons */\n\t\t\t.content-editor-topbar-actions\n\t\t\t{\n\t\t\t\tgap: 4px;\n\t\t\t\tpadding: 0 6px;\n\t\t\t}\n\n\t\t\t.content-editor-topbar-btn\n\t\t\t{\n\t\t\t\tpadding: 5px 10px;\n\t\t\t\tfont-size: 0.75rem;\n\t\t\t}\n\n\t\t\t/* Status text */\n\t\t\t.content-editor-topbar-status\n\t\t\t{\n\t\t\t\tpadding: 0 6px;\n\t\t\t\tfont-size: 0.72rem;\n\t\t\t}\n\n\t\t\t/* Confirm dialog: tighter for mobile */\n\t\t\t.content-editor-confirm-panel\n\t\t\t{\n\t\t\t\twidth: 95vw;\n\t\t\t\tmax-width: 95vw;\n\t\t\t}\n\t\t}\n\n\t\t/* ============================================\n\t\t RESPONSIVE: Small phone (max-width: 480px)\n\t\t ============================================ */\n\t\t@media (max-width: 480px)\n\t\t{\n\t\t\t/* Hide brand text entirely on very small screens */\n\t\t\t.content-editor-topbar-brand\n\t\t\t{\n\t\t\t\tdisplay: none;\n\t\t\t}\n\n\t\t\t.content-editor-topbar-filename\n\t\t\t{\n\t\t\t\tfont-size: 0.8rem;\n\t\t\t}\n\n\t\t\t.content-editor-topbar-actions\n\t\t\t{\n\t\t\t\tpadding: 0 4px;\n\t\t\t}\n\t\t}\n\t",Templates:[{Hash:"ContentEditor-TopBar-Template",Template:'\n<div class="content-editor-topbar">\n\t<div class="content-editor-topbar-brand">Content Editor</div>\n\t<div class="content-editor-topbar-file">\n\t\t<span class="content-editor-topbar-filename">{~D:AppData.ContentEditor.CurrentFile~}</span>{~D:AppData.ContentEditor.DirtyIndicatorHTML~}\n\t</div>\n\t<div class="content-editor-topbar-spacer"></div>\n\t<div class="content-editor-topbar-status {~D:AppData.ContentEditor.SaveStatusClass~}">\n\t\t{~D:AppData.ContentEditor.SaveStatus~}\n\t</div>\n\t<span class="content-editor-topbar-stats" id="ContentEditor-Stats"></span>\n\t<div class="content-editor-topbar-actions">\n\t\t<button class="content-editor-topbar-btn content-editor-topbar-btn-save"\n\t\t\tonclick="{~P~}.PictApplication.saveCurrentFile()"\n\t\t\t{~D:AppData.ContentEditor.SaveDisabledAttr~} {~D:AppData.ContentEditor.SaveVisibilityAttr~}>Save</button>\n\t\t<button class="content-editor-topbar-btn content-editor-topbar-btn-close"\n\t\t\tonclick="{~P~}.PictApplication.closeCurrentFile()"\n\t\t\t{~D:AppData.ContentEditor.CloseVisibilityAttr~}>Close</button>\n\t\t<button class="content-editor-topbar-btn" id="ContentEditor-DocsToggle"\n\t\t\tonclick="{~P~}.views[\'ContentEditor-Layout\'].toggleDocPanel()"\n\t\t\ttitle="Toggle documentation panel (right side)">Docs</button>\n\t\t<div id="ContentEditor-SettingsPanel-Container"></div>\n\t</div>\n</div>\n<div class="content-editor-confirm-overlay" id="ContentEditor-ConfirmOverlay"\n\tonclick="{~P~}.PictApplication.cancelCloseFile()">\n\t<div class="content-editor-confirm-panel" onclick="event.stopPropagation()">\n\t\t<div class="content-editor-confirm-body">\n\t\t\t<div class="content-editor-confirm-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M8 1L1 14h14z"/><line x1="8" y1="6" x2="8" y2="9"/><circle cx="8" cy="11.5" r="0.5" fill="currentColor" stroke="none"/></svg></div>\n\t\t\t<div class="content-editor-confirm-title">Unsaved Changes</div>\n\t\t\t<div class="content-editor-confirm-message">\n\t\t\t\tThis file has unsaved changes.<br>Close without saving?\n\t\t\t</div>\n\t\t\t<div class="content-editor-confirm-actions">\n\t\t\t\t<button class="content-editor-confirm-btn content-editor-confirm-btn-discard"\n\t\t\t\t\tonclick="{~P~}.PictApplication.confirmCloseFile()">Discard & Close</button>\n\t\t\t\t<button class="content-editor-confirm-btn content-editor-confirm-btn-cancel"\n\t\t\t\t\tonclick="{~P~}.PictApplication.cancelCloseFile()">Cancel</button>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class="content-editor-confirm-footer">\n\t\t\t<span class="content-editor-confirm-kbd">Y</span> to discard ·\n\t\t\t<span class="content-editor-confirm-kbd">N</span> or\n\t\t\t<span class="content-editor-confirm-kbd">Esc</span> to cancel\n\t\t</div>\n\t</div>\n</div>\n'}],Renderables:[{RenderableHash:"ContentEditor-TopBar-Display",TemplateHash:"ContentEditor-TopBar-Template",DestinationAddress:"#ContentEditor-TopBar-Container",RenderMethod:"replace"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i)}onBeforeRender(t,e,i){let n=this.pict.AppData.ContentEditor;if(n.DirtyIndicatorHTML=n.IsDirty?' <span class="content-editor-dirty-indicator">*</span>':"",n.SaveDisabledAttr=!n.CurrentFile||n.IsSaving?"disabled":"",n.SaveVisibilityAttr=n.IsDirty||n.IsSaving||n.SaveStatus?"":'style="display:none"',n.CloseVisibilityAttr=n.CurrentFile?"":'style="display:none"',n.CurrentFile){let t=n.CurrentFile.replace(/\.md$/,"");n.ViewerHash="#/page/"+t}else n.ViewerHash="";return super.onBeforeRender(t,e,i)}onAfterRender(t,e,i,n){let o=this.pict.views["ContentEditor-SettingsPanel"];return o&&o.render(),super.onAfterRender(t,e,i,n)}},e.exports.default_configuration=o},{"pict-view":102}],122:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"ContentEditor-Topics",DefaultRenderable:"Topics-Wrap",DefaultDestinationAddress:"#ContentEditor-SidebarTopics-Container",AutoRender:!1,CSS:"\n\t\t.topics-container\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\theight: 100%;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #3D3229;\n\t\t}\n\t\t.topics-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 6px;\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-bottom: 1px solid #EDE9E3;\n\t\t\tbackground: #FAF8F4;\n\t\t\tflex-shrink: 0;\n\t\t}\n\t\t.topics-header-title\n\t\t{\n\t\t\tflex: 1;\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: #5E5549;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.topics-header-btn\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.82rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tpadding: 2px 6px;\n\t\t\tborder-radius: 3px;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.topics-header-btn:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t.topics-list\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\toverflow-x: hidden;\n\t\t}\n\t\t.topics-row\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: flex-start;\n\t\t\tgap: 6px;\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-bottom: 1px solid #F0EDE8;\n\t\t\tcursor: pointer;\n\t\t\ttransition: background 0.1s;\n\t\t}\n\t\t.topics-row:hover\n\t\t{\n\t\t\tbackground: #F5F0EA;\n\t\t}\n\t\t.topics-row-info\n\t\t{\n\t\t\tflex: 1;\n\t\t\tmin-width: 0;\n\t\t}\n\t\t.topics-row-code\n\t\t{\n\t\t\tfont-weight: 600;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcolor: #2E7D74;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.topics-row-title\n\t\t{\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #5E5549;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\tmargin-top: 1px;\n\t\t}\n\t\t.topics-row-path\n\t\t{\n\t\t\tfont-size: 0.68rem;\n\t\t\tcolor: #8A7F72;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\tmargin-top: 1px;\n\t\t}\n\t\t.topics-row-actions\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tdisplay: flex;\n\t\t\tgap: 2px;\n\t\t\tpadding-top: 1px;\n\t\t}\n\t\t.topics-row-btn\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tborder: none;\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.72rem;\n\t\t\tcolor: #8A7F72;\n\t\t\tpadding: 2px 4px;\n\t\t\tborder-radius: 3px;\n\t\t\tline-height: 1;\n\t\t}\n\t\t.topics-row-btn:hover\n\t\t{\n\t\t\tcolor: #3D3229;\n\t\t\tbackground: #EDE9E3;\n\t\t}\n\t\t.topics-row-btn-delete:hover\n\t\t{\n\t\t\tcolor: #D9534F;\n\t\t\tbackground: #FDF0EF;\n\t\t}\n\t\t/* Inline edit form */\n\t\t.topics-edit\n\t\t{\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-bottom: 1px solid #DDD6CA;\n\t\t\tbackground: #FFF9F0;\n\t\t}\n\t\t.topics-edit-field\n\t\t{\n\t\t\tmargin-bottom: 6px;\n\t\t}\n\t\t.topics-edit-label\n\t\t{\n\t\t\tdisplay: block;\n\t\t\tfont-size: 0.68rem;\n\t\t\tfont-weight: 600;\n\t\t\tcolor: #8A7F72;\n\t\t\tmargin-bottom: 2px;\n\t\t}\n\t\t.topics-edit-input\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tbox-sizing: border-box;\n\t\t\tpadding: 4px 6px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tbackground: #FFF;\n\t\t\tcolor: #3D3229;\n\t\t\tfont-family: inherit;\n\t\t}\n\t\t.topics-edit-input:focus\n\t\t{\n\t\t\toutline: none;\n\t\t\tborder-color: #2E7D74;\n\t\t}\n\t\t.topics-edit-actions\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tgap: 6px;\n\t\t\tmargin-top: 8px;\n\t\t}\n\t\t.topics-edit-save\n\t\t{\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 4px 12px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.topics-edit-save:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.topics-edit-cancel\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t\tborder-radius: 3px;\n\t\t\tpadding: 4px 12px;\n\t\t\tfont-size: 0.72rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.topics-edit-cancel:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t}\n\t\t/* Footer add button */\n\t\t.topics-footer\n\t\t{\n\t\t\tflex-shrink: 0;\n\t\t\tpadding: 8px 10px;\n\t\t\tborder-top: 1px solid #EDE9E3;\n\t\t\tbackground: #FAF8F4;\n\t\t}\n\t\t.topics-add-btn\n\t\t{\n\t\t\tdisplay: block;\n\t\t\twidth: 100%;\n\t\t\tpadding: 6px 0;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t\ttext-align: center;\n\t\t}\n\t\t.topics-add-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t/* Empty state */\n\t\t.topics-empty\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tjustify-content: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 32px 16px;\n\t\t\ttext-align: center;\n\t\t\tcolor: #8A7F72;\n\t\t\tfont-size: 0.82rem;\n\t\t}\n\t\t.topics-empty-icon\n\t\t{\n\t\t\tfont-size: 2rem;\n\t\t\tcolor: #C4BDB3;\n\t\t}\n\t\t.topics-empty-btn\n\t\t{\n\t\t\tdisplay: inline-block;\n\t\t\tpadding: 6px 14px;\n\t\t\tbackground: #2E7D74;\n\t\t\tcolor: #FFF;\n\t\t\tborder: none;\n\t\t\tborder-radius: 4px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tfont-weight: 600;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.topics-empty-btn:hover\n\t\t{\n\t\t\tbackground: #3A9E92;\n\t\t}\n\t\t.topics-empty-btn-secondary\n\t\t{\n\t\t\tbackground: transparent;\n\t\t\tcolor: #5E5549;\n\t\t\tborder: 1px solid #DDD6CA;\n\t\t}\n\t\t.topics-empty-btn-secondary:hover\n\t\t{\n\t\t\tbackground: #F0EDE8;\n\t\t\tborder-color: #8A7F72;\n\t\t}\n\t",Templates:[{Hash:"Topics-Container-Template",Template:'\n<div class="topics-container" id="ContentEditor-Topics-Container">\n\t<div class="topics-header">\n\t\t<span class="topics-header-title" id="ContentEditor-Topics-HeaderTitle">Topics</span>\n\t\t<button class="topics-header-btn" title="Close topics file"\n\t\t\tonclick="pict.views[\'ContentEditor-Topics\'].closeTopicsFile()">×</button>\n\t</div>\n\t<div class="topics-list" id="ContentEditor-Topics-List"></div>\n\t<div class="topics-footer" id="ContentEditor-Topics-Footer">\n\t\t<button class="topics-add-btn"\n\t\t\tonclick="pict.views[\'ContentEditor-Topics\'].addTopic()">+ Add Topic</button>\n\t</div>\n</div>\n'},{Hash:"Topics-Row-Template",Template:'\n<div class="topics-row" ondblclick="{~P~}.views[\'{~D:Record.ViewHash~}\'].startEditTopic(\'{~D:Record.CodeEscaped~}\')">\n <div class="topics-row-info">\n <div class="topics-row-code">{~D:Record.Code~}</div>\n <div class="topics-row-title">{~D:Record.Title~}</div>\n <div class="topics-row-path">{~D:Record.PathDisplay~}</div>\n </div>\n <div class="topics-row-actions">\n <button class="topics-row-btn" title="Edit" onclick="event.stopPropagation();{~P~}.views[\'{~D:Record.ViewHash~}\'].startEditTopic(\'{~D:Record.CodeEscaped~}\')"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M11.5 1.5l3 3L5 14H2v-3z"/><line x1="9" y1="4" x2="12" y2="7"/></svg></button>\n <button class="topics-row-btn topics-row-btn-delete" title="Delete" onclick="event.stopPropagation();{~P~}.views[\'{~D:Record.ViewHash~}\'].removeTopic(\'{~D:Record.CodeEscaped~}\')"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"/><line x1="12" y1="4" x2="4" y2="12"/></svg></button>\n {~D:Record.NavigateButton~}\n </div>\n</div>\n'},{Hash:"Topics-EditForm-Template",Template:'\n<div class="topics-edit">\n <div class="topics-edit-field">\n <label class="topics-edit-label">Topic Code</label>\n <input class="topics-edit-input" id="topics-edit-code" type="text" value="{~D:Record.Code~}" placeholder="My-Topic-Code">\n </div>\n <div class="topics-edit-field">\n <label class="topics-edit-label">Title</label>\n <input class="topics-edit-input" id="topics-edit-title" type="text" value="{~D:Record.Title~}" placeholder="Topic title">\n </div>\n <div class="topics-edit-field">\n <label class="topics-edit-label">Help File Path</label>\n <input class="topics-edit-input" id="topics-edit-path" type="text" value="{~D:Record.Path~}" placeholder="path/to/file.md">\n </div>\n <div class="topics-edit-field">\n <label class="topics-edit-label">Line Number (optional)</label>\n <input class="topics-edit-input" id="topics-edit-line" type="number" value="{~D:Record.Line~}" placeholder="e.g. 23" min="1">\n </div>\n <div class="topics-edit-actions">\n <button class="topics-edit-save" onclick="{~P~}.views[\'{~D:Record.ViewHash~}\'].saveEditTopic(\'{~D:Record.OriginalCode~}\')">Save</button>\n <button class="topics-edit-cancel" onclick="{~P~}.views[\'{~D:Record.ViewHash~}\'].cancelEditTopic()">Cancel</button>\n </div>\n</div>\n'},{Hash:"Topics-Empty-Template",Template:'\n<div class="topics-empty">\n <div class="topics-empty-icon"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M4 1h5l4 4v9a1 1 0 01-1 1H4a1 1 0 01-1-1V2a1 1 0 011-1z"/><path d="M9 1v4h4"/><line x1="5" y1="8" x2="11" y2="8"/><line x1="5" y1="11" x2="9" y2="11"/></svg></div>\n <div>No topics file loaded</div>\n <button class="topics-empty-btn" onclick="{~P~}.views[\'{~D:Record.ViewHash~}\'].loadDefaultTopicsFile()">Load .pict_documentation_topics.json</button>\n <button class="topics-empty-btn topics-empty-btn-secondary" onclick="{~P~}.views[\'{~D:Record.ViewHash~}\'].promptSelectTopicsFile()">Select file...</button>\n</div>\n'},{Hash:"Topics-EmptyList-Template",Template:'\n<div style="padding:16px;text-align:center;color:#8A7F72;font-size:0.78rem;">No topics yet. Click "+ Add Topic" to create one.</div>\n'}],Renderables:[{RenderableHash:"Topics-Wrap",TemplateHash:"Topics-Container-Template",DestinationAddress:"#ContentEditor-SidebarTopics-Container"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._topics={},this._topicsFilePath="",this._hasRendered=!1,this._editingTopicCode=null}onAfterRender(t,e,i,n){return this._hasRendered=!0,this.pict.CSSMap.injectCSS(),this._topicsFilePath?(this._updateHeaderTitle(),this.renderTopicList()):this._showEmptyState(),super.onAfterRender(t,e,i,n)}loadTopicsFile(t,e){let i="function"==typeof e?e:()=>{},n=this;if(!t)return i("No path specified");let o=this.pict.providers["ContentEditor-Provider"];if(!o)return i("Provider not available");o.loadFile(t,(e,o)=>{if(e)return n._topics={},n._topicsFilePath="",n._hasRendered&&n._showEmptyState(),i(e);try{let t=JSON.parse(o);"object"!=typeof t||null===t||Array.isArray(t)?n._topics={}:n._topics=t}catch(t){n._topics={},n.log.warn("ContentEditor-Topics: Failed to parse topics JSON: "+t.message)}return n._topicsFilePath=t,n.pict.AppData.ContentEditor.TopicsFilePath=t,n.pict.PictApplication.saveSettings(),n._hasRendered&&(n._updateHeaderTitle(),n.renderTopicList(),n._showFooter(!0)),i(null)})}saveTopicsFile(t){let e="function"==typeof t?t:()=>{};if(!this._topicsFilePath)return e("No topics file loaded");let i=this.pict.providers["ContentEditor-Provider"];if(!i)return e("Provider not available");let n=JSON.stringify(this._topics,null,"\t");i.saveFile(this._topicsFilePath,n,e)}closeTopicsFile(){this._topics={},this._topicsFilePath="",this._editingTopicCode=null,this.pict.AppData.ContentEditor.TopicsFilePath="",this.pict.PictApplication.saveSettings(),this._hasRendered&&this._showEmptyState()}addTopic(t){if(!this._topicsFilePath)return void this._createDefaultTopicsFile(()=>{this.addTopic(t)});let e=t||{},i=e.TopicCode||this._generateUniqueCode("New-Topic"),n={TopicCode:i,TopicHelpFilePath:e.TopicHelpFilePath||"",TopicTitle:e.TopicTitle||""};"number"==typeof e.RelevantMarkdownLine&&(n.RelevantMarkdownLine=e.RelevantMarkdownLine),this._topics[i]=n;let o=this;this.saveTopicsFile(()=>{o.renderTopicList(),o.startEditTopic(i)})}removeTopic(t){if(!t||!this._topics[t])return;if(!confirm('Remove topic "'+t+'"?'))return;delete this._topics[t],this._editingTopicCode=null;let e=this;this.saveTopicsFile(()=>{e.renderTopicList()})}startEditTopic(t){if(!t||!this._topics[t])return;this._editingTopicCode=t,this.renderTopicList();let e=this.pict.ContentAssignment.getElement("#topics-edit-code")[0];e&&(e.focus(),e.select())}saveEditTopic(t){if(!t||!this._topics[t])return;let e=this.pict.ContentAssignment.getElement("#topics-edit-code")[0],i=this.pict.ContentAssignment.getElement("#topics-edit-title")[0],n=this.pict.ContentAssignment.getElement("#topics-edit-path")[0],o=this.pict.ContentAssignment.getElement("#topics-edit-line")[0];if(!e)return;let r=e.value.trim(),a=i?i.value.trim():"",s=n?n.value.trim():"",l=o?parseInt(o.value,10):NaN;if(!r)return void(e.style.borderColor="#D9534F");if(r!==t&&this._topics[r])return e.style.borderColor="#D9534F",void alert('A topic with code "'+r+'" already exists.');r!==t&&delete this._topics[t];let d={TopicCode:r,TopicHelpFilePath:s,TopicTitle:a};!isNaN(l)&&l>0&&(d.RelevantMarkdownLine=l),this._topics[r]=d,this._editingTopicCode=null;let c=this;this.saveTopicsFile(()=>{c.renderTopicList()})}cancelEditTopic(){this._editingTopicCode=null,this.renderTopicList()}navigateToTopic(t){if(!t||!this._topics[t])return;let e=this._topics[t],i=e.TopicHelpFilePath;if(i&&(this.pict.PictApplication.navigateToFile(i),"number"==typeof e.RelevantMarkdownLine&&e.RelevantMarkdownLine>0)){let t=e.RelevantMarkdownLine;setTimeout(()=>{let e=this.pict.views["ContentEditor-MarkdownEditor"];if(e&&e._segmentEditors){let i=0;for(let n in e._segmentEditors){let o=e._segmentEditors[n];if(o&&o.state&&o.state.doc){let e=o.state.doc.lines;if(i+e>=t){let n=t-i;n<1&&(n=1),n>e&&(n=e);let r=o.state.doc.line(n);o.dispatch({selection:{anchor:r.from},scrollIntoView:!0}),o.focus();break}i+=e}}}},500)}}renderTopicList(){if(!this.pict.ContentAssignment.getElement("#ContentEditor-Topics-List")[0])return;let t=Object.keys(this._topics);if(0===t.length)return void this.pict.ContentAssignment.assignContent("#ContentEditor-Topics-List",this.pict.parseTemplateByHash("Topics-EmptyList-Template",{}));let e="",i=this.pict.PictApplication.pict_configuration.Pict+".views['"+this.Hash+"']";for(let n=0;n<t.length;n++){let o=t[n],r=this._topics[o],a=this._escapeHTML(r.TopicCode||""),s=this._escapeAttr(r.TopicCode||""),l=this._escapeHTML(r.TopicTitle||""),d=this._escapeHTML(r.TopicHelpFilePath||""),c="number"==typeof r.RelevantMarkdownLine?r.RelevantMarkdownLine:"",p="number"==typeof r.RelevantMarkdownLine?" :"+r.RelevantMarkdownLine:"",h=this._escapeAttr(r.TopicHelpFilePath||""),u=this._escapeAttr(r.TopicCode||""),m="";r.TopicHelpFilePath&&(m='<button class="topics-row-btn" title="Go to file" onclick="event.stopPropagation();'+i+".navigateToTopic('"+s+'\')"><svg width="1em" height="1em" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="3" y1="8" x2="13" y2="8"/><polyline points="9,4 13,8 9,12"/></svg></button>');let g={ViewHash:this.Hash,Code:a,CodeEscaped:s,Title:l,PathDisplay:d+p,Path:h,Line:c,OriginalCode:u,NavigateButton:m};this._editingTopicCode===o?e+=this.pict.parseTemplateByHash("Topics-EditForm-Template",g):e+=this.pict.parseTemplateByHash("Topics-Row-Template",g)}this.pict.ContentAssignment.assignContent("#ContentEditor-Topics-List",e)}_showEmptyState(){if(!this.pict.ContentAssignment.getElement("#ContentEditor-Topics-Container")[0]){return void(this.pict.ContentAssignment.getElement("#ContentEditor-SidebarTopics-Container")[0]&&this.pict.ContentAssignment.assignContent("#ContentEditor-SidebarTopics-Container",this.pict.parseTemplateByHash("Topics-Empty-Template",{ViewHash:this.Hash})))}this.pict.ContentAssignment.assignContent("#ContentEditor-Topics-Container",this.pict.parseTemplateByHash("Topics-Empty-Template",{ViewHash:this.Hash}))}loadDefaultTopicsFile(){let t=this;this.loadTopicsFile(".pict_documentation_topics.json",e=>{e&&t._createDefaultTopicsFile()})}promptSelectTopicsFile(){let t=prompt("Enter the path to a topics JSON file:",".pict_documentation_topics.json");if(t&&t.trim()){let e=this;this.loadTopicsFile(t.trim(),i=>{i&&confirm('File not found. Create "'+t.trim()+'"?')&&(e._topicsFilePath=t.trim(),e._topics={},e.pict.AppData.ContentEditor.TopicsFilePath=t.trim(),e.pict.PictApplication.saveSettings(),e.saveTopicsFile(()=>{e._hasRendered&&e.render()}))})}}_createDefaultTopicsFile(t){let e="function"==typeof t?t:()=>{},i=this,n=".pict_documentation_topics.json";this._topicsFilePath=n,this._topics={},this.pict.AppData.ContentEditor.TopicsFilePath=n,this.pict.PictApplication.saveSettings(),this.saveTopicsFile(()=>{i._hasRendered&&i.render(),e()})}_updateHeaderTitle(){let t=this.pict.ContentAssignment.getElement("#ContentEditor-Topics-HeaderTitle")[0];if(t){let e=this._topicsFilePath.replace(/^.*\//,"");t.textContent=e||"Topics",t.title=this._topicsFilePath}}_showFooter(t){let e=this.pict.ContentAssignment.getElement("#ContentEditor-Topics-Footer")[0];e&&(e.style.display=t?"":"none")}_generateUniqueCode(t){if(!this._topics[t])return t;let e=2;for(;this._topics[t+"-"+e];)e++;return t+"-"+e}_escapeHTML(t){return String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}_escapeAttr(t){return String(t).replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}},e.exports.default_configuration=o},{"pict-view":102}],123:[function(t,e,i){var n=t("object-inspect"),o=t("es-errors/type"),r=function(t,e,i){for(var n,o=t;null!=(n=o.next);o=n)if(n.key===e)return o.next=n.next,i||(n.next=t.next,t.next=n),n};e.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new o("Side channel does not contain "+n(t))},delete:function(e){var i=t&&t.next,n=function(t,e){if(t)return r(t,e,!0)}(t,e);return n&&i&&i===n&&(t=void 0),!!n},get:function(e){return function(t,e){if(t){var i=r(t,e);return i&&i.value}}(t,e)},has:function(e){return function(t,e){return!!t&&!!r(t,e)}(t,e)},set:function(e,i){t||(t={next:void 0}),function(t,e,i){var n=r(t,e);n?n.value=i:t.next={key:e,next:t.next,value:i}}(t,e,i)}};return e}},{"es-errors/type":16,"object-inspect":41}],124:[function(t,e,i){var n=t("get-intrinsic"),o=t("call-bound"),r=t("object-inspect"),a=t("es-errors/type"),s=n("%Map%",!0),l=o("Map.prototype.get",!0),d=o("Map.prototype.set",!0),c=o("Map.prototype.has",!0),p=o("Map.prototype.delete",!0),h=o("Map.prototype.size",!0);e.exports=!!s&&function(){var t,e={assert:function(t){if(!e.has(t))throw new a("Side channel does not contain "+r(t))},delete:function(e){if(t){var i=p(t,e);return 0===h(t)&&(t=void 0),i}return!1},get:function(e){if(t)return l(t,e)},has:function(e){return!!t&&c(t,e)},set:function(e,i){t||(t=new s),d(t,e,i)}};return e}},{"call-bound":8,"es-errors/type":16,"get-intrinsic":23,"object-inspect":41}],125:[function(t,e,i){var n=t("get-intrinsic"),o=t("call-bound"),r=t("object-inspect"),a=t("side-channel-map"),s=t("es-errors/type"),l=n("%WeakMap%",!0),d=o("WeakMap.prototype.get",!0),c=o("WeakMap.prototype.set",!0),p=o("WeakMap.prototype.has",!0),h=o("WeakMap.prototype.delete",!0);e.exports=l?function(){var t,e,i={assert:function(t){if(!i.has(t))throw new s("Side channel does not contain "+r(t))},delete:function(i){if(l&&i&&("object"==typeof i||"function"==typeof i)){if(t)return h(t,i)}else if(a&&e)return e.delete(i);return!1},get:function(i){return l&&i&&("object"==typeof i||"function"==typeof i)&&t?d(t,i):e&&e.get(i)},has:function(i){return l&&i&&("object"==typeof i||"function"==typeof i)&&t?p(t,i):!!e&&e.has(i)},set:function(i,n){l&&i&&("object"==typeof i||"function"==typeof i)?(t||(t=new l),c(t,i,n)):a&&(e||(e=a()),e.set(i,n))}};return i}:a},{"call-bound":8,"es-errors/type":16,"get-intrinsic":23,"object-inspect":41,"side-channel-map":124}],126:[function(t,e,i){var n=t("es-errors/type"),o=t("object-inspect"),r=t("side-channel-list"),a=t("side-channel-map"),s=t("side-channel-weakmap")||a||r;e.exports=function(){var t,e={assert:function(t){if(!e.has(t))throw new n("Side channel does not contain "+o(t))},delete:function(e){return!!t&&t.delete(e)},get:function(e){return t&&t.get(e)},has:function(e){return!!t&&t.has(e)},set:function(e,i){t||(t=s()),t.set(e,i)}};return e}},{"es-errors/type":16,"object-inspect":41,"side-channel-list":123,"side-channel-map":124,"side-channel-weakmap":125}],127:[function(t,e,i){var n=t("punycode/");function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),d=["'"].concat(l),c=["%","/","?",";","#"].concat(d),p=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,u=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},f={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=t("qs");function b(t,e,i){if(t&&"object"==typeof t&&t instanceof o)return t;var n=new o;return n.parse(t,e,i),n}o.prototype.parse=function(t,e,i){if("string"!=typeof t)throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o<t.indexOf("#")?"?":"#",l=t.split(a);l[0]=l[0].replace(/\\/g,"/");var b=t=l.join(a);if(b=b.trim(),!i&&1===t.split("#").length){var y=s.exec(b);if(y)return this.path=b,this.href=b,this.pathname=y[1],y[2]?(this.search=y[2],this.query=e?v.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var w=r.exec(b);if(w){var C=(w=w[0]).toLowerCase();this.protocol=C,b=b.substr(w.length)}if(i||w||b.match(/^\/\/[^@/]+@[^@/]+/)){var x="//"===b.substr(0,2);!x||w&&g[w]||(b=b.substr(2),this.slashes=!0)}if(!g[w]&&(x||w&&!f[w])){for(var R,_,D=-1,E=0;E<p.length;E++){-1!==(A=b.indexOf(p[E]))&&(-1===D||A<D)&&(D=A)}-1!==(_=-1===D?b.lastIndexOf("@"):b.lastIndexOf("@",D))&&(R=b.slice(0,_),b=b.slice(_+1),this.auth=decodeURIComponent(R)),D=-1;for(E=0;E<c.length;E++){var A;-1!==(A=b.indexOf(c[E]))&&(-1===D||A<D)&&(D=A)}-1===D&&(D=b.length),this.host=b.slice(0,D),b=b.slice(D),this.parseHost(),this.hostname=this.hostname||"";var S="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!S)for(var T=this.hostname.split(/\./),P=(E=0,T.length);E<P;E++){var k=T[E];if(k&&!k.match(h)){for(var F="",I=0,L=k.length;I<L;I++)k.charCodeAt(I)>127?F+="x":F+=k[I];if(!F.match(h)){var M=T.slice(0,E),B=T.slice(E+1),H=k.match(u);H&&(M.push(H[1]),B.unshift(H[2])),B.length&&(b="/"+B.join(".")+b),this.hostname=M.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),S||(this.hostname=n.toASCII(this.hostname));var V=this.port?":"+this.port:"",O=this.hostname||"";this.host=O+V,this.href+=this.host,S&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[C])for(E=0,P=d.length;E<P;E++){var N=d[E];if(-1!==b.indexOf(N)){var z=encodeURIComponent(N);z===N&&(z=escape(N)),b=b.split(N).join(z)}}var j=b.indexOf("#");-1!==j&&(this.hash=b.substr(j),b=b.slice(0,j));var U=b.indexOf("?");if(-1!==U?(this.search=b.substr(U),this.query=b.substr(U+1),e&&(this.query=v.parse(this.query)),b=b.slice(0,U)):e&&(this.search="",this.query={}),b&&(this.pathname=b),f[C]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){V=this.pathname||"";var $=this.search||"";this.path=V+$}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",i=this.pathname||"",n=this.hash||"",o=!1,r="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(r=v.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var a=this.search||r&&"?"+r||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||f[e])&&!1!==o?(o="//"+(o||""),i&&"/"!==i.charAt(0)&&(i="/"+i)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),a&&"?"!==a.charAt(0)&&(a="?"+a),e+o+(i=i.replace(/[?#]/g,function(t){return encodeURIComponent(t)}))+(a=a.replace("#","%23"))+n},o.prototype.resolve=function(t){return this.resolveObject(b(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if("string"==typeof t){var e=new o;e.parse(t,!1,!0),t=e}for(var i=new o,n=Object.keys(this),r=0;r<n.length;r++){var a=n[r];i[a]=this[a]}if(i.hash=t.hash,""===t.href)return i.href=i.format(),i;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),l=0;l<s.length;l++){var d=s[l];"protocol"!==d&&(i[d]=t[d])}return f[i.protocol]&&i.hostname&&!i.pathname&&(i.pathname="/",i.path=i.pathname),i.href=i.format(),i}if(t.protocol&&t.protocol!==i.protocol){if(!f[t.protocol]){for(var c=Object.keys(t),p=0;p<c.length;p++){var h=c[p];i[h]=t[h]}return i.href=i.format(),i}if(i.protocol=t.protocol,t.host||g[t.protocol])i.pathname=t.pathname;else{for(var u=(t.pathname||"").split("/");u.length&&!(t.host=u.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==u[0]&&u.unshift(""),u.length<2&&u.unshift(""),i.pathname=u.join("/")}if(i.search=t.search,i.query=t.query,i.host=t.host||"",i.auth=t.auth,i.hostname=t.hostname||t.host,i.port=t.port,i.pathname||i.search){var m=i.pathname||"",v=i.search||"";i.path=m+v}return i.slashes=i.slashes||t.slashes,i.href=i.format(),i}var b=i.pathname&&"/"===i.pathname.charAt(0),y=t.host||t.pathname&&"/"===t.pathname.charAt(0),w=y||b||i.host&&t.pathname,C=w,x=i.pathname&&i.pathname.split("/")||[],R=(u=t.pathname&&t.pathname.split("/")||[],i.protocol&&!f[i.protocol]);if(R&&(i.hostname="",i.port=null,i.host&&(""===x[0]?x[0]=i.host:x.unshift(i.host)),i.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===u[0]?u[0]=t.host:u.unshift(t.host)),t.host=null),w=w&&(""===u[0]||""===x[0])),y)i.host=t.host||""===t.host?t.host:i.host,i.hostname=t.hostname||""===t.hostname?t.hostname:i.hostname,i.search=t.search,i.query=t.query,x=u;else if(u.length)x||(x=[]),x.pop(),x=x.concat(u),i.search=t.search,i.query=t.query;else if(null!=t.search){if(R)i.host=x.shift(),i.hostname=i.host,(S=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=S.shift(),i.hostname=S.shift(),i.host=i.hostname);return i.search=t.search,i.query=t.query,null===i.pathname&&null===i.search||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!x.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var _=x.slice(-1)[0],D=(i.host||t.host||x.length>1)&&("."===_||".."===_)||""===_,E=0,A=x.length;A>=0;A--)"."===(_=x[A])?x.splice(A,1):".."===_?(x.splice(A,1),E++):E&&(x.splice(A,1),E--);if(!w&&!C)for(;E--;E)x.unshift("..");!w||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),D&&"/"!==x.join("/").substr(-1)&&x.push("");var S,T=""===x[0]||x[0]&&"/"===x[0].charAt(0);R&&(i.hostname=T?"":x.length?x.shift():"",i.host=i.hostname,(S=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=S.shift(),i.hostname=S.shift(),i.host=i.hostname));return(w=w||i.host&&x.length)&&!T&&x.unshift(""),x.length>0?i.pathname=x.join("/"):(i.pathname=null,i.path=null),null===i.pathname&&null===i.search||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=t.auth||i.auth,i.slashes=i.slashes||t.slashes,i.href=i.format(),i},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)},i.parse=b,i.resolve=function(t,e){return b(t,!1,!0).resolve(e)},i.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},i.format=function(t){return"string"==typeof t&&(t=b(t)),t instanceof o?t.format():o.prototype.format.call(t)},i.Url=o},{"punycode/":104,qs:106}],128:[function(t,e,i){e.exports={Name:"Retold Remote",MainViewportViewIdentifier:"ContentEditor-Layout",AutoSolveAfterInitialize:!0,AutoRenderMainViewportViewAfterInitialize:!1,AutoRenderViewsAfterInitialize:!1}},{}],129:[function(t,e,i){const n=t("retold-content-system").PictContentEditor,o=(t("pict-section-filebrowser"),t("./providers/Pict-Provider-RetoldRemote.js")),r=t("./providers/Pict-Provider-GalleryNavigation.js"),a=t("./providers/Pict-Provider-GalleryFilterSort.js"),s=t("./providers/Pict-Provider-RetoldRemoteIcons.js"),l=t("./providers/Pict-Provider-RetoldRemoteTheme.js"),d=t("./providers/Pict-Provider-FormattingUtilities.js"),c=t("./providers/Pict-Provider-ToastNotification.js"),p=t("./providers/Pict-Provider-OperationStatus.js"),h=t("./providers/Pict-Provider-CollectionManager.js"),u=t("./providers/Pict-Provider-AISortManager.js"),m=t("./RetoldRemote-ExtensionMaps.js"),g=t("./views/PictView-Remote-Layout.js"),f=t("./views/PictView-Remote-TopBar.js"),v=t("./views/PictView-Remote-SettingsPanel.js"),b=t("./views/PictView-Remote-Gallery.js"),y=t("./views/PictView-Remote-MediaViewer.js"),w=t("./views/PictView-Remote-ImageViewer.js"),C=t("./views/PictView-Remote-VideoExplorer.js"),x=t("./views/PictView-Remote-AudioExplorer.js"),R=t("./views/PictView-Remote-ImageExplorer.js"),_=t("./views/PictView-Remote-VLCSetup.js"),D=t("./views/PictView-Remote-CollectionsPanel.js"),E=t("./views/PictView-Remote-FileInfoPanel.js"),A=t("./views/PictView-Remote-SubimagesPanel.js"),S=t("./views/PictView-Remote-RegionsBrowser.js"),T=t("./Pict-Application-RetoldRemote-Configuration.json");e.exports=class extends n{constructor(t,e,i){super(t,Object.assign({},T,e),i),this.pict.addView("ContentEditor-Layout",g.default_configuration,g),this.pict.addView("ContentEditor-TopBar",f.default_configuration,f),this.pict.addView("RetoldRemote-Gallery",b.default_configuration,b),this.pict.addView("RetoldRemote-MediaViewer",y.default_configuration,y),this.pict.addView("RetoldRemote-ImageViewer",w.default_configuration,w),this.pict.addView("RetoldRemote-SettingsPanel",v.default_configuration,v),this.pict.addView("RetoldRemote-VideoExplorer",C.default_configuration,C),this.pict.addView("RetoldRemote-AudioExplorer",x.default_configuration,x),this.pict.addView("RetoldRemote-ImageExplorer",R.default_configuration,R),this.pict.addView("RetoldRemote-VLCSetup",_.default_configuration,_),this.pict.addView("RetoldRemote-CollectionsPanel",D.default_configuration,D),this.pict.addView("RetoldRemote-FileInfoPanel",E.default_configuration,E),this.pict.addView("RetoldRemote-SubimagesPanel",A.default_configuration,A),this.pict.addView("RetoldRemote-RegionsBrowser",S.default_configuration,S),this.pict.addProvider("RetoldRemote-Provider",o.default_configuration,o),this.pict.addProvider("RetoldRemote-GalleryNavigation",r.default_configuration,r),this.pict.addProvider("RetoldRemote-GalleryFilterSort",a.default_configuration,a),this.pict.addProvider("RetoldRemote-Icons",s.default_configuration,s),this.pict.addProvider("RetoldRemote-Theme",l.default_configuration,l),this.pict.addProvider("RetoldRemote-FormattingUtilities",d.default_configuration,d),this.pict.addProvider("RetoldRemote-ToastNotification",c.default_configuration,c),this.pict.addProvider("RetoldRemote-OperationStatus",p.default_configuration,p),this.pict.addProvider("RetoldRemote-CollectionManager",h.default_configuration,h),this.pict.addProvider("RetoldRemote-AISortManager",u.default_configuration,u)}onAfterInitializeAsync(t){"undefined"!=typeof window&&(window.pict=this.pict),this.pict.AppData.RetoldRemote={ActiveMode:"gallery",Theme:"twilight",ViewMode:"list",ThumbnailSize:"medium",RawFileList:[],GalleryItems:[],GalleryCursorIndex:0,FolderCursorHistory:{},GalleryFilter:"all",SearchQuery:"",SearchCaseSensitive:!1,SearchRegex:!1,ServerCapabilities:{},FolderSummary:null,CurrentViewerFile:"",CurrentViewerMediaType:"",HashedFilenames:!0,ShowHiddenFiles:!1,DistractionFreeShowNav:!1,ImageFitMode:"fit",SidebarCollapsed:!1,SidebarWidth:250,AutoplayVideo:!1,AutoplayAudio:!1,ListShowExtension:!0,ListShowSize:!0,ListShowDate:!0,FilterState:{MediaType:"all",Extensions:[],SizeMin:null,SizeMax:null,DateModifiedAfter:null,DateModifiedBefore:null,DateCreatedAfter:null,DateCreatedBefore:null},SortField:"folder-first",SortDirection:"asc",FilterBarVisible:!1,FilterPanelOpen:!1,FilterPresets:[],Collections:[],CollectionsPanelOpen:!1,CollectionsPanelWidth:300,CollectionsPanelMode:"list",ActiveCollectionGUID:null,ActiveCollection:null,CollectionSearchQuery:"",LastUsedCollectionGUID:null,BrowsingCollection:!1,BrowsingCollectionIndex:-1,FavoritesGUID:null,FavoritesCollection:null,FavoritesPathSet:{},CurrentFileMetadata:null,AISortSettings:{AIEndpoint:"http://localhost:11434",AIModel:"llama3.1",AIProvider:"ollama",NamingTemplate:"{artist}/{album}/{track} - {title}"}},this._loadRemoteSettings();let e=this.pict.providers["RetoldRemote-Theme"];e&&e.applyTheme(this.pict.AppData.RetoldRemote.Theme),this.pict.AppData.ContentEditor={CurrentFile:"",ActiveEditor:"markdown",IsDirty:!1,IsSaving:!1,IsLoading:!1,Files:[],Document:{Segments:[{Content:""}]},CodeContent:"",SaveStatus:"",SaveStatusClass:"",AutoSegmentMarkdown:!1,AutoSegmentDepth:1,AutoContentPreview:!1,MarkdownEditingControls:!0,MarkdownWordWrap:!0,CodeWordWrap:!1,SidebarCollapsed:this.pict.AppData.RetoldRemote.SidebarCollapsed,SidebarWidth:this.pict.AppData.RetoldRemote.SidebarWidth,AutoPreviewImages:!0,AutoPreviewVideo:!1,AutoPreviewAudio:!1,ShowHiddenFiles:this.pict.AppData.RetoldRemote.ShowHiddenFiles,TopicsFilePath:""},this.pict.views["ContentEditor-Layout"].render(),this.pict.views["ContentEditor-TopBar"].render(),this.pict.views["RetoldRemote-CollectionsPanel"].render();let i=this.pict.providers["RetoldRemote-CollectionManager"];i&&i.fetchCollections(()=>{i.ensureFavoritesCollection()});let n=this.pict.views["ContentEditor-TopBar"];n&&"function"==typeof n.updateCollectionsIcon&&n.updateCollectionsIcon();let o=this,r=this.pict.providers["Pict-FileBrowser-List"];if(r){let t=r.selectFile.bind(r);r.selectFile=function(e){if(t(e),e&&"file"===e.Type)o.navigateToFile(e.Path);else if(e&&("folder"===e.Type||"archive"===e.Type)){let t=o.pict.AppData.PictFileBrowser&&o.pict.AppData.PictFileBrowser.CurrentLocation||"",i=t?t+"/"+e.Name:e.Name;o.loadFileList(i)}}}let a=this.pict.providers["Pict-FileBrowser-Browse"];if(a){let t=a.navigateToFolder.bind(a);a.navigateToFolder=function(e){t(e),o.loadFileList(e)}}let s=this.pict.providers["RetoldRemote-Provider"];s&&(s.fetchCapabilities((t,e)=>{!t&&e&&(o.pict.AppData.RetoldRemote.ServerCapabilities=e)}),s.fetchRemoteSettings((t,e)=>{!t&&e&&(o.pict.AppData.RetoldRemote.HashedFilenames=!!e.HashedFilenames)}));let l=this.pict.providers["RetoldRemote-GalleryNavigation"];l&&l.bindKeyboardNavigation();let d=window.location.hash||"";if(this.syncHiddenFilesSetting(()=>{o.loadFileList(null,()=>{d&&"#"!==d&&"#/"!==d&&"#/browse/"!==d&&"#/browse"!==d?window.location.hash=d:o.resolveHash()})}),"function"==typeof t)return t()}_getMediaType(t){return{js:!0,mjs:!0,cjs:!0,ts:!0,tsx:!0,jsx:!0,py:!0,rb:!0,java:!0,c:!0,cpp:!0,h:!0,hpp:!0,cs:!0,go:!0,rs:!0,php:!0,sh:!0,bash:!0,zsh:!0,pl:!0,r:!0,swift:!0,kt:!0,scala:!0,lua:!0,json:!0,xml:!0,yaml:!0,yml:!0,toml:!0,ini:!0,cfg:!0,conf:!0,env:!0,properties:!0,md:!0,markdown:!0,txt:!0,csv:!0,tsv:!0,log:!0,html:!0,htm:!0,css:!0,scss:!0,sass:!0,less:!0,sql:!0,graphql:!0,gql:!0,makefile:!0,dockerfile:!0,gitignore:!0,editorconfig:!0,htaccess:!0,npmrc:!0,eslintrc:!0,prettierrc:!0}[t]?"text":m.getCategory(t)}navigateToFile(t){if(!t)return;let e=this.getEditorTypeForFile(t),i=t.replace(/^.*\./,"").toLowerCase(),n=this._getMediaType(i),o=(this.pict.AppData.RetoldRemote,this.pict.providers["RetoldRemote-Provider"]),r=o?o.getFragmentIdentifier(t):t;if(window.location.hash="#/view/"+r,this.pict.AppData.ContentEditor.CurrentFile=t,this.pict.AppData.ContentEditor.ActiveEditor=e,"binary"===e){let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,n)}else if("text"===n){let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,"text")}else if("other"===n){let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,"document")}else{let e=this.pict.views["RetoldRemote-MediaViewer"];e&&e.showMedia(t,n)}let a=this.pict.views["ContentEditor-TopBar"];a&&(a.updateInfo(),"function"==typeof a.updateFavoritesIcon&&a.updateFavoritesIcon())}navigateToFileAs(t,e){if(!t)return;this.pict.AppData.RetoldRemote;let i=this.pict.providers["RetoldRemote-Provider"],n=i?i.getFragmentIdentifier(t):t;window.location.hash="#/view/"+n,this.pict.AppData.ContentEditor.CurrentFile=t,this.pict.AppData.ContentEditor.ActiveEditor="binary";let o=this.pict.views["RetoldRemote-MediaViewer"];o&&o.showMedia(t,e);let r=this.pict.views["ContentEditor-TopBar"];r&&(r.updateInfo(),"function"==typeof r.updateFavoritesIcon&&r.updateFavoritesIcon())}loadFileList(t,e){let i="function"==typeof e?e:"function"==typeof t?t:()=>{},n=this,o="string"==typeof t?t:null;null===o&&this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation&&(o=this.pict.AppData.PictFileBrowser.CurrentLocation);let r=n.pict.views["RetoldRemote-Gallery"];r&&"function"==typeof r.showLoadingState&&r.showLoadingState(o||""),r&&"function"==typeof r.cancelActiveRender&&r.cancelActiveRender();let a="/api/filebrowser/list";if(o&&o.length>0){let t=n.pict.providers["RetoldRemote-Provider"];a+=t?"?path="+t._getPathParam(o):"?path="+encodeURIComponent(o)}fetch(a).then(t=>{let e=t.headers.get("X-Retold-Folder-Hash");if(e&&o){let t=n.pict.providers["RetoldRemote-Provider"];t&&t.registerHash(o,e)}return t.json()}).then(e=>{n.pict.AppData.PictFileBrowser=n.pict.AppData.PictFileBrowser||{},n.pict.AppData.PictFileBrowser.FileList=e||[],n.pict.AppData.PictFileBrowser.CurrentLocation="string"==typeof t?t:n.pict.AppData.PictFileBrowser.CurrentLocation||"";let o=n.pict.providers["RetoldRemote-Provider"];if(o&&Array.isArray(e))for(let t=0;t<e.length;t++)e[t].Hash&&e[t].Path&&o.registerHash(e[t].Path,e[t].Hash);let r=n.pict.views["Pict-FileBrowser"];r&&r.render();let a=n.pict.views["Pict-FileBrowser-ListDetail"];a&&a.render(),n._injectSidebarAddFolderButton();let s=n.pict.AppData.RetoldRemote;s.RawFileList=e||[],s.ActiveMode="gallery",s.SearchQuery="",s.FilterState={MediaType:s.FilterState.MediaType,Extensions:[],SizeMin:null,SizeMax:null,DateModifiedAfter:null,DateModifiedBefore:null,DateCreatedAfter:null,DateCreatedBefore:null};let l=document.getElementById("RetoldRemote-Gallery-Container"),d=document.getElementById("RetoldRemote-Viewer-Container");l&&(l.style.display=""),d&&(d.style.display="none");let c=n.pict.providers["RetoldRemote-GalleryFilterSort"];if(c)c.applyFilterSort();else{s.GalleryItems=e||[];let t=s.FolderCursorHistory&&s.FolderCursorHistory[n.pict.AppData.PictFileBrowser.CurrentLocation||""];s.GalleryCursorIndex="number"==typeof t&&t<(e||[]).length?t:0;let i=n.pict.views["RetoldRemote-Gallery"];i&&i.renderGallery()}let p=n.pict.AppData.PictFileBrowser.CurrentLocation||"",h=n.pict.providers["RetoldRemote-Provider"],u=h&&p?h.getFragmentIdentifier(p):p;window.location.hash=u?"#/browse/"+u:"#/browse/";let m=n.pict.providers["RetoldRemote-Provider"],g=/\.(zip|7z|rar|tar|tgz|cbz|cbr|tar\.gz|tar\.bz2|tar\.xz)(\/|$)/i.test(p);if(m&&!g)m.fetchFolderSummary(p,(t,e)=>{if(!t&&e){s.FolderSummary=e;let t=n.pict.views["ContentEditor-TopBar"];t&&(t.updateLocation(),t.updateInfo())}});else{let t=n.pict.views["ContentEditor-TopBar"];t&&(t.updateLocation(),t.updateInfo())}return i()}).catch(t=>(n.log.error(`Failed to load file list: ${t.message}`),i()))}resolveHash(){let t=decodeURIComponent((window.location.hash||"").replace(/^#\/?/,""));if(!t)return;let e=t.split("/"),i=this.pict.providers["RetoldRemote-Provider"],n=this,o=e[0];if(["browse","view","explore","explore-audio","explore-image","edit"].indexOf(o)>=0&&e.length>=2){let t=e.slice(1).join("/"),r=i?i.resolveFragmentIdentifier(t):t;if(/^[a-f0-9]{10}$/.test(r))return void n._resolveHashFromServer(r,t=>{n._executeRoute(o,t||r)});this._executeRoute(o,r)}else if("collection"===o&&e.length>=2){let t=e[1],i=this.pict.providers["RetoldRemote-CollectionManager"];if(i){this.pict.AppData.RetoldRemote.CollectionsPanelMode="detail",i.openPanel(),i.fetchCollection(t)}}}_executeRoute(t,e){let i=this.pict.AppData.RetoldRemote.ActiveMode||"gallery";switch(t){case"browse":e===(this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"")&&"gallery"===i||this.loadFileList(e);break;case"view":case"edit":this.pict.AppData.ContentEditor.CurrentFile===e&&"gallery"!==i||this.navigateToFile(e);break;case"explore":{let t=this.pict.views["RetoldRemote-VideoExplorer"];t&&t.showExplorer(e);break}case"explore-audio":{let t=this.pict.views["RetoldRemote-AudioExplorer"];t&&t.showExplorer(e);break}case"explore-image":{let t=this.pict.views["RetoldRemote-ImageExplorer"];t&&t.showExplorer(e);break}}}_resolveHashFromServer(t,e){let i=this;fetch("/api/resolve-hash/"+t).then(t=>t.ok?t.json():e(null)).then(n=>{if(n&&n.Success&&n.Path){let o=i.pict.providers["RetoldRemote-Provider"];o&&o.registerHash(n.Path,t);let r=n.Path.replace(/\/[^/]+$/,"")||"";return i.loadFileList(r),e(n.Path)}return e(null)}).catch(()=>e(null))}_injectSidebarAddFolderButton(){let t=document.getElementById("Pict-FileBrowser-DetailRows");if(!t)return;let e=t.parentElement.querySelector(".retold-remote-sidebar-addfolder");e&&e.parentElement.removeChild(e);let i=document.createElement("button");i.className="retold-remote-sidebar-addfolder",i.textContent="+ New Folder",i.title="Create a new folder here",i.onclick=function(){pict.PictApplication.promptNewFolder()},t.parentElement.appendChild(i)}saveSettings(){try{let t=this.pict.AppData.RetoldRemote,e={Theme:t.Theme,ViewMode:t.ViewMode,ThumbnailSize:t.ThumbnailSize,GalleryFilter:t.GalleryFilter,ShowHiddenFiles:t.ShowHiddenFiles,DistractionFreeShowNav:t.DistractionFreeShowNav,ImageFitMode:t.ImageFitMode,SidebarCollapsed:t.SidebarCollapsed,SidebarWidth:t.SidebarWidth,SortField:t.SortField,SortDirection:t.SortDirection,FilterPresets:t.FilterPresets,FilterPanelOpen:t.FilterPanelOpen,AutoplayVideo:t.AutoplayVideo,AutoplayAudio:t.AutoplayAudio,ListShowExtension:t.ListShowExtension,ListShowSize:t.ListShowSize,ListShowDate:t.ListShowDate,CollectionsPanelOpen:t.CollectionsPanelOpen,CollectionsPanelWidth:t.CollectionsPanelWidth,LastUsedCollectionGUID:t.LastUsedCollectionGUID,FavoritesGUID:t.FavoritesGUID,AISortSettings:t.AISortSettings};localStorage.setItem("retold-remote-settings",JSON.stringify(e))}catch(t){}}_loadRemoteSettings(){try{let t=localStorage.getItem("retold-remote-settings");if(t){let e=JSON.parse(t),i=this.pict.AppData.RetoldRemote;e.Theme&&(i.Theme=e.Theme),e.ViewMode&&(i.ViewMode=e.ViewMode),e.ThumbnailSize&&(i.ThumbnailSize=e.ThumbnailSize),e.GalleryFilter&&(i.GalleryFilter=e.GalleryFilter,i.FilterState.MediaType=e.GalleryFilter),"boolean"==typeof e.ShowHiddenFiles&&(i.ShowHiddenFiles=e.ShowHiddenFiles),"boolean"==typeof e.DistractionFreeShowNav&&(i.DistractionFreeShowNav=e.DistractionFreeShowNav),e.ImageFitMode&&(i.ImageFitMode=e.ImageFitMode),"boolean"==typeof e.SidebarCollapsed&&(i.SidebarCollapsed=e.SidebarCollapsed),e.SidebarWidth&&(i.SidebarWidth=e.SidebarWidth),e.SortField&&(i.SortField=e.SortField),e.SortDirection&&(i.SortDirection=e.SortDirection),Array.isArray(e.FilterPresets)&&(i.FilterPresets=e.FilterPresets),"boolean"==typeof e.FilterPanelOpen&&(i.FilterPanelOpen=e.FilterPanelOpen),"boolean"==typeof e.AutoplayVideo&&(i.AutoplayVideo=e.AutoplayVideo),"boolean"==typeof e.AutoplayAudio&&(i.AutoplayAudio=e.AutoplayAudio),"boolean"==typeof e.ListShowExtension&&(i.ListShowExtension=e.ListShowExtension),"boolean"==typeof e.ListShowSize&&(i.ListShowSize=e.ListShowSize),"boolean"==typeof e.ListShowDate&&(i.ListShowDate=e.ListShowDate),"boolean"==typeof e.CollectionsPanelOpen&&(i.CollectionsPanelOpen=e.CollectionsPanelOpen),e.CollectionsPanelWidth&&(i.CollectionsPanelWidth=e.CollectionsPanelWidth),e.LastUsedCollectionGUID&&(i.LastUsedCollectionGUID=e.LastUsedCollectionGUID),e.FavoritesGUID&&(i.FavoritesGUID=e.FavoritesGUID),e.AISortSettings&&"object"==typeof e.AISortSettings&&(e.AISortSettings.AIEndpoint&&(i.AISortSettings.AIEndpoint=e.AISortSettings.AIEndpoint),e.AISortSettings.AIModel&&(i.AISortSettings.AIModel=e.AISortSettings.AIModel),e.AISortSettings.AIProvider&&(i.AISortSettings.AIProvider=e.AISortSettings.AIProvider),e.AISortSettings.NamingTemplate&&(i.AISortSettings.NamingTemplate=e.AISortSettings.NamingTemplate))}}catch(t){}}}},{"./Pict-Application-RetoldRemote-Configuration.json":128,"./RetoldRemote-ExtensionMaps.js":131,"./providers/Pict-Provider-AISortManager.js":135,"./providers/Pict-Provider-CollectionManager.js":136,"./providers/Pict-Provider-FormattingUtilities.js":137,"./providers/Pict-Provider-GalleryFilterSort.js":138,"./providers/Pict-Provider-GalleryNavigation.js":139,"./providers/Pict-Provider-OperationStatus.js":140,"./providers/Pict-Provider-RetoldRemote.js":141,"./providers/Pict-Provider-RetoldRemoteIcons.js":142,"./providers/Pict-Provider-RetoldRemoteTheme.js":143,"./providers/Pict-Provider-ToastNotification.js":144,"./views/PictView-Remote-AudioExplorer.js":155,"./views/PictView-Remote-CollectionsPanel.js":156,"./views/PictView-Remote-FileInfoPanel.js":157,"./views/PictView-Remote-Gallery.js":158,"./views/PictView-Remote-ImageExplorer.js":159,"./views/PictView-Remote-ImageViewer.js":160,"./views/PictView-Remote-Layout.js":161,"./views/PictView-Remote-MediaViewer.js":162,"./views/PictView-Remote-RegionsBrowser.js":163,"./views/PictView-Remote-SettingsPanel.js":164,"./views/PictView-Remote-SubimagesPanel.js":165,"./views/PictView-Remote-TopBar.js":166,"./views/PictView-Remote-VLCSetup.js":167,"./views/PictView-Remote-VideoExplorer.js":168,"pict-section-filebrowser":66,"retold-content-system":114}],130:[function(t,e,i){e.exports={RetoldRemoteApplication:t("./Pict-Application-RetoldRemote.js")},"undefined"!=typeof window&&(window.RetoldRemoteApplication=e.exports.RetoldRemoteApplication)},{"./Pict-Application-RetoldRemote.js":129}],131:[function(t,e,i){const n={nef:!0,nrw:!0,cr2:!0,cr3:!0,crw:!0,arw:!0,srf:!0,sr2:!0,raf:!0,orf:!0,rw2:!0,rwl:!0,pef:!0,srw:!0,x3f:!0,"3fr":!0,fff:!0,iiq:!0,dcr:!0,kdc:!0,mrw:!0,erf:!0,raw:!0,dng:!0,heic:!0,heif:!0},o={png:!0,jpg:!0,jpeg:!0,gif:!0,webp:!0,svg:!0,bmp:!0,ico:!0,avif:!0,tiff:!0,tif:!0,heic:!0,heif:!0};for(let t in n)o[t]=!0;const r={mp4:!0,webm:!0,mov:!0,mkv:!0,avi:!0,wmv:!0,flv:!0,m4v:!0,ogv:!0,mpg:!0,mpeg:!0,mpe:!0,mpv:!0,m2v:!0,ts:!0,mts:!0,m2ts:!0,vob:!0,"3gp":!0,"3g2":!0,f4v:!0,rm:!0,rmvb:!0,divx:!0,asf:!0,mxf:!0,dv:!0,nsv:!0,nuv:!0,y4m:!0,wtv:!0,swf:!0,dat:!0},a={mp3:!0,wav:!0,ogg:!0,flac:!0,aac:!0,m4a:!0,wma:!0,oga:!0},s={pdf:!0,epub:!0,mobi:!0,doc:!0,docx:!0,rtf:!0,odt:!0,wpd:!0,wps:!0,pages:!0,odp:!0,ppt:!0,pptx:!0,ods:!0,xls:!0,xlsx:!0};e.exports.RawImageExtensions=n,e.exports.ImageExtensions=o,e.exports.VideoExtensions=r,e.exports.AudioExtensions=a,e.exports.DocumentExtensions=s,e.exports.getCategory=function(t){let e=(t||"").replace(/^\./,"").toLowerCase();return o[e]?"image":r[e]?"video":a[e]?"audio":s[e]?"document":"other"},e.exports.isRawImage=function(t){let e=(t||"").replace(/^\./,"").toLowerCase();return!!n[e]}},{}],132:[function(t,e,i){
|
|
128
128
|
/**
|
|
129
129
|
* CollectionManager — Add Items Mixin
|
|
130
130
|
*
|
|
@@ -254,7 +254,7 @@ const n="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/4.9.155/pdf.min.mjs";e.ex
|
|
|
254
254
|
*
|
|
255
255
|
* @license MIT
|
|
256
256
|
*/
|
|
257
|
-
const n=t("pict-view"),o={ViewIdentifier:"RetoldRemote-CollectionsPanel",DefaultRenderable:"RetoldRemote-CollectionsPanel",DefaultDestinationAddress:"#RetoldRemote-Collections-Container",AutoRender:!1,CSS:"",Templates:[{Hash:"RetoldRemote-CollectionsPanel",Template:'<div class="retold-remote-collections-panel" id="RetoldRemote-CollectionsPanel-Root"></div>'}],Renderables:[{RenderableHash:"RetoldRemote-CollectionsPanel",TemplateHash:"RetoldRemote-CollectionsPanel",DestinationAddress:"#RetoldRemote-Collections-Container"}]};class r extends n{constructor(t,e,i){super(t,e,i),this._draggedItemId=null}onAfterRender(){super.onAfterRender(),this.renderContent()}renderContent(){let t=document.getElementById("RetoldRemote-CollectionsPanel-Root");if(t)switch(this.pict.AppData.RetoldRemote.CollectionsPanelMode){case"detail":this._renderDetailMode(t);break;case"edit":this._renderEditMode(t);break;default:this._renderListMode(t)}}_renderListMode(t){let e=this,i=this.pict.AppData.RetoldRemote,n=this.pict.providers["RetoldRemote-CollectionManager"];t.innerHTML="";let o=document.createElement("div");o.className="retold-remote-collections-header";let r=document.createElement("div");r.className="retold-remote-collections-header-title",r.textContent="Collections";let a=document.createElement("button");a.className="retold-remote-collections-header-btn",a.title="New Collection",a.textContent="+",a.onclick=()=>{let t=prompt("Collection name:");t&&t.trim()&&n.createCollection(t.trim(),(t,e)=>{!t&&e&&(i.CollectionsPanelMode="detail",n.fetchCollection(e.GUID))})},o.appendChild(r),o.appendChild(a),t.appendChild(o);let s=document.createElement("div");s.className="retold-remote-collections-search";let l=document.createElement("input");l.type="text",l.placeholder="Search collections...",l.value=i.CollectionSearchQuery||"",l.oninput=n=>{i.CollectionSearchQuery=n.target.value,e._renderCollectionCards(t.querySelector(".retold-remote-collections-body"))},s.appendChild(l),t.appendChild(s);let d=document.createElement("div");d.className="retold-remote-collections-body",t.appendChild(d),this._renderCollectionCards(d)}_renderCollectionCards(t){if(!t)return;let e=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-CollectionManager"],n=this.pict.providers["RetoldRemote-Icons"];t.innerHTML="";let o=i.searchCollections(e.CollectionSearchQuery);if(!o||0===o.length){let i=document.createElement("div");return i.className="retold-remote-collections-empty",i.textContent=e.CollectionSearchQuery?"No collections match your search.":"No collections yet. Click + to create one.",void t.appendChild(i)}for(let r=0;r<o.length;r++){let a=o[r],s=document.createElement("div");s.className="retold-remote-collection-card",s.onclick=()=>{e.CollectionsPanelMode="detail",i.fetchCollection(a.GUID)};let l=document.createElement("div");l.className="retold-remote-collection-card-icon",n&&"function"==typeof n.getIcon?l.innerHTML=n.getIcon("bookmark",18):l.textContent="☰";let d=document.createElement("div");d.className="retold-remote-collection-card-info";let c=document.createElement("div");c.className="retold-remote-collection-card-name",c.textContent=a.Name||"Untitled";let p=document.createElement("div");p.className="retold-remote-collection-card-meta",p.textContent=a.ItemCount+" item"+(1!==a.ItemCount?"s":""),d.appendChild(c),d.appendChild(p),s.appendChild(l),s.appendChild(d),t.appendChild(s)}}_renderDetailMode(t){let e=this,i=this.pict.AppData.RetoldRemote,n=this.pict.providers["RetoldRemote-CollectionManager"],o=i.ActiveCollection;if(t.innerHTML="",!o)return void(t.innerHTML='<div class="retold-remote-collections-empty">Loading...</div>');let r=document.createElement("div");r.className="retold-remote-collections-header";let a=document.createElement("button");a.className="retold-remote-collections-header-btn",a.title="Back to list",a.textContent="←",a.onclick=()=>{i.CollectionsPanelMode="list",i.ActiveCollectionGUID=null,i.ActiveCollection=null,e.renderContent()};let s=document.createElement("div");s.className="retold-remote-collections-header-title",s.textContent=o.Name||"Untitled";let l=document.createElement("button");l.className="retold-remote-collections-header-btn",l.title="Edit collection",l.textContent="✎",l.onclick=()=>{i.CollectionsPanelMode="edit",e.renderContent()},r.appendChild(a),r.appendChild(s),r.appendChild(l),t.appendChild(r);let d="operation-plan"===o.CollectionType;if(d){let e=document.createElement("div");e.className="retold-remote-collections-detail-controls retold-remote-collections-op-controls";let i=o.Items||[],r=0,a=0,s=0,l=0;for(let t=0;t<i.length;t++){let e=i[t].OperationStatus;"completed"===e?a++:"failed"===e?s++:"skipped"===e?l++:i[t].Operation&&r++}let d=document.createElement("div");d.className="retold-remote-collections-op-summary";let c=[];r>0&&c.push(r+" pending"),a>0&&c.push(a+" done"),s>0&&c.push(s+" failed"),l>0&&c.push(l+" skipped"),d.textContent=c.join(" · ")||"No operations",e.appendChild(d);let p=document.createElement("div");if(p.className="retold-remote-collections-op-buttons",r>0){let t=document.createElement("button");t.className="retold-remote-collections-op-execute-btn",t.textContent="Execute "+r+" Move"+(r>1?"s":""),t.onclick=()=>{t.disabled=!0,t.textContent="Moving...",n.executeCollectionOperations(o.GUID)},p.appendChild(t)}if(o.OperationBatchGUID&&a>0){let t=document.createElement("button");t.className="retold-remote-collections-op-undo-btn",t.textContent="Undo",t.onclick=()=>{t.disabled=!0,t.textContent="Undoing...",n.undoCollectionOperations(o.GUID)},p.appendChild(t)}e.appendChild(p),t.appendChild(e)}else{let r=document.createElement("div");r.className="retold-remote-collections-detail-controls";let a=document.createElement("select");a.className="retold-remote-collections-sort-select";let s=[{value:"manual",label:"Manual"},{value:"name",label:"Name"},{value:"modified",label:"Date Added"},{value:"type",label:"Type"}];for(let t=0;t<s.length;t++){let e=document.createElement("option");e.value=s[t].value,e.textContent=s[t].label,o.SortMode===s[t].value&&(e.selected=!0),a.appendChild(e)}a.onchange=t=>{n.sortActiveCollection(t.target.value,null)};let l=document.createElement("button");l.className="retold-remote-collections-sort-dir",l.textContent="desc"===o.SortDirection?"↓":"↑",l.title="desc"===o.SortDirection?"Descending":"Ascending",l.onclick=()=>{let t="desc"===i.ActiveCollection.SortDirection?"asc":"desc";n.sortActiveCollection(null,t)};let d=document.createElement("button");d.className="retold-remote-collections-export-btn",d.textContent="⇩ Export",d.title="Export collection to a folder",d.onclick=()=>{e._showExportDialog(o.GUID,o.Name)},r.appendChild(a),r.appendChild(l),r.appendChild(d),t.appendChild(r)}let c=document.createElement("div");c.className="retold-remote-collections-body",t.appendChild(c),d?this._renderOperationItemList(c,o):this._renderItemList(c,o)}_renderItemList(t,e){let i=this,n=(this.pict.AppData.RetoldRemote,this.pict.providers["RetoldRemote-CollectionManager"]),o=e.Items||[];if(t.innerHTML="",0===o.length){let e=document.createElement("div");return e.className="retold-remote-collections-empty",e.textContent="No items yet. Browse files and add them to this collection.",void t.appendChild(e)}for(let r=0;r<o.length;r++){let a=o[r],s=document.createElement("div");if(s.className="retold-remote-collection-item",s.setAttribute("data-item-id",a.ID),"manual"===e.SortMode){let e=document.createElement("div");e.className="retold-remote-collection-item-drag",e.textContent="☰",e.draggable=!0,e.ondragstart=t=>{i._draggedItemId=a.ID,s.classList.add("dragging"),t.dataTransfer.effectAllowed="move"},e.ondragend=()=>{s.classList.remove("dragging"),i._draggedItemId=null;let e=t.querySelectorAll(".retold-remote-collection-item");for(let t=0;t<e.length;t++)e[t].classList.remove("drag-over")},s.appendChild(e)}s.ondragover=t=>{t.preventDefault(),t.dataTransfer.dropEffect="move",s.classList.add("drag-over")},s.ondragleave=()=>{s.classList.remove("drag-over")},s.ondrop=t=>{if(t.preventDefault(),s.classList.remove("drag-over"),i._draggedItemId&&i._draggedItemId!==a.ID){let t=e.Items||[],o=[];for(let e=0;e<t.length;e++)t[e].ID!==i._draggedItemId&&(t[e].ID===a.ID&&o.push(i._draggedItemId),o.push(t[e].ID));n.reorderItems(e.GUID,o)}};let l=document.createElement("div");l.className="retold-remote-collection-item-icon";let d=a.Path||"",c=d.replace(/^.*\./,"").toLowerCase(),p=this.pict.PictApplication._getMediaType(c);if("video-frame"===a.Type&&a.FrameCacheKey&&a.FrameFilename){let t=document.createElement("img");t.src="/api/media/video-frame/"+encodeURIComponent(a.FrameCacheKey)+"/"+encodeURIComponent(a.FrameFilename),t.alt="",t.loading="lazy",l.appendChild(t)}else if("image-crop"===a.Type&&a.CropRegion){let t=document.createElement("img"),e=this.pict.providers["RetoldRemote-Provider"];e&&(t.src=e.getThumbnailURL(d,48,48)),t.alt="",t.loading="lazy",l.appendChild(t)}else if("image"===p&&"file"===a.Type){let t=document.createElement("img"),e=this.pict.providers["RetoldRemote-Provider"];e&&(t.src=e.getThumbnailURL(d,48,48)),t.alt="",t.loading="lazy",l.appendChild(t)}else l.textContent=this._getTypeIcon(a.Type,p);let h=document.createElement("div");h.className="retold-remote-collection-item-name",h.textContent=a.Label||d.split("/").pop()||d,h.title=d;let u=document.createElement("div");u.className="retold-remote-collection-item-type",u.textContent=a.Type||"file";let m=document.createElement("button");m.className="retold-remote-collection-item-remove",m.title="Remove from collection",m.textContent="×",m.onclick=t=>{t.stopPropagation(),n.removeItemFromCollection(e.GUID,a.ID)};let g=r;s.onclick=()=>{if("folder"===a.Type||"folder-contents"===a.Type)i.pict.PictApplication.loadFileList(a.Path);else{let t=i.pict.providers["RetoldRemote-GalleryNavigation"];t&&t._navigateToCollectionItem(a,g)}},s.appendChild(l),s.appendChild(h),s.appendChild(u),s.appendChild(m),t.appendChild(s)}}_renderOperationItemList(t,e){let i=this,n=this.pict.providers["RetoldRemote-CollectionManager"],o=e.Items||[];if(t.innerHTML="",0===o.length){let e=document.createElement("div");return e.className="retold-remote-collections-empty",e.textContent="No items in this sort plan.",void t.appendChild(e)}for(let r=0;r<o.length;r++){let a=o[r],s=document.createElement("div");s.className="retold-remote-collection-op-item";let l=a.OperationStatus||"pending";s.classList.add("op-status-"+l);let d=document.createElement("div");d.className="retold-remote-collection-op-status","completed"===l?(d.textContent="✓",d.title="Completed"):"failed"===l?(d.textContent="✗",d.title=a.OperationError||"Failed"):"skipped"===l?(d.textContent="—",d.title="Skipped"):(d.textContent="○",d.title="Pending");let c=document.createElement("div");c.className="retold-remote-collection-op-source";let p=a.Path||"";c.textContent=p.split("/").pop()||p,c.title=p;let h=document.createElement("div");h.className="retold-remote-collection-op-arrow",h.textContent="→";let u=document.createElement("div");u.className="retold-remote-collection-op-dest";let m=a.DestinationPath||"";u.textContent=m||"(no destination)",u.title=m,"pending"===l&&(u.style.cursor="pointer",u.onclick=t=>{t.stopPropagation(),i._startEditDestination(u,a,e)});let g=document.createElement("div");g.className="retold-remote-collection-op-badge",g.textContent=(a.Operation||"move").toUpperCase();let f=document.createElement("button");if(f.className="retold-remote-collection-item-remove",f.title="Skip this operation",f.textContent="×","pending"===l?f.onclick=t=>{t.stopPropagation(),n.skipItemOperation(a.ID)}:f.style.visibility="hidden","failed"===l&&a.OperationError){let t=document.createElement("div");t.className="retold-remote-collection-op-error",t.textContent=a.OperationError,s.appendChild(t)}s.appendChild(d),s.appendChild(c),s.appendChild(h),s.appendChild(u),s.appendChild(g),s.appendChild(f),t.appendChild(s)}}_startEditDestination(t,e,i){let n=this.pict.providers["RetoldRemote-CollectionManager"],o=document.createElement("input");o.type="text",o.className="retold-remote-collection-op-dest-input",o.value=e.DestinationPath||"";o.onblur=()=>{let i=o.value.trim();i&&i!==e.DestinationPath&&n.setItemDestination(e.ID,i),t.textContent=i||e.DestinationPath||"(no destination)",t.title=i||e.DestinationPath||""},o.onkeydown=i=>{"Enter"===i.key?(i.preventDefault(),o.blur()):"Escape"===i.key&&(i.preventDefault(),t.textContent=e.DestinationPath||"(no destination)",t.title=e.DestinationPath||"")},t.textContent="",t.appendChild(o),o.focus(),o.select()}_renderEditMode(t){let e=this,i=this.pict.AppData.RetoldRemote,n=this.pict.providers["RetoldRemote-CollectionManager"],o=i.ActiveCollection;if(t.innerHTML="",!o)return void(t.innerHTML='<div class="retold-remote-collections-empty">No collection selected.</div>');let r=document.createElement("div");r.className="retold-remote-collections-header";let a=document.createElement("button");a.className="retold-remote-collections-header-btn",a.title="Back to detail",a.textContent="←",a.onclick=()=>{i.CollectionsPanelMode="detail",e.renderContent()};let s=document.createElement("div");s.className="retold-remote-collections-header-title",s.textContent="Edit Collection",r.appendChild(a),r.appendChild(s),t.appendChild(r);let l=document.createElement("div");l.className="retold-remote-collections-body";let d=document.createElement("div");d.className="retold-remote-collections-edit",d.appendChild(this._createEditGroup("Name","input",o.Name||"","edit-name")),d.appendChild(this._createEditGroup("Description (Markdown)","textarea",o.Description||"","edit-description"));let c=this._createEditGroup("Cover Image Path","input",o.CoverImage||"","edit-cover"),p=this.pict.AppData.ContentEditor.CurrentFile;if(p){let t=document.createElement("button");t.className="retold-remote-collections-edit-btn",t.textContent="Use current file",t.style.marginTop="4px",t.style.fontSize="0.72rem",t.onclick=()=>{let t=document.getElementById("retold-remote-edit-cover");t&&(t.value=p)},c.appendChild(t)}d.appendChild(c),d.appendChild(this._createEditGroup("Tags (comma-separated)","input",(o.Tags||[]).join(", "),"edit-tags"));let h=document.createElement("div");h.className="retold-remote-collections-edit-actions";let u=document.createElement("button");u.className="retold-remote-collections-edit-btn retold-remote-collections-edit-btn-primary",u.textContent="Save",u.onclick=()=>{let t=document.getElementById("retold-remote-edit-name"),e=document.getElementById("retold-remote-edit-description"),r=document.getElementById("retold-remote-edit-cover"),a=document.getElementById("retold-remote-edit-tags"),s={GUID:o.GUID,Name:t?t.value:o.Name,Description:e?e.value:o.Description,CoverImage:r?r.value:o.CoverImage,Tags:a?a.value.split(",").map(t=>t.trim()).filter(t=>t):o.Tags};n.updateCollection(s,t=>{if(!t){i.CollectionsPanelMode="detail",n.fetchCollection(o.GUID);let t=n._getToast();t&&t.show("Collection saved")}})};let m=document.createElement("button");m.className="retold-remote-collections-edit-btn",m.textContent="Cancel",m.onclick=()=>{i.CollectionsPanelMode="detail",e.renderContent()},h.appendChild(u),h.appendChild(m),d.appendChild(h);let g=document.createElement("button");g.className="retold-remote-collections-edit-btn retold-remote-collections-edit-btn-danger",g.textContent="Delete Collection",g.onclick=()=>{confirm("Delete this collection? This cannot be undone.")&&n.deleteCollection(o.GUID)},d.appendChild(g),l.appendChild(d),t.appendChild(l)}_createEditGroup(t,e,i,n){let o=document.createElement("div");o.className="retold-remote-collections-edit-group";let r,a=document.createElement("div");return a.className="retold-remote-collections-edit-label",a.textContent=t,"textarea"===e?(r=document.createElement("textarea"),r.className="retold-remote-collections-edit-textarea"):(r=document.createElement("input"),r.className="retold-remote-collections-edit-input",r.type="text"),r.value=i,r.id="retold-remote-"+n,o.appendChild(a),o.appendChild(r),o}_getTypeIcon(t,e){switch(t){case"folder":case"folder-contents":return"📁";case"subfile":return"🗄";case"image-crop":return"✂";case"audio-clip":return"🎵";case"video-clip":case"video-frame":return"🎬"}switch(e){case"image":return"🖼";case"video":return"🎬";case"audio":return"🎵";default:return"📄"}}_showExportDialog(t,e){let i=this,n=(e||"collection-export").replace(/[<>:"/\\|?*\x00-\x1F]/g,"_").replace(/\s+/g,"_").substring(0,80),o=this.pict.AppData.RetoldRemote.CurrentBrowsedFolder||"",r=o?o.replace(/\/+$/,"")+"/"+n:n,a=document.getElementById("RetoldRemote-Collections-Detail");if(!a)return;let s=document.getElementById("RetoldRemote-ExportDialog");s&&s.parentElement.removeChild(s);let l=document.createElement("div");l.id="RetoldRemote-ExportDialog",l.style.cssText="padding:10px;border-top:1px solid var(--retold-border);background:var(--retold-bg-secondary,#21252b);",l.innerHTML='<div style="font-size:0.78rem;color:var(--retold-text);margin-bottom:6px;">Export to folder (within content root):</div><input type="text" id="RetoldRemote-ExportPath" value="'+r.replace(/"/g,""")+'" style="width:100%;box-sizing:border-box;background:var(--retold-bg-input,#1e1e1e);color:var(--retold-text);border:1px solid var(--retold-border);border-radius:4px;padding:4px 8px;font-size:0.78rem;font-family:inherit;margin-bottom:6px;"><div style="display:flex;gap:6px;"><button id="RetoldRemote-ExportConfirmBtn" style="flex:1;padding:4px 8px;font-size:0.75rem;">Export</button><button id="RetoldRemote-ExportCancelBtn" style="padding:4px 8px;font-size:0.75rem;">Cancel</button></div><div id="RetoldRemote-ExportStatus" style="font-size:0.72rem;color:var(--retold-text-dim);margin-top:6px;display:none;"></div>',a.appendChild(l);let d=document.getElementById("RetoldRemote-ExportPath");d&&(d.focus(),d.select()),document.getElementById("RetoldRemote-ExportCancelBtn").onclick=()=>{l.parentElement.removeChild(l)},document.getElementById("RetoldRemote-ExportConfirmBtn").onclick=()=>{let n=d?d.value.trim():"";if(!n)return;let o=document.getElementById("RetoldRemote-ExportConfirmBtn"),r=document.getElementById("RetoldRemote-ExportStatus");o&&(o.disabled=!0),o&&(o.textContent="Exporting…"),r&&(r.style.display=""),r&&(r.textContent="Exporting…");let a=i.pict.providers["RetoldRemote-OperationStatus"],s=a?a.startOperation({Label:"Exporting collection"+(e?": "+e:""),Phase:"Starting export…",Cancelable:!0}):null,c={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({DestinationPath:n})};s&&s.AbortController&&(c.signal=s.AbortController.signal),s&&(c.headers["X-Op-Id"]=s.OperationId),fetch("/api/collections/"+encodeURIComponent(t)+"/export",c).then(t=>t.json()).then(t=>{if(t&&t.Success){s&&a&&a.completeOperation(s.OperationId);let e="Exported "+t.ExportedCount+" of "+t.TotalItems+" items";t.ErrorCount>0&&(e+=" ("+t.ErrorCount+" errors)"),t.Cancelled&&(e="Export cancelled after "+t.ExportedCount+" of "+t.TotalItems+" items"),e+=" to "+t.DestinationPath,r&&(r.textContent=e),o&&(o.textContent=t.Cancelled?"Close":"Done");let n=i.pict.providers["RetoldRemote-ToastNotification"];n&&n.showToast(e),t.Cancelled||setTimeout(()=>{l.parentElement&&l.parentElement.removeChild(l)},3e3)}else{s&&a&&a.errorOperation(s.OperationId,{message:t&&t.Error||"Export failed"});let e=t&&t.Error||"Export failed";r&&(r.textContent=e),r&&(r.style.color="#e06c75"),o&&(o.textContent="Retry"),o&&(o.disabled=!1)}}).catch(t=>{if(t&&"AbortError"===t.name)return r&&(r.textContent="Cancelled"),o&&(o.textContent="Close"),void(o&&(o.disabled=!1));s&&a&&a.errorOperation(s.OperationId,t),r&&(r.textContent="Request failed: "+t.message),r&&(r.style.color="#e06c75"),o&&(o.textContent="Retry"),o&&(o.disabled=!1)})},d&&(d.onkeydown=t=>{"Enter"===t.key&&document.getElementById("RetoldRemote-ExportConfirmBtn").click(),"Escape"===t.key&&l.parentElement.removeChild(l)})}}r.default_configuration=o,e.exports=r},{"pict-view":102}],157:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"RetoldRemote-FileInfoPanel",DefaultRenderable:"RetoldRemote-FileInfoPanel",DefaultDestinationAddress:"#RetoldRemote-Info-Container",AutoRender:!1,CSS:"",DefaultTemplateRecordAddress:!1,Templates:[{Hash:"RetoldRemote-FileInfoPanel",Template:'<div class="retold-remote-info" id="RetoldRemote-Info-Body"></div>'}],Renderables:[{RenderableHash:"RetoldRemote-FileInfoPanel",TemplateHash:"RetoldRemote-FileInfoPanel",DestinationAddress:"#RetoldRemote-Info-Container"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._currentPath=null,this._currentMetadata=null,this._extracting=!1}onAfterRender(){this._refreshForCurrentFile()}_refreshForCurrentFile(){let t=this.pict.AppData.RetoldRemote,e="";if(this.pict.AppData.ContentEditor&&this.pict.AppData.ContentEditor.CurrentFile&&(e=this.pict.AppData.ContentEditor.CurrentFile),!e&&t.CurrentViewerFile&&(e=t.CurrentViewerFile),!e){let i=t.GalleryItems||[],n=t.GalleryCursorIndex||0;i.length>0&&i[n]&&i[n].Path&&(e=i[n].Path)}e?e===this._currentPath&&this._currentMetadata?this._renderMetadata(this._currentMetadata):(this._currentPath=e,this._currentMetadata=null,this._fetchMetadata(e,!1)):this._renderEmpty("No file selected")}_fetchMetadata(t,e){let i=this,n="/api/media/extended-metadata?path="+encodeURIComponent(t);e&&(n+="&extract=true",this._extracting=!0,this._renderSpinner()),fetch(n).then(t=>t.json()).then(e=>{i._extracting=!1,e&&e.Success?(i._currentMetadata=e,i.pict.AppData.RetoldRemote.CurrentFileMetadata=e,i._renderMetadata(e)):e&&!1===e.Cached?i._renderUncached(t):i._renderEmpty("Could not load metadata")}).catch(t=>{i._extracting=!1,i._renderEmpty("Error: "+t.message)})}extractMetadata(){!this._extracting&&this._currentPath&&this._fetchMetadata(this._currentPath,!0)}_getExtension(t){let e=(t||"").split("/").pop()||"",i=e.lastIndexOf(".");return i<1?"":e.substring(i)}_getHashForCurrentFile(){let t=this.pict.providers.RetoldRemote;if(t&&"function"==typeof t.getHashForPath){let e=t.getHashForPath(this._currentPath);if(e)return e}let e=this.pict.AppData.RetoldRemote.GalleryItems||[];for(let t=0;t<e.length;t++)if(e[t].Path===this._currentPath&&e[t].Hash)return e[t].Hash;return null}_triggerDownload(t,e){let i=document.createElement("a");i.href=t,i.download=e,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}downloadFile(){if(!this._currentPath)return;let t=this._currentPath.split("/").pop()||this._currentPath,e="/content/"+encodeURIComponent(this._currentPath);this._triggerDownload(e,t)}downloadHashedFile(){if(!this._currentPath)return;let t=this._getHashForCurrentFile();if(!t)return void this.fable.log.warn("No hash available for file: "+this._currentPath);let e=t+this._getExtension(this._currentPath),i="/content/"+encodeURIComponent(this._currentPath);this._triggerDownload(i,e)}_getInfoBody(){return document.getElementById("RetoldRemote-Info-Body")}_renderEmpty(t){let e=this._getInfoBody();e&&(e.innerHTML=`<div class="retold-remote-info-empty">${this._esc(t)}</div>`)}_renderSpinner(){let t=this._getInfoBody();t&&(t.innerHTML='<div class="retold-remote-info-spinner">Extracting metadata...</div>')}_renderUncached(t){let e=this._getInfoBody();if(!e)return;let i=t.split("/").pop()||t,n=t.substring(0,t.length-i.length),o=this.pict.AppData.RetoldRemote.GalleryItems||[],r=null;for(let e=0;e<o.length;e++)if(o[e].Path===t){r=o[e];break}let a="";a+=`<div class="retold-remote-info-filename">${this._esc(i)}</div>`,a+=`<div class="retold-remote-info-path">${this._esc(n)}</div>`,r&&(a+='<div class="retold-remote-info-section">',a+='<div class="retold-remote-info-section-title">Basic</div>',r.Size&&(a+=this._row("Size",this._formatSize(r.Size))),r.Type&&(a+=this._row("Type",r.Type)),r.Extension&&(a+=this._row("Extension",r.Extension)),a+="</div>"),a+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].extractMetadata()">Extract Metadata</button>',a+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].downloadFile()" style="margin-top: 4px;">Download File</button>',a+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].downloadHashedFile()" style="margin-top: 4px;">Download Hashed File</button>',e.innerHTML=a}_renderMetadata(t){let e=this._getInfoBody();if(!e)return;let i=(t.Path||"").split("/").pop()||t.Path,n=(t.Path||"").substring(0,(t.Path||"").length-i.length),o="";if(o+=`<div class="retold-remote-info-filename">${this._esc(i)}</div>`,o+=`<div class="retold-remote-info-path">${this._esc(n)}</div>`,o+='<div class="retold-remote-info-section">',o+='<div class="retold-remote-info-section-title">Basic</div>',o+=this._row("Size",this._formatSize(t.FileSize)),o+=this._row("Category",t.Category||"unknown"),t.Extension&&(o+=this._row("Extension",t.Extension)),t.Modified&&(o+=this._row("Modified",this._formatDate(t.Modified))),t.Created&&(o+=this._row("Created",this._formatDate(t.Created))),t.MD5&&(o+='<div class="retold-remote-info-row">',o+='<span class="retold-remote-info-label">MD5</span>',o+=`<span class="retold-remote-info-value retold-remote-info-value-mono">${this._esc(t.MD5)}</span>`,o+="</div>"),o+="</div>",(t.FormatName||t.Duration)&&(o+='<div class="retold-remote-info-section">',o+='<div class="retold-remote-info-section-title">Format</div>',t.FormatName&&(o+=this._row("Container",t.FormatName)),t.Duration&&(o+=this._row("Duration",this._formatDuration(t.Duration))),t.Bitrate&&(o+=this._row("Bitrate",this._formatBitrate(t.Bitrate))),o+="</div>"),t.Video){o+='<div class="retold-remote-info-section">',o+='<div class="retold-remote-info-section-title">Video</div>';let e=t.Video;if(e.Codec){let t=e.Codec;e.Profile&&(t+=` (${e.Profile}`,e.Level&&(t+=` ${e.Level}`),t+=")"),o+=this._row("Codec",t)}e.Width&&e.Height&&(o+=this._row("Resolution",`${e.Width}×${e.Height}`)),e.FrameRate&&(o+=this._row("Frame Rate",this._formatFrameRate(e.FrameRate))),e.PixelFormat&&(o+=this._row("Pixel Format",e.PixelFormat)),e.ColorSpace&&(o+=this._row("Color Space",e.ColorSpace)),e.Bitrate&&(o+=this._row("Bitrate",this._formatBitrate(e.Bitrate))),o+="</div>"}if(t.Audio){o+='<div class="retold-remote-info-section">',o+='<div class="retold-remote-info-section-title">Audio</div>';let e=t.Audio;if(e.Codec){let t=e.Codec;e.Profile&&(t+=` (${e.Profile})`),o+=this._row("Codec",t)}if(e.SampleRate&&(o+=this._row("Sample Rate",e.SampleRate+" Hz")),e.Channels){let t=e.ChannelLayout||e.Channels+" ch";o+=this._row("Channels",t)}e.Bitrate&&(o+=this._row("Bitrate",this._formatBitrate(e.Bitrate))),e.BitsPerSample&&(o+=this._row("Bit Depth",e.BitsPerSample+"-bit")),o+="</div>"}if(t.Image){let e=t.Image;if(o+='<div class="retold-remote-info-section">',o+='<div class="retold-remote-info-section-title">Image</div>',e.Width&&e.Height&&(o+=this._row("Dimensions",`${e.Width}×${e.Height}`)),e.Format&&(o+=this._row("Format",e.Format)),e.Space&&(o+=this._row("Color Space",e.Space)),e.DPI&&(o+=this._row("DPI",e.DPI)),null!==e.HasAlpha&&void 0!==e.HasAlpha&&(o+=this._row("Alpha",e.HasAlpha?"Yes":"No")),o+="</div>",e.EXIF){let t=e.EXIF;if(t.Make||t.Model||t.ExposureTime||t.Software){if(o+='<div class="retold-remote-info-section">',o+='<div class="retold-remote-info-section-title">EXIF</div>',(t.Make||t.Model)&&(o+=this._row("Camera",((t.Make||"")+" "+(t.Model||"")).trim())),t.LensModel&&(o+=this._row("Lens",t.LensModel)),t.ExposureTime||t.FNumber||t.ISO){let e="";t.ExposureTime&&(e+=t.ExposureTime<1?`1/${Math.round(1/t.ExposureTime)}s`:t.ExposureTime+"s"),t.FNumber&&(e+=(e?" ":"")+`f/${t.FNumber}`),t.ISO&&(e+=(e?" ":"")+`ISO ${t.ISO}`),o+=this._row("Exposure",e)}t.FocalLength&&(o+=this._row("Focal Length",t.FocalLength+"mm")),t.DateTimeOriginal&&(o+=this._row("Date Taken",this._formatDate(t.DateTimeOriginal))),t.Software&&(o+=this._row("Software",t.Software)),o+="</div>"}}if(e.GPS){let t=e.GPS;if(o+='<div class="retold-remote-info-section">',o+='<div class="retold-remote-info-section-title">GPS</div>',null!==t.Latitude&&null!==t.Longitude){let e=parseFloat(t.Latitude).toFixed(6),i=parseFloat(t.Longitude).toFixed(6),n=t.Latitude>=0?"N":"S",r=t.Longitude>=0?"E":"W";o+=this._row("Latitude",`${Math.abs(e)}° ${n}`),o+=this._row("Longitude",`${Math.abs(i)}° ${r}`),null!==t.Altitude&&void 0!==t.Altitude&&(o+=this._row("Altitude",Math.round(t.Altitude)+"m")),o+='<div style="margin-top: 4px;">',o+=`<a class="retold-remote-info-gps-link" href="${`https://www.google.com/maps?q=${e},${i}`}" target="_blank" rel="noopener">Open in Maps ↗</a>`,o+="</div>"}o+="</div>"}}if(t.Document){let e=t.Document;o+='<div class="retold-remote-info-section">',o+='<div class="retold-remote-info-section-title">Document</div>',e.PageCount&&(o+=this._row("Pages",e.PageCount)),e.Title&&(o+=this._row("Title",e.Title)),e.Author&&(o+=this._row("Author",e.Author)),e.Subject&&(o+=this._row("Subject",e.Subject)),e.Keywords&&(o+=this._row("Keywords",e.Keywords)),e.Creator&&(o+=this._row("Creator",e.Creator)),e.Producer&&(o+=this._row("Producer",e.Producer)),e.CreatedDate&&(o+=this._row("Created",this._formatDate(e.CreatedDate))),e.ModifiedDate&&(o+=this._row("Modified",this._formatDate(e.ModifiedDate))),o+="</div>"}if(t.Tags&&Object.keys(t.Tags).length>0){o+='<div class="retold-remote-info-section">',o+='<div class="retold-remote-info-section-title">Tags</div>';let e=Object.keys(t.Tags).sort();for(let i=0;i<e.length;i++){let n=e[i],r=t.Tags[n];o+='<div class="retold-remote-info-tag-row">',o+=`<span class="retold-remote-info-tag-key">${this._esc(n)}</span>`,o+=`<span class="retold-remote-info-tag-value">${this._esc(String(r))}</span>`,o+="</div>"}o+="</div>"}if(t.Chapters&&t.Chapters.length>0){o+='<div class="retold-remote-info-section">',o+=`<div class="retold-remote-info-section-title">Chapters (${t.Chapters.length})</div>`;for(let e=0;e<t.Chapters.length;e++){let i=t.Chapters[e];o+='<div class="retold-remote-info-chapter-row">',o+=`<span class="retold-remote-info-chapter-time">${this._formatDuration(i.StartTime)}</span>`,o+=`<span class="retold-remote-info-chapter-title">${this._esc(i.Title)}</span>`,o+="</div>"}o+="</div>"}o+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].extractMetadata()" style="margin-top: 8px;">Re-extract Metadata</button>',o+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].downloadFile()" style="margin-top: 4px;">Download File</button>',o+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].downloadHashedFile()" style="margin-top: 4px;">Download Hashed File</button>',e.innerHTML=o}_row(t,e){return`<div class="retold-remote-info-row"><span class="retold-remote-info-label">${this._esc(String(t))}</span><span class="retold-remote-info-value">${this._esc(String(e))}</span></div>`}_esc(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}_formatSize(t){if(!t&&0!==t)return"unknown";let e=parseInt(t,10);return e<1024?e+" B":e<1048576?(e/1024).toFixed(1)+" KB":e<1073741824?(e/1048576).toFixed(1)+" MB":(e/1073741824).toFixed(2)+" GB"}_formatDuration(t){if(!t&&0!==t)return"unknown";let e=Math.floor(t),i=Math.floor(e/3600),n=Math.floor(e%3600/60),o=e%60;return i>0?`${i}:${String(n).padStart(2,"0")}:${String(o).padStart(2,"0")}`:`${n}:${String(o).padStart(2,"0")}`}_formatBitrate(t){if(!t)return"unknown";let e=parseInt(t,10);return e<1e3?e+" bps":e<1e6?(e/1e3).toFixed(0)+" kbps":(e/1e6).toFixed(1)+" Mbps"}_formatFrameRate(t){if(!t)return"unknown";if("string"==typeof t&&t.includes("/")){let e=t.split("/"),i=parseFloat(e[0]),n=parseFloat(e[1]);if(n>0)return(i/n).toFixed(3).replace(/\.?0+$/,"")+" fps"}return t+" fps"}_formatDate(t){if(!t)return"unknown";try{let e=new Date(t);return isNaN(e.getTime())?String(t):e.toLocaleDateString()+" "+e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(e){return String(t)}}},e.exports.default_configuration=o},{"pict-view":102}],158:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"RetoldRemote-Gallery",DefaultRenderable:"RetoldRemote-Gallery-Grid",DefaultDestinationAddress:"#RetoldRemote-Gallery-Container",AutoRender:!1,CSS:"",Templates:[],Renderables:[]};class r extends n{constructor(t,e,i){super(t,e,i),this._intersectionObserver=null,this._activeRenderFrame=null,this._activeRenderToken=0,this._thumbnailQueue=[],this._thumbnailInFlight=0}showLoadingState(t){let e=document.getElementById("RetoldRemote-Gallery-Container");if(!e)return;let i=this.pict.providers["RetoldRemote-FormattingUtilities"],n=i?i.escapeHTML(t||""):t||"",o='<div class="retold-remote-gallery-loading">';o+='<div class="retold-remote-gallery-loading-spinner"></div>',o+='<div class="retold-remote-gallery-loading-text">Loading folder…</div>',n&&(o+='<div class="retold-remote-gallery-loading-path">'+n+"</div>"),o+="</div>",e.innerHTML=o}cancelActiveRender(){null!==this._activeRenderFrame&&(cancelAnimationFrame(this._activeRenderFrame),this._activeRenderFrame=null),this._activeRenderToken++}renderGallery(){let t=document.getElementById("RetoldRemote-Gallery-Container");if(!t)return;this.cancelActiveRender();let e=this.pict.AppData.RetoldRemote,i=e.GalleryItems||[],n=e.ViewMode||"list",o=e.ThumbnailSize||"medium",r=e.GalleryCursorIndex||0,a=document.getElementById("RetoldRemote-Gallery-Search"),s=a&&document.activeElement===a,l=s?a.selectionStart:0,d=s?a.selectionEnd:0,c=this._buildHeaderHTML(e.FilterState?e.FilterState.MediaType:"all");if(c+=this._buildFilterPanelHTML(),c+=this._buildFilterChipsHTML(),0===i.length){c+='<div class="retold-remote-empty">';let e=this.pict.providers["RetoldRemote-Icons"];return c+='<div class="retold-remote-empty-icon"><span class="retold-remote-icon retold-remote-icon-xl">'+(e?e.getIcon("gallery-empty",96):"")+"</span></div>",c+="<div>Empty folder</div>",c+="</div>",t.innerHTML=c,void this._restoreSearchFocus(s,l,d)}if(i.length<=500){c+="gallery"===n?this._buildGridHTML(i,o,r):this._buildListHTML(i,r),t.innerHTML=c,this._restoreSearchFocus(s,l,d),this._setupLazyLoading();let e=this.pict.providers["RetoldRemote-GalleryNavigation"];e&&e.recalculateColumns();let a=this.pict.views["ContentEditor-TopBar"];return void(a&&a.updateFilterIcon&&a.updateFilterIcon())}let p="RetoldRemote-GalleryItemsContainer",h="RetoldRemote-GalleryProgress";c+="gallery"===n?'<div class="retold-remote-grid size-'+o+'" id="'+p+'"></div>':'<div class="retold-remote-list" id="'+p+'"></div>',c+='<div class="retold-remote-gallery-progress" id="'+h+'"><span class="retold-remote-gallery-progress-spinner"></span><span class="retold-remote-gallery-progress-text">Rendering 0 / '+i.length.toLocaleString()+"…</span></div>",t.innerHTML=c,this._restoreSearchFocus(s,l,d);let u=this.pict.views["ContentEditor-TopBar"];u&&u.updateFilterIcon&&u.updateFilterIcon(),this._renderGalleryChunked(i,n,o,r,p,h)}_restoreSearchFocus(t,e,i){if(!t)return;let n=document.getElementById("RetoldRemote-Gallery-Search");n&&(n.focus(),n.setSelectionRange(e,i))}_renderGalleryChunked(t,e,i,n,o,r){let a=this,s=++this._activeRenderToken,l=t.length,d=0,c=function(){if(s!==a._activeRenderToken)return;let i=document.getElementById(o);if(!i)return;let p,h=0===d?250:500,u=Math.min(d+h,l),m=t.slice(d,u);p="gallery"===e?a._buildGridItemsHTML(m,n,d):a._buildListItemsHTML(m,n,d),i.insertAdjacentHTML("beforeend",p),d=u;let g=document.getElementById(r);if(g){let t=g.querySelector(".retold-remote-gallery-progress-text");t&&(t.textContent="Rendering "+d.toLocaleString()+" / "+l.toLocaleString()+"…")}if(d<l)a._observeNewThumbnails(),a._activeRenderFrame=requestAnimationFrame(c);else{a._activeRenderFrame=null,g&&g.parentElement&&g.parentElement.removeChild(g),a._setupLazyLoading();let t=a.pict.providers["RetoldRemote-GalleryNavigation"];t&&t.recalculateColumns()}};this._activeRenderFrame=requestAnimationFrame(c)}_buildHeaderHTML(t){let e=this.pict.AppData.RetoldRemote;if(!e.FilterBarVisible)return"";let i=[{key:"all",label:"All"},{key:"images",label:"Images"},{key:"video",label:"Video"},{key:"audio",label:"Audio"},{key:"documents",label:"Docs"}],n='<div class="retold-remote-gallery-header">';n+='<div class="retold-remote-gallery-filter">';for(let e=0;e<i.length;e++){let o=i[e];n+='<button class="retold-remote-gallery-filter-btn'+(o.key===t?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].setFilter('"+o.key+"')\">"+o.label+"</button>"}n+="</div>",n+='<div class="retold-remote-gallery-sort">',n+='<select class="retold-remote-gallery-sort-select" id="RetoldRemote-Gallery-Sort" onchange="pict.views[\'RetoldRemote-Gallery\'].onSortChange(this.value)">';let o=[{value:"folder-first:asc",label:"Folders first"},{value:"name:asc",label:"Name A–Z"},{value:"name:desc",label:"Name Z–A"},{value:"modified:desc",label:"Newest modified"},{value:"modified:asc",label:"Oldest modified"},{value:"created:desc",label:"Newest created"},{value:"created:asc",label:"Oldest created"}],r=(e.SortField||"folder-first")+":"+(e.SortDirection||"asc");for(let t=0;t<o.length;t++){let e=o[t].value===r?" selected":"";n+='<option value="'+o[t].value+'"'+e+">"+o[t].label+"</option>"}n+="</select>",n+="</div>";let a=this.pict.providers["RetoldRemote-GalleryFilterSort"],s=a?a.getActiveFilterChips().length:0;n+='<button class="retold-remote-gallery-filter-btn retold-remote-gallery-filter-toggle'+(s>0?" has-filters":"")+'" onclick="pict.views[\'RetoldRemote-Gallery\'].toggleFilterPanel()">⚙ Filters',s>0&&(n+='<span class="retold-remote-gallery-filter-count">'+s+"</span>"),n+="</button>";let l=e.SearchQuery||"";n+='<input type="text" class="retold-remote-gallery-search" id="RetoldRemote-Gallery-Search" placeholder="Search files... (/)" value="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l)+'" oninput="pict.views[\'RetoldRemote-Gallery\'].onSearchInput(this.value)">';let d=e.SearchCaseSensitive||!1,c=e.SearchRegex||!1;return n+='<div class="retold-remote-gallery-search-options">',n+='<label class="retold-remote-gallery-search-option'+(d?" active":"")+'"><input type="checkbox" '+(d?"checked ":"")+"onchange=\"pict.views['RetoldRemote-Gallery'].onSearchCaseSensitiveChange(this.checked)\">Aa</label>",n+='<label class="retold-remote-gallery-search-option'+(c?" active":"")+'"><input type="checkbox" '+(c?"checked ":"")+"onchange=\"pict.views['RetoldRemote-Gallery'].onSearchRegexChange(this.checked)\">.*</label>",e._searchRegexError&&(n+='<span class="retold-remote-gallery-search-regex-error" title="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e._searchRegexError)+'">invalid regex</span>'),n+="</div>",n+="</div>",n}_buildFilterPanelHTML(){let t=this.pict.AppData.RetoldRemote;if(!t.FilterPanelOpen)return"";let e=this.pict.providers["RetoldRemote-GalleryFilterSort"],i=e?e.getAvailableExtensions():[],n=t.FilterState||{},o='<div class="retold-remote-filter-panel">';o+='<div class="retold-remote-filter-panel-grid">',o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">File Type</div>',o+='<div class="retold-remote-filter-ext-list">';let r=n.Extensions||[];for(let t=0;t<i.length;t++){let e=i[t];o+='<label class="retold-remote-filter-ext-item">',o+='<input type="checkbox" '+(0===r.length||r.indexOf(e.ext)>=0?"checked ":"")+"onchange=\"pict.views['RetoldRemote-Gallery'].onExtensionToggle('"+e.ext+"', this.checked)\">",o+=" ."+e.ext+' <span class="retold-remote-filter-ext-count">('+e.count+")</span>",o+="</label>"}return o+="</div>",o+="</div>",o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">File Size</div>',o+='<div class="retold-remote-filter-row">',o+='<input type="number" class="retold-remote-filter-input" placeholder="Min KB" value="'+(null!==n.SizeMin&&void 0!==n.SizeMin?Math.round(n.SizeMin/1024):"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onSizeFilterChange('min', this.value)\">",o+='<span class="retold-remote-filter-label">to</span>',o+='<input type="number" class="retold-remote-filter-input" placeholder="Max KB" value="'+(null!==n.SizeMax&&void 0!==n.SizeMax?Math.round(n.SizeMax/1024):"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onSizeFilterChange('max', this.value)\">",o+='<span class="retold-remote-filter-label">KB</span>',o+="</div>",o+="</div>",o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">Modified Date</div>',o+='<div class="retold-remote-filter-row">',o+='<input type="date" class="retold-remote-filter-input" value="'+(n.DateModifiedAfter||"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onDateFilterChange('DateModifiedAfter', this.value)\">",o+='<span class="retold-remote-filter-label">to</span>',o+='<input type="date" class="retold-remote-filter-input" value="'+(n.DateModifiedBefore||"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onDateFilterChange('DateModifiedBefore', this.value)\">",o+="</div>",o+="</div>",o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">List Columns</div>',o+='<div class="retold-remote-filter-col-toggles">',o+='<button class="retold-remote-filter-col-toggle'+(!1!==t.ListShowExtension?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].toggleListColumn('ListShowExtension')\">Ext</button>",o+='<button class="retold-remote-filter-col-toggle'+(!1!==t.ListShowSize?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].toggleListColumn('ListShowSize')\">Size</button>",o+='<button class="retold-remote-filter-col-toggle'+(!1!==t.ListShowDate?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].toggleListColumn('ListShowDate')\">Date</button>",o+="</div>",o+="</div>",o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">Presets</div>',o+=this._buildPresetControlsHTML(),o+="</div>",o+='<div class="retold-remote-filter-actions">',o+='<button class="retold-remote-filter-btn-sm" onclick="pict.views[\'RetoldRemote-Gallery\'].clearAllFilters()">Clear All Filters</button>',o+="</div>",o+="</div>",o+="</div>",o}_buildPresetControlsHTML(){let t=this.pict.AppData.RetoldRemote.FilterPresets||[],e='<div class="retold-remote-filter-preset-row">';if(t.length>0){e+='<select class="retold-remote-filter-preset-select" id="RetoldRemote-Filter-PresetSelect" onchange="pict.views[\'RetoldRemote-Gallery\'].loadFilterPreset(this.value)">',e+='<option value="">Load preset...</option>';for(let i=0;i<t.length;i++)e+='<option value="'+i+'">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t[i].Name)+"</option>";e+="</select>",e+='<button class="retold-remote-filter-btn-sm" onclick="pict.views[\'RetoldRemote-Gallery\'].deleteSelectedPreset()">✕</button>'}return e+='<input type="text" class="retold-remote-filter-preset-input" id="RetoldRemote-Filter-PresetName" placeholder="Preset name...">',e+='<button class="retold-remote-filter-btn-sm" onclick="pict.views[\'RetoldRemote-Gallery\'].saveFilterPreset()">Save</button>',e+="</div>",e}_buildFilterChipsHTML(){let t=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(!t)return"";let e=t.getActiveFilterChips();if(0===e.length)return"";let i='<div class="retold-remote-filter-chips">';for(let t=0;t<e.length;t++){let n=e[t];i+='<span class="retold-remote-filter-chip">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(n.label)+" <button class=\"retold-remote-filter-chip-remove\" onclick=\"pict.views['RetoldRemote-Gallery'].removeFilterChip('"+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(n.key)+"')\">×</button></span>"}return i+='<button class="retold-remote-filter-chip-clear" onclick="pict.views[\'RetoldRemote-Gallery\'].clearAllFilters()">Clear all</button>',i+="</div>",i}_buildGridHTML(t,e,i){let n='<div class="retold-remote-grid size-'+e+'">';return n+=this._buildGridItemsHTML(t,i,0),n+="</div>",n}_buildGridItemsHTML(t,e,i){let n=i||0,o="",r=this.pict.providers["RetoldRemote-Provider"],a=this.pict.providers["RetoldRemote-Icons"],s=this.pict.providers["RetoldRemote-FormattingUtilities"];for(let i=0;i<t.length;i++){let l=t[i],d=n+i,c=d===e?" selected":"",p=(l.Extension||"").toLowerCase(),h=this._getCategory(p,l.Type);if(o+='<div class="retold-remote-tile'+c+'" data-index="'+d+"\" onclick=\"pict.views['RetoldRemote-Gallery'].onTileClick("+d+")\" ondblclick=\"pict.views['RetoldRemote-Gallery'].onTileDoubleClick("+d+')">',o+='<div class="retold-remote-tile-thumb">',"folder"===l.Type)o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(a?a.getIcon("folder",48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-folder">Folder</span>';else if("archive"===l.Type)o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(a?a.getIcon("file-archive",48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-folder">Archive</span>';else if("image"===h&&r){let t=r.getThumbnailURL(l.Path,400,300);o+=t?'<img data-src="'+t+'" alt="'+s.escapeHTML(l.Name)+'" loading="lazy">':'<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(a?a.getIcon("file-image",48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-image">'+p+"</span>"}else if("video"===h){if(r){let t=r.getThumbnailURL(l.Path,400,300);o+=t?'<img data-src="'+t+'" alt="'+s.escapeHTML(l.Name)+'" loading="lazy">':'<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(a?a.getIcon("file-video",48):"")+"</span></div>"}else o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(a?a.getIcon("file-video",48):"")+"</span></div>";o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-video">Video</span>'}else"audio"===h?(o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(a?a.getIcon("file-audio",48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-audio">Audio</span>'):"document"===h?(o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(a?a.getIconForEntry(l,48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-document">'+p+"</span>"):o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(a?a.getIconForEntry(l,48):"")+"</span></div>";o+="</div>",o+='<div class="retold-remote-tile-label" title="'+s.escapeHTML(l.Name)+'">'+s.escapeHTML(l.Name)+"</div>","file"===l.Type&&void 0!==l.Size?o+='<div class="retold-remote-tile-meta">'+s.formatFileSize(l.Size)+"</div>":"folder"===l.Type?o+='<div class="retold-remote-tile-meta">Folder</div>':"archive"===l.Type&&(o+='<div class="retold-remote-tile-meta">Archive'+(l.Size?" · "+s.formatFileSize(l.Size):"")+"</div>"),o+="</div>"}return o}_buildListHTML(t,e){let i='<div class="retold-remote-list">';return i+=this._buildListItemsHTML(t,e,0),i+="</div>",i}_buildListItemsHTML(t,e,i){let n=i||0,o=this.pict.AppData.RetoldRemote,r=!1!==o.ListShowExtension,a=!1!==o.ListShowSize,s=!1!==o.ListShowDate,l="",d=this.pict.providers["RetoldRemote-Icons"],c=this.pict.providers["RetoldRemote-FormattingUtilities"];for(let i=0;i<t.length;i++){let o=t[i],p=n+i,h=p===e?" selected":"",u="";if(d&&(u='<span class="retold-remote-icon retold-remote-icon-sm">'+d.getIconForEntry(o,16)+"</span>"),l+='<div class="retold-remote-list-row'+h+'" data-index="'+p+"\" onclick=\"pict.views['RetoldRemote-Gallery'].onTileClick("+p+")\" ondblclick=\"pict.views['RetoldRemote-Gallery'].onTileDoubleClick("+p+')">',l+='<div class="retold-remote-list-icon">'+u+"</div>",l+='<div class="retold-remote-list-name" title="'+c.escapeHTML(o.Name)+"\" ontouchstart=\"pict.views['RetoldRemote-Gallery']._onNameTouchStart(event, '"+c.escapeHTML(o.Name).replace(/'/g,"\\'")+"')\" ontouchend=\"pict.views['RetoldRemote-Gallery']._onNameTouchEnd(event)\" ontouchcancel=\"pict.views['RetoldRemote-Gallery']._onNameTouchEnd(event)\">"+c.escapeHTML(o.Name)+"</div>",r){let t="";"file"===o.Type||"archive"===o.Type?t=(o.Extension||"").replace(/^\./,"").toLowerCase():"folder"===o.Type&&(t=""),l+='<div class="retold-remote-list-ext">'+t+"</div>"}a&&("file"!==o.Type&&"archive"!==o.Type||void 0===o.Size?l+='<div class="retold-remote-list-size"></div>':l+='<div class="retold-remote-list-size">'+c.formatFileSize(o.Size)+"</div>"),s&&(o.Modified?l+='<div class="retold-remote-list-date">'+c.formatShortDate(o.Modified)+"</div>":l+='<div class="retold-remote-list-date"></div>'),l+="</div>"}return l}_setupLazyLoading(){this._intersectionObserver&&this._intersectionObserver.disconnect(),this._thumbnailQueue=[],this._thumbnailInFlight=0;let t=this;this._intersectionObserver=new IntersectionObserver(e=>{for(let i=0;i<e.length;i++)if(e[i].isIntersecting){let n=e[i].target;t._intersectionObserver.unobserve(n),t._enqueueThumbnail(n)}},{rootMargin:"100px"}),this._observeNewThumbnails()}_observeNewThumbnails(){if(!this._intersectionObserver)return;let t=document.querySelectorAll(".retold-remote-tile-thumb img[data-src]:not([data-observed])");for(let e=0;e<t.length;e++)t[e].setAttribute("data-observed","1"),this._intersectionObserver.observe(t[e])}_enqueueThumbnail(t){this._thumbnailQueue.push(t),this._drainThumbnailQueue()}_drainThumbnailQueue(){let t=this;for(;this._thumbnailInFlight<8&&this._thumbnailQueue.length>0;){let e=this._thumbnailQueue.shift(),i=e.getAttribute("data-src");if(!i)continue;this._thumbnailInFlight++;let n=function(){t._thumbnailInFlight--,t._drainThumbnailQueue()};e.addEventListener("load",n,{once:!0}),e.addEventListener("error",n,{once:!0}),e.src=i,e.removeAttribute("data-src")}}onTileClick(t){let e=this.pict.providers["RetoldRemote-GalleryNavigation"];e&&e.moveCursor(t)}onTileDoubleClick(t){this.pict.AppData.RetoldRemote.GalleryCursorIndex=t;let e=this.pict.providers["RetoldRemote-GalleryNavigation"];e&&e.openCurrent()}setFilter(t){let e=this.pict.AppData.RetoldRemote;e.GalleryFilter=t,e.FilterState.MediaType=t;let i=this.pict.providers["RetoldRemote-GalleryFilterSort"];i&&i.applyFilterSort()}onSearchInput(t){this.pict.AppData.RetoldRemote.SearchQuery=t||"";let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSearchCaseSensitiveChange(t){this.pict.AppData.RetoldRemote.SearchCaseSensitive=t;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSearchRegexChange(t){this.pict.AppData.RetoldRemote.SearchRegex=t;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSortChange(t){let e=t.split(":"),i=this.pict.AppData.RetoldRemote;i.SortField=e[0],i.SortDirection=e[1]||"asc";let n=this.pict.providers["RetoldRemote-GalleryFilterSort"];n&&n.applyFilterSort(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}toggleFilterPanel(){let t=this.pict.AppData.RetoldRemote;t.FilterPanelOpen=!t.FilterPanelOpen,this.renderGallery(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}onExtensionToggle(t,e){let i=this.pict.AppData.RetoldRemote.FilterState,n=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(e)i.Extensions.length>0&&i.Extensions.push(t);else if(0===i.Extensions.length&&n){let e=n.getAvailableExtensions();i.Extensions=e.map(t=>t.ext).filter(e=>e!==t)}else i.Extensions=i.Extensions.filter(e=>e!==t);n&&n.applyFilterSort()}onSizeFilterChange(t,e){let i=this.pict.AppData.RetoldRemote.FilterState,n=e&&""!==e?1024*parseInt(e,10):null;"min"===t?i.SizeMin=n:i.SizeMax=n;let o=this.pict.providers["RetoldRemote-GalleryFilterSort"];o&&o.applyFilterSort()}onDateFilterChange(t,e){this.pict.AppData.RetoldRemote.FilterState[t]=e||null;let i=this.pict.providers["RetoldRemote-GalleryFilterSort"];i&&i.applyFilterSort()}removeFilterChip(t){let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&(e.removeFilter(t),e.applyFilterSort())}clearAllFilters(){let t=this.pict.providers["RetoldRemote-GalleryFilterSort"];t&&(t.clearAllFilters(),t.applyFilterSort())}saveFilterPreset(){let t=document.getElementById("RetoldRemote-Filter-PresetName");if(!t||!t.value.trim())return;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.savePreset(t.value.trim()),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings(),this.renderGallery()}loadFilterPreset(t){if(""===t||null==t)return;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&(e.loadPreset(parseInt(t,10)),e.applyFilterSort()),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}deleteSelectedPreset(){let t=document.getElementById("RetoldRemote-Filter-PresetSelect");if(!t||""===t.value)return;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.deletePreset(parseInt(t.value,10)),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings(),this.renderGallery()}toggleListColumn(t){let e=this.pict.AppData.RetoldRemote,i=e[t];e[t]=!1===i,this.renderGallery(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}_onNameTouchStart(t,e){let i=this;this._clearLongPressTimer(),this._longPressTimer=setTimeout(function(){i._showLongPressTooltip(t,e)},500)}_onNameTouchEnd(t){this._clearLongPressTimer(),this._hideLongPressTooltip()}_clearLongPressTimer(){this._longPressTimer&&(clearTimeout(this._longPressTimer),this._longPressTimer=null)}_showLongPressTooltip(t,e){this._hideLongPressTooltip();let i=document.createElement("div");i.className="retold-remote-longpress-tooltip",i.textContent=e;let n=t.touches&&t.touches[0];n&&(i.style.left=Math.min(n.clientX,window.innerWidth-20)+"px",i.style.top=n.clientY-50+"px"),document.body.appendChild(i),this._longPressTooltipEl=i,t.preventDefault()}_hideLongPressTooltip(){this._longPressTooltipEl&&(this._longPressTooltipEl.parentNode&&this._longPressTooltipEl.parentNode.removeChild(this._longPressTooltipEl),this._longPressTooltipEl=null)}_getCategory(t,e){if("folder"===e)return"folder";if("archive"===e)return"archive";let i=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(i)return i.getCategory(t);let n=(t||"").replace(/^\./,"").toLowerCase();return"png"===n||"jpg"===n||"jpeg"===n||"gif"===n||"webp"===n?"image":"mp4"===n||"webm"===n||"mov"===n?"video":"mp3"===n||"wav"===n||"ogg"===n?"audio":"pdf"===n?"document":"other"}}r.default_configuration=o,e.exports=r},{"pict-view":102}],159:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"RetoldRemote-ImageExplorer",DefaultRenderable:"RetoldRemote-ImageExplorer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:""};class r extends n{constructor(t,e,i){super(t,e,i),this._currentPath="",this._osdViewer=null,this._dziData=null,this._osdLoaded=!1,this._loading=!1,this._selectionMode=!1,this._selectionTracker=null,this._selectionOverlay=null,this._selectionRegion=null,this._selectionStart=null,this._selectionStartScreenPos=null,this._savedRegions=[],this._viewerReady=!1,this._editingRegionID=null,this._editDragMode=null,this._editDragStart=null,this._editOriginalRect=null,this._editTracker=null}showExplorer(t){let e=this.pict.AppData.RetoldRemote;e.ActiveMode="image-explorer",e.CurrentViewerFile=t,e.CurrentViewerMediaType="image",this._currentPath=t,this._dziData=null,this._loading=!1;let i=this.pict.views["ContentEditor-Layout"];if(i&&"function"==typeof i.notifyCurrentFileChanged&&i.notifyCurrentFileChanged(t),this._selectionMode=!1,this._selectionTracker=null,this._selectionOverlay=null,this._selectionRegion=null,this._selectionStart=null,this._selectionStartScreenPos=null,this._savedRegions=[],this._viewerReady=!1,this._editingRegionID=null,this._editDragMode=null,this._editDragStart=null,this._editOriginalRect=null,this._editTracker){try{this._editTracker.destroy()}catch(t){}this._editTracker=null}if(this._osdViewer){try{this._osdViewer.destroy()}catch(t){}this._osdViewer=null}let n=this.pict.providers["RetoldRemote-Provider"],o="#/explore-image/"+(n?n.getFragmentIdentifier(t):t);0===(window.location.hash||"").indexOf("#/view/")?history.replaceState(null,"",o):window.location.hash=o;let r=document.getElementById("RetoldRemote-Gallery-Container"),a=document.getElementById("RetoldRemote-Viewer-Container");r&&(r.style.display="none"),a&&(a.style.display="block");let s=t.replace(/^.*\//,""),l='<div class="retold-remote-iex">';l+='<div class="retold-remote-iex-header">',l+='<button class="retold-remote-iex-nav-btn" onclick="pict.views[\'RetoldRemote-ImageExplorer\'].goBack()" title="Back (Esc)">← Back</button>',l+='<div class="retold-remote-iex-title">Image Explorer — '+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s)+"</div>",l+='<div class="retold-remote-iex-actions">',l+='<button class="retold-remote-iex-action-btn" id="RetoldRemote-IEX-SelectBtn" onclick="pict.views[\'RetoldRemote-ImageExplorer\'].toggleSelectionMode()" title="Select a region (s)">✂ Select</button>',l+='<button class="retold-remote-iex-action-btn" onclick="pict.views[\'RetoldRemote-ImageExplorer\'].viewInBrowser()" title="View in standard viewer">🖼 View</button>',l+="</div>",l+="</div>",l+='<div class="retold-remote-iex-info" id="RetoldRemote-IEX-Info" style="display:none;"></div>',l+='<div class="retold-remote-iex-body" id="RetoldRemote-IEX-Body">',l+='<div class="retold-remote-iex-loading" id="RetoldRemote-IEX-Loading">',l+="<div>Loading image…</div>",l+="</div>",l+='<div id="RetoldRemote-IEX-Viewer" style="display:none;"></div>',l+="</div>",l+='<div class="retold-remote-iex-controls" id="RetoldRemote-IEX-Controls" style="display:none;">',l+='<button onclick="pict.views[\'RetoldRemote-ImageExplorer\'].zoomIn()" title="Zoom In (+)">+ Zoom In</button>',l+='<span class="retold-remote-iex-zoom-label" id="RetoldRemote-IEX-ZoomLabel">100%</span>',l+='<button onclick="pict.views[\'RetoldRemote-ImageExplorer\'].zoomOut()" title="Zoom Out (-)">- Zoom Out</button>',l+='<button onclick="pict.views[\'RetoldRemote-ImageExplorer\'].zoomHome()" title="Fit to view (0)">Fit</button>',l+='<span style="flex:1;"></span>',l+='<span id="RetoldRemote-IEX-LabelInput" style="display:none;">',l+='<input type="text" id="RetoldRemote-IEX-LabelField" placeholder="Label this region…" style="background:var(--retold-bg-input,#1e1e1e);color:var(--retold-text,#abb2bf);border:1px solid var(--retold-border,#3e4451);border-radius:4px;padding:2px 8px;font-size:0.78rem;width:180px;margin-right:4px;" onkeydown="if(event.key===\'Enter\'){pict.views[\'RetoldRemote-ImageExplorer\'].saveSelectionLabel();event.preventDefault();event.stopPropagation();}if(event.key===\'Escape\'){pict.views[\'RetoldRemote-ImageExplorer\'].cancelSelection();event.preventDefault();event.stopPropagation();}">',l+='<button onclick="pict.views[\'RetoldRemote-ImageExplorer\'].saveSelectionLabel()" style="font-size:0.75rem;padding:2px 8px;">Save</button>',l+='<button onclick="pict.views[\'RetoldRemote-ImageExplorer\'].cancelSelection()" style="font-size:0.75rem;padding:2px 8px;margin-left:2px;">Cancel</button>',l+="</span>",l+='<span id="RetoldRemote-IEX-Coords" style="color:var(--retold-text-dim);font-size:0.72rem;"></span>',l+="</div>",l+="</div>",a&&(a.innerHTML=l);let d=this.pict.views["ContentEditor-TopBar"];d&&d.updateInfo();let c=this;this._ensureOSDLoaded(()=>{c._probeAndShow(t),c._loadSavedRegions(t)})}_ensureOSDLoaded(t){if("undefined"!=typeof OpenSeadragon)return this._osdLoaded=!0,t();let e=this,i=document.createElement("script");i.src="https://cdnjs.cloudflare.com/ajax/libs/openseadragon/4.1.1/openseadragon.min.js",i.onload=function(){e._osdLoaded=!0,t()},i.onerror=function(){e._showError("Failed to load OpenSeadragon library.")},document.head.appendChild(i)}_probeAndShow(t){if(this._loading)return;this._loading=!0;let e=this,i=this.pict.providers["RetoldRemote-Provider"],n=i?i._getPathParam(t):encodeURIComponent(t);fetch("/api/media/image-preview?path="+n).then(t=>t.json()).then(i=>{if(!i||!i.Success)return e._loading=!1,void(e._isRawExtension(t)?e._showRawUnsupported():e._showSimpleImage(t));if(Math.max(i.OrigWidth||0,i.OrigHeight||0)>4096)e._generateAndShowTiles(t,n,i);else if(e._loading=!1,e._dziData={Width:i.OrigWidth,Height:i.OrigHeight},e._showSimpleImageInfo(i.OrigWidth,i.OrigHeight),i.IsRawFormat&&i.CacheKey){let t="/api/media/image-preview-file/"+encodeURIComponent(i.CacheKey)+"/"+encodeURIComponent(i.OutputFilename);e._initSimpleViewer(null,t)}else e._initSimpleViewer(t)}).catch(()=>{e._loading=!1,e._showSimpleImage(t)})}_showSimpleImage(t){this._dziData={Width:0,Height:0},this._initSimpleViewer(t)}_isRawExtension(t){return!!{nef:!0,nrw:!0,cr2:!0,cr3:!0,crw:!0,arw:!0,srf:!0,sr2:!0,raf:!0,orf:!0,rw2:!0,rwl:!0,pef:!0,srw:!0,x3f:!0,"3fr":!0,fff:!0,iiq:!0,dcr:!0,kdc:!0,mrw:!0,erf:!0,raw:!0,dng:!0,heic:!0,heif:!0}[(t||"").replace(/^.*\./,"").toLowerCase()]}_showRawUnsupported(){let t=document.getElementById("RetoldRemote-IEX-Loading");t&&(t.innerHTML='<div style="padding: 2em; text-align: center; color: #999;">Raw image preview not available.<br>Install dcraw on the server for raw camera format support.</div>')}_showSimpleImageInfo(t,e){let i=document.getElementById("RetoldRemote-IEX-Info");if(!i)return;let n="";n+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Dimensions:</span> ',n+='<span class="retold-remote-iex-info-value">'+t+" × "+e+" px</span></span>",n+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Size:</span> ',n+='<span class="retold-remote-iex-info-value">'+(t*e/1e6).toFixed(1)+" MP</span></span>",n+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Mode:</span> ',n+='<span class="retold-remote-iex-info-value">Direct</span></span>',i.innerHTML=n,i.style.display=""}_initSimpleViewer(t,e){let i=document.getElementById("RetoldRemote-IEX-Loading"),n=document.getElementById("RetoldRemote-IEX-Viewer"),o=document.getElementById("RetoldRemote-IEX-Controls");i&&(i.style.display="none"),n&&(n.style.display="block"),o&&(o.style.display="");let r,a=this;if(e)r=e;else{let e=this.pict.providers["RetoldRemote-Provider"];r=e?e.getContentURL(t):"/content/"+encodeURIComponent(t)}this._osdViewer=OpenSeadragon({id:"RetoldRemote-IEX-Viewer",tileSources:{type:"image",url:r},prefixUrl:"",showNavigationControl:!1,showNavigator:!0,navigatorPosition:"BOTTOM_RIGHT",navigatorSizeRatio:.15,animationTime:.3,blendTime:.1,minZoomLevel:.1,maxZoomLevel:20,visibilityRatio:.5,constrainDuringPan:!1,gestureSettingsMouse:{scrollToZoom:!0,clickToZoom:!0,dblClickToZoom:!0,flickEnabled:!1},gestureSettingsTouch:{pinchToZoom:!0,flickEnabled:!0,flickMinSpeed:120,flickMomentum:.25}}),this._osdViewer.addHandler("zoom",function(){a._updateZoomLabel()}),this._osdViewer.addHandler("open",function(){let t=a._osdViewer.world.getItemAt(0);if(t){let e=t.getContentSize();e&&(a._dziData={Width:e.x,Height:e.y})}a._updateZoomLabel(),a._viewerReady=!0,a._savedRegions&&a._savedRegions.length>0&&a._renderSavedRegionOverlays()}),void 0!==OpenSeadragon.MouseTracker&&new OpenSeadragon.MouseTracker({element:n,moveHandler:function(t){a._updateCoords(t.position)}})}_generateAndShowTiles(t,e,i){let n=this,o=null;i&&i.CacheKey&&i.OutputFilename&&(o="/api/media/image-preview-file/"+encodeURIComponent(i.CacheKey)+"/"+encodeURIComponent(i.OutputFilename)),o&&(this._dziData={Width:i.OrigWidth,Height:i.OrigHeight},this._showPreviewInfo(i.OrigWidth,i.OrigHeight),this._initSimpleViewer(null,o)),this._cancelActiveDziOperation();let r=this.pict.providers["RetoldRemote-OperationStatus"],a=r?r.startOperation({Label:"Generating deep-zoom tiles",Phase:"Reading image…",Cancelable:!0}):null;a&&(this._activeDziOperationId=a.OperationId,this._activeDziAbortController=a.AbortController);let s={};a&&a.AbortController&&(s.signal=a.AbortController.signal),a&&(s.headers={"X-Op-Id":a.OperationId}),fetch("/api/media/dzi?path="+e,s).then(t=>t.json()).then(e=>{if(n._loading=!1,!e||!e.Success)return a&&r&&r.errorOperation(a.OperationId,{message:e&&e.Error||"DZI generation failed"}),void(o||n._showSimpleImage(t));if(a&&r&&r.completeOperation(a.OperationId),n._activeDziOperationId=null,n._activeDziAbortController=null,n._dziData=e,n._showInfo(e),n._osdViewer){try{n._osdViewer.destroy()}catch(t){}n._osdViewer=null}n._viewerReady=!1;let i=document.getElementById("RetoldRemote-IEX-Viewer");i&&(i.innerHTML=""),n._initViewer(e)}).catch(e=>{n._loading=!1,e&&"AbortError"===e.name||(a&&r&&r.errorOperation(a.OperationId,e),o||n._showSimpleImage(t))})}_cancelActiveDziOperation(){if(this._activeDziAbortController)try{this._activeDziAbortController.abort()}catch(t){}let t=this.pict.providers["RetoldRemote-OperationStatus"];this._activeDziOperationId&&t&&t.cancelOperation(this._activeDziOperationId),this._activeDziOperationId=null,this._activeDziAbortController=null}_showPreviewInfo(t,e){let i=document.getElementById("RetoldRemote-IEX-Info");if(!i)return;let n="";n+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Dimensions:</span> ',n+='<span class="retold-remote-iex-info-value">'+t+" × "+e+" px</span></span>",n+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Size:</span> ',n+='<span class="retold-remote-iex-info-value">'+(t*e/1e6).toFixed(1)+" MP</span></span>",n+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Mode:</span> ',n+='<span class="retold-remote-iex-info-value retold-remote-iex-tiling-status">Preview — generating tiles…</span></span>',i.innerHTML=n,i.style.display=""}_showInfo(t){let e=document.getElementById("RetoldRemote-IEX-Info");if(!e)return;let i="";i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Dimensions:</span> ',i+='<span class="retold-remote-iex-info-value">'+t.Width+" × "+t.Height+" px</span></span>",i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Tile size:</span> ',i+='<span class="retold-remote-iex-info-value">'+t.TileSize+" px</span></span>",i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Format:</span> ',i+='<span class="retold-remote-iex-info-value">'+t.Format+"</span></span>",i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Size:</span> ',i+='<span class="retold-remote-iex-info-value">'+(t.Width*t.Height/1e6).toFixed(1)+" MP</span></span>",i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Mode:</span> ',i+='<span class="retold-remote-iex-info-value">Tiled</span></span>',e.innerHTML=i,e.style.display=""}_initViewer(t){let e=document.getElementById("RetoldRemote-IEX-Loading"),i=document.getElementById("RetoldRemote-IEX-Viewer"),n=document.getElementById("RetoldRemote-IEX-Controls");e&&(e.style.display="none"),i&&(i.style.display="block"),n&&(n.style.display="");let o=this,r={Image:{xmlns:"http://schemas.microsoft.com/deepzoom/2008",Url:"/api/media/dzi-tile/"+encodeURIComponent(t.CacheKey)+"/",Format:t.Format,Overlap:String(t.Overlap),TileSize:String(t.TileSize),Size:{Width:String(t.Width),Height:String(t.Height)}}};this._osdViewer=OpenSeadragon({id:"RetoldRemote-IEX-Viewer",tileSources:r,prefixUrl:"",showNavigationControl:!1,showNavigator:!0,navigatorPosition:"BOTTOM_RIGHT",navigatorSizeRatio:.15,animationTime:.3,blendTime:.1,minZoomLevel:.1,maxZoomLevel:20,visibilityRatio:.5,constrainDuringPan:!1,gestureSettingsMouse:{scrollToZoom:!0,clickToZoom:!0,dblClickToZoom:!0,flickEnabled:!1},gestureSettingsTouch:{pinchToZoom:!0,flickEnabled:!0,flickMinSpeed:120,flickMomentum:.25}}),this._osdViewer.addHandler("zoom",function(t){o._updateZoomLabel()}),this._osdViewer.addHandler("open",function(){o._updateZoomLabel(),o._viewerReady=!0,o._savedRegions&&o._savedRegions.length>0&&o._renderSavedRegionOverlays()}),void 0!==OpenSeadragon.MouseTracker&&new OpenSeadragon.MouseTracker({element:i,moveHandler:function(t){o._updateCoords(t.position)}})}_updateZoomLabel(){if(!this._osdViewer)return;let t=document.getElementById("RetoldRemote-IEX-ZoomLabel");if(t){let e=this._osdViewer.viewport.getZoom(!0),i=this._osdViewer.viewport.getHomeZoom(),n=Math.round(e/i*100);t.textContent=n+"%"}}_updateCoords(t){if(!this._osdViewer||!this._dziData)return;let e=document.getElementById("RetoldRemote-IEX-Coords");if(e)try{let i=this._osdViewer.viewport.pointFromPixel(t),n=this._osdViewer.viewport.viewportToImageCoordinates(i),o=Math.round(n.x),r=Math.round(n.y);o>=0&&o<=this._dziData.Width&&r>=0&&r<=this._dziData.Height?e.textContent=o+", "+r:e.textContent=""}catch(t){}}zoomIn(){if(this._osdViewer){let t=this._osdViewer.viewport.getZoom();this._osdViewer.viewport.zoomTo(1.5*t)}}zoomOut(){if(this._osdViewer){let t=this._osdViewer.viewport.getZoom();this._osdViewer.viewport.zoomTo(t/1.5)}}zoomHome(){this._osdViewer&&this._osdViewer.viewport.goHome()}toggleSelectionMode(){this._selectionMode?this._exitSelectionMode():this._enterSelectionMode()}_enterSelectionMode(){if(!this._osdViewer)return;this._selectionMode=!0;let t=document.getElementById("RetoldRemote-IEX-SelectBtn");t&&(t.style.background="rgba(97, 175, 239, 0.4)",t.style.color="#fff"),this._osdViewer.setMouseNavEnabled(!1);let e=this,i=document.getElementById("RetoldRemote-IEX-Viewer");i&&(i.style.cursor="crosshair",this._selectionTracker=new OpenSeadragon.MouseTracker({element:i,pressHandler:function(t){e._onSelectionPress(t)},dragHandler:function(t){e._onSelectionDrag(t)},releaseHandler:function(t){e._onSelectionRelease(t)}}))}_exitSelectionMode(){this._selectionMode=!1;let t=document.getElementById("RetoldRemote-IEX-SelectBtn");t&&(t.style.background="",t.style.color=""),this._osdViewer&&this._osdViewer.setMouseNavEnabled(!0),this._selectionTracker&&(this._selectionTracker.destroy(),this._selectionTracker=null);let e=document.getElementById("RetoldRemote-IEX-Viewer");e&&(e.style.cursor=""),this._removeActiveSelectionOverlay(),this._selectionRegion=null,this._selectionStart=null,this._selectionStartScreenPos=null;let i=document.getElementById("RetoldRemote-IEX-LabelInput");i&&(i.style.display="none");let n=document.getElementById("RetoldRemote-IEX-Coords");n&&(n.style.display="")}_onSelectionPress(t){if(!this._osdViewer)return;this._removeActiveSelectionOverlay(),this._selectionStartScreenPos={x:t.position.x,y:t.position.y},this._selectionStart=this._osdViewer.viewport.pointFromPixel(t.position);let e=document.createElement("div");e.id="RetoldRemote-IEX-ActiveSelection",e.style.cssText="border: 2px solid rgba(97, 175, 239, 0.9); background: rgba(97, 175, 239, 0.15); pointer-events: none;",this._selectionOverlay=e,this._osdViewer.addOverlay({element:e,location:new OpenSeadragon.Rect(this._selectionStart.x,this._selectionStart.y,0,0)})}_onSelectionDrag(t){if(!this._osdViewer||!this._selectionStart||!this._selectionOverlay)return;let e=this._osdViewer.viewport.pointFromPixel(t.position),i=Math.min(this._selectionStart.x,e.x),n=Math.min(this._selectionStart.y,e.y),o=Math.abs(e.x-this._selectionStart.x),r=Math.abs(e.y-this._selectionStart.y);this._osdViewer.updateOverlay(this._selectionOverlay,new OpenSeadragon.Rect(i,n,o,r))}_onSelectionRelease(t){if(!this._osdViewer||!this._selectionStart)return;if(this._selectionStartScreenPos){let e=Math.abs(t.position.x-this._selectionStartScreenPos.x),i=Math.abs(t.position.y-this._selectionStartScreenPos.y);if(e<5&&i<5)return this._removeActiveSelectionOverlay(),this._selectionStart=null,void(this._selectionStartScreenPos=null)}let e=this._osdViewer.viewport.pointFromPixel(t.position),i=Math.min(this._selectionStart.x,e.x),n=Math.min(this._selectionStart.y,e.y),o=Math.abs(e.x-this._selectionStart.x),r=Math.abs(e.y-this._selectionStart.y),a=this._osdViewer.viewport.viewportToImageCoordinates(new OpenSeadragon.Point(i,n)),s=this._osdViewer.viewport.viewportToImageCoordinates(new OpenSeadragon.Point(i+o,n+r)),l={X:Math.max(0,Math.round(a.x)),Y:Math.max(0,Math.round(a.y)),Width:Math.round(s.x-a.x),Height:Math.round(s.y-a.y)};if(this._clampRegionToImage(l),l.Width<5||l.Height<5)return this._removeActiveSelectionOverlay(),this._selectionStart=null,void(this._selectionStartScreenPos=null);this._selectionRegion=l;let d=document.getElementById("RetoldRemote-IEX-LabelInput"),c=document.getElementById("RetoldRemote-IEX-Coords");d&&(d.style.display=""),c&&(c.style.display="none");let p=document.getElementById("RetoldRemote-IEX-LabelField");p&&(p.value="",p.focus())}_saveNewRegionLabel(){if(!this._selectionRegion)return;let t=document.getElementById("RetoldRemote-IEX-LabelField"),e=t?t.value.trim():"",i=this,n=this.pict.providers["RetoldRemote-Provider"];n?n._getPathParam(this._currentPath):encodeURIComponent(this._currentPath);fetch("/api/media/subimage-regions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({Path:this._currentPath,Region:{Label:e,X:this._selectionRegion.X,Y:this._selectionRegion.Y,Width:this._selectionRegion.Width,Height:this._selectionRegion.Height}})}).then(t=>t.json()).then(t=>{if(t&&t.Success){i._savedRegions=t.Regions||[],i._removeActiveSelectionOverlay(),i._renderSavedRegionOverlays();let n=i.pict.providers["RetoldRemote-ToastNotification"];n&&n.showToast("Subimage region saved"+(e?": "+e:""));let o=i.pict.views["RetoldRemote-SubimagesPanel"];o&&o.render()}}).catch(t=>{let e=i.pict.providers["RetoldRemote-ToastNotification"];e&&e.showToast("Failed to save region: "+t.message)}),this._selectionRegion=null,this._selectionStart=null,this._selectionStartScreenPos=null;let o=document.getElementById("RetoldRemote-IEX-LabelInput");o&&(o.style.display="none");let r=document.getElementById("RetoldRemote-IEX-Coords");r&&(r.style.display="")}_cancelNewSelection(){this._removeActiveSelectionOverlay(),this._selectionRegion=null,this._selectionStart=null,this._selectionStartScreenPos=null;let t=document.getElementById("RetoldRemote-IEX-LabelInput");t&&(t.style.display="none");let e=document.getElementById("RetoldRemote-IEX-Coords");e&&(e.style.display="")}_removeActiveSelectionOverlay(){let t=document.getElementById("RetoldRemote-IEX-ActiveSelection");if(t&&this._osdViewer)try{this._osdViewer.removeOverlay(t)}catch(e){t.parentElement&&t.parentElement.removeChild(t)}this._selectionOverlay=null}_loadSavedRegions(t){let e=this,i=t,n=this.pict.providers["RetoldRemote-Provider"],o=n?n._getPathParam(t):encodeURIComponent(t);fetch("/api/media/subimage-regions?path="+o).then(t=>t.json()).then(t=>{e._currentPath===i&&t&&t.Success&&Array.isArray(t.Regions)&&(e._savedRegions=t.Regions,e._viewerReady&&e._renderSavedRegionOverlays())}).catch(()=>{})}_renderSavedRegionOverlays(){if(!this._osdViewer)return;let t=document.getElementById("RetoldRemote-IEX-Viewer");if(t){let e=t.querySelectorAll(".retold-remote-iex-region-overlay");for(let t=0;t<e.length;t++)try{this._osdViewer.removeOverlay(e[t])}catch(i){e[t].parentElement&&e[t].parentElement.removeChild(e[t])}}for(let t=0;t<this._savedRegions.length;t++){let e=this._savedRegions[t];this._addRegionOverlay(e)}if(this._editingRegionID&&t){let e=t.querySelector('.retold-remote-iex-region-overlay[data-region-id="'+this._editingRegionID+'"]');e&&this._appendEditHandles(e)}}_addRegionOverlay(t){if(!this._osdViewer)return;let e=this,i=document.createElement("div");if(i.className="retold-remote-iex-region-overlay",i.setAttribute("data-region-id",t.ID),i.style.cssText="border: 2px solid rgba(229, 192, 123, 0.85); background: rgba(229, 192, 123, 0.08); pointer-events: auto; position: relative; cursor: pointer;",t.Label){let e=document.createElement("span");e.className="retold-remote-iex-region-label",e.style.cssText="position:absolute;top:-1px;left:-1px;background:rgba(229,192,123,0.9);color:#282c34;font-size:0.65rem;padding:1px 5px;border-radius:0 0 3px 0;white-space:nowrap;pointer-events:none;",e.textContent=t.Label,i.appendChild(e)}this._editingRegionID&&this._editingRegionID===t.ID?(i.style.border="2px solid rgba(97, 175, 239, 0.95)",i.style.background="rgba(97, 175, 239, 0.15)",i.style.opacity="1"):this._editingRegionID&&(i.style.opacity="0.35"),i.addEventListener("mousedown",function(i){e._editingRegionID!==t.ID&&i.stopPropagation()}),i.addEventListener("dblclick",function(i){i.stopPropagation(),i.preventDefault(),e._enterRegionEditMode(t.ID)});let n=new OpenSeadragon.Rect(t.X,t.Y,t.Width,t.Height),o=this._osdViewer.viewport.imageToViewportRectangle(n);this._osdViewer.addOverlay({element:i,location:o})}zoomToRegion(t){if(!this._osdViewer||!this._dziData)return;let e=null;for(let i=0;i<this._savedRegions.length;i++)if(this._savedRegions[i].ID===t){e=this._savedRegions[i];break}if(!e)return;let i=new OpenSeadragon.Rect(e.X,e.Y,e.Width,e.Height),n=this._osdViewer.viewport.imageToViewportRectangle(i);this._osdViewer.viewport.fitBounds(n)}deleteRegion(t){let e=this,i=this.pict.providers["RetoldRemote-Provider"],n=i?i._getPathParam(this._currentPath):encodeURIComponent(this._currentPath);fetch("/api/media/subimage-regions/"+encodeURIComponent(t)+"?path="+n,{method:"DELETE"}).then(t=>t.json()).then(t=>{if(t&&t.Success){e._savedRegions=t.Regions||[],e._renderSavedRegionOverlays();let i=e.pict.providers["RetoldRemote-ToastNotification"];i&&i.showToast("Region deleted");let n=e.pict.views["RetoldRemote-SubimagesPanel"];n&&n.render()}}).catch(()=>{})}getActiveSelection(){return this._selectionRegion}getSavedRegions(){return this._savedRegions}goBack(){if(this._cancelActiveDziOperation(),this._selectionMode&&this._exitSelectionMode(),this._osdViewer){try{this._osdViewer.destroy()}catch(t){}this._osdViewer=null}let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t.closeViewer()}viewInBrowser(){if(this._cancelActiveDziOperation(),this._osdViewer){try{this._osdViewer.destroy()}catch(t){}this._osdViewer=null}let t=this.pict.views["RetoldRemote-MediaViewer"];t&&t.showMedia(this._currentPath,"image")}_showError(t){let e=document.getElementById("RetoldRemote-IEX-Loading");e&&(e.style.display="none");let i=document.getElementById("RetoldRemote-IEX-Body");if(i){let e=this.pict.providers["RetoldRemote-FormattingUtilities"];i.innerHTML='<div class="retold-remote-iex-error"><div class="retold-remote-iex-error-message">'+e.escapeHTML(t||"An error occurred.")+'</div><button class="retold-remote-iex-nav-btn" onclick="pict.views[\'RetoldRemote-ImageExplorer\'].goBack()">Back to Image</button></div>'}}_clampRegionToImage(t){t&&(t.X<0&&(t.Width+=t.X,t.X=0),t.Y<0&&(t.Height+=t.Y,t.Y=0),this._dziData&&(t.X+t.Width>this._dziData.Width&&(t.Width=this._dziData.Width-t.X),t.Y+t.Height>this._dziData.Height&&(t.Height=this._dziData.Height-t.Y)))}_enterRegionEditMode(t){let e=null;for(let i=0;i<this._savedRegions.length;i++)if(this._savedRegions[i].ID===t){e=this._savedRegions[i];break}if(!e)return;this._selectionMode&&this._exitSelectionMode(),this._editingRegionID&&this._editingRegionID!==t&&this._exitRegionEditMode(),this._editingRegionID=t,this._editDragMode=null,this._editDragStart=null,this._editOriginalRect=null,this._osdViewer&&this._osdViewer.setMouseNavEnabled(!1),this._renderSavedRegionOverlays();let i=document.getElementById("RetoldRemote-IEX-LabelInput"),n=document.getElementById("RetoldRemote-IEX-Coords"),o=document.getElementById("RetoldRemote-IEX-LabelField");i&&(i.style.display=""),n&&(n.style.display="none"),o&&(o.value=e.Label||"",o.setAttribute("data-edit-mode","1"),o.focus(),o.select())}_exitRegionEditMode(){this._editingRegionID=null,this._editDragMode=null,this._editDragStart=null,this._editOriginalRect=null,this._editDocMoveHandler&&(document.removeEventListener("mousemove",this._editDocMoveHandler),this._editDocMoveHandler=null),this._editDocUpHandler&&(document.removeEventListener("mouseup",this._editDocUpHandler),this._editDocUpHandler=null),this._osdViewer&&this._osdViewer.setMouseNavEnabled(!0),this._renderSavedRegionOverlays();let t=document.getElementById("RetoldRemote-IEX-LabelInput"),e=document.getElementById("RetoldRemote-IEX-Coords"),i=document.getElementById("RetoldRemote-IEX-LabelField");t&&(t.style.display="none"),e&&(e.style.display=""),i&&(i.removeAttribute("data-edit-mode"),i.value="")}_appendEditHandles(t){let e=this,i=[{key:"tl",css:"top:-8px;left:-8px;cursor:nwse-resize;"},{key:"tr",css:"top:-8px;right:-8px;cursor:nesw-resize;"},{key:"bl",css:"bottom:-8px;left:-8px;cursor:nesw-resize;"},{key:"br",css:"bottom:-8px;right:-8px;cursor:nwse-resize;"},{key:"t",css:"top:-8px;left:50%;transform:translateX(-50%);cursor:ns-resize;"},{key:"b",css:"bottom:-8px;left:50%;transform:translateX(-50%);cursor:ns-resize;"},{key:"l",css:"top:50%;left:-8px;transform:translateY(-50%);cursor:ew-resize;"},{key:"r",css:"top:50%;right:-8px;transform:translateY(-50%);cursor:ew-resize;"}];for(let n=0;n<i.length;n++){let o=i[n],r=document.createElement("div");r.className="retold-remote-iex-edit-handle",r.setAttribute("data-handle",o.key),r.style.cssText="position:absolute;width:16px;height:16px;pointer-events:auto;z-index:10;"+o.css;let a=document.createElement("div");a.style.cssText="position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:8px;height:8px;background:#61afef;border:1.5px solid #fff;border-radius:50%;box-shadow:0 1px 3px rgba(0,0,0,0.5);",r.appendChild(a),r.addEventListener("mousedown",function(t){t.stopPropagation(),t.preventDefault(),e._onEditHandlePress(o.key,t)}),t.appendChild(r)}t.addEventListener("mousedown",function(i){i.target===t&&e._editingRegionID===t.getAttribute("data-region-id")&&(i.stopPropagation(),i.preventDefault(),e._onEditHandlePress("body",i))}),t.style.cursor="move"}_onEditHandlePress(t,e){if(!this._osdViewer)return;if(!this._editingRegionID)return;let i=document.getElementById("RetoldRemote-IEX-Viewer");if(!i)return;this._editDragMode=t;let n=i.getBoundingClientRect(),o=e.clientX-n.left,r=e.clientY-n.top;this._editDragStart=this._osdViewer.viewport.pointFromPixel(new OpenSeadragon.Point(o,r));let a=this._findSavedRegion(this._editingRegionID);if(!a)return void(this._editDragMode=null);let s=new OpenSeadragon.Rect(a.X,a.Y,a.Width,a.Height);this._editOriginalRect=this._osdViewer.viewport.imageToViewportRectangle(s);let l=this;this._editDocMoveHandler=function(t){l._onEditHandleMove(t)},this._editDocUpHandler=function(t){l._onEditHandleRelease(t)},document.addEventListener("mousemove",this._editDocMoveHandler),document.addEventListener("mouseup",this._editDocUpHandler)}_onEditHandleMove(t){if(!(this._osdViewer&&this._editDragStart&&this._editOriginalRect&&this._editDragMode))return;let e=document.getElementById("RetoldRemote-IEX-Viewer");if(!e)return;let i=e.getBoundingClientRect(),n=t.clientX-i.left,o=t.clientY-i.top,r=this._osdViewer.viewport.pointFromPixel(new OpenSeadragon.Point(n,o)),a=r.x-this._editDragStart.x,s=r.y-this._editDragStart.y,l=this._editOriginalRect.x,d=this._editOriginalRect.y,c=this._editOriginalRect.width,p=this._editOriginalRect.height;switch(this._editDragMode){case"body":l+=a,d+=s;break;case"tl":l+=a,d+=s,c-=a,p-=s;break;case"tr":d+=s,c+=a,p-=s;break;case"bl":l+=a,c-=a,p+=s;break;case"br":c+=a,p+=s;break;case"t":d+=s,p-=s;break;case"b":p+=s;break;case"l":l+=a,c-=a;break;case"r":c+=a}c<0&&(l+=c,c=-c),p<0&&(d+=p,p=-p);let h=e.querySelector('.retold-remote-iex-region-overlay[data-region-id="'+this._editingRegionID+'"]');h&&this._osdViewer.updateOverlay(h,new OpenSeadragon.Rect(l,d,c,p))}_onEditHandleRelease(t){if(this._editDocMoveHandler&&(document.removeEventListener("mousemove",this._editDocMoveHandler),this._editDocMoveHandler=null),this._editDocUpHandler&&(document.removeEventListener("mouseup",this._editDocUpHandler),this._editDocUpHandler=null),!this._osdViewer||!this._editingRegionID||!this._editDragMode)return void(this._editDragMode=null);let e=document.getElementById("RetoldRemote-IEX-Viewer");if(!e)return void(this._editDragMode=null);let i=e.querySelector('.retold-remote-iex-region-overlay[data-region-id="'+this._editingRegionID+'"]');if(!i)return void(this._editDragMode=null);let n=this._osdViewer.getOverlayById(i);if(!n||!n.location)return void(this._editDragMode=null);let o=n.location,r=this._osdViewer.viewport.viewportToImageCoordinates(new OpenSeadragon.Point(o.x,o.y)),a=this._osdViewer.viewport.viewportToImageCoordinates(new OpenSeadragon.Point(o.x+o.width,o.y+o.height)),s={X:Math.round(r.x),Y:Math.round(r.y),Width:Math.round(a.x-r.x),Height:Math.round(a.y-r.y)};this._clampRegionToImage(s);let l=this._findSavedRegion(this._editingRegionID);if(!l)return void(this._editDragMode=null);let d={X:l.X,Y:l.Y,Width:l.Width,Height:l.Height};d.X!==s.X||d.Y!==s.Y||d.Width!==s.Width||d.Height!==s.Height?(l.X=s.X,l.Y=s.Y,l.Width=s.Width,l.Height=s.Height,this._editDragMode=null,this._putRegionUpdate(l.ID,{X:s.X,Y:s.Y,Width:s.Width,Height:s.Height},d)):this._editDragMode=null}saveSelectionLabel(){if(this._editingRegionID){let t=document.getElementById("RetoldRemote-IEX-LabelField"),e=t?t.value.trim():"",i=this._findSavedRegion(this._editingRegionID);if(!i)return void this._exitRegionEditMode();let n=i.Label||"";if(e===n)return void this._exitRegionEditMode();i.Label=e;let o=this._editingRegionID;return this._exitRegionEditMode(),void this._putRegionUpdate(o,{Label:e},{Label:n})}return this._saveNewRegionLabel()}_putRegionUpdate(t,e,i){let n=this,o=Object.assign({Path:this._currentPath},e);fetch("/api/media/subimage-regions/"+encodeURIComponent(t),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}).then(t=>t.json()).then(e=>{if(!e||!e.Success){n._revertRegion(t,i),n._renderSavedRegionOverlays();let o=n.pict.providers["RetoldRemote-ToastNotification"];if(o){let t=e&&e.Error?"Failed to save: "+e.Error:"Failed to save region update (file may have been modified).";o.showToast(t)}return}Array.isArray(e.Regions)&&(n._savedRegions=e.Regions),n._renderSavedRegionOverlays();let o=n.pict.views["RetoldRemote-SubimagesPanel"];o&&"function"==typeof o.refresh&&o.refresh();let r=n.pict.providers["RetoldRemote-ToastNotification"];r&&r.showToast("Region updated")}).catch(e=>{n._revertRegion(t,i),n._renderSavedRegionOverlays();let o=n.pict.providers["RetoldRemote-ToastNotification"];o&&o.showToast("Network error saving region: "+e.message)})}_revertRegion(t,e){if(!e)return;let i=this._findSavedRegion(t);if(i)for(let t in e)i[t]=e[t]}_findSavedRegion(t){for(let e=0;e<this._savedRegions.length;e++)if(this._savedRegions[e].ID===t)return this._savedRegions[e];return null}cancelSelection(){if(!this._editingRegionID)return this._cancelNewSelection();this._exitRegionEditMode()}}r.default_configuration=o,e.exports=r},{"pict-view":102}],160:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"RetoldRemote-ImageViewer",DefaultRenderable:"RetoldRemote-ImageViewer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:""};class r extends n{constructor(t,e,i){super(t,e,i),this._zoomLevel=1,this._naturalWidth=0,this._naturalHeight=0,this._resizeHandler=null}initImage(){let t=document.getElementById("RetoldRemote-ImageViewer-Img");if(!t)return;this._naturalWidth=t.naturalWidth,this._naturalHeight=t.naturalHeight,this._zoomLevel=1,this._applyDisplay(),this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler);let e=this,i=null;this._resizeHandler=function(){clearTimeout(i),i=setTimeout(function(){e._applyDisplay()},100)},window.addEventListener("resize",this._resizeHandler),this._showExploreButton()}_showExploreButton(){let t=document.getElementById("RetoldRemote-HeaderExploreBtn");t&&(t.style.display="")}_getFitMode(){return this.pict.AppData.RetoldRemote.ImageFitMode||"fit"}setFitMode(t){this.pict.AppData.RetoldRemote.ImageFitMode=t,this._zoomLevel=1,this._applyDisplay(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}cycleFitMode(){let t;switch(this._getFitMode()){case"fit":t="auto";break;case"auto":t="original";break;default:t="fit"}this.setFitMode(t),this._showFitModeIndicator(t)}toggleZoom(){this._naturalWidth&&(1===this._zoomLevel?this._zoomLevel=2:this._zoomLevel=1,this._applyDisplay())}zoomIn(){this._zoomLevel=Math.min(1.25*this._zoomLevel,8),this._applyDisplay()}zoomOut(){this._zoomLevel=Math.max(this._zoomLevel/1.25,.25),this._applyDisplay()}zoomReset(){this._zoomLevel=1,this._applyDisplay()}_applyDisplay(){let t=document.getElementById("RetoldRemote-ImageViewer-Img");if(!t||!this._naturalWidth)return;let e=t.parentElement;if(!e)return;let i=this._getBaseSize(e),n=Math.round(i.width*this._zoomLevel),o=Math.round(i.height*this._zoomLevel);t.style.maxWidth="none",t.style.maxHeight="none",t.style.objectFit="",t.style.width=n+"px",t.style.height=o+"px",t.style.transform="",this._zoomLevel>1||n>e.clientWidth||o>e.clientHeight?t.style.cursor="zoom-out":t.style.cursor="zoom-in"}_getBaseSize(t){let e=this._naturalWidth,i=this._naturalHeight,n=t.clientWidth,o=t.clientHeight;if(!n||!o)return{width:e,height:i};let r=e/i;switch(this._getFitMode()){case"fit":{let t=n,e=n/r;return e>o&&(e=o,t=o*r),{width:t,height:e}}case"auto":{if(e<=n&&i<=o)return{width:e,height:i};let t=n,a=n/r;return a>o&&(a=o,t=o*r),{width:t,height:a}}default:return{width:e,height:i}}}_showFitModeIndicator(t){let e={fit:"Fit to Window",auto:"Original if Smaller",original:"Original Size"}[t]||t;this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator(e,1200)}cleanup(){this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null)}}r.default_configuration=o,e.exports=r},{"pict-view":102}],161:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"ContentEditor-Layout",DefaultRenderable:"RetoldRemote-Layout-Shell",DefaultDestinationAddress:"#ContentEditor-Application-Container",AutoRender:!1,CSS:"",Templates:[{Hash:"RetoldRemote-Layout-Shell",Template:'\n\t\t\t\t<div id="ContentEditor-TopBar-Container"></div>\n\t\t\t\t<div class="content-editor-body">\n\t\t\t\t\t<div class="content-editor-sidebar-wrap" style="width: 250px;">\n\t\t\t\t\t\t<div class="content-editor-sidebar-inner">\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-tabs">\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab active" data-tab="files" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'files\')">Files</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab" data-tab="favorites" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'favorites\')">Favorites</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab" data-tab="info" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'info\')">Info</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab" data-tab="subimages" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'subimages\')">Regions</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab" data-tab="settings" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'settings\')">Settings</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab content-editor-sidebar-tab-collections" data-tab="collections" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'collections\')" style="display:none;">Collections</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="files" id="ContentEditor-Sidebar-Container"></div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="favorites" id="RetoldRemote-Favorites-Container" style="display:none">\n\t\t\t\t\t\t\t\t<div id="RetoldRemote-Favorites-Body"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="info" id="RetoldRemote-Info-Container" style="display:none"></div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="subimages" id="RetoldRemote-Subimages-Container" style="display:none"></div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="settings" id="RetoldRemote-Settings-Container" style="display:none"></div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="collections" id="RetoldRemote-Collections-MobilePane" style="display:none"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="content-editor-resize-handle"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div id="RetoldRemote-Content-Container">\n\t\t\t\t\t\t<div id="RetoldRemote-Gallery-Container"></div>\n\t\t\t\t\t\t<div id="RetoldRemote-Viewer-Container"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="retold-remote-collections-wrap collapsed" id="RetoldRemote-Collections-Wrap" style="width: 300px;">\n\t\t\t\t\t\t<div class="retold-remote-collections-resize-handle"></div>\n\t\t\t\t\t\t<div class="retold-remote-collections-inner">\n\t\t\t\t\t\t\t<div id="RetoldRemote-Collections-Container"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="retold-remote-operation-status" id="RetoldRemote-OperationStatus-Container"></div>\n\t\t\t'}],Renderables:[{RenderableHash:"RetoldRemote-Layout-Shell",TemplateHash:"RetoldRemote-Layout-Shell",DestinationAddress:"#ContentEditor-Application-Container"}]};class r extends n{constructor(t,e,i){super(t,e,i),this._sidebarDragging=!1,this._collectionsDragging=!1}onAfterRender(){super.onAfterRender(),this.pict.CSSMap.injectCSS(),this._setupResizeHandle();let t=this.pict.AppData.RetoldRemote;if(t&&t.SidebarCollapsed){let t=document.querySelector(".content-editor-sidebar-wrap");t&&t.classList.add("collapsed")}if(!this.isMobileDrawer()&&t&&t.SidebarWidth){let e=document.querySelector(".content-editor-sidebar-wrap");e&&!e.classList.contains("collapsed")&&(e.style.width=t.SidebarWidth+"px")}if(this.isMobileDrawer()&&t&&t.SidebarDrawerHeight){let e=document.querySelector(".content-editor-sidebar-wrap");e&&!e.classList.contains("collapsed")&&(e.style.height=t.SidebarDrawerHeight+"px")}if(t&&t.CollectionsPanelOpen){let e=document.getElementById("RetoldRemote-Collections-Wrap");e&&(e.classList.remove("collapsed"),t.CollectionsPanelWidth&&(e.style.width=t.CollectionsPanelWidth+"px"))}this._setupCollectionsResizeHandle();let e=this;window.addEventListener("hashchange",()=>{e.pict.PictApplication.resolveHash()})}isMobileDrawer(){return window.innerWidth<=600}toggleSidebar(){let t=document.querySelector(".content-editor-sidebar-wrap");if(!t)return;t.classList.toggle("collapsed");let e=this.pict.AppData.RetoldRemote,i=t.classList.contains("collapsed");if(e.SidebarCollapsed=i,!i)if(this.isMobileDrawer()){let i=e.SidebarDrawerHeight||Math.round(.33*window.innerHeight);t.style.height=i+"px"}else e.SidebarWidth&&(t.style.width=e.SidebarWidth+"px");this.pict.PictApplication.saveSettings();let n=this.pict.providers["RetoldRemote-GalleryNavigation"];n&&setTimeout(()=>n.recalculateColumns(),250)}switchSidebarTab(t){if(document.querySelectorAll(".content-editor-sidebar-tab").forEach(e=>{e.classList.toggle("active",e.getAttribute("data-tab")===t)}),document.querySelectorAll(".content-editor-sidebar-pane").forEach(e=>{e.style.display=e.getAttribute("data-pane")===t?"":"none"}),"subimages"===t){let t=this.pict.views["RetoldRemote-SubimagesPanel"];t&&t.render()}if("settings"===t){let t=this.pict.views["RetoldRemote-SettingsPanel"];t&&t.render()}if("favorites"===t&&this.renderFavoritesList(),"info"===t){let t=this.pict.views["RetoldRemote-FileInfoPanel"];t&&t.render()}if("collections"===t){let t=document.getElementById("RetoldRemote-Collections-Container"),e=document.getElementById("RetoldRemote-Collections-MobilePane");t&&e&&!e.contains(t)&&e.appendChild(t);let i=this.pict.views["RetoldRemote-CollectionsPanel"];i&&i.render();let n=this.pict.providers["RetoldRemote-CollectionManager"];n&&n.fetchCollections()}else{let t=document.getElementById("RetoldRemote-Collections-Container"),e=document.querySelector(".retold-remote-collections-inner");t&&e&&!e.contains(t)&&e.appendChild(t)}}notifyCurrentFileChanged(t){let e=document.querySelector(".content-editor-sidebar-tab.active");if(!e)return;let i=e.getAttribute("data-tab");if("subimages"===i){let t=this.pict.views["RetoldRemote-SubimagesPanel"];t&&t.render()}else if("info"===i){let t=this.pict.views["RetoldRemote-FileInfoPanel"];t&&t.render()}}_setupResizeHandle(){let t=this,e=document.querySelector(".content-editor-resize-handle"),i=document.querySelector(".content-editor-sidebar-wrap");if(!e||!i)return;let n=0,o=0,r=0,a=0;function s(t){return t.touches&&t.touches.length>0?{x:t.touches[0].clientX,y:t.touches[0].clientY}:{x:t.clientX,y:t.clientY}}function l(l){t._sidebarDragging=!0;let p=s(l);n=p.x,o=p.y,r=i.offsetWidth,a=i.offsetHeight,e.classList.add("dragging"),document.addEventListener("mousemove",d),document.addEventListener("mouseup",c),document.addEventListener("touchmove",d,{passive:!1}),document.addEventListener("touchend",c),l.preventDefault()}function d(e){if(!t._sidebarDragging)return;let l=s(e);if(t.isMobileDrawer()){let t=a+(l.y-o),e=Math.round(.7*window.innerHeight);t=Math.max(80,Math.min(t,e)),i.style.height=t+"px"}else{let t=r+(l.x-n);t=Math.max(150,Math.min(t,600)),i.style.width=t+"px"}e.preventDefault()}function c(){t._sidebarDragging=!1,e.classList.remove("dragging"),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",c),document.removeEventListener("touchmove",d),document.removeEventListener("touchend",c);let n=t.pict.AppData.RetoldRemote;t.isMobileDrawer()?n.SidebarDrawerHeight=i.offsetHeight:n.SidebarWidth=i.offsetWidth,t.pict.PictApplication.saveSettings();let o=t.pict.providers["RetoldRemote-GalleryNavigation"];o&&o.recalculateColumns()}e.addEventListener("mousedown",l),e.addEventListener("touchstart",l,{passive:!1}),e.addEventListener("dblclick",function(e){e.preventDefault(),t.toggleSidebar()})}toggleCollectionsPanel(){let t=this.pict.providers["RetoldRemote-CollectionManager"];t&&t.togglePanel()}renderFavoritesList(){let t=document.getElementById("RetoldRemote-Favorites-Body");if(!t)return;let e=this.pict.AppData.RetoldRemote.FavoritesCollection,i=this.pict.providers["RetoldRemote-Icons"];if(!e||!Array.isArray(e.Items)||0===e.Items.length)return void(t.innerHTML='<div class="retold-remote-favorites-empty"><div style="font-size:1.5rem; margin-bottom:8px; opacity:0.4;">♡</div>No favorites yet.<br>Tap ♡ or press <b>h</b> to favorite files.</div>');let n="";for(let t=0;t<e.Items.length;t++){let o=e.Items[t],r=o.Path||"",a=r.split("/").pop()||r,s=a.lastIndexOf(".")>=0?a.substring(a.lastIndexOf(".")):"",l="";i&&(l=i.getIconForEntry({Type:"folder"===o.Type?"folder":"file",Extension:s},16));let d=r.replace(/'/g,"\\'");n+='<div class="retold-remote-favorites-item" onclick="pict.PictApplication.navigateToFile(\''+d+"')\">",n+='<span class="retold-remote-favorites-item-icon">'+l+"</span>",n+='<span class="retold-remote-favorites-item-name" title="'+r+'">'+a+"</span>",n+="<button class=\"retold-remote-favorites-item-remove\" onclick=\"event.stopPropagation(); pict.providers['RetoldRemote-CollectionManager'].toggleFavorite('"+d+'\')" title="Remove from favorites">×</button>',n+="</div>"}t.innerHTML=n}_setupCollectionsResizeHandle(){let t=document.querySelector(".retold-remote-collections-resize-handle"),e=document.getElementById("RetoldRemote-Collections-Wrap");if(!t||!e)return;let i=this,n=0,o=0;function r(r){if(e.classList.contains("collapsed"))return;r.preventDefault(),i._collectionsDragging=!0,t.classList.add("dragging");let l=r.touches?r.touches[0].clientX:r.clientX;n=l,o=e.getBoundingClientRect().width,document.addEventListener("mousemove",a),document.addEventListener("mouseup",s),document.addEventListener("touchmove",a,{passive:!1}),document.addEventListener("touchend",s)}function a(t){if(!i._collectionsDragging)return;t.preventDefault();let r=t.touches?t.touches[0].clientX:t.clientX,a=n-r,s=Math.max(150,Math.min(600,o+a));e.style.width=s+"px"}function s(){if(!i._collectionsDragging)return;i._collectionsDragging=!1,t.classList.remove("dragging"),i.pict.AppData.RetoldRemote.CollectionsPanelWidth=e.getBoundingClientRect().width,i.pict.PictApplication.saveSettings(),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",s),document.removeEventListener("touchmove",a),document.removeEventListener("touchend",s);let n=i.pict.providers["RetoldRemote-GalleryNavigation"];n&&"function"==typeof n.recalculateColumns&&n.recalculateColumns()}t.addEventListener("mousedown",r),t.addEventListener("touchstart",r,{passive:!1}),t.addEventListener("dblclick",function(t){t.preventDefault(),i.toggleCollectionsPanel()})}}r.default_configuration=o,e.exports=r},{"pict-view":102}],162:[function(t,e,i){const n=t("pict-view"),o=t("./MediaViewer-EbookViewer"),r=t("./MediaViewer-CodeViewer"),a=t("./MediaViewer-PdfViewer"),s={ViewIdentifier:"RetoldRemote-MediaViewer",DefaultRenderable:"RetoldRemote-MediaViewer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:""};class l extends n{constructor(t,e,i){super(t,e,i),this._swipeStartX=0,this._swipeStartY=0,this._swipeTouchCount=0,this._swipeHandlers=null,this._dfExitHandlers=null}showMedia(t,e){let i=this.pict.AppData.RetoldRemote;i.ActiveMode="viewer",i.CurrentViewerFile=t,i.CurrentViewerMediaType=e,i.VideoMenuActive="video"===e;let n=this.pict.views["ContentEditor-Layout"];n&&"function"==typeof n.notifyCurrentFileChanged&&n.notifyCurrentFileChanged(t);let o=document.getElementById("RetoldRemote-Gallery-Container"),r=document.getElementById("RetoldRemote-Viewer-Container");o&&(o.style.display="none"),r&&(r.style.display="block");let a=t.replace(/^.*\//,""),s=this.pict.providers["RetoldRemote-Provider"],l=s?s.getContentURL(t):"/content/"+encodeURIComponent(t),d='<div class="retold-remote-viewer">';if(d+='<div class="retold-remote-viewer-header">',d+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].closeViewer()" title="Back (Esc)">← Back</button>',d+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].prevFile()" title="Previous (k)">‹ Prev</button>',d+='<div class="retold-remote-viewer-title">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(a)+"</div>",d+='<button class="retold-remote-viewer-nav-btn" id="RetoldRemote-HeaderExploreBtn" onclick="pict.views[\'RetoldRemote-ImageExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore image (e)" style="display:none;">🔍 Explore</button>',d+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].nextFile()" title="Next (j)">Next ›</button>',d+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleFileInfo()" title="Info (i)">ⓘ</button>',d+='<button class="retold-remote-viewer-nav-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].toggleDistractionFree()" title="Distraction-Free (d)">▢</button>',d+="</div>",d+='<div class="retold-remote-viewer-body">',d+='<div class="retold-remote-df-exit-hotspot" id="RetoldRemote-DF-ExitHotspot"'+(i._distractionFreeMode?"":' style="display:none"')+"></div>","image"===e)d+=this._buildImagePlaceholderHTML(a);else switch(e){case"video":d+=this._buildVideoHTML(l,a);break;case"audio":d+=this._buildAudioHTML(l,a);break;case"text":d+=this._buildTextHTML(l,a,t);break;case"document":d+=this._buildDocumentHTML(l,a,t);break;default:d+=this._buildFallbackHTML(l,a)}if(d+='<div class="retold-remote-fileinfo-overlay" id="RetoldRemote-FileInfo-Overlay">',d+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Loading...</span></div>',d+="</div>",d+="</div>",d+="</div>",r&&(r.innerHTML=d),"image"===e&&this._probeAndShowImage(t,l,a),this._loadFileInfo(t),"text"===e&&this._loadCodeViewer(l,t),"document"===e){let e=t.replace(/^.*\./,"").toLowerCase();"epub"===e||"mobi"===e?this._loadEbookViewer(l,t):"pdf"===e?this._loadPdfViewer(l,t):this._loadConvertedDocumentViewer(t)}this._setupSwipeNavigation(),this._setupDFExitHotspot();let c=this.pict.views["ContentEditor-TopBar"];c&&c.updateInfo()}showDirectImage(t,e,i){let n=this.pict.AppData.RetoldRemote;n.ActiveMode="viewer",n.CurrentViewerFile=i||"",n.CurrentViewerMediaType="image",n.VideoMenuActive=!1;let o=this.pict.views["ContentEditor-Layout"];o&&"function"==typeof o.notifyCurrentFileChanged&&o.notifyCurrentFileChanged(i||"");let r=document.getElementById("RetoldRemote-Gallery-Container"),a=document.getElementById("RetoldRemote-Viewer-Container");r&&(r.style.display="none"),a&&(a.style.display="block");let s=this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e),l='<div class="retold-remote-viewer">';l+='<div class="retold-remote-viewer-header">',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].closeViewer()" title="Back (Esc)">← Back</button>',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].prevFile()" title="Previous (k)">‹ Prev</button>',l+='<div class="retold-remote-viewer-title">'+s+"</div>",l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].nextFile()" title="Next (j)">Next ›</button>',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleFileInfo()" title="Info (i)">ⓘ</button>',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].toggleDistractionFree()" title="Distraction-Free (d)">▢</button>',l+="</div>",l+='<div class="retold-remote-viewer-body">',l+='<div class="retold-remote-df-exit-hotspot" id="RetoldRemote-DF-ExitHotspot"'+(n._distractionFreeMode?"":' style="display:none"')+"></div>",l+='<img id="RetoldRemote-ImageViewer-Img" src="'+t+'" alt="'+s+"\" style=\"max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in;\" onload=\"if (pict.views['RetoldRemote-ImageViewer']) pict.views['RetoldRemote-ImageViewer'].initImage();\" onclick=\"if (pict.views['RetoldRemote-ImageViewer']) pict.views['RetoldRemote-ImageViewer'].toggleZoom();\" />",l+='<div class="retold-remote-fileinfo-overlay" id="RetoldRemote-FileInfo-Overlay">',l+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Frame: '+s+"</span></div>",l+="</div>",l+="</div>",l+="</div>",a&&(a.innerHTML=l),this._setupSwipeNavigation(),this._setupDFExitHotspot();let d=this.pict.views["ContentEditor-TopBar"];d&&d.updateInfo()}_setupSwipeNavigation(){this._cleanupSwipe();let t=document.querySelector(".retold-remote-viewer-body");if(!t)return;let e=this,i=function(t){e._swipeTouchCount=t.touches.length,1===t.touches.length&&(e._swipeStartX=t.touches[0].clientX,e._swipeStartY=t.touches[0].clientY)},n=function(t){if(1!==e._swipeTouchCount)return;let i=t.changedTouches[0].clientX,n=t.changedTouches[0].clientY,o=i-e._swipeStartX,r=n-e._swipeStartY;if(Math.abs(o)<50||Math.abs(r)>Math.abs(o))return;let a=document.querySelector(".retold-remote-viewer-body");if(a&&a.scrollWidth>a.clientWidth+2)return;let s=e.pict.providers["RetoldRemote-GalleryNavigation"];s&&(o<0?s.nextFile():s.prevFile())};t.addEventListener("touchstart",i,{passive:!0}),t.addEventListener("touchend",n,{passive:!0}),this._swipeHandlers={element:t,touchstart:i,touchend:n}}_cleanupSwipe(){this._swipeHandlers&&(this._swipeHandlers.element.removeEventListener("touchstart",this._swipeHandlers.touchstart),this._swipeHandlers.element.removeEventListener("touchend",this._swipeHandlers.touchend),this._swipeHandlers=null)}toggleDistractionFree(){let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t._toggleDistractionFree(),this._updateDFControls()}_updateDFControls(){let t=this.pict.AppData.RetoldRemote._distractionFreeMode||!1,e=document.getElementById("RetoldRemote-DF-ExitHotspot");e&&(e.style.display=t?"":"none")}_setupDFExitHotspot(){this._cleanupDFExitHotspot();let t=document.getElementById("RetoldRemote-DF-ExitHotspot");if(!t)return;let e=this,i=function(){e.pict.AppData.RetoldRemote._distractionFreeMode&&e.toggleDistractionFree()},n=0,o=function(t){let i=Date.now();if(i-n<300){t.preventDefault(),e.pict.AppData.RetoldRemote._distractionFreeMode&&e.toggleDistractionFree(),n=0}else n=i};t.addEventListener("dblclick",i),t.addEventListener("touchend",o),this._dfExitHandlers={element:t,dblclick:i,touchend:o}}_cleanupDFExitHotspot(){this._dfExitHandlers&&(this._dfExitHandlers.element.removeEventListener("dblclick",this._dfExitHandlers.dblclick),this._dfExitHandlers.element.removeEventListener("touchend",this._dfExitHandlers.touchend),this._dfExitHandlers=null)}_buildImagePlaceholderHTML(t){return'<div id="RetoldRemote-ImagePlaceholder" style="display:flex;align-items:center;justify-content:center;height:100%;color:var(--retold-text-dim);font-size:0.85rem;">Loading '+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t)+"…</div>"}_probeAndShowImage(t,e,i){let n=this,o=this.pict.providers["RetoldRemote-Provider"],r=o?o._getPathParam(t):encodeURIComponent(t);fetch("/api/media/image-preview?path="+r).then(t=>t.json()).then(o=>{if(!o||!o.Success)return void n._insertImageTag(e,i,!1);if(Math.max(o.OrigWidth||0,o.OrigHeight||0)>8192){let e=n.pict.views["RetoldRemote-ImageExplorer"];if(e)return void e.showExplorer(t)}if(o.NeedsPreview&&o.CacheKey){let t="/api/media/image-preview-file/"+encodeURIComponent(o.CacheKey)+"/"+encodeURIComponent(o.OutputFilename);return void n._insertImageTag(t,i,!0,o.OrigWidth,o.OrigHeight)}n._insertImageTag(e,i,!1)}).catch(()=>{n._insertImageTag(e,i,!1)})}_insertImageTag(t,e,i,n,o){let r=document.getElementById("RetoldRemote-ImagePlaceholder");if(!r||!r.parentElement)return;let a=this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e),s=document.createDocumentFragment(),l=document.createElement("img");l.src=t,l.alt=a,l.id="RetoldRemote-ImageViewer-Img",l.style.cssText="max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in;",l.onload=function(){pict.views["RetoldRemote-ImageViewer"].initImage()},l.onclick=function(){pict.views["RetoldRemote-ImageViewer"].toggleZoom()},s.appendChild(l);let d=document.getElementById("RetoldRemote-HeaderExploreBtn");if(d&&(d.style.display=""),i&&n&&o){let t=document.createElement("div");t.id="RetoldRemote-LargeImageBadge",t.className="retold-remote-image-large-badge",t.textContent=n+" × "+o+" px (preview)",s.appendChild(t)}r.parentElement.replaceChild(s,r)}_buildImageHTML(t,e){return'<img src="'+t+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'" style="max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in;" id="RetoldRemote-ImageViewer-Img" onload="pict.views[\'RetoldRemote-ImageViewer\'].initImage()" onclick="pict.views[\'RetoldRemote-ImageViewer\'].toggleZoom()">'}_buildVideoHTML(t,e){let i=this.pict.AppData.RetoldRemote.ServerCapabilities||{},n=(this.pict.AppData.RetoldRemote.CurrentViewerFile,'<div class="retold-remote-video-action-menu" id="RetoldRemote-VideoActionMenu">');return n+='<div class="retold-remote-video-action-menu-title">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+"</div>",i.ffmpeg&&(n+='<div id="RetoldRemote-VideoActionThumb" class="retold-remote-video-action-thumb-wrap"></div>',setTimeout(()=>{this.loadVideoMenuFrame()},0)),i.ffmpeg&&(n+='<button class="retold-remote-video-action-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore frames from this video"><span class="retold-remote-video-action-key">e</span>Explore Video Frames</button>'),n+='<button class="retold-remote-video-action-btn selected" onclick="pict.views[\'RetoldRemote-MediaViewer\'].playVideo()" title="Play video in browser"><span class="retold-remote-video-action-key">Space</span>Play in Browser</button>',i.ffmpeg&&(n+='<button class="retold-remote-video-action-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].loadVideoMenuFrame()" title="Extract a frame from the midpoint of this video"><span class="retold-remote-video-action-key">t</span>Thumbnail</button>'),n+='<button class="retold-remote-video-action-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream to VLC on this device"><span class="retold-remote-video-action-key">v</span>Stream with VLC</button>',n+="</div>",n}playVideo(){let t=this.pict.AppData.RetoldRemote,e=t.CurrentViewerFile;if(!e)return;e.replace(/^.*\//,"");let i=this.pict.providers["RetoldRemote-Provider"],n=i?i.getContentURL(e):"/content/"+encodeURIComponent(e),o=t.ServerCapabilities||{},r='<div class="retold-remote-video-wrap">';r+="<video controls"+(t.AutoplayVideo?" autoplay":"")+' preload="metadata" id="RetoldRemote-VideoPlayer"><source src="'+n+'">Your browser does not support the video tag.</video>',r+='<div class="retold-remote-video-stats" id="RetoldRemote-VideoStats">',r+='<span class="retold-remote-video-stat-label">Loading info...</span>',o.ffmpeg&&(r+='<button class="retold-remote-explore-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore frames from this video">Explore Video</button>'),r+='<button class="retold-remote-vlc-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream to VLC on this device">Stream with VLC</button>',r+="</div>",r+="</div>";let a=document.getElementById("RetoldRemote-VideoActionMenu");a&&(a.outerHTML=r),t.VideoMenuActive=!1}loadVideoMenuFrame(){let t=this.pict.AppData.RetoldRemote,e=t.CurrentViewerFile;if(!e)return;let i=document.getElementById("RetoldRemote-VideoActionThumb");if(!i)return;i.innerHTML='<div class="retold-remote-video-action-thumb-loading">Extracting frame...</div>';let n=this.pict.providers["RetoldRemote-Provider"],o=n?n._getPathParam(e):encodeURIComponent(e);fetch("/api/media/video-frames?path="+o+"&count=1").then(t=>t.json()).then(i=>{if(t.CurrentViewerFile!==e)return;let n=document.getElementById("RetoldRemote-VideoActionThumb");if(n)if(i&&i.Frames&&i.Frames.length>0){let t=i.Frames[0],o="/api/media/video-frame/"+i.CacheKey+"/"+t.Filename;n.innerHTML='<img src="'+o+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e.replace(/^.*\//,""))+'" onerror="this.parentNode.innerHTML=\'\'">'}else n.innerHTML=""}).catch(()=>{let t=document.getElementById("RetoldRemote-VideoActionThumb");t&&(t.innerHTML="")})}_buildAudioHTML(t,e){let i=this.pict.providers["RetoldRemote-Icons"],n='<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(i?'<span class="retold-remote-icon retold-remote-icon-lg">'+i.getIcon("music-note",64)+"</span>":"🎵")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+"</div><audio controls"+(this.pict.AppData.RetoldRemote.AutoplayAudio?" autoplay":"")+' preload="metadata" id="RetoldRemote-AudioPlayer" style="width: 100%; max-width: 500px;"><source src="'+t+'">Your browser does not support the audio tag.</audio>';n+='<div style="margin-top: 20px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;">';let o=this.pict.AppData.RetoldRemote.ServerCapabilities||{};return(o.ffprobe||o.ffmpeg)&&(n+='<button class="retold-remote-explore-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore waveform and extract segments from this audio">Explore Audio</button>'),n+='<button class="retold-remote-vlc-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream to VLC on this device (v)">Stream with VLC</button>',n+="</div>",n+="</div>",n}_buildDocumentHTML(t,e,i){let n=i.replace(/^.*\./,"").toLowerCase();if("pdf"===n)return this._buildPdfHTML(t,e,i);if("epub"===n||"mobi"===n)return this._buildEbookHTML(t,e,i);if({doc:!0,docx:!0,rtf:!0,odt:!0,wpd:!0,wps:!0,pages:!0,odp:!0,ppt:!0,pptx:!0,ods:!0,xls:!0,xlsx:!0}[n])return this._buildPdfHTML(t,e,i);let o=this.pict.providers["RetoldRemote-Icons"];return'<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(o?'<span class="retold-remote-icon retold-remote-icon-lg">'+o.getIcon("document-large",64)+"</span>":"📄")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'</div><a href="'+t+'" target="_blank" style="color: var(--retold-accent); font-size: 0.9rem;">Open in new tab</a></div>'}_loadConvertedDocumentViewer(t){let e=this,i=this.pict.providers["RetoldRemote-Provider"],n=i?i._getPathParam(t):encodeURIComponent(t),o=document.getElementById("RetoldRemote-PdfContent");o&&(o.innerHTML='<div style="text-align:center;padding:40px;color:var(--retold-text-dim);"><div style="font-size:1.5rem;margin-bottom:12px;">⚙</div>Converting document to PDF…</div>'),fetch("/api/media/doc-convert?path="+n).then(t=>t.json()).then(i=>{if(!i||!i.Success)throw new Error(i?i.Error:"Conversion failed.");let n="/api/media/ebook/"+i.CacheKey+"/"+i.OutputFilename;e._loadPdfViewer(n,t)}).catch(n=>{if(o){let r=e.pict.providers["RetoldRemote-FormattingUtilities"];o.innerHTML='<div style="text-align:center;padding:40px;color:var(--retold-text-dim);"><div style="margin-bottom:12px;color:#e06c75;">Conversion failed</div><div style="font-size:0.85rem;">'+r.escapeHTML(n.message)+'</div><div style="margin-top:16px;"><a href="'+(i?i.getContentURL(t):"/content/"+encodeURIComponent(t))+'" target="_blank" style="color:var(--retold-accent);font-size:0.85rem;">Download original file</a></div></div>'}})}_buildFallbackHTML(t,e){let i=this.pict.providers["RetoldRemote-Icons"];return'<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(i?'<span class="retold-remote-icon retold-remote-icon-lg">'+i.getIcon("document-large",64)+"</span>":"📄")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'</div><a href="'+t+'" target="_blank" style="color: var(--retold-accent); font-size: 0.9rem;">Download / Open in new tab</a></div>'}_loadFileInfo(t){let e=this,i=this.pict.providers["RetoldRemote-Provider"];i&&i.fetchMediaProbe(t,(t,i)=>{if(!i)return;let n=document.getElementById("RetoldRemote-FileInfo-Overlay");if(n){let t="";if(void 0!==i.Size&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Size</span><span class="retold-remote-fileinfo-value">'+e.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(i.Size)+"</span></div>"),i.Width&&i.Height&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Dimensions</span><span class="retold-remote-fileinfo-value">'+i.Width+" x "+i.Height+"</span></div>"),i.Duration){let e=Math.floor(i.Duration/60),n=Math.floor(i.Duration%60);t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Duration</span><span class="retold-remote-fileinfo-value">'+e+":"+(n<10?"0":"")+n+"</span></div>"}i.Codec&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Codec</span><span class="retold-remote-fileinfo-value">'+i.Codec+"</span></div>"),i.Format&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Format</span><span class="retold-remote-fileinfo-value">'+i.Format+"</span></div>"),i.Modified&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Modified</span><span class="retold-remote-fileinfo-value">'+new Date(i.Modified).toLocaleString()+"</span></div>"),i.Path&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Path</span><span class="retold-remote-fileinfo-value">'+i.Path+"</span></div>"),n.innerHTML=t}let o=document.getElementById("RetoldRemote-VideoStats");if(o){let t="";if(i.Duration){let e=Math.floor(i.Duration/60),n=Math.floor(i.Duration%60);t+='<span><span class="retold-remote-video-stat-label">Duration</span> <span class="retold-remote-video-stat-value">'+e+":"+(n<10?"0":"")+n+"</span></span>"}if(i.Width&&i.Height&&(t+='<span><span class="retold-remote-video-stat-label">Resolution</span> <span class="retold-remote-video-stat-value">'+i.Width+"×"+i.Height+"</span></span>"),i.Codec&&(t+='<span><span class="retold-remote-video-stat-label">Codec</span> <span class="retold-remote-video-stat-value">'+i.Codec+"</span></span>"),i.Bitrate){let e,n=i.Bitrate;e=n>=1e6?(n/1e6).toFixed(1)+" Mbps":n>=1e3?Math.round(n/1e3)+" kbps":n+" bps",t+='<span><span class="retold-remote-video-stat-label">Bitrate</span> <span class="retold-remote-video-stat-value">'+e+"</span></span>"}void 0!==i.Size&&(t+='<span><span class="retold-remote-video-stat-label">Size</span> <span class="retold-remote-video-stat-value">'+e.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(i.Size)+"</span></span>");let n=o.querySelector(".retold-remote-explore-btn"),r=n?n.outerHTML:"",a=o.querySelector(".retold-remote-vlc-btn"),s=a?a.outerHTML:"";o.innerHTML=t+r+s}})}}Object.assign(l.prototype,o),Object.assign(l.prototype,r),Object.assign(l.prototype,a),l.default_configuration=s,e.exports=l},{"./MediaViewer-CodeViewer":152,"./MediaViewer-EbookViewer":153,"./MediaViewer-PdfViewer":154,"pict-view":102}],163:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"RetoldRemote-RegionsBrowser",DefaultRenderable:"RetoldRemote-RegionsBrowser",DefaultDestinationAddress:"#RetoldRemote-RegionsBrowser-Overlay",AutoRender:!1,CSS:"\n\t\t#RetoldRemote-RegionsBrowser-Overlay\n\t\t{\n\t\t\tposition: fixed;\n\t\t\ttop: 0; left: 0; right: 0; bottom: 0;\n\t\t\tbackground: rgba(0, 0, 0, 0.85);\n\t\t\tz-index: 10000;\n\t\t\tdisplay: none;\n\t\t\tflex-direction: column;\n\t\t}\n\t\t#RetoldRemote-RegionsBrowser-Overlay.active { display: flex; }\n\t\t.rrrb-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 8px 14px;\n\t\t\tbackground: var(--retold-bg-panel, #282c34);\n\t\t\tborder-bottom: 1px solid var(--retold-border, #3e4451);\n\t\t\tcolor: var(--retold-text, #abb2bf);\n\t\t}\n\t\t.rrrb-header-title\n\t\t{\n\t\t\tfont-size: 0.95rem;\n\t\t\tfont-weight: 600;\n\t\t\tflex: 1;\n\t\t}\n\t\t.rrrb-header button\n\t\t{\n\t\t\tbackground: var(--retold-bg-input, #1e1e1e);\n\t\t\tcolor: var(--retold-text, #abb2bf);\n\t\t\tborder: 1px solid var(--retold-border, #3e4451);\n\t\t\tborder-radius: 4px;\n\t\t\tpadding: 4px 10px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.rrrb-body\n\t\t{\n\t\t\tflex: 1;\n\t\t\tdisplay: flex;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.rrrb-tree\n\t\t{\n\t\t\twidth: 260px;\n\t\t\toverflow-y: auto;\n\t\t\tbackground: var(--retold-bg-panel, #21252b);\n\t\t\tborder-right: 1px solid var(--retold-border, #3e4451);\n\t\t\tpadding: 8px 0;\n\t\t}\n\t\t.rrrb-tree-node\n\t\t{\n\t\t\tpadding: 5px 14px;\n\t\t\tcolor: var(--retold-text, #abb2bf);\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.82rem;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.rrrb-tree-node:hover { background: var(--retold-bg-hover, rgba(255,255,255,0.05)); }\n\t\t.rrrb-tree-node.active\n\t\t{\n\t\t\tbackground: var(--retold-accent, rgba(97,175,239,0.15));\n\t\t\tcolor: var(--retold-text-bright, #e0e0e0);\n\t\t\tfont-weight: 600;\n\t\t}\n\t\t.rrrb-tree-count\n\t\t{\n\t\t\tcolor: var(--retold-text-dim, #707880);\n\t\t\tfont-size: 0.72rem;\n\t\t\tmargin-left: 4px;\n\t\t}\n\t\t.rrrb-list\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tbackground: var(--retold-bg, #181a1f);\n\t\t\tpadding: 8px 14px;\n\t\t}\n\t\t.rrrb-list-empty\n\t\t{\n\t\t\tcolor: var(--retold-text-dim, #707880);\n\t\t\ttext-align: center;\n\t\t\tpadding: 40px 20px;\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t\t.rrrb-file-group\n\t\t{\n\t\t\tmargin-bottom: 16px;\n\t\t\tborder: 1px solid var(--retold-border, #3e4451);\n\t\t\tborder-radius: 6px;\n\t\t\tbackground: var(--retold-bg-panel, #21252b);\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.rrrb-file-header\n\t\t{\n\t\t\tpadding: 8px 12px;\n\t\t\tbackground: var(--retold-bg-panel-alt, #282c34);\n\t\t\tcolor: var(--retold-text, #abb2bf);\n\t\t\tfont-size: 0.82rem;\n\t\t\tfont-weight: 600;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t}\n\t\t.rrrb-file-name\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.rrrb-file-count\n\t\t{\n\t\t\tcolor: var(--retold-text-dim, #707880);\n\t\t\tfont-size: 0.72rem;\n\t\t}\n\t\t.rrrb-regions\n\t\t{\n\t\t\tpadding: 6px 12px 10px 12px;\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tgap: 6px;\n\t\t}\n\t\t.rrrb-region\n\t\t{\n\t\t\tbackground: var(--retold-bg-input, #1e1e1e);\n\t\t\tborder: 1px solid var(--retold-border, #3e4451);\n\t\t\tborder-radius: 4px;\n\t\t\tpadding: 5px 10px;\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text, #abb2bf);\n\t\t\tcursor: pointer;\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 6px;\n\t\t}\n\t\t.rrrb-region:hover { background: var(--retold-bg-hover, rgba(255,255,255,0.08)); border-color: var(--retold-accent, #61afef); }\n\t\t.rrrb-region-label { font-weight: 600; }\n\t\t.rrrb-region-dims { color: var(--retold-text-dim, #707880); font-size: 0.68rem; }\n\t",Templates:[{Hash:"RetoldRemote-RegionsBrowser",Template:'\n\t\t\t\t<div id="RetoldRemote-RegionsBrowser-Overlay">\n\t\t\t\t\t<div class="rrrb-header">\n\t\t\t\t\t\t<div class="rrrb-header-title" id="RetoldRemote-RegionsBrowser-Title">Regions Browser</div>\n\t\t\t\t\t\t<button onclick="pict.views[\'RetoldRemote-RegionsBrowser\'].refresh()" title="Reload">↻ Reload</button>\n\t\t\t\t\t\t<button onclick="pict.views[\'RetoldRemote-RegionsBrowser\'].close()" title="Close (Esc)">✕ Close</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="rrrb-body">\n\t\t\t\t\t\t<div class="rrrb-tree" id="RetoldRemote-RegionsBrowser-Tree"></div>\n\t\t\t\t\t\t<div class="rrrb-list" id="RetoldRemote-RegionsBrowser-List"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t'}],Renderables:[{RenderableHash:"RetoldRemote-RegionsBrowser",TemplateHash:"RetoldRemote-RegionsBrowser",DestinationAddress:"#RetoldRemote-RegionsBrowser-Container"}]};class r extends n{constructor(t,e,i){super(t,e,i),this._allFiles=[],this._selectedFolder="",this._keyHandler=null}open(){this._ensureOverlayContainer(),this.render();let t=document.getElementById("RetoldRemote-RegionsBrowser-Overlay");t&&t.classList.add("active");this.pict.AppData.RetoldRemote;let e=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"";this._selectedFolder=e.replace(/\/+$/,"").replace(/^\/+/,"");let i=this;this._keyHandler=function(t){"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),i.close())},document.addEventListener("keydown",this._keyHandler,!0),this._fetchRegions()}close(){let t=document.getElementById("RetoldRemote-RegionsBrowser-Overlay");t&&t.classList.remove("active"),this._keyHandler&&(document.removeEventListener("keydown",this._keyHandler,!0),this._keyHandler=null)}refresh(){this._fetchRegions()}_ensureOverlayContainer(){let t=document.getElementById("RetoldRemote-RegionsBrowser-Container");t||(t=document.createElement("div"),t.id="RetoldRemote-RegionsBrowser-Container",document.body.appendChild(t))}_fetchRegions(){let t=this,e=document.getElementById("RetoldRemote-RegionsBrowser-List"),i=document.getElementById("RetoldRemote-RegionsBrowser-Tree");e&&(e.innerHTML='<div class="rrrb-list-empty">Loading…</div>'),i&&(i.innerHTML=""),fetch("/api/media/subimage-regions?folder=").then(t=>t.json()).then(e=>{if(!e||!e.Success||!Array.isArray(e.Files))return t._allFiles=[],t._renderTree(),void t._renderList();t._allFiles=e.Files,t._renderTree(),t._renderList()}).catch(t=>{e&&(e.innerHTML='<div class="rrrb-list-empty">Failed to load: '+(t&&t.message?t.message:"unknown error")+"</div>")})}_renderTree(){let t=document.getElementById("RetoldRemote-RegionsBrowser-Tree");if(!t)return;let e={"":0};for(let t=0;t<this._allFiles.length;t++){let i=this._allFiles[t],n=Array.isArray(i.Regions)?i.Regions.length:0;e[""]+=n;let o=(i.Path||"").split("/");o.pop();let r="";for(let t=0;t<o.length;t++)r=r?r+"/"+o[t]:o[t],e[r]=(e[r]||0)+n}let i=Object.keys(e);i.sort();let n=this.pict.providers["RetoldRemote-FormattingUtilities"],o="";o+='<div class="rrrb-tree-node'+(""===this._selectedFolder?" active":"")+"\" onclick=\"pict.views['RetoldRemote-RegionsBrowser'].selectFolder('')\">",o+="📁 <em>All folders</em>",o+='<span class="rrrb-tree-count">('+e[""]+")</span>",o+="</div>";for(let t=0;t<i.length;t++){let r=i[t];if(""===r)continue;let a=r.split("/").length,s=r.split("/").pop();o+='<div class="rrrb-tree-node'+(this._selectedFolder===r?" active":"")+'" style="'+("padding-left:"+(14+14*(a-1))+"px;")+"\" onclick=\"pict.views['RetoldRemote-RegionsBrowser'].selectFolder('"+r.replace(/'/g,"\\'")+"')\">",o+="📁 "+n.escapeHTML(s),o+='<span class="rrrb-tree-count">('+e[r]+")</span>",o+="</div>"}t.innerHTML=o}_renderList(){let t=document.getElementById("RetoldRemote-RegionsBrowser-List");if(!t)return;let e=this.pict.providers["RetoldRemote-FormattingUtilities"],i=this._selectedFolder||"",n=[];for(let t=0;t<this._allFiles.length;t++){let e=this._allFiles[t];e&&e.Path&&(""!==i&&e.Path!==i&&0!==e.Path.indexOf(i+"/")||n.push(e))}let o=document.getElementById("RetoldRemote-RegionsBrowser-Title");if(o){let t=i||"All folders",e=0;for(let t=0;t<n.length;t++)e+=(n[t].Regions||[]).length;o.textContent="Regions Browser — "+t+" ("+e+" region"+(1===e?"":"s")+" in "+n.length+" file"+(1===n.length?"":"s")+")"}if(0===n.length)return void(t.innerHTML='<div class="rrrb-list-empty">No regions in this folder yet.</div>');let r="";for(let t=0;t<n.length;t++){let i=n[t],o=(i.Path||"").replace(/^.*\//,""),a=i.Regions||[];r+='<div class="rrrb-file-group">',r+='<div class="rrrb-file-header">',r+='<span class="rrrb-file-name" title="'+e.escapeHTML(i.Path)+'">'+e.escapeHTML(o)+"</span>",r+='<span class="rrrb-file-count">'+a.length+" region"+(1===a.length?"":"s")+"</span>",r+="</div>",r+='<div class="rrrb-regions">';for(let t=0;t<a.length;t++){let n=a[t],o=n.Label||"(unlabeled)",s="";"number"==typeof n.Width&&"number"==typeof n.Height?s=n.Width+"×"+n.Height:n.PageNumber&&(s="p."+n.PageNumber),r+="<div class=\"rrrb-region\" onclick=\"pict.views['RetoldRemote-RegionsBrowser'].navigateTo('"+i.Path.replace(/'/g,"\\'")+"','"+n.ID+"')\">",r+='<span class="rrrb-region-label">'+e.escapeHTML(o)+"</span>",s&&(r+='<span class="rrrb-region-dims">'+e.escapeHTML(s)+"</span>"),r+="</div>"}r+="</div>",r+="</div>"}t.innerHTML=r}selectFolder(t){this._selectedFolder=t||"",this._renderTree(),this._renderList()}navigateTo(t,e){this.close();let i=this,n=t.split(".").pop().toLowerCase(),o=["jpg","jpeg","png","gif","bmp","webp","tiff","tif","svg"].indexOf(n)>=0;if(o){let n=this.pict.views["RetoldRemote-ImageExplorer"];if(n)return n.showExplorer(t),void setTimeout(function(){let t=i.pict.views["RetoldRemote-ImageExplorer"];t&&"function"==typeof t.zoomToRegion&&t.zoomToRegion(e)},900)}let r=this.pict.views["RetoldRemote-MediaViewer"];r&&(r.showMedia(t,o?"image":"document"),setTimeout(function(){let t=i.pict.views["RetoldRemote-SubimagesPanel"];t&&"function"==typeof t.navigateToRegion&&t.navigateToRegion(e)},900))}}r.default_configuration=o,e.exports=r},{"pict-view":102}],164:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"RetoldRemote-SettingsPanel",DefaultRenderable:"RetoldRemote-SettingsPanel",DefaultDestinationAddress:"#RetoldRemote-Settings-Container",AutoRender:!1,CSS:""};class r extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(){super.onAfterRender(),this._renderSettingsContent()}_renderSettingsContent(){let t=document.getElementById("RetoldRemote-Settings-Container");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=e.ServerCapabilities||{},n='<div class="retold-remote-settings">';n+='<div class="retold-remote-settings-section">',n+='<div class="retold-remote-settings-section-title">Appearance</div>',n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Theme</span>',n+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeTheme(this.value)">';let o=this.pict.providers["RetoldRemote-Theme"];if(o){let t=o.getThemeList(),e=o.getCurrentTheme(),i="";for(let o=0;o<t.length;o++){let r=t[o];r.category!==i&&(i&&(n+="</optgroup>"),n+='<optgroup label="'+r.category+'">',i=r.category),n+='<option value="'+r.key+'"'+(r.key===e?" selected":"")+">"+r.name+"</option>"}i&&(n+="</optgroup>")}n+="</select>",n+="</div>",n+="</div>",n+='<div class="retold-remote-settings-section">',n+='<div class="retold-remote-settings-section-title">Gallery</div>',n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">View mode</span>',n+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeSetting('ViewMode', this.value)\">",n+='<option value="gallery"'+("gallery"===e.ViewMode?" selected":"")+">Grid</option>",n+='<option value="list"'+("list"===e.ViewMode?" selected":"")+">List</option>",n+="</select>",n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Thumbnail size</span>',n+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeSetting('ThumbnailSize', this.value)\">",n+='<option value="small"'+("small"===e.ThumbnailSize?" selected":"")+">Small</option>",n+='<option value="medium"'+("medium"===e.ThumbnailSize?" selected":"")+">Medium</option>",n+='<option value="large"'+("large"===e.ThumbnailSize?" selected":"")+">Large</option>",n+="</select>",n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Sort by</span>',n+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeSortField(this.value)">',n+='<option value="folder-first"'+("folder-first"===e.SortField?" selected":"")+">Folders first</option>",n+='<option value="name"'+("name"===e.SortField?" selected":"")+">Name</option>",n+='<option value="modified"'+("modified"===e.SortField?" selected":"")+">Modified</option>",n+='<option value="created"'+("created"===e.SortField?" selected":"")+">Created</option>",n+="</select>",n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Sort direction</span>',n+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeSortDirection(this.value)">',n+='<option value="asc"'+("asc"===e.SortDirection?" selected":"")+">Ascending</option>",n+='<option value="desc"'+("desc"===e.SortDirection?" selected":"")+">Descending</option>",n+="</select>",n+="</div>";let r=e.FilterState&&e.FilterState.MediaType||"all";n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Media filter</span>',n+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeMediaFilter(this.value)">',n+='<option value="all"'+("all"===r?" selected":"")+">All files</option>",n+='<option value="images"'+("images"===r?" selected":"")+">Images</option>",n+='<option value="video"'+("video"===r?" selected":"")+">Video</option>",n+='<option value="audio"'+("audio"===r?" selected":"")+">Audio</option>",n+='<option value="documents"'+("documents"===r?" selected":"")+">Documents</option>",n+="</select>",n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Show hidden files</span>',n+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.ShowHiddenFiles?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleHiddenFiles(this.checked)\">",n+="</div>",n+="</div>",n+='<div class="retold-remote-settings-section">',n+='<div class="retold-remote-settings-section-title">Viewer</div>',n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Image fit mode</span>',n+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeImageFitMode(this.value)">',n+='<option value="fit"'+("fit"===e.ImageFitMode?" selected":"")+">Fit to window</option>",n+='<option value="auto"'+("auto"===e.ImageFitMode?" selected":"")+">Original if smaller</option>",n+='<option value="original"'+("original"===e.ImageFitMode?" selected":"")+">Original size</option>",n+="</select>",n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Autoplay video</span>',n+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.AutoplayVideo?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleAutoplay('AutoplayVideo', this.checked)\">",n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Autoplay audio</span>',n+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.AutoplayAudio?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleAutoplay('AutoplayAudio', this.checked)\">",n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Nav bar in distraction-free</span>',n+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.DistractionFreeShowNav?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleDistractionFreeNav(this.checked)\">",n+="</div>",n+="</div>",n+='<div class="retold-remote-settings-section">',n+='<div class="retold-remote-settings-section-title">Server Capabilities</div>',n+='<div class="retold-remote-settings-capabilities">';let a="Sharp (image thumbnails)";i.sharpMode&&(a="Sharp / "+i.sharpMode+" (image thumbnails)");let s=[{key:"sharp",label:a},{key:"imagemagick",label:"ImageMagick (image fallback)"},{key:"ffmpeg",label:"ffmpeg (video thumbnails)"},{key:"ffprobe",label:"ffprobe (media metadata)"}];for(let t=0;t<s.length;t++){let e=s[t],o=i[e.key];n+='<div class="retold-remote-settings-cap-row">',n+='<span class="retold-remote-settings-cap-label">'+e.label+"</span>",n+='<span class="'+(o?"retold-remote-settings-cap-yes":"retold-remote-settings-cap-no")+'">'+(o?"Available":"Not found")+"</span>",n+="</div>"}n+='<div class="retold-remote-settings-cap-row" style="margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--retold-border);">',n+='<span class="retold-remote-settings-cap-label">Hashed filenames</span>',n+='<span class="'+(e.HashedFilenames?"retold-remote-settings-cap-yes":"retold-remote-settings-cap-no")+'">'+(e.HashedFilenames?"Enabled":"Disabled")+"</span>",n+="</div>",n+="</div>",n+="</div>",n+='<div class="retold-remote-settings-section">',n+='<div class="retold-remote-settings-section-title">AI File Sort</div>';let l=this.pict.providers["RetoldRemote-AISortManager"],d=e.AISortSettings||{AIEndpoint:"http://localhost:11434",AIModel:"llama3.1",AIProvider:"ollama",NamingTemplate:"{artist}/{album}/{track} - {title}"};n+='<div class="retold-remote-settings-input-row">',n+='<label class="retold-remote-settings-input-label">AI Endpoint URL</label>',n+='<input class="retold-remote-settings-input" type="text" id="RetoldRemote-AISortEndpoint" value="'+this._escapeAttr(d.AIEndpoint)+'" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeAISetting(\'AIEndpoint\', this.value)" placeholder="http://localhost:11434">',n+="</div>",n+='<div class="retold-remote-settings-input-row">',n+='<label class="retold-remote-settings-input-label">Model</label>',n+='<input class="retold-remote-settings-input" type="text" id="RetoldRemote-AISortModel" value="'+this._escapeAttr(d.AIModel)+'" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeAISetting(\'AIModel\', this.value)" placeholder="llama3.1">',n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Provider</span>',n+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeAISetting('AIProvider', this.value)\">",n+='<option value="ollama"'+("ollama"===d.AIProvider?" selected":"")+">Ollama</option>",n+='<option value="openai"'+("openai"===d.AIProvider?" selected":"")+">OpenAI-compatible</option>",n+="</select>",n+="</div>",n+='<div class="retold-remote-settings-input-row" style="margin-top: 8px;">',n+='<label class="retold-remote-settings-input-label">Naming Template</label>',n+='<input class="retold-remote-settings-input" type="text" id="RetoldRemote-AISortTemplate" value="'+this._escapeAttr(d.NamingTemplate)+'" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeAISetting(\'NamingTemplate\', this.value)" placeholder="{artist}/{album}/{track} - {title}">';let c=l?l.getTemplatePreview(d.NamingTemplate):"";c&&(n+='<div class="retold-remote-settings-template-preview">Preview: '+this._escapeHTML(c)+"</div>"),n+="</div>",n+='<button class="retold-remote-settings-vlc-btn" id="RetoldRemote-AISortTestBtn" onclick="pict.views[\'RetoldRemote-SettingsPanel\'].testAIConnection()" style="margin-top: 8px;">',n+="Test Connection",n+="</button>",n+="</div>",n+='<div class="retold-remote-settings-section">',n+='<div class="retold-remote-settings-section-title">VLC Streaming</div>',n+='<button class="retold-remote-settings-vlc-btn" onclick="pict.views[\'RetoldRemote-VLCSetup\'].openModal()">',n+="VLC Protocol Setup",n+="</button>",n+="</div>",n+='<div class="retold-remote-settings-section">',n+='<div class="retold-remote-settings-section-title">Help</div>',n+='<button class="retold-remote-settings-vlc-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleHelpPanel()">',n+="Help (F1)",n+="</button>",n+="</div>",n+="</div>",t.innerHTML=n}changeTheme(t){let e=this.pict.providers["RetoldRemote-Theme"];e&&(e.applyTheme(t),this.pict.PictApplication.saveSettings(),this._renderSettingsContent())}changeSetting(t,e){let i=this.pict.AppData.RetoldRemote;if(i[t]=e,this.pict.PictApplication.saveSettings(),"gallery"===i.ActiveMode){let t=this.pict.views["RetoldRemote-Gallery"];t&&t.renderGallery()}}toggleHiddenFiles(t){this.pict.AppData.RetoldRemote.ShowHiddenFiles=t,this.pict.PictApplication.saveSettings(),this.pict.PictApplication.syncHiddenFilesSetting(()=>{this.pict.PictApplication.loadFileList()})}toggleAutoplay(t,e){this.pict.AppData.RetoldRemote[t]=e,this.pict.PictApplication.saveSettings()}toggleDistractionFreeNav(t){let e=this.pict.AppData.RetoldRemote;if(e.DistractionFreeShowNav=t,this.pict.PictApplication.saveSettings(),e._distractionFreeMode){let e=document.querySelector(".retold-remote-viewer-header");e&&(e.style.display=t?"":"none")}}changeImageFitMode(t){let e=this.pict.views["RetoldRemote-ImageViewer"];if(e)e.setFitMode(t);else{this.pict.AppData.RetoldRemote.ImageFitMode=t,this.pict.PictApplication.saveSettings()}}changeSortField(t){this.pict.AppData.RetoldRemote.SortField=t,this.pict.PictApplication.saveSettings(),this._refilterGallery()}changeSortDirection(t){this.pict.AppData.RetoldRemote.SortDirection=t,this.pict.PictApplication.saveSettings(),this._refilterGallery()}changeMediaFilter(t){let e=this.pict.AppData.RetoldRemote;e.GalleryFilter=t,e.FilterState&&(e.FilterState.MediaType=t),this.pict.PictApplication.saveSettings(),this._refilterGallery()}changeAISetting(t,e){let i=this.pict.providers["RetoldRemote-AISortManager"];if(i){let n={};n[t]=e,i.updateSettings(n)}"NamingTemplate"===t&&this._renderSettingsContent()}testAIConnection(){let t=document.getElementById("RetoldRemote-AISortTestBtn");t&&(t.disabled=!0,t.textContent="Testing...");let e=this.pict.providers["RetoldRemote-AISortManager"];e&&e.testConnection()}_escapeAttr(t){return t?String(t).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"):""}_escapeHTML(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"):""}_refilterGallery(){let t=this.pict.AppData.RetoldRemote,e=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(e&&e.runFilterPipeline(),"gallery"===t.ActiveMode){let t=this.pict.views["RetoldRemote-Gallery"];t&&t.renderGallery()}}}r.default_configuration=o,e.exports=r},{"pict-view":102}],165:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"RetoldRemote-SubimagesPanel",DefaultRenderable:"RetoldRemote-SubimagesPanel",DefaultDestinationAddress:"#RetoldRemote-Subimages-Container",AutoRender:!1,CSS:""};class r extends n{constructor(t,e,i){super(t,e,i),this._regions=[],this._currentPath=""}render(){let t=document.getElementById("RetoldRemote-Subimages-Container");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=e.CurrentViewerFile;e.CurrentViewerMediaType;return i?i!==this._currentPath?(this._currentPath=i,void this._fetchAndRender(i,t)):void this._renderRegionList(t):(t.innerHTML='<div style="padding:12px;color:var(--retold-text-dim);font-size:0.82rem;">View a file to see its regions.</div>',this._regions=[],void(this._currentPath=""))}refresh(){this._currentPath="",this.render()}_fetchAndRender(t,e){let i=this,n=this.pict.providers["RetoldRemote-Provider"],o=n?n._getPathParam(t):encodeURIComponent(t);e.innerHTML='<div style="padding:12px;color:var(--retold-text-dim);font-size:0.82rem;">Loading…</div>',fetch("/api/media/subimage-regions?path="+o).then(t=>t.json()).then(t=>{t&&t.Success?i._regions=t.Regions||[]:i._regions=[],i._renderRegionList(e)}).catch(()=>{i._regions=[],i._renderRegionList(e)})}_renderRegionList(t){if(t||(t=document.getElementById("RetoldRemote-Subimages-Container")),!t)return;let e=this.pict.views["RetoldRemote-ImageExplorer"];e&&e._currentPath===this._currentPath&&(e._savedRegions=this._regions);let i=this.pict.providers["RetoldRemote-FormattingUtilities"],n=(this._currentPath||"").replace(/^.*\//,""),o='<div class="retold-remote-subimages-panel">';if(o+='<div style="padding:8px 10px;font-size:0.78rem;color:var(--retold-text-dim);border-bottom:1px solid var(--retold-border);">',o+=i.escapeHTML(n),o+=" — "+this._regions.length+" region"+(1!==this._regions.length?"s":""),o+="</div>",0===this._regions.length)o+='<div style="padding:16px 12px;color:var(--retold-text-dim);font-size:0.8rem;text-align:center;">',o+="No regions yet.<br>Use selection tools in the viewer to create regions.",o+="</div>";else for(let t=0;t<this._regions.length;t++){let e=this._regions[t],n=e.Label||"(unlabeled)",r="text-selection"===e.Type,a="";if(r){let t=(e.SelectedText||"").substring(0,60);(e.SelectedText||"").length>60&&(t+="…"),a=t||"(no text)",e.PageNumber?a="p."+e.PageNumber+" — "+a:e.ChapterTitle&&(a=e.ChapterTitle)}else a=(e.Width||0)+" × "+(e.Height||0)+" px",e.PageNumber?a="p."+e.PageNumber+" — "+a:null!==e.X&&null!==e.Y&&(a+=" at "+e.X+", "+e.Y);let s=r?"📝":"🔲";o+='<div class="retold-remote-subimages-item" data-region-id="'+e.ID+'">',o+='<div class="retold-remote-subimages-item-info">',o+='<div class="retold-remote-subimages-item-label">'+s+" "+i.escapeHTML(n)+"</div>",o+='<div class="retold-remote-subimages-item-dims">'+i.escapeHTML(a)+"</div>",o+="</div>",o+='<div class="retold-remote-subimages-item-actions">',o+="<button onclick=\"pict.views['RetoldRemote-SubimagesPanel'].navigateToRegion('"+e.ID+'\')" title="Navigate to region" style="font-size:0.7rem;padding:2px 6px;">🔎</button>',o+="<button onclick=\"pict.views['RetoldRemote-SubimagesPanel'].addRegionToCollection('"+e.ID+'\')" title="Add to collection" style="font-size:0.7rem;padding:2px 6px;">✚</button>',o+="<button onclick=\"pict.views['RetoldRemote-SubimagesPanel'].deleteRegion('"+e.ID+'\')" title="Delete region" style="font-size:0.7rem;padding:2px 6px;">🗑</button>',o+="</div>",o+="</div>"}o+="</div>",t.innerHTML=o}navigateToRegion(t){let e=null;for(let i=0;i<this._regions.length;i++)if(this._regions[i].ID===t){e=this._regions[i];break}if(!e)return;let i=this.pict.AppData.RetoldRemote,n=this.pict.views["RetoldRemote-MediaViewer"];if(e.CFI&&n&&n._activeRendition)return void n._activeRendition.display(e.CFI);if(e.PageNumber&&n&&"function"==typeof n._renderPdfPage)return void n._renderPdfPage(e.PageNumber);let o=this.pict.views["RetoldRemote-ImageExplorer"];"image-explorer"===i.ActiveMode&&o?o.zoomToRegion(t):o&&this._currentPath&&(o.showExplorer(this._currentPath),setTimeout(()=>{o.zoomToRegion(t)},800))}addRegionToCollection(t){let e=null;for(let i=0;i<this._regions.length;i++)if(this._regions[i].ID===t){e=this._regions[i];break}if(!e)return;let i=this.pict.providers["RetoldRemote-CollectionManager"];if(i){let t=i.getQuickAddTargetGUID();if(t)i.addSubimageToCollection(t,e,this._currentPath);else{let t=this.pict.views["ContentEditor-TopBar"];t&&"function"==typeof t.showAddToCollectionDropdown&&t.showAddToCollectionDropdown()}}}deleteRegion(t){let e=this.pict.views["RetoldRemote-ImageExplorer"];if(e&&e._currentPath===this._currentPath)e.deleteRegion(t);else{let e=this,i=this.pict.providers["RetoldRemote-Provider"],n=i?i._getPathParam(this._currentPath):encodeURIComponent(this._currentPath);fetch("/api/media/subimage-regions/"+encodeURIComponent(t)+"?path="+n,{method:"DELETE"}).then(t=>t.json()).then(t=>{if(t&&t.Success){e._regions=t.Regions||[],e._renderRegionList();let i=e.pict.providers["RetoldRemote-ToastNotification"];i&&i.showToast("Region deleted")}}).catch(()=>{})}}}r.default_configuration=o,e.exports=r},{"pict-view":102}],166:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"ContentEditor-TopBar",DefaultRenderable:"RetoldRemote-TopBar",DefaultDestinationAddress:"#ContentEditor-TopBar-Container",AutoRender:!1,CSS:"",Templates:[{Hash:"RetoldRemote-TopBar",Template:'\n\t\t\t\t<div class="retold-remote-topbar">\n\t\t\t\t\t<button class="retold-remote-topbar-sidebar-toggle" id="RetoldRemote-TopBar-SidebarToggle" onclick="pict.views[\'ContentEditor-Layout\'].toggleSidebar()" title="Toggle Sidebar"></button>\n\t\t\t\t\t<button class="retold-remote-topbar-df-toggle" id="RetoldRemote-TopBar-DFToggle" onclick="pict.views[\'ContentEditor-TopBar\'].toggleDistractionFree()" title="Distraction-free mode (d)"></button>\n\t\t\t\t\t<div class="retold-remote-topbar-location" id="RetoldRemote-TopBar-Location"></div>\n\t\t\t\t\t<div class="retold-remote-topbar-info" id="RetoldRemote-TopBar-Info"></div>\n\t\t\t\t\t<div class="retold-remote-topbar-actions">\n\t\t\t\t\t\t<button class="retold-remote-topbar-aisort-btn" id="RetoldRemote-TopBar-AISortBtn" onclick="pict.views[\'ContentEditor-TopBar\'].triggerAISort()" title="AI Sort (generate sort plan for current folder)" style="display:none;">Ai</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-btn retold-remote-topbar-regions-btn" id="RetoldRemote-TopBar-RegionsBtn" onclick="pict.views[\'RetoldRemote-RegionsBrowser\'] && pict.views[\'RetoldRemote-RegionsBrowser\'].open()" title="Browse all regions by folder">▣</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-btn retold-remote-topbar-addcoll-btn" id="RetoldRemote-TopBar-AddToCollectionBtn" onclick="pict.views[\'ContentEditor-TopBar\'].addToCollection(event)" title="Add to collection">★</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-btn retold-remote-topbar-favorites-btn" id="RetoldRemote-TopBar-FavoritesBtn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleFavorite()" title="Toggle favorite (h)">♡</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-sidebar-toggle retold-remote-topbar-collections-btn" id="RetoldRemote-TopBar-CollectionsBtn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleCollections()" title="Toggle Collections panel (b)">★</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-filter-btn" id="RetoldRemote-TopBar-FilterBtn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleFilterBar()" title="Toggle filter bar (/)">◢</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t'}],Renderables:[{RenderableHash:"RetoldRemote-TopBar",TemplateHash:"RetoldRemote-TopBar",DestinationAddress:"#ContentEditor-TopBar-Container"}]};class r extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(){super.onAfterRender(),this.updateSidebarToggleIcon(),this.updateDFToggleIcon(),this.updateLocation(),this.updateInfo(),this.updateFavoritesIcon()}updateSidebarToggleIcon(){let t=document.getElementById("RetoldRemote-TopBar-SidebarToggle");if(!t)return;let e=this.pict.providers["RetoldRemote-Icons"];t.innerHTML=e?e.getIcon("sidebar",18):"☰"}updateDFToggleIcon(){let t=document.getElementById("RetoldRemote-TopBar-DFToggle");t&&(t.innerHTML='<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 3 21 3 21 9" /><polyline points="9 21 3 21 3 15" /><polyline points="21 15 21 21 15 21" /><polyline points="3 9 3 3 9 3" /></svg>')}toggleDistractionFree(){let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t._toggleDistractionFree&&t._toggleDistractionFree()}updateLocation(){let t=document.getElementById("RetoldRemote-TopBar-Location");if(!t)return;this.pict.AppData.RetoldRemote;let e=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",i=this.pict.providers["RetoldRemote-Icons"],n=i?i.getIcon("home",16):"/",o=e?e.split("/").filter(t=>t):[],r="";if(o.length>0){let t=i?i.getIcon("folder",16):"",e=i?i.getIcon("home",16):"/";for(let e=o.length-2;e>=0;e--){let i=o.slice(0,e+1).join("/"),n=o[e]+"/",a="";e>0&&(a="/"+o.slice(0,e).join("/")+"/"),r+='<button class="retold-remote-topbar-overflow-item" onclick="pict.PictApplication.loadFileList(\''+i+"'); pict.views['ContentEditor-TopBar'].closeBreadcrumbDropdown();\">",r+='<span class="retold-remote-topbar-overflow-item-icon">'+t+"</span>",r+=a?'<span class="retold-remote-topbar-overflow-item-label"><span class="retold-remote-topbar-overflow-item-prefix">'+a+"</span>"+n+"</span>":'<span class="retold-remote-topbar-overflow-item-label">'+n+"</span>",r+="</button>"}r+="<button class=\"retold-remote-topbar-overflow-item\" onclick=\"pict.PictApplication.loadFileList(''); pict.views['ContentEditor-TopBar'].closeBreadcrumbDropdown();\">",r+='<span class="retold-remote-topbar-overflow-item-icon">'+e+"</span>",r+='<span class="retold-remote-topbar-overflow-item-label">Home</span>',r+="</button>"}let a="";if(a+='<span class="retold-remote-topbar-breadcrumb-overflow">',a+='<span class="retold-remote-topbar-home-crumb"',o.length>0?(a+=" onclick=\"pict.views['ContentEditor-TopBar'].toggleBreadcrumbDropdown()\"",a+=' title="Navigate to parent folders"'):a+=' title="Home"',a+=">"+n+"</span>",a+='<div class="retold-remote-topbar-overflow-dropdown" id="RetoldRemote-BreadcrumbDropdown">',a+=r,a+="</div>",a+="</span>",o.length>0){let t=o[o.length-1];a+='<span class="retold-remote-topbar-location-inner">',a+='<span class="retold-remote-topbar-sep">/</span>',a+='<span class="retold-remote-topbar-location-crumb" onclick="pict.PictApplication.loadFileList(\''+o.join("/")+"')\">"+t+"</span>",a+="</span>"}t.innerHTML=a}toggleBreadcrumbDropdown(){let t=document.getElementById("RetoldRemote-BreadcrumbDropdown");if(t)if(t.classList.contains("open"))this.closeBreadcrumbDropdown();else{t.classList.add("open");let e=this,i=function(n){if(t.contains(n.target))return;let o=t.parentElement&&t.parentElement.querySelector(".retold-remote-topbar-home-crumb");o&&o.contains(n.target)||(e.closeBreadcrumbDropdown(),document.removeEventListener("click",i,!0),document.removeEventListener("touchstart",i,!0))};setTimeout(function(){document.addEventListener("click",i,!0),document.addEventListener("touchstart",i,!0)},0),this._breadcrumbCloseHandler=i}}closeBreadcrumbDropdown(){let t=document.getElementById("RetoldRemote-BreadcrumbDropdown");t&&t.classList.remove("open"),this._breadcrumbCloseHandler&&(document.removeEventListener("click",this._breadcrumbCloseHandler,!0),document.removeEventListener("touchstart",this._breadcrumbCloseHandler,!0),this._breadcrumbCloseHandler=null)}toggleFilterBar(){let t=this.pict.AppData.RetoldRemote;t.FilterBarVisible=!t.FilterBarVisible,t.FilterBarVisible||(t.FilterPanelOpen=!1);let e=this.pict.views["RetoldRemote-Gallery"];e&&e.renderGallery(),this.updateFilterIcon(),t.FilterBarVisible&&setTimeout(()=>{let t=document.getElementById("RetoldRemote-Gallery-Search");t&&t.focus()},50)}updateFilterIcon(){let t=document.getElementById("RetoldRemote-TopBar-FilterBtn");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-GalleryFilterSort"],n=i?i.getActiveFilterChips().length:0,o=e.FilterBarVisible||!1;t.classList.remove("filter-active","filter-bar-open"),n>0?(t.classList.add("filter-active"),t.innerHTML='◓<span class="retold-remote-topbar-filter-badge">'+n+"</span>",t.title=n+" active filter"+(n>1?"s":"")+" (/)"):o?(t.classList.add("filter-bar-open"),t.innerHTML="◢",t.title="Hide filter bar (/)"):(t.innerHTML="◢",t.title="Toggle filter bar (/)")}updateInfo(){this.updateAISortButton();let t=document.getElementById("RetoldRemote-TopBar-Info");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=e.FolderSummary;if("viewer"===e.ActiveMode){let i=e.GalleryItems||[],n=e.GalleryCursorIndex||0,o=i[n];if(o){let e=n+1+"/"+i.length;t.innerHTML="<span>"+e+'</span><span class="retold-remote-topbar-info-sep retold-remote-topbar-info-priority-1"> · </span><span class="retold-remote-topbar-info-priority-1">'+this._escapeHTML(o.Name)+"</span>"}return}let n=e.GalleryItems||[],o=e.GalleryCursorIndex||0,r="";if(n.length>0&&(r=o+1+"/"+n.length),!i)return void(t.textContent=r);let a=[];i.Images>0&&a.push(i.Images+" images"),i.Videos>0&&a.push(i.Videos+" videos"),i.Audio>0&&a.push(i.Audio+" audio");let s=[];i.Folders>0&&s.push(i.Folders+" folders"),i.Documents>0&&s.push(i.Documents+" docs"),i.Other>0&&s.push(i.Other+" other");let l="";if(r&&(l+="<span>"+r+"</span>"),s.length>0){l+=(l?'<span class="retold-remote-topbar-info-sep retold-remote-topbar-info-priority-3"> · </span>':"")+'<span class="retold-remote-topbar-info-priority-3">'+s.join(" · ")+"</span>"}if(a.length>0){l+=(l?'<span class="retold-remote-topbar-info-sep retold-remote-topbar-info-priority-2"> · </span>':"")+'<span class="retold-remote-topbar-info-priority-2">'+a.join(" · ")+"</span>"}t.innerHTML=l||""}_escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"):""}triggerAISort(){let t=this.pict.providers["RetoldRemote-AISortManager"];if(!t)return;let e=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",i=document.getElementById("RetoldRemote-TopBar-AISortBtn");i&&(i.classList.add("generating"),i.textContent="..."),t.generateSortPlan(e,(t,e)=>{i&&(i.classList.remove("generating"),i.textContent="Ai")})}updateAISortButton(){let t=document.getElementById("RetoldRemote-TopBar-AISortBtn");if(!t)return;let e=this.pict.providers["RetoldRemote-AISortManager"];e&&e.isAvailable()?t.style.display="":t.style.display="none"}toggleCollections(){let t=this.pict.providers["RetoldRemote-CollectionManager"];t&&t.togglePanel()}updateCollectionsIcon(){let t=document.getElementById("RetoldRemote-TopBar-CollectionsBtn");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-Icons"],n=e.CollectionsPanelOpen,o=this.pict.views["ContentEditor-Layout"];if(o&&o.isMobileDrawer()){let t=document.querySelector(".content-editor-sidebar-tab.active");n=t&&"collections"===t.getAttribute("data-tab")}n?(t.classList.add("panel-open"),i&&"function"==typeof i.getIcon&&(t.innerHTML=i.getIcon("bookmark-filled",16))):(t.classList.remove("panel-open"),i&&"function"==typeof i.getIcon&&(t.innerHTML=i.getIcon("bookmark",16)))}toggleFavorite(){let t=this.pict.providers["RetoldRemote-CollectionManager"];t&&t.toggleFavorite()}updateFavoritesIcon(){let t=document.getElementById("RetoldRemote-TopBar-FavoritesBtn");if(!t)return;let e=this.pict.providers["RetoldRemote-CollectionManager"];e&&e.isFavorited()?(t.classList.add("is-favorited"),t.innerHTML="♥",t.title="Remove from favorites (h)"):(t.classList.remove("is-favorited"),t.innerHTML="♡",t.title="Add to favorites (h)")}addToCollection(t){this.pict.AppData.RetoldRemote;let e=this.pict.providers["RetoldRemote-CollectionManager"];if(!e)return;let i=e.getQuickAddTargetGUID();if(i){if(e.addCurrentFileToCollection(i))return}this.showAddToCollectionDropdown(t)}showAddToCollectionDropdown(t){let e=this,i=this.pict.AppData.RetoldRemote,n=this.pict.providers["RetoldRemote-CollectionManager"];this._closeAddToCollectionDropdown();let o=document.getElementById("RetoldRemote-TopBar-AddToCollectionBtn");o&&n.fetchCollections(()=>{let t=i.Collections||[],r=document.createElement("div");r.className="retold-remote-addcoll-dropdown",r.id="RetoldRemote-AddToCollection-Dropdown";let a=document.createElement("button");a.className="retold-remote-addcoll-dropdown-item retold-remote-addcoll-dropdown-new",a.textContent="+ New Collection...",a.onclick=()=>{e._closeAddToCollectionDropdown();let t=prompt("Collection name:");t&&t.trim()?n.createCollection(t.trim(),(t,e)=>{!t&&e&&n.addPendingOrCurrentToCollection(e.GUID)}):n.clearPendingClipContext()},r.appendChild(a);for(let i=0;i<t.length;i++){let o=t[i],a=document.createElement("button");a.className="retold-remote-addcoll-dropdown-item",a.textContent=o.Name||"Untitled",a.onclick=()=>{e._closeAddToCollectionDropdown(),n.addPendingOrCurrentToCollection(o.GUID)},r.appendChild(a)}o.style.position="relative",o.appendChild(r),setTimeout(()=>{document.addEventListener("click",e._boundCloseDropdown=t=>{r.contains(t.target)||t.target===o||e._closeAddToCollectionDropdown()})},10)})}_closeAddToCollectionDropdown(){let t=document.getElementById("RetoldRemote-AddToCollection-Dropdown");t&&t.remove(),this._boundCloseDropdown&&(document.removeEventListener("click",this._boundCloseDropdown),this._boundCloseDropdown=null);let e=this.pict.providers["RetoldRemote-CollectionManager"];e&&e.clearPendingClipContext()}}r.default_configuration=o,e.exports=r},{"pict-view":102}],167:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"RetoldRemote-VLCSetup",DefaultRenderable:"RetoldRemote-VLCSetup",DefaultDestinationAddress:"#ContentEditor-Application-Container",AutoRender:!1,CSS:""};class r extends n{constructor(t,e,i){super(t,e,i),this._activePlatformTab=this._detectPlatform(),this._modalVisible=!1,this._boundKeyHandler=null}_detectPlatform(){let t="undefined"!=typeof navigator?navigator.userAgent:"";return/iPhone|iPad|iPod/i.test(t)||/Macintosh/i.test(t)&&"undefined"!=typeof navigator&&navigator.maxTouchPoints>1?"ios":/Android/i.test(t)?"android":/Macintosh|Mac OS X/.test(t)?"macos":/Windows/.test(t)?"windows":"linux"}openModal(){if(this._modalVisible)return;this._modalVisible=!0;let t=document.createElement("div");t.className="retold-remote-vlc-modal-backdrop",t.id="RetoldRemote-VLCSetup-Backdrop",t.onclick=e=>{e.target===t&&this.closeModal()};let e=document.createElement("div");e.className="retold-remote-vlc-modal";let i=document.createElement("div");i.className="retold-remote-vlc-modal-header",i.innerHTML='<span class="retold-remote-vlc-modal-title">VLC Protocol Setup</span><button class="retold-remote-vlc-modal-close" onclick="pict.views[\'RetoldRemote-VLCSetup\'].closeModal()">X</button>';let n=document.createElement("div");n.className="retold-remote-vlc-modal-body",n.id="RetoldRemote-VLCSetup-Container",e.appendChild(i),e.appendChild(n),t.appendChild(e),document.body.appendChild(t),this._renderVLCSetupContent(),this._boundKeyHandler=t=>{"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),this.closeModal())},document.addEventListener("keydown",this._boundKeyHandler,!0)}closeModal(){if(!this._modalVisible)return;this._modalVisible=!1;let t=document.getElementById("RetoldRemote-VLCSetup-Backdrop");t&&t.remove(),this._boundKeyHandler&&(document.removeEventListener("keydown",this._boundKeyHandler,!0),this._boundKeyHandler=null)}switchPlatformTab(t){this._activePlatformTab=t,this._renderVLCSetupContent()}_renderVLCSetupContent(){let t=document.getElementById("RetoldRemote-VLCSetup-Container");if(!t)return;let e=this._activePlatformTab,i="";i+='<div class="retold-remote-vlc-setup-section">',i+='<div class="retold-remote-vlc-setup-desc">',i+="Stream media directly in VLC from the browser. Press <b>v</b> in the media viewer to launch VLC with the current file.",i+="</div>",i+="</div>",i+='<div class="retold-remote-vlc-setup-status">',i+='<div class="retold-remote-vlc-setup-status-dot '+(this._detectPlatform()===e?"detected":"unknown")+'"></div>',i+="<span>Detected platform: <b>"+this._getPlatformLabel(this._detectPlatform())+"</b></span>",i+="</div>",i+='<div class="retold-remote-vlc-setup-platform-tabs">',i+=this._buildPlatformTab("ios","iOS",e),i+=this._buildPlatformTab("android","Android",e),i+=this._buildPlatformTab("macos","macOS",e),i+=this._buildPlatformTab("windows","Windows",e),i+=this._buildPlatformTab("linux","Linux",e),i+="</div>",i+=this._buildIOSContent(e),i+=this._buildAndroidContent(e),i+=this._buildMacOSContent(e),i+=this._buildWindowsContent(e),i+=this._buildLinuxContent(e),i+='<div class="retold-remote-vlc-setup-section">',i+='<div class="retold-remote-vlc-setup-section-title">Test</div>',i+='<div class="retold-remote-vlc-setup-desc">',i+="Click below to test whether the vlc:// protocol handler is registered. VLC should open.",i+="</div>",i+='<button class="retold-remote-vlc-setup-btn" onclick="pict.views[\'RetoldRemote-VLCSetup\'].testProtocol()">Test VLC Protocol</button>',i+="</div>",t.innerHTML=i}_buildPlatformTab(t,e,i){let n="retold-remote-vlc-setup-platform-tab";return t===i&&(n+=" active"),'<button class="'+n+"\" onclick=\"pict.views['RetoldRemote-VLCSetup'].switchPlatformTab('"+t+"')\">"+e+"</button>"}_getPlatformLabel(t){return"ios"===t?"iOS":"android"===t?"Android":"macos"===t?"macOS":"windows"===t?"Windows":"Linux"}_buildIOSContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("ios"===t?" active":""))+'" data-platform="ios">';return e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (iOS)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="VLC for iOS registers the vlc:// protocol handler automatically when installed. No additional setup is needed.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Installation</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Install <b>VLC for Mobile</b> from the App Store if you haven\'t already.</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Tap the <b>Stream with VLC</b> button on any video or audio file. Safari will ask to open VLC — tap <b>Open</b>.</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">If Safari shows "Cannot Open Page", VLC may not be installed or may need to be updated.</div>',e+="</div>",e+="</div>",e}_buildAndroidContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("android"===t?" active":""))+'" data-platform="android">';return e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (Android)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="VLC for Android registers the vlc:// protocol handler automatically when installed. No additional setup is needed.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Installation</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Install <b>VLC for Android</b> from the Google Play Store if you haven\'t already.</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Tap the <b>Stream with VLC</b> button on any video or audio file. Your browser will ask to open VLC — tap <b>Open</b>.</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">If your browser shows an error, VLC may not be installed or may need to be updated.</div>',e+="</div>",e+="</div>",e}_buildMacOSContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("macos"===t?" active":""))+'" data-platform="macos">';e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (macOS)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="VLC on macOS does not register a vlc:// protocol handler by default. ",e+="An AppleScript app bundle is needed to bridge vlc:// links to VLC. ",e+="Run the command below in Terminal to create and register the handler automatically.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Automatic Setup</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Copy and paste this into Terminal:",e+="</div>";let i=this._getMacSetupScript();return e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyMacSetup()">Copy to Clipboard</button>',e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">What This Does</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Creates an AppleScript at <code>/tmp/VLCProtocol.applescript</code> that handles vlc:// URLs</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Compiles it into an app bundle at <code>/Applications/VLCProtocol.app</code></div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">3</div>',e+='<div class="retold-remote-vlc-setup-step-content">Adds the vlc:// URL scheme to the app\'s Info.plist</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">4</div>',e+='<div class="retold-remote-vlc-setup-step-content">Registers the protocol handler with macOS Launch Services</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">Requires VLC installed at /Applications/VLC.app and Python 3 (included with macOS).</div>',e+="</div>",e+="</div>",e}_buildWindowsContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("windows"===t?" active":""))+'" data-platform="windows">';e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (Windows)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Windows requires a protocol handler to open vlc:// links. ",e+="Choose one of the options below to register the handler.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Option A: Reinstall VLC</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Reinstall VLC and ensure "Register VLC as handler for vlc:// protocol" is checked during installation.</div>',e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Option B: Registry File</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Save this as <code>vlc-protocol.reg</code> and double-click to import. ",e+="Adjust the VLC path if yours differs.",e+="</div>";let i=this._getWindowsRegFile();e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyWindowsReg()">Copy to Clipboard</button>',e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Option C: Batch Script</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Alternatively, save this as <code>vlc-protocol-setup.bat</code> and run as Administrator. ",e+="This creates a handler script and registers the vlc:// protocol automatically.",e+="</div>";let n=this._getWindowsBatchScript();return e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(n)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyWindowsBatch()">Copy to Clipboard</button>',e+="</div>",e+="</div>",e}_buildLinuxContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("linux"===t?" active":""))+'" data-platform="linux">';e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (Linux)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Register a vlc:// protocol handler using a .desktop file and xdg-mime. ",e+="Run the command below in a terminal.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup Command</div>';let i=this._getLinuxSetupScript();return e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyLinuxSetup()">Copy to Clipboard</button>',e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">What This Does</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Creates a handler script at <code>~/.local/bin/vlc-protocol</code> that URL-decodes and opens VLC</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Creates a .desktop file at <code>~/.local/share/applications/vlc-protocol.desktop</code></div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">3</div>',e+='<div class="retold-remote-vlc-setup-step-content">Registers vlc:// as a URL scheme via <code>xdg-mime</code></div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">Requires VLC and Python 3 installed.</div>',e+="</div>",e+="</div>",e}_getMacSetupScript(){return["# Create the AppleScript handler","cat > /tmp/VLCProtocol.applescript << 'EOF'","on open location theURL","\tset theURL to text 7 thru -1 of theURL","\tset theURL to do shell script \"python3 -c 'import sys, urllib.parse; print(urllib.parse.unquote(sys.argv[1]))' \" & quoted form of theURL",'\tdo shell script "open -a VLC " & quoted form of theURL',"end open location","EOF","","# Compile into app bundle","osacompile -o /Applications/VLCProtocol.app /tmp/VLCProtocol.applescript","","# Add vlc:// URL scheme to Info.plist",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes array" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes:0 dict" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null","/usr/libexec/PlistBuddy -c \"Add :CFBundleURLTypes:0:CFBundleURLName string 'VLC Protocol'\" \\"," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes:0:CFBundleURLSchemes array" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes:0:CFBundleURLSchemes:0 string vlc" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null","","# Register with Launch Services","/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister \\"," -f /Applications/VLCProtocol.app","",'echo "VLC protocol handler installed successfully."'].join("\n")}_getWindowsRegFile(){return["Windows Registry Editor Version 5.00","","[HKEY_CLASSES_ROOT\\vlc]",'@="URL:VLC Protocol"','"URL Protocol"=""',"","[HKEY_CLASSES_ROOT\\vlc\\shell]","","[HKEY_CLASSES_ROOT\\vlc\\shell\\open]","","[HKEY_CLASSES_ROOT\\vlc\\shell\\open\\command]","@=\"powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command \\\"$u='%1'; if($u.StartsWith('vlc://')){$u=$u.Substring(6)}; $u=[System.Uri]::UnescapeDataString($u); $u=$u.TrimEnd('/'); Start-Process -FilePath 'C:\\\\Program Files\\\\VideoLAN\\\\VLC\\\\vlc.exe' -ArgumentList $u\\\"\""].join("\n")}_getWindowsBatchScript(){return["@echo off","REM VLC Protocol Handler Setup for Windows","REM Run this as Administrator","","REM Create the handler directory",'mkdir "%APPDATA%\\VLCProtocol" 2>nul',"","REM Write the PowerShell handler script","(","echo $url = $args[0]","echo if ^($url -and $url.StartsWith^('vlc://'^)^) { $url = $url.Substring^(6^) }","echo $url = [System.Uri]::UnescapeDataString^($url^)","echo $url = $url.TrimEnd^('/'^)","echo if ^($url^) { Start-Process 'C:\\Program Files\\VideoLAN\\VLC\\vlc.exe' -ArgumentList $url }",') > "%APPDATA%\\VLCProtocol\\handler.ps1"',"","REM Register the protocol in the registry",'reg add "HKCU\\Software\\Classes\\vlc" /ve /d "URL:VLC Protocol" /f','reg add "HKCU\\Software\\Classes\\vlc" /v "URL Protocol" /d "" /f','reg add "HKCU\\Software\\Classes\\vlc\\shell\\open\\command" /ve /d "powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File \\"%APPDATA%\\VLCProtocol\\handler.ps1\\" \\"%%1\\"" /f',"","echo VLC protocol handler installed successfully.","pause"].join("\n")}_getLinuxSetupScript(){return["# Create handler script","mkdir -p ~/.local/bin","cat > ~/.local/bin/vlc-protocol << 'EOF'","#!/bin/bash",'URL="$1"','URL="${URL#vlc://}"','URL=$(python3 -c "import sys, urllib.parse; print(urllib.parse.unquote(sys.argv[1]))" "$URL")','exec vlc "$URL" &',"EOF","chmod +x ~/.local/bin/vlc-protocol","","# Create .desktop file","cat > ~/.local/share/applications/vlc-protocol.desktop << 'EOF'","[Desktop Entry]","Name=VLC Protocol Handler","Exec=bash -c '~/.local/bin/vlc-protocol %u'","Type=Application","NoDisplay=true","MimeType=x-scheme-handler/vlc;","EOF","","# Register the handler","xdg-mime default vlc-protocol.desktop x-scheme-handler/vlc","update-desktop-database ~/.local/share/applications/","",'echo "VLC protocol handler installed successfully."'].join("\n")}_copyToClipboard(t,e){navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(t).then(()=>{this.pict.providers["RetoldRemote-ToastNotification"].showToast(e+" copied to clipboard")}).catch(()=>{this._fallbackCopy(t,e)}):this._fallbackCopy(t,e)}_fallbackCopy(t,e){let i=document.createElement("textarea");i.value=t,i.style.position="fixed",i.style.left="-9999px",document.body.appendChild(i),i.select();try{document.execCommand("copy"),this.pict.providers["RetoldRemote-ToastNotification"].showToast(e+" copied to clipboard")}catch(t){this.pict.providers["RetoldRemote-ToastNotification"].showToast("Failed to copy - please select and copy manually")}document.body.removeChild(i)}copyMacSetup(){this._copyToClipboard(this._getMacSetupScript(),"macOS setup script")}copyWindowsReg(){this._copyToClipboard(this._getWindowsRegFile(),"Registry file")}copyWindowsBatch(){this._copyToClipboard(this._getWindowsBatchScript(),"Batch script")}copyLinuxSetup(){this._copyToClipboard(this._getLinuxSetupScript(),"Linux setup script")}testProtocol(){let t=/Windows/.test(navigator.userAgent),e=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),i="https://www.sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4",n=t||e?"vlc://"+i:"vlc://"+encodeURIComponent(i),o=document.createElement("a");o.href=n,o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o)}}r.default_configuration=o,e.exports=r},{"pict-view":102}],168:[function(t,e,i){const n=t("pict-view"),o=t("./VideoExplorer-Selection"),r=t("./VideoExplorer-CustomFrames"),a=t("./VideoExplorer-Preview"),s={ViewIdentifier:"RetoldRemote-VideoExplorer",DefaultRenderable:"RetoldRemote-VideoExplorer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:""};class l extends n{constructor(t,e,i){super(t,e,i),this._currentPath="",this._frameData=null,this._selectedFrameIndex=-1,this._frameCount=20,this._fullResFrames=!0,this._customFrames=[],this._selectionModeActive=!1,this._selectionStartTime=-1,this._selectionEndTime=-1,this._isSelectingRange=!1,this._isDraggingTimeline=!1,this._draggingHandle=null,this._fmt=null,this._provider=null}_getFmt(){return this._fmt||(this._fmt=this.pict.providers["RetoldRemote-FormattingUtilities"]),this._fmt}_getProvider(){return this._provider||(this._provider=this.pict.providers["RetoldRemote-Provider"]),this._provider}_buildFrameURL(t,e){return"/api/media/video-frame/"+encodeURIComponent(t)+"/"+encodeURIComponent(e)}_getPathParam(t){let e=this._getProvider();return e?e._getPathParam(t):encodeURIComponent(t)}_getClientX(t){return t.touches&&t.touches.length>0?t.touches[0].clientX:t.changedTouches&&t.changedTouches.length>0?t.changedTouches[0].clientX:"number"==typeof t.clientX?t.clientX:null}_getTimelineTimestamp(t){let e=document.getElementById("RetoldRemote-VEX-TimelineBar");if(!e||!this._frameData||!this._frameData.Duration)return 0;let i=e.getBoundingClientRect(),n=this._getClientX(t);return null===n?0:Math.max(0,Math.min(1,(n-i.left)/i.width))*this._frameData.Duration}saveSelectionToCollection(){if(this._selectionStartTime<0||this._selectionEndTime<0)return;let t=Math.min(this._selectionStartTime,this._selectionEndTime),e=Math.max(this._selectionStartTime,this._selectionEndTime),i=this.pict.providers["RetoldRemote-CollectionManager"];if(!i)return;let n=i.getQuickAddTargetGUID();if(n)i.addVideoClipToCollection(n,t,e);else{i.setPendingClipContext({Type:"video-clip",Start:t,End:e});let n=this.pict.views["ContentEditor-TopBar"];n&&"function"==typeof n.showAddToCollectionDropdown&&n.showAddToCollectionDropdown()}}showExplorer(t,e,i){let n=this.pict.AppData.RetoldRemote;n.ActiveMode="video-explorer",n.CurrentViewerFile=t,n.CurrentViewerMediaType="video",this._currentPath=t;let o=this.pict.views["ContentEditor-Layout"];o&&"function"==typeof o.notifyCurrentFileChanged&&o.notifyCurrentFileChanged(t),this._frameData=null,this._selectedFrameIndex=-1,this._customFrames=[],this._selectionModeActive=!1,this._isSelectingRange=!1,this._isDraggingTimeline=!1,this._draggingHandle=null,"number"==typeof e&&e>=0&&"number"==typeof i&&i>=0?(this._selectionStartTime=e,this._selectionEndTime=i,this._selectionFromCaller=!0):(this._selectionStartTime=-1,this._selectionEndTime=-1,this._selectionFromCaller=!1),this._cleanupWindowListeners();let r=this._getProvider(),a="#/explore/"+(r?r.getFragmentIdentifier(t):t);0===(window.location.hash||"").indexOf("#/view/")?history.replaceState(null,"",a):window.location.hash=a;let s=document.getElementById("RetoldRemote-Gallery-Container"),l=document.getElementById("RetoldRemote-Viewer-Container");s&&(s.style.display="none"),l&&(l.style.display="block");let d=t.replace(/^.*\//,""),c='<div class="retold-remote-vex">',p=n.ServerCapabilities||{};c+='<div class="retold-remote-vex-header">',c+='<button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].goBack()" title="Back (Esc)">← Back</button>',c+='<div class="retold-remote-vex-title">Video Explorer — '+this._getFmt().escapeHTML(d)+"</div>",c+='<div class="retold-remote-vex-actions">',c+='<button class="retold-remote-vex-action-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].playInBrowser()" title="Play in browser (Space)">▶ Play</button>',c+='<button class="retold-remote-vex-action-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream with VLC (v)">▶ VLC</button>',(p.ffmpeg||p.ffprobe)&&(c+='<button class="retold-remote-vex-action-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].showExplorer(pict.views[\'RetoldRemote-VideoExplorer\']._currentPath)" title="Explore audio track">♫ Audio</button>'),c+="</div>",c+="</div>",c+='<div class="retold-remote-vex-info" id="RetoldRemote-VEX-Info" style="display:none;"></div>',c+='<div class="retold-remote-vex-controls" id="RetoldRemote-VEX-Controls" style="display:none;">',c+="<label>Frames:</label>",c+='<select id="RetoldRemote-VEX-FrameCount" onchange="pict.views[\'RetoldRemote-VideoExplorer\'].onFrameCountChange(this.value)">',c+='<option value="10"'+(10===this._frameCount?" selected":"")+">10</option>",c+='<option value="20"'+(20===this._frameCount?" selected":"")+">20</option>",c+='<option value="40"'+(40===this._frameCount?" selected":"")+">40</option>",c+='<option value="60"'+(60===this._frameCount?" selected":"")+">60</option>",c+='<option value="100"'+(100===this._frameCount?" selected":"")+">100</option>",c+="</select>",c+='<label style="display:inline-flex;align-items:center;gap:4px;cursor:pointer;">',c+='<input type="checkbox" id="RetoldRemote-VEX-FullRes"'+(this._fullResFrames?" checked":"")+" onchange=\"pict.views['RetoldRemote-VideoExplorer'].onFullResChange(this.checked)\">",c+="Full Res Frames</label>",c+='<button class="retold-remote-vex-refresh-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].refresh()">Refresh</button>',c+='<span style="border-left:1px solid var(--retold-border);height:20px;margin:0 4px;"></span>',c+='<button class="retold-remote-vex-select-btn" id="RetoldRemote-VEX-SelectBtn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].toggleSelectionMode()">Select Range</button>',c+='<span class="retold-remote-vex-selection-info" id="RetoldRemote-VEX-SelectionInfo" style="display:none;"></span>',c+='<button class="retold-remote-vex-clear-btn" id="RetoldRemote-VEX-ClearBtn" style="display:none;" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].clearSelection()">Clear</button>',c+='<span id="RetoldRemote-VEX-GenerateControls" style="display:none;">',c+='<span style="border-left:1px solid var(--retold-border);height:20px;margin:0 2px;"></span>',c+='<select class="retold-remote-vex-range-frame-select" id="RetoldRemote-VEX-RangeFrameCount">',c+='<option value="3">3</option>',c+='<option value="5" selected>5</option>',c+='<option value="10">10</option>',c+='<option value="20">20</option>',c+="</select>",c+='<button class="retold-remote-vex-generate-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].generateSelectionFrames()">Generate Frames</button>',c+='<span style="border-left:1px solid var(--retold-border);height:20px;margin:0 2px;"></span>',c+='<button class="retold-remote-vex-save-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].saveSelectionToCollection()" title="Save segment to collection (s)">Save Segment</button>',c+="</span>",c+="</div>",c+='<div class="retold-remote-vex-body" id="RetoldRemote-VEX-Body">',c+='<div class="retold-remote-vex-loading">',c+='<div class="retold-remote-vex-loading-spinner"></div>',c+="Extracting frames from video...",c+="</div>",c+="</div>",c+='<div class="retold-remote-vex-timeline" id="RetoldRemote-VEX-Timeline" style="display:none;"></div>',c+="</div>",l&&(l.innerHTML=c);let h=this.pict.views["ContentEditor-TopBar"];h&&h.updateInfo(),this._fetchFrames(t)}_fetchFrames(t){let e=this,i="/api/media/video-frames?path="+this._getPathParam(t)+"&count="+this._frameCount;this._fullResFrames&&(i+="&width=1920&height=1080"),this._cancelActiveOperation();let n=this.pict.providers["RetoldRemote-OperationStatus"],o=n?n.startOperation({Label:"Extracting video frames",Phase:"Starting…",Cancelable:!0}):null;o&&(this._activeOperationId=o.OperationId,this._activeAbortController=o.AbortController);let r={};o&&o.AbortController&&(r.signal=o.AbortController.signal),o&&(r.headers={"X-Op-Id":o.OperationId}),fetch(i,r).then(t=>t.json()).then(t=>{if(!t||!t.Success)return o&&n&&n.errorOperation(o.OperationId,{message:t?t.Error:"Unknown error"}),void e._showError(t?t.Error:"Unknown error");o&&n&&n.completeOperation(o.OperationId),e._activeOperationId=null,e._activeAbortController=null,e._frameData=t,e._renderFrames(),e._loadSavedCustomFrames()}).catch(t=>{t&&"AbortError"===t.name||(o&&n&&n.errorOperation(o.OperationId,t),e._showError(t.message))})}_cancelActiveOperation(){if(this._activeAbortController)try{this._activeAbortController.abort()}catch(t){}let t=this.pict.providers["RetoldRemote-OperationStatus"];this._activeOperationId&&t&&t.cancelOperation(this._activeOperationId),this._activeOperationId=null,this._activeAbortController=null}_renderFrames(){let t=this._frameData;if(!t)return;let e=document.getElementById("RetoldRemote-VEX-Info");if(e){let i="";i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Duration</span> <span class="retold-remote-vex-info-value">'+this._getFmt().escapeHTML(t.DurationFormatted)+"</span></span>",t.VideoWidth&&t.VideoHeight&&(i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Resolution</span> <span class="retold-remote-vex-info-value">'+t.VideoWidth+"×"+t.VideoHeight+"</span></span>"),t.Codec&&(i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Codec</span> <span class="retold-remote-vex-info-value">'+this._getFmt().escapeHTML(t.Codec)+"</span></span>"),t.FileSize&&(i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Size</span> <span class="retold-remote-vex-info-value">'+this._getFmt().formatFileSize(t.FileSize)+"</span></span>"),i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Frames</span> <span class="retold-remote-vex-info-value">'+t.FrameCount+"</span></span>",e.innerHTML=i,e.style.display=""}let i=document.getElementById("RetoldRemote-VEX-Controls");i&&(i.style.display="");let n=document.getElementById("RetoldRemote-VEX-Body");if(n){let e='<div class="retold-remote-vex-grid">';for(let i=0;i<t.Frames.length;i++){let n=t.Frames[i];e+='<div class="retold-remote-vex-frame" id="retold-vex-frame-'+i+"\" onclick=\"pict.views['RetoldRemote-VideoExplorer'].selectFrame("+i+")\" ondblclick=\"pict.views['RetoldRemote-VideoExplorer'].openFrameFullsize("+i+')">',e+='<img src="'+this._buildFrameURL(t.CacheKey,n.Filename)+'" alt="Frame at '+this._getFmt().escapeHTML(n.TimestampFormatted)+'" loading="lazy">',e+='<div class="retold-remote-vex-frame-info">',e+='<span class="retold-remote-vex-frame-timestamp">'+this._getFmt().escapeHTML(n.TimestampFormatted)+"</span>",e+='<span class="retold-remote-vex-frame-index">#'+(n.Index+1)+"</span>",e+="</div>",e+="</div>"}e+="</div>",n.innerHTML=e}this._renderTimeline()}_renderTimeline(){let t=this._frameData;if(!t||!t.Duration)return;let e=document.getElementById("RetoldRemote-VEX-Timeline");if(!e)return;let i="";i+='<span class="retold-remote-vex-timeline-label">0:00</span>',i+='<div class="retold-remote-vex-timeline-column">',i+='<div class="retold-remote-vex-slider-track" id="RetoldRemote-VEX-SliderTrack"></div>',i+='<div class="retold-remote-vex-timeline-bar" id="RetoldRemote-VEX-TimelineBar">';for(let e=0;e<t.Frames.length;e++){let n=t.Frames[e],o=n.Timestamp/t.Duration*100;i+='<div class="retold-remote-vex-timeline-marker'+(e===this._selectedFrameIndex?" selected":"")+'" style="left:'+o.toFixed(2)+'%;" data-frame-index="'+e+'" title="'+this._getFmt().escapeHTML(n.TimestampFormatted)+'"></div>'}if(this._customFrames)for(let e=0;e<this._customFrames.length;e++){let n=this._customFrames[e];i+='<div class="retold-remote-vex-timeline-marker custom" style="left:'+(n.Timestamp/t.Duration*100).toFixed(2)+'%;" title="'+this._getFmt().escapeHTML(n.TimestampFormatted)+'"></div>'}i+="</div>",i+="</div>",i+='<span class="retold-remote-vex-timeline-label">'+this._getFmt().escapeHTML(t.DurationFormatted)+"</span>",e.innerHTML=i,e.style.display="";let n=this,o=document.getElementById("RetoldRemote-VEX-TimelineBar");o&&(o.addEventListener("click",t=>{let e=t.target.closest(".retold-remote-vex-timeline-marker");if(e&&void 0!==e.dataset.frameIndex)return t.stopPropagation(),void n.selectFrame(parseInt(e.dataset.frameIndex,10));n._selectionModeActive||n.onTimelineClick(t)}),o.addEventListener("mousedown",t=>{0===t.button&&n._onSelectionDragStart(t)}),o.addEventListener("mousemove",t=>{n._onSelectionDragMove(t)}),o.addEventListener("touchstart",t=>{n._onSelectionDragStart(t)},{passive:!1}),o.addEventListener("touchmove",t=>{n._onSelectionDragMove(t)},{passive:!1}),n._cleanupWindowListeners(),n._boundDragEnd=t=>{n._onSelectionDragEnd(t)},window.addEventListener("mouseup",n._boundDragEnd),window.addEventListener("touchend",n._boundDragEnd),n._selectionModeActive&&o.classList.add("selecting")),this._renderSelectionOverlay(),this._renderSliderHandles(),this._updateSelectionInfo(),this._bindSliderHandleDrag()}selectFrame(t){if(this._selectedFrameIndex>=0){let t=document.getElementById("retold-vex-frame-"+this._selectedFrameIndex);t&&t.classList.remove("selected")}this._selectedFrameIndex=t;let e=document.getElementById("retold-vex-frame-"+t);e&&(e.classList.add("selected"),e.scrollIntoView({behavior:"smooth",block:"nearest"})),this._updateTimelineSelection()}_updateTimelineSelection(){let t=document.getElementById("RetoldRemote-VEX-TimelineBar");if(!t)return;let e=t.querySelectorAll(".retold-remote-vex-timeline-marker");for(let t=0;t<e.length;t++)t===this._selectedFrameIndex?e[t].classList.add("selected"):e[t].classList.remove("selected")}onFrameCountChange(t){this._frameCount=parseInt(t,10)||20,this.refresh()}onFullResChange(t){this._fullResFrames=t,this.refresh()}refresh(){let t=document.getElementById("RetoldRemote-VEX-Body");t&&(t.innerHTML='<div class="retold-remote-vex-loading"><div class="retold-remote-vex-loading-spinner"></div>Extracting frames from video...</div>');let e=document.getElementById("RetoldRemote-VEX-Timeline");e&&(e.style.display="none"),this._selectedFrameIndex=-1,this._customFrames=[],this._fetchFrames(this._currentPath)}goBack(){this._cancelActiveOperation(),this._cleanupWindowListeners();let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t.closeViewer()}playInBrowser(){this._cancelActiveOperation(),this._cleanupWindowListeners();let t=this.pict.views["RetoldRemote-MediaViewer"];t&&(t.showMedia(this._currentPath,"video"),t.playVideo())}_showError(t){let e=document.getElementById("RetoldRemote-VEX-Body");e&&(e.innerHTML='<div class="retold-remote-vex-error"><div class="retold-remote-vex-error-message">'+this._getFmt().escapeHTML(t||"An error occurred.")+'</div><button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].goBack()">Back to Video</button></div>')}}Object.assign(l.prototype,o),Object.assign(l.prototype,r),Object.assign(l.prototype,a),l.default_configuration=s,e.exports=l},{"./VideoExplorer-CustomFrames":169,"./VideoExplorer-Preview":170,"./VideoExplorer-Selection":171,"pict-view":102}],169:[function(t,e,i){
|
|
257
|
+
const n=t("pict-view"),o={ViewIdentifier:"RetoldRemote-CollectionsPanel",DefaultRenderable:"RetoldRemote-CollectionsPanel",DefaultDestinationAddress:"#RetoldRemote-Collections-Container",AutoRender:!1,CSS:"",Templates:[{Hash:"RetoldRemote-CollectionsPanel",Template:'<div class="retold-remote-collections-panel" id="RetoldRemote-CollectionsPanel-Root"></div>'}],Renderables:[{RenderableHash:"RetoldRemote-CollectionsPanel",TemplateHash:"RetoldRemote-CollectionsPanel",DestinationAddress:"#RetoldRemote-Collections-Container"}]};class r extends n{constructor(t,e,i){super(t,e,i),this._draggedItemId=null}onAfterRender(){super.onAfterRender(),this.renderContent()}renderContent(){let t=document.getElementById("RetoldRemote-CollectionsPanel-Root");if(t)switch(this.pict.AppData.RetoldRemote.CollectionsPanelMode){case"detail":this._renderDetailMode(t);break;case"edit":this._renderEditMode(t);break;default:this._renderListMode(t)}}_renderListMode(t){let e=this,i=this.pict.AppData.RetoldRemote,n=this.pict.providers["RetoldRemote-CollectionManager"];t.innerHTML="";let o=document.createElement("div");o.className="retold-remote-collections-header";let r=document.createElement("div");r.className="retold-remote-collections-header-title",r.textContent="Collections";let a=document.createElement("button");a.className="retold-remote-collections-header-btn",a.title="New Collection",a.textContent="+",a.onclick=()=>{let t=prompt("Collection name:");t&&t.trim()&&n.createCollection(t.trim(),(t,e)=>{!t&&e&&(i.CollectionsPanelMode="detail",n.fetchCollection(e.GUID))})},o.appendChild(r),o.appendChild(a),t.appendChild(o);let s=document.createElement("div");s.className="retold-remote-collections-search";let l=document.createElement("input");l.type="text",l.placeholder="Search collections...",l.value=i.CollectionSearchQuery||"",l.oninput=n=>{i.CollectionSearchQuery=n.target.value,e._renderCollectionCards(t.querySelector(".retold-remote-collections-body"))},s.appendChild(l),t.appendChild(s);let d=document.createElement("div");d.className="retold-remote-collections-body",t.appendChild(d),this._renderCollectionCards(d)}_renderCollectionCards(t){if(!t)return;let e=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-CollectionManager"],n=this.pict.providers["RetoldRemote-Icons"];t.innerHTML="";let o=i.searchCollections(e.CollectionSearchQuery);if(!o||0===o.length){let i=document.createElement("div");return i.className="retold-remote-collections-empty",i.textContent=e.CollectionSearchQuery?"No collections match your search.":"No collections yet. Click + to create one.",void t.appendChild(i)}for(let r=0;r<o.length;r++){let a=o[r],s=document.createElement("div");s.className="retold-remote-collection-card",s.onclick=()=>{e.CollectionsPanelMode="detail",i.fetchCollection(a.GUID)};let l=document.createElement("div");l.className="retold-remote-collection-card-icon",n&&"function"==typeof n.getIcon?l.innerHTML=n.getIcon("bookmark",18):l.textContent="☰";let d=document.createElement("div");d.className="retold-remote-collection-card-info";let c=document.createElement("div");c.className="retold-remote-collection-card-name",c.textContent=a.Name||"Untitled";let p=document.createElement("div");p.className="retold-remote-collection-card-meta",p.textContent=a.ItemCount+" item"+(1!==a.ItemCount?"s":""),d.appendChild(c),d.appendChild(p),s.appendChild(l),s.appendChild(d),t.appendChild(s)}}_renderDetailMode(t){let e=this,i=this.pict.AppData.RetoldRemote,n=this.pict.providers["RetoldRemote-CollectionManager"],o=i.ActiveCollection;if(t.innerHTML="",!o)return void(t.innerHTML='<div class="retold-remote-collections-empty">Loading...</div>');let r=document.createElement("div");r.className="retold-remote-collections-header";let a=document.createElement("button");a.className="retold-remote-collections-header-btn",a.title="Back to list",a.textContent="←",a.onclick=()=>{i.CollectionsPanelMode="list",i.ActiveCollectionGUID=null,i.ActiveCollection=null,e.renderContent()};let s=document.createElement("div");s.className="retold-remote-collections-header-title",s.textContent=o.Name||"Untitled";let l=document.createElement("button");l.className="retold-remote-collections-header-btn",l.title="Edit collection",l.textContent="✎",l.onclick=()=>{i.CollectionsPanelMode="edit",e.renderContent()},r.appendChild(a),r.appendChild(s),r.appendChild(l),t.appendChild(r);let d="operation-plan"===o.CollectionType;if(d){let e=document.createElement("div");e.className="retold-remote-collections-detail-controls retold-remote-collections-op-controls";let i=o.Items||[],r=0,a=0,s=0,l=0;for(let t=0;t<i.length;t++){let e=i[t].OperationStatus;"completed"===e?a++:"failed"===e?s++:"skipped"===e?l++:i[t].Operation&&r++}let d=document.createElement("div");d.className="retold-remote-collections-op-summary";let c=[];r>0&&c.push(r+" pending"),a>0&&c.push(a+" done"),s>0&&c.push(s+" failed"),l>0&&c.push(l+" skipped"),d.textContent=c.join(" · ")||"No operations",e.appendChild(d);let p=document.createElement("div");if(p.className="retold-remote-collections-op-buttons",r>0){let t=document.createElement("button");t.className="retold-remote-collections-op-execute-btn",t.textContent="Execute "+r+" Move"+(r>1?"s":""),t.onclick=()=>{t.disabled=!0,t.textContent="Moving...",n.executeCollectionOperations(o.GUID)},p.appendChild(t)}if(o.OperationBatchGUID&&a>0){let t=document.createElement("button");t.className="retold-remote-collections-op-undo-btn",t.textContent="Undo",t.onclick=()=>{t.disabled=!0,t.textContent="Undoing...",n.undoCollectionOperations(o.GUID)},p.appendChild(t)}e.appendChild(p),t.appendChild(e)}else{let r=document.createElement("div");r.className="retold-remote-collections-detail-controls";let a=document.createElement("select");a.className="retold-remote-collections-sort-select";let s=[{value:"manual",label:"Manual"},{value:"name",label:"Name"},{value:"modified",label:"Date Added"},{value:"type",label:"Type"}];for(let t=0;t<s.length;t++){let e=document.createElement("option");e.value=s[t].value,e.textContent=s[t].label,o.SortMode===s[t].value&&(e.selected=!0),a.appendChild(e)}a.onchange=t=>{n.sortActiveCollection(t.target.value,null)};let l=document.createElement("button");l.className="retold-remote-collections-sort-dir",l.textContent="desc"===o.SortDirection?"↓":"↑",l.title="desc"===o.SortDirection?"Descending":"Ascending",l.onclick=()=>{let t="desc"===i.ActiveCollection.SortDirection?"asc":"desc";n.sortActiveCollection(null,t)};let d=document.createElement("button");d.className="retold-remote-collections-export-btn",d.textContent="⇩ Export",d.title="Export collection to a folder",d.onclick=()=>{e._showExportDialog(o.GUID,o.Name)},r.appendChild(a),r.appendChild(l),r.appendChild(d),t.appendChild(r)}let c=document.createElement("div");c.className="retold-remote-collections-body",t.appendChild(c),d?this._renderOperationItemList(c,o):this._renderItemList(c,o)}_renderItemList(t,e){let i=this,n=(this.pict.AppData.RetoldRemote,this.pict.providers["RetoldRemote-CollectionManager"]),o=e.Items||[];if(t.innerHTML="",0===o.length){let e=document.createElement("div");return e.className="retold-remote-collections-empty",e.textContent="No items yet. Browse files and add them to this collection.",void t.appendChild(e)}for(let r=0;r<o.length;r++){let a=o[r],s=document.createElement("div");if(s.className="retold-remote-collection-item",s.setAttribute("data-item-id",a.ID),"manual"===e.SortMode){let e=document.createElement("div");e.className="retold-remote-collection-item-drag",e.textContent="☰",e.draggable=!0,e.ondragstart=t=>{i._draggedItemId=a.ID,s.classList.add("dragging"),t.dataTransfer.effectAllowed="move"},e.ondragend=()=>{s.classList.remove("dragging"),i._draggedItemId=null;let e=t.querySelectorAll(".retold-remote-collection-item");for(let t=0;t<e.length;t++)e[t].classList.remove("drag-over")},s.appendChild(e)}s.ondragover=t=>{t.preventDefault(),t.dataTransfer.dropEffect="move",s.classList.add("drag-over")},s.ondragleave=()=>{s.classList.remove("drag-over")},s.ondrop=t=>{if(t.preventDefault(),s.classList.remove("drag-over"),i._draggedItemId&&i._draggedItemId!==a.ID){let t=e.Items||[],o=[];for(let e=0;e<t.length;e++)t[e].ID!==i._draggedItemId&&(t[e].ID===a.ID&&o.push(i._draggedItemId),o.push(t[e].ID));n.reorderItems(e.GUID,o)}};let l=document.createElement("div");l.className="retold-remote-collection-item-icon";let d=a.Path||"",c=d.replace(/^.*\./,"").toLowerCase(),p=this.pict.PictApplication._getMediaType(c);if("video-frame"===a.Type&&a.FrameCacheKey&&a.FrameFilename){let t=document.createElement("img");t.src="/api/media/video-frame/"+encodeURIComponent(a.FrameCacheKey)+"/"+encodeURIComponent(a.FrameFilename),t.alt="",t.loading="lazy",l.appendChild(t)}else if("image-crop"===a.Type&&a.CropRegion){let t=document.createElement("img"),e=this.pict.providers["RetoldRemote-Provider"];e&&(t.src=e.getThumbnailURL(d,48,48)),t.alt="",t.loading="lazy",l.appendChild(t)}else if("image"===p&&"file"===a.Type){let t=document.createElement("img"),e=this.pict.providers["RetoldRemote-Provider"];e&&(t.src=e.getThumbnailURL(d,48,48)),t.alt="",t.loading="lazy",l.appendChild(t)}else l.textContent=this._getTypeIcon(a.Type,p);let h=document.createElement("div");h.className="retold-remote-collection-item-name",h.textContent=a.Label||d.split("/").pop()||d,h.title=d;let u=document.createElement("div");u.className="retold-remote-collection-item-type",u.textContent=a.Type||"file";let m=document.createElement("button");m.className="retold-remote-collection-item-remove",m.title="Remove from collection",m.textContent="×",m.onclick=t=>{t.stopPropagation(),n.removeItemFromCollection(e.GUID,a.ID)};let g=r;s.onclick=()=>{if("folder"===a.Type||"folder-contents"===a.Type)i.pict.PictApplication.loadFileList(a.Path);else{let t=i.pict.providers["RetoldRemote-GalleryNavigation"];t&&t._navigateToCollectionItem(a,g)}},s.appendChild(l),s.appendChild(h),s.appendChild(u),s.appendChild(m),t.appendChild(s)}}_renderOperationItemList(t,e){let i=this,n=this.pict.providers["RetoldRemote-CollectionManager"],o=e.Items||[];if(t.innerHTML="",0===o.length){let e=document.createElement("div");return e.className="retold-remote-collections-empty",e.textContent="No items in this sort plan.",void t.appendChild(e)}for(let r=0;r<o.length;r++){let a=o[r],s=document.createElement("div");s.className="retold-remote-collection-op-item";let l=a.OperationStatus||"pending";s.classList.add("op-status-"+l);let d=document.createElement("div");d.className="retold-remote-collection-op-status","completed"===l?(d.textContent="✓",d.title="Completed"):"failed"===l?(d.textContent="✗",d.title=a.OperationError||"Failed"):"skipped"===l?(d.textContent="—",d.title="Skipped"):(d.textContent="○",d.title="Pending");let c=document.createElement("div");c.className="retold-remote-collection-op-source";let p=a.Path||"";c.textContent=p.split("/").pop()||p,c.title=p;let h=document.createElement("div");h.className="retold-remote-collection-op-arrow",h.textContent="→";let u=document.createElement("div");u.className="retold-remote-collection-op-dest";let m=a.DestinationPath||"";u.textContent=m||"(no destination)",u.title=m,"pending"===l&&(u.style.cursor="pointer",u.onclick=t=>{t.stopPropagation(),i._startEditDestination(u,a,e)});let g=document.createElement("div");g.className="retold-remote-collection-op-badge",g.textContent=(a.Operation||"move").toUpperCase();let f=document.createElement("button");if(f.className="retold-remote-collection-item-remove",f.title="Skip this operation",f.textContent="×","pending"===l?f.onclick=t=>{t.stopPropagation(),n.skipItemOperation(a.ID)}:f.style.visibility="hidden","failed"===l&&a.OperationError){let t=document.createElement("div");t.className="retold-remote-collection-op-error",t.textContent=a.OperationError,s.appendChild(t)}s.appendChild(d),s.appendChild(c),s.appendChild(h),s.appendChild(u),s.appendChild(g),s.appendChild(f),t.appendChild(s)}}_startEditDestination(t,e,i){let n=this.pict.providers["RetoldRemote-CollectionManager"],o=document.createElement("input");o.type="text",o.className="retold-remote-collection-op-dest-input",o.value=e.DestinationPath||"";o.onblur=()=>{let i=o.value.trim();i&&i!==e.DestinationPath&&n.setItemDestination(e.ID,i),t.textContent=i||e.DestinationPath||"(no destination)",t.title=i||e.DestinationPath||""},o.onkeydown=i=>{"Enter"===i.key?(i.preventDefault(),o.blur()):"Escape"===i.key&&(i.preventDefault(),t.textContent=e.DestinationPath||"(no destination)",t.title=e.DestinationPath||"")},t.textContent="",t.appendChild(o),o.focus(),o.select()}_renderEditMode(t){let e=this,i=this.pict.AppData.RetoldRemote,n=this.pict.providers["RetoldRemote-CollectionManager"],o=i.ActiveCollection;if(t.innerHTML="",!o)return void(t.innerHTML='<div class="retold-remote-collections-empty">No collection selected.</div>');let r=document.createElement("div");r.className="retold-remote-collections-header";let a=document.createElement("button");a.className="retold-remote-collections-header-btn",a.title="Back to detail",a.textContent="←",a.onclick=()=>{i.CollectionsPanelMode="detail",e.renderContent()};let s=document.createElement("div");s.className="retold-remote-collections-header-title",s.textContent="Edit Collection",r.appendChild(a),r.appendChild(s),t.appendChild(r);let l=document.createElement("div");l.className="retold-remote-collections-body";let d=document.createElement("div");d.className="retold-remote-collections-edit",d.appendChild(this._createEditGroup("Name","input",o.Name||"","edit-name")),d.appendChild(this._createEditGroup("Description (Markdown)","textarea",o.Description||"","edit-description"));let c=this._createEditGroup("Cover Image Path","input",o.CoverImage||"","edit-cover"),p=this.pict.AppData.ContentEditor.CurrentFile;if(p){let t=document.createElement("button");t.className="retold-remote-collections-edit-btn",t.textContent="Use current file",t.style.marginTop="4px",t.style.fontSize="0.72rem",t.onclick=()=>{let t=document.getElementById("retold-remote-edit-cover");t&&(t.value=p)},c.appendChild(t)}d.appendChild(c),d.appendChild(this._createEditGroup("Tags (comma-separated)","input",(o.Tags||[]).join(", "),"edit-tags"));let h=document.createElement("div");h.className="retold-remote-collections-edit-actions";let u=document.createElement("button");u.className="retold-remote-collections-edit-btn retold-remote-collections-edit-btn-primary",u.textContent="Save",u.onclick=()=>{let t=document.getElementById("retold-remote-edit-name"),e=document.getElementById("retold-remote-edit-description"),r=document.getElementById("retold-remote-edit-cover"),a=document.getElementById("retold-remote-edit-tags"),s={GUID:o.GUID,Name:t?t.value:o.Name,Description:e?e.value:o.Description,CoverImage:r?r.value:o.CoverImage,Tags:a?a.value.split(",").map(t=>t.trim()).filter(t=>t):o.Tags};n.updateCollection(s,t=>{if(!t){i.CollectionsPanelMode="detail",n.fetchCollection(o.GUID);let t=n._getToast();t&&t.show("Collection saved")}})};let m=document.createElement("button");m.className="retold-remote-collections-edit-btn",m.textContent="Cancel",m.onclick=()=>{i.CollectionsPanelMode="detail",e.renderContent()},h.appendChild(u),h.appendChild(m),d.appendChild(h);let g=document.createElement("button");g.className="retold-remote-collections-edit-btn retold-remote-collections-edit-btn-danger",g.textContent="Delete Collection",g.onclick=()=>{confirm("Delete this collection? This cannot be undone.")&&n.deleteCollection(o.GUID)},d.appendChild(g),l.appendChild(d),t.appendChild(l)}_createEditGroup(t,e,i,n){let o=document.createElement("div");o.className="retold-remote-collections-edit-group";let r,a=document.createElement("div");return a.className="retold-remote-collections-edit-label",a.textContent=t,"textarea"===e?(r=document.createElement("textarea"),r.className="retold-remote-collections-edit-textarea"):(r=document.createElement("input"),r.className="retold-remote-collections-edit-input",r.type="text"),r.value=i,r.id="retold-remote-"+n,o.appendChild(a),o.appendChild(r),o}_getTypeIcon(t,e){switch(t){case"folder":case"folder-contents":return"📁";case"subfile":return"🗄";case"image-crop":return"✂";case"audio-clip":return"🎵";case"video-clip":case"video-frame":return"🎬"}switch(e){case"image":return"🖼";case"video":return"🎬";case"audio":return"🎵";default:return"📄"}}_showExportDialog(t,e){let i=this,n=(e||"collection-export").replace(/[<>:"/\\|?*\x00-\x1F]/g,"_").replace(/\s+/g,"_").substring(0,80),o=this.pict.AppData.RetoldRemote.CurrentBrowsedFolder||"",r=o?o.replace(/\/+$/,"")+"/"+n:n,a=document.getElementById("RetoldRemote-Collections-Detail");if(!a)return;let s=document.getElementById("RetoldRemote-ExportDialog");s&&s.parentElement.removeChild(s);let l=document.createElement("div");l.id="RetoldRemote-ExportDialog",l.style.cssText="padding:10px;border-top:1px solid var(--retold-border);background:var(--retold-bg-secondary,#21252b);",l.innerHTML='<div style="font-size:0.78rem;color:var(--retold-text);margin-bottom:6px;">Export to folder (within content root):</div><input type="text" id="RetoldRemote-ExportPath" value="'+r.replace(/"/g,""")+'" style="width:100%;box-sizing:border-box;background:var(--retold-bg-input,#1e1e1e);color:var(--retold-text);border:1px solid var(--retold-border);border-radius:4px;padding:4px 8px;font-size:0.78rem;font-family:inherit;margin-bottom:6px;"><div style="display:flex;gap:6px;"><button id="RetoldRemote-ExportConfirmBtn" style="flex:1;padding:4px 8px;font-size:0.75rem;">Export</button><button id="RetoldRemote-ExportCancelBtn" style="padding:4px 8px;font-size:0.75rem;">Cancel</button></div><div id="RetoldRemote-ExportStatus" style="font-size:0.72rem;color:var(--retold-text-dim);margin-top:6px;display:none;"></div>',a.appendChild(l);let d=document.getElementById("RetoldRemote-ExportPath");d&&(d.focus(),d.select()),document.getElementById("RetoldRemote-ExportCancelBtn").onclick=()=>{l.parentElement.removeChild(l)},document.getElementById("RetoldRemote-ExportConfirmBtn").onclick=()=>{let n=d?d.value.trim():"";if(!n)return;let o=document.getElementById("RetoldRemote-ExportConfirmBtn"),r=document.getElementById("RetoldRemote-ExportStatus");o&&(o.disabled=!0),o&&(o.textContent="Exporting…"),r&&(r.style.display=""),r&&(r.textContent="Exporting…");let a=i.pict.providers["RetoldRemote-OperationStatus"],s=a?a.startOperation({Label:"Exporting collection"+(e?": "+e:""),Phase:"Starting export…",Cancelable:!0}):null,c={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({DestinationPath:n})};s&&s.AbortController&&(c.signal=s.AbortController.signal),s&&(c.headers["X-Op-Id"]=s.OperationId),fetch("/api/collections/"+encodeURIComponent(t)+"/export",c).then(t=>t.json()).then(t=>{if(t&&t.Success){s&&a&&a.completeOperation(s.OperationId);let e="Exported "+t.ExportedCount+" of "+t.TotalItems+" items";t.ErrorCount>0&&(e+=" ("+t.ErrorCount+" errors)"),t.Cancelled&&(e="Export cancelled after "+t.ExportedCount+" of "+t.TotalItems+" items"),e+=" to "+t.DestinationPath,r&&(r.textContent=e),o&&(o.textContent=t.Cancelled?"Close":"Done");let n=i.pict.providers["RetoldRemote-ToastNotification"];n&&n.showToast(e),t.Cancelled||setTimeout(()=>{l.parentElement&&l.parentElement.removeChild(l)},3e3)}else{s&&a&&a.errorOperation(s.OperationId,{message:t&&t.Error||"Export failed"});let e=t&&t.Error||"Export failed";r&&(r.textContent=e),r&&(r.style.color="#e06c75"),o&&(o.textContent="Retry"),o&&(o.disabled=!1)}}).catch(t=>{if(t&&"AbortError"===t.name)return r&&(r.textContent="Cancelled"),o&&(o.textContent="Close"),void(o&&(o.disabled=!1));s&&a&&a.errorOperation(s.OperationId,t),r&&(r.textContent="Request failed: "+t.message),r&&(r.style.color="#e06c75"),o&&(o.textContent="Retry"),o&&(o.disabled=!1)})},d&&(d.onkeydown=t=>{"Enter"===t.key&&document.getElementById("RetoldRemote-ExportConfirmBtn").click(),"Escape"===t.key&&l.parentElement.removeChild(l)})}}r.default_configuration=o,e.exports=r},{"pict-view":102}],157:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"RetoldRemote-FileInfoPanel",DefaultRenderable:"RetoldRemote-FileInfoPanel",DefaultDestinationAddress:"#RetoldRemote-Info-Container",AutoRender:!1,CSS:"",DefaultTemplateRecordAddress:!1,Templates:[{Hash:"RetoldRemote-FileInfoPanel",Template:'<div class="retold-remote-info" id="RetoldRemote-Info-Body"></div>'}],Renderables:[{RenderableHash:"RetoldRemote-FileInfoPanel",TemplateHash:"RetoldRemote-FileInfoPanel",DestinationAddress:"#RetoldRemote-Info-Container"}]};e.exports=class extends n{constructor(t,e,i){super(t,e,i),this._currentPath=null,this._currentMetadata=null,this._extracting=!1}onAfterRender(){this._refreshForCurrentFile()}_refreshForCurrentFile(){let t=this.pict.AppData.RetoldRemote,e="";if(this.pict.AppData.ContentEditor&&this.pict.AppData.ContentEditor.CurrentFile&&(e=this.pict.AppData.ContentEditor.CurrentFile),!e&&t.CurrentViewerFile&&(e=t.CurrentViewerFile),!e){let i=t.GalleryItems||[],n=t.GalleryCursorIndex||0;i.length>0&&i[n]&&i[n].Path&&(e=i[n].Path)}e?e===this._currentPath&&this._currentMetadata?this._renderMetadata(this._currentMetadata):(this._currentPath=e,this._currentMetadata=null,this._fetchMetadata(e,!1)):this._renderEmpty("No file selected")}_fetchMetadata(t,e){let i=this,n="/api/media/extended-metadata?path="+encodeURIComponent(t);e&&(n+="&extract=true",this._extracting=!0,this._renderSpinner()),fetch(n).then(t=>t.json()).then(e=>{i._extracting=!1,e&&e.Success?(i._currentMetadata=e,i.pict.AppData.RetoldRemote.CurrentFileMetadata=e,i._renderMetadata(e)):e&&!1===e.Cached?i._renderUncached(t):i._renderEmpty("Could not load metadata")}).catch(t=>{i._extracting=!1,i._renderEmpty("Error: "+t.message)})}extractMetadata(){!this._extracting&&this._currentPath&&this._fetchMetadata(this._currentPath,!0)}_getExtension(t){let e=(t||"").split("/").pop()||"",i=e.lastIndexOf(".");return i<1?"":e.substring(i)}_getHashForCurrentFile(){let t=this.pict.providers.RetoldRemote;if(t&&"function"==typeof t.getHashForPath){let e=t.getHashForPath(this._currentPath);if(e)return e}let e=this.pict.AppData.RetoldRemote.GalleryItems||[];for(let t=0;t<e.length;t++)if(e[t].Path===this._currentPath&&e[t].Hash)return e[t].Hash;return null}_triggerDownload(t,e){let i=document.createElement("a");i.href=t,i.download=e,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i)}downloadFile(){if(!this._currentPath)return;let t=this._currentPath.split("/").pop()||this._currentPath,e="/content/"+encodeURIComponent(this._currentPath);this._triggerDownload(e,t)}downloadHashedFile(){if(!this._currentPath)return;let t=this._getHashForCurrentFile();if(!t)return void this.fable.log.warn("No hash available for file: "+this._currentPath);let e=t+this._getExtension(this._currentPath),i="/content/"+encodeURIComponent(this._currentPath);this._triggerDownload(i,e)}_getInfoBody(){return document.getElementById("RetoldRemote-Info-Body")}_renderEmpty(t){let e=this._getInfoBody();e&&(e.innerHTML=`<div class="retold-remote-info-empty">${this._esc(t)}</div>`)}_renderSpinner(){let t=this._getInfoBody();t&&(t.innerHTML='<div class="retold-remote-info-spinner">Extracting metadata...</div>')}_renderUncached(t){let e=this._getInfoBody();if(!e)return;let i=t.split("/").pop()||t,n=t.substring(0,t.length-i.length),o=this.pict.AppData.RetoldRemote.GalleryItems||[],r=null;for(let e=0;e<o.length;e++)if(o[e].Path===t){r=o[e];break}let a="";a+=`<div class="retold-remote-info-filename">${this._esc(i)}</div>`,a+=`<div class="retold-remote-info-path">${this._esc(n)}</div>`,r&&(a+='<div class="retold-remote-info-section">',a+='<div class="retold-remote-info-section-title">Basic</div>',r.Size&&(a+=this._row("Size",this._formatSize(r.Size))),r.Type&&(a+=this._row("Type",r.Type)),r.Extension&&(a+=this._row("Extension",r.Extension)),a+="</div>"),a+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].extractMetadata()">Extract Metadata</button>',a+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].downloadFile()" style="margin-top: 4px;">Download File</button>',a+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].downloadHashedFile()" style="margin-top: 4px;">Download Hashed File</button>',e.innerHTML=a}_renderMetadata(t){let e=this._getInfoBody();if(!e)return;let i=(t.Path||"").split("/").pop()||t.Path,n=(t.Path||"").substring(0,(t.Path||"").length-i.length),o="";if(o+=`<div class="retold-remote-info-filename">${this._esc(i)}</div>`,o+=`<div class="retold-remote-info-path">${this._esc(n)}</div>`,o+='<div class="retold-remote-info-section">',o+='<div class="retold-remote-info-section-title">Basic</div>',o+=this._row("Size",this._formatSize(t.FileSize)),o+=this._row("Category",t.Category||"unknown"),t.Extension&&(o+=this._row("Extension",t.Extension)),t.Modified&&(o+=this._row("Modified",this._formatDate(t.Modified))),t.Created&&(o+=this._row("Created",this._formatDate(t.Created))),t.MD5&&(o+='<div class="retold-remote-info-row">',o+='<span class="retold-remote-info-label">MD5</span>',o+=`<span class="retold-remote-info-value retold-remote-info-value-mono">${this._esc(t.MD5)}</span>`,o+="</div>"),o+="</div>",(t.FormatName||t.Duration)&&(o+='<div class="retold-remote-info-section">',o+='<div class="retold-remote-info-section-title">Format</div>',t.FormatName&&(o+=this._row("Container",t.FormatName)),t.Duration&&(o+=this._row("Duration",this._formatDuration(t.Duration))),t.Bitrate&&(o+=this._row("Bitrate",this._formatBitrate(t.Bitrate))),o+="</div>"),t.Video){o+='<div class="retold-remote-info-section">',o+='<div class="retold-remote-info-section-title">Video</div>';let e=t.Video;if(e.Codec){let t=e.Codec;e.Profile&&(t+=` (${e.Profile}`,e.Level&&(t+=` ${e.Level}`),t+=")"),o+=this._row("Codec",t)}e.Width&&e.Height&&(o+=this._row("Resolution",`${e.Width}×${e.Height}`)),e.FrameRate&&(o+=this._row("Frame Rate",this._formatFrameRate(e.FrameRate))),e.PixelFormat&&(o+=this._row("Pixel Format",e.PixelFormat)),e.ColorSpace&&(o+=this._row("Color Space",e.ColorSpace)),e.Bitrate&&(o+=this._row("Bitrate",this._formatBitrate(e.Bitrate))),o+="</div>"}if(t.Audio){o+='<div class="retold-remote-info-section">',o+='<div class="retold-remote-info-section-title">Audio</div>';let e=t.Audio;if(e.Codec){let t=e.Codec;e.Profile&&(t+=` (${e.Profile})`),o+=this._row("Codec",t)}if(e.SampleRate&&(o+=this._row("Sample Rate",e.SampleRate+" Hz")),e.Channels){let t=e.ChannelLayout||e.Channels+" ch";o+=this._row("Channels",t)}e.Bitrate&&(o+=this._row("Bitrate",this._formatBitrate(e.Bitrate))),e.BitsPerSample&&(o+=this._row("Bit Depth",e.BitsPerSample+"-bit")),o+="</div>"}if(t.Image){let e=t.Image;if(o+='<div class="retold-remote-info-section">',o+='<div class="retold-remote-info-section-title">Image</div>',e.Width&&e.Height&&(o+=this._row("Dimensions",`${e.Width}×${e.Height}`)),e.Format&&(o+=this._row("Format",e.Format)),e.Space&&(o+=this._row("Color Space",e.Space)),e.DPI&&(o+=this._row("DPI",e.DPI)),null!==e.HasAlpha&&void 0!==e.HasAlpha&&(o+=this._row("Alpha",e.HasAlpha?"Yes":"No")),o+="</div>",e.EXIF){let t=e.EXIF;if(t.Make||t.Model||t.ExposureTime||t.Software){if(o+='<div class="retold-remote-info-section">',o+='<div class="retold-remote-info-section-title">EXIF</div>',(t.Make||t.Model)&&(o+=this._row("Camera",((t.Make||"")+" "+(t.Model||"")).trim())),t.LensModel&&(o+=this._row("Lens",t.LensModel)),t.ExposureTime||t.FNumber||t.ISO){let e="";t.ExposureTime&&(e+=t.ExposureTime<1?`1/${Math.round(1/t.ExposureTime)}s`:t.ExposureTime+"s"),t.FNumber&&(e+=(e?" ":"")+`f/${t.FNumber}`),t.ISO&&(e+=(e?" ":"")+`ISO ${t.ISO}`),o+=this._row("Exposure",e)}t.FocalLength&&(o+=this._row("Focal Length",t.FocalLength+"mm")),t.DateTimeOriginal&&(o+=this._row("Date Taken",this._formatDate(t.DateTimeOriginal))),t.Software&&(o+=this._row("Software",t.Software)),o+="</div>"}}if(e.GPS){let t=e.GPS;if(o+='<div class="retold-remote-info-section">',o+='<div class="retold-remote-info-section-title">GPS</div>',null!==t.Latitude&&null!==t.Longitude){let e=parseFloat(t.Latitude).toFixed(6),i=parseFloat(t.Longitude).toFixed(6),n=t.Latitude>=0?"N":"S",r=t.Longitude>=0?"E":"W";o+=this._row("Latitude",`${Math.abs(e)}° ${n}`),o+=this._row("Longitude",`${Math.abs(i)}° ${r}`),null!==t.Altitude&&void 0!==t.Altitude&&(o+=this._row("Altitude",Math.round(t.Altitude)+"m")),o+='<div style="margin-top: 4px;">',o+=`<a class="retold-remote-info-gps-link" href="${`https://www.google.com/maps?q=${e},${i}`}" target="_blank" rel="noopener">Open in Maps ↗</a>`,o+="</div>"}o+="</div>"}}if(t.Document){let e=t.Document;o+='<div class="retold-remote-info-section">',o+='<div class="retold-remote-info-section-title">Document</div>',e.PageCount&&(o+=this._row("Pages",e.PageCount)),e.Title&&(o+=this._row("Title",e.Title)),e.Author&&(o+=this._row("Author",e.Author)),e.Subject&&(o+=this._row("Subject",e.Subject)),e.Keywords&&(o+=this._row("Keywords",e.Keywords)),e.Creator&&(o+=this._row("Creator",e.Creator)),e.Producer&&(o+=this._row("Producer",e.Producer)),e.CreatedDate&&(o+=this._row("Created",this._formatDate(e.CreatedDate))),e.ModifiedDate&&(o+=this._row("Modified",this._formatDate(e.ModifiedDate))),o+="</div>"}if(t.Tags&&Object.keys(t.Tags).length>0){o+='<div class="retold-remote-info-section">',o+='<div class="retold-remote-info-section-title">Tags</div>';let e=Object.keys(t.Tags).sort();for(let i=0;i<e.length;i++){let n=e[i],r=t.Tags[n];o+='<div class="retold-remote-info-tag-row">',o+=`<span class="retold-remote-info-tag-key">${this._esc(n)}</span>`,o+=`<span class="retold-remote-info-tag-value">${this._esc(String(r))}</span>`,o+="</div>"}o+="</div>"}if(t.Chapters&&t.Chapters.length>0){o+='<div class="retold-remote-info-section">',o+=`<div class="retold-remote-info-section-title">Chapters (${t.Chapters.length})</div>`;for(let e=0;e<t.Chapters.length;e++){let i=t.Chapters[e];o+='<div class="retold-remote-info-chapter-row">',o+=`<span class="retold-remote-info-chapter-time">${this._formatDuration(i.StartTime)}</span>`,o+=`<span class="retold-remote-info-chapter-title">${this._esc(i.Title)}</span>`,o+="</div>"}o+="</div>"}o+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].extractMetadata()" style="margin-top: 8px;">Re-extract Metadata</button>',o+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].downloadFile()" style="margin-top: 4px;">Download File</button>',o+='<button class="retold-remote-info-extract-btn" onclick="pict.views[\'RetoldRemote-FileInfoPanel\'].downloadHashedFile()" style="margin-top: 4px;">Download Hashed File</button>',e.innerHTML=o}_row(t,e){return`<div class="retold-remote-info-row"><span class="retold-remote-info-label">${this._esc(String(t))}</span><span class="retold-remote-info-value">${this._esc(String(e))}</span></div>`}_esc(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""):""}_formatSize(t){if(!t&&0!==t)return"unknown";let e=parseInt(t,10);return e<1024?e+" B":e<1048576?(e/1024).toFixed(1)+" KB":e<1073741824?(e/1048576).toFixed(1)+" MB":(e/1073741824).toFixed(2)+" GB"}_formatDuration(t){if(!t&&0!==t)return"unknown";let e=Math.floor(t),i=Math.floor(e/3600),n=Math.floor(e%3600/60),o=e%60;return i>0?`${i}:${String(n).padStart(2,"0")}:${String(o).padStart(2,"0")}`:`${n}:${String(o).padStart(2,"0")}`}_formatBitrate(t){if(!t)return"unknown";let e=parseInt(t,10);return e<1e3?e+" bps":e<1e6?(e/1e3).toFixed(0)+" kbps":(e/1e6).toFixed(1)+" Mbps"}_formatFrameRate(t){if(!t)return"unknown";if("string"==typeof t&&t.includes("/")){let e=t.split("/"),i=parseFloat(e[0]),n=parseFloat(e[1]);if(n>0)return(i/n).toFixed(3).replace(/\.?0+$/,"")+" fps"}return t+" fps"}_formatDate(t){if(!t)return"unknown";try{let e=new Date(t);return isNaN(e.getTime())?String(t):e.toLocaleDateString()+" "+e.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch(e){return String(t)}}},e.exports.default_configuration=o},{"pict-view":102}],158:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"RetoldRemote-Gallery",DefaultRenderable:"RetoldRemote-Gallery-Grid",DefaultDestinationAddress:"#RetoldRemote-Gallery-Container",AutoRender:!1,CSS:"",Templates:[],Renderables:[]};class r extends n{constructor(t,e,i){super(t,e,i),this._intersectionObserver=null,this._activeRenderFrame=null,this._activeRenderToken=0,this._thumbnailQueue=[],this._thumbnailInFlight=0}showLoadingState(t){let e=document.getElementById("RetoldRemote-Gallery-Container");if(!e)return;let i=this.pict.providers["RetoldRemote-FormattingUtilities"],n=i?i.escapeHTML(t||""):t||"",o='<div class="retold-remote-gallery-loading">';o+='<div class="retold-remote-gallery-loading-spinner"></div>',o+='<div class="retold-remote-gallery-loading-text">Loading folder…</div>',n&&(o+='<div class="retold-remote-gallery-loading-path">'+n+"</div>"),o+="</div>",e.innerHTML=o}cancelActiveRender(){null!==this._activeRenderFrame&&(cancelAnimationFrame(this._activeRenderFrame),this._activeRenderFrame=null),this._activeRenderToken++}renderGallery(){let t=document.getElementById("RetoldRemote-Gallery-Container");if(!t)return;this.cancelActiveRender();let e=this.pict.AppData.RetoldRemote,i=e.GalleryItems||[],n=e.ViewMode||"list",o=e.ThumbnailSize||"medium",r=e.GalleryCursorIndex||0,a=document.getElementById("RetoldRemote-Gallery-Search"),s=a&&document.activeElement===a,l=s?a.selectionStart:0,d=s?a.selectionEnd:0,c=this._buildHeaderHTML(e.FilterState?e.FilterState.MediaType:"all");if(c+=this._buildFilterPanelHTML(),c+=this._buildFilterChipsHTML(),0===i.length){c+='<div class="retold-remote-empty">';let e=this.pict.providers["RetoldRemote-Icons"];return c+='<div class="retold-remote-empty-icon"><span class="retold-remote-icon retold-remote-icon-xl">'+(e?e.getIcon("gallery-empty",96):"")+"</span></div>",c+="<div>Empty folder</div>",c+="</div>",t.innerHTML=c,void this._restoreSearchFocus(s,l,d)}if(i.length<=500){c+="gallery"===n?this._buildGridHTML(i,o,r):this._buildListHTML(i,r),t.innerHTML=c,this._restoreSearchFocus(s,l,d),this._setupLazyLoading();let e=this.pict.providers["RetoldRemote-GalleryNavigation"];e&&e.recalculateColumns();let a=this.pict.views["ContentEditor-TopBar"];return void(a&&a.updateFilterIcon&&a.updateFilterIcon())}let p="RetoldRemote-GalleryItemsContainer",h="RetoldRemote-GalleryProgress";c+="gallery"===n?'<div class="retold-remote-grid size-'+o+'" id="'+p+'"></div>':'<div class="retold-remote-list" id="'+p+'"></div>',c+='<div class="retold-remote-gallery-progress" id="'+h+'"><span class="retold-remote-gallery-progress-spinner"></span><span class="retold-remote-gallery-progress-text">Rendering 0 / '+i.length.toLocaleString()+"…</span></div>",t.innerHTML=c,this._restoreSearchFocus(s,l,d);let u=this.pict.views["ContentEditor-TopBar"];u&&u.updateFilterIcon&&u.updateFilterIcon(),this._renderGalleryChunked(i,n,o,r,p,h)}_restoreSearchFocus(t,e,i){if(!t)return;let n=document.getElementById("RetoldRemote-Gallery-Search");n&&(n.focus(),n.setSelectionRange(e,i))}_renderGalleryChunked(t,e,i,n,o,r){let a=this,s=++this._activeRenderToken,l=t.length,d=0,c=function(){if(s!==a._activeRenderToken)return;let i=document.getElementById(o);if(!i)return;let p,h=0===d?250:500,u=Math.min(d+h,l),m=t.slice(d,u);p="gallery"===e?a._buildGridItemsHTML(m,n,d):a._buildListItemsHTML(m,n,d),i.insertAdjacentHTML("beforeend",p),d=u;let g=document.getElementById(r);if(g){let t=g.querySelector(".retold-remote-gallery-progress-text");t&&(t.textContent="Rendering "+d.toLocaleString()+" / "+l.toLocaleString()+"…")}if(d<l)a._observeNewThumbnails(),a._activeRenderFrame=requestAnimationFrame(c);else{a._activeRenderFrame=null,g&&g.parentElement&&g.parentElement.removeChild(g),a._setupLazyLoading();let t=a.pict.providers["RetoldRemote-GalleryNavigation"];t&&t.recalculateColumns()}};this._activeRenderFrame=requestAnimationFrame(c)}_buildHeaderHTML(t){let e=this.pict.AppData.RetoldRemote;if(!e.FilterBarVisible)return"";let i=[{key:"all",label:"All"},{key:"images",label:"Images"},{key:"video",label:"Video"},{key:"audio",label:"Audio"},{key:"documents",label:"Docs"}],n='<div class="retold-remote-gallery-header">';n+='<div class="retold-remote-gallery-filter">';for(let e=0;e<i.length;e++){let o=i[e];n+='<button class="retold-remote-gallery-filter-btn'+(o.key===t?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].setFilter('"+o.key+"')\">"+o.label+"</button>"}n+="</div>",n+='<div class="retold-remote-gallery-sort">',n+='<select class="retold-remote-gallery-sort-select" id="RetoldRemote-Gallery-Sort" onchange="pict.views[\'RetoldRemote-Gallery\'].onSortChange(this.value)">';let o=[{value:"folder-first:asc",label:"Folders first"},{value:"name:asc",label:"Name A–Z"},{value:"name:desc",label:"Name Z–A"},{value:"modified:desc",label:"Newest modified"},{value:"modified:asc",label:"Oldest modified"},{value:"created:desc",label:"Newest created"},{value:"created:asc",label:"Oldest created"}],r=(e.SortField||"folder-first")+":"+(e.SortDirection||"asc");for(let t=0;t<o.length;t++){let e=o[t].value===r?" selected":"";n+='<option value="'+o[t].value+'"'+e+">"+o[t].label+"</option>"}n+="</select>",n+="</div>";let a=this.pict.providers["RetoldRemote-GalleryFilterSort"],s=a?a.getActiveFilterChips().length:0;n+='<button class="retold-remote-gallery-filter-btn retold-remote-gallery-filter-toggle'+(s>0?" has-filters":"")+'" onclick="pict.views[\'RetoldRemote-Gallery\'].toggleFilterPanel()">⚙ Filters',s>0&&(n+='<span class="retold-remote-gallery-filter-count">'+s+"</span>"),n+="</button>";let l=e.SearchQuery||"";n+='<input type="text" class="retold-remote-gallery-search" id="RetoldRemote-Gallery-Search" placeholder="Search files... (/)" value="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(l)+'" oninput="pict.views[\'RetoldRemote-Gallery\'].onSearchInput(this.value)">';let d=e.SearchCaseSensitive||!1,c=e.SearchRegex||!1;return n+='<div class="retold-remote-gallery-search-options">',n+='<label class="retold-remote-gallery-search-option'+(d?" active":"")+'"><input type="checkbox" '+(d?"checked ":"")+"onchange=\"pict.views['RetoldRemote-Gallery'].onSearchCaseSensitiveChange(this.checked)\">Aa</label>",n+='<label class="retold-remote-gallery-search-option'+(c?" active":"")+'"><input type="checkbox" '+(c?"checked ":"")+"onchange=\"pict.views['RetoldRemote-Gallery'].onSearchRegexChange(this.checked)\">.*</label>",e._searchRegexError&&(n+='<span class="retold-remote-gallery-search-regex-error" title="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e._searchRegexError)+'">invalid regex</span>'),n+="</div>",n+="</div>",n}_buildFilterPanelHTML(){let t=this.pict.AppData.RetoldRemote;if(!t.FilterPanelOpen)return"";let e=this.pict.providers["RetoldRemote-GalleryFilterSort"],i=e?e.getAvailableExtensions():[],n=t.FilterState||{},o='<div class="retold-remote-filter-panel">';o+='<div class="retold-remote-filter-panel-grid">',o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">File Type</div>',o+='<div class="retold-remote-filter-ext-list">';let r=n.Extensions||[];for(let t=0;t<i.length;t++){let e=i[t];o+='<label class="retold-remote-filter-ext-item">',o+='<input type="checkbox" '+(0===r.length||r.indexOf(e.ext)>=0?"checked ":"")+"onchange=\"pict.views['RetoldRemote-Gallery'].onExtensionToggle('"+e.ext+"', this.checked)\">",o+=" ."+e.ext+' <span class="retold-remote-filter-ext-count">('+e.count+")</span>",o+="</label>"}return o+="</div>",o+="</div>",o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">File Size</div>',o+='<div class="retold-remote-filter-row">',o+='<input type="number" class="retold-remote-filter-input" placeholder="Min KB" value="'+(null!==n.SizeMin&&void 0!==n.SizeMin?Math.round(n.SizeMin/1024):"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onSizeFilterChange('min', this.value)\">",o+='<span class="retold-remote-filter-label">to</span>',o+='<input type="number" class="retold-remote-filter-input" placeholder="Max KB" value="'+(null!==n.SizeMax&&void 0!==n.SizeMax?Math.round(n.SizeMax/1024):"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onSizeFilterChange('max', this.value)\">",o+='<span class="retold-remote-filter-label">KB</span>',o+="</div>",o+="</div>",o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">Modified Date</div>',o+='<div class="retold-remote-filter-row">',o+='<input type="date" class="retold-remote-filter-input" value="'+(n.DateModifiedAfter||"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onDateFilterChange('DateModifiedAfter', this.value)\">",o+='<span class="retold-remote-filter-label">to</span>',o+='<input type="date" class="retold-remote-filter-input" value="'+(n.DateModifiedBefore||"")+"\" onchange=\"pict.views['RetoldRemote-Gallery'].onDateFilterChange('DateModifiedBefore', this.value)\">",o+="</div>",o+="</div>",o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">List Columns</div>',o+='<div class="retold-remote-filter-col-toggles">',o+='<button class="retold-remote-filter-col-toggle'+(!1!==t.ListShowExtension?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].toggleListColumn('ListShowExtension')\">Ext</button>",o+='<button class="retold-remote-filter-col-toggle'+(!1!==t.ListShowSize?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].toggleListColumn('ListShowSize')\">Size</button>",o+='<button class="retold-remote-filter-col-toggle'+(!1!==t.ListShowDate?" active":"")+"\" onclick=\"pict.views['RetoldRemote-Gallery'].toggleListColumn('ListShowDate')\">Date</button>",o+="</div>",o+="</div>",o+='<div class="retold-remote-filter-section">',o+='<div class="retold-remote-filter-section-title">Presets</div>',o+=this._buildPresetControlsHTML(),o+="</div>",o+='<div class="retold-remote-filter-actions">',o+='<button class="retold-remote-filter-btn-sm" onclick="pict.views[\'RetoldRemote-Gallery\'].clearAllFilters()">Clear All Filters</button>',o+="</div>",o+="</div>",o+="</div>",o}_buildPresetControlsHTML(){let t=this.pict.AppData.RetoldRemote.FilterPresets||[],e='<div class="retold-remote-filter-preset-row">';if(t.length>0){e+='<select class="retold-remote-filter-preset-select" id="RetoldRemote-Filter-PresetSelect" onchange="pict.views[\'RetoldRemote-Gallery\'].loadFilterPreset(this.value)">',e+='<option value="">Load preset...</option>';for(let i=0;i<t.length;i++)e+='<option value="'+i+'">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t[i].Name)+"</option>";e+="</select>",e+='<button class="retold-remote-filter-btn-sm" onclick="pict.views[\'RetoldRemote-Gallery\'].deleteSelectedPreset()">✕</button>'}return e+='<input type="text" class="retold-remote-filter-preset-input" id="RetoldRemote-Filter-PresetName" placeholder="Preset name...">',e+='<button class="retold-remote-filter-btn-sm" onclick="pict.views[\'RetoldRemote-Gallery\'].saveFilterPreset()">Save</button>',e+="</div>",e}_buildFilterChipsHTML(){let t=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(!t)return"";let e=t.getActiveFilterChips();if(0===e.length)return"";let i='<div class="retold-remote-filter-chips">';for(let t=0;t<e.length;t++){let n=e[t];i+='<span class="retold-remote-filter-chip">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(n.label)+" <button class=\"retold-remote-filter-chip-remove\" onclick=\"pict.views['RetoldRemote-Gallery'].removeFilterChip('"+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(n.key)+"')\">×</button></span>"}return i+='<button class="retold-remote-filter-chip-clear" onclick="pict.views[\'RetoldRemote-Gallery\'].clearAllFilters()">Clear all</button>',i+="</div>",i}_buildGridHTML(t,e,i){let n='<div class="retold-remote-grid size-'+e+'">';return n+=this._buildGridItemsHTML(t,i,0),n+="</div>",n}_buildGridItemsHTML(t,e,i){let n=i||0,o="",r=this.pict.providers["RetoldRemote-Provider"],a=this.pict.providers["RetoldRemote-Icons"],s=this.pict.providers["RetoldRemote-FormattingUtilities"];for(let i=0;i<t.length;i++){let l=t[i],d=n+i,c=d===e?" selected":"",p=(l.Extension||"").toLowerCase(),h=this._getCategory(p,l.Type);if(o+='<div class="retold-remote-tile'+c+'" data-index="'+d+"\" onclick=\"pict.views['RetoldRemote-Gallery'].onTileClick("+d+")\" ondblclick=\"pict.views['RetoldRemote-Gallery'].onTileDoubleClick("+d+')">',o+='<div class="retold-remote-tile-thumb">',"folder"===l.Type)o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(a?a.getIcon("folder",48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-folder">Folder</span>';else if("archive"===l.Type)o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(a?a.getIcon("file-archive",48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-folder">Archive</span>';else if("image"===h&&r){let t=r.getThumbnailURL(l.Path,400,300);o+=t?'<img data-src="'+t+'" alt="'+s.escapeHTML(l.Name)+'" loading="lazy">':'<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(a?a.getIcon("file-image",48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-image">'+p+"</span>"}else if("video"===h){if(r){let t=r.getThumbnailURL(l.Path,400,300);o+=t?'<img data-src="'+t+'" alt="'+s.escapeHTML(l.Name)+'" loading="lazy">':'<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(a?a.getIcon("file-video",48):"")+"</span></div>"}else o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(a?a.getIcon("file-video",48):"")+"</span></div>";o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-video">Video</span>'}else"audio"===h?(o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(a?a.getIcon("file-audio",48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-audio">Audio</span>'):"document"===h?(o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(a?a.getIconForEntry(l,48):"")+"</span></div>",o+='<span class="retold-remote-tile-badge retold-remote-tile-badge-document">'+p+"</span>"):o+='<div class="retold-remote-tile-thumb-icon"><span class="retold-remote-icon retold-remote-icon-md">'+(a?a.getIconForEntry(l,48):"")+"</span></div>";o+="</div>",o+='<div class="retold-remote-tile-label" title="'+s.escapeHTML(l.Name)+'">'+s.escapeHTML(l.Name)+"</div>","file"===l.Type&&void 0!==l.Size?o+='<div class="retold-remote-tile-meta">'+s.formatFileSize(l.Size)+"</div>":"folder"===l.Type?o+='<div class="retold-remote-tile-meta">Folder</div>':"archive"===l.Type&&(o+='<div class="retold-remote-tile-meta">Archive'+(l.Size?" · "+s.formatFileSize(l.Size):"")+"</div>"),o+="</div>"}return o}_buildListHTML(t,e){let i='<div class="retold-remote-list">';return i+=this._buildListItemsHTML(t,e,0),i+="</div>",i}_buildListItemsHTML(t,e,i){let n=i||0,o=this.pict.AppData.RetoldRemote,r=!1!==o.ListShowExtension,a=!1!==o.ListShowSize,s=!1!==o.ListShowDate,l="",d=this.pict.providers["RetoldRemote-Icons"],c=this.pict.providers["RetoldRemote-FormattingUtilities"];for(let i=0;i<t.length;i++){let o=t[i],p=n+i,h=p===e?" selected":"",u="";if(d&&(u='<span class="retold-remote-icon retold-remote-icon-sm">'+d.getIconForEntry(o,16)+"</span>"),l+='<div class="retold-remote-list-row'+h+'" data-index="'+p+"\" onclick=\"pict.views['RetoldRemote-Gallery'].onTileClick("+p+")\" ondblclick=\"pict.views['RetoldRemote-Gallery'].onTileDoubleClick("+p+')">',l+='<div class="retold-remote-list-icon">'+u+"</div>",l+='<div class="retold-remote-list-name" title="'+c.escapeHTML(o.Name)+"\" ontouchstart=\"pict.views['RetoldRemote-Gallery']._onNameTouchStart(event, '"+c.escapeHTML(o.Name).replace(/'/g,"\\'")+"')\" ontouchend=\"pict.views['RetoldRemote-Gallery']._onNameTouchEnd(event)\" ontouchcancel=\"pict.views['RetoldRemote-Gallery']._onNameTouchEnd(event)\">"+c.escapeHTML(o.Name)+"</div>",r){let t="";"file"===o.Type||"archive"===o.Type?t=(o.Extension||"").replace(/^\./,"").toLowerCase():"folder"===o.Type&&(t=""),l+='<div class="retold-remote-list-ext">'+t+"</div>"}a&&("file"!==o.Type&&"archive"!==o.Type||void 0===o.Size?l+='<div class="retold-remote-list-size"></div>':l+='<div class="retold-remote-list-size">'+c.formatFileSize(o.Size)+"</div>"),s&&(o.Modified?l+='<div class="retold-remote-list-date">'+c.formatShortDate(o.Modified)+"</div>":l+='<div class="retold-remote-list-date"></div>'),l+="</div>"}return l}_setupLazyLoading(){this._intersectionObserver&&this._intersectionObserver.disconnect(),this._thumbnailQueue=[],this._thumbnailInFlight=0;let t=this;this._intersectionObserver=new IntersectionObserver(e=>{for(let i=0;i<e.length;i++)if(e[i].isIntersecting){let n=e[i].target;t._intersectionObserver.unobserve(n),t._enqueueThumbnail(n)}},{rootMargin:"100px"}),this._observeNewThumbnails()}_observeNewThumbnails(){if(!this._intersectionObserver)return;let t=document.querySelectorAll(".retold-remote-tile-thumb img[data-src]:not([data-observed])");for(let e=0;e<t.length;e++)t[e].setAttribute("data-observed","1"),this._intersectionObserver.observe(t[e])}_enqueueThumbnail(t){this._thumbnailQueue.push(t),this._drainThumbnailQueue()}_drainThumbnailQueue(){let t=this;for(;this._thumbnailInFlight<8&&this._thumbnailQueue.length>0;){let e=this._thumbnailQueue.shift(),i=e.getAttribute("data-src");if(!i)continue;this._thumbnailInFlight++;let n=function(){t._thumbnailInFlight--,t._drainThumbnailQueue()};e.addEventListener("load",n,{once:!0}),e.addEventListener("error",n,{once:!0}),e.src=i,e.removeAttribute("data-src")}}onTileClick(t){let e=this.pict.providers["RetoldRemote-GalleryNavigation"];e&&e.moveCursor(t)}onTileDoubleClick(t){this.pict.AppData.RetoldRemote.GalleryCursorIndex=t;let e=this.pict.providers["RetoldRemote-GalleryNavigation"];e&&e.openCurrent()}setFilter(t){let e=this.pict.AppData.RetoldRemote;e.GalleryFilter=t,e.FilterState.MediaType=t;let i=this.pict.providers["RetoldRemote-GalleryFilterSort"];i&&i.applyFilterSort()}onSearchInput(t){this.pict.AppData.RetoldRemote.SearchQuery=t||"";let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSearchCaseSensitiveChange(t){this.pict.AppData.RetoldRemote.SearchCaseSensitive=t;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSearchRegexChange(t){this.pict.AppData.RetoldRemote.SearchRegex=t;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.applyFilterSort()}onSortChange(t){let e=t.split(":"),i=this.pict.AppData.RetoldRemote;i.SortField=e[0],i.SortDirection=e[1]||"asc";let n=this.pict.providers["RetoldRemote-GalleryFilterSort"];n&&n.applyFilterSort(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}toggleFilterPanel(){let t=this.pict.AppData.RetoldRemote;t.FilterPanelOpen=!t.FilterPanelOpen,this.renderGallery(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}onExtensionToggle(t,e){let i=this.pict.AppData.RetoldRemote.FilterState,n=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(e)i.Extensions.length>0&&i.Extensions.push(t);else if(0===i.Extensions.length&&n){let e=n.getAvailableExtensions();i.Extensions=e.map(t=>t.ext).filter(e=>e!==t)}else i.Extensions=i.Extensions.filter(e=>e!==t);n&&n.applyFilterSort()}onSizeFilterChange(t,e){let i=this.pict.AppData.RetoldRemote.FilterState,n=e&&""!==e?1024*parseInt(e,10):null;"min"===t?i.SizeMin=n:i.SizeMax=n;let o=this.pict.providers["RetoldRemote-GalleryFilterSort"];o&&o.applyFilterSort()}onDateFilterChange(t,e){this.pict.AppData.RetoldRemote.FilterState[t]=e||null;let i=this.pict.providers["RetoldRemote-GalleryFilterSort"];i&&i.applyFilterSort()}removeFilterChip(t){let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&(e.removeFilter(t),e.applyFilterSort())}clearAllFilters(){let t=this.pict.providers["RetoldRemote-GalleryFilterSort"];t&&(t.clearAllFilters(),t.applyFilterSort())}saveFilterPreset(){let t=document.getElementById("RetoldRemote-Filter-PresetName");if(!t||!t.value.trim())return;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.savePreset(t.value.trim()),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings(),this.renderGallery()}loadFilterPreset(t){if(""===t||null==t)return;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&(e.loadPreset(parseInt(t,10)),e.applyFilterSort()),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}deleteSelectedPreset(){let t=document.getElementById("RetoldRemote-Filter-PresetSelect");if(!t||""===t.value)return;let e=this.pict.providers["RetoldRemote-GalleryFilterSort"];e&&e.deletePreset(parseInt(t.value,10)),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings(),this.renderGallery()}toggleListColumn(t){let e=this.pict.AppData.RetoldRemote,i=e[t];e[t]=!1===i,this.renderGallery(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}_onNameTouchStart(t,e){let i=this;this._clearLongPressTimer(),this._longPressTimer=setTimeout(function(){i._showLongPressTooltip(t,e)},500)}_onNameTouchEnd(t){this._clearLongPressTimer(),this._hideLongPressTooltip()}_clearLongPressTimer(){this._longPressTimer&&(clearTimeout(this._longPressTimer),this._longPressTimer=null)}_showLongPressTooltip(t,e){this._hideLongPressTooltip();let i=document.createElement("div");i.className="retold-remote-longpress-tooltip",i.textContent=e;let n=t.touches&&t.touches[0];n&&(i.style.left=Math.min(n.clientX,window.innerWidth-20)+"px",i.style.top=n.clientY-50+"px"),document.body.appendChild(i),this._longPressTooltipEl=i,t.preventDefault()}_hideLongPressTooltip(){this._longPressTooltipEl&&(this._longPressTooltipEl.parentNode&&this._longPressTooltipEl.parentNode.removeChild(this._longPressTooltipEl),this._longPressTooltipEl=null)}_getCategory(t,e){if("folder"===e)return"folder";if("archive"===e)return"archive";let i=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(i)return i.getCategory(t);let n=(t||"").replace(/^\./,"").toLowerCase();return"png"===n||"jpg"===n||"jpeg"===n||"gif"===n||"webp"===n?"image":"mp4"===n||"webm"===n||"mov"===n?"video":"mp3"===n||"wav"===n||"ogg"===n?"audio":"pdf"===n?"document":"other"}}r.default_configuration=o,e.exports=r},{"pict-view":102}],159:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"RetoldRemote-ImageExplorer",DefaultRenderable:"RetoldRemote-ImageExplorer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:""};class r extends n{constructor(t,e,i){super(t,e,i),this._currentPath="",this._osdViewer=null,this._dziData=null,this._osdLoaded=!1,this._loading=!1,this._selectionMode=!1,this._selectionTracker=null,this._selectionOverlay=null,this._selectionRegion=null,this._selectionStart=null,this._selectionStartScreenPos=null,this._savedRegions=[],this._viewerReady=!1,this._editingRegionID=null,this._editDragMode=null,this._editDragStart=null,this._editOriginalRect=null,this._editTracker=null}showExplorer(t){let e=this.pict.AppData.RetoldRemote;e.ActiveMode="image-explorer",e.CurrentViewerFile=t,e.CurrentViewerMediaType="image",this._currentPath=t,this._dziData=null,this._loading=!1;let i=this.pict.views["ContentEditor-Layout"];if(i&&"function"==typeof i.notifyCurrentFileChanged&&i.notifyCurrentFileChanged(t),this._selectionMode=!1,this._selectionTracker=null,this._selectionOverlay=null,this._selectionRegion=null,this._selectionStart=null,this._selectionStartScreenPos=null,this._savedRegions=[],this._viewerReady=!1,this._editingRegionID=null,this._editDragMode=null,this._editDragStart=null,this._editOriginalRect=null,this._editTracker){try{this._editTracker.destroy()}catch(t){}this._editTracker=null}if(this._osdViewer){try{this._osdViewer.destroy()}catch(t){}this._osdViewer=null}let n=this.pict.providers["RetoldRemote-Provider"],o="#/explore-image/"+(n?n.getFragmentIdentifier(t):t);0===(window.location.hash||"").indexOf("#/view/")?history.replaceState(null,"",o):window.location.hash=o;let r=document.getElementById("RetoldRemote-Gallery-Container"),a=document.getElementById("RetoldRemote-Viewer-Container");r&&(r.style.display="none"),a&&(a.style.display="block");let s=t.replace(/^.*\//,""),l='<div class="retold-remote-iex">';l+='<div class="retold-remote-iex-header">',l+='<button class="retold-remote-iex-nav-btn" onclick="pict.views[\'RetoldRemote-ImageExplorer\'].goBack()" title="Back (Esc)">← Back</button>',l+='<div class="retold-remote-iex-title">Image Explorer — '+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(s)+"</div>",l+='<div class="retold-remote-iex-actions">',l+='<button class="retold-remote-iex-action-btn" id="RetoldRemote-IEX-SelectBtn" onclick="pict.views[\'RetoldRemote-ImageExplorer\'].toggleSelectionMode()" title="Select a region (s)">✂ Select</button>',l+='<button class="retold-remote-iex-action-btn" onclick="pict.views[\'RetoldRemote-ImageExplorer\'].viewInBrowser()" title="View in standard viewer">🖼 View</button>',l+="</div>",l+="</div>",l+='<div class="retold-remote-iex-info" id="RetoldRemote-IEX-Info" style="display:none;"></div>',l+='<div class="retold-remote-iex-body" id="RetoldRemote-IEX-Body">',l+='<div class="retold-remote-iex-loading" id="RetoldRemote-IEX-Loading">',l+="<div>Loading image…</div>",l+="</div>",l+='<div id="RetoldRemote-IEX-Viewer" style="display:none;"></div>',l+="</div>",l+='<div class="retold-remote-iex-controls" id="RetoldRemote-IEX-Controls" style="display:none;">',l+='<button onclick="pict.views[\'RetoldRemote-ImageExplorer\'].zoomIn()" title="Zoom In (+)">+ Zoom In</button>',l+='<span class="retold-remote-iex-zoom-label" id="RetoldRemote-IEX-ZoomLabel">100%</span>',l+='<button onclick="pict.views[\'RetoldRemote-ImageExplorer\'].zoomOut()" title="Zoom Out (-)">- Zoom Out</button>',l+='<button onclick="pict.views[\'RetoldRemote-ImageExplorer\'].zoomHome()" title="Fit to view (0)">Fit</button>',l+='<span style="flex:1;"></span>',l+='<span id="RetoldRemote-IEX-LabelInput" style="display:none;">',l+='<input type="text" id="RetoldRemote-IEX-LabelField" placeholder="Label this region…" style="background:var(--retold-bg-input,#1e1e1e);color:var(--retold-text,#abb2bf);border:1px solid var(--retold-border,#3e4451);border-radius:4px;padding:2px 8px;font-size:0.78rem;width:180px;margin-right:4px;" onkeydown="if(event.key===\'Enter\'){pict.views[\'RetoldRemote-ImageExplorer\'].saveSelectionLabel();event.preventDefault();event.stopPropagation();}if(event.key===\'Escape\'){pict.views[\'RetoldRemote-ImageExplorer\'].cancelSelection();event.preventDefault();event.stopPropagation();}">',l+='<button onclick="pict.views[\'RetoldRemote-ImageExplorer\'].saveSelectionLabel()" style="font-size:0.75rem;padding:2px 8px;">Save</button>',l+='<button onclick="pict.views[\'RetoldRemote-ImageExplorer\'].cancelSelection()" style="font-size:0.75rem;padding:2px 8px;margin-left:2px;">Cancel</button>',l+="</span>",l+='<span id="RetoldRemote-IEX-Coords" style="color:var(--retold-text-dim);font-size:0.72rem;"></span>',l+="</div>",l+="</div>",a&&(a.innerHTML=l);let d=this.pict.views["ContentEditor-TopBar"];d&&d.updateInfo();let c=this;this._ensureOSDLoaded(()=>{c._probeAndShow(t),c._loadSavedRegions(t)})}_ensureOSDLoaded(t){if("undefined"!=typeof OpenSeadragon)return this._osdLoaded=!0,t();let e=this,i=document.createElement("script");i.src="https://cdnjs.cloudflare.com/ajax/libs/openseadragon/4.1.1/openseadragon.min.js",i.onload=function(){e._osdLoaded=!0,t()},i.onerror=function(){e._showError("Failed to load OpenSeadragon library.")},document.head.appendChild(i)}_probeAndShow(t){if(this._loading)return;this._loading=!0;let e=this,i=this.pict.providers["RetoldRemote-Provider"],n=i?i._getPathParam(t):encodeURIComponent(t);fetch("/api/media/image-preview?path="+n).then(t=>t.json()).then(i=>{if(!i||!i.Success)return e._loading=!1,void(e._isRawExtension(t)?e._showRawUnsupported():e._showSimpleImage(t));if(Math.max(i.OrigWidth||0,i.OrigHeight||0)>4096)e._generateAndShowTiles(t,n,i);else if(e._loading=!1,e._dziData={Width:i.OrigWidth,Height:i.OrigHeight},e._showSimpleImageInfo(i.OrigWidth,i.OrigHeight),i.IsRawFormat&&i.CacheKey){let t="/api/media/image-preview-file/"+encodeURIComponent(i.CacheKey)+"/"+encodeURIComponent(i.OutputFilename);e._initSimpleViewer(null,t)}else e._initSimpleViewer(t)}).catch(()=>{e._loading=!1,e._showSimpleImage(t)})}_showSimpleImage(t){this._dziData={Width:0,Height:0},this._initSimpleViewer(t)}_isRawExtension(t){return!!{nef:!0,nrw:!0,cr2:!0,cr3:!0,crw:!0,arw:!0,srf:!0,sr2:!0,raf:!0,orf:!0,rw2:!0,rwl:!0,pef:!0,srw:!0,x3f:!0,"3fr":!0,fff:!0,iiq:!0,dcr:!0,kdc:!0,mrw:!0,erf:!0,raw:!0,dng:!0,heic:!0,heif:!0}[(t||"").replace(/^.*\./,"").toLowerCase()]}_showRawUnsupported(){let t=document.getElementById("RetoldRemote-IEX-Loading");t&&(t.innerHTML='<div style="padding: 2em; text-align: center; color: #999;">Raw image preview not available.<br>Install dcraw on the server for raw camera format support.</div>')}_showSimpleImageInfo(t,e){let i=document.getElementById("RetoldRemote-IEX-Info");if(!i)return;let n="";n+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Dimensions:</span> ',n+='<span class="retold-remote-iex-info-value">'+t+" × "+e+" px</span></span>",n+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Size:</span> ',n+='<span class="retold-remote-iex-info-value">'+(t*e/1e6).toFixed(1)+" MP</span></span>",n+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Mode:</span> ',n+='<span class="retold-remote-iex-info-value">Direct</span></span>',i.innerHTML=n,i.style.display=""}_initSimpleViewer(t,e){let i=document.getElementById("RetoldRemote-IEX-Loading"),n=document.getElementById("RetoldRemote-IEX-Viewer"),o=document.getElementById("RetoldRemote-IEX-Controls");i&&(i.style.display="none"),n&&(n.style.display="block"),o&&(o.style.display="");let r,a=this;if(e)r=e;else{let e=this.pict.providers["RetoldRemote-Provider"];r=e?e.getContentURL(t):"/content/"+encodeURIComponent(t)}this._osdViewer=OpenSeadragon({id:"RetoldRemote-IEX-Viewer",tileSources:{type:"image",url:r},prefixUrl:"",showNavigationControl:!1,showNavigator:!0,navigatorPosition:"BOTTOM_RIGHT",navigatorSizeRatio:.15,animationTime:.3,blendTime:.1,minZoomLevel:.1,maxZoomLevel:20,visibilityRatio:.5,constrainDuringPan:!1,gestureSettingsMouse:{scrollToZoom:!0,clickToZoom:!0,dblClickToZoom:!0,flickEnabled:!1},gestureSettingsTouch:{pinchToZoom:!0,flickEnabled:!0,flickMinSpeed:120,flickMomentum:.25}}),this._osdViewer.addHandler("zoom",function(){a._updateZoomLabel()}),this._osdViewer.addHandler("open",function(){let t=a._osdViewer.world.getItemAt(0);if(t){let e=t.getContentSize();e&&(a._dziData={Width:e.x,Height:e.y})}a._updateZoomLabel(),a._viewerReady=!0,a._savedRegions&&a._savedRegions.length>0&&a._renderSavedRegionOverlays()}),void 0!==OpenSeadragon.MouseTracker&&new OpenSeadragon.MouseTracker({element:n,moveHandler:function(t){a._updateCoords(t.position)}})}_generateAndShowTiles(t,e,i){let n=this,o=null;i&&i.CacheKey&&i.OutputFilename&&(o="/api/media/image-preview-file/"+encodeURIComponent(i.CacheKey)+"/"+encodeURIComponent(i.OutputFilename)),o&&(this._dziData={Width:i.OrigWidth,Height:i.OrigHeight},this._showPreviewInfo(i.OrigWidth,i.OrigHeight),this._initSimpleViewer(null,o)),this._cancelActiveDziOperation();let r=this.pict.providers["RetoldRemote-OperationStatus"],a=r?r.startOperation({Label:"Generating deep-zoom tiles",Phase:"Reading image…",Cancelable:!0}):null;a&&(this._activeDziOperationId=a.OperationId,this._activeDziAbortController=a.AbortController);let s={};a&&a.AbortController&&(s.signal=a.AbortController.signal),a&&(s.headers={"X-Op-Id":a.OperationId}),fetch("/api/media/dzi?path="+e,s).then(t=>t.json()).then(e=>{if(n._loading=!1,!e||!e.Success)return a&&r&&r.errorOperation(a.OperationId,{message:e&&e.Error||"DZI generation failed"}),void(o||n._showSimpleImage(t));if(a&&r&&r.completeOperation(a.OperationId),n._activeDziOperationId=null,n._activeDziAbortController=null,n._dziData=e,n._showInfo(e),n._osdViewer){try{n._osdViewer.destroy()}catch(t){}n._osdViewer=null}n._viewerReady=!1;let i=document.getElementById("RetoldRemote-IEX-Viewer");i&&(i.innerHTML=""),n._initViewer(e)}).catch(e=>{n._loading=!1,e&&"AbortError"===e.name||(a&&r&&r.errorOperation(a.OperationId,e),o||n._showSimpleImage(t))})}_cancelActiveDziOperation(){if(this._activeDziAbortController)try{this._activeDziAbortController.abort()}catch(t){}let t=this.pict.providers["RetoldRemote-OperationStatus"];this._activeDziOperationId&&t&&t.cancelOperation(this._activeDziOperationId),this._activeDziOperationId=null,this._activeDziAbortController=null}_showPreviewInfo(t,e){let i=document.getElementById("RetoldRemote-IEX-Info");if(!i)return;let n="";n+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Dimensions:</span> ',n+='<span class="retold-remote-iex-info-value">'+t+" × "+e+" px</span></span>",n+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Size:</span> ',n+='<span class="retold-remote-iex-info-value">'+(t*e/1e6).toFixed(1)+" MP</span></span>",n+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Mode:</span> ',n+='<span class="retold-remote-iex-info-value retold-remote-iex-tiling-status">Preview — generating tiles…</span></span>',i.innerHTML=n,i.style.display=""}_showInfo(t){let e=document.getElementById("RetoldRemote-IEX-Info");if(!e)return;let i="";i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Dimensions:</span> ',i+='<span class="retold-remote-iex-info-value">'+t.Width+" × "+t.Height+" px</span></span>",i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Tile size:</span> ',i+='<span class="retold-remote-iex-info-value">'+t.TileSize+" px</span></span>",i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Format:</span> ',i+='<span class="retold-remote-iex-info-value">'+t.Format+"</span></span>",i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Size:</span> ',i+='<span class="retold-remote-iex-info-value">'+(t.Width*t.Height/1e6).toFixed(1)+" MP</span></span>",i+='<span class="retold-remote-iex-info-item"><span class="retold-remote-iex-info-label">Mode:</span> ',i+='<span class="retold-remote-iex-info-value">Tiled</span></span>',e.innerHTML=i,e.style.display=""}_initViewer(t){let e=document.getElementById("RetoldRemote-IEX-Loading"),i=document.getElementById("RetoldRemote-IEX-Viewer"),n=document.getElementById("RetoldRemote-IEX-Controls");e&&(e.style.display="none"),i&&(i.style.display="block"),n&&(n.style.display="");let o=this,r={Image:{xmlns:"http://schemas.microsoft.com/deepzoom/2008",Url:"/api/media/dzi-tile/"+encodeURIComponent(t.CacheKey)+"/",Format:t.Format,Overlap:String(t.Overlap),TileSize:String(t.TileSize),Size:{Width:String(t.Width),Height:String(t.Height)}}};this._osdViewer=OpenSeadragon({id:"RetoldRemote-IEX-Viewer",tileSources:r,prefixUrl:"",showNavigationControl:!1,showNavigator:!0,navigatorPosition:"BOTTOM_RIGHT",navigatorSizeRatio:.15,animationTime:.3,blendTime:.1,minZoomLevel:.1,maxZoomLevel:20,visibilityRatio:.5,constrainDuringPan:!1,gestureSettingsMouse:{scrollToZoom:!0,clickToZoom:!0,dblClickToZoom:!0,flickEnabled:!1},gestureSettingsTouch:{pinchToZoom:!0,flickEnabled:!0,flickMinSpeed:120,flickMomentum:.25}}),this._osdViewer.addHandler("zoom",function(t){o._updateZoomLabel()}),this._osdViewer.addHandler("open",function(){o._updateZoomLabel(),o._viewerReady=!0,o._savedRegions&&o._savedRegions.length>0&&o._renderSavedRegionOverlays()}),void 0!==OpenSeadragon.MouseTracker&&new OpenSeadragon.MouseTracker({element:i,moveHandler:function(t){o._updateCoords(t.position)}})}_updateZoomLabel(){if(!this._osdViewer)return;let t=document.getElementById("RetoldRemote-IEX-ZoomLabel");if(t){let e=this._osdViewer.viewport.getZoom(!0),i=this._osdViewer.viewport.getHomeZoom(),n=Math.round(e/i*100);t.textContent=n+"%"}}_updateCoords(t){if(!this._osdViewer||!this._dziData)return;let e=document.getElementById("RetoldRemote-IEX-Coords");if(e)try{let i=this._osdViewer.viewport.pointFromPixel(t),n=this._osdViewer.viewport.viewportToImageCoordinates(i),o=Math.round(n.x),r=Math.round(n.y);o>=0&&o<=this._dziData.Width&&r>=0&&r<=this._dziData.Height?e.textContent=o+", "+r:e.textContent=""}catch(t){}}zoomIn(){if(this._osdViewer){let t=this._osdViewer.viewport.getZoom();this._osdViewer.viewport.zoomTo(1.5*t)}}zoomOut(){if(this._osdViewer){let t=this._osdViewer.viewport.getZoom();this._osdViewer.viewport.zoomTo(t/1.5)}}zoomHome(){this._osdViewer&&this._osdViewer.viewport.goHome()}toggleSelectionMode(){this._selectionMode?this._exitSelectionMode():this._enterSelectionMode()}_enterSelectionMode(){if(!this._osdViewer)return;this._selectionMode=!0;let t=document.getElementById("RetoldRemote-IEX-SelectBtn");t&&(t.style.background="rgba(97, 175, 239, 0.4)",t.style.color="#fff"),this._osdViewer.setMouseNavEnabled(!1);let e=this,i=document.getElementById("RetoldRemote-IEX-Viewer");i&&(i.style.cursor="crosshair",this._selectionTracker=new OpenSeadragon.MouseTracker({element:i,pressHandler:function(t){e._onSelectionPress(t)},dragHandler:function(t){e._onSelectionDrag(t)},releaseHandler:function(t){e._onSelectionRelease(t)}}))}_exitSelectionMode(){this._selectionMode=!1;let t=document.getElementById("RetoldRemote-IEX-SelectBtn");t&&(t.style.background="",t.style.color=""),this._osdViewer&&this._osdViewer.setMouseNavEnabled(!0),this._selectionTracker&&(this._selectionTracker.destroy(),this._selectionTracker=null);let e=document.getElementById("RetoldRemote-IEX-Viewer");e&&(e.style.cursor=""),this._removeActiveSelectionOverlay(),this._selectionRegion=null,this._selectionStart=null,this._selectionStartScreenPos=null;let i=document.getElementById("RetoldRemote-IEX-LabelInput");i&&(i.style.display="none");let n=document.getElementById("RetoldRemote-IEX-Coords");n&&(n.style.display="")}_onSelectionPress(t){if(!this._osdViewer)return;this._removeActiveSelectionOverlay(),this._selectionStartScreenPos={x:t.position.x,y:t.position.y},this._selectionStart=this._osdViewer.viewport.pointFromPixel(t.position);let e=document.createElement("div");e.id="RetoldRemote-IEX-ActiveSelection",e.style.cssText="border: 2px solid rgba(97, 175, 239, 0.9); background: rgba(97, 175, 239, 0.15); pointer-events: none;",this._selectionOverlay=e,this._osdViewer.addOverlay({element:e,location:new OpenSeadragon.Rect(this._selectionStart.x,this._selectionStart.y,0,0)})}_onSelectionDrag(t){if(!this._osdViewer||!this._selectionStart||!this._selectionOverlay)return;let e=this._osdViewer.viewport.pointFromPixel(t.position),i=Math.min(this._selectionStart.x,e.x),n=Math.min(this._selectionStart.y,e.y),o=Math.abs(e.x-this._selectionStart.x),r=Math.abs(e.y-this._selectionStart.y);this._osdViewer.updateOverlay(this._selectionOverlay,new OpenSeadragon.Rect(i,n,o,r))}_onSelectionRelease(t){if(!this._osdViewer||!this._selectionStart)return;if(this._selectionStartScreenPos){let e=Math.abs(t.position.x-this._selectionStartScreenPos.x),i=Math.abs(t.position.y-this._selectionStartScreenPos.y);if(e<5&&i<5)return this._removeActiveSelectionOverlay(),this._selectionStart=null,void(this._selectionStartScreenPos=null)}let e=this._osdViewer.viewport.pointFromPixel(t.position),i=Math.min(this._selectionStart.x,e.x),n=Math.min(this._selectionStart.y,e.y),o=Math.abs(e.x-this._selectionStart.x),r=Math.abs(e.y-this._selectionStart.y),a=this._osdViewer.viewport.viewportToImageCoordinates(new OpenSeadragon.Point(i,n)),s=this._osdViewer.viewport.viewportToImageCoordinates(new OpenSeadragon.Point(i+o,n+r)),l={X:Math.max(0,Math.round(a.x)),Y:Math.max(0,Math.round(a.y)),Width:Math.round(s.x-a.x),Height:Math.round(s.y-a.y)};if(this._clampRegionToImage(l),l.Width<5||l.Height<5)return this._removeActiveSelectionOverlay(),this._selectionStart=null,void(this._selectionStartScreenPos=null);this._selectionRegion=l;let d=document.getElementById("RetoldRemote-IEX-LabelInput"),c=document.getElementById("RetoldRemote-IEX-Coords");d&&(d.style.display=""),c&&(c.style.display="none");let p=document.getElementById("RetoldRemote-IEX-LabelField");p&&(p.value="",p.focus())}_saveNewRegionLabel(){if(!this._selectionRegion)return;let t=document.getElementById("RetoldRemote-IEX-LabelField"),e=t?t.value.trim():"",i=this,n=this.pict.providers["RetoldRemote-Provider"];n?n._getPathParam(this._currentPath):encodeURIComponent(this._currentPath);fetch("/api/media/subimage-regions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({Path:this._currentPath,Region:{Label:e,X:this._selectionRegion.X,Y:this._selectionRegion.Y,Width:this._selectionRegion.Width,Height:this._selectionRegion.Height}})}).then(t=>t.json()).then(t=>{if(t&&t.Success){i._savedRegions=t.Regions||[],i._removeActiveSelectionOverlay(),i._renderSavedRegionOverlays();let n=i.pict.providers["RetoldRemote-ToastNotification"];n&&n.showToast("Subimage region saved"+(e?": "+e:""));let o=i.pict.views["RetoldRemote-SubimagesPanel"];o&&o.render()}}).catch(t=>{let e=i.pict.providers["RetoldRemote-ToastNotification"];e&&e.showToast("Failed to save region: "+t.message)}),this._selectionRegion=null,this._selectionStart=null,this._selectionStartScreenPos=null;let o=document.getElementById("RetoldRemote-IEX-LabelInput");o&&(o.style.display="none");let r=document.getElementById("RetoldRemote-IEX-Coords");r&&(r.style.display="")}_cancelNewSelection(){this._removeActiveSelectionOverlay(),this._selectionRegion=null,this._selectionStart=null,this._selectionStartScreenPos=null;let t=document.getElementById("RetoldRemote-IEX-LabelInput");t&&(t.style.display="none");let e=document.getElementById("RetoldRemote-IEX-Coords");e&&(e.style.display="")}_removeActiveSelectionOverlay(){let t=document.getElementById("RetoldRemote-IEX-ActiveSelection");if(t&&this._osdViewer)try{this._osdViewer.removeOverlay(t)}catch(e){t.parentElement&&t.parentElement.removeChild(t)}this._selectionOverlay=null}_loadSavedRegions(t){let e=this,i=t,n=this.pict.providers["RetoldRemote-Provider"],o=n?n._getPathParam(t):encodeURIComponent(t);fetch("/api/media/subimage-regions?path="+o).then(t=>t.json()).then(t=>{e._currentPath===i&&t&&t.Success&&Array.isArray(t.Regions)&&(e._savedRegions=t.Regions,e._viewerReady&&e._renderSavedRegionOverlays())}).catch(()=>{})}_renderSavedRegionOverlays(){if(!this._osdViewer)return;let t=document.getElementById("RetoldRemote-IEX-Viewer");if(t){let e=t.querySelectorAll(".retold-remote-iex-region-overlay");for(let t=0;t<e.length;t++)try{this._osdViewer.removeOverlay(e[t])}catch(i){e[t].parentElement&&e[t].parentElement.removeChild(e[t])}}for(let t=0;t<this._savedRegions.length;t++){let e=this._savedRegions[t];this._addRegionOverlay(e)}if(this._editingRegionID&&t){let e=t.querySelector('.retold-remote-iex-region-overlay[data-region-id="'+this._editingRegionID+'"]');e&&this._appendEditHandles(e)}}_addRegionOverlay(t){if(!this._osdViewer)return;let e=this,i=document.createElement("div");if(i.className="retold-remote-iex-region-overlay",i.setAttribute("data-region-id",t.ID),i.style.cssText="border: 2px solid rgba(229, 192, 123, 0.85); background: rgba(229, 192, 123, 0.08); pointer-events: auto; position: relative; cursor: pointer;",t.Label){let e=document.createElement("span");e.className="retold-remote-iex-region-label",e.style.cssText="position:absolute;top:-1px;left:-1px;background:rgba(229,192,123,0.9);color:#282c34;font-size:0.65rem;padding:1px 5px;border-radius:0 0 3px 0;white-space:nowrap;pointer-events:none;",e.textContent=t.Label,i.appendChild(e)}this._editingRegionID&&this._editingRegionID===t.ID?(i.style.border="2px solid rgba(97, 175, 239, 0.95)",i.style.background="rgba(97, 175, 239, 0.15)",i.style.opacity="1"):this._editingRegionID&&(i.style.opacity="0.35"),i.addEventListener("mousedown",function(i){e._editingRegionID!==t.ID&&i.stopPropagation()}),i.addEventListener("dblclick",function(i){i.stopPropagation(),i.preventDefault(),e._enterRegionEditMode(t.ID)});let n=new OpenSeadragon.Rect(t.X,t.Y,t.Width,t.Height),o=this._osdViewer.viewport.imageToViewportRectangle(n);this._osdViewer.addOverlay({element:i,location:o})}zoomToRegion(t){if(!this._osdViewer||!this._dziData)return;let e=null;for(let i=0;i<this._savedRegions.length;i++)if(this._savedRegions[i].ID===t){e=this._savedRegions[i];break}if(!e)return;let i=new OpenSeadragon.Rect(e.X,e.Y,e.Width,e.Height),n=this._osdViewer.viewport.imageToViewportRectangle(i);this._osdViewer.viewport.fitBounds(n)}deleteRegion(t){let e=this,i=this.pict.providers["RetoldRemote-Provider"],n=i?i._getPathParam(this._currentPath):encodeURIComponent(this._currentPath);fetch("/api/media/subimage-regions/"+encodeURIComponent(t)+"?path="+n,{method:"DELETE"}).then(t=>t.json()).then(t=>{if(t&&t.Success){e._savedRegions=t.Regions||[],e._renderSavedRegionOverlays();let i=e.pict.providers["RetoldRemote-ToastNotification"];i&&i.showToast("Region deleted");let n=e.pict.views["RetoldRemote-SubimagesPanel"];n&&n.render()}}).catch(()=>{})}getActiveSelection(){return this._selectionRegion}getSavedRegions(){return this._savedRegions}goBack(){if(this._cancelActiveDziOperation(),this._selectionMode&&this._exitSelectionMode(),this._osdViewer){try{this._osdViewer.destroy()}catch(t){}this._osdViewer=null}let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t.closeViewer()}viewInBrowser(){if(this._cancelActiveDziOperation(),this._osdViewer){try{this._osdViewer.destroy()}catch(t){}this._osdViewer=null}let t=this.pict.views["RetoldRemote-MediaViewer"];t&&t.showMedia(this._currentPath,"image")}_showError(t){let e=document.getElementById("RetoldRemote-IEX-Loading");e&&(e.style.display="none");let i=document.getElementById("RetoldRemote-IEX-Body");if(i){let e=this.pict.providers["RetoldRemote-FormattingUtilities"];i.innerHTML='<div class="retold-remote-iex-error"><div class="retold-remote-iex-error-message">'+e.escapeHTML(t||"An error occurred.")+'</div><button class="retold-remote-iex-nav-btn" onclick="pict.views[\'RetoldRemote-ImageExplorer\'].goBack()">Back to Image</button></div>'}}_clampRegionToImage(t){t&&(t.X<0&&(t.Width+=t.X,t.X=0),t.Y<0&&(t.Height+=t.Y,t.Y=0),this._dziData&&(t.X+t.Width>this._dziData.Width&&(t.Width=this._dziData.Width-t.X),t.Y+t.Height>this._dziData.Height&&(t.Height=this._dziData.Height-t.Y)))}_enterRegionEditMode(t){let e=null;for(let i=0;i<this._savedRegions.length;i++)if(this._savedRegions[i].ID===t){e=this._savedRegions[i];break}if(!e)return;this._selectionMode&&this._exitSelectionMode(),this._editingRegionID&&this._editingRegionID!==t&&this._exitRegionEditMode(),this._editingRegionID=t,this._editDragMode=null,this._editDragStart=null,this._editOriginalRect=null,this._osdViewer&&this._osdViewer.setMouseNavEnabled(!1),this._renderSavedRegionOverlays();let i=document.getElementById("RetoldRemote-IEX-LabelInput"),n=document.getElementById("RetoldRemote-IEX-Coords"),o=document.getElementById("RetoldRemote-IEX-LabelField");i&&(i.style.display=""),n&&(n.style.display="none"),o&&(o.value=e.Label||"",o.setAttribute("data-edit-mode","1"),o.focus(),o.select())}_exitRegionEditMode(){this._editingRegionID=null,this._editDragMode=null,this._editDragStart=null,this._editOriginalRect=null,this._editDocMoveHandler&&(document.removeEventListener("mousemove",this._editDocMoveHandler),this._editDocMoveHandler=null),this._editDocUpHandler&&(document.removeEventListener("mouseup",this._editDocUpHandler),this._editDocUpHandler=null),this._osdViewer&&this._osdViewer.setMouseNavEnabled(!0),this._renderSavedRegionOverlays();let t=document.getElementById("RetoldRemote-IEX-LabelInput"),e=document.getElementById("RetoldRemote-IEX-Coords"),i=document.getElementById("RetoldRemote-IEX-LabelField");t&&(t.style.display="none"),e&&(e.style.display=""),i&&(i.removeAttribute("data-edit-mode"),i.value="")}_appendEditHandles(t){let e=this,i=[{key:"tl",css:"top:-8px;left:-8px;cursor:nwse-resize;"},{key:"tr",css:"top:-8px;right:-8px;cursor:nesw-resize;"},{key:"bl",css:"bottom:-8px;left:-8px;cursor:nesw-resize;"},{key:"br",css:"bottom:-8px;right:-8px;cursor:nwse-resize;"},{key:"t",css:"top:-8px;left:50%;transform:translateX(-50%);cursor:ns-resize;"},{key:"b",css:"bottom:-8px;left:50%;transform:translateX(-50%);cursor:ns-resize;"},{key:"l",css:"top:50%;left:-8px;transform:translateY(-50%);cursor:ew-resize;"},{key:"r",css:"top:50%;right:-8px;transform:translateY(-50%);cursor:ew-resize;"}];for(let n=0;n<i.length;n++){let o=i[n],r=document.createElement("div");r.className="retold-remote-iex-edit-handle",r.setAttribute("data-handle",o.key),r.style.cssText="position:absolute;width:16px;height:16px;pointer-events:auto;z-index:10;"+o.css;let a=document.createElement("div");a.style.cssText="position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:8px;height:8px;background:#61afef;border:1.5px solid #fff;border-radius:50%;box-shadow:0 1px 3px rgba(0,0,0,0.5);",r.appendChild(a),r.addEventListener("mousedown",function(t){t.stopPropagation(),t.preventDefault(),e._onEditHandlePress(o.key,t)}),t.appendChild(r)}t.addEventListener("mousedown",function(i){i.target===t&&e._editingRegionID===t.getAttribute("data-region-id")&&(i.stopPropagation(),i.preventDefault(),e._onEditHandlePress("body",i))}),t.style.cursor="move"}_onEditHandlePress(t,e){if(!this._osdViewer)return;if(!this._editingRegionID)return;let i=document.getElementById("RetoldRemote-IEX-Viewer");if(!i)return;this._editDragMode=t;let n=i.getBoundingClientRect(),o=e.clientX-n.left,r=e.clientY-n.top;this._editDragStart=this._osdViewer.viewport.pointFromPixel(new OpenSeadragon.Point(o,r));let a=this._findSavedRegion(this._editingRegionID);if(!a)return void(this._editDragMode=null);let s=new OpenSeadragon.Rect(a.X,a.Y,a.Width,a.Height);this._editOriginalRect=this._osdViewer.viewport.imageToViewportRectangle(s);let l=this;this._editDocMoveHandler=function(t){l._onEditHandleMove(t)},this._editDocUpHandler=function(t){l._onEditHandleRelease(t)},document.addEventListener("mousemove",this._editDocMoveHandler),document.addEventListener("mouseup",this._editDocUpHandler)}_onEditHandleMove(t){if(!(this._osdViewer&&this._editDragStart&&this._editOriginalRect&&this._editDragMode))return;let e=document.getElementById("RetoldRemote-IEX-Viewer");if(!e)return;let i=e.getBoundingClientRect(),n=t.clientX-i.left,o=t.clientY-i.top,r=this._osdViewer.viewport.pointFromPixel(new OpenSeadragon.Point(n,o)),a=r.x-this._editDragStart.x,s=r.y-this._editDragStart.y,l=this._editOriginalRect.x,d=this._editOriginalRect.y,c=this._editOriginalRect.width,p=this._editOriginalRect.height;switch(this._editDragMode){case"body":l+=a,d+=s;break;case"tl":l+=a,d+=s,c-=a,p-=s;break;case"tr":d+=s,c+=a,p-=s;break;case"bl":l+=a,c-=a,p+=s;break;case"br":c+=a,p+=s;break;case"t":d+=s,p-=s;break;case"b":p+=s;break;case"l":l+=a,c-=a;break;case"r":c+=a}c<0&&(l+=c,c=-c),p<0&&(d+=p,p=-p);let h=e.querySelector('.retold-remote-iex-region-overlay[data-region-id="'+this._editingRegionID+'"]');h&&this._osdViewer.updateOverlay(h,new OpenSeadragon.Rect(l,d,c,p))}_onEditHandleRelease(t){if(this._editDocMoveHandler&&(document.removeEventListener("mousemove",this._editDocMoveHandler),this._editDocMoveHandler=null),this._editDocUpHandler&&(document.removeEventListener("mouseup",this._editDocUpHandler),this._editDocUpHandler=null),!this._osdViewer||!this._editingRegionID||!this._editDragMode)return void(this._editDragMode=null);let e=document.getElementById("RetoldRemote-IEX-Viewer");if(!e)return void(this._editDragMode=null);let i=e.querySelector('.retold-remote-iex-region-overlay[data-region-id="'+this._editingRegionID+'"]');if(!i)return void(this._editDragMode=null);let n=this._osdViewer.getOverlayById(i);if(!n||!n.location)return void(this._editDragMode=null);let o=n.location,r=this._osdViewer.viewport.viewportToImageCoordinates(new OpenSeadragon.Point(o.x,o.y)),a=this._osdViewer.viewport.viewportToImageCoordinates(new OpenSeadragon.Point(o.x+o.width,o.y+o.height)),s={X:Math.round(r.x),Y:Math.round(r.y),Width:Math.round(a.x-r.x),Height:Math.round(a.y-r.y)};this._clampRegionToImage(s);let l=this._findSavedRegion(this._editingRegionID);if(!l)return void(this._editDragMode=null);let d={X:l.X,Y:l.Y,Width:l.Width,Height:l.Height};d.X!==s.X||d.Y!==s.Y||d.Width!==s.Width||d.Height!==s.Height?(l.X=s.X,l.Y=s.Y,l.Width=s.Width,l.Height=s.Height,this._editDragMode=null,this._putRegionUpdate(l.ID,{X:s.X,Y:s.Y,Width:s.Width,Height:s.Height},d)):this._editDragMode=null}saveSelectionLabel(){if(this._editingRegionID){let t=document.getElementById("RetoldRemote-IEX-LabelField"),e=t?t.value.trim():"",i=this._findSavedRegion(this._editingRegionID);if(!i)return void this._exitRegionEditMode();let n=i.Label||"";if(e===n)return void this._exitRegionEditMode();i.Label=e;let o=this._editingRegionID;return this._exitRegionEditMode(),void this._putRegionUpdate(o,{Label:e},{Label:n})}return this._saveNewRegionLabel()}_putRegionUpdate(t,e,i){let n=this,o=Object.assign({Path:this._currentPath},e);fetch("/api/media/subimage-regions/"+encodeURIComponent(t),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(o)}).then(t=>t.json()).then(e=>{if(!e||!e.Success){n._revertRegion(t,i),n._renderSavedRegionOverlays();let o=n.pict.providers["RetoldRemote-ToastNotification"];if(o){let t=e&&e.Error?"Failed to save: "+e.Error:"Failed to save region update (file may have been modified).";o.showToast(t)}return}Array.isArray(e.Regions)&&(n._savedRegions=e.Regions),n._renderSavedRegionOverlays();let o=n.pict.views["RetoldRemote-SubimagesPanel"];o&&"function"==typeof o.refresh&&o.refresh();let r=n.pict.providers["RetoldRemote-ToastNotification"];r&&r.showToast("Region updated")}).catch(e=>{n._revertRegion(t,i),n._renderSavedRegionOverlays();let o=n.pict.providers["RetoldRemote-ToastNotification"];o&&o.showToast("Network error saving region: "+e.message)})}_revertRegion(t,e){if(!e)return;let i=this._findSavedRegion(t);if(i)for(let t in e)i[t]=e[t]}_findSavedRegion(t){for(let e=0;e<this._savedRegions.length;e++)if(this._savedRegions[e].ID===t)return this._savedRegions[e];return null}cancelSelection(){if(!this._editingRegionID)return this._cancelNewSelection();this._exitRegionEditMode()}}r.default_configuration=o,e.exports=r},{"pict-view":102}],160:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"RetoldRemote-ImageViewer",DefaultRenderable:"RetoldRemote-ImageViewer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:""};class r extends n{constructor(t,e,i){super(t,e,i),this._zoomLevel=1,this._naturalWidth=0,this._naturalHeight=0,this._resizeHandler=null}initImage(){let t=document.getElementById("RetoldRemote-ImageViewer-Img");if(!t)return;this._naturalWidth=t.naturalWidth,this._naturalHeight=t.naturalHeight,this._zoomLevel=1,this._applyDisplay(),this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler);let e=this,i=null;this._resizeHandler=function(){clearTimeout(i),i=setTimeout(function(){e._applyDisplay()},100)},window.addEventListener("resize",this._resizeHandler),this._showExploreButton()}_showExploreButton(){let t=document.getElementById("RetoldRemote-HeaderExploreBtn");t&&(t.style.display="")}_getFitMode(){return this.pict.AppData.RetoldRemote.ImageFitMode||"fit"}setFitMode(t){this.pict.AppData.RetoldRemote.ImageFitMode=t,this._zoomLevel=1,this._applyDisplay(),this.pict.PictApplication&&this.pict.PictApplication.saveSettings&&this.pict.PictApplication.saveSettings()}cycleFitMode(){let t;switch(this._getFitMode()){case"fit":t="auto";break;case"auto":t="original";break;default:t="fit"}this.setFitMode(t),this._showFitModeIndicator(t)}toggleZoom(){this._naturalWidth&&(1===this._zoomLevel?this._zoomLevel=2:this._zoomLevel=1,this._applyDisplay())}zoomIn(){this._zoomLevel=Math.min(1.25*this._zoomLevel,8),this._applyDisplay()}zoomOut(){this._zoomLevel=Math.max(this._zoomLevel/1.25,.25),this._applyDisplay()}zoomReset(){this._zoomLevel=1,this._applyDisplay()}_applyDisplay(){let t=document.getElementById("RetoldRemote-ImageViewer-Img");if(!t||!this._naturalWidth)return;let e=t.parentElement;if(!e)return;let i=this._getBaseSize(e),n=Math.round(i.width*this._zoomLevel),o=Math.round(i.height*this._zoomLevel);t.style.maxWidth="none",t.style.maxHeight="none",t.style.objectFit="",t.style.width=n+"px",t.style.height=o+"px",t.style.transform="",this._zoomLevel>1||n>e.clientWidth||o>e.clientHeight?t.style.cursor="zoom-out":t.style.cursor="zoom-in"}_getBaseSize(t){let e=this._naturalWidth,i=this._naturalHeight,n=t.clientWidth,o=t.clientHeight;if(!n||!o)return{width:e,height:i};let r=e/i;switch(this._getFitMode()){case"fit":{let t=n,e=n/r;return e>o&&(e=o,t=o*r),{width:t,height:e}}case"auto":{if(e<=n&&i<=o)return{width:e,height:i};let t=n,a=n/r;return a>o&&(a=o,t=o*r),{width:t,height:a}}default:return{width:e,height:i}}}_showFitModeIndicator(t){let e={fit:"Fit to Window",auto:"Original if Smaller",original:"Original Size"}[t]||t;this.pict.providers["RetoldRemote-ToastNotification"].showOverlayIndicator(e,1200)}cleanup(){this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null)}}r.default_configuration=o,e.exports=r},{"pict-view":102}],161:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"ContentEditor-Layout",DefaultRenderable:"RetoldRemote-Layout-Shell",DefaultDestinationAddress:"#ContentEditor-Application-Container",AutoRender:!1,CSS:"",Templates:[{Hash:"RetoldRemote-Layout-Shell",Template:'\n\t\t\t\t<div id="ContentEditor-TopBar-Container"></div>\n\t\t\t\t<div class="content-editor-body">\n\t\t\t\t\t<div class="content-editor-sidebar-wrap" style="width: 250px;">\n\t\t\t\t\t\t<div class="content-editor-sidebar-inner">\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-tabs">\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab active" data-tab="files" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'files\')">Files</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab" data-tab="favorites" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'favorites\')">Favorites</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab" data-tab="info" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'info\')">Info</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab" data-tab="subimages" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'subimages\')">Regions</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab" data-tab="settings" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'settings\')">Settings</button>\n\t\t\t\t\t\t\t\t<button class="content-editor-sidebar-tab content-editor-sidebar-tab-collections" data-tab="collections" onclick="pict.views[\'ContentEditor-Layout\'].switchSidebarTab(\'collections\')" style="display:none;">Collections</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="files" id="ContentEditor-Sidebar-Container"></div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="favorites" id="RetoldRemote-Favorites-Container" style="display:none">\n\t\t\t\t\t\t\t\t<div id="RetoldRemote-Favorites-Body"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="info" id="RetoldRemote-Info-Container" style="display:none"></div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="subimages" id="RetoldRemote-Subimages-Container" style="display:none"></div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="settings" id="RetoldRemote-Settings-Container" style="display:none"></div>\n\t\t\t\t\t\t\t<div class="content-editor-sidebar-pane" data-pane="collections" id="RetoldRemote-Collections-MobilePane" style="display:none"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class="content-editor-resize-handle"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div id="RetoldRemote-Content-Container">\n\t\t\t\t\t\t<div id="RetoldRemote-Gallery-Container"></div>\n\t\t\t\t\t\t<div id="RetoldRemote-Viewer-Container"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="retold-remote-collections-wrap collapsed" id="RetoldRemote-Collections-Wrap" style="width: 300px;">\n\t\t\t\t\t\t<div class="retold-remote-collections-resize-handle"></div>\n\t\t\t\t\t\t<div class="retold-remote-collections-inner">\n\t\t\t\t\t\t\t<div id="RetoldRemote-Collections-Container"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="retold-remote-operation-status" id="RetoldRemote-OperationStatus-Container"></div>\n\t\t\t'}],Renderables:[{RenderableHash:"RetoldRemote-Layout-Shell",TemplateHash:"RetoldRemote-Layout-Shell",DestinationAddress:"#ContentEditor-Application-Container"}]};class r extends n{constructor(t,e,i){super(t,e,i),this._sidebarDragging=!1,this._collectionsDragging=!1}onAfterRender(){super.onAfterRender(),this.pict.CSSMap.injectCSS(),this._setupResizeHandle();let t=this.pict.AppData.RetoldRemote;if(t&&t.SidebarCollapsed){let t=document.querySelector(".content-editor-sidebar-wrap");t&&t.classList.add("collapsed")}if(!this.isMobileDrawer()&&t&&t.SidebarWidth){let e=document.querySelector(".content-editor-sidebar-wrap");e&&!e.classList.contains("collapsed")&&(e.style.width=t.SidebarWidth+"px")}if(this.isMobileDrawer()&&t&&t.SidebarDrawerHeight){let e=document.querySelector(".content-editor-sidebar-wrap");e&&!e.classList.contains("collapsed")&&(e.style.height=t.SidebarDrawerHeight+"px")}if(t&&t.CollectionsPanelOpen){let e=document.getElementById("RetoldRemote-Collections-Wrap");e&&(e.classList.remove("collapsed"),t.CollectionsPanelWidth&&(e.style.width=t.CollectionsPanelWidth+"px"))}this._setupCollectionsResizeHandle();let e=this;window.addEventListener("hashchange",()=>{e.pict.PictApplication.resolveHash()})}isMobileDrawer(){return window.innerWidth<=600}toggleSidebar(){let t=document.querySelector(".content-editor-sidebar-wrap");if(!t)return;t.classList.toggle("collapsed");let e=this.pict.AppData.RetoldRemote,i=t.classList.contains("collapsed");if(e.SidebarCollapsed=i,!i)if(this.isMobileDrawer()){let i=e.SidebarDrawerHeight||Math.round(.33*window.innerHeight);t.style.height=i+"px"}else e.SidebarWidth&&(t.style.width=e.SidebarWidth+"px");this.pict.PictApplication.saveSettings();let n=this.pict.providers["RetoldRemote-GalleryNavigation"];n&&setTimeout(()=>n.recalculateColumns(),250)}switchSidebarTab(t){if(document.querySelectorAll(".content-editor-sidebar-tab").forEach(e=>{e.classList.toggle("active",e.getAttribute("data-tab")===t)}),document.querySelectorAll(".content-editor-sidebar-pane").forEach(e=>{e.style.display=e.getAttribute("data-pane")===t?"":"none"}),"subimages"===t){let t=this.pict.views["RetoldRemote-SubimagesPanel"];t&&t.render()}if("settings"===t){let t=this.pict.views["RetoldRemote-SettingsPanel"];t&&t.render()}if("favorites"===t&&this.renderFavoritesList(),"info"===t){let t=this.pict.views["RetoldRemote-FileInfoPanel"];t&&t.render()}if("collections"===t){let t=document.getElementById("RetoldRemote-Collections-Container"),e=document.getElementById("RetoldRemote-Collections-MobilePane");t&&e&&!e.contains(t)&&e.appendChild(t);let i=this.pict.views["RetoldRemote-CollectionsPanel"];i&&i.render();let n=this.pict.providers["RetoldRemote-CollectionManager"];n&&n.fetchCollections()}else{let t=document.getElementById("RetoldRemote-Collections-Container"),e=document.querySelector(".retold-remote-collections-inner");t&&e&&!e.contains(t)&&e.appendChild(t)}}notifyCurrentFileChanged(t){let e=document.querySelector(".content-editor-sidebar-tab.active");if(!e)return;let i=e.getAttribute("data-tab");if("subimages"===i){let t=this.pict.views["RetoldRemote-SubimagesPanel"];t&&t.render()}else if("info"===i){let t=this.pict.views["RetoldRemote-FileInfoPanel"];t&&t.render()}}_setupResizeHandle(){let t=this,e=document.querySelector(".content-editor-resize-handle"),i=document.querySelector(".content-editor-sidebar-wrap");if(!e||!i)return;let n=0,o=0,r=0,a=0;function s(t){return t.touches&&t.touches.length>0?{x:t.touches[0].clientX,y:t.touches[0].clientY}:{x:t.clientX,y:t.clientY}}function l(l){t._sidebarDragging=!0;let p=s(l);n=p.x,o=p.y,r=i.offsetWidth,a=i.offsetHeight,e.classList.add("dragging"),document.addEventListener("mousemove",d),document.addEventListener("mouseup",c),document.addEventListener("touchmove",d,{passive:!1}),document.addEventListener("touchend",c),l.preventDefault()}function d(e){if(!t._sidebarDragging)return;let l=s(e);if(t.isMobileDrawer()){let t=a+(l.y-o),e=Math.round(.7*window.innerHeight);t=Math.max(80,Math.min(t,e)),i.style.height=t+"px"}else{let t=r+(l.x-n);t=Math.max(150,Math.min(t,600)),i.style.width=t+"px"}e.preventDefault()}function c(){t._sidebarDragging=!1,e.classList.remove("dragging"),document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",c),document.removeEventListener("touchmove",d),document.removeEventListener("touchend",c);let n=t.pict.AppData.RetoldRemote;t.isMobileDrawer()?n.SidebarDrawerHeight=i.offsetHeight:n.SidebarWidth=i.offsetWidth,t.pict.PictApplication.saveSettings();let o=t.pict.providers["RetoldRemote-GalleryNavigation"];o&&o.recalculateColumns()}e.addEventListener("mousedown",l),e.addEventListener("touchstart",l,{passive:!1}),e.addEventListener("dblclick",function(e){e.preventDefault(),t.toggleSidebar()})}toggleCollectionsPanel(){let t=this.pict.providers["RetoldRemote-CollectionManager"];t&&t.togglePanel()}renderFavoritesList(){let t=document.getElementById("RetoldRemote-Favorites-Body");if(!t)return;let e=this.pict.AppData.RetoldRemote.FavoritesCollection,i=this.pict.providers["RetoldRemote-Icons"];if(!e||!Array.isArray(e.Items)||0===e.Items.length)return void(t.innerHTML='<div class="retold-remote-favorites-empty"><div style="font-size:1.5rem; margin-bottom:8px; opacity:0.4;">♡</div>No favorites yet.<br>Tap ♡ or press <b>h</b> to favorite files.</div>');let n="";for(let t=0;t<e.Items.length;t++){let o=e.Items[t],r=o.Path||"",a=r.split("/").pop()||r,s=a.lastIndexOf(".")>=0?a.substring(a.lastIndexOf(".")):"",l="";i&&(l=i.getIconForEntry({Type:"folder"===o.Type?"folder":"file",Extension:s},16));let d=r.replace(/'/g,"\\'");n+='<div class="retold-remote-favorites-item" onclick="pict.PictApplication.navigateToFile(\''+d+"')\">",n+='<span class="retold-remote-favorites-item-icon">'+l+"</span>",n+='<span class="retold-remote-favorites-item-name" title="'+r+'">'+a+"</span>",n+="<button class=\"retold-remote-favorites-item-remove\" onclick=\"event.stopPropagation(); pict.providers['RetoldRemote-CollectionManager'].toggleFavorite('"+d+'\')" title="Remove from favorites">×</button>',n+="</div>"}t.innerHTML=n}_setupCollectionsResizeHandle(){let t=document.querySelector(".retold-remote-collections-resize-handle"),e=document.getElementById("RetoldRemote-Collections-Wrap");if(!t||!e)return;let i=this,n=0,o=0;function r(r){if(e.classList.contains("collapsed"))return;r.preventDefault(),i._collectionsDragging=!0,t.classList.add("dragging");let l=r.touches?r.touches[0].clientX:r.clientX;n=l,o=e.getBoundingClientRect().width,document.addEventListener("mousemove",a),document.addEventListener("mouseup",s),document.addEventListener("touchmove",a,{passive:!1}),document.addEventListener("touchend",s)}function a(t){if(!i._collectionsDragging)return;t.preventDefault();let r=t.touches?t.touches[0].clientX:t.clientX,a=n-r,s=Math.max(150,Math.min(600,o+a));e.style.width=s+"px"}function s(){if(!i._collectionsDragging)return;i._collectionsDragging=!1,t.classList.remove("dragging"),i.pict.AppData.RetoldRemote.CollectionsPanelWidth=e.getBoundingClientRect().width,i.pict.PictApplication.saveSettings(),document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",s),document.removeEventListener("touchmove",a),document.removeEventListener("touchend",s);let n=i.pict.providers["RetoldRemote-GalleryNavigation"];n&&"function"==typeof n.recalculateColumns&&n.recalculateColumns()}t.addEventListener("mousedown",r),t.addEventListener("touchstart",r,{passive:!1}),t.addEventListener("dblclick",function(t){t.preventDefault(),i.toggleCollectionsPanel()})}}r.default_configuration=o,e.exports=r},{"pict-view":102}],162:[function(t,e,i){const n=t("pict-view"),o=t("./MediaViewer-EbookViewer"),r=t("./MediaViewer-CodeViewer"),a=t("./MediaViewer-PdfViewer"),s={ViewIdentifier:"RetoldRemote-MediaViewer",DefaultRenderable:"RetoldRemote-MediaViewer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:""};class l extends n{constructor(t,e,i){super(t,e,i),this._swipeStartX=0,this._swipeStartY=0,this._swipeTouchCount=0,this._swipeHandlers=null,this._dfExitHandlers=null}showMedia(t,e){let i=this.pict.AppData.RetoldRemote;i.ActiveMode="viewer",i.CurrentViewerFile=t,i.CurrentViewerMediaType=e,i.VideoMenuActive="video"===e;let n=this.pict.views["ContentEditor-Layout"];n&&"function"==typeof n.notifyCurrentFileChanged&&n.notifyCurrentFileChanged(t);let o=document.getElementById("RetoldRemote-Gallery-Container"),r=document.getElementById("RetoldRemote-Viewer-Container");o&&(o.style.display="none"),r&&(r.style.display="block");let a=t.replace(/^.*\//,""),s=this.pict.providers["RetoldRemote-Provider"],l=s?s.getContentURL(t):"/content/"+encodeURIComponent(t),d='<div class="retold-remote-viewer">';if(d+='<div class="retold-remote-viewer-header">',d+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].closeViewer()" title="Back (Esc)">← Back</button>',d+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].prevFile()" title="Previous (k)">‹ Prev</button>',d+='<div class="retold-remote-viewer-title">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(a)+"</div>",d+='<button class="retold-remote-viewer-nav-btn" id="RetoldRemote-HeaderExploreBtn" onclick="pict.views[\'RetoldRemote-ImageExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore image (e)" style="display:none;">🔍 Explore</button>',d+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].nextFile()" title="Next (j)">Next ›</button>',d+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleFileInfo()" title="Info (i)">ⓘ</button>',d+='<button class="retold-remote-viewer-nav-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].toggleDistractionFree()" title="Distraction-Free (d)">▢</button>',d+="</div>",d+='<div class="retold-remote-viewer-body">',d+='<div class="retold-remote-df-exit-hotspot" id="RetoldRemote-DF-ExitHotspot"'+(i._distractionFreeMode?"":' style="display:none"')+"></div>","image"===e)d+=this._buildImagePlaceholderHTML(a);else switch(e){case"video":d+=this._buildVideoHTML(l,a);break;case"audio":d+=this._buildAudioHTML(l,a);break;case"text":d+=this._buildTextHTML(l,a,t);break;case"document":d+=this._buildDocumentHTML(l,a,t);break;default:d+=this._buildFallbackHTML(l,a)}if(d+='<div class="retold-remote-fileinfo-overlay" id="RetoldRemote-FileInfo-Overlay">',d+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Loading...</span></div>',d+="</div>",d+="</div>",d+="</div>",r&&(r.innerHTML=d),"image"===e&&this._probeAndShowImage(t,l,a),this._loadFileInfo(t),"text"===e&&this._loadCodeViewer(l,t),"document"===e){let e=t.replace(/^.*\./,"").toLowerCase();"epub"===e||"mobi"===e?this._loadEbookViewer(l,t):"pdf"===e?this._loadPdfViewer(l,t):this._loadConvertedDocumentViewer(t)}this._setupSwipeNavigation(),this._setupDFExitHotspot();let c=this.pict.views["ContentEditor-TopBar"];c&&c.updateInfo()}showDirectImage(t,e,i){let n=this.pict.AppData.RetoldRemote;n.ActiveMode="viewer",n.CurrentViewerFile=i||"",n.CurrentViewerMediaType="image",n.VideoMenuActive=!1;let o=this.pict.views["ContentEditor-Layout"];o&&"function"==typeof o.notifyCurrentFileChanged&&o.notifyCurrentFileChanged(i||"");let r=document.getElementById("RetoldRemote-Gallery-Container"),a=document.getElementById("RetoldRemote-Viewer-Container");r&&(r.style.display="none"),a&&(a.style.display="block");let s=this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e),l='<div class="retold-remote-viewer">';l+='<div class="retold-remote-viewer-header">',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].closeViewer()" title="Back (Esc)">← Back</button>',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].prevFile()" title="Previous (k)">‹ Prev</button>',l+='<div class="retold-remote-viewer-title">'+s+"</div>",l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\'].nextFile()" title="Next (j)">Next ›</button>',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleFileInfo()" title="Info (i)">ⓘ</button>',l+='<button class="retold-remote-viewer-nav-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].toggleDistractionFree()" title="Distraction-Free (d)">▢</button>',l+="</div>",l+='<div class="retold-remote-viewer-body">',l+='<div class="retold-remote-df-exit-hotspot" id="RetoldRemote-DF-ExitHotspot"'+(n._distractionFreeMode?"":' style="display:none"')+"></div>",l+='<img id="RetoldRemote-ImageViewer-Img" src="'+t+'" alt="'+s+"\" style=\"max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in;\" onload=\"if (pict.views['RetoldRemote-ImageViewer']) pict.views['RetoldRemote-ImageViewer'].initImage();\" onclick=\"if (pict.views['RetoldRemote-ImageViewer']) pict.views['RetoldRemote-ImageViewer'].toggleZoom();\" />",l+='<div class="retold-remote-fileinfo-overlay" id="RetoldRemote-FileInfo-Overlay">',l+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Frame: '+s+"</span></div>",l+="</div>",l+="</div>",l+="</div>",a&&(a.innerHTML=l),this._setupSwipeNavigation(),this._setupDFExitHotspot();let d=this.pict.views["ContentEditor-TopBar"];d&&d.updateInfo()}_setupSwipeNavigation(){this._cleanupSwipe();let t=document.querySelector(".retold-remote-viewer-body");if(!t)return;let e=this,i=function(t){e._swipeTouchCount=t.touches.length,1===t.touches.length&&(e._swipeStartX=t.touches[0].clientX,e._swipeStartY=t.touches[0].clientY)},n=function(t){if(1!==e._swipeTouchCount)return;let i=t.changedTouches[0].clientX,n=t.changedTouches[0].clientY,o=i-e._swipeStartX,r=n-e._swipeStartY;if(Math.abs(o)<50||Math.abs(r)>Math.abs(o))return;let a=document.querySelector(".retold-remote-viewer-body");if(a&&a.scrollWidth>a.clientWidth+2)return;let s=e.pict.providers["RetoldRemote-GalleryNavigation"];s&&(o<0?s.nextFile():s.prevFile())};t.addEventListener("touchstart",i,{passive:!0}),t.addEventListener("touchend",n,{passive:!0}),this._swipeHandlers={element:t,touchstart:i,touchend:n}}_cleanupSwipe(){this._swipeHandlers&&(this._swipeHandlers.element.removeEventListener("touchstart",this._swipeHandlers.touchstart),this._swipeHandlers.element.removeEventListener("touchend",this._swipeHandlers.touchend),this._swipeHandlers=null)}toggleDistractionFree(){let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t._toggleDistractionFree(),this._updateDFControls()}_updateDFControls(){let t=this.pict.AppData.RetoldRemote._distractionFreeMode||!1,e=document.getElementById("RetoldRemote-DF-ExitHotspot");e&&(e.style.display=t?"":"none")}_setupDFExitHotspot(){this._cleanupDFExitHotspot();let t=document.getElementById("RetoldRemote-DF-ExitHotspot");if(!t)return;let e=this,i=function(){e.pict.AppData.RetoldRemote._distractionFreeMode&&e.toggleDistractionFree()},n=0,o=function(t){let i=Date.now();if(i-n<300){t.preventDefault(),e.pict.AppData.RetoldRemote._distractionFreeMode&&e.toggleDistractionFree(),n=0}else n=i};t.addEventListener("dblclick",i),t.addEventListener("touchend",o),this._dfExitHandlers={element:t,dblclick:i,touchend:o}}_cleanupDFExitHotspot(){this._dfExitHandlers&&(this._dfExitHandlers.element.removeEventListener("dblclick",this._dfExitHandlers.dblclick),this._dfExitHandlers.element.removeEventListener("touchend",this._dfExitHandlers.touchend),this._dfExitHandlers=null)}_buildImagePlaceholderHTML(t){return'<div id="RetoldRemote-ImagePlaceholder" style="display:flex;align-items:center;justify-content:center;height:100%;color:var(--retold-text-dim);font-size:0.85rem;">Loading '+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(t)+"…</div>"}_probeAndShowImage(t,e,i){let n=this,o=this.pict.providers["RetoldRemote-Provider"],r=o?o._getPathParam(t):encodeURIComponent(t);fetch("/api/media/image-preview?path="+r).then(t=>t.json()).then(o=>{if(!o||!o.Success)return void n._insertImageTag(e,i,!1);if(!o.IsRawFormat&&"number"==typeof o.OrigFileSize&&"number"==typeof o.DirectDisplayMaxFileSize&&o.DirectDisplayMaxFileSize>0&&o.OrigFileSize<=o.DirectDisplayMaxFileSize)return void n._insertImageTag(e,i,!1);if(Math.max(o.OrigWidth||0,o.OrigHeight||0)>8192){let e=n.pict.views["RetoldRemote-ImageExplorer"];if(e)return void e.showExplorer(t)}if(o.NeedsPreview&&o.CacheKey){let t="/api/media/image-preview-file/"+encodeURIComponent(o.CacheKey)+"/"+encodeURIComponent(o.OutputFilename);return void n._insertImageTag(t,i,!0,o.OrigWidth,o.OrigHeight)}n._insertImageTag(e,i,!1)}).catch(()=>{n._insertImageTag(e,i,!1)})}_insertImageTag(t,e,i,n,o){let r=document.getElementById("RetoldRemote-ImagePlaceholder");if(!r||!r.parentElement)return;let a=this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e),s=document.createDocumentFragment(),l=document.createElement("img");l.src=t,l.alt=a,l.id="RetoldRemote-ImageViewer-Img",l.style.cssText="max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in;",l.onload=function(){pict.views["RetoldRemote-ImageViewer"].initImage()},l.onclick=function(){pict.views["RetoldRemote-ImageViewer"].toggleZoom()},s.appendChild(l);let d=document.getElementById("RetoldRemote-HeaderExploreBtn");if(d&&(d.style.display=""),i&&n&&o){let t=document.createElement("div");t.id="RetoldRemote-LargeImageBadge",t.className="retold-remote-image-large-badge",t.textContent=n+" × "+o+" px (preview)",s.appendChild(t)}r.parentElement.replaceChild(s,r)}_buildImageHTML(t,e){return'<img src="'+t+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'" style="max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in;" id="RetoldRemote-ImageViewer-Img" onload="pict.views[\'RetoldRemote-ImageViewer\'].initImage()" onclick="pict.views[\'RetoldRemote-ImageViewer\'].toggleZoom()">'}_buildVideoHTML(t,e){let i=this.pict.AppData.RetoldRemote.ServerCapabilities||{},n=(this.pict.AppData.RetoldRemote.CurrentViewerFile,'<div class="retold-remote-video-action-menu" id="RetoldRemote-VideoActionMenu">');return n+='<div class="retold-remote-video-action-menu-title">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+"</div>",i.ffmpeg&&(n+='<div id="RetoldRemote-VideoActionThumb" class="retold-remote-video-action-thumb-wrap"></div>',setTimeout(()=>{this.loadVideoMenuFrame()},0)),i.ffmpeg&&(n+='<button class="retold-remote-video-action-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore frames from this video"><span class="retold-remote-video-action-key">e</span>Explore Video Frames</button>'),n+='<button class="retold-remote-video-action-btn selected" onclick="pict.views[\'RetoldRemote-MediaViewer\'].playVideo()" title="Play video in browser"><span class="retold-remote-video-action-key">Space</span>Play in Browser</button>',i.ffmpeg&&(n+='<button class="retold-remote-video-action-btn" onclick="pict.views[\'RetoldRemote-MediaViewer\'].loadVideoMenuFrame()" title="Extract a frame from the midpoint of this video"><span class="retold-remote-video-action-key">t</span>Thumbnail</button>'),n+='<button class="retold-remote-video-action-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream to VLC on this device"><span class="retold-remote-video-action-key">v</span>Stream with VLC</button>',n+="</div>",n}playVideo(){let t=this.pict.AppData.RetoldRemote,e=t.CurrentViewerFile;if(!e)return;e.replace(/^.*\//,"");let i=this.pict.providers["RetoldRemote-Provider"],n=i?i.getContentURL(e):"/content/"+encodeURIComponent(e),o=t.ServerCapabilities||{},r='<div class="retold-remote-video-wrap">';r+="<video controls"+(t.AutoplayVideo?" autoplay":"")+' preload="metadata" id="RetoldRemote-VideoPlayer"><source src="'+n+'">Your browser does not support the video tag.</video>',r+='<div class="retold-remote-video-stats" id="RetoldRemote-VideoStats">',r+='<span class="retold-remote-video-stat-label">Loading info...</span>',o.ffmpeg&&(r+='<button class="retold-remote-explore-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore frames from this video">Explore Video</button>'),r+='<button class="retold-remote-vlc-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream to VLC on this device">Stream with VLC</button>',r+="</div>",r+="</div>";let a=document.getElementById("RetoldRemote-VideoActionMenu");a&&(a.outerHTML=r),t.VideoMenuActive=!1}loadVideoMenuFrame(){let t=this.pict.AppData.RetoldRemote,e=t.CurrentViewerFile;if(!e)return;let i=document.getElementById("RetoldRemote-VideoActionThumb");if(!i)return;i.innerHTML='<div class="retold-remote-video-action-thumb-loading">Extracting frame...</div>';let n=this.pict.providers["RetoldRemote-Provider"],o=n?n._getPathParam(e):encodeURIComponent(e);fetch("/api/media/video-frames?path="+o+"&count=1").then(t=>t.json()).then(i=>{if(t.CurrentViewerFile!==e)return;let n=document.getElementById("RetoldRemote-VideoActionThumb");if(n)if(i&&i.Frames&&i.Frames.length>0){let t=i.Frames[0],o="/api/media/video-frame/"+i.CacheKey+"/"+t.Filename;n.innerHTML='<img src="'+o+'" alt="'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e.replace(/^.*\//,""))+'" onerror="this.parentNode.innerHTML=\'\'">'}else n.innerHTML=""}).catch(()=>{let t=document.getElementById("RetoldRemote-VideoActionThumb");t&&(t.innerHTML="")})}_buildAudioHTML(t,e){let i=this.pict.providers["RetoldRemote-Icons"],n='<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(i?'<span class="retold-remote-icon retold-remote-icon-lg">'+i.getIcon("music-note",64)+"</span>":"🎵")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+"</div><audio controls"+(this.pict.AppData.RetoldRemote.AutoplayAudio?" autoplay":"")+' preload="metadata" id="RetoldRemote-AudioPlayer" style="width: 100%; max-width: 500px;"><source src="'+t+'">Your browser does not support the audio tag.</audio>';n+='<div style="margin-top: 20px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;">';let o=this.pict.AppData.RetoldRemote.ServerCapabilities||{};return(o.ffprobe||o.ffmpeg)&&(n+='<button class="retold-remote-explore-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].showExplorer(pict.AppData.RetoldRemote.CurrentViewerFile)" title="Explore waveform and extract segments from this audio">Explore Audio</button>'),n+='<button class="retold-remote-vlc-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream to VLC on this device (v)">Stream with VLC</button>',n+="</div>",n+="</div>",n}_buildDocumentHTML(t,e,i){let n=i.replace(/^.*\./,"").toLowerCase();if("pdf"===n)return this._buildPdfHTML(t,e,i);if("epub"===n||"mobi"===n)return this._buildEbookHTML(t,e,i);if({doc:!0,docx:!0,rtf:!0,odt:!0,wpd:!0,wps:!0,pages:!0,odp:!0,ppt:!0,pptx:!0,ods:!0,xls:!0,xlsx:!0}[n])return this._buildPdfHTML(t,e,i);let o=this.pict.providers["RetoldRemote-Icons"];return'<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(o?'<span class="retold-remote-icon retold-remote-icon-lg">'+o.getIcon("document-large",64)+"</span>":"📄")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'</div><a href="'+t+'" target="_blank" style="color: var(--retold-accent); font-size: 0.9rem;">Open in new tab</a></div>'}_loadConvertedDocumentViewer(t){let e=this,i=this.pict.providers["RetoldRemote-Provider"],n=i?i._getPathParam(t):encodeURIComponent(t),o=document.getElementById("RetoldRemote-PdfContent");o&&(o.innerHTML='<div style="text-align:center;padding:40px;color:var(--retold-text-dim);"><div style="font-size:1.5rem;margin-bottom:12px;">⚙</div>Converting document to PDF…</div>'),fetch("/api/media/doc-convert?path="+n).then(t=>t.json()).then(i=>{if(!i||!i.Success)throw new Error(i?i.Error:"Conversion failed.");let n="/api/media/ebook/"+i.CacheKey+"/"+i.OutputFilename;e._loadPdfViewer(n,t)}).catch(n=>{if(o){let r=e.pict.providers["RetoldRemote-FormattingUtilities"];o.innerHTML='<div style="text-align:center;padding:40px;color:var(--retold-text-dim);"><div style="margin-bottom:12px;color:#e06c75;">Conversion failed</div><div style="font-size:0.85rem;">'+r.escapeHTML(n.message)+'</div><div style="margin-top:16px;"><a href="'+(i?i.getContentURL(t):"/content/"+encodeURIComponent(t))+'" target="_blank" style="color:var(--retold-accent);font-size:0.85rem;">Download original file</a></div></div>'}})}_buildFallbackHTML(t,e){let i=this.pict.providers["RetoldRemote-Icons"];return'<div style="text-align: center; padding: 40px;"><div style="margin-bottom: 24px;">'+(i?'<span class="retold-remote-icon retold-remote-icon-lg">'+i.getIcon("document-large",64)+"</span>":"📄")+'</div><div style="font-size: 1.1rem; color: var(--retold-text-secondary); margin-bottom: 24px;">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(e)+'</div><a href="'+t+'" target="_blank" style="color: var(--retold-accent); font-size: 0.9rem;">Download / Open in new tab</a></div>'}_loadFileInfo(t){let e=this,i=this.pict.providers["RetoldRemote-Provider"];i&&i.fetchMediaProbe(t,(t,i)=>{if(!i)return;let n=document.getElementById("RetoldRemote-FileInfo-Overlay");if(n){let t="";if(void 0!==i.Size&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Size</span><span class="retold-remote-fileinfo-value">'+e.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(i.Size)+"</span></div>"),i.Width&&i.Height&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Dimensions</span><span class="retold-remote-fileinfo-value">'+i.Width+" x "+i.Height+"</span></div>"),i.Duration){let e=Math.floor(i.Duration/60),n=Math.floor(i.Duration%60);t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Duration</span><span class="retold-remote-fileinfo-value">'+e+":"+(n<10?"0":"")+n+"</span></div>"}i.Codec&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Codec</span><span class="retold-remote-fileinfo-value">'+i.Codec+"</span></div>"),i.Format&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Format</span><span class="retold-remote-fileinfo-value">'+i.Format+"</span></div>"),i.Modified&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Modified</span><span class="retold-remote-fileinfo-value">'+new Date(i.Modified).toLocaleString()+"</span></div>"),i.Path&&(t+='<div class="retold-remote-fileinfo-row"><span class="retold-remote-fileinfo-label">Path</span><span class="retold-remote-fileinfo-value">'+i.Path+"</span></div>"),n.innerHTML=t}let o=document.getElementById("RetoldRemote-VideoStats");if(o){let t="";if(i.Duration){let e=Math.floor(i.Duration/60),n=Math.floor(i.Duration%60);t+='<span><span class="retold-remote-video-stat-label">Duration</span> <span class="retold-remote-video-stat-value">'+e+":"+(n<10?"0":"")+n+"</span></span>"}if(i.Width&&i.Height&&(t+='<span><span class="retold-remote-video-stat-label">Resolution</span> <span class="retold-remote-video-stat-value">'+i.Width+"×"+i.Height+"</span></span>"),i.Codec&&(t+='<span><span class="retold-remote-video-stat-label">Codec</span> <span class="retold-remote-video-stat-value">'+i.Codec+"</span></span>"),i.Bitrate){let e,n=i.Bitrate;e=n>=1e6?(n/1e6).toFixed(1)+" Mbps":n>=1e3?Math.round(n/1e3)+" kbps":n+" bps",t+='<span><span class="retold-remote-video-stat-label">Bitrate</span> <span class="retold-remote-video-stat-value">'+e+"</span></span>"}void 0!==i.Size&&(t+='<span><span class="retold-remote-video-stat-label">Size</span> <span class="retold-remote-video-stat-value">'+e.pict.providers["RetoldRemote-FormattingUtilities"].formatFileSize(i.Size)+"</span></span>");let n=o.querySelector(".retold-remote-explore-btn"),r=n?n.outerHTML:"",a=o.querySelector(".retold-remote-vlc-btn"),s=a?a.outerHTML:"";o.innerHTML=t+r+s}})}}Object.assign(l.prototype,o),Object.assign(l.prototype,r),Object.assign(l.prototype,a),l.default_configuration=s,e.exports=l},{"./MediaViewer-CodeViewer":152,"./MediaViewer-EbookViewer":153,"./MediaViewer-PdfViewer":154,"pict-view":102}],163:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"RetoldRemote-RegionsBrowser",DefaultRenderable:"RetoldRemote-RegionsBrowser",DefaultDestinationAddress:"#RetoldRemote-RegionsBrowser-Overlay",AutoRender:!1,CSS:"\n\t\t#RetoldRemote-RegionsBrowser-Overlay\n\t\t{\n\t\t\tposition: fixed;\n\t\t\ttop: 0; left: 0; right: 0; bottom: 0;\n\t\t\tbackground: rgba(0, 0, 0, 0.85);\n\t\t\tz-index: 10000;\n\t\t\tdisplay: none;\n\t\t\tflex-direction: column;\n\t\t}\n\t\t#RetoldRemote-RegionsBrowser-Overlay.active { display: flex; }\n\t\t.rrrb-header\n\t\t{\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 12px;\n\t\t\tpadding: 8px 14px;\n\t\t\tbackground: var(--retold-bg-panel, #282c34);\n\t\t\tborder-bottom: 1px solid var(--retold-border, #3e4451);\n\t\t\tcolor: var(--retold-text, #abb2bf);\n\t\t}\n\t\t.rrrb-header-title\n\t\t{\n\t\t\tfont-size: 0.95rem;\n\t\t\tfont-weight: 600;\n\t\t\tflex: 1;\n\t\t}\n\t\t.rrrb-header button\n\t\t{\n\t\t\tbackground: var(--retold-bg-input, #1e1e1e);\n\t\t\tcolor: var(--retold-text, #abb2bf);\n\t\t\tborder: 1px solid var(--retold-border, #3e4451);\n\t\t\tborder-radius: 4px;\n\t\t\tpadding: 4px 10px;\n\t\t\tfont-size: 0.78rem;\n\t\t\tcursor: pointer;\n\t\t}\n\t\t.rrrb-body\n\t\t{\n\t\t\tflex: 1;\n\t\t\tdisplay: flex;\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.rrrb-tree\n\t\t{\n\t\t\twidth: 260px;\n\t\t\toverflow-y: auto;\n\t\t\tbackground: var(--retold-bg-panel, #21252b);\n\t\t\tborder-right: 1px solid var(--retold-border, #3e4451);\n\t\t\tpadding: 8px 0;\n\t\t}\n\t\t.rrrb-tree-node\n\t\t{\n\t\t\tpadding: 5px 14px;\n\t\t\tcolor: var(--retold-text, #abb2bf);\n\t\t\tcursor: pointer;\n\t\t\tfont-size: 0.82rem;\n\t\t\twhite-space: nowrap;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t\t.rrrb-tree-node:hover { background: var(--retold-bg-hover, rgba(255,255,255,0.05)); }\n\t\t.rrrb-tree-node.active\n\t\t{\n\t\t\tbackground: var(--retold-accent, rgba(97,175,239,0.15));\n\t\t\tcolor: var(--retold-text-bright, #e0e0e0);\n\t\t\tfont-weight: 600;\n\t\t}\n\t\t.rrrb-tree-count\n\t\t{\n\t\t\tcolor: var(--retold-text-dim, #707880);\n\t\t\tfont-size: 0.72rem;\n\t\t\tmargin-left: 4px;\n\t\t}\n\t\t.rrrb-list\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow-y: auto;\n\t\t\tbackground: var(--retold-bg, #181a1f);\n\t\t\tpadding: 8px 14px;\n\t\t}\n\t\t.rrrb-list-empty\n\t\t{\n\t\t\tcolor: var(--retold-text-dim, #707880);\n\t\t\ttext-align: center;\n\t\t\tpadding: 40px 20px;\n\t\t\tfont-size: 0.9rem;\n\t\t}\n\t\t.rrrb-file-group\n\t\t{\n\t\t\tmargin-bottom: 16px;\n\t\t\tborder: 1px solid var(--retold-border, #3e4451);\n\t\t\tborder-radius: 6px;\n\t\t\tbackground: var(--retold-bg-panel, #21252b);\n\t\t\toverflow: hidden;\n\t\t}\n\t\t.rrrb-file-header\n\t\t{\n\t\t\tpadding: 8px 12px;\n\t\t\tbackground: var(--retold-bg-panel-alt, #282c34);\n\t\t\tcolor: var(--retold-text, #abb2bf);\n\t\t\tfont-size: 0.82rem;\n\t\t\tfont-weight: 600;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tgap: 8px;\n\t\t}\n\t\t.rrrb-file-name\n\t\t{\n\t\t\tflex: 1;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twhite-space: nowrap;\n\t\t}\n\t\t.rrrb-file-count\n\t\t{\n\t\t\tcolor: var(--retold-text-dim, #707880);\n\t\t\tfont-size: 0.72rem;\n\t\t}\n\t\t.rrrb-regions\n\t\t{\n\t\t\tpadding: 6px 12px 10px 12px;\n\t\t\tdisplay: flex;\n\t\t\tflex-wrap: wrap;\n\t\t\tgap: 6px;\n\t\t}\n\t\t.rrrb-region\n\t\t{\n\t\t\tbackground: var(--retold-bg-input, #1e1e1e);\n\t\t\tborder: 1px solid var(--retold-border, #3e4451);\n\t\t\tborder-radius: 4px;\n\t\t\tpadding: 5px 10px;\n\t\t\tfont-size: 0.75rem;\n\t\t\tcolor: var(--retold-text, #abb2bf);\n\t\t\tcursor: pointer;\n\t\t\tdisplay: inline-flex;\n\t\t\talign-items: center;\n\t\t\tgap: 6px;\n\t\t}\n\t\t.rrrb-region:hover { background: var(--retold-bg-hover, rgba(255,255,255,0.08)); border-color: var(--retold-accent, #61afef); }\n\t\t.rrrb-region-label { font-weight: 600; }\n\t\t.rrrb-region-dims { color: var(--retold-text-dim, #707880); font-size: 0.68rem; }\n\t",Templates:[{Hash:"RetoldRemote-RegionsBrowser",Template:'\n\t\t\t\t<div id="RetoldRemote-RegionsBrowser-Overlay">\n\t\t\t\t\t<div class="rrrb-header">\n\t\t\t\t\t\t<div class="rrrb-header-title" id="RetoldRemote-RegionsBrowser-Title">Regions Browser</div>\n\t\t\t\t\t\t<button onclick="pict.views[\'RetoldRemote-RegionsBrowser\'].refresh()" title="Reload">↻ Reload</button>\n\t\t\t\t\t\t<button onclick="pict.views[\'RetoldRemote-RegionsBrowser\'].close()" title="Close (Esc)">✕ Close</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="rrrb-body">\n\t\t\t\t\t\t<div class="rrrb-tree" id="RetoldRemote-RegionsBrowser-Tree"></div>\n\t\t\t\t\t\t<div class="rrrb-list" id="RetoldRemote-RegionsBrowser-List"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t'}],Renderables:[{RenderableHash:"RetoldRemote-RegionsBrowser",TemplateHash:"RetoldRemote-RegionsBrowser",DestinationAddress:"#RetoldRemote-RegionsBrowser-Container"}]};class r extends n{constructor(t,e,i){super(t,e,i),this._allFiles=[],this._selectedFolder="",this._keyHandler=null}open(){this._ensureOverlayContainer(),this.render();let t=document.getElementById("RetoldRemote-RegionsBrowser-Overlay");t&&t.classList.add("active");this.pict.AppData.RetoldRemote;let e=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"";this._selectedFolder=e.replace(/\/+$/,"").replace(/^\/+/,"");let i=this;this._keyHandler=function(t){"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),i.close())},document.addEventListener("keydown",this._keyHandler,!0),this._fetchRegions()}close(){let t=document.getElementById("RetoldRemote-RegionsBrowser-Overlay");t&&t.classList.remove("active"),this._keyHandler&&(document.removeEventListener("keydown",this._keyHandler,!0),this._keyHandler=null)}refresh(){this._fetchRegions()}_ensureOverlayContainer(){let t=document.getElementById("RetoldRemote-RegionsBrowser-Container");t||(t=document.createElement("div"),t.id="RetoldRemote-RegionsBrowser-Container",document.body.appendChild(t))}_fetchRegions(){let t=this,e=document.getElementById("RetoldRemote-RegionsBrowser-List"),i=document.getElementById("RetoldRemote-RegionsBrowser-Tree");e&&(e.innerHTML='<div class="rrrb-list-empty">Loading…</div>'),i&&(i.innerHTML=""),fetch("/api/media/subimage-regions?folder=").then(t=>t.json()).then(e=>{if(!e||!e.Success||!Array.isArray(e.Files))return t._allFiles=[],t._renderTree(),void t._renderList();t._allFiles=e.Files,t._renderTree(),t._renderList()}).catch(t=>{e&&(e.innerHTML='<div class="rrrb-list-empty">Failed to load: '+(t&&t.message?t.message:"unknown error")+"</div>")})}_renderTree(){let t=document.getElementById("RetoldRemote-RegionsBrowser-Tree");if(!t)return;let e={"":0};for(let t=0;t<this._allFiles.length;t++){let i=this._allFiles[t],n=Array.isArray(i.Regions)?i.Regions.length:0;e[""]+=n;let o=(i.Path||"").split("/");o.pop();let r="";for(let t=0;t<o.length;t++)r=r?r+"/"+o[t]:o[t],e[r]=(e[r]||0)+n}let i=Object.keys(e);i.sort();let n=this.pict.providers["RetoldRemote-FormattingUtilities"],o="";o+='<div class="rrrb-tree-node'+(""===this._selectedFolder?" active":"")+"\" onclick=\"pict.views['RetoldRemote-RegionsBrowser'].selectFolder('')\">",o+="📁 <em>All folders</em>",o+='<span class="rrrb-tree-count">('+e[""]+")</span>",o+="</div>";for(let t=0;t<i.length;t++){let r=i[t];if(""===r)continue;let a=r.split("/").length,s=r.split("/").pop();o+='<div class="rrrb-tree-node'+(this._selectedFolder===r?" active":"")+'" style="'+("padding-left:"+(14+14*(a-1))+"px;")+"\" onclick=\"pict.views['RetoldRemote-RegionsBrowser'].selectFolder('"+r.replace(/'/g,"\\'")+"')\">",o+="📁 "+n.escapeHTML(s),o+='<span class="rrrb-tree-count">('+e[r]+")</span>",o+="</div>"}t.innerHTML=o}_renderList(){let t=document.getElementById("RetoldRemote-RegionsBrowser-List");if(!t)return;let e=this.pict.providers["RetoldRemote-FormattingUtilities"],i=this._selectedFolder||"",n=[];for(let t=0;t<this._allFiles.length;t++){let e=this._allFiles[t];e&&e.Path&&(""!==i&&e.Path!==i&&0!==e.Path.indexOf(i+"/")||n.push(e))}let o=document.getElementById("RetoldRemote-RegionsBrowser-Title");if(o){let t=i||"All folders",e=0;for(let t=0;t<n.length;t++)e+=(n[t].Regions||[]).length;o.textContent="Regions Browser — "+t+" ("+e+" region"+(1===e?"":"s")+" in "+n.length+" file"+(1===n.length?"":"s")+")"}if(0===n.length)return void(t.innerHTML='<div class="rrrb-list-empty">No regions in this folder yet.</div>');let r="";for(let t=0;t<n.length;t++){let i=n[t],o=(i.Path||"").replace(/^.*\//,""),a=i.Regions||[];r+='<div class="rrrb-file-group">',r+='<div class="rrrb-file-header">',r+='<span class="rrrb-file-name" title="'+e.escapeHTML(i.Path)+'">'+e.escapeHTML(o)+"</span>",r+='<span class="rrrb-file-count">'+a.length+" region"+(1===a.length?"":"s")+"</span>",r+="</div>",r+='<div class="rrrb-regions">';for(let t=0;t<a.length;t++){let n=a[t],o=n.Label||"(unlabeled)",s="";"number"==typeof n.Width&&"number"==typeof n.Height?s=n.Width+"×"+n.Height:n.PageNumber&&(s="p."+n.PageNumber),r+="<div class=\"rrrb-region\" onclick=\"pict.views['RetoldRemote-RegionsBrowser'].navigateTo('"+i.Path.replace(/'/g,"\\'")+"','"+n.ID+"')\">",r+='<span class="rrrb-region-label">'+e.escapeHTML(o)+"</span>",s&&(r+='<span class="rrrb-region-dims">'+e.escapeHTML(s)+"</span>"),r+="</div>"}r+="</div>",r+="</div>"}t.innerHTML=r}selectFolder(t){this._selectedFolder=t||"",this._renderTree(),this._renderList()}navigateTo(t,e){this.close();let i=this,n=t.split(".").pop().toLowerCase(),o=["jpg","jpeg","png","gif","bmp","webp","tiff","tif","svg"].indexOf(n)>=0;if(o){let n=this.pict.views["RetoldRemote-ImageExplorer"];if(n)return n.showExplorer(t),void setTimeout(function(){let t=i.pict.views["RetoldRemote-ImageExplorer"];t&&"function"==typeof t.zoomToRegion&&t.zoomToRegion(e)},900)}let r=this.pict.views["RetoldRemote-MediaViewer"];r&&(r.showMedia(t,o?"image":"document"),setTimeout(function(){let t=i.pict.views["RetoldRemote-SubimagesPanel"];t&&"function"==typeof t.navigateToRegion&&t.navigateToRegion(e)},900))}}r.default_configuration=o,e.exports=r},{"pict-view":102}],164:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"RetoldRemote-SettingsPanel",DefaultRenderable:"RetoldRemote-SettingsPanel",DefaultDestinationAddress:"#RetoldRemote-Settings-Container",AutoRender:!1,CSS:""};class r extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(){super.onAfterRender(),this._renderSettingsContent()}_renderSettingsContent(){let t=document.getElementById("RetoldRemote-Settings-Container");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=e.ServerCapabilities||{},n='<div class="retold-remote-settings">';n+='<div class="retold-remote-settings-section">',n+='<div class="retold-remote-settings-section-title">Appearance</div>',n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Theme</span>',n+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeTheme(this.value)">';let o=this.pict.providers["RetoldRemote-Theme"];if(o){let t=o.getThemeList(),e=o.getCurrentTheme(),i="";for(let o=0;o<t.length;o++){let r=t[o];r.category!==i&&(i&&(n+="</optgroup>"),n+='<optgroup label="'+r.category+'">',i=r.category),n+='<option value="'+r.key+'"'+(r.key===e?" selected":"")+">"+r.name+"</option>"}i&&(n+="</optgroup>")}n+="</select>",n+="</div>",n+="</div>",n+='<div class="retold-remote-settings-section">',n+='<div class="retold-remote-settings-section-title">Gallery</div>',n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">View mode</span>',n+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeSetting('ViewMode', this.value)\">",n+='<option value="gallery"'+("gallery"===e.ViewMode?" selected":"")+">Grid</option>",n+='<option value="list"'+("list"===e.ViewMode?" selected":"")+">List</option>",n+="</select>",n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Thumbnail size</span>',n+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeSetting('ThumbnailSize', this.value)\">",n+='<option value="small"'+("small"===e.ThumbnailSize?" selected":"")+">Small</option>",n+='<option value="medium"'+("medium"===e.ThumbnailSize?" selected":"")+">Medium</option>",n+='<option value="large"'+("large"===e.ThumbnailSize?" selected":"")+">Large</option>",n+="</select>",n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Sort by</span>',n+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeSortField(this.value)">',n+='<option value="folder-first"'+("folder-first"===e.SortField?" selected":"")+">Folders first</option>",n+='<option value="name"'+("name"===e.SortField?" selected":"")+">Name</option>",n+='<option value="modified"'+("modified"===e.SortField?" selected":"")+">Modified</option>",n+='<option value="created"'+("created"===e.SortField?" selected":"")+">Created</option>",n+="</select>",n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Sort direction</span>',n+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeSortDirection(this.value)">',n+='<option value="asc"'+("asc"===e.SortDirection?" selected":"")+">Ascending</option>",n+='<option value="desc"'+("desc"===e.SortDirection?" selected":"")+">Descending</option>",n+="</select>",n+="</div>";let r=e.FilterState&&e.FilterState.MediaType||"all";n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Media filter</span>',n+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeMediaFilter(this.value)">',n+='<option value="all"'+("all"===r?" selected":"")+">All files</option>",n+='<option value="images"'+("images"===r?" selected":"")+">Images</option>",n+='<option value="video"'+("video"===r?" selected":"")+">Video</option>",n+='<option value="audio"'+("audio"===r?" selected":"")+">Audio</option>",n+='<option value="documents"'+("documents"===r?" selected":"")+">Documents</option>",n+="</select>",n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Show hidden files</span>',n+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.ShowHiddenFiles?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleHiddenFiles(this.checked)\">",n+="</div>",n+="</div>",n+='<div class="retold-remote-settings-section">',n+='<div class="retold-remote-settings-section-title">Viewer</div>',n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Image fit mode</span>',n+='<select class="retold-remote-settings-select" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeImageFitMode(this.value)">',n+='<option value="fit"'+("fit"===e.ImageFitMode?" selected":"")+">Fit to window</option>",n+='<option value="auto"'+("auto"===e.ImageFitMode?" selected":"")+">Original if smaller</option>",n+='<option value="original"'+("original"===e.ImageFitMode?" selected":"")+">Original size</option>",n+="</select>",n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Autoplay video</span>',n+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.AutoplayVideo?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleAutoplay('AutoplayVideo', this.checked)\">",n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Autoplay audio</span>',n+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.AutoplayAudio?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleAutoplay('AutoplayAudio', this.checked)\">",n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Nav bar in distraction-free</span>',n+='<input type="checkbox" class="retold-remote-settings-checkbox"'+(e.DistractionFreeShowNav?" checked":"")+" onchange=\"pict.views['RetoldRemote-SettingsPanel'].toggleDistractionFreeNav(this.checked)\">",n+="</div>",n+="</div>",n+='<div class="retold-remote-settings-section">',n+='<div class="retold-remote-settings-section-title">Server Capabilities</div>',n+='<div class="retold-remote-settings-capabilities">';let a="Sharp (image thumbnails)";i.sharpMode&&(a="Sharp / "+i.sharpMode+" (image thumbnails)");let s=[{key:"sharp",label:a},{key:"imagemagick",label:"ImageMagick (image fallback)"},{key:"ffmpeg",label:"ffmpeg (video thumbnails)"},{key:"ffprobe",label:"ffprobe (media metadata)"}];for(let t=0;t<s.length;t++){let e=s[t],o=i[e.key];n+='<div class="retold-remote-settings-cap-row">',n+='<span class="retold-remote-settings-cap-label">'+e.label+"</span>",n+='<span class="'+(o?"retold-remote-settings-cap-yes":"retold-remote-settings-cap-no")+'">'+(o?"Available":"Not found")+"</span>",n+="</div>"}n+='<div class="retold-remote-settings-cap-row" style="margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--retold-border);">',n+='<span class="retold-remote-settings-cap-label">Hashed filenames</span>',n+='<span class="'+(e.HashedFilenames?"retold-remote-settings-cap-yes":"retold-remote-settings-cap-no")+'">'+(e.HashedFilenames?"Enabled":"Disabled")+"</span>",n+="</div>",n+="</div>",n+="</div>",n+='<div class="retold-remote-settings-section">',n+='<div class="retold-remote-settings-section-title">AI File Sort</div>';let l=this.pict.providers["RetoldRemote-AISortManager"],d=e.AISortSettings||{AIEndpoint:"http://localhost:11434",AIModel:"llama3.1",AIProvider:"ollama",NamingTemplate:"{artist}/{album}/{track} - {title}"};n+='<div class="retold-remote-settings-input-row">',n+='<label class="retold-remote-settings-input-label">AI Endpoint URL</label>',n+='<input class="retold-remote-settings-input" type="text" id="RetoldRemote-AISortEndpoint" value="'+this._escapeAttr(d.AIEndpoint)+'" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeAISetting(\'AIEndpoint\', this.value)" placeholder="http://localhost:11434">',n+="</div>",n+='<div class="retold-remote-settings-input-row">',n+='<label class="retold-remote-settings-input-label">Model</label>',n+='<input class="retold-remote-settings-input" type="text" id="RetoldRemote-AISortModel" value="'+this._escapeAttr(d.AIModel)+'" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeAISetting(\'AIModel\', this.value)" placeholder="llama3.1">',n+="</div>",n+='<div class="retold-remote-settings-row">',n+='<span class="retold-remote-settings-label">Provider</span>',n+="<select class=\"retold-remote-settings-select\" onchange=\"pict.views['RetoldRemote-SettingsPanel'].changeAISetting('AIProvider', this.value)\">",n+='<option value="ollama"'+("ollama"===d.AIProvider?" selected":"")+">Ollama</option>",n+='<option value="openai"'+("openai"===d.AIProvider?" selected":"")+">OpenAI-compatible</option>",n+="</select>",n+="</div>",n+='<div class="retold-remote-settings-input-row" style="margin-top: 8px;">',n+='<label class="retold-remote-settings-input-label">Naming Template</label>',n+='<input class="retold-remote-settings-input" type="text" id="RetoldRemote-AISortTemplate" value="'+this._escapeAttr(d.NamingTemplate)+'" onchange="pict.views[\'RetoldRemote-SettingsPanel\'].changeAISetting(\'NamingTemplate\', this.value)" placeholder="{artist}/{album}/{track} - {title}">';let c=l?l.getTemplatePreview(d.NamingTemplate):"";c&&(n+='<div class="retold-remote-settings-template-preview">Preview: '+this._escapeHTML(c)+"</div>"),n+="</div>",n+='<button class="retold-remote-settings-vlc-btn" id="RetoldRemote-AISortTestBtn" onclick="pict.views[\'RetoldRemote-SettingsPanel\'].testAIConnection()" style="margin-top: 8px;">',n+="Test Connection",n+="</button>",n+="</div>",n+='<div class="retold-remote-settings-section">',n+='<div class="retold-remote-settings-section-title">VLC Streaming</div>',n+='<button class="retold-remote-settings-vlc-btn" onclick="pict.views[\'RetoldRemote-VLCSetup\'].openModal()">',n+="VLC Protocol Setup",n+="</button>",n+="</div>",n+='<div class="retold-remote-settings-section">',n+='<div class="retold-remote-settings-section-title">Help</div>',n+='<button class="retold-remote-settings-vlc-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._toggleHelpPanel()">',n+="Help (F1)",n+="</button>",n+="</div>",n+="</div>",t.innerHTML=n}changeTheme(t){let e=this.pict.providers["RetoldRemote-Theme"];e&&(e.applyTheme(t),this.pict.PictApplication.saveSettings(),this._renderSettingsContent())}changeSetting(t,e){let i=this.pict.AppData.RetoldRemote;if(i[t]=e,this.pict.PictApplication.saveSettings(),"gallery"===i.ActiveMode){let t=this.pict.views["RetoldRemote-Gallery"];t&&t.renderGallery()}}toggleHiddenFiles(t){this.pict.AppData.RetoldRemote.ShowHiddenFiles=t,this.pict.PictApplication.saveSettings(),this.pict.PictApplication.syncHiddenFilesSetting(()=>{this.pict.PictApplication.loadFileList()})}toggleAutoplay(t,e){this.pict.AppData.RetoldRemote[t]=e,this.pict.PictApplication.saveSettings()}toggleDistractionFreeNav(t){let e=this.pict.AppData.RetoldRemote;if(e.DistractionFreeShowNav=t,this.pict.PictApplication.saveSettings(),e._distractionFreeMode){let e=document.querySelector(".retold-remote-viewer-header");e&&(e.style.display=t?"":"none")}}changeImageFitMode(t){let e=this.pict.views["RetoldRemote-ImageViewer"];if(e)e.setFitMode(t);else{this.pict.AppData.RetoldRemote.ImageFitMode=t,this.pict.PictApplication.saveSettings()}}changeSortField(t){this.pict.AppData.RetoldRemote.SortField=t,this.pict.PictApplication.saveSettings(),this._refilterGallery()}changeSortDirection(t){this.pict.AppData.RetoldRemote.SortDirection=t,this.pict.PictApplication.saveSettings(),this._refilterGallery()}changeMediaFilter(t){let e=this.pict.AppData.RetoldRemote;e.GalleryFilter=t,e.FilterState&&(e.FilterState.MediaType=t),this.pict.PictApplication.saveSettings(),this._refilterGallery()}changeAISetting(t,e){let i=this.pict.providers["RetoldRemote-AISortManager"];if(i){let n={};n[t]=e,i.updateSettings(n)}"NamingTemplate"===t&&this._renderSettingsContent()}testAIConnection(){let t=document.getElementById("RetoldRemote-AISortTestBtn");t&&(t.disabled=!0,t.textContent="Testing...");let e=this.pict.providers["RetoldRemote-AISortManager"];e&&e.testConnection()}_escapeAttr(t){return t?String(t).replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"):""}_escapeHTML(t){return t?String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"):""}_refilterGallery(){let t=this.pict.AppData.RetoldRemote,e=this.pict.providers["RetoldRemote-GalleryFilterSort"];if(e&&e.runFilterPipeline(),"gallery"===t.ActiveMode){let t=this.pict.views["RetoldRemote-Gallery"];t&&t.renderGallery()}}}r.default_configuration=o,e.exports=r},{"pict-view":102}],165:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"RetoldRemote-SubimagesPanel",DefaultRenderable:"RetoldRemote-SubimagesPanel",DefaultDestinationAddress:"#RetoldRemote-Subimages-Container",AutoRender:!1,CSS:""};class r extends n{constructor(t,e,i){super(t,e,i),this._regions=[],this._currentPath=""}render(){let t=document.getElementById("RetoldRemote-Subimages-Container");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=e.CurrentViewerFile;e.CurrentViewerMediaType;return i?i!==this._currentPath?(this._currentPath=i,void this._fetchAndRender(i,t)):void this._renderRegionList(t):(t.innerHTML='<div style="padding:12px;color:var(--retold-text-dim);font-size:0.82rem;">View a file to see its regions.</div>',this._regions=[],void(this._currentPath=""))}refresh(){this._currentPath="",this.render()}_fetchAndRender(t,e){let i=this,n=this.pict.providers["RetoldRemote-Provider"],o=n?n._getPathParam(t):encodeURIComponent(t);e.innerHTML='<div style="padding:12px;color:var(--retold-text-dim);font-size:0.82rem;">Loading…</div>',fetch("/api/media/subimage-regions?path="+o).then(t=>t.json()).then(t=>{t&&t.Success?i._regions=t.Regions||[]:i._regions=[],i._renderRegionList(e)}).catch(()=>{i._regions=[],i._renderRegionList(e)})}_renderRegionList(t){if(t||(t=document.getElementById("RetoldRemote-Subimages-Container")),!t)return;let e=this.pict.views["RetoldRemote-ImageExplorer"];e&&e._currentPath===this._currentPath&&(e._savedRegions=this._regions);let i=this.pict.providers["RetoldRemote-FormattingUtilities"],n=(this._currentPath||"").replace(/^.*\//,""),o='<div class="retold-remote-subimages-panel">';if(o+='<div style="padding:8px 10px;font-size:0.78rem;color:var(--retold-text-dim);border-bottom:1px solid var(--retold-border);">',o+=i.escapeHTML(n),o+=" — "+this._regions.length+" region"+(1!==this._regions.length?"s":""),o+="</div>",0===this._regions.length)o+='<div style="padding:16px 12px;color:var(--retold-text-dim);font-size:0.8rem;text-align:center;">',o+="No regions yet.<br>Use selection tools in the viewer to create regions.",o+="</div>";else for(let t=0;t<this._regions.length;t++){let e=this._regions[t],n=e.Label||"(unlabeled)",r="text-selection"===e.Type,a="";if(r){let t=(e.SelectedText||"").substring(0,60);(e.SelectedText||"").length>60&&(t+="…"),a=t||"(no text)",e.PageNumber?a="p."+e.PageNumber+" — "+a:e.ChapterTitle&&(a=e.ChapterTitle)}else a=(e.Width||0)+" × "+(e.Height||0)+" px",e.PageNumber?a="p."+e.PageNumber+" — "+a:null!==e.X&&null!==e.Y&&(a+=" at "+e.X+", "+e.Y);let s=r?"📝":"🔲";o+='<div class="retold-remote-subimages-item" data-region-id="'+e.ID+'">',o+='<div class="retold-remote-subimages-item-info">',o+='<div class="retold-remote-subimages-item-label">'+s+" "+i.escapeHTML(n)+"</div>",o+='<div class="retold-remote-subimages-item-dims">'+i.escapeHTML(a)+"</div>",o+="</div>",o+='<div class="retold-remote-subimages-item-actions">',o+="<button onclick=\"pict.views['RetoldRemote-SubimagesPanel'].navigateToRegion('"+e.ID+'\')" title="Navigate to region" style="font-size:0.7rem;padding:2px 6px;">🔎</button>',o+="<button onclick=\"pict.views['RetoldRemote-SubimagesPanel'].addRegionToCollection('"+e.ID+'\')" title="Add to collection" style="font-size:0.7rem;padding:2px 6px;">✚</button>',o+="<button onclick=\"pict.views['RetoldRemote-SubimagesPanel'].deleteRegion('"+e.ID+'\')" title="Delete region" style="font-size:0.7rem;padding:2px 6px;">🗑</button>',o+="</div>",o+="</div>"}o+="</div>",t.innerHTML=o}navigateToRegion(t){let e=null;for(let i=0;i<this._regions.length;i++)if(this._regions[i].ID===t){e=this._regions[i];break}if(!e)return;let i=this.pict.AppData.RetoldRemote,n=this.pict.views["RetoldRemote-MediaViewer"];if(e.CFI&&n&&n._activeRendition)return void n._activeRendition.display(e.CFI);if(e.PageNumber&&n&&"function"==typeof n._renderPdfPage)return void n._renderPdfPage(e.PageNumber);let o=this.pict.views["RetoldRemote-ImageExplorer"];"image-explorer"===i.ActiveMode&&o?o.zoomToRegion(t):o&&this._currentPath&&(o.showExplorer(this._currentPath),setTimeout(()=>{o.zoomToRegion(t)},800))}addRegionToCollection(t){let e=null;for(let i=0;i<this._regions.length;i++)if(this._regions[i].ID===t){e=this._regions[i];break}if(!e)return;let i=this.pict.providers["RetoldRemote-CollectionManager"];if(i){let t=i.getQuickAddTargetGUID();if(t)i.addSubimageToCollection(t,e,this._currentPath);else{let t=this.pict.views["ContentEditor-TopBar"];t&&"function"==typeof t.showAddToCollectionDropdown&&t.showAddToCollectionDropdown()}}}deleteRegion(t){let e=this.pict.views["RetoldRemote-ImageExplorer"];if(e&&e._currentPath===this._currentPath)e.deleteRegion(t);else{let e=this,i=this.pict.providers["RetoldRemote-Provider"],n=i?i._getPathParam(this._currentPath):encodeURIComponent(this._currentPath);fetch("/api/media/subimage-regions/"+encodeURIComponent(t)+"?path="+n,{method:"DELETE"}).then(t=>t.json()).then(t=>{if(t&&t.Success){e._regions=t.Regions||[],e._renderRegionList();let i=e.pict.providers["RetoldRemote-ToastNotification"];i&&i.showToast("Region deleted")}}).catch(()=>{})}}}r.default_configuration=o,e.exports=r},{"pict-view":102}],166:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"ContentEditor-TopBar",DefaultRenderable:"RetoldRemote-TopBar",DefaultDestinationAddress:"#ContentEditor-TopBar-Container",AutoRender:!1,CSS:"",Templates:[{Hash:"RetoldRemote-TopBar",Template:'\n\t\t\t\t<div class="retold-remote-topbar">\n\t\t\t\t\t<button class="retold-remote-topbar-sidebar-toggle" id="RetoldRemote-TopBar-SidebarToggle" onclick="pict.views[\'ContentEditor-Layout\'].toggleSidebar()" title="Toggle Sidebar"></button>\n\t\t\t\t\t<button class="retold-remote-topbar-df-toggle" id="RetoldRemote-TopBar-DFToggle" onclick="pict.views[\'ContentEditor-TopBar\'].toggleDistractionFree()" title="Distraction-free mode (d)"></button>\n\t\t\t\t\t<div class="retold-remote-topbar-location" id="RetoldRemote-TopBar-Location"></div>\n\t\t\t\t\t<div class="retold-remote-topbar-info" id="RetoldRemote-TopBar-Info"></div>\n\t\t\t\t\t<div class="retold-remote-topbar-actions">\n\t\t\t\t\t\t<button class="retold-remote-topbar-aisort-btn" id="RetoldRemote-TopBar-AISortBtn" onclick="pict.views[\'ContentEditor-TopBar\'].triggerAISort()" title="AI Sort (generate sort plan for current folder)" style="display:none;">Ai</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-btn retold-remote-topbar-regions-btn" id="RetoldRemote-TopBar-RegionsBtn" onclick="pict.views[\'RetoldRemote-RegionsBrowser\'] && pict.views[\'RetoldRemote-RegionsBrowser\'].open()" title="Browse all regions by folder">▣</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-btn retold-remote-topbar-addcoll-btn" id="RetoldRemote-TopBar-AddToCollectionBtn" onclick="pict.views[\'ContentEditor-TopBar\'].addToCollection(event)" title="Add to collection">★</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-btn retold-remote-topbar-favorites-btn" id="RetoldRemote-TopBar-FavoritesBtn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleFavorite()" title="Toggle favorite (h)">♡</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-sidebar-toggle retold-remote-topbar-collections-btn" id="RetoldRemote-TopBar-CollectionsBtn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleCollections()" title="Toggle Collections panel (b)">★</button>\n\t\t\t\t\t\t<button class="retold-remote-topbar-filter-btn" id="RetoldRemote-TopBar-FilterBtn" onclick="pict.views[\'ContentEditor-TopBar\'].toggleFilterBar()" title="Toggle filter bar (/)">◢</button>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t'}],Renderables:[{RenderableHash:"RetoldRemote-TopBar",TemplateHash:"RetoldRemote-TopBar",DestinationAddress:"#ContentEditor-TopBar-Container"}]};class r extends n{constructor(t,e,i){super(t,e,i)}onAfterRender(){super.onAfterRender(),this.updateSidebarToggleIcon(),this.updateDFToggleIcon(),this.updateLocation(),this.updateInfo(),this.updateFavoritesIcon()}updateSidebarToggleIcon(){let t=document.getElementById("RetoldRemote-TopBar-SidebarToggle");if(!t)return;let e=this.pict.providers["RetoldRemote-Icons"];t.innerHTML=e?e.getIcon("sidebar",18):"☰"}updateDFToggleIcon(){let t=document.getElementById("RetoldRemote-TopBar-DFToggle");t&&(t.innerHTML='<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 3 21 3 21 9" /><polyline points="9 21 3 21 3 15" /><polyline points="21 15 21 21 15 21" /><polyline points="3 9 3 3 9 3" /></svg>')}toggleDistractionFree(){let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t._toggleDistractionFree&&t._toggleDistractionFree()}updateLocation(){let t=document.getElementById("RetoldRemote-TopBar-Location");if(!t)return;this.pict.AppData.RetoldRemote;let e=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",i=this.pict.providers["RetoldRemote-Icons"],n=i?i.getIcon("home",16):"/",o=e?e.split("/").filter(t=>t):[],r="";if(o.length>0){let t=i?i.getIcon("folder",16):"",e=i?i.getIcon("home",16):"/";for(let e=o.length-2;e>=0;e--){let i=o.slice(0,e+1).join("/"),n=o[e]+"/",a="";e>0&&(a="/"+o.slice(0,e).join("/")+"/"),r+='<button class="retold-remote-topbar-overflow-item" onclick="pict.PictApplication.loadFileList(\''+i+"'); pict.views['ContentEditor-TopBar'].closeBreadcrumbDropdown();\">",r+='<span class="retold-remote-topbar-overflow-item-icon">'+t+"</span>",r+=a?'<span class="retold-remote-topbar-overflow-item-label"><span class="retold-remote-topbar-overflow-item-prefix">'+a+"</span>"+n+"</span>":'<span class="retold-remote-topbar-overflow-item-label">'+n+"</span>",r+="</button>"}r+="<button class=\"retold-remote-topbar-overflow-item\" onclick=\"pict.PictApplication.loadFileList(''); pict.views['ContentEditor-TopBar'].closeBreadcrumbDropdown();\">",r+='<span class="retold-remote-topbar-overflow-item-icon">'+e+"</span>",r+='<span class="retold-remote-topbar-overflow-item-label">Home</span>',r+="</button>"}let a="";if(a+='<span class="retold-remote-topbar-breadcrumb-overflow">',a+='<span class="retold-remote-topbar-home-crumb"',o.length>0?(a+=" onclick=\"pict.views['ContentEditor-TopBar'].toggleBreadcrumbDropdown()\"",a+=' title="Navigate to parent folders"'):a+=' title="Home"',a+=">"+n+"</span>",a+='<div class="retold-remote-topbar-overflow-dropdown" id="RetoldRemote-BreadcrumbDropdown">',a+=r,a+="</div>",a+="</span>",o.length>0){let t=o[o.length-1];a+='<span class="retold-remote-topbar-location-inner">',a+='<span class="retold-remote-topbar-sep">/</span>',a+='<span class="retold-remote-topbar-location-crumb" onclick="pict.PictApplication.loadFileList(\''+o.join("/")+"')\">"+t+"</span>",a+="</span>"}t.innerHTML=a}toggleBreadcrumbDropdown(){let t=document.getElementById("RetoldRemote-BreadcrumbDropdown");if(t)if(t.classList.contains("open"))this.closeBreadcrumbDropdown();else{t.classList.add("open");let e=this,i=function(n){if(t.contains(n.target))return;let o=t.parentElement&&t.parentElement.querySelector(".retold-remote-topbar-home-crumb");o&&o.contains(n.target)||(e.closeBreadcrumbDropdown(),document.removeEventListener("click",i,!0),document.removeEventListener("touchstart",i,!0))};setTimeout(function(){document.addEventListener("click",i,!0),document.addEventListener("touchstart",i,!0)},0),this._breadcrumbCloseHandler=i}}closeBreadcrumbDropdown(){let t=document.getElementById("RetoldRemote-BreadcrumbDropdown");t&&t.classList.remove("open"),this._breadcrumbCloseHandler&&(document.removeEventListener("click",this._breadcrumbCloseHandler,!0),document.removeEventListener("touchstart",this._breadcrumbCloseHandler,!0),this._breadcrumbCloseHandler=null)}toggleFilterBar(){let t=this.pict.AppData.RetoldRemote;t.FilterBarVisible=!t.FilterBarVisible,t.FilterBarVisible||(t.FilterPanelOpen=!1);let e=this.pict.views["RetoldRemote-Gallery"];e&&e.renderGallery(),this.updateFilterIcon(),t.FilterBarVisible&&setTimeout(()=>{let t=document.getElementById("RetoldRemote-Gallery-Search");t&&t.focus()},50)}updateFilterIcon(){let t=document.getElementById("RetoldRemote-TopBar-FilterBtn");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-GalleryFilterSort"],n=i?i.getActiveFilterChips().length:0,o=e.FilterBarVisible||!1;t.classList.remove("filter-active","filter-bar-open"),n>0?(t.classList.add("filter-active"),t.innerHTML='◓<span class="retold-remote-topbar-filter-badge">'+n+"</span>",t.title=n+" active filter"+(n>1?"s":"")+" (/)"):o?(t.classList.add("filter-bar-open"),t.innerHTML="◢",t.title="Hide filter bar (/)"):(t.innerHTML="◢",t.title="Toggle filter bar (/)")}updateInfo(){this.updateAISortButton();let t=document.getElementById("RetoldRemote-TopBar-Info");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=e.FolderSummary;if("viewer"===e.ActiveMode){let i=e.GalleryItems||[],n=e.GalleryCursorIndex||0,o=i[n];if(o){let e=n+1+"/"+i.length;t.innerHTML="<span>"+e+'</span><span class="retold-remote-topbar-info-sep retold-remote-topbar-info-priority-1"> · </span><span class="retold-remote-topbar-info-priority-1">'+this._escapeHTML(o.Name)+"</span>"}return}let n=e.GalleryItems||[],o=e.GalleryCursorIndex||0,r="";if(n.length>0&&(r=o+1+"/"+n.length),!i)return void(t.textContent=r);let a=[];i.Images>0&&a.push(i.Images+" images"),i.Videos>0&&a.push(i.Videos+" videos"),i.Audio>0&&a.push(i.Audio+" audio");let s=[];i.Folders>0&&s.push(i.Folders+" folders"),i.Documents>0&&s.push(i.Documents+" docs"),i.Other>0&&s.push(i.Other+" other");let l="";if(r&&(l+="<span>"+r+"</span>"),s.length>0){l+=(l?'<span class="retold-remote-topbar-info-sep retold-remote-topbar-info-priority-3"> · </span>':"")+'<span class="retold-remote-topbar-info-priority-3">'+s.join(" · ")+"</span>"}if(a.length>0){l+=(l?'<span class="retold-remote-topbar-info-sep retold-remote-topbar-info-priority-2"> · </span>':"")+'<span class="retold-remote-topbar-info-priority-2">'+a.join(" · ")+"</span>"}t.innerHTML=l||""}_escapeHTML(t){return t?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"):""}triggerAISort(){let t=this.pict.providers["RetoldRemote-AISortManager"];if(!t)return;let e=this.pict.AppData.PictFileBrowser&&this.pict.AppData.PictFileBrowser.CurrentLocation||"",i=document.getElementById("RetoldRemote-TopBar-AISortBtn");i&&(i.classList.add("generating"),i.textContent="..."),t.generateSortPlan(e,(t,e)=>{i&&(i.classList.remove("generating"),i.textContent="Ai")})}updateAISortButton(){let t=document.getElementById("RetoldRemote-TopBar-AISortBtn");if(!t)return;let e=this.pict.providers["RetoldRemote-AISortManager"];e&&e.isAvailable()?t.style.display="":t.style.display="none"}toggleCollections(){let t=this.pict.providers["RetoldRemote-CollectionManager"];t&&t.togglePanel()}updateCollectionsIcon(){let t=document.getElementById("RetoldRemote-TopBar-CollectionsBtn");if(!t)return;let e=this.pict.AppData.RetoldRemote,i=this.pict.providers["RetoldRemote-Icons"],n=e.CollectionsPanelOpen,o=this.pict.views["ContentEditor-Layout"];if(o&&o.isMobileDrawer()){let t=document.querySelector(".content-editor-sidebar-tab.active");n=t&&"collections"===t.getAttribute("data-tab")}n?(t.classList.add("panel-open"),i&&"function"==typeof i.getIcon&&(t.innerHTML=i.getIcon("bookmark-filled",16))):(t.classList.remove("panel-open"),i&&"function"==typeof i.getIcon&&(t.innerHTML=i.getIcon("bookmark",16)))}toggleFavorite(){let t=this.pict.providers["RetoldRemote-CollectionManager"];t&&t.toggleFavorite()}updateFavoritesIcon(){let t=document.getElementById("RetoldRemote-TopBar-FavoritesBtn");if(!t)return;let e=this.pict.providers["RetoldRemote-CollectionManager"];e&&e.isFavorited()?(t.classList.add("is-favorited"),t.innerHTML="♥",t.title="Remove from favorites (h)"):(t.classList.remove("is-favorited"),t.innerHTML="♡",t.title="Add to favorites (h)")}addToCollection(t){this.pict.AppData.RetoldRemote;let e=this.pict.providers["RetoldRemote-CollectionManager"];if(!e)return;let i=e.getQuickAddTargetGUID();if(i){if(e.addCurrentFileToCollection(i))return}this.showAddToCollectionDropdown(t)}showAddToCollectionDropdown(t){let e=this,i=this.pict.AppData.RetoldRemote,n=this.pict.providers["RetoldRemote-CollectionManager"];this._closeAddToCollectionDropdown();let o=document.getElementById("RetoldRemote-TopBar-AddToCollectionBtn");o&&n.fetchCollections(()=>{let t=i.Collections||[],r=document.createElement("div");r.className="retold-remote-addcoll-dropdown",r.id="RetoldRemote-AddToCollection-Dropdown";let a=document.createElement("button");a.className="retold-remote-addcoll-dropdown-item retold-remote-addcoll-dropdown-new",a.textContent="+ New Collection...",a.onclick=()=>{e._closeAddToCollectionDropdown();let t=prompt("Collection name:");t&&t.trim()?n.createCollection(t.trim(),(t,e)=>{!t&&e&&n.addPendingOrCurrentToCollection(e.GUID)}):n.clearPendingClipContext()},r.appendChild(a);for(let i=0;i<t.length;i++){let o=t[i],a=document.createElement("button");a.className="retold-remote-addcoll-dropdown-item",a.textContent=o.Name||"Untitled",a.onclick=()=>{e._closeAddToCollectionDropdown(),n.addPendingOrCurrentToCollection(o.GUID)},r.appendChild(a)}o.style.position="relative",o.appendChild(r),setTimeout(()=>{document.addEventListener("click",e._boundCloseDropdown=t=>{r.contains(t.target)||t.target===o||e._closeAddToCollectionDropdown()})},10)})}_closeAddToCollectionDropdown(){let t=document.getElementById("RetoldRemote-AddToCollection-Dropdown");t&&t.remove(),this._boundCloseDropdown&&(document.removeEventListener("click",this._boundCloseDropdown),this._boundCloseDropdown=null);let e=this.pict.providers["RetoldRemote-CollectionManager"];e&&e.clearPendingClipContext()}}r.default_configuration=o,e.exports=r},{"pict-view":102}],167:[function(t,e,i){const n=t("pict-view"),o={ViewIdentifier:"RetoldRemote-VLCSetup",DefaultRenderable:"RetoldRemote-VLCSetup",DefaultDestinationAddress:"#ContentEditor-Application-Container",AutoRender:!1,CSS:""};class r extends n{constructor(t,e,i){super(t,e,i),this._activePlatformTab=this._detectPlatform(),this._modalVisible=!1,this._boundKeyHandler=null}_detectPlatform(){let t="undefined"!=typeof navigator?navigator.userAgent:"";return/iPhone|iPad|iPod/i.test(t)||/Macintosh/i.test(t)&&"undefined"!=typeof navigator&&navigator.maxTouchPoints>1?"ios":/Android/i.test(t)?"android":/Macintosh|Mac OS X/.test(t)?"macos":/Windows/.test(t)?"windows":"linux"}openModal(){if(this._modalVisible)return;this._modalVisible=!0;let t=document.createElement("div");t.className="retold-remote-vlc-modal-backdrop",t.id="RetoldRemote-VLCSetup-Backdrop",t.onclick=e=>{e.target===t&&this.closeModal()};let e=document.createElement("div");e.className="retold-remote-vlc-modal";let i=document.createElement("div");i.className="retold-remote-vlc-modal-header",i.innerHTML='<span class="retold-remote-vlc-modal-title">VLC Protocol Setup</span><button class="retold-remote-vlc-modal-close" onclick="pict.views[\'RetoldRemote-VLCSetup\'].closeModal()">X</button>';let n=document.createElement("div");n.className="retold-remote-vlc-modal-body",n.id="RetoldRemote-VLCSetup-Container",e.appendChild(i),e.appendChild(n),t.appendChild(e),document.body.appendChild(t),this._renderVLCSetupContent(),this._boundKeyHandler=t=>{"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),this.closeModal())},document.addEventListener("keydown",this._boundKeyHandler,!0)}closeModal(){if(!this._modalVisible)return;this._modalVisible=!1;let t=document.getElementById("RetoldRemote-VLCSetup-Backdrop");t&&t.remove(),this._boundKeyHandler&&(document.removeEventListener("keydown",this._boundKeyHandler,!0),this._boundKeyHandler=null)}switchPlatformTab(t){this._activePlatformTab=t,this._renderVLCSetupContent()}_renderVLCSetupContent(){let t=document.getElementById("RetoldRemote-VLCSetup-Container");if(!t)return;let e=this._activePlatformTab,i="";i+='<div class="retold-remote-vlc-setup-section">',i+='<div class="retold-remote-vlc-setup-desc">',i+="Stream media directly in VLC from the browser. Press <b>v</b> in the media viewer to launch VLC with the current file.",i+="</div>",i+="</div>",i+='<div class="retold-remote-vlc-setup-status">',i+='<div class="retold-remote-vlc-setup-status-dot '+(this._detectPlatform()===e?"detected":"unknown")+'"></div>',i+="<span>Detected platform: <b>"+this._getPlatformLabel(this._detectPlatform())+"</b></span>",i+="</div>",i+='<div class="retold-remote-vlc-setup-platform-tabs">',i+=this._buildPlatformTab("ios","iOS",e),i+=this._buildPlatformTab("android","Android",e),i+=this._buildPlatformTab("macos","macOS",e),i+=this._buildPlatformTab("windows","Windows",e),i+=this._buildPlatformTab("linux","Linux",e),i+="</div>",i+=this._buildIOSContent(e),i+=this._buildAndroidContent(e),i+=this._buildMacOSContent(e),i+=this._buildWindowsContent(e),i+=this._buildLinuxContent(e),i+='<div class="retold-remote-vlc-setup-section">',i+='<div class="retold-remote-vlc-setup-section-title">Test</div>',i+='<div class="retold-remote-vlc-setup-desc">',i+="Click below to test whether the vlc:// protocol handler is registered. VLC should open.",i+="</div>",i+='<button class="retold-remote-vlc-setup-btn" onclick="pict.views[\'RetoldRemote-VLCSetup\'].testProtocol()">Test VLC Protocol</button>',i+="</div>",t.innerHTML=i}_buildPlatformTab(t,e,i){let n="retold-remote-vlc-setup-platform-tab";return t===i&&(n+=" active"),'<button class="'+n+"\" onclick=\"pict.views['RetoldRemote-VLCSetup'].switchPlatformTab('"+t+"')\">"+e+"</button>"}_getPlatformLabel(t){return"ios"===t?"iOS":"android"===t?"Android":"macos"===t?"macOS":"windows"===t?"Windows":"Linux"}_buildIOSContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("ios"===t?" active":""))+'" data-platform="ios">';return e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (iOS)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="VLC for iOS registers the vlc:// protocol handler automatically when installed. No additional setup is needed.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Installation</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Install <b>VLC for Mobile</b> from the App Store if you haven\'t already.</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Tap the <b>Stream with VLC</b> button on any video or audio file. Safari will ask to open VLC — tap <b>Open</b>.</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">If Safari shows "Cannot Open Page", VLC may not be installed or may need to be updated.</div>',e+="</div>",e+="</div>",e}_buildAndroidContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("android"===t?" active":""))+'" data-platform="android">';return e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (Android)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="VLC for Android registers the vlc:// protocol handler automatically when installed. No additional setup is needed.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Installation</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Install <b>VLC for Android</b> from the Google Play Store if you haven\'t already.</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Tap the <b>Stream with VLC</b> button on any video or audio file. Your browser will ask to open VLC — tap <b>Open</b>.</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">If your browser shows an error, VLC may not be installed or may need to be updated.</div>',e+="</div>",e+="</div>",e}_buildMacOSContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("macos"===t?" active":""))+'" data-platform="macos">';e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (macOS)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="VLC on macOS does not register a vlc:// protocol handler by default. ",e+="An AppleScript app bundle is needed to bridge vlc:// links to VLC. ",e+="Run the command below in Terminal to create and register the handler automatically.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Automatic Setup</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Copy and paste this into Terminal:",e+="</div>";let i=this._getMacSetupScript();return e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyMacSetup()">Copy to Clipboard</button>',e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">What This Does</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Creates an AppleScript at <code>/tmp/VLCProtocol.applescript</code> that handles vlc:// URLs</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Compiles it into an app bundle at <code>/Applications/VLCProtocol.app</code></div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">3</div>',e+='<div class="retold-remote-vlc-setup-step-content">Adds the vlc:// URL scheme to the app\'s Info.plist</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">4</div>',e+='<div class="retold-remote-vlc-setup-step-content">Registers the protocol handler with macOS Launch Services</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">Requires VLC installed at /Applications/VLC.app and Python 3 (included with macOS).</div>',e+="</div>",e+="</div>",e}_buildWindowsContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("windows"===t?" active":""))+'" data-platform="windows">';e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (Windows)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Windows requires a protocol handler to open vlc:// links. ",e+="Choose one of the options below to register the handler.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Option A: Reinstall VLC</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Reinstall VLC and ensure "Register VLC as handler for vlc:// protocol" is checked during installation.</div>',e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Option B: Registry File</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Save this as <code>vlc-protocol.reg</code> and double-click to import. ",e+="Adjust the VLC path if yours differs.",e+="</div>";let i=this._getWindowsRegFile();e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyWindowsReg()">Copy to Clipboard</button>',e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Option C: Batch Script</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Alternatively, save this as <code>vlc-protocol-setup.bat</code> and run as Administrator. ",e+="This creates a handler script and registers the vlc:// protocol automatically.",e+="</div>";let n=this._getWindowsBatchScript();return e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(n)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyWindowsBatch()">Copy to Clipboard</button>',e+="</div>",e+="</div>",e}_buildLinuxContent(t){let e='<div class="'+("retold-remote-vlc-setup-platform"+("linux"===t?" active":""))+'" data-platform="linux">';e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup (Linux)</div>',e+='<div class="retold-remote-vlc-setup-desc">',e+="Register a vlc:// protocol handler using a .desktop file and xdg-mime. ",e+="Run the command below in a terminal.",e+="</div>",e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">Setup Command</div>';let i=this._getLinuxSetupScript();return e+='<div class="retold-remote-vlc-setup-code">'+this.pict.providers["RetoldRemote-FormattingUtilities"].escapeHTML(i)+"</div>",e+='<button class="retold-remote-vlc-setup-btn primary" onclick="pict.views[\'RetoldRemote-VLCSetup\'].copyLinuxSetup()">Copy to Clipboard</button>',e+="</div>",e+='<div class="retold-remote-vlc-setup-section">',e+='<div class="retold-remote-vlc-setup-section-title">What This Does</div>',e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">1</div>',e+='<div class="retold-remote-vlc-setup-step-content">Creates a handler script at <code>~/.local/bin/vlc-protocol</code> that URL-decodes and opens VLC</div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">2</div>',e+='<div class="retold-remote-vlc-setup-step-content">Creates a .desktop file at <code>~/.local/share/applications/vlc-protocol.desktop</code></div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-step">',e+='<div class="retold-remote-vlc-setup-step-num">3</div>',e+='<div class="retold-remote-vlc-setup-step-content">Registers vlc:// as a URL scheme via <code>xdg-mime</code></div>',e+="</div>",e+='<div class="retold-remote-vlc-setup-note">Requires VLC and Python 3 installed.</div>',e+="</div>",e+="</div>",e}_getMacSetupScript(){return["# Create the AppleScript handler","cat > /tmp/VLCProtocol.applescript << 'EOF'","on open location theURL","\tset theURL to text 7 thru -1 of theURL","\tset theURL to do shell script \"python3 -c 'import sys, urllib.parse; print(urllib.parse.unquote(sys.argv[1]))' \" & quoted form of theURL",'\tdo shell script "open -a VLC " & quoted form of theURL',"end open location","EOF","","# Compile into app bundle","osacompile -o /Applications/VLCProtocol.app /tmp/VLCProtocol.applescript","","# Add vlc:// URL scheme to Info.plist",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes array" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes:0 dict" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null","/usr/libexec/PlistBuddy -c \"Add :CFBundleURLTypes:0:CFBundleURLName string 'VLC Protocol'\" \\"," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes:0:CFBundleURLSchemes array" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null",'/usr/libexec/PlistBuddy -c "Add :CFBundleURLTypes:0:CFBundleURLSchemes:0 string vlc" \\'," /Applications/VLCProtocol.app/Contents/Info.plist 2>/dev/null","","# Register with Launch Services","/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister \\"," -f /Applications/VLCProtocol.app","",'echo "VLC protocol handler installed successfully."'].join("\n")}_getWindowsRegFile(){return["Windows Registry Editor Version 5.00","","[HKEY_CLASSES_ROOT\\vlc]",'@="URL:VLC Protocol"','"URL Protocol"=""',"","[HKEY_CLASSES_ROOT\\vlc\\shell]","","[HKEY_CLASSES_ROOT\\vlc\\shell\\open]","","[HKEY_CLASSES_ROOT\\vlc\\shell\\open\\command]","@=\"powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -Command \\\"$u='%1'; if($u.StartsWith('vlc://')){$u=$u.Substring(6)}; $u=[System.Uri]::UnescapeDataString($u); $u=$u.TrimEnd('/'); Start-Process -FilePath 'C:\\\\Program Files\\\\VideoLAN\\\\VLC\\\\vlc.exe' -ArgumentList $u\\\"\""].join("\n")}_getWindowsBatchScript(){return["@echo off","REM VLC Protocol Handler Setup for Windows","REM Run this as Administrator","","REM Create the handler directory",'mkdir "%APPDATA%\\VLCProtocol" 2>nul',"","REM Write the PowerShell handler script","(","echo $url = $args[0]","echo if ^($url -and $url.StartsWith^('vlc://'^)^) { $url = $url.Substring^(6^) }","echo $url = [System.Uri]::UnescapeDataString^($url^)","echo $url = $url.TrimEnd^('/'^)","echo if ^($url^) { Start-Process 'C:\\Program Files\\VideoLAN\\VLC\\vlc.exe' -ArgumentList $url }",') > "%APPDATA%\\VLCProtocol\\handler.ps1"',"","REM Register the protocol in the registry",'reg add "HKCU\\Software\\Classes\\vlc" /ve /d "URL:VLC Protocol" /f','reg add "HKCU\\Software\\Classes\\vlc" /v "URL Protocol" /d "" /f','reg add "HKCU\\Software\\Classes\\vlc\\shell\\open\\command" /ve /d "powershell.exe -NoProfile -WindowStyle Hidden -ExecutionPolicy Bypass -File \\"%APPDATA%\\VLCProtocol\\handler.ps1\\" \\"%%1\\"" /f',"","echo VLC protocol handler installed successfully.","pause"].join("\n")}_getLinuxSetupScript(){return["# Create handler script","mkdir -p ~/.local/bin","cat > ~/.local/bin/vlc-protocol << 'EOF'","#!/bin/bash",'URL="$1"','URL="${URL#vlc://}"','URL=$(python3 -c "import sys, urllib.parse; print(urllib.parse.unquote(sys.argv[1]))" "$URL")','exec vlc "$URL" &',"EOF","chmod +x ~/.local/bin/vlc-protocol","","# Create .desktop file","cat > ~/.local/share/applications/vlc-protocol.desktop << 'EOF'","[Desktop Entry]","Name=VLC Protocol Handler","Exec=bash -c '~/.local/bin/vlc-protocol %u'","Type=Application","NoDisplay=true","MimeType=x-scheme-handler/vlc;","EOF","","# Register the handler","xdg-mime default vlc-protocol.desktop x-scheme-handler/vlc","update-desktop-database ~/.local/share/applications/","",'echo "VLC protocol handler installed successfully."'].join("\n")}_copyToClipboard(t,e){navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(t).then(()=>{this.pict.providers["RetoldRemote-ToastNotification"].showToast(e+" copied to clipboard")}).catch(()=>{this._fallbackCopy(t,e)}):this._fallbackCopy(t,e)}_fallbackCopy(t,e){let i=document.createElement("textarea");i.value=t,i.style.position="fixed",i.style.left="-9999px",document.body.appendChild(i),i.select();try{document.execCommand("copy"),this.pict.providers["RetoldRemote-ToastNotification"].showToast(e+" copied to clipboard")}catch(t){this.pict.providers["RetoldRemote-ToastNotification"].showToast("Failed to copy - please select and copy manually")}document.body.removeChild(i)}copyMacSetup(){this._copyToClipboard(this._getMacSetupScript(),"macOS setup script")}copyWindowsReg(){this._copyToClipboard(this._getWindowsRegFile(),"Registry file")}copyWindowsBatch(){this._copyToClipboard(this._getWindowsBatchScript(),"Batch script")}copyLinuxSetup(){this._copyToClipboard(this._getLinuxSetupScript(),"Linux setup script")}testProtocol(){let t=/Windows/.test(navigator.userAgent),e=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent),i="https://www.sample-videos.com/video321/mp4/720/big_buck_bunny_720p_1mb.mp4",n=t||e?"vlc://"+i:"vlc://"+encodeURIComponent(i),o=document.createElement("a");o.href=n,o.style.display="none",document.body.appendChild(o),o.click(),document.body.removeChild(o)}}r.default_configuration=o,e.exports=r},{"pict-view":102}],168:[function(t,e,i){const n=t("pict-view"),o=t("./VideoExplorer-Selection"),r=t("./VideoExplorer-CustomFrames"),a=t("./VideoExplorer-Preview"),s={ViewIdentifier:"RetoldRemote-VideoExplorer",DefaultRenderable:"RetoldRemote-VideoExplorer",DefaultDestinationAddress:"#RetoldRemote-Viewer-Container",AutoRender:!1,CSS:""};class l extends n{constructor(t,e,i){super(t,e,i),this._currentPath="",this._frameData=null,this._selectedFrameIndex=-1,this._frameCount=20,this._fullResFrames=!0,this._customFrames=[],this._selectionModeActive=!1,this._selectionStartTime=-1,this._selectionEndTime=-1,this._isSelectingRange=!1,this._isDraggingTimeline=!1,this._draggingHandle=null,this._fmt=null,this._provider=null}_getFmt(){return this._fmt||(this._fmt=this.pict.providers["RetoldRemote-FormattingUtilities"]),this._fmt}_getProvider(){return this._provider||(this._provider=this.pict.providers["RetoldRemote-Provider"]),this._provider}_buildFrameURL(t,e){return"/api/media/video-frame/"+encodeURIComponent(t)+"/"+encodeURIComponent(e)}_getPathParam(t){let e=this._getProvider();return e?e._getPathParam(t):encodeURIComponent(t)}_getClientX(t){return t.touches&&t.touches.length>0?t.touches[0].clientX:t.changedTouches&&t.changedTouches.length>0?t.changedTouches[0].clientX:"number"==typeof t.clientX?t.clientX:null}_getTimelineTimestamp(t){let e=document.getElementById("RetoldRemote-VEX-TimelineBar");if(!e||!this._frameData||!this._frameData.Duration)return 0;let i=e.getBoundingClientRect(),n=this._getClientX(t);return null===n?0:Math.max(0,Math.min(1,(n-i.left)/i.width))*this._frameData.Duration}saveSelectionToCollection(){if(this._selectionStartTime<0||this._selectionEndTime<0)return;let t=Math.min(this._selectionStartTime,this._selectionEndTime),e=Math.max(this._selectionStartTime,this._selectionEndTime),i=this.pict.providers["RetoldRemote-CollectionManager"];if(!i)return;let n=i.getQuickAddTargetGUID();if(n)i.addVideoClipToCollection(n,t,e);else{i.setPendingClipContext({Type:"video-clip",Start:t,End:e});let n=this.pict.views["ContentEditor-TopBar"];n&&"function"==typeof n.showAddToCollectionDropdown&&n.showAddToCollectionDropdown()}}showExplorer(t,e,i){let n=this.pict.AppData.RetoldRemote;n.ActiveMode="video-explorer",n.CurrentViewerFile=t,n.CurrentViewerMediaType="video",this._currentPath=t;let o=this.pict.views["ContentEditor-Layout"];o&&"function"==typeof o.notifyCurrentFileChanged&&o.notifyCurrentFileChanged(t),this._frameData=null,this._selectedFrameIndex=-1,this._customFrames=[],this._selectionModeActive=!1,this._isSelectingRange=!1,this._isDraggingTimeline=!1,this._draggingHandle=null,"number"==typeof e&&e>=0&&"number"==typeof i&&i>=0?(this._selectionStartTime=e,this._selectionEndTime=i,this._selectionFromCaller=!0):(this._selectionStartTime=-1,this._selectionEndTime=-1,this._selectionFromCaller=!1),this._cleanupWindowListeners();let r=this._getProvider(),a="#/explore/"+(r?r.getFragmentIdentifier(t):t);0===(window.location.hash||"").indexOf("#/view/")?history.replaceState(null,"",a):window.location.hash=a;let s=document.getElementById("RetoldRemote-Gallery-Container"),l=document.getElementById("RetoldRemote-Viewer-Container");s&&(s.style.display="none"),l&&(l.style.display="block");let d=t.replace(/^.*\//,""),c='<div class="retold-remote-vex">',p=n.ServerCapabilities||{};c+='<div class="retold-remote-vex-header">',c+='<button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].goBack()" title="Back (Esc)">← Back</button>',c+='<div class="retold-remote-vex-title">Video Explorer — '+this._getFmt().escapeHTML(d)+"</div>",c+='<div class="retold-remote-vex-actions">',c+='<button class="retold-remote-vex-action-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].playInBrowser()" title="Play in browser (Space)">▶ Play</button>',c+='<button class="retold-remote-vex-action-btn" onclick="pict.providers[\'RetoldRemote-GalleryNavigation\']._streamWithVLC()" title="Stream with VLC (v)">▶ VLC</button>',(p.ffmpeg||p.ffprobe)&&(c+='<button class="retold-remote-vex-action-btn" onclick="pict.views[\'RetoldRemote-AudioExplorer\'].showExplorer(pict.views[\'RetoldRemote-VideoExplorer\']._currentPath)" title="Explore audio track">♫ Audio</button>'),c+="</div>",c+="</div>",c+='<div class="retold-remote-vex-info" id="RetoldRemote-VEX-Info" style="display:none;"></div>',c+='<div class="retold-remote-vex-controls" id="RetoldRemote-VEX-Controls" style="display:none;">',c+="<label>Frames:</label>",c+='<select id="RetoldRemote-VEX-FrameCount" onchange="pict.views[\'RetoldRemote-VideoExplorer\'].onFrameCountChange(this.value)">',c+='<option value="10"'+(10===this._frameCount?" selected":"")+">10</option>",c+='<option value="20"'+(20===this._frameCount?" selected":"")+">20</option>",c+='<option value="40"'+(40===this._frameCount?" selected":"")+">40</option>",c+='<option value="60"'+(60===this._frameCount?" selected":"")+">60</option>",c+='<option value="100"'+(100===this._frameCount?" selected":"")+">100</option>",c+="</select>",c+='<label style="display:inline-flex;align-items:center;gap:4px;cursor:pointer;">',c+='<input type="checkbox" id="RetoldRemote-VEX-FullRes"'+(this._fullResFrames?" checked":"")+" onchange=\"pict.views['RetoldRemote-VideoExplorer'].onFullResChange(this.checked)\">",c+="Full Res Frames</label>",c+='<button class="retold-remote-vex-refresh-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].refresh()">Refresh</button>',c+='<span style="border-left:1px solid var(--retold-border);height:20px;margin:0 4px;"></span>',c+='<button class="retold-remote-vex-select-btn" id="RetoldRemote-VEX-SelectBtn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].toggleSelectionMode()">Select Range</button>',c+='<span class="retold-remote-vex-selection-info" id="RetoldRemote-VEX-SelectionInfo" style="display:none;"></span>',c+='<button class="retold-remote-vex-clear-btn" id="RetoldRemote-VEX-ClearBtn" style="display:none;" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].clearSelection()">Clear</button>',c+='<span id="RetoldRemote-VEX-GenerateControls" style="display:none;">',c+='<span style="border-left:1px solid var(--retold-border);height:20px;margin:0 2px;"></span>',c+='<select class="retold-remote-vex-range-frame-select" id="RetoldRemote-VEX-RangeFrameCount">',c+='<option value="3">3</option>',c+='<option value="5" selected>5</option>',c+='<option value="10">10</option>',c+='<option value="20">20</option>',c+="</select>",c+='<button class="retold-remote-vex-generate-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].generateSelectionFrames()">Generate Frames</button>',c+='<span style="border-left:1px solid var(--retold-border);height:20px;margin:0 2px;"></span>',c+='<button class="retold-remote-vex-save-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].saveSelectionToCollection()" title="Save segment to collection (s)">Save Segment</button>',c+="</span>",c+="</div>",c+='<div class="retold-remote-vex-body" id="RetoldRemote-VEX-Body">',c+='<div class="retold-remote-vex-loading">',c+='<div class="retold-remote-vex-loading-spinner"></div>',c+="Extracting frames from video...",c+="</div>",c+="</div>",c+='<div class="retold-remote-vex-timeline" id="RetoldRemote-VEX-Timeline" style="display:none;"></div>',c+="</div>",l&&(l.innerHTML=c);let h=this.pict.views["ContentEditor-TopBar"];h&&h.updateInfo(),this._fetchFrames(t)}_fetchFrames(t){let e=this,i="/api/media/video-frames?path="+this._getPathParam(t)+"&count="+this._frameCount;this._fullResFrames&&(i+="&width=1920&height=1080"),this._cancelActiveOperation();let n=this.pict.providers["RetoldRemote-OperationStatus"],o=n?n.startOperation({Label:"Extracting video frames",Phase:"Starting…",Cancelable:!0}):null;o&&(this._activeOperationId=o.OperationId,this._activeAbortController=o.AbortController);let r={};o&&o.AbortController&&(r.signal=o.AbortController.signal),o&&(r.headers={"X-Op-Id":o.OperationId}),fetch(i,r).then(t=>t.json()).then(t=>{if(!t||!t.Success)return o&&n&&n.errorOperation(o.OperationId,{message:t?t.Error:"Unknown error"}),void e._showError(t?t.Error:"Unknown error");o&&n&&n.completeOperation(o.OperationId),e._activeOperationId=null,e._activeAbortController=null,e._frameData=t,e._renderFrames(),e._loadSavedCustomFrames()}).catch(t=>{t&&"AbortError"===t.name||(o&&n&&n.errorOperation(o.OperationId,t),e._showError(t.message))})}_cancelActiveOperation(){if(this._activeAbortController)try{this._activeAbortController.abort()}catch(t){}let t=this.pict.providers["RetoldRemote-OperationStatus"];this._activeOperationId&&t&&t.cancelOperation(this._activeOperationId),this._activeOperationId=null,this._activeAbortController=null}_renderFrames(){let t=this._frameData;if(!t)return;let e=document.getElementById("RetoldRemote-VEX-Info");if(e){let i="";i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Duration</span> <span class="retold-remote-vex-info-value">'+this._getFmt().escapeHTML(t.DurationFormatted)+"</span></span>",t.VideoWidth&&t.VideoHeight&&(i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Resolution</span> <span class="retold-remote-vex-info-value">'+t.VideoWidth+"×"+t.VideoHeight+"</span></span>"),t.Codec&&(i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Codec</span> <span class="retold-remote-vex-info-value">'+this._getFmt().escapeHTML(t.Codec)+"</span></span>"),t.FileSize&&(i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Size</span> <span class="retold-remote-vex-info-value">'+this._getFmt().formatFileSize(t.FileSize)+"</span></span>"),i+='<span class="retold-remote-vex-info-item"><span class="retold-remote-vex-info-label">Frames</span> <span class="retold-remote-vex-info-value">'+t.FrameCount+"</span></span>",e.innerHTML=i,e.style.display=""}let i=document.getElementById("RetoldRemote-VEX-Controls");i&&(i.style.display="");let n=document.getElementById("RetoldRemote-VEX-Body");if(n){let e='<div class="retold-remote-vex-grid">';for(let i=0;i<t.Frames.length;i++){let n=t.Frames[i];e+='<div class="retold-remote-vex-frame" id="retold-vex-frame-'+i+"\" onclick=\"pict.views['RetoldRemote-VideoExplorer'].selectFrame("+i+")\" ondblclick=\"pict.views['RetoldRemote-VideoExplorer'].openFrameFullsize("+i+')">',e+='<img src="'+this._buildFrameURL(t.CacheKey,n.Filename)+'" alt="Frame at '+this._getFmt().escapeHTML(n.TimestampFormatted)+'" loading="lazy">',e+='<div class="retold-remote-vex-frame-info">',e+='<span class="retold-remote-vex-frame-timestamp">'+this._getFmt().escapeHTML(n.TimestampFormatted)+"</span>",e+='<span class="retold-remote-vex-frame-index">#'+(n.Index+1)+"</span>",e+="</div>",e+="</div>"}e+="</div>",n.innerHTML=e}this._renderTimeline()}_renderTimeline(){let t=this._frameData;if(!t||!t.Duration)return;let e=document.getElementById("RetoldRemote-VEX-Timeline");if(!e)return;let i="";i+='<span class="retold-remote-vex-timeline-label">0:00</span>',i+='<div class="retold-remote-vex-timeline-column">',i+='<div class="retold-remote-vex-slider-track" id="RetoldRemote-VEX-SliderTrack"></div>',i+='<div class="retold-remote-vex-timeline-bar" id="RetoldRemote-VEX-TimelineBar">';for(let e=0;e<t.Frames.length;e++){let n=t.Frames[e],o=n.Timestamp/t.Duration*100;i+='<div class="retold-remote-vex-timeline-marker'+(e===this._selectedFrameIndex?" selected":"")+'" style="left:'+o.toFixed(2)+'%;" data-frame-index="'+e+'" title="'+this._getFmt().escapeHTML(n.TimestampFormatted)+'"></div>'}if(this._customFrames)for(let e=0;e<this._customFrames.length;e++){let n=this._customFrames[e];i+='<div class="retold-remote-vex-timeline-marker custom" style="left:'+(n.Timestamp/t.Duration*100).toFixed(2)+'%;" title="'+this._getFmt().escapeHTML(n.TimestampFormatted)+'"></div>'}i+="</div>",i+="</div>",i+='<span class="retold-remote-vex-timeline-label">'+this._getFmt().escapeHTML(t.DurationFormatted)+"</span>",e.innerHTML=i,e.style.display="";let n=this,o=document.getElementById("RetoldRemote-VEX-TimelineBar");o&&(o.addEventListener("click",t=>{let e=t.target.closest(".retold-remote-vex-timeline-marker");if(e&&void 0!==e.dataset.frameIndex)return t.stopPropagation(),void n.selectFrame(parseInt(e.dataset.frameIndex,10));n._selectionModeActive||n.onTimelineClick(t)}),o.addEventListener("mousedown",t=>{0===t.button&&n._onSelectionDragStart(t)}),o.addEventListener("mousemove",t=>{n._onSelectionDragMove(t)}),o.addEventListener("touchstart",t=>{n._onSelectionDragStart(t)},{passive:!1}),o.addEventListener("touchmove",t=>{n._onSelectionDragMove(t)},{passive:!1}),n._cleanupWindowListeners(),n._boundDragEnd=t=>{n._onSelectionDragEnd(t)},window.addEventListener("mouseup",n._boundDragEnd),window.addEventListener("touchend",n._boundDragEnd),n._selectionModeActive&&o.classList.add("selecting")),this._renderSelectionOverlay(),this._renderSliderHandles(),this._updateSelectionInfo(),this._bindSliderHandleDrag()}selectFrame(t){if(this._selectedFrameIndex>=0){let t=document.getElementById("retold-vex-frame-"+this._selectedFrameIndex);t&&t.classList.remove("selected")}this._selectedFrameIndex=t;let e=document.getElementById("retold-vex-frame-"+t);e&&(e.classList.add("selected"),e.scrollIntoView({behavior:"smooth",block:"nearest"})),this._updateTimelineSelection()}_updateTimelineSelection(){let t=document.getElementById("RetoldRemote-VEX-TimelineBar");if(!t)return;let e=t.querySelectorAll(".retold-remote-vex-timeline-marker");for(let t=0;t<e.length;t++)t===this._selectedFrameIndex?e[t].classList.add("selected"):e[t].classList.remove("selected")}onFrameCountChange(t){this._frameCount=parseInt(t,10)||20,this.refresh()}onFullResChange(t){this._fullResFrames=t,this.refresh()}refresh(){let t=document.getElementById("RetoldRemote-VEX-Body");t&&(t.innerHTML='<div class="retold-remote-vex-loading"><div class="retold-remote-vex-loading-spinner"></div>Extracting frames from video...</div>');let e=document.getElementById("RetoldRemote-VEX-Timeline");e&&(e.style.display="none"),this._selectedFrameIndex=-1,this._customFrames=[],this._fetchFrames(this._currentPath)}goBack(){this._cancelActiveOperation(),this._cleanupWindowListeners();let t=this.pict.providers["RetoldRemote-GalleryNavigation"];t&&t.closeViewer()}playInBrowser(){this._cancelActiveOperation(),this._cleanupWindowListeners();let t=this.pict.views["RetoldRemote-MediaViewer"];t&&(t.showMedia(this._currentPath,"video"),t.playVideo())}_showError(t){let e=document.getElementById("RetoldRemote-VEX-Body");e&&(e.innerHTML='<div class="retold-remote-vex-error"><div class="retold-remote-vex-error-message">'+this._getFmt().escapeHTML(t||"An error occurred.")+'</div><button class="retold-remote-vex-nav-btn" onclick="pict.views[\'RetoldRemote-VideoExplorer\'].goBack()">Back to Video</button></div>')}}Object.assign(l.prototype,o),Object.assign(l.prototype,r),Object.assign(l.prototype,a),l.default_configuration=s,e.exports=l},{"./VideoExplorer-CustomFrames":169,"./VideoExplorer-Preview":170,"./VideoExplorer-Selection":171,"pict-view":102}],169:[function(t,e,i){
|
|
258
258
|
/**
|
|
259
259
|
* VideoExplorer — Custom Frames Mixin
|
|
260
260
|
*
|